Skip to content

Orders and checkout ​

Create, inspect, or cancel orders and retrieve purchase history or checkout charges. Guest checkout supplies customer details in its request body.

Access labels such as Origin + Brand key + Customer are defined in Headers and access. Each endpoint ends in a Try it console; set the host and keys once in its Settings tab or on the overview.

Get Shopify orders by user ID ​

Fetch the authenticated customer’s Shopify orders, newest first, with cursor pagination.

MethodURL pathRequired access
GET/api/v1/user/shopify/ordersOrigin + Brand key + Customer

Request fields:

FieldTypeRequiredRules / meaning
query.limitnumberoptionalInteger; Minimum (1); Maximum (250); Default (10)
query.cursorstringoptionalAlso accepts ("" , null); Default (null)

limit defaults to 10 and must be an integer from 1 through 250. cursor is an opaque string from the previous page; omit it for the first page. The result also includes limit.

Example:

bash
curl -X GET "$BASE_URL/api/v1/user/shopify/orders?limit=10" \
  -H "Origin: $ORIGIN" \
  -H "api-key: $API_KEY" \
  -H "Authorization: Bearer $CUSTOMER_TOKEN"

Response: JSON with success: true and result containing the operation’s service data.

Source: app/v1/controller/customer_controller.js:1605 → getShopifyOrdersByUserID; routes: routes/v1/customer_route.js:145; service: _getShopifyOrdersByUserID (app/v1/service/customer_service.js:3991).

Cancel order ​

MethodURL pathRequired access
PUT/api/v1/user/order/cancel/:orderIdOrigin + Brand key + Customer

Request fields:

FieldTypeRequiredRules / meaning
path.orderIdnumberyes—

Example:

bash
curl -X PUT "$BASE_URL/api/v1/user/order/cancel/1" \
  -H "Origin: $ORIGIN" \
  -H "api-key: $API_KEY" \
  -H "Authorization: Bearer $CUSTOMER_TOKEN"

Response: JSON with success: true and result containing the operation’s service data.

Source: app/v1/controller/order_controller.js:408 → cancelOrder; routes: routes/v1/order_route.js:142; service: _cancelOrder (app/v1/service/order_service.js:1745).

Create new order ​

MethodURL pathRequired access
POST/api/v1/user/createOrderOrigin + Brand key + Hub selected + Customer

Request fields:

FieldTypeRequiredRules / meaning
body.payloadobjectyes—
body.payload.addressIdnumberoptional—
body.payload.billingAddressIdnumberoptional—
body.payload.governmentIdnumberoptional—
body.payload.deliverySchedulestringoptionalWhitespace trimmed
body.payload.deliveryInstructionstringoptionalWhitespace trimmed
body.payload.posIdstringoptionalWhitespace trimmed; Allowed values ("weedmaps", "phone", "email", "website", "kiosk")
body.payload.discountsarray of stringoptional—
body.payload.deliveryChargesnumberoptional—
body.payload.isPrepaidOrderbooleanoptional—
body.payload.pointsnumberoptionalMinimum (0)
body.payload.methodstringoptionalWhitespace trimmed; Allowed values ("curbside", "doorstep", "pos", "instore", "shipment")

Example:

bash
curl -X POST "$BASE_URL/api/v1/user/createOrder" \
  -H "Origin: $ORIGIN" \
  -H "api-key: $API_KEY" \
  -H "Authorization: Bearer $CUSTOMER_TOKEN" \
  -H 'Content-Type: application/json' \
  --data-raw '{"payload":{}}'

Response: JSON with success: true and result containing the operation’s service data.

Source: app/v1/controller/order_controller.js:24 → createNewOrder; routes: routes/v1/order_route.js:112; service: _newCreateOrder (app/v1/service/order_service.js:49).

Create guest order ​

MethodURL pathRequired access
POST/api/v1/user/create-orderOrigin + Brand key + Hub selected

Request fields:

FieldTypeRequiredRules / meaning
body.payloadobjectyes—
body.payload.customerobjectyesAt least one of ("email" , "phoneNumber" , "userId"); Exactly one of ("userId" , "name")
body.payload.customer.userIdnumberoptional—
body.payload.customer.namestringoptionalWhitespace trimmed
body.payload.customer.passwordstringoptionalWhitespace trimmed; Minimum (8)
body.payload.customer.dateOfBirthdateoptionalISO date
body.payload.customer.emailstringoptionalEmail address; Whitespace trimmed; Converted to lowercase
body.payload.customer.phoneNumberstringoptionalreplace(/\D/g , ""); Whitespace trimmed; Minimum (8)
body.payload.customer.phone_prefixstringconditionalRequired when phoneNumber is supplied; otherwise optional
body.payload.customer.addressobjectoptionalAt least one of ("addressId" , "address1")
body.payload.customer.address.addressIdnumberoptional—
body.payload.customer.address.namestringoptionalWhitespace trimmed
body.payload.customer.address.typestringoptionalWhitespace trimmed; Allowed values ("shipping"); Default ("shipping")
body.payload.customer.address.address1stringoptionalWhitespace trimmed
body.payload.customer.address.countystringoptionalWhitespace trimmed
body.payload.customer.address.citystringoptionalWhitespace trimmed
body.payload.customer.address.statestringoptionalWhitespace trimmed
body.payload.customer.address.short_statestringoptionalWhitespace trimmed
body.payload.customer.address.zipstringoptionalWhitespace trimmed
body.payload.customer.address.countrystringoptionalWhitespace trimmed; Country code from country_iso_codes, for example US or CA
body.payload.customer.address.latLngobjectoptional—
body.payload.customer.address.latLng.latnumberyes—
body.payload.customer.address.latLng.lngnumberyes—
body.payload.customer.address.addressStringstringoptionalWhitespace trimmed
body.payload.customer.billingAddressobjectoptionalAt least one of ("addressId" , "address1")
body.payload.customer.billingAddress.addressIdnumberoptional—
body.payload.customer.billingAddress.namestringoptionalWhitespace trimmed
body.payload.customer.billingAddress.typestringoptionalWhitespace trimmed; Allowed values ("billing"); Default ("billing")
body.payload.customer.billingAddress.address1stringoptionalWhitespace trimmed
body.payload.customer.billingAddress.countystringoptionalWhitespace trimmed
body.payload.customer.billingAddress.citystringoptionalWhitespace trimmed
body.payload.customer.billingAddress.statestringoptionalWhitespace trimmed
body.payload.customer.billingAddress.short_statestringoptionalWhitespace trimmed
body.payload.customer.billingAddress.zipstringoptionalWhitespace trimmed
body.payload.customer.billingAddress.countrystringoptionalWhitespace trimmed; Country code from country_iso_codes, for example US or CA
body.payload.customer.billingAddress.latLngobjectoptional—
body.payload.customer.billingAddress.latLng.latnumberyes—
body.payload.customer.billingAddress.latLng.lngnumberyes—
body.payload.customer.billingAddress.addressStringstringoptionalWhitespace trimmed
body.payload.customer.user_documentsarray of objectoptional—
body.payload.customer.user_documents[].governmentIdstringyes—
body.payload.customer.user_documents[].expirationdateyes—
body.payload.customer.user_documents[].fileNamestringyesWhitespace trimmed
body.payload.customer.user_documents[].typestringyesWhitespace trimmed
body.payload.customer.user_documents[].isValidbooleanyes—
body.payload.bagarray of objectyes—
body.payload.bag[].indexnumberoptional—
body.payload.bag[].hubProductIdnumberyesInteger
body.payload.bag[].isPromotionalbooleanoptional—
body.payload.bag[].quantitynumberyes—
body.payload.bag[].packageIdstringoptionalWhitespace trimmed
body.payload.deliverySchedulestringoptionalWhitespace trimmed
body.payload.deliveryInstructionstringoptionalWhitespace trimmed
body.payload.posIdstringoptionalWhitespace trimmed; Allowed values ("weedmaps", "phone", "email", "website", "kiosk")
body.payload.discountsarray of stringoptional—
body.payload.transporterIdstringoptionalWhitespace trimmed
body.payload.methodstringoptionalWhitespace trimmed; Allowed values ("curbside", "doorstep", "pos", "instore", "shipment")
query.sourcestringoptionalWhitespace trimmed; Allowed values ("organic", "scan", "referral", "promotion", "shopify_plugin", "other")
query.mediumstringoptionalWhitespace trimmed; Allowed values ("ios", "android", "website", "plugin", "other")
query.devicestringoptionalWhitespace trimmed; Allowed values ("mobile", "desktop", "ipad", "tablet", "other", "laptop")

Example:

bash
curl -X POST "$BASE_URL/api/v1/user/create-order" \
  -H "Origin: $ORIGIN" \
  -H "api-key: $API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{"payload":{"customer":{"email":"alex@example.com","userId":1},"bag":[{"hubProductId":1,"quantity":1}]}}'

Response: JSON with success: true and result containing the operation’s service data.

Source: app/v1/controller/order_controller.js:100 → createGuestOrder; routes: routes/v1/order_route.js:102; service: _guestCreateOrder (app/v1/service/order_service.js:155).

Get order by order ID ​

MethodURL pathRequired access
GET/api/v1/user/order/:orderIdOrigin + Customer

No brand key on this route

/api/v1/user/order/:orderId is listed although its route does not check api-key: the shop to order flow calls it. Sending the key anyway is harmless.

Request fields:

FieldTypeRequiredRules / meaning
path.orderIdnumberyes—

Example:

bash
curl -X GET "$BASE_URL/api/v1/user/order/1" \
  -H "Origin: $ORIGIN" \
  -H "Authorization: Bearer $CUSTOMER_TOKEN"

Response: JSON with success: true and result containing the operation’s service data.

Source: app/v1/controller/order_controller.js:316 → getOrderByOrderId; routes: routes/v1/order_route.js:122; service: _getOrderByOrderId (app/v1/service/order_service.js:1175).

Get all orders for customer ​

MethodURL pathRequired access
GET/api/v1/user/ordersOrigin + Customer

No brand key on this route

/api/v1/user/orders is listed although its route does not check api-key: the shop to order flow calls it. Sending the key anyway is harmless.

Request fields:

FieldTypeRequiredRules / meaning
query.withLineItemsbooleanoptionalDefault (false)

Example:

bash
curl -X GET "$BASE_URL/api/v1/user/orders" \
  -H "Origin: $ORIGIN" \
  -H "Authorization: Bearer $CUSTOMER_TOKEN"

Response: JSON with success: true and result containing the operation’s service data. Result fields/details: Order history for the current customer; withLineItems requests line items.

Source: app/v1/controller/order_controller.js:345 → getAllOrdersForCustomer; routes: routes/v1/order_route.js:132; service: _getAllOrdersForUser (app/v1/service/order_service.js:1428).

Get user ordered products ​

List products previously ordered by the current customer, optionally filtered by date and tags.

MethodURL pathRequired access
POST/api/v1/user/ordered-productsOrigin + Brand key + Customer

Request fields:

FieldTypeRequiredRules / meaning
body.payloadobjectoptional—
body.payload.startDatestringoptionalisoDate()
body.payload.endDatestringoptionalisoDate()
body.payload.tagsarray of stringoptional—
body.payload.limitnumberoptionalInteger; Minimum (1); Maximum (100)
body.payload.offsetnumberoptionalInteger; Minimum (0)

Example:

bash
curl -X POST "$BASE_URL/api/v1/user/ordered-products" \
  -H "Origin: $ORIGIN" \
  -H "api-key: $API_KEY" \
  -H "Authorization: Bearer $CUSTOMER_TOKEN" \
  -H 'Content-Type: application/json' \
  --data-raw '{"payload":{"limit":10}}'

Response: JSON with success: true and result containing the operation’s service data. Result fields/details: count, limit, offset, products; each product includes lastOrderedAt, totalQuantity, orderCount.

Source: app/v1/controller/order_controller.js:368 → getUserOrderedProducts; routes: routes/v1/order_route.js:59; service: _getUserOrderedProducts (app/v1/service/order_service.js:1588).

Get taxes and other charges breakup ​

MethodURL pathRequired access
POST/api/v1/taxes-breakupOrigin + Brand key + Hub selected

Request fields:

FieldTypeRequiredRules / meaning
body.payloadobjectyes—
body.payload.priceBeforeTaxesnumberyes—
body.payload.countryCodestringyesWhitespace trimmed

Example:

bash
curl -X POST "$BASE_URL/api/v1/taxes-breakup" \
  -H "Origin: $ORIGIN" \
  -H "api-key: $API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{"payload":{"priceBeforeTaxes":1,"countryCode":"US"}}'

Response: JSON with success: true and result containing the operation’s service data.

Source: app/v1/controller/order_controller.js:434 → getTaxesAndOtherChargesBreakup; routes: routes/v1/order_route.js:81; service: _getTaxesAndOtherChargesBreakup (app/v1/service/order_service.js:1811).

Cancel order integration ​

MethodURL pathRequired access
PUT/api/v1/order/integrations/cancelOrigin + Brand key + Hub selected

Request fields:

FieldTypeRequiredRules / meaning
body.payloadobjectyesAt least one of ("email" , "phoneNumber")
body.payload.emailstringoptionalEmail address; Whitespace trimmed; Converted to lowercase
body.payload.phoneNumberstringoptionalreplace(/\D/g , ""); Whitespace trimmed
body.payload.phone_prefixstringconditionalRequired when phoneNumber is supplied; otherwise optional
body.payload.orderIdnumberyes—

Example:

bash
curl -X PUT "$BASE_URL/api/v1/order/integrations/cancel" \
  -H "Origin: $ORIGIN" \
  -H "api-key: $API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{"payload":{"orderId":1,"email":"alex@example.com"}}'

Response: JSON with success: true and result containing the operation’s service data.

Source: app/v1/controller/order_controller.js:464 → cancelOrderIntegration; routes: routes/v1/order_route.js:91; service: _cancelOrderIntegration (app/v1/service/order_service.js:1900).

Lifecycle ​

An order's currentStep is one of PAYMENT_PENDING, PLACED, ACCEPTED, READY_FOR_DELIVERY, DISPATCHED, TRANSIT, DELIVERED, COMPLETED or CANCELLED. This API sets the first two and CANCELLED; the fulfilment steps are moved on the hub side.

  • Prepaid means the request sent isPrepaidOrder, or the hub ships and has payment gateways configured. Both create-order paths share this rule.
  • Payment succeeds is any gateway's pay call, or the provider's redirect back to the backend after a hosted payment — each sets PLACED. See Payments and gateways.
  • Cancelling follows the order type. A pickup order can be cancelled from any step until it is COMPLETED or CANCELLED. Every other type can be cancelled only from PLACED, ACCEPTED or PAYMENT_PENDING, and is refused with already in progress or completed after that.
  • The first fulfilment step the customer backend defines is ACCEPTED for delivery and shipment orders and DISPATCHED for pickup. Its cancellation handlers cover those three types only.
  • Notifications follow the starting step: order placed or order payment pending, and the order is pushed to the hub's integration only when it starts at PLACED.

The checkout journey that creates and pays an order is the shop-to-order web flow.

Batch platform, Shopify app and API documentation