Create or update orders
/ordersThe body is a JSON list of up to 25 orders, keyed by external_id (source api; a connected store's orders are never touched). Always 200 with one result per order: one invalid order never fails the others.
An order is attached to profile_id if that profile is in the account, otherwise to the profile with the same email; with neither it is stored unlinked and attached when such a profile appears. Orders never create profiles.
Order events (placed_order, ordered_product per line, fulfilled_order, cancelled_order, refunded_order) are recorded by YouSendIt from the order, and corrected when the order changes; they are not counted against the event allowance. Parts of an order that happened more than 48 hours before it was FIRST submitted are stored as historical (they never trigger flows or webhooks).
Which copy wins: a copy replaces the stored order unless it is older by updated_at. A copy WITHOUT updated_at replaces a stored copy that also has none (last write wins) and NEVER replaces one that has it: such a copy is reported as stale. Send updated_at always, or never.
Permission: orders:write · on the API key screen: Orders → Full access · All permissions
Body parameters
external_idstringrequiredYour id for the order. The upsert key.
At least 1 characters. At most 255 characters.
namestring | nullAt most 100 characters.
profile_idstringThe buyer, if you know the profile id. Otherwise the order is matched by email.
At most 2,000 characters.
emailstring | nullAt most 254 characters.
currencystringAt most 2,000 characters.
totalstring | numberrequiredsubtotalstring | number | nulltaxstring | number | nulldiscountsstring | number | nullshippingstring | number | nullfinancial_statusstring | nullAt most 30 characters.
fulfillment_statusstring | nullAt most 30 characters.
placed_atstringrequiredAt most 2,000 characters.
cancelled_atstring | nullAt most 2,000 characters.
fulfilled_atstring | nullAt most 2,000 characters.
updated_atstringWhen the order last changed in your system. See 'Which copy wins' in docs/API.md.
At most 2,000 characters.
refundsobject[]At most 50 items.
Show propertiesHide properties
idstringrequiredAt least 1 characters. At most 100 characters.
amountstring | numberrequiredatstringAt most 2,000 characters.
itemsobject[]The COMPLETE line list: lines not in it are removed. Omit to leave lines alone.
At most 100 items.
Show propertiesHide properties
external_idstringrequiredYour id for the line (stable across updates).
At least 1 characters. At most 255 characters.
product_external_idstring | nullAt most 255 characters.
variant_external_idstring | nullAt most 255 characters.
titlestring | nullAt most 500 characters.
variant_titlestring | nullAt most 500 characters.
skustring | nullAt most 255 characters.
quantitynumberFrom 0 to 1000000.
pricestring | numberUnit price.
Response
writtennumberrequiredstalenumberrequiredfailednumberrequiredresultsobject[]requiredAt most 25 items.
Show propertiesHide properties
indexnumberrequiredstatusstringrequiredOne of:
createdupdatedstalefailedAt most 2,000 characters.
idstring | nullrequiredAt most 2,000 characters.
profile_idstring | nullrequiredAt most 2,000 characters.
codestring | nullrequiredAt most 64 characters.
paramstring | nullrequiredAt most 300 characters.
messagestring | nullrequiredAt most 500 characters.