POST /v1/commerce/draft-orders
POST
/v1/commerce/draft-ordersAuthorization
bearerAuthbearerAuthrequiredor
apiKeyAuthapiKeyAuthrequiredRequest body
requiredapplication/jsoncustomer_namestringcustomer_phonestringrequireditemsDraftOrderItemInput[] | nullrequiredShow propertiesHide properties
Array of
DraftOrderItemInputquantityinteger<int32>requiredretailer_idstringrequiredpromotion_codestringsource_channelstringAllowed:
whatsapp_catalogmanualcheckout_linksource_referencestringResponses
201Created
draft_order_idstringrequiredexpires_atstringrequiredtokenstringrequiredurlstringrequireddefaultError
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstringRequest
curl -X POST "/v1/commerce/draft-orders" \
-H "Content-Type: application/json" \
-d '{
"customer_name": "string",
"customer_phone": "string",
"items": [
{
"quantity": 0,
"retailer_id": "string"
}
],
"promotion_code": "string",
"source_channel": "whatsapp_catalog",
"source_reference": "string"
}'const response = await fetch("/v1/commerce/draft-orders", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"customer_name": "string",
"customer_phone": "string",
"items": [
{
"quantity": 0,
"retailer_id": "string"
}
],
"promotion_code": "string",
"source_channel": "whatsapp_catalog",
"source_reference": "string"
})
});import requests
response = requests.post(
"/v1/commerce/draft-orders",
headers={
"Content-Type": "application/json"
},
json={
"customer_name": "string",
"customer_phone": "string",
"items": [
{
"quantity": 0,
"retailer_id": "string"
}
],
"promotion_code": "string",
"source_channel": "whatsapp_catalog",
"source_reference": "string"
},
)Response
{
"draft_order_id": "string",
"expires_at": "string",
"token": "string",
"url": "string"
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}