---
title: Wholesale API Integration Guide
description: This wholesale API integration guide is written for a technical audience who possess an understanding of the order and fulfillment processes that are standard to EDI retailer integration.
---

[ChannelApe Blog](https://www.channelape.com/blog)

# [Wholesale API Integration Guide](https://www.channelape.com/blog/api/wholesale-api-integration-guide)

 Written by [Jordan Stokes](https://www.channelape.com/blog/author/jordan-stokes) | Dec 20, 2021, 10:27:12 PM

### Who is this for?

This guide is written for a technical audience who possess an understanding of the order and fulfillment processes that are standard to EDI retailer integration

- If you are an operations leader looking for the best way to marry X12 EDI retailers, VANs, or other providers with ChannelApe’s Fulfillment Management System

### Foreword

ChannelApe is a stateful system and this sometimes makes integration difficult for message-based systems.  

Additionally, the Rate Limiting of our RESTful APIs may introduce more complexity if your system is unable to recover and retry rejected requests.

### Please see the [ChannelApe API documentation](https://docs.channelape.io/#intro) to learn more about our APIs.

### References

- [Order Model](https://channelape.zendesk.com/hc/en-us/articles/360058534454-ChannelApe-Order)
- [Fulfillment Model](https://channelape.zendesk.com/hc/en-us/articles/360058534454-ChannelApe-Order#fulfillment)

### Authorization

ChannelApe’s API endpoints are authenticated using a secret token via a custom header on every API call, X-Channel-Ape-Authorization-Token.

Tokens are created alongside API Users which must be done by a business owner.

### Overview of Wholesale API Integration Dataflows

### Creating Purchase Orders

To fulfill an order, [create an order](https://docs.channelape.io/#16c21514-30f0-45d8-b80f-6a36a8bb19a1) in ChannelApe.

- ChannelApe requires one shipping destination per order so if customers are placing multi-store orders you will need to split the 850 by shipping destination
- [ChannelApe’s Inventory Management System](https://channelape.zendesk.com/hc/en-us/articles/1500000062901-ChannelApe-Inventory-Management-System) is indexed by SKU, which is your Vendor Part Number (your SKU). In order for ChannelApe to accurately maintain inventory these orders must use the Vendor’s Part Numbers, so if customers are placing orders with their Buyer Part Numbers (their SKUs) you will need to convert these to your SKU before creating the order in ChannelApe. 
    - The same goes for UPC.  [ChannelApe’s Inventory Management System](https://channelape.zendesk.com/hc/en-us/articles/1500000062901-ChannelApe-Inventory-Management-System) does not use UPC so you will need to convert the item to the SKU on record with ChannelApe. 
          - If the Buyer’s catalog is available in CSV format, ChannelApe can import the catalog and you can use our [Variant Searches API](https://docs.channelape.io/#ddade195-8aa6-4748-a509-b264e9311e70) to perform the cross-reference lookup on their SKU or UPC.

### Retrieving the Purchase Orders Acknowledgement

To generate a **Purchase Order Acknowledgement**, [query ChannelApe for **IN\_PROGRESS** *orders* on the **Wholesale Channel**](https://docs.channelape.io/#a74e4f7f-bf3f-46bd-b185-59e88039f8f9) or if you’re looking for a specific **Purchase Order**, you can [query ChannelApe by **purchase Order Number**](https://docs.channelape.io/#8a24015e-9fd4-408e-acad-a6136ce9857d), and create an 855 for each **PENDING** fulfillment found.

- **Note:** You will need to keep track of which **PENDING** fulfillments you’ve processed and acknowledged.  **PENDING** fulfillments will have two fields you can use for this: the **id** which is on the fulfillment level and the **warehouse\_order\_id** which is in the fulfillment’s **additional fields**.
- You can optionally specify an **updated** timestamp to return only orders updated since the last time you queried if your system is capable of maintaining the last query time.
- Some 3PLs can reject a fulfillment request, when this happens ChannelApe will change the order to **HOLD**.

**cURL Example**

| curl –location –request GET ‘https://api.channelape.com/v1/orders?channelId=846d2a6d-f420-441e-bffe-5c064f8c75de&status=IN\_PROGRESS&updatedAtStartDate=2021-06-01T20:00:00.403Z&updatedAtEndDate=2021-06-01T20:30:00.403Z’ \\ –header ‘Content-Type: application/json’ \\ –header ‘X-Channel-Ape-Authorization-Token: XXXXXXXX-cbeb-4f28-801d-XXXXXXXXXX67’ |
| --- |

### Retrieving Shipment Confirmations

To get Shipment Confirmations, [query ChannelApe for **IN\_PROGRESS** *orders* on the *Wholesale Channel*](https://docs.channelape.io/#a74e4f7f-bf3f-46bd-b185-59e88039f8f9) or if you’re looking for a specific **Purchase Order**, you can [query ChannelApe by **purchase Order Number**](https://docs.channelape.io/#8a24015e-9fd4-408e-acad-a6136ce9857d), and create an 856 for each **OPEN** fulfillment found.

- **Note:** As with the previous step, you will need to keep track of which **OPEN** fulfillments you’ve processed. The **id** is the best field to use for **OPEN** fulfillments
- After processing the **OPEN** fulfillment, change the fulfillment status to **SUCCESS** by [PATCHing the order](https://docs.channelape.io/#3e038c1b-8bab-4e9c-a142-f0e3b9f8d23a) fulfillments list. 
    - **Caution**: We do not support PATCH on the fulfillment level so you will need to preserve *all* the fulfillments in your request body.
- If there are no more **PENDING** or **OPEN** fulfillments on the order, change the order status to **CLOSED** by [PATCHing just the order status](https://docs.channelape.io/#3e038c1b-8bab-4e9c-a142-f0e3b9f8d23a).
- **SOPI** and **SOTPI** structures must be built on your end.  ChannelApe’s fulfillment data model provides access to the GS1-128, SSCC-18, BOL, and Master BOL as additional fields on the fulfillment.

**cURL Example**

| curl –location –request PATCH ‘https://api.channelape.com/v1/orders/21c922c0-69a4-425b-aea3-4ad8e1aaffc4’ \\ –header ‘Content-Type: application/json’ \\ –header ‘X-Channel-Ape-Authorization-Token: XXXXXXXX-cbeb-4f28-801d-XXXXXXXXXX67’ \\ –data-raw ‘{ “status”: “CLOSED”, “fulfillments”: \[ { “id”: “1091235123”, “status”: “SUCCESS”, “shippingCompany”: “UPS”, “shippingMethod”: “GROUND”, “trackingNumber”: “1Z999AA10123456784”, “warehouseOrderId”: “#100351-1”, “billOfLading”: “12000013”, “masterBillOfLading”: “”, “palletCode”: “01108479760000401319112010ABC1234”, “containerCode”: “00001234560000000018”, “lineItems”: \[ { “id”: “1”, “sku”: “VN120-1”, “upc”: “123456789012”, “quantity”: “12” } \] } \] }’ |
| --- |

### Generating Invoices

To generate **Invoices**, [query ChannelApe for **CLOSED** orders on the **Wholesale Channe**](https://docs.channelape.io/#a74e4f7f-bf3f-46bd-b185-59e88039f8f9)**l**.

- **Note:** You will need to keep track of which orders you processed to ensure you are not duplicating invoices. 
- As with the other steps, you have the option of querying orders that have been updated since the last time you queried if your system is capable of storing the last query time.

[View full post](https://www.channelape.com/blog/api/wholesale-api-integration-guide)

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Jordan Stokes"
  },
  "dateModified" : "2022-02-22T03:44:13.116Z",
  "datePublished" : "2021-12-20T22:27:12Z",
  "headline" : "Wholesale API Integration Guide",
  "image" : {
    "@type" : "ImageObject",
    "height" : 409,
    "url" : "https://f.hubspotusercontent10.net/hubfs/6043565/contemporary-it-developer-2021-09-24-04-17-50-utc%201.png",
    "width" : 544
  },
  "mainEntityOfPage" : "https://www.channelape.com/blog/api/wholesale-api-integration-guide",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 60.0,
      "url" : "https://6043565.fs1.hubspotusercontent-na1.net/hubfs/6043565/2160555841956752810_2160503356726803253_InvoiceLogo_400x5.png",
      "width" : 281.63266
    },
    "name" : "Inventory & Order Management Blog"
  }
}
```