Gateway O WeChat Integration

Glossary

TERM

EXPLANATION

TERM

EXPLANATION

ORP

Omni-channel Retail Platform

OMS

Order Management System (part of ORP)

FTP server

File Transfer Protocol server

DTO

Data Transfer Object

Table of contents

Introduction

The purpose of this document is to detail the various aspects that need to be taken into account to integrate your WeChat webstore with ORP.

ORP facilitates the interaction between WeChat and your ERP systems. That means, all orders placed on WeChat are made available in a central location in ORP that can be conveniently imported. Similarly, ORP implements a simple approach to updating your WeChat webstore’s stock and relaying shipping information to your customers.

Integration overview

ORP facilitates 3 different interactions:

  1. Retrieving and distributing orders to a central location where they can be imported;

  2. Maintaining stock levels by SKU;

  3. Handling shipping confirmations.

Figure 1 below illustrates the process flow for the abovementioned interactions:

Figure 1: The process flow for orders (blue), stock (red), and shipping information (purple).

As seen in figure 1, orders placed on the WeChat platform enter ORP where they are stored in the OMS (as indicated by the blue flow). Orders are then placed on an FTP server instance where they can be retrieved by your systems.

Stock levels can be updated by means of uploading a file to the FTP. This file has to contain the new stock levels of products you wish to update. Stock files are processed hourly, which means stock levels can be altered a total of 24 times a day.

Once an order has been processed and shipped, shipping information needs to be uploaded to your FTP instance. This information will be imported into ORP and forwarded to WeChat where the customer will be informed of their order’s progress.

Orders

Orders will be placed in the corresponding folder on the FTP. It is your responsibility to monitor this folder and import any orders that are placed inside this folder into your system(s).

Orders will be in JSON format and will conform to a standard set out and maintained by Wolfpack DCS. See Order data contract.

Order statuses

ORP orders placed on the FTP can be in one of the following statuses:

  1. NEW

  2. EXPORTED

  3. SHIPPED

  4. MIXED

  5. CANCELLED

The NEW status is the first status that is assigned to an order when it is created in ORP. This means that the order has been completely paid by the customer and has just entered ORP.

The EXPORTED status is the second status that is assigned to an order when it is placed on the FTP server.

The SHIPPED status is assigned to an order when ORP receives a full shipping confirmation on the FTP server. This status also indicates that WeChat has been updated with the shipping information.

The MIXED status is assigned to an order when ORP receives shipping information with mispicks and shipped items. This status also indicates that WeChat has been updated with the mispick information.

The CANCELLED status is assigned to an order when ORP receives shipping information containing only mispicks. No status update is sent, however the cancelled order information is still communicated to WeChat.

Order data contract

The JSON object format shown in figure 2 will be uploaded to the FTP instance - ready for import into your system(s). This is the Wolfpack DCS order DTO.

{ "externalId": "string", "erpChannelId": "string", "orderNumber": "string", "orderType": "string", "customerNumber": "string", "customerName": "string", "customerEmail": "string", "orderLines": [ { "orderLinePriceAdjustment": [ { "id": 0, "description": "string", "netAdjustment": 0, "taxAdjustment": 0, "grossAdjustment": 0, "reasonType": "string", "reasonId": "string", "promotionId": "string", "usedCoupons": [ { "couponBatch": "string", "couponCode": "string" } ] } ], "refundInfo": { "reasonType": "string", "reasonId": "string", "description": "string", "originalOrderNumber": "string", "originalOrderLineId": 0 }, "ean": "string", "sku": "string", "externalId": "string", "quantity": 0, "lineNumber": 0, "online": true, "name": "string", "imageUrl": "string", "productInformation": "string", "taxPercentage": 0, "grossPrice": 0, "originalGrossPrice": 0, "customOrderLineProperties": [ { "key": "string", "value": "string" } ] } ], "payments": [ { "operationType": "string", "paymentOrigin": "string", "paymentHandler": "string", "paymentType": "string", "processorId": "string", "name": "string", "amountPaid": 0, "includesShippingCosts": true, "customPaymentProperties": [ { "key": "string", "value": "string" } ] } ], "priceAdjustments": [ { "id": 0, "description": "string", "netAdjustment": 0, "taxAdjustment": 0, "grossAdjustment": 0, "reasonType": "string", "reasonId": "string", "promotionId": "string", "usedCoupons": [ { "couponBatch": "string", "couponCode": "string" } ] } ], "customOrderProperties": [ { "key": "string", "value": "string" } ], "currencyCode": "string", "originalGrossPrice": 0, "grossPrice": 0, "shippingGrossPrice": 0, "shippingTaxPercentage": 0, "shipments": [ { "shippingMethod": "string", "shipmentLines": [ { "quantity": 0, "orderLineExternalId": "string" } ], "shippingAddress": { "id": 0, "firstName": "string", "lastName": "string", "address1": "string", "address2": "string", "address3": "string", "city": "string", "postalCode": "string", "email": "string", "companyName": "string", "countryCode": "string", "stateCode": "string", "phone": "string", "customAddressProperties": [ { "key": "string", "value": "string" } ] } } ], "issuedCoupons": [ { "customerSpecific": true, "couponBatch": "string", "couponCode": "string", "validFrom": "2021-03-08T13:21:41.306Z", "validUntil": "2021-03-08T13:21:41.306Z" } ], "customerLocale": "string", "billingAddress": { "id": 0, "firstName": "string", "lastName": "string", "address1": "string", "address2": "string", "address3": "string", "city": "string", "postalCode": "string", "email": "string", "companyName": "string", "countryCode": "string", "stateCode": "string", "phone": "string", "customAddressProperties": [ { "key": "string", "value": "string" } ] }, "orderDate": "2021-03-08T13:21:41.306Z", "customOrderStatusId": 0, "notes": [ { "isSystem": true, "message": "string", "author": "string" } ] }

Figure 2: The ORP order JSON that will be uploaded to the FTP instance.

Stock

The stock keeping mechanism in ORP is kept simple with stock level processing occurring hourly.

It is your responsibility to update the stock levels of your products within ORP. This can be achieved by uploading a .CSV file containing the new stock level per SKU to the FTP instance. ORP checks the FTP instance for a new file every hour. If a file has been uploaded, it will be consequently processed. If no file has been uploaded, no stock levels will be adjusted.

The stock quantity in the uploaded .CSV file will become the newly available stock quantity in ORP.

Stock file format

ORP defines the format of the .CSV file as follows (figure 3):

sku,available,stockentity ITEM-01,8,warehouse-01 ITEM-02,10,warehouse-01

Figure 3: The format of the .CSV file used for stock updates.

The first column (SKU) in the .CSV file represents the SKU of the product. This has to match the SKU that is maintained in the ORP database.

The second column (available) is the new quantity available for the given SKU. No calculation is done on this field - it is seen as the new truth for the number of items available for sale.

The third column (stockentity) refers to the warehouse. It might be your brand has more than one warehouse where your products are stored. In this case, the product can be updated per SKU per warehouse. If only one warehouse exists, the same value can be populated for all rows in the file.

Updating stock deltas

When ORP receives the stock update file on the FTP instance, it will perform a “delta check” to determine whether the stock available for a specific SKU has in fact changed and merits an update. To illustrate this, consider the following:

  1. A new stock update .CSV is uploaded to the FTP containing the following:
    ITEM-01,5,warehouse-01

    ITEM-02,7,warehouse-01

  2. ORP retrieves the file and performs a delta check;

  3. In the ORP stock database, ITEM-01 has a stock quantity of 5. That means the stock available for this item did not change. As such, ORP will ignore updating the stock level for this SKU;

  4. In the ORP stock database, ITEM-02 has a stock quantity of 10. That means 3 products have become unavailable on the platform and the stock needs to be adjusted accordingly. As such, ORP will make a call to the WeChat platform to update the quantity available for this SKU.

By performing this delta check, ORP can limit the number of calls it makes to the WeChat platform by only updating what is necessary.

Shipping information

ORP enables you to update an order with shipping information by uploading a JSON object to the FTP instance. This information will be consequently imported into ORP and forwarded to WeChat.

ORP defines and maintains the data contract that will be used (see Shipping information data contract).

Shipping information data contract

Wolfpack DCS maintains the data contract of the shipping information (figure 4). It is your responsibility to upload the JSON object in figure 4 to your FTP instance:

{ "orderNumber": "string", "shipments": [ { "trackAndTrace": "string", "trackAndTraceUrl": "string", "carrier": "string", "shippedItems": [ { "sku": "string", "orderedQuantity": 0, // The total quantity that was ordered for this SKU. "shippedQuantity": 0 // The total quantity that was shipped in the parcel. } ] } ] }

Figure 4: The data contract for shipping information.

FTP

Wolfpack DCS has opted to use FTP file processing in facilitating the communication between your brand and ORP. The reason for this is because it aids in retrying in case of failures and also allows a neat history of the requests received - since all successfully processed files are archived automatically by ORP.

Each brand that integrates with ORP will have its own FTP instance and authentication credentials.

FTP environments

There will be 2 FTP environments:

  1. STAGING;

  2. PRODUCTION.

Please contact a representative from Wolfpack DCS in order to receive FTP credentials. You can contact the team by sending an email to support@wolfpack-dcs.com.

FTP locations

ORP will use the following FTP locations to communicate orders and receive and process stock mutations and shipping information:

TYPE OF UPDATE

FTP FOLDER STRUCTURE

ARCHIVE FOLDER STRUCTURE

TYPE OF UPDATE

FTP FOLDER STRUCTURE

ARCHIVE FOLDER STRUCTURE

Exported orders JSON blob

/export/order/

/archive/order/

Stock mutation .CSV file

/import/stock/

archive/stock/

Shipping confirmation JSON blob

/import/shipping/

archive/shipping/

After a file has been processed, it should be removed from its original folder and placed in the corresponding archive folder (for audit purposes). ORP archives stock mutations and shipping information as part of its import process. It will be your responsibility to archive the order JSON once processed.

copyright wolfpack DCS b.v. 2020