Skip to main content

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.

  1. Login to appx.channelape.io

  2. Install playbook step on business by going to this URL: https://appx.channelape.io/{{businessId}}/embed/playbook/steps/a1cd6d94-1fe5-4e7b-8ad3-fb185fb62a1f/install

    1. Replace businessId with the ID of the business you are using
  3. Ensure Synchronous is enabled

  4. Ensure Authenticated Callback is enabled

    1. This flag will use the session ID passed in from authorization headers on the callbacks endpoint
  5. Set version to STAGING if this is a Staging Business otherwise use PRODUCTION

  6. Select Install

  7. Refresh the Playbook ➝ Steps Configuration page and select the new step you just installed

  8. Select Copy Callback URL

    1. This URL is your endpoint to post fulfillment order receipts too
    2. You will need to pass in valid authorization headers along with the payload

Example

Given the following values:

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

  1. warehouseOrderId: This is the only required parameter.
  2. cancellationReason: If this parameter is supplied then the order activity description will contain this information.
  3. purchaseOrderNumber: The purchase order number of the ChannelApe order.
  4. channelOrderId: The channel order id of the ChannelApe order.
  5. 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.

note

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.