HTTP POST https://intercity.draftorder.app/draft/<draft_order_id>
This API require an API Key in the HTTP Header, the header name is API_KEY .
Example :
API_KEY : 12345abcde
HTTP POST https://intercity.draftorder.app/draft/<draft_order_id>
draft_order_id is the numeric ID of the Draft order, eg: 123455678
Body parameters, (in JSON format)
lineItems (array of line items you want to update) , each array element contain "id" and "customAttributes" (array of objects that contain "key" and "value").
Example structure of the body JSON :
xxxxxxxxxx{"lineItems":[{"id":"gid://shopify/DraftOrderLineItem/57949071114322","customAttributes":[{"key":"Attribute to add or update","value":"Tomorrow"},{"key":"attribute to delete","value":null}]},{"id":"gid://shopify/DraftOrderLineItem/57949071212626","customAttributes":[{"key":"example key","value":"example value"},{"key":"example key 2","value":"example value 2"}]}]}
Example cURL code :
xxxxxxxxxxcurl -X POST "https://intercity.draftorder.app/draft/1234567890" \-H "API_KEY: 1234abcd" \-H "Content-Type: application/json" \-d '{"lineItems":[{"id":"gid://shopify/DraftOrderLineItem/57949071114322","customAttributes":[{"key":"Attribute to add or update","value":"Tomorrow"},{"key":"attribute to delete","value":null}]},{"id":"gid://shopify/DraftOrderLineItem/57949071212626","customAttributes":[{"key":"example key","value":"example value"},{"key":"example key 2","value":"example value 2"}]}]}'
If the "key" does not exist in the line item, this API will add the key and value to the line item (ie. attributes name and value).
If the "key" already exist in the line item, this API will update the value for the key.
If the "value" is set to null , the attribute will be removed from the line item.