Skip to main content

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.

  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/7099e345-f901-4f30-964d-e10eac9f6550/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 provided 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

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

  1. warehouseOrderId: This is the only required parameter.
  2. rejectionReason: If this parameter is supplied then the ERROR 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.