← Documentation home
POST
/hyax-api/v1/ordersCreate order
CORS-enabled. Use `Authorization: Bearer hx_…` or pass `teamId` in the JSON body (for embedded scripts). Deduplicates by `orderId` if provided. Defaults `source` to `MANUAL` with API key auth, `EXTERNAL` otherwise.
Base URL: https://platform.hyax.com · Replace YOUR_API_KEY with your team API key.
Request body
| Field | Required | Description |
|---|---|---|
| Yes | Person email; creates person if new | |
| amount | Yes | Number |
| currency | No | Default `USD` |
| name | No | Customer name (used when creating person) |
| orderId | No | External order ID (dedup key) |
| source | No | Payment platform label (default `MANUAL` with API key, `EXTERNAL` otherwise) |
| notes | No | |
| items | No | Array of line item objects |
| visitorId | No | Cookie ID for analytics attribution |
| ip | No | Override inferred client IP |
| teamId | No | Required if no API key |
Request examples
Same request in cURL, Node.js (fetch), and PHP (ext-curl).
curl -X POST 'https://platform.hyax.com/hyax-api/v1/orders' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"email": "[email protected]",
"amount": 49.99,
"currency": "USD",
"name": "Jane Smith",
"orderId": "pi_3abc123def456",
"source": "STRIPE",
"notes": "Purchased via checkout",
"items": [
{
"name": "E-book",
"quantity": 1,
"price": 49.99
}
],
"visitorId": "hyax_vid_abc123",
"ip": "203.0.113.42"
}'Example response
Shape varies by data; values are illustrative.
{
"success": true,
"data": {
"id": "clx…",
"orderNumber": "ORD-abc12345",
"amount": 49.99,
"currency": "USD",
"paymentStatus": "PAID",
"peopleId": "clx…",
"isNew": true,
"createdAt": "2025-01-15T12:00:00.000Z"
}
}