← Documentation home
POST/hyax-api/v1/orders

Create 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

FieldRequiredDescription
emailYesPerson email; creates person if new
amountYesNumber
currencyNoDefault `USD`
nameNoCustomer name (used when creating person)
orderIdNoExternal order ID (dedup key)
sourceNoPayment platform label (default `MANUAL` with API key, `EXTERNAL` otherwise)
notesNo
itemsNoArray of line item objects
visitorIdNoCookie ID for analytics attribution
ipNoOverride inferred client IP
isTestNoMark as test order (default `false`). Test orders are excluded from LTV and dashboard stats.
teamIdNoRequired 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",
    "isTest": false
  }'

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…",
    "isTest": false,
    "isNew": true,
    "createdAt": "2025-01-15T12:00:00.000Z"
  }
}