Swiftazu

Orders

Update order

Change an order before it is collected.

PATCH/v1/orders/{orderId}
Bearer tokenReturns JSONSuccess 200

An order can be edited while it is Pending or Ready for Pickup. Send only what you want to change. Sending boxes replaces all boxes and recalculates the totals. After collection the order can no longer be edited through the API.

Request

Headers

FieldTypeDescription
AuthorizationrequiredstringThe access token from Get token, as "Bearer <token>".
Content-TyperequiredstringAlways application/json when a body is sent.

Path parameters

FieldTypeDescription
orderIdrequiredstringThe order's id (the UUID, not the short Order ID).

Request body

FieldTypeDescription
customerAddressIdoptionalstringThe delivery address: an address id of that customer.
merchantReferenceoptionalstringYour own order number, up to 100 characters. It must be unique among your orders that are not cancelled.
serviceIdoptionalstringThe delivery service, from List services.
paymentModeoptionalprepaid | codprepaid: you pay the shipping charge. cod: cash is collected from the customer at delivery.
codAmountoptionalnumberThe cash to collect. Required when paymentMode is cod.
insuranceElectedoptionalbooleanInsure this shipment. The premium is added at dispatch.
declaredValueoptionalnumberThe value of the goods. Insurance and customs duty are worked out from it.
deliveryContactNameoptionalstringWho receives the shipment, if not the address contact.
deliveryAltPhoneoptionalstringA second phone number for delivery.
deliveryInstructionsoptionalstringInstructions for the driver.
boxesoptionalarrayThe boxes of the shipment. At least one. On an update, this replaces all boxes.
boxes[].lengthrequirednumberLength in cm.
boxes[].widthrequirednumberWidth in cm.
boxes[].heightrequirednumberHeight in cm.
boxes[].standardBoxIdoptionalstringA standard box id, from List standard boxes.
boxes[].isFragileoptionalbooleanHandling flags: isFragile, isLiquid, isBattery, isPerishable, isOversize.
boxes[].itemsrequiredarrayThe products in the box. At least one.
boxes[].items[].productNamerequiredstringProduct name.
boxes[].items[].skuoptionalstringYour product code.
boxes[].items[].quantityrequirednumberHow many, 1 or more.
boxes[].items[].unitPricerequirednumberPrice of one unit.
boxes[].items[].unitWeightrequirednumberWeight of one unit in kg.
boxes[].items[].hsCodeoptionalstringCustoms (HS) code. Needed for cross-border orders.
boxes[].items[].originCountryIdoptionalstringThe country the product was made in.
customsoptionalobjectCustoms details. Required for a cross-border order.
customs.exportReasonrequiredsale | gift | sample | return_goods | repairWhy the goods are being sent.
customs.incotermrequiredddp | dapWho pays duties: ddp (you) or dap (the receiver).
customs.declaredCustomsValuerequirednumberThe value declared to customs.
customs.declaredCurrencyrequiredstringCurrency of the declared value, as a 3-letter code.
Example request
curl -X PATCH "https://api.swiftazu.com/v1/orders/dffcd25d-6eb3-4b90-868c-6deca160ad74" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "deliveryInstructions": "Leave with reception"
}'

Response

Example response · 200
{
  "status": "ok"
}

Errors

HTTPCodeMeaning
404not_foundThe record does not exist, or it is not yours.
400invalid_requestThe request broke a business rule. message says which one.
409duplicate_merchant_referenceAnother order of yours (not cancelled) already uses this merchantReference. Send a new one.

Every call can also return the shared errors listed on the Overview page. Overview