{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Create an order"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"create-an-order","__idx":0},"children":["Create an order"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Applies to direct API integrations."]}," Connectors build this payload for you from your store's order."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"the-payload","__idx":1},"children":["The payload"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This is the payload Quiqup support sends when someone asks how to start. Copy it, change the values."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For a UAE order you can drop the whole ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["products"]}," array. It is here because export orders need it, and because it is where weight and dimensions live."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Save it as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order.json"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"kind\": \"partner_same_day\",\n  \"payment_mode\": \"pre_paid\",\n  \"partner_order_id\": \"PARTNER-ORDER-ID\",\n  \"origin\": {\n    \"contact_name\": \"Warehouse contact\",\n    \"contact_phone\": \"+971500000000\",\n    \"address\": {\n      \"address1\": \"Example Warehouse, Street 1\",\n      \"address2\": \"Al Quoz Industrial Area 4\",\n      \"country\": \"AE\",\n      \"town\": \"Dubai\"\n    }\n  },\n  \"destination\": {\n    \"contact_name\": \"Customer name\",\n    \"contact_phone\": \"+971599999999\",\n    \"contact_email\": \"customer@example.com\",\n    \"notes\": \"\",\n    \"address\": {\n      \"address1\": \"1st Road\",\n      \"address2\": \"104G\",\n      \"country\": \"AE\",\n      \"town\": \"Dubai\"\n    }\n  },\n  \"products\": [\n    {\n      \"sku\": \"SKU-RUN-001\",\n      \"quantity\": 1,\n      \"description\": \"Running shoe red\",\n      \"barcode\": \"1234654-kt\",\n      \"selling_price\": 58.3,\n      \"hs_code\": \"64041100\",\n      \"country_of_origin\": \"CN\",\n      \"weight\": 0.8,\n      \"height\": 12,\n      \"width\": 20,\n      \"length\": 30\n    }\n  ],\n  \"items\": [\n    {\n      \"name\": \"Parcel 1\",\n      \"quantity\": 1,\n      \"parcel_barcode\": \"\"\n    }\n  ]\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Then:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST 'https://api.staging.quiqup.com/orders' \\\n  -H 'Authorization: Bearer YOUR_TOKEN' \\\n  -H 'Content-Type: application/json' \\\n  -d @order.json\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["That creates a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pending"]}," order. It is not collected until you ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/order-lifecycle#create-then-make-it-ready"},"children":["make it ready"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Three things to notice."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["products"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["items"]}," are siblings."]}," Neither nests inside the other."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["There are no coordinates in this payload."]}," A resolvable text address is enough."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Prepaid orders carry no amount on create."]}," The payload above omits ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_amount"]}," entirely. Only ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paid_on_delivery"]}," needs one."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"the-response","__idx":2},"children":["The response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The response wraps the order. The field you need from it is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order.id"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"order\": {\n    \"id\": 10000001,\n    \"uuid\": \"00000000-0000-4000-8000-000000000001\",\n    \"state\": \"pending\",\n    \"partner_order_id\": \"PARTNER-ORDER-ID\",\n    \"tracking_url\": \"https://track-parcel.quiqup.com/00000000-0000-4000-8000-000000000001\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order.id"]}," is the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{order_id}"]}," in every later path. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["uuid"]}," is what the tracking URL uses. Neither is your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["partner_order_id"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"top-level-fields","__idx":3},"children":["Top-level fields"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["kind"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The service. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/order-lifecycle#service-types"},"children":["Service types"]},". Fixed at creation, so getting it wrong means cancelling and re-booking. An order whose destination country differs from its pickup country becomes an export whatever you send, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#export-orders"},"children":["Export orders"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["origin"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Where Quiqup collects."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["destination"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Where Quiqup delivers."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["items"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["parcels"]},". One entry per physical box."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["products"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["goods"]},". Optional domestically, required for export."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["partner_order_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your own reference. ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Uniqueness is not enforced"]},", so send something unique yourself."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_mode"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pre_paid"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paid_on_delivery"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_amount"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Above 1 with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paid_on_delivery"]},". Omit it on create when prepaid. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT /orders/{order_id}"]}," is stricter and wants both fields together, with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]}," for prepaid. Payment is order-level, not per parcel, and collection on delivery is not available on international orders."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["billing_identifier"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Omit unless Quiqup set one up for you. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#billing_identifier"},"children":["billing_identifier"]}," below."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["disallowed_payment_types"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Suppresses a collection method on a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paid_on_delivery"]}," order. Accepts ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cash"]}]}," and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["card"]}]},", and nothing else. Any other value returns 422 with an empty message."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["scheduled_for"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An ISO 8601 datetime. An unparseable value returns HTTP 400 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[order] creation build failed"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["metadata"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Any JSON object. A string is rejected. Quiqup does not act on it."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["required_documents"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Only ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[]"]}," is accepted today. Do not send anything else."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ready_for_collection"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Set ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," to skip the separate release call. ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Applied asynchronously"]},": the create response still says ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["state: pending"]},", and the order moves a moment later. Do not read the release back off the create response."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["notes"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Free text. Declared at top level and on both ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["origin"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["destination"]},". Put courier instructions on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["destination"]},", which is where the payload above puts them."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Four of the fields declared in the contract are worth knowing about even though the payload above leaves them out, because most integrations do not need them: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["required_documents"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["disallowed_payment_types"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["scheduled_for"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["metadata"]},". All four are in the table above. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["share_tracking"]}," sits on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["destination"]},". The contract also declares ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["partner_order_id"]}," on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["origin"]}," and on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["destination"]},", duplicating the top-level field, and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["notes"]}," in all three places. Use the top-level ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["partner_order_id"]}," and the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["destination.notes"]}," that the payload above uses. Those are the ones support and the courier read."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"parcels-and-products","__idx":4},"children":["Parcels and products"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Two levels. Getting them the wrong way round changes how many labels print and how many bags arrive."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"What it is"},"children":["What it is"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Item"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["parcel"]},". One box, one bag, one stash box. A label is generated per item, so each box can be tracked separately."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Product"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["good"]},". A SKU. What is inside the boxes."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["One label per item."]}," Three boxes means three entries in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["items[]"]}," and three labels. Ten garments returned in one bag is ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["one item and ten products"]},"; send ten items and ten pouches turn up."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For a return you can leave ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["items"]}," exactly as the example has it: one parcel, quantity 1."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"item-fields","__idx":5},"children":["Item fields"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A label for the box, for example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Parcel 1"]},". Nothing rejects a long name at create, but names over about 250 characters can make the order fail later. Keep it short."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["quantity"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Always ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]},". One entry is one parcel; do not use this to express a count of boxes."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parcel_barcode"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Send an empty string. Quiqup generates the barcode and prints the label. A non-empty value tells Quiqup you are printing your own label, which is a separate arrangement."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"product-fields","__idx":6},"children":["Product fields"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["products"]}," is optional for domestic orders and useful there mainly so support can see what is in the box. ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["For export orders it is not optional"]},": the customs fields below are what clears the shipment."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sku"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your stock code. Required for export. Send it on domestic orders too."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["quantity"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["How many of this SKU."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["description"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The product name. Required for export."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["barcode"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The product's own barcode. Not the same thing as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parcel_barcode"]},", which belongs to the box."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["selling_price"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["In AED. The declared customs value. Required for export. Not printed on the label."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hs_code"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Harmonised System code. Required for export."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["country_of_origin"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ISO 3166-1 alpha-2, for example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CN"]},". Required for export."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["weight"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Kilograms. Required for export."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["height"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["width"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["length"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Centimetres. Required for export."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Weight and dimensions live on the product, not the parcel."]}," The create response echoes a default parcel weight of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"5.0\""]}," and dimensions of 10 x 10 x 10 cm on every item, whatever you sent, because you never sent them at parcel level. Do not read those values back as confirmation of anything."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Bundles must be expanded."]}," A bundle SKU sent as one product fails. Send its components."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Keep ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["description"]}," to 18 characters."]}," Nothing rejects a longer one at create, but export shipments go to several carriers and they do not agree on what they accept, so 18 is the safe ceiling."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["No product field is enforced at create."]}," A long ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["description"]},", products missing any of the export fields, and even ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["products: [{}]"]},", are all accepted. The export set is checked when the order is made ready for collection, so a create that succeeds is not a product payload that will ship. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#export-orders"},"children":["Export orders"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["selling_price"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["weight"]}," are decimals, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["quantity"]}," is an integer, and all of them echo back unchanged."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"billing_identifier","__idx":7},"children":["billing_identifier"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A billing identifier lets one account's credentials create orders that belong to another account. It identifies a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["billing account, not a pickup location"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Quiqup links the two accounts and gives the link its identifier, with the agreement of the account that will own the orders. Then, when your credentials send that identifier:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Who"},"children":["Who"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Owner"]}," of the order"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The linked account. It is billed, its ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["brand_name"]}," is on the order, and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["business_partner_id"]}," is its id."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Author"]}," of the order"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["You, the account whose credentials made the call."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Sees the order in Quiqdash and through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /orders"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Both of you."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Receives its webhooks"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The owner's subscriptions, and yours."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This is how one integration serves several brands: one credential, one identifier per brand. The alternative is a separate account, and a separate credential, per brand. ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/authentication#how-credentials-are-scoped"},"children":["How credentials are scoped"]}," compares the two."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Omit the field entirely if you do not have one."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["An identifier that is not linked to your account is accepted and ignored."]}," The create succeeds, the value is echoed back in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["billing_identifier"]},", and the order belongs to you. Nothing tells you the identifier did not apply, so check ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["brand_name"]}," on the response the first time you use a new identifier."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If the identifier cannot be resolved, the create returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[order][billing_identifier] invalid"]},". Retry once, then send the value to support."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["An order that sends no billing identifier gets ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]}," back."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Having one does not remove the need for a full pickup address on every order. Branch addresses are not defaulted from the account."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Links are set up per environment. An identifier that works on staging has to be set up again for production."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"address-object","__idx":8},"children":["Address object"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The same fields on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["origin.address"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["destination.address"]},"."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["address1"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Street and building. Required on both ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["origin"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["destination"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["address2"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Unit, floor, apartment."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["town"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["For example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Dubai"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["country"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An ISO 3166-1 alpha-2 code: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AE"]}," for the UAE, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SA"]}," for Saudi Arabia. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#country-codes"},"children":["Country codes"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["coords"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[longitude, latitude]"]},", so Dubai is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[55.1631, 25.0560]"]}," with the larger number first: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[55.1372, 25.0805]"]}," resolves to Dubai Marina. ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Reversed coordinates are accepted without an error"]}," and come back with a null zone and a null emirate, so nothing tells you it went wrong."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["What is actually required:"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Not required"},"children":["Not required"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["origin.contact_name"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["origin.contact_phone"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["origin.address.address1"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["kind"]},", which defaults to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["partner_same_day"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["destination.contact_name"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["destination.contact_phone"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["destination.address.address1"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_mode"]},", which defaults to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pre_paid"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_amount"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0.0"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["items"]},", with at least one entry carrying a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["everything else in the payload above"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Older versions of this contract marked only ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["origin.address.address1"]},". The set above is what the API enforces."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"country-codes","__idx":9},"children":["Country codes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Send the two-letter ISO code"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AE"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SA"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["KW"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BH"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["QA"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["OM"]},". Two other spellings are converted: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UAE"]}," is stored as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AE"]},", and a full English country name, such as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Saudi Arabia"]},", is stored as its code. Anything else is stored exactly as sent. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["KSA"]}," stays ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["KSA"]},", and an export with it is refused at release with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Invalid country code"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /orders/{order_id}"]},", the list and webhooks return the stored value, so an order sent with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UAE"]}," comes back with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AE"]},". Nothing validates the country at create."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["A destination country that differs from the pickup country makes the order an export"]},", whatever ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["kind"]}," you send. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#export-orders"},"children":["Export orders"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["There is no postcode field and no emirate field."]}," If you are sending either, you are sending something this API does not declare. If you hit a postcode validation error, ask support rather than adding a field the contract does not declare."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Responses and webhooks return a different shape, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["coordinates: {lat, lng}"]},", so what comes back will not look like what you sent."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"contact-fields","__idx":10},"children":["Contact fields"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["contact_name"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["contact_phone"]}," sit on both ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["origin"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["destination"]},", not inside ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["address"]},". ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["contact_email"]}," is declared on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["destination"]}," only."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Phone numbers are E.164 with a single ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["+"]},". A dropoff number that is not a valid UAE number, or that carries a doubled ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["++"]},", is the most common reason an otherwise good order fails."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["On an international order, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["contact_email"]}," is required, and it is checked at release rather than at create."]}," An international order with no destination email is accepted by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /orders"]}," and rejected on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT /orders/{order_id}/ready_for_collection"]},", which is why the field looks optional right up until it is not. Domestic orders do not need it."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Quiqup does not send customer tracking emails today. The field is there for the export paperwork, and notifications may use it later."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"export-orders","__idx":11},"children":["Export orders"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Exports to GCC destinations go through the same ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /orders"]},". The account needs the international terms signed and the export service enabled first."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An order is an export in either of two cases:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["you send ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["kind: partner_export"]},", or"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["the destination ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["country"]}," differs from the pickup ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["country"]},". The order is then created as an export whatever ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["kind"]}," you sent, and the response shows ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["service_kind: partner_export"]},". Returns and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["partner_store"]}," orders are never converted."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["An export is checked when it is made ready for collection, not when it is created."]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /orders"]}," accepts it with any payload. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT /orders/{order_id}/ready_for_collection"]}," then books it with the carrier, and refuses with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422"]}," if anything the carrier needs is missing. The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]}," string starts ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Failed to book shipment for order, please fix missing details in the order"]}," and names each problem with its field, for example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Invalid country code (field: dropoff.country, code: required_data_invalid)"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["must not be empty (field: items, ...)"]}," when ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["products"]}," is missing."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The order stays ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pending"]},", so you can cancel it and create it again with the missing fields."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["What an export needs:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Where"},"children":["Where"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Fields"},"children":["Fields"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["destination"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["contact_email"]},", and an ISO ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["country"]}," code, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#country-codes"},"children":["Country codes"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Every entry in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["products"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sku"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["description"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["quantity"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["selling_price"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["weight"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["height"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["width"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["length"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hs_code"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["country_of_origin"]},". See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#product-fields"},"children":["Product fields"]},"."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Collection on delivery is not available on exports."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"every-operation","__idx":12},"children":["Every operation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ten order operations, plus ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /oauth/token"]}," on the Auth reference if you use client credentials."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Operation"},"children":["Operation"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"What it does"},"children":["What it does"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /orders"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create an order. The page above."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /orders"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["List your orders. Requires ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["per_page"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["from"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["to"]}," (both ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["YYYY-MM-DD"]},"). ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["filters[state]"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["filters[partner_order_id]"]}," are optional. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["filters[state]"]}," takes the lowercase ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["state"]}," strings from ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/order-lifecycle#order-statuses-and-their-events"},"children":["Order statuses and their events"]},"; an unrecognised or wrongly-cased value returns 200, no results, and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total: 1"]},". ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Pending orders are left out unless ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["filters[state]"]}," asks for them"]},", and that includes a search by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["filters[partner_order_id]"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /orders/{order_id}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Retrieve one order. Current state only."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /orders/{order_id}/history"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Every state the order has passed through, with timestamps."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /order_label/{order_id}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Download the AWB (air waybill, the shipping label) as a PDF. ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Check the content length"]},", see below."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT /orders/{order_id}/ready_for_collection"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Release a pending order to operations."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT /orders/{order_id}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Update a pending order."]}," Only while pending."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /orders/{order_id}/parcels"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Add a parcel to a pending order."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DELETE /orders/{order_id}/parcels/{parcel_id}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Remove a parcel from a pending order. The last remaining parcel cannot be removed."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT /orders/batch/set_cancelled"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Cancel orders in bulk, while they are ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pending"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ready_for_collection"]},"."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Updating an order and adding or removing parcels work only while it is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pending"]},". Cancelling works until a courier is on the way to collect: from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["out_for_collection"]}," onwards the API refuses it, and cancellation moves to Quiqdash."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"the-calls-with-bodies","__idx":13},"children":["The calls, with bodies"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every path below takes the same ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization: Bearer YOUR_TOKEN"]}," header. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{order_id}"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order.id"]}," from the create response."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Release a pending order. No body.\ncurl -X PUT 'https://api.staging.quiqup.com/orders/{order_id}/ready_for_collection' \\\n  -H 'Authorization: Bearer YOUR_TOKEN'\n\n# Download the AWB. Returns a PDF, so write it to a file.\ncurl 'https://api.staging.quiqup.com/order_label/{order_id}' \\\n  -H 'Authorization: Bearer YOUR_TOKEN' -o label.pdf\n\n# Current state.\ncurl 'https://api.staging.quiqup.com/orders/{order_id}' \\\n  -H 'Authorization: Bearer YOUR_TOKEN'\n\n# Every state it has passed through.\ncurl 'https://api.staging.quiqup.com/orders/{order_id}/history' \\\n  -H 'Authorization: Bearer YOUR_TOKEN'\n\n# Cancel orders that are pending or ready for collection. Takes a list of ids.\ncurl -X PUT 'https://api.staging.quiqup.com/orders/batch/set_cancelled' \\\n  -H 'Authorization: Bearer YOUR_TOKEN' -H 'Content-Type: application/json' \\\n  -d '{\"order_ids\": [10000001]}'\n\n# Add a parcel to a pending order.\ncurl -X POST 'https://api.staging.quiqup.com/orders/{order_id}/parcels' \\\n  -H 'Authorization: Bearer YOUR_TOKEN' -H 'Content-Type: application/json' \\\n  -d '{\"name\": \"Parcel 2\"}'   # name is the only field it reads\n\n# Remove a parcel. The last remaining parcel cannot be removed.\ncurl -X DELETE 'https://api.staging.quiqup.com/orders/{order_id}/parcels/{parcel_id}' \\\n  -H 'Authorization: Bearer YOUR_TOKEN'\n\n# Change payment on a pending order. Both fields, always together.\ncurl -X PUT 'https://api.staging.quiqup.com/orders/{order_id}' \\\n  -H 'Authorization: Bearer YOUR_TOKEN' -H 'Content-Type: application/json' \\\n  -d '{\"payment_mode\": \"pre_paid\", \"payment_amount\": 0}'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Swap ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api.staging.quiqup.com"]}," for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api-ae.quiqup.com"]}," on production."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"return-values-that-will-catch-you-out","__idx":14},"children":["Return values that will catch you out"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["The label endpoint has no 404."]}," An order id that does not exist returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200"]},","," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Content-Type: application/pdf"]},", and a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["zero-byte body"]},". If you stream the response straight to a"," ","file you get an empty PDF and no error. Check the content length before you write it."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT /orders/{order_id}"]}," returns the literal ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}]},", sent with no ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Content-Type"]}," header. It is"," ","not the updated order. Calling ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".json()"]}," on it works in some HTTP clients and throws in others. If"," ","you need the new values, read the order back."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Unknown fields are accepted and ignored."]}," A misspelled field name, anywhere in the payload, does"," ","not produce an error on any of these endpoints. A field that had no effect and a field you spelled"," ","wrong look identical from the outside, so check the response for the value you meant to set rather"," ","than assuming the call did what you asked."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /orders/{order_id}/parcels"]}," reads ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name"]}," and nothing else"]},". An empty body returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[name] is missing"]},", and a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["quantity"]}," of 2 is accepted and silently ignored, with the parcel created at quantity 1."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT /orders/{order_id}"]}," is narrower than its name suggests."]}," The contract states that ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_mode"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_amount"]}," are the only attributes it accepts, and that they must be sent together. It cannot change an address. Address corrections are made in Quiqdash."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"retrying-safely","__idx":15},"children":["Retrying safely"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Send a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["uuid"]}," on every create."]}," Generate a UUID for each order, put it at the top level of the payload, and send the same value again on a retry. A repeat from the same account returns the original order with HTTP ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["200"]}," instead of 201, and creates nothing. A ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["uuid"]}," that is not a valid UUID, or that another account already used, is rejected with 422."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"uuid\": \"9b2f6c1e-4d7a-4c1b-8e3f-2a5d6b7c8e90\",\n  \"kind\": \"partner_same_day\",\n  \"...\": \"the rest of the order\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Without a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["uuid"]},", order creation is ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["not idempotent"]},". ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["partner_order_id"]}," does not enforce uniqueness, so a retried create produces a second order and a second AWB. The rest of this section is for that case."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /orders"]}," leaves pending orders out unless you ask for them."]}," With no ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["filters[state]"]},", the list returns every state except ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pending"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["filters[partner_order_id]"]}," on its own does the same, so a search by reference returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total: 0"]}," for a pending order that exists."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A create that timed out leaves a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pending"]}," order. That is precisely the case a plain reference search cannot see, so using it as a pre-retry check tells you the order does not exist when it does, and you create a duplicate."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["What works instead."]}," Ask for pending orders explicitly, together with your reference:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl 'https://api.staging.quiqup.com/orders?page=1&per_page=10&from=2026-08-01&to=2026-08-31&filters%5Bstate%5D=pending&filters%5Bpartner_order_id%5D=PARTNER-ORDER-ID' \\\n  -H 'Authorization: Bearer YOUR_TOKEN'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total"]}," of 1 or more means the create landed. The reference filter matches ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["any reference that contains"]}," the value you send, ignoring case, so ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ORDER-1"]}," also matches ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ORDER-10"]},". Check ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["partner_order_id"]}," on each result before you decide. Cover the day the create was sent in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["from"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["to"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Log the response, or the absence of one, at the moment you send the create."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Once you have an order id, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /orders/{order_id}/history"]}," shows everything that happened to it since."]}]},"headings":[{"value":"Create an order","id":"create-an-order","depth":1},{"value":"The payload","id":"the-payload","depth":2},{"value":"The response","id":"the-response","depth":2},{"value":"Top-level fields","id":"top-level-fields","depth":2},{"value":"Parcels and products","id":"parcels-and-products","depth":2},{"value":"Item fields","id":"item-fields","depth":3},{"value":"Product fields","id":"product-fields","depth":3},{"value":"billing_identifier","id":"billing_identifier","depth":2},{"value":"Address object","id":"address-object","depth":2},{"value":"Country codes","id":"country-codes","depth":3},{"value":"Contact fields","id":"contact-fields","depth":2},{"value":"Export orders","id":"export-orders","depth":2},{"value":"Every operation","id":"every-operation","depth":2},{"value":"The calls, with bodies","id":"the-calls-with-bodies","depth":3},{"value":"Return values that will catch you out","id":"return-values-that-will-catch-you-out","depth":3},{"value":"Retrying safely","id":"retrying-safely","depth":2}],"frontmatter":{"seo":{"title":"Create an order"}},"lastModified":"2026-10-16T10:25:38.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/lastmile/create-an-order","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}