/
Unfulfillable Event flow

Unfulfillable Event flow


Step 1 - We will receive the unfulfillable event when an order is marked unfulfillable in Eshopbox.

Sample event -

{ "response_dataresponse_data": { "vendorOrderNumber": "5054778120", "balanceDue": 0.0, "externalChannelID": "CH2261", "orderSiteID": "AJIO_RAYMOND_DROPSHIP_ACCU", "expectedShipDate": "2024-06-11 17:32:08", "customerOrderNumber": "AJIORAYWB15056", "orderTotal": 708.22, "paymentType": "Prepaid", "isCOD": "0", "subtotal": 708.22, "shipMethod": "STD", "shippingAddress": { "city": "KOLKATA", "countryCode": "IN", "postalCode": "700055", "addressLine1": "Diamond City North Mall 68 Shop No", "addressLine2": "6 Jessore Road,Opposite Aditya Hospital Nager Baza", "state": "WB", "countryName": "IN", "contactPhone": "null", "customerName": "AJIO-DS-8139-KOL", "email": "abc@gmail.com" }, "thirdPartyShipping": true, "billingAddress": { "city": "KOLKATA", "countryCode": "IN", "postalCode": "700055", "addressLine1": "Diamond City North Mall 68 Shop No", "addressLine2": "6 Jessore Road,Opposite Aditya Hospital Nager Baza", "state": "WB", "countryName": "IN", "contactPhone": "null", "customerName": "AJIO-DS-8139-KOL", "email": "abc@gmail.com" }, "taxAmount": 0.0, "orderDate": "2024-06-09 17:50:37", "externalWarehouseID": "ACCU", "shipChargeAmount": 0.0, "items": [ { "id": "37736167", "order_id": "54317409", "lineItemSequenceNumber": "36675063", "status": "UNFULFILLABLE", "quantity": "1", "sku": "44AP43HLA6G", "itemID": "44AP43HLA6G", "productName": "RMSX12833-R486F044", "lineItemOrderStatus": "failure", "productAdditionalInfo": "{\\\"productDetails\\\":{\\\"unitPrice\\\":524.75,\\\"hsnCode\\\":\\\"62052090\\\",\\\"dimensionHeight\\\":2.5,\\\"dimensionLength\\\":27.899999999999999,\\\"dimensionUnit\\\":\\\"cm\\\",\\\"description\\\":\\\"Raymond Medium Red Shirt\\\",\\\"weight\\\":390,\\\"mrp\\\":2099,\\\"dimensionWidth\\\":36.299999999999997,\\\"type\\\":\\\"BASE\\\",\\\"verticalName\\\":\\\"Apparels\\\",\\\"imageUrl\\\":\\\"https:\\\\/\\\\/i.ibb.co\\\\/56XQdWD\\\\/RMSX12833-R4-1.jpg\\\",\\\"accountSlug\\\":\\\"raymond\\\",\\\"sku\\\":\\\"RMSX12833-R486F044\\\",\\\"esin\\\":\\\"44AP43HLA6G\\\",\\\"brand\\\":\\\"Raymond\\\",\\\"additionalNames\\\":{\\\"ean\\\":\\\"8905725260192\\\",\\\"upc\\\":\\\"RMSX12833-R486F044\\\",\\\"others\\\":[\\\"RAYAB00030845\\\",\\\"RMSX12833-R486F044\\\"]},\\\"groupCode\\\":\\\"RMSX12833-R4\\\",\\\"status\\\":\\\"ACTIVE\\\",\\\"weightUnit\\\":\\\"g\\\"}}", "mrp": "0.0", "lineItemTotal": "708.22", "shippingCharges": "0.0", "customerPrice": "708.22", "discount": "0.0", "shipment_id": "0", "orderItemID": "AJIORAYWB15056-37736167", "externalWarehouseID": "ACCU", "customerOrderItemID": "S248706067.1-1", "integrationType": "11" } ] }, "eventSubType": "unfulfillable", "resource": "order", "previous_data": [], "custom": [], "resource_type": "order.unfulfillable", "eventType": "POST", "version": "v1", "actor": "SYSTEM", "account_slug": "raymond", "accountId": "", "integrationType": "11", "accountSlug": "raymond", "request_data": [] }



Step 2 - In the listener of the event, reject the order on Ajio by using the below Acknowledge order API.

 

URL -

https://api-seller.services.ajio.com/ds/eshopbox/orders

 

Request body -

{ "order_id": "string", "order_lines": [ { "cancelled_quantity": 0, "confirmed_quantity": 0, "order_item_id": "string" } ], "status": "enum(Acknowledge, Cancel)" }

 

Key Mapping -

Acknowledge order API keys

Keys from unfulfillable event

Acknowledge order API keys

Keys from unfulfillable event

order_id

response_data.customerOrderNumber

order_lines

-

order_lines.cancelled_quantity

response_data.items.quantity

order_lines.confirmed_quantity

0

order_lines.order_item_id

response_data.customerOrderNumber + “.“ + response_data.lineItemSequenceNumber

status

'Cancel'

 

Sample response -

{ "failed_items": [ { "error_message": "string", "order_id": "string" } ], "success": [ { "order_id": "string", "order_lines": [ { "cancelled_quantity": "string", "confirmed_quantity": "string", "order_item_id": "string" } ], "order_status": "enum(Acknowledge, Cancel)" } ] }



Step 3 - Cancel the order in Eshopbox as well if we get a successful response from Ajio for cancellation.


curl --location --request POST 'https://{{accountSlug}}.eshopbox.com/api/cancel-order' \ --header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik1UaERRamxDUlRJelJVUTRRVU0wUVRJNU1FSkVOVGszUVVFeU5qVXdSa1JDTmpBeU16WTROQSJ9.eyJodHRwczovL2FwcERhdGEiOnt9LCJodHRwczovL3VzZXJEZXRhaWxzIjp7ImlkIjoxMDAzLCJ1c2VyVHlwZSI6ImRlZmF1bHQiLCJlbWFpbCI6ImFudXNoaS5kQGVzaG9wYm94LmNvbSJ9LCJodHRwczovL2FjY291bnRzIjpbInRjbnNnZ24iLCJ0Y25zYTQ4NCIsInRjbnN3OTk2IiwidGNuc2E0OTIiLCJ0Y25zZTAwMyIsInRjbnN3OTc1IiwidGNuc3c5NDAiLCJ0Y25zdzc0MCIsInRjbnN3NDA0IiwidGNuc3c0MTYiLCJ0Y25zdzUzMiIsInRjbnN3ODM4IiwidGNuc3c3MTUiLCJ0Y25zd2ExMDciLCJ0Y25zdzg2MCIsInRjbnNwYXRsaWJnZ24iLCJ0Y25zZXNiZm5mcnNodmlydHVhbG1vdmVtZW50IiwidGNuc2FnZ24iLCJ0Y25zIl0sImh0dHBzOi8vd2FyZWhvdXNlV29ya3NwYWNlcyI6WyJ0Y25zZ2duIiwidGNuc2E0ODQiLCJ0Y25zdzk5NiIsInRjbnNhNDkyIiwidGNuc2UwMDMiLCJ0Y25zdzk3NSIsInRjbnN3OTQwIiwidGNuc3c3NDAiLCJ0Y25zdzQwNCIsInRjbnN3NDE2IiwidGNuc3c1MzIiLCJ0Y25zdzgzOCIsInRjbnN3NzE1IiwidGNuc3dhMTA3IiwidGNuc3c4NjAiLCJ0Y25zcGF0bGliZ2duIiwidGNuc2VzYmZuZnJzaHZpcnR1YWxtb3ZlbWVudCIsInRjbnNhZ2duIl0sImh0dHBzOi8vd2FyZWhvdXNlcyI6W10sImh0dHBzOi8vcGFydG5lcnMiOlsiNDMxODk1IiwiMjg0MTY2IiwiODk4Njg1IiwiNjc4MTUxIiwiMTIyMDg1IiwiMjk1MzUyIiwiMTg2MTk2IiwiMTYzNTA5IiwiNTYzMzg1IiwiODIwMDYxIiwiOTI5MTMyIiwiOTI2NzY2IiwiMzExMTkxIiwiMTMwNTQxIiwiMTYzNjI0Il0sImlzcyI6Imh0dHBzOi8vZXNob3Bib3guYXV0aDAuY29tLyIsInN1YiI6ImVtYWlsfDYwODk2ZWVlYjYwODcxMDMyZTZjOGVjMyIsImF1ZCI6WyJodHRwczovL3dtcy5teWVzaG9wYm94LmNvbSIsImh0dHBzOi8vZXNob3Bib3guYXV0aDAuY29tL3VzZXJpbmZvIl0sImlhdCI6MTcxNTMyNDQ1NCwiZXhwIjoxNzE1NDEwODU0LCJzY29wZSI6Im9wZW5pZCBwcm9maWxlIGVtYWlsIiwiYXpwIjoiSUlOSjZrbjNFQkZLZDJlVEZ6TW9ZZ0tmaGw2NTQwMkwifQ.DM_FojYYcLRgxQHJ0XpGROWyfcQQIbGW_-iU_Di5gkRVVq1Ww32wke8LTmbyD_fi2tuFPjCRk67G6-iRQr9avEnCYHaX1hGoTcszUqb7z6uJG-fQi0asPDa-IvAN-Zx32cKzJhyuVYx1BsNWcVpja5OkhtSBAigrbeLLkNbGUAcK2f7CP_PqtAPDO5CoS8Vv5nmxSffqPze6mh6uY-YKu7u_VjUBi7Q8jhO7fSMiLy6_rUT8NOuIJwM0Sy_SM0UgIvULt-_BZf8XnEy_MhSEbOlFaenlgH8jAICU2IV6dyQwvRFyAkoj4EvYf1wn_7RAJki1cx5OPcnGHpX25vI6bQ' \ --header 'Content-Type: application/json' \ --data-raw '{ "reason": "Other", "externalChannelID": "CH2198", "cancellationTime": "2024-05-06 06:05:00", "customerOrderNumber": "ABC", "items": [ { "itemID": "8905661221240", "quantity": "1", "orderItemID": "123", "lineItemSequenceNumber": "8631641", "remark": "Other" } ] }'


Key Mapping

Cancellation request body keys

Key in the unfulfillable event

Cancellation request body keys

Key in the unfulfillable event

reason

Other

externalChannelID

response_data.externalChannelID

cancellationTime

current time

customerOrderNumber

response_data.customerOrderNumber

items

-

items.itemID

response_data.items.itemID

items.quantity

response_data.items.quantity

items.orderItemID

response_data.items.orderItemID

items.lineItemSequenceNumber

response_data.items.lineItemSequenceNumber

items.remark

Other

If we get 5XX response from Ajio, We will retry for 2 times.
For any 4XX error from Ajio, We will log the error.
For 401 unauthorised error, we will retry with the new token.

Related content