Cart and checkout

Turn a cart into an order, for pickup or delivery, paid now or later.

POST/v1/storefront/orders

Before checkout

Read GET /shop to build the checkout:

FieldWhat it decides
pickupOffer Pickup at the branch (branch.name, branch.address).
deliveryOffer Delivery when it isn't null: fee is the usual fee, zones places with their own.
payOnlineOffer Pay now (mobile money, card, bank) through a payment link.
payFirstEvery order must be paid now: hide pay at pickup or on delivery.
closedUntil, closedOrdersClosed now: closedUntil says when it opens ("tomorrow at 8:00 am"). With closedOrders: "take" orders are made when it opens; with refuse none are taken.

Placing the order

curl https://api.cashiar.app/v1/storefront/orders \
  -H "Authorization: Bearer pk_live_your_key" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 0b8c7e91-checkout-1" \
  -d '{
    "customerName": "Kojo Mensah",
    "customerPhone": "024 555 0199",
    "fulfilment": "delivery",
    "deliverTo": "House 12, Lagoon Rd, Kasoa",
    "deliveryZone": "Kasoa",
    "payNow": true,
    "note": "Call when you arrive",
    "lines": [
      { "variantId": "1db29704-09ee-4aa3-95cc-c424173e6d5a", "quantity": 2 },
      {
        "variantId": "1db29704-09ee-4aa3-95cc-c424173e6d5a",
        "sellingUnitId": "c22d51bf-e219-4175-bc54-7ba351d67e5e",
        "quantity": 1
      }
    ]
  }'

Prop

Type

201 Created
{
  "id": "4490c9f8-31fd-454a-ae02-b74c976d070b",
  "number": "S-0067",
  "total": 36500,
  "payUrl": "https://checkout.paystack.com/…",
  "waiting": false,
  "trackUrl": "https://shop.cashiar.app/track/K7Q2…"
}
FieldMeaning
idKeep it to follow the order.
numberThe order number the shop sees: show it to the customer.
totalWhat the customer pays, with taxes and delivery, in minor units.
payUrlWith payNow: send the customer here to pay. null when they pay at pickup or on delivery.
waitingThe shop accepts orders before making them: say "the shop will confirm your order".
trackUrlFor a delivery: Cashiar's page where the customer follows it.

Paying now

With payNow: true (and the shop's payOnline), redirect the customer to payUrl. They pay by mobile money, card or bank on Paystack's checkout, and the payment lands on the order in Cashiar. Check it with order status: paid grows to total.

Show the total Cashiar answers

Show your cart's sum while the customer shops, but charge and confirm the total the order answers with: it includes the shop's taxes and the delivery fee.

What happens in the shop

The order appears in Cashiar as an open sale from the online store: on the Sales screen and its Orders tab, in the kitchen when the shop has one, and with a rider when it is a delivery. When the shop takes orders as they come, it is made straight away; otherwise staff accept it first. The customer gets the same texts as from the Cashiar store.

On this page