Skip to content

Customers API

Access customer data from your store.

List Customers

http
GET /api/external/v1/customers

Query Parameters

ParameterTypeDescription
pageintegerPage number (default: 1)
per_pageintegerItems per page (default: 15, max: 100)
searchstringSearch by email or username
sortstringSort field: created_at, total_spent
orderstringSort order: asc, desc

Example Request

bash
curl -X GET "https://yourstore.pixlpay.net/api/external/v1/customers?search=player" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"

Response

json
{
  "success": true,
  "data": [
    {
      "id": 1,
      "email": "player@example.com",
      "username": "Player123",
      "discord_id": "123456789",
      "discord_username": "Player#1234",
      "total_orders": 5,
      "total_spent": "149.95",
      "first_order_at": "2025-01-10T10:00:00Z",
      "last_order_at": "2025-01-20T14:30:00Z",
      "created_at": "2025-01-10T10:00:00Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 5,
    "per_page": 15,
    "total": 72
  }
}

Get Single Customer

http
GET /api/external/v1/customers/{id}

Example Request

bash
curl -X GET "https://yourstore.pixlpay.net/api/external/v1/customers/1" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"

Response

json
{
  "success": true,
  "data": {
    "id": 1,
    "email": "player@example.com",
    "username": "Player123",
    "discord_id": "123456789",
    "discord_username": "Player#1234",
    "game_usernames": {
      "minecraft": "Player123",
      "steam_id": "76561198012345678"
    },
    "total_orders": 5,
    "total_spent": "149.95",
    "subscriptions": [
      {
        "id": 1,
        "product_name": "VIP Monthly",
        "status": "active",
        "current_period_end": "2025-02-10T10:00:00Z"
      }
    ],
    "first_order_at": "2025-01-10T10:00:00Z",
    "last_order_at": "2025-01-20T14:30:00Z",
    "created_at": "2025-01-10T10:00:00Z"
  }
}

Get Customer Orders

http
GET /api/external/v1/customers/{id}/orders

Returns all orders for a specific customer.

Example Request

bash
curl -X GET "https://yourstore.pixlpay.net/api/external/v1/customers/1/orders" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"

Customer Object

FieldTypeDescription
idintegerUnique identifier
emailstringCustomer email
usernamestringDisplay username
discord_idstringDiscord user ID (if connected)
discord_usernamestringDiscord username (if connected)
game_usernamesobjectGame platform usernames
total_ordersintegerNumber of orders
total_spentstringTotal amount spent
subscriptionsarrayActive subscriptions
first_order_atstringFirst order timestamp
last_order_atstringLast order timestamp
created_atstringAccount creation timestamp

Errors

StatusErrorDescription
401UnauthorizedInvalid or missing token
403ForbiddenToken lacks customers:read scope
404Not FoundCustomer doesn't exist

Built for game developers, by game developers.