Order Fulfillment Request Rejections
Playbook can process rejections from a warehouse due to API errors, or and unexpected networking issues. It will delete the fulfillment and allow the flow to retry.
When the Webhook - Process Order Fulfillment Rejections
Playbook Step is installed on a business it provides a synchronous endpoint that can be used to post order fulfillment request rejections back to ChannelApe. It handles much more than just writing an order activity about the error although it does that to. It will handle deleting the fulfillment, create adjustments reversing the committed inventory at the location, and write an activity about why.
Configuration
Install the Webhook - Process Order Fulfillment Rejections
Playbook Step on a business using the app.
-
Login to appx.channelape.io
-
Install playbook step on business by going to this URL:
https://appx.channelape.io/{{businessId}}/embed/playbook/steps/7099e345-f901-4f30-964d-e10eac9f6550/install
- Replace businessId with the ID of the business you are using
-
Ensure Synchronous is enabled
-
Ensure Authenticated Callback is enabled
- This flag will use the provided authorization headers on the callbacks endpoint
-
Set version to
STAGING
if this is a Staging Business otherwise usePRODUCTION
-
Select Install
-
Refresh the Playbook ➝ Steps Configuration page and select the new step you just installed
-
Select
Copy Callback URL
- This URL is your endpoint to post fulfillment order receipts too
- You will need to pass in valid authorization headers along with the payload
Example
Given the following values:
-
Callback URL set to https://callbacks.channelape.com/v1/suppliers/g81c87c7-2692-4088-a396-05872695ff93/callbacks
-
API Account for business with private key of o375b408-3c06-41ee-9df2-00402c7472b1
-
Business ID for business with private key of aed87de4-180c-4d21-bbf7-3f5509748df4
-
Order with warehouseOrderId of
CAT333
has 1PENDING
fulfillment with the following line items:- SKU
sku-1
, Quantity 2 - SKU
sku-2
, Quantity 3
- SKU
Request sent:
POST https://callbacks.channelape.com/v1/suppliers/g81c87c7-2692-4088-a396-05872695ff93/callbacks
Headers sent:
Authorization: Bearer YOUR_KEY
apikey: ANON_KEY
Content-Type: application/json
Payload sent:
{
"warehouseOrderId": "#1232",
"rejectionReason": {
"status": 500,
"error": "Internal Server Error"
},
"businessId": "aed87de4-180c-4d21-bbf7-3f5509748df4"
}
Will return a 200 Response Status
And a Response Body of:
{
"updateResult": {
"id": "091a3e84-9bff-417f-a8b1-1428f2ab9af9",
"fulfillments": [],
"status": "HOLD"
}
}
There are 5 parameters that can be used in the request
- warehouseOrderId: This is the only required parameter.
- rejectionReason: If this parameter is supplied then the ERROR order activity description will contain this information.
- purchaseOrderNumber: The purchase order number of the ChannelApe order.
- channelOrderId: The channel order id of the ChannelApe order.
- orderId The order id of the ChannelApe order.
When the webhook is called the ChannelApe order is searched for. The parameters supplied will determine how the order is found. There is an order of operations when searching:
orderId > channelOrderId > purchaseOrderNumber > warehouseOrderId
Even if more than one parameter specifying an order is supplied, the most specific one should be used to find the order.
In practice, do not provide more than 1 of these or risk a 500 complaining about businessId or channelId being missing even if they aren't.