Customers API
Access customer data from your store.
List Customers
http
GET /api/external/v1/customersQuery Parameters
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number (default: 1) |
per_page | integer | Items per page (default: 15, max: 100) |
search | string | Search by email or username |
sort | string | Sort field: created_at, total_spent |
order | string | Sort 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}/ordersReturns 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
| Field | Type | Description |
|---|---|---|
id | integer | Unique identifier |
email | string | Customer email |
username | string | Display username |
discord_id | string | Discord user ID (if connected) |
discord_username | string | Discord username (if connected) |
game_usernames | object | Game platform usernames |
total_orders | integer | Number of orders |
total_spent | string | Total amount spent |
subscriptions | array | Active subscriptions |
first_order_at | string | First order timestamp |
last_order_at | string | Last order timestamp |
created_at | string | Account creation timestamp |
Errors
| Status | Error | Description |
|---|---|---|
| 401 | Unauthorized | Invalid or missing token |
| 403 | Forbidden | Token lacks customers:read scope |
| 404 | Not Found | Customer doesn't exist |
