API reference

Place an order

POST
/v1/storefront/orders

Places an order as the online store’s checkout does: for pickup or delivery, paid now by link (payUrl) when the shop takes online payment, else at pickup or on delivery.

Authorization

publishableKey
headerAuthorizationBearer <pk_live_…>

The shop’s publishable key, from Settings, Developers in Cashiar. Safe to use in a browser.

Header Parameters

idempotency-key*string
Idempotency-Key?string

Any unique string (8–100 letters, digits, - or _). A retry with the same key gets the first answer instead of placing it twice.

Request Body

application/json
  1. body
customerName*string
Length1 <= length <= 120
customerPhone*string
deliverTo?|
Lengthlength <= 300
deliveryZone?string
Lengthlength <= 60
lines*array<>
Items1 <= items <= 50
note?|
Lengthlength <= 500
fulfilment*string
Value in"pickup""delivery"
payNow?boolean
Defaultfalse

Response Body

application/json
  1. response
id*string
number*string
total*number
payUrl*string|null
waiting*boolean
trackUrl*string|null
Example Request
curl -X POST 'https://api.cashiar.app/v1/storefront/orders' \  -H 'idempotency-key: string' \  -H 'Content-Type: application/json' \  -d '{  "customerName": "string",  "customerPhone": "string",  "lines": [    {      "variantId": "d53feca7-c65b-4741-aca7-827a42d686bf",      "quantity": 0    }  ],  "fulfilment": "pickup"}'
Example Response201
{  "id": "string",  "number": "string",  "total": 0,  "payUrl": "string",  "waiting": true,  "trackUrl": "string"}