Skip to content
API referenceAPI v1admin-sdk 1.1.52Search docs⌘K
Orders · Create an order
API reference / Orders

Create an order

POST/api/v1/ordersorders:write

Creates an order for the merchant and returns the links the customer pays with. The order stays pending until the payment completes; listen for orders.paid.

Body

reference_idstringrequired

Your own ID for the order, unique for the merchant. You'll see it on the merchant's dashboard and in webhooks.

totalnumberrequired

What the customer pays for the items, in the currency's major unit: 2500 is J$2,500.00. At least J$150.00 or US$1.00.

kindstringrequired

What sort of order this is.

onlinecartsubscriptioninvoiceoffline
customerobjectrequired

Who is paying. Matched to an existing customer by email.

emailstringrequired

Receipts go here.

first_namestring

First name.

last_namestring

Last name.

phonestring

With country code.

currency_codestring

JMD or USD.

titlestring

Shown on the payment page and receipt.

productsarray

Line items, each with a product id and quantity. Leave out for a single amount.

discount_codestring

Inkress checks the code and re-prices the order itself. A discount amount you send is never trusted.

fulfillment_totalnumber

Delivery or shipping charged on top of total.

meta_dataobject

Extra settings for this order.

return_urlstring

Where the customer goes after paying.

dataobject

Order details such as a shipping address. Keys Inkress doesn't accept return 422.

Headers

Authorizationheaderrequired

Bearer with your secret key, or the merchant's OAuth token.

Idempotency-Keyheader

For apps. The same key and body within 24 hours return the first response instead of a second order. Idempotent requests.

Returns

The order, with payment_urls.payment_url for a redirect, short_link to share, qr_url for a QR code, and invoice_url.

statusMeaning
1pending: waiting for the customer to pay.
2error: the payment failed.
3paid: orders.paid has been sent.

Errors

401Missing or wrong key, or the token doesn't have orders:write.
422A required field is missing, the reference_id was used before (Reference ID already exists.), the total is under the minimum, the business isn't verified, or a transaction limit is reached. result.reason says which.