Skip to main content

Overview

The Customers API provides endpoints for managing third-party customer accounts, including creating new customers, retrieving customer information, and checking tier status.

Authentication

All endpoints require API key authentication via the x-api-key header.

Endpoints

Create Customer

Create a new customer account.
    Response (201 Created):
    {
      "id": "cust_123456789",
      "name": "John Doe",
      "email": "[email protected]",
      "phone": "+1234567890",
      "tier": "basic",
      "createdAt": "2023-01-01T00:00:00.000Z",
      "updatedAt": "2023-01-01T00:00:00.000Z"
    }
    

    Get All Customers

    Retrieve a list of all customers.
      Response (200 OK):
      [
        {
          "id": "cust_123456789",
          "name": "John Doe",
          "email": "[email protected]",
          "phone": "+1234567890",
          "tier": "basic",
          "createdAt": "2023-01-01T00:00:00.000Z",
          "updatedAt": "2023-01-01T00:00:00.000Z"
        }
      ]
      

      Get Customer by ID

      Retrieve a specific customer by their ID.
        Response (200 OK):
        {
          "id": "cust_123456789",
          "name": "John Doe",
          "email": "[email protected]",
          "phone": "+1234567890",
          "tier": "basic",
          "createdAt": "2023-01-01T00:00:00.000Z",
          "updatedAt": "2023-01-01T00:00:00.000Z"
        }
        

        Get Customer Tier Status

        Retrieve the tier status and limits for a specific customer.
          Response (200 OK):
          {
            "tier": "basic",
            "limits": {
              "maxTransactions": 100,
              "maxAmount": 10000
            },
            "status": "active"
          }
          

          Error Responses

          400 Bad Request

          {
            "error": 400,
            "message": "Validation failed"
          }
          

          401 Unauthorized

          {
            "error": 401,
            "message": "Invalid API key"
          }
          

          404 Not Found

          {
            "error": 404,
            "message": "Customer not found"
          }
          

          Customer Tiers

          • Basic: Standard tier with basic limits
          • Premium: Enhanced features and higher limits
          • Enterprise: Custom solutions and maximum limits

          Rate Limits

          • Maximum 100 requests per minute per API key
          • Burst limit of 20 requests per second

          Webhooks

          Customer-related events are available via webhooks:
          • customer.created: Triggered when a new customer is created
          • customer.updated: Triggered when customer information is updated
          • customer.tier_changed: Triggered when customer tier is modified