Process Cancellations
Playbook can process cancellations from a warehouse due to lack of inventory, or other issues. It will cancel the fulfillment and allow the flow to retry.
Unlike Order Fulfillment Request Rejections, the fulfillment will be cancelled instead of deleted and the order status will not be set to HOLD
.
When the Webhook - Process Cancellations
Playbook Step is installed on a business it provides a synchronous endpoint that can be used to post order fulfillment request cancellations back to ChannelApe. It will handle canceling the fulfillment, reverse the committed inventory at the location, and write an order activity cotaining the reason for cancellation if provided.
Configuration
Install the Webhook - Process Cancellations
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/a1cd6d94-1fe5-4e7b-8ad3-fb185fb62a1f/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 session ID passed in from 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
Example Headers:
Authorization: Bearer YOUR_KEY
apikey: ANON_KEY
Content-Type: application/json
Example Body:
{
"warehouseOrderId": "#1232",
"cancellationReason": "Out of stock",
"businessId": "aed87de4-180c-4d21-bbf7-3f5509748df4"
}
There are 5 parameters that can be used in the request
- warehouseOrderId: This is the only required parameter.
- cancellationReason: If this parameter is supplied then the 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.