Skip to main content

Webhook Send Orders Step

Sends order fulfillment requests to a configured payload URL for fulfillment. Authentication is optionally supported via query parameter. Optionally one payload URL per warehouse location is also supported.

Only fulfillments with a NEW status and a locationId defined in WAREHOUSE_LOCATION_MAP environment variable should be sent to the webhook endpoint for fulfillment.

If a webhookUrl is defined in the WAREHOUSE_LOCATION_MAP for the order fulfillment location then that URL will be used instead of the PAYLOAD_URL Environment Variable. In this way multiple webhook URLs are supported.

Any Successful responses (200–299 status code) or Redirection messages (300-399 status code) from the payload URL endpoint will update the order fulfillment request in ChannelApe from NEW to PENDING.

A failure response will result in the NEW fulfillment being removed in ChannelApe. An Order Activity with title of 3PL Failure and result of ERROR will be creating indicating failure. Check the order activity description for more details such as the network error, the response HTTP status code, and the response body.

Prerequisites

Webhook - Send Orders step requires locations to be setup prior to running.

Environment Variables

  • PAYLOAD_URL - Webhook URL to send the order payload.

  • AUTH_TOKEN_QUERY_PARAMETER_FIELD - Query Param Field used for authentication of the webhook.

  • AUTH_TOKEN_QUERY_PARAMETER_VALUE - Query Param Value used for authentication of the webhook.

  • WAREHOUSE_LOCATION_MAP - A JSON dictionary mapping warehouse codes and their location limits to a ChannelApe Location ID. See here for more details.

Example with Single Payload Url

Given the following values:

  • PAYLOAD_URL set to https://webhook.site/0b2d6f2b-4676-40b4-9588-2a4c93f6b250
  • AUTH_TOKEN_QUERY_PARAMETER_FIELD set to authToken
  • AUTH_TOKEN_QUERY_PARAMETER_VALUE set to password123
  • WAREHOUSE_LOCATION_MAP set to:
[
{
"warehouse": "RJT1",
"company": "United Parcel Service",
"locationId": "942",
"name": "UPS East Coast",
"id": "UPSF",
"zipCode": "40165"
},
{
"warehouse": "RJT2",
"company": "United Parcel Service",
"locationId": "874",
"name": "UPS West Coast",
"id": "UPSW",
"zipCode": "91752"
}
]

Request sent: POST https://webhook.site/0b2d6f2b-4676-40b4-9588-2a4c93f6b250?authToken=password123

Payload sent:

{
"additionalFields": {
"closed_at": "null",
"number": "414",
"token": "ce37baefef9b0cd8251e054364845ea2",
"taxes_included": "false",
"financial_status": "paid",
"total_discounts": "0.00",
"total_line_items_price": "1500.00",
"buyer_accepts_marketing": "false",
"name": "CAWO11414",
"cancelled_at": "null",
"user_id": "79729033458",
"location_id": "null",
"browser_ip": "136.49.24.5",
"order_number": "1414",
"processing_method": "direct",
"source_name": "shopify_draft_order",
"tags": "test",
"order_status_url": "https://channelape-warehouse-onboarding-1.myshopify.com/61758701810/orders/ce37baefef9b0cd8251e054364845ea2/authenticate?key=20acb53e9c056e7f55142c28e343c46e",
"updated_at": "2023-05-16T15:18:15.000-04:00",
"creation_time": "2023-05-16T15:18:12.000-04:00",
"processed_at": "2023-05-16T15:18:11.000-04:00",
"risk_recommendation": "accept",
"apple_pay": "false",
"warehouse_order_id": "RJDTPO-1692015143"
},
"customer": {
"additionalFields": [
{
"name": "id",
"value": "6335089574130"
},
{
"name": "accepts_marketing",
"value": "false"
},
{
"name": "orders_count",
"value": "0"
},
{
"name": "total_spent",
"value": "0.00"
},
{
"name": "state",
"value": "disabled"
}
],
"billingAddress": {
"additionalFields": [],
"address1": "400 Beach Street",
"city": "Santa Cruz",
"country": "United States",
"countryCode": "US",
"firstName": "Walt",
"lastName": "Test",
"name": "Walt Test",
"phone": "+15555555555",
"postalCode": "95060",
"province": "California",
"provinceCode": "CA"
},
"email": "test@test.com",
"firstName": "Walt",
"lastName": "Test",
"shippingAddress": {
"additionalFields": [],
"address1": "400 Beach Street",
"city": "Santa Cruz",
"country": "United States",
"countryCode": "US",
"firstName": "Walt",
"lastName": "Test",
"name": "Walt Test",
"phone": "+15555555555",
"postalCode": "95060",
"province": "California",
"provinceCode": "CA"
}
},
"lineItems": [
{
"additionalFields": {
"variant_id": "42186875306226",
"title": "ChannelApe Men's Running Shoes",
"variant_title": "9",
"product_id": "7484045623538",
"requires_shipping": "true",
"taxable": "true",
"gift_card": "false",
"variant_inventory_management": "shopify",
"fulfillable_quantity": "6",
"total_discount": "0.00",
"fulfillment_service": "manual"
},
"id": "13067164057842",
"price": "125.00",
"quantity": 6,
"sku": "CARSBLKM-09",
"grams": "680",
"title": "ChannelApe Men's Running Shoes - 9"
},
{
"additionalFields": {
"variant_id": "42186875338994",
"title": "ChannelApe Men's Running Shoes",
"variant_title": "10",
"product_id": "7484045623538",
"requires_shipping": "true",
"taxable": "true",
"gift_card": "false",
"variant_inventory_management": "shopify",
"fulfillable_quantity": "6",
"total_discount": "0.00",
"fulfillment_service": "manual"
},
"id": "13067164090610",
"price": "125.00",
"quantity": 6,
"sku": "CARSBLKM-10",
"grams": "680",
"title": "ChannelApe Men's Running Shoes - 10"
}
],
"locationId": "874",
"purchasedAt": "2023-08-14T12:12:23.297Z",
"purchaseOrderNumber": "RJDTPO-1692015143",
"shippingCompany": "USPS",
"shippingMethod": "1DA",
"status": "NEW",
"warehouseOrderId": "RJDTPO-1692015143",
"warehouseCode": "RJT2",
"warehouseCompany": "United Parcel Service",
"warehouseName": "UPS West Coast",
"warehouseId": "UPSW",
"warehouseZipcode": "91752",
"channelOrderId": "RJDTCOI-1692015143",
"channelId": "1fc7d777-f210-4e9c-ac24-90741eeec066",
"orderId": "fd4fda9f-452b-40e5-8ff2-f8796ea2443e"
}

Example with Multiple Payload Urls

Given the following values:

  • PAYLOAD_URL set to https://webhook.site/0b2d6f2b-4676-40b4-9588-2a4c93f6b250
  • AUTH_TOKEN_QUERY_PARAMETER_FIELD set to authToken
  • AUTH_TOKEN_QUERY_PARAMETER_VALUE set to password123
  • WAREHOUSE_LOCATION_MAP set to:
[
{
"warehouse": "RJT1",
"company": "United Parcel Service",
"locationId": "942",
"name": "UPS East Coast",
"id": "UPSF",
"zipCode": "40165",
"webhookUrl": "https://webhook.site/f0f75529-d8a6-4fc1-9e3f-2c2c252c1ff5",
"cancelEndpoint": "https://webhook.site/0e46e204-c284-4b47-b829-8705f201d178"
},
{
"warehouse": "RJT2",
"company": "United Parcel Service",
"locationId": "874",
"name": "UPS West Coast",
"id": "UPSW",
"zipCode": "91752",
"webhookUrl": "https://webhook.site/6f7402b4-e75c-4573-b3b4-3139dc1b733d"
}
]

Request sent: POST https://webhook.site/6f7402b4-e75c-4573-b3b4-3139dc1b733d

Payload sent:

{
"additionalFields": {
"closed_at": "null",
"number": "414",
"token": "ce37baefef9b0cd8251e054364845ea2",
"taxes_included": "false",
"financial_status": "paid",
"total_discounts": "0.00",
"total_line_items_price": "1500.00",
"buyer_accepts_marketing": "false",
"name": "CAWO11414",
"cancelled_at": "null",
"user_id": "79729033458",
"location_id": "null",
"browser_ip": "136.49.24.5",
"order_number": "1414",
"processing_method": "direct",
"source_name": "shopify_draft_order",
"tags": "test",
"order_status_url": "https://channelape-warehouse-onboarding-1.myshopify.com/61758701810/orders/ce37baefef9b0cd8251e054364845ea2/authenticate?key=20acb53e9c056e7f55142c28e343c46e",
"updated_at": "2023-05-16T15:18:15.000-04:00",
"creation_time": "2023-05-16T15:18:12.000-04:00",
"processed_at": "2023-05-16T15:18:11.000-04:00",
"risk_recommendation": "accept",
"apple_pay": "false",
"warehouse_order_id": "RJDTPO-1692015143"
},
"customer": {
"additionalFields": [
{
"name": "id",
"value": "6335089574130"
},
{
"name": "accepts_marketing",
"value": "false"
},
{
"name": "orders_count",
"value": "0"
},
{
"name": "total_spent",
"value": "0.00"
},
{
"name": "state",
"value": "disabled"
}
],
"billingAddress": {
"additionalFields": [],
"address1": "400 Beach Street",
"city": "Santa Cruz",
"country": "United States",
"countryCode": "US",
"firstName": "Walt",
"lastName": "Test",
"name": "Walt Test",
"phone": "+15555555555",
"postalCode": "95060",
"province": "California",
"provinceCode": "CA"
},
"email": "test@test.com",
"firstName": "Walt",
"lastName": "Test",
"shippingAddress": {
"additionalFields": [],
"address1": "400 Beach Street",
"city": "Santa Cruz",
"country": "United States",
"countryCode": "US",
"firstName": "Walt",
"lastName": "Test",
"name": "Walt Test",
"phone": "+15555555555",
"postalCode": "95060",
"province": "California",
"provinceCode": "CA"
}
},
"lineItems": [
{
"additionalFields": {
"variant_id": "42186875306226",
"title": "ChannelApe Men's Running Shoes",
"variant_title": "9",
"product_id": "7484045623538",
"requires_shipping": "true",
"taxable": "true",
"gift_card": "false",
"variant_inventory_management": "shopify",
"fulfillable_quantity": "6",
"total_discount": "0.00",
"fulfillment_service": "manual"
},
"id": "13067164057842",
"price": "125.00",
"quantity": 6,
"sku": "CARSBLKM-09",
"grams": "680",
"title": "ChannelApe Men's Running Shoes - 9"
},
{
"additionalFields": {
"variant_id": "42186875338994",
"title": "ChannelApe Men's Running Shoes",
"variant_title": "10",
"product_id": "7484045623538",
"requires_shipping": "true",
"taxable": "true",
"gift_card": "false",
"variant_inventory_management": "shopify",
"fulfillable_quantity": "6",
"total_discount": "0.00",
"fulfillment_service": "manual"
},
"id": "13067164090610",
"price": "125.00",
"quantity": 6,
"sku": "CARSBLKM-10",
"grams": "680",
"title": "ChannelApe Men's Running Shoes - 10"
}
],
"locationId": "874",
"purchasedAt": "2023-08-14T12:12:23.297Z",
"purchaseOrderNumber": "RJDTPO-1692015143",
"shippingCompany": "USPS",
"shippingMethod": "1DA",
"status": "NEW",
"warehouseOrderId": "RJDTPO-1692015143",
"warehouseCode": "RJT2",
"warehouseCompany": "United Parcel Service",
"warehouseName": "UPS West Coast",
"warehouseId": "UPSW",
"warehouseZipcode": "91752",
"channelOrderId": "RJDTCOI-1692015143",
"channelId": "1fc7d777-f210-4e9c-ac24-90741eeec066",
"orderId": "fd4fda9f-452b-40e5-8ff2-f8796ea2443e"
}