Publisher Integration
API Reference
Order Push Configuration

1. How to Push Orders

1. What is Order Push

Linkbest supports pushing publisher promotion effect orders to publisher platforms actively.

2. Fill in the Pushing Address

After publishers access Linkbest, fill in "Order Pushing Address" on the Linkbest website.
Log in to Linkbest, go to "My Tools" -> "Order Pushing Service". In the corresponding list item, click "Configure Pushing Address".

Then fill in the address you need to push the order in the pop-up window, note that entering a new address will override the original address and leaving it blank means canceling the setting.

When submitted, Linkbest will make a test push to verify the interface. The pushing interface needs to return 1, 0 to indicate that the test data has been received, and -1 means that the test data has not been received.More Details

3. Precautions

The Status of orders actively pushed by Linkbest includes: created, confirmed settlement, settled, invalidated. Publisher platforms will be actively pushed when the above states occur.

The confirmed settlement, settled, invalidated Statuses of Linkbest orders are currently marked as confirmed settlements, settlements, and invalidations when the settlement process is completed in Linkbest.

If publishers need the original order Status of the e-commerce platform (created, paid, returned, etc.), please use the Linkbest order details inquiry API. Currently, only online merchants that support real-time order Status updates will have Status updates, such as JD, Taobao.

2. Push Data

Linkbest will initiate a Get request to the pushing address and send the order data as a request parameter. Pushing one order each time, Linkbest will add a Sign parameter to the parameter list as a verification. See the following section for details.

1. Push Parameter Explanation

All parameter names are in upperCamelCase characters, and the values are UTF8 encoded

ParameterDescription
IdPush ID
ProgramIdPromotion plan ID
ProgramNamePromotion plan name
WebsiteIdWebsite ID
SubIdChannel custom tag value of the order
OrderSnOrder number
OrderTimeTime when the order is placed
OrdersPriceOrder amount: when the order Status is 1 or 2, the order_price indicates the confirmed order amount
CommissionOrder Commission: when the order Status is 1 or 2, Commission indicates the confirmed Commission, and other Status values are order estimated Commission
CurrencyCurrency, CNY is RMB, USD is USD
StatusOrder Status: -1 invalid, 0 unconfirmed, 1 confirmed, 2 settled
RemarkOrder description information
OriginalStatusThe original state of the business
SignSign of the push data, Sign = MD5 (the "parameter value" is spliced ​​into a string according to the first letter of the parameter index in ascending order + AppSecret), the parameter value spliced ​​does not include the parameter values of Sign and id
2. Receiving Request Security Verification

The parameters of the request may increase or decrease according to the needs. For the recipient, we recommend verifying the Sign value. The verification logic and code example are as follows:

After receiving a request

  1. First extract Sign, id.

  2. Sort the remaining data in the array index in alphabetical order.

  3. Concatenate the sorted array data in the order of value1+value2+value3+... to get string.

  4. Check whether Sign equals to md5(string+AppSecret)

PHP code example:

$app_secret = 'your secret'; // interface key
$params = $_REQUEST;
$Sign = $params['Sign'];
$id = $params['Id'];
unset($params['Sign'], $params['Id']);
ksort($params);
$localSign = md5(join('', array_values($params)) . $app_secret);

//If $localSign == $Sign is a legal push
if($localSign != $Sign){
    throw new Exception("Illegal push");
}

3. response requirements after receiving the request

If the push is successful, please output the following value from the receiver: 1 means that the push is successful and the order has been successfully placed in the warehouse. 0 means the push was successful, but the order already exists. -1 means push failed.

If the recipient does not feedback any data, we also consider the push to fail.

4. review the test push of the push address

In order to review the validity of the filled-in interface, we will construct a test push during the review. The pushed data is as follows:

ParameterValue
ProgramId0
ProgramNametest
WebsiteId0
SubId
OrderSn0
OrderTime0000-00-00 00:00:00
OrdersPrice0.00
Commission0.00
CurrencyCNY
Status-1
Remark
OriginalStatusTo be paid

After receiving the above information, please output 0 or 1 through the interface. By default, the interface does not receive data. For direct access, please output -1 or no output.