Commerce
Post v1commercedraft orders
POST
/
v1
/
commerce
/
draft-orders
cURL
curl --request POST \
--url https://api.wazapin.com/v1/commerce/draft-orders \
--header 'Content-Type: application/json' \
--data '
{
"customer_phone": "<string>",
"items": [
{
"quantity": 123,
"retailer_id": "<string>"
}
],
"customer_name": "<string>",
"promotion_code": "<string>",
"source_reference": "<string>"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
customer_phone: '<string>',
items: [{quantity: 123, retailer_id: '<string>'}],
customer_name: '<string>',
promotion_code: '<string>',
source_reference: '<string>'
})
};
fetch('https://api.wazapin.com/v1/commerce/draft-orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wazapin.com/v1/commerce/draft-orders"
payload = {
"customer_phone": "<string>",
"items": [
{
"quantity": 123,
"retailer_id": "<string>"
}
],
"customer_name": "<string>",
"promotion_code": "<string>",
"source_reference": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"draft_order_id": "<string>",
"expires_at": "<string>",
"token": "<string>",
"url": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"field": "<string>",
"location": "<string>"
}
],
"request_id": "<string>"
}
}Body
application/json
⌘I
cURL
curl --request POST \
--url https://api.wazapin.com/v1/commerce/draft-orders \
--header 'Content-Type: application/json' \
--data '
{
"customer_phone": "<string>",
"items": [
{
"quantity": 123,
"retailer_id": "<string>"
}
],
"customer_name": "<string>",
"promotion_code": "<string>",
"source_reference": "<string>"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
customer_phone: '<string>',
items: [{quantity: 123, retailer_id: '<string>'}],
customer_name: '<string>',
promotion_code: '<string>',
source_reference: '<string>'
})
};
fetch('https://api.wazapin.com/v1/commerce/draft-orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wazapin.com/v1/commerce/draft-orders"
payload = {
"customer_phone": "<string>",
"items": [
{
"quantity": 123,
"retailer_id": "<string>"
}
],
"customer_name": "<string>",
"promotion_code": "<string>",
"source_reference": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"draft_order_id": "<string>",
"expires_at": "<string>",
"token": "<string>",
"url": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"field": "<string>",
"location": "<string>"
}
],
"request_id": "<string>"
}
}