SOTERIA API

Build powerful integrations with Soteria's Partner Loyalty Platform

https://api.soteria.zone

Getting Started

Welcome to the Soteria API! This guide will help you integrate Soteria's Partner Loyalty features into your application.

🔑 Authentication: Currently, the API uses partner_id for identification. API keys are optional and can be added for enhanced security.

Base URL

https://api.soteria.zone

Request Format

All API requests should:

Response Format

All responses are JSON with the following structure:

{
  "success": true,
  "data": { ... },
  "error": null
}

QR Code / Barcode Format

When scanning a member's card, the barcode/QR code contains a JSON string with the following structure:

{
  "user_id": "string (UUID)",
  "card_type": "gold" | "platinum" | "black",
  "member_since": "ISO8601 date string (e.g., 2024-01-01T00:00:00Z)",
  "app": "soteria",
  "version": "1.0"
}

Example QR Code Data:

{"user_id":"1498a4b8-2081-70ef-35f1-9e3856b39837","card_type":"gold","member_since":"2024-01-15T10:30:00Z","app":"soteria","version":"1.0"}

Note: The QR code data is a JSON string that must be passed as-is to the validation endpoint. Do not parse it - send the entire string in the qr_data field.

Member Number Format

As an alternative to QR code scanning, you can use member numbers. Member numbers follow this format:

SOT-XXXXXX

Where XXXXXX is a 6-digit number. Example: SOT-123456

Partner Registration

To integrate with Soteria's Partner Loyalty API, you need a partner_id. Here's how to get started:

Step 1: Contact Soteria

Reach out to our partnerships team to begin the registration process:

📧 Email: partners@soteria.zone
Include your business information, discount details, and technical contact information.

Step 2: Provide Business Information

You'll need to provide:

Step 3: Receive Credentials

Once approved, you'll receive:

Step 4: Start Integration

Use your partner_id in all API requests. See the API Endpoints section below for integration details.

✅ Ready to register? Contact us at partners@soteria.zone to get started!

API Endpoints

POST /soteria/partner/validate-member

Validates a Soteria premium member and returns their eligibility for loyalty benefits.

Request Body

{
  "qr_data": "{\"user_id\":\"user-123\",\"card_type\":\"gold\",\"member_since\":\"2024-01-01T00:00:00Z\"}",
  "partner_id": "partner-acme"
}
Parameter Type Description
qr_data OR string JSON string from scanned QR code/barcode
member_number OR string Member number (e.g., "SOT-123456")
partner_id Required string Your unique partner identifier

Success Response (200)

{
  "success": true,
  "valid": true,
  "member": {
    "user_id": "user-123",
    "card_type": "gold",
    "member_since": "2024-01-01T00:00:00Z",
    "is_premium": true,
    "subscription_status": "active",
    "subscription_type": "monthly"
  },
  "partner": {
    "partner_id": "partner-acme",
    "name": "ACME Coffee",
    "description": "Premium coffee and pastries",
    "discount_percentage": 10,
    "discount_amount": null,
    "discount_type": "percentage",
    "logo_url": "https://...",
    "terms": "Valid on all items. Cannot be combined with other offers."
  }
}

Error Response (403) - Not Premium

When the member does not have an active premium subscription:

{
  "success": true,
  "valid": false,
  "error": "User does not have an active premium subscription",
  "member": {
    "user_id": "user-123",
    "is_premium": false,
    "subscription_status": "expired"
  }
}

Error Response (400) - Invalid Request

When required parameters are missing or invalid:

{
  "success": false,
  "error": "Either qr_data or member_number is required"
}

Error Response (400) - Invalid QR Code Format

When the QR code data is malformed or missing required fields:

{
  "success": false,
  "error": "Invalid QR code format"
}

Error Response (404) - Partner Not Found

When the partner_id is invalid or partner is inactive:

{
  "success": false,
  "error": "Partner not found"
}

Error Response (404) - Member Not Found

When the user_id or member_number doesn't exist:

{
  "success": false,
  "error": "Member not found"
}
POST /soteria/partner/redeem

Records a loyalty benefit redemption for analytics and tracking.

Request Body

{
  "user_id": "user-123",
  "partner_id": "partner-acme",
  "loyalty_amount": 5.00,
  "transaction_id": "txn-456"
}
Parameter Type Description
user_id Required string User ID from validation response
partner_id Required string Your partner ID
loyalty_amount Required number Discount amount applied
transaction_id Optional string Your transaction ID for reference

Success Response (200)

{
  "success": true,
  "redemption_id": "redemption-123",
  "message": "Redemption recorded successfully"
}

Error Response (400) - Invalid Request

When required parameters are missing:

{
  "success": false,
  "error": "user_id, partner_id, and loyalty_amount are required"
}

Error Response (404) - Partner Not Found

When the partner_id is invalid:

{
  "success": false,
  "error": "Partner not found"
}

Error Response (404) - Member Not Found

When the user_id doesn't exist:

{
  "success": false,
  "error": "Member not found"
}
GET /soteria/partner/analytics

Returns redemption statistics and analytics for your partner account.

Query Parameters

Parameter Type Description
partner_id Required string Your partner ID
start_date Optional string ISO 8601 date (e.g., "2026-01-01")
end_date Optional string ISO 8601 date (e.g., "2026-01-31")

Success Response (200)

{
  "success": true,
  "analytics": {
    "total_redemptions": 150,
    "total_discount_amount": 750.00,
    "unique_members": 45,
    "average_discount_per_redemption": 5.00,
    "redemptions_by_day": [
      { "date": "2026-01-01", "count": 5 },
      { "date": "2026-01-02", "count": 8 }
    ],
    "top_members": [
      { "user_id": "user-123", "redemption_count": 12 }
    ]
  }
}

Error Response (400) - Missing Partner ID

When partner_id is not provided:

{
  "success": false,
  "error": "partner_id is required"
}

Error Response (404) - Partner Not Found

When the partner_id is invalid:

{
  "success": false,
  "error": "Partner not found"
}

Error Response (400) - Invalid Date Format

When date parameters are in wrong format:

{
  "success": false,
  "error": "Invalid date format. Use ISO 8601 format (YYYY-MM-DD)"
}
GET /soteria/partner/list

Returns a list of all active partners (for reference).

Query Parameters

Parameter Type Description
category Optional string Filter by category
location Optional string Filter by location

Success Response (200)

{
  "success": true,
  "partners": [
    {
      "partner_id": "partner-acme",
      "name": "ACME Coffee",
      "description": "Premium coffee and pastries",
      "discount_percentage": 10,
      "discount_type": "percentage",
      "category": "Food & Beverage",
      "location": "New York, NY",
      "is_active": true
    }
  ]
}

Error Response (500) - Server Error

When an internal server error occurs:

{
  "success": false,
  "error": "Internal server error"
}

Code Examples

JavaScript (Node.js / Browser)

async function validateMember(qrData, partnerId) {
  const response = await fetch(
    'https://api.soteria.zone/soteria/partner/validate-member',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        qr_data: qrData,
        partner_id: partnerId
      })
    }
  );

  const result = await response.json();
  
  if (result.valid && result.member.is_premium) {
    // Member is valid - apply discount
    const discountPercent = result.partner.discount_percentage;
    return { valid: true, discountPercent };
  }
  
  return { valid: false };
}

Python

import requests

def validate_member(qr_data, partner_id):
    url = 'https://api.soteria.zone/soteria/partner/validate-member'
    
    payload = {
        'qr_data': qr_data,
        'partner_id': partner_id
    }
    
    response = requests.post(url, json=payload)
    result = response.json()
    
    if result.get('valid') and result.get('member', {}).get('is_premium'):
        discount_percent = result.get('partner', {}).get('discount_percentage', 0)
        return {'valid': True, 'discount_percent': discount_percent}
    
    return {'valid': False}

cURL

curl -X POST 'https://api.soteria.zone/soteria/partner/validate-member' \
  -H 'Content-Type: application/json' \
  -d '{
    "qr_data": "{\"user_id\":\"user-123\",\"card_type\":\"gold\",\"member_since\":\"2024-01-01T00:00:00Z\"}",
    "partner_id": "partner-acme"
  }'

Why Soteria API?

🔒 Privacy-First

Real-time validation means no user data sharing. Your customers' privacy is protected.

âš¡ Real-Time

Always accurate. Validates subscription status instantly, no stale data.

🚀 Simple Integration

RESTful API with clear documentation. Get up and running in minutes.

Error Handling

All errors follow a consistent format:

{
  "success": false,
  "error": "Error message describing what went wrong"
}

HTTP Status Codes

Code Description
200 Success
400 Bad Request (invalid parameters)
403 Forbidden (member not eligible, limit reached)
404 Not Found (partner not found)
500 Internal Server Error
💡 Best Practice: Always handle errors gracefully. Don't block checkout if validation fails - show a friendly message instead.

Support & Resources

📧 Email Support

Get help from our team

partners@soteria.zone

📚 Documentation

Complete integration guide

Download PDF Guide

💬 Community

Connect with other developers

Join Discord

✅ Ready to get started? Contact us at partners@soteria.zone to receive your Partner ID and API credentials.