Taobao Global Open Platform is an end-to-end API development and operation integration platform that provides developers with programmatic access to data on products, orders, shipments, logistics and settlements of platform sellers and resellers, and provides a development environment for users to integrate applications through the API system to provide more diverse seller needs and share your applications to more Taobao global sellers.
The open platform has the following features and advantages.
If you are new to the Taobao Global Open Platform, this guide will help you quickly understand how to start developing your application using the API, deploying it live and sharing your application to users of the Taobao Global Business.
To enter the cross-border supply platform, note that you need to register in advance, to go for approval (about 1 to 2 people days), generally find their own business classmates to register. After registration, through the open platform of the authorization address link, looking for business students to log in cross-border supply platform for the corresponding authorization, and through the callback address to obtain the authorization code code, with code can call the creation of Token interface to generate a token!
https://distributor.taobao.global/apps/register/registration
Cross-border supply platform help document:
If you are a third-party developer who wishes to develop applications that integrate with the Taobao Global Open Platform business through APIs, then you can register as a developer on the Taobao Global Open Platform. Firstly, you can ask your business peers to register a developer account and sign the platform's developer agreement.
Register a developer account on the Taobao Global Open Platform by following these steps.
1) Open the Taobao Global Open Platform homepage at https://open.taobao.global and click on "Join Now".
2) Enter your email address and verification code on the page that opens, then click on "Send Email" to verify.
3) Open the verification email from your email address and click on the verification link, the account registration page will open again. Note: The verification email may be in a spam folder.
4) On the account registration page, set your password, read and check the box to accept the Taobao Global Open Platform Developer Agreement.
5) Click "Finish" to complete your account registration.
Description: Once your Open Platform developer account has been added, you can start registering your app on the Taobao Global Open Platform.
Description: The application type is used to initialise the data configuration when an application is added. It is a template that defines information about the application's licensing policy, licence duration, API licence rights group, API call restriction policy, etc. An application can only belong to one application type. The Supply and Sales Platform application type is "Global supply and marketing platform/全球供销平台".
Specific step-by-step details.:
A. Log in to the Taobao Global Open Platform and open the APP Console;
B. Click on "Add" to display a list of application types that can be applied for;
C. Read the app type description, find the app type you want to apply for and click "Apply';
D. Enter the business requirement for requesting the application type in the "Reason" field of the application window;
E. (Optional) Attach documentation to the request if required. The documentation can be a market analysis, a business plan or the design of the application;
F. Click 'OK' to submit the request;
G. The status of the application type will be displayed as 'Pending' and your request will be reviewed by the platform administrator (approximately 2-3 working days). If you are unable to find a suitable category for your application, please contact the Taobao Global Open Platform Operations team;
Description: Once the application type request is approved, the status of the application type will change to "valid", after which you can submit detailed information about your application. The steps are as follows:
Create application details:
A. On the request type page, click "Add APP ";
B. Enter information about the application, including: Application name, callback address (redirect URL for seller authorization), application LOGO;
C. Click on "Submit";
D. Once the app has been successfully added, click on "APP Overview" to view the list of apps, including the app name, app key, type and status of each application;
AppKey: It is the unique identifier of the application on the Taobao Global Open Platform. The App Key is one of the parameters that must be included when making an API call request and the application will be identified by the Taobao Global Open Platform through the App Key.
AppSecret: It is the password assigned to the app by Taobao Global Open Platform to ensure the security and reliability of the app source. You must keep the app key safe and do not share it with other third parties.
Once your app registration is complete, the App Key and App Secret will be generated automatically. You can view or reset the App Key from the App Console/App Preview page.
As shown in the picture:
On the Taobao Global Open Platform, an API Permission Group defines a set of API groups with specific permission bindings. Without an API permission, API calls initiated by an application will be rejected.
An application type can contain multiple API permission groups. When the application is added, it will be granted some API permission groups, but other permission groups need to apply separately. The status of the API permission group is as follows:
Configure Seller Authorization If your application needs to access the seller's business data, your application needs to be authorized by the seller. You need to guide them to complete the "Authorization with Taobao Global Account" process. After registering your application on Taobao Global Open Platform, you can start your application development. API reference-A complete reference document for each API.
Taobao Global Open Platform uses OAuth 2.0 protocol for user authentication and provides different authorization policies for different application categories, which are predefined for the application category your application belongs to. You can view the detailed authorisation policies for your application on the Authorisation Management page, including the following:
Important to note that the following two authorisation policies apply to different app categories:
If you have developed an app for a specific seller, you can limit the scope of authorisation by specifying a whitelist of sellers on the Taobao Global Open Platform, so that only these sellers can authorise your app to access their business data on the Taobao Marketplace. After your app has been deployed online, you will need to provide your sellers with the authorisation URL and when they log into your app for the first time, they will be prompted to complete the authorisation process.
Take the following steps to specify the short code of the seller who can authorise your application to access their business data:
Take the following steps to specify a shortcode for sellers who can authorize your application to access their business data:
Description: If your application needs to access a seller's business data (e.g. product and order information) via the Taobao Global Open Platform, you will need to obtain the seller's authorisation, i.e. the 'Access Token' required to access the seller's information. You will need to guide the seller through the 'Application for Authorisation to Login using the Cross Border Supply Platform' process. This process uses the international OAuth 2.0 standard protocol for user authentication and authorisation.
The Taobao Global Open Platform uses the "Code for token" model, described as follows:
Server Address: https://api.taobao.global/oauth/authorize
Authorisation steps (as shown in the diagram):
Spell out the authorised URLs and direct access to them by business students according to the following rules:
Note: Please replace "appkey" and "redirect_url" with your developer application configuration.
The list of authorization URL parameters is described below:
parameter |
Is it necessary? |
value |
describe |
client_id |
xxx |
The App Key of your application assigned by the open platform. |
|
redirect_url |
The file back URL provided when the application is created. |
Redirect_url is the receiving code returned to you by the seller upon completion of authorization, which must be the same as the file URL provided when creating the application on taobao Global Open Platform. |
|
response_type |
code |
The authorization type whose value is code. |
|
force_auth |
true |
Refresh the Web browser Cookie to obtain the new authorization process. |
|
state |
It can be customized, for example, 1212. |
The state of the application is the same as that of input and response. |
|
uuid |
uuid283118319 |
The identity assigned to the seller protects the returned authorization code. |
Guide the distributor to open the above authorization URL through the web browser, and the authorization login page as shown in the following figure will appear. The left side shows the permissions granted by the seller to the application after Authorization. You need to enter the cross-border supply platform account and password registered in step 2.2 (note that it is not an open platform account! Otherwise, it cannot be purchased normally), click "Log in and Authorize" to complete the authorization of the application.
After the seller completes the authorization, Taobao Global Open Platform returns the authorization code to the return URL address. Your application uses the authorization code to obtain the AccessToken. The URL will be the APP callback address you set + authorization code (code)
For example:
Note:
Description: Use the API "/auth/token/create" to get AccessToken
Note: The Access Token is valid within a certain time range. The seller does not need to re-authorize the application before it expires. You need to be properly Keep the latest token.
IopClient client = new IopClientImpl("https://api.taobao.global/rest", appkey, appSecret); IopRequest request = new IopRequest("/auth/token/create"); request.addApiParameter("code", "0_TryzT8Vd9T1pwS7VWZ2qlMOS5"); IopResponse response = client.execute(request); System.out.println(response.getBody());
Output parameters (for reference only):
{
"code": "0",
"access_token": "50000601c30atpedfgu3LVvik87Ixlsvle3mSoB7701ceb156fPunYZ43GBg",
"refresh_token": "500016000300bwa2WteaQyfwBMnPxurcA0mXGhQdTt18356663CfcDTYpWoi",
"account_id": "7063844",
"user_Id": "1001",
"account_platform": "seller_center",
"refresh_expires_in": "60",
"error_code": "error_code",
"expires_in": "10",
"request_id": "0ba2887315178178017221014",
"seller_Id": "10011",
"account": "xxx@126.com",
"short_code": "HK001"
}
The following table lists the token parameters and descriptions:
Key |
Type |
Sample |
Description |
access_token |
string |
50000601c30atpedfgu3LVvik87Ixlsvle3mSoB7701ceb156fPunYZ43GBg |
Access token. |
refresh_token |
string |
500016000300bwa2WteaQyfwBMnPxurcA0mXGhQdTt18356663CfcDTYpWoi |
Refresh token, used to Refresh when refresh_expires_in >0. |
expires_in |
number |
25920 (expires in 25920 seconds) |
The Access token expires in seconds: 7 days for "test" applications, 30 days for "online" applications. |
refresh_expires_in |
number |
25920 (expires in 25920 seconds) |
Refresh Token expiration time 30 days for applications in test state 180 days for applications in online state refresh Token expiration time 30 days for applications in test state 180 days for applications in online state |
account_id |
string |
706388888 |
User ID, which can be ignored when account_platform = seller_center. |
account |
string |
User account. |
|
account_platform |
string |
seller_center |
User platform, supporting multiple platforms. |
View the actual validity period:
Note: The application of the developer who has not been released and launched (in the test phase) will be shorter than the application that has been launched. Therefore, the developer must apply for the application to be released and launched after the docking is completed! You can adjust the refresh token policy accordingly. If your business needs to extend the token or refresh token validity time, you can find the owner of the open platform to adjust it.
Example (test phase):
Description: Use the API "/auth/token/refresh" to update the AccessToken.
IopClient client = new IopClientImpl(UrlConstants.API_GATEWAY_URL_TW, appkey, appSecret); LazopRequest request = new LazopRequest(); request.setApiName("/auth/token/refresh"); request.addApiParameter("refresh_token", "50001600212wcwiOabwyjtEH11acc19aBOvQr9ZYkYDlr987D8BB88LIB8bj"); LazopResponse response = client.execute(request); System.out.println(response.getBody());
Output parameters (for reference only):
{
"code": "0",
"access_token": "50000601c30atpedfgu3LVvik87Ixlsvle3mSoB7701ceb156fPunYZ43GBg",
"refresh_token": "500016000300bwa2WteaQyfwBMnPxurcA0mXGhQdTt18356663CfcDTYpWoi",
"account_id": "7063844",
"user_Id": "1001",
"account_platform": "seller_center",
"refresh_expires_in": "60",
"error_code": "error_code",
"expires_in": "10",
"request_id": "0ba2887315178178017221014",
"seller_Id": "10011",
"account": "xxx@126.com",
"short_code": "HK001"
}
With API "/auth/token/refresh", the data structure returned is the same as the data structure returned by obtaining access rights through the authorization code. You will get new access_token and refresh_token . You must save the latest refresh_token to get a new access_token . Note that the access_token duration is reset, but the refresh_token duration is not reset. After the refresh_token expires, the seller will need to reauthorize your app to generate new access_token and refresh_token.
Note:
field |
Application Status: Test (aging) |
Application Status: Online (aging) |
code |
30 minutes |
30 minutes |
access_token |
30 days |
30 days |
refresh_token |
60 days |
180 days |
Description: The SDK is automatically generated for your application, including combining requests, generating encryption, response interpretation, and information monitoring. Use the SDK Call API operations are easy to understand. We recommend that you use the official SDK to call API operations.
Environmental requirements:
Before downloading the SDK, you must register as a developer and log on. The downloaded SDK is directly associated with the application.
To download the SDK for an application, you can take the following steps:
Address: https://open.taobao.global/app/index.htm#/sdk/download, as shown in the following figure:
Description: Before using the SDK, modify the request server
Call request address: https://api.taobao.global/rest
Call the API of Taobao Global Open Platform by using HTTP requests. You can use the SDK provided by the platform to call an API (recommended), or assemble the request according to the custom format of the Taobao Global Open Platform protocol (only if the official SDK is not provided in this programming language). This topic describes how to assemble HTTP requests to call.
API calls require input data and return data as output responses. The general steps for calling an API by generating an HTTP request are as follows:
For more information on open platform API calls, see API tutorials.
Taobao Global Open Platform provides an online production environment. The data generated in this environment is real and valid online data, and provides a limited number of calls and permissions. The production environment shares data with the online system. The real data of online stores is directly affected by API operations. Be sure to operate with caution.
The call request address is: https://api.taobao.global/rest
Taobao Global Open Platform API supports both HTTP and HTTPS communication protocols. To ensure data security, we recommend that you use the HTTPS protocol to send API requests. Although most APIs are called through GET, and some calls for additional request information are sent through POST, sometimes more information needs to be provided than the data that can be transmitted in the request parameters. In many cases, additional data is sent to the server through a POST request. The body of the request must be in XML format, and all data (including parameter names and values) must be utf8 encoded.
Each HTTP request URL must contain the API path. For example, a request to the/order/get API should be https://api.taobao.global/rest/order/get 。 Common parameters and business data are included in the request or sent through POST.
All API calls return a response document that shows the status of the operation (success or error) and may provide results and/or details related to the specified operation. The response format is JSON.
In addition to the parameters associated with the application, the call to the API must also contain system parameters. Different APIs require different application-specific parameters.
System parameters
System parameters are required for HTTP requests for each API call, as shown in the following table:
Name |
Type |
Whether or not mandatory |
Description |
app_key |
String |
Yes |
The app key assigned to the application. |
access_token |
String |
Conditional |
For APIs that require seller authorization, the seller authorization token is required. |
timestamp |
String |
Yes |
The time when the request is sent, in UTC or digital format, such as "2018-11-11 T12:00:00Z or 1517886554000". Note that the difference between the timestamp and the UTC time should not exceed 7200 seconds. |
sign_method |
String |
Yes |
The algorithm used for signature encryption. |
sign |
String |
Yes |
The password signature used to verify the request. |
Business parameters
In addition to the system parameters that must be included in the API call request, the request service parameters are also required. For more information about the business parameters of each API, see the API documentation.
Taobao Global Open Platform verifies the identity of each API request, and the server also verifies whether the call parameters are valid. Therefore, each HTTP request must contain signature information, and requests with invalid signatures will be rejected.
Taobao Global Open Platform uses the App Key and the key assigned to the application to verify the identity of the request. The App key is used to generate a signature string when requesting a URL and a server-side signature string. Please keep your key strictly confidential.
If you manually write HTTP requests without using the official SDK, you need to understand the following signature algorithms.
The process of generating a signature is as follows:
Taking the GetOrder (/order/get) API request as an example, the steps to form an HTTP request are as follows:
Step 1: Fill the basic parameters
Business parameters:
Step 2: Sort all parameters and values according to the parameter names in the ASCII table
Step 3: Connect the sorted parameters and their values to a string
access_tokentestapp_key123456order_id1234sign_methodsha256timestamp1517820392000
Step 4: Add the API name in front of the connected string
/order/getaccess_tokentestapp_key123456order_id1234sign_methodsha256timestamp1517820392000
Step 5: Signature encryption algorithm
Assuming that App Secret 为「helloworld」,The signature:
hex(sha256(/order/getaccess_tokentestapp_key123456order_id1234sign_methodsha256timestamp1517820392000))=4190D32361CFB9581350222F345CB77F3B19F0E31D162316848A2C1FFD5FAB4A
Step 6: Assemble the HTTP request and encode all parameters and values using the UTF-8 format (the order of the parameters can be arbitrary) (using "sign" parameters).
http://api.taobao.global/rest/order/get?app_key=123456&access_token=test×tamp=1517820392000&sign_method=sha256&order_id=1234&sign=4190D32361CFB9581350222F345CB77F3B19F0E31D162316848A2C1FFD5FAB4A
All API calls return a value that shows the status of the operation (success or error) and may provide results and/or details related to the specified operation.
When an API call fails, the system also returns a request ID and an error code. There are three common API call errors:
API platform error (ISV errors)
The API platform errors usually occur because the request from a user does not fulfill the basic verification. When encountering such errors, check the authority, frequency and other conditions of the applications. Then, check the uploaded parameters for completeness and validity based on the API documentation.
Business data error (ISP errors)
These errors are the result of a business logic error, these errors are caused if you do not follow the certain business rules set out by the Lazada Platform (e.g. product creation rules, platform policy rules, etc).
When encountering such errors, check whether the corresponding information is uploaded based on the error information. It is recommended to try again after correcting such errors. Should you still receive the error messages, please reach out to the Lazada Partner Seller Support to find out the business
Backend service error
The backend service errors are usually caused by the availability of API service. Please try again after some time, if the issue persists, please contact our technical support team.
For example
ErrorCode |
ErrorMsg |
Description |
ServiceTimeout |
The request has failed due to RPC timeout. |
an error message that describes the timeout of an API call |
502 Bad Gateway |
The proxy server received an invalid response from an upstream server. Sorry for the inconvenience. |
If the Qps is too high, the request fails to reach the gateway. We recommend that the distributor retry the request. |
InternalError |
The request processing has failed due to some unknown error, exception or failure. |
The API call failed. Check whether the input parameters and API documents are correct. |
Taobao Global Open Platform provides you with an API testing tool to test APIs on the platform. The steps to start the API testing tool are as follows:
Parameter description. The API test tool parameter is described as follows:
Name |
Description |
Sample values |
API Path |
which describes the path of the API that you want to test. |
/brands/get |
HTTP Method |
Most APIs are called through GET, and some calls that get additional request data are sent via POST. |
GET or POST |
App Key |
The unique identity of your application on the open platform is generated when the application is created. |
100126 |
Access Token |
The token required for your application to access seller sensitivity data. |
|
Business parameters |
The business parameters of the API to be tested. |
According to the selected API, different parameter fields can be filled in. |
Request |
When the parameters are specified, click the "Start Test" |button, and the request URL will be generated and displayed in the request field. |
|
Response |
The API response body of the specified parameter. |
After completing the configuration of the application, you can start testing the application using the Taobao Global Unified Account. You need a seller account to complete the vendor authorization process for interface debugging. If you don't have a test account, Taobao Global Open will provide you with some test accounts to test your application. To obtain a test account, follow these steps:
interface debugging. If you don't have a test account, Taobao Global Open will provide you with some test accounts to test your application. To obtain a test account, follow these steps:
Important information:
The password for the test account consists of (your developer account) and (password).
For example, if your developer account on the open platform is test@mail.com, and your developer account password is ABC, then the password for the test account is test@mail.com | ABC.
Note: In order to successfully test the application, you should issue 1000 + calls to the Open Platform every day for two weeks with a success rate of at least 95%. If you do not have enough test API call records, you will not be able to respond to your application.
Deploy applications When your application is developed and tested, you can deploy your application online to a hosting environment.
Do these steps to complete the deployment process:
Once the online deployment request is approved, the status of the application will be changed to online. The application can then be deployed to the requested or planned hosting environment.
After the application is published online, you can monitor the statistics of API calls initiated by the application through the Data Dashboard page.
The data dashboard provides the following categories of statistics:
APP statistics-Statistics based on API calls over a period of time
Seller Statistics-Seller's API call statistics over a period of time
Error code statistics-API error code statistics over a period of time
Fast procurement process (recommended) 1: commodity collision-transaction
Scenario description: According to the Taobao product ID, you can obtain the product model of the cross-border supply platform by using the product ID of the Taobao product, and purchase the product that has successfully collided with the database.
Fast procurement process (recommended) 2: Taobao similar recommendations-transactions.
Scenario description: The entry parameter is the Taobao product ID. You can obtain a batch of similar products in the Taobao product pool and have low prices (from low to high). You can place orders from the returned batch of products according to their own needs. (When similar users shop on Taobao, they search through a picture of the target product, and then Taobao retrieves the corresponding similar product and shows it to you from low to high according to the price).
Rapid procurement process (recommended) 1: Distribution-transaction
Scenario description: The platform selects a batch of goods from the product pool to the distributor according to the user's needs, or the distributor manually selects the required goods on the cross-border supply platform for distribution. After the product is successfully distributed, the supply and marketing platform system sends a successful delivery message to the distributor. The distributor can subscribe to the distribution message in the open platform developer application and analyze the message accordingly. Obtain product information (the message body mainly includes the channel product ID, distributor ID, etc.), call the cross-border supply platform product details interface based on the channel product ID to obtain the product details such as SKU, and persist to its own system platform, and then place orders for the product.
Quick procurement process (recommended) 2: Search (Post URL format)-transaction
Scenario: You can search for the same product in the cross-border supply platform based on the image of the purchased product or the channel product ID, and then obtain the returned product ID. You can call the cross-border supply platform to obtain the product details such as SKU, and then purchase the product.
Fast procurement process 3: cross-border supply platform with the same payment-transaction
Business description: distribution through the supply and marketing platform to initiate the purchase order, through the supply and marketing platform interface for the relevant after-sales operation, secondly, can also use the scene as shown in the following figure, through its own distribution platform after-sales capacity building, access to cross-border supply and marketing platform external OpenAPI to complete the after-sales purchase order. Before accessing the OpenAPI, it is necessary to go to the cross-border supply and marketing platform to experience the after-sales process to ensure that the overall process is familiar with the convenience of after-sales interface docking. (The following figure only shows the overall process. For other Reverse order queries, message queries, etc., you can consult the relevant interfaces, and don't forget the synchronization of reverse messages.)
API document address:
https://open.taobao.global/doc/api.htm#/api?cid=8&path=/auth/token/refresh&methodType=GET/POST
API name |
Description |
Version (must see) |
When the seller and distributor complete the authorization, you can obtain the authorization code from the Call Back URL and use this API to further obtain the access token. |
||
When the Access Token expires, use this API to obtain a new Access Token. |
API name |
Description |
Version (must see) |
|
Batch collision (you can understand batch query products) Note: The entry is Taobao product ID, which is the same as the single product collision Library. |
|
|
The status of the goods on the selling e-commerce platform. |
|
|
Single product collision Library (understandable query product) Note: The entry parameter is the product ID of Taobao. |
|
|
Category tree query |
|
|
Taobao product query Note: The entry is Taobao product ID. |
|
|
Obtain the channel product ID based on Taobao product ID Note: For the time being, the product ID of Taobao is not available. |
|
|
Query the list of products that have been sold or canceled by the distributor. Note: This interface only supports Shopping Guide scenarios! The purchasing scene is not used. |
|
|
Supply and marketing platform product details. Note: The input parameter is the mp_Id of the product on the supply and marketing platform, and the ID of the non-Taobao product. |
|
|
Big promotion commodity discount inquiry. Note: You can only participate in the price query of the product. |
|
|
Search for product images. Note: Search for the same product in the cross-border supply platform based on the picture or the product ID of the supply and marketing platform market. |
|
|
Similar recommended queries. Note: The entry parameter is the Taobao product ID. You can obtain a batch of similar products in the Taobao product pool, and the price is low (the price is low to high). |
|
|
Distributor distribution (establishing a commodity relationship), before purchasing the distributor must establish a binding relationship with the product. Note: At present, the order will be automatically laid out (the relationship between goods and merchants) can be discarded. |
|
|
Supply and marketing platform products with the same amount of query. |
API name |
Description |
Version (must see) |
|
Cancel the purchase order. Note: After the merchant delivers goods, it will not be able to cancel it through this interface, and it needs to go to the cross-border supply platform to initiate after-sales reverse. (It is recommended that all paid purchase orders go through the after-sales interface). |
|
|
Purchase order bulk payment Note: The input parameter is the purchase order ID of the cross-border supply platform. This interface is executed asynchronously. It is only submitted for payment and the purchase order that cannot be paid is filtered out. The returned results are for reference only. In the end, information synchronization must be performed through the purchase query interface. Otherwise, data consistency problems will occur. |
|
|
Create a purchase order. Note: 1. The asynchronous logic used behind this interface allows you to synchronize data by subscribing to the purchase order status change message. 2. Product details in the entry (commodity ID must check the mp_id returned by the commodity interface, sku_id is also taken mp_sku_id, otherwise it cannot create a single normally! Because of the post-distribution data model) 3.outer_purchase_id is an idempotent field, remember that each order must be unique. 4. Market channel_order_type mainly depends on your specific application scenario: purchasing scene fill in: PANAMA_DG, shopping guide scenario: PANAMA (default) |
|
|
Query the purchase order. Note: Pay attention to the input of this interface, and the shipped orders will have corresponding logistics. |
(1) Overall business process
(2) After-sales interface details
API name |
Description |
Version (must see) |
Reverse order rendering interface Description: The distributor initiates a refund and calls this interface to obtain the reason for the refund and the maximum amount of the refund. Provide the reverse interface certainty information (refund type + cargo status) to determine the refund reason list, (refund type, cargo status, refund reason) to determine the maximum refund amount. |
||
|
Reverse order submission Description: The distributor initiates a refund. After filling in the information (the information can be obtained from the rendering interface), submit a reverse order. |
|
|
Reverse single modification interface Description: The distributor modified the reverse order information. |
|
|
Reverse order details interface Description: The distributor can view the details of the reverse order. |
|
|
Reverse single list query interface Description: Distributor Reverse order list query. |
|
/order/refund/render/logistics
|
Return logistics rendering interface Description: The distributor initiates a refund of the return, and the seller agrees to obtain the logistics information. |
|
/order/refund/submit/logistics
|
Return logistics submission interface Description: The distributor initiates a return refund. After the seller agrees, fill in the logistics information and submit the return logistics. |
|
|
Reverse undo interface Description: The distributor cancels the reverse application. |
|
submit reverse Message Interface Description: The distributor submits a Reverse order message. |
||
|
Message list query interface Description: Query the list of reverse messages, including paging. |
(3) Reverse state enumeration
refundType
code |
Description |
1 |
Only Return Money |
2 |
Return All (Return Money and Return goods) |
goodsStatus
code |
Description |
1 |
Not to deliver goods |
2 |
Has been shipped |
3 |
Not received the goods |
4 |
Have received the goods |
5 |
Has been sent back |
6 |
Seller confirms receipt of goods |
Description: When applying for a refund, the refund type and the status of the goods can be transferred according to the specific scenario.
Description of refund types and good status
refund status
code |
Description |
0 |
Not applying for a refund |
10 |
The buyer has applied for a refund and is awaiting approval from the seller |
20 |
The seller has agreed to refund and wait for the buyer to return goods |
30 |
The buyer has returned the goods and is waiting for the seller to confirm receipt |
100 |
Refund success |
-10 |
The seller refused to refund |
-20 |
Refund close |
Solution ideas:
API:/product/get
Common QA:
ErrorCode |
ErrorDescription |
Solution |
SYSTEM_ERROR |
未查到淘宝商品 |
Did not find Taobao goods, indicating that the Taobao products have been deleted or off the shelves, please replace other sellers to buy |
SYSTEM_ERROR |
此商家商品不能通过分销方式售卖,请更换商家 |
This merchant goods can not be sold through distribution, please change the merchant, according to the prompt to change a merchant to purchase goods |
SYSTEM_ERROR |
暂不支持购买淘特商品 |
Does not support the purchase of tamote goods, currently does not support taote goods |
SYSTEM_ERROR |
撞库不是供销平台签约商品 |
Distribution is not a supply and marketing platform contracted goods, according to the prompt to replace a merchant for commodity procurement |
SYSTEM_ERROR |
铺货失败 |
Delivery failure, contact relevant supply and marketing platform technical person in charge to assist |
SYSTEM_ERROR |
批量撞库未查询到该商品的mpId |
Batch collision Library did not find the mpId of the product contact the relevant supply and marketing platform technical director for assistance |
Note:
Common QA:
ErrorCode |
ErrorDescription |
Solution |
GOODS_UN_BUILD_RELATION_OR_NOT_CORRECT |
商家未和该商品建立关系,请检查商品的正确性(用跨境供货平台商品ID)后重试创单600037765030623443 |
(1) Check the channel channel_order_type Whether to fill in the error, according to the specific application scenario of the API. (2) the channel is correct, check whether the commodity parameters are correct; focus on itemI(mp_id), skuId (mp_sku_id), whether all are cross-border supply platform Channel commodity model attributes. (3) Check whether the product status is normal. (4) If there is no problem in the first few steps, find the technical person in charge to solve it. |
B-10-00-005 |
GSP拆单异常 |
(1) Check whether the channel channel_order_type is wrong, the specific application scenario. (2) the channel is correct, check whether the commodity parameters are correct; focus on itemId(mp_id), skuId (mp_sku_id), whether all are cross-border supply platform commodity model attributes. (3) Check whether the goods are normal. (4) Check whether the authorized account is a cross-border supply platform account (rather than an open platform account). The two platform accounts are separate and not the same. (5) If there is no problem in the first few steps, find the technical person in charge to solve it. |
Field_name |
Description |
outer_purchase_id |
IDs generated by the distributor's own system must be unique. |
purchase_amount |
estimated purchase amount |
seller_order_number |
order number generated by the distributor's own system |
order_source |
order source |
order_line_list |
order details [commodity ID must check the mp_id returned by the commodity interface, sku_id is also the mp_sku_id, otherwise the order cannot be created normally. ] |
receiver |
recipient information |
warehouse_address_info |
Distributor domestic warehouse address (generally sent to this) |
channel_order_type |
mainly depends on your specific application scenario: [PANAMA_DG | shopping guide mode: PANAMA] |
support_partial_success |
if the customer fills in the default parameter (false/empty), the online order creation logic goes "one sub-order fails, the whole main order fails", if the customer fills in the specified parameter (true), the online order logic goes "one sub-order fails, part of the sub-order succeeds, the main order returns success" |
order_remark |
supplier comments (limited to 35 words) |
API:/item/get
Common QA:
ErrorCode |
ErrorDescription |
Solution |
SYSTEM_ERROR |
商品详情未查到淘宝商品 |
product details did not find Taobao goods, indicating that the Taobao products were deleted or off the shelves |
SYSTEM_ERROR |
商品详情暂不支持购买淘特商品 |
commodity details do not support the purchase of tamote goods, currently do not support taote goods |
Description: The input parameter is the purchase order ID of the cross-border supply platform. This interface is executed asynchronously. It is only submitted for payment and filters out purchases that cannot be paid.The returned results are for reference only. In the end, you must synchronize information through the purchase query interface. Otherwise, data consistency questions will occur.
The ginseng:
Note:
will_pay_purchase_order_ids does not indicate payment success! Instead, a payment order was submitted.
pay_failure_purchase_order_ids indicates payment cannot be submitted! The payment verification failed.
Detailed parameters:
{
"error_msg": "",
"code": "0",
"data": {
"will_pay_purchase_order_ids": "200001911633",// a payment order has been submitted
"pay_failure_purchase_order_ids": "200000229005" // Submit failed orders
},
"success": "true",
"error_code": "BATCH_PAY_ERROR",
"request_id": "0ba2887315178178017221014"
}
Developers can configure a callback URL on the open platform to receive message requests. This method can reduce the developer's attempts to obtain order updates through the polling mechanism.
For example:
For the design of the message receiving channel, see:
For more information about the message structure, see:
Note: You need to provide a message receiving Channel in the form of HTTPS POST requests.
To use Message Service, you must prepare a callback interface for receiving messages. Follow the following requirements:
Message Example #1. Example of positive transaction information (generated by forward transaction behaviors such as placing orders, paying, shipping, and receiving goods)
POST /example/uri HTTP/1.1
Host: www.example.com
Content-Type: application/json
Content-Length: 1238
Authorization: 34f7b258df045d4ed9341850ca85b866f34828fd7d51862f11137216294a894c
#Message body
{
"seller_id":"1234567", #Seller ID
"message_type":0,
"data":{
"order_status":"unpaid", #Order status
"trade_order_id":"260422900198363", #Primary ID
"trade_order_line_id":"260422900298363", #Sub-ID
"status_update_time":1603698638 #The timestamp when the order status is updated.
},
"timestamp":1603766859530, #Push timestamp
"site":"lazada_vn" # Site information
}
Message Example #2. Examples of reverse transaction information (cancellation, return refund, and other reverse transaction behavior)
POST /example/uri HTTP/1.1
Host: www.example.com
Content-Type: application/json
Content-Length: 1238
Authorization: 34f7b258df045d4ed9341850ca85b866f34828fd7d51862f11137216294a894c
#Message body
{
"seller_id":"1000114855",
"message_type":0,
"data":{
"order_status":"canceled",
"reverse_order_id":"501977696648153", #Reverse master ID
"reverse_order_line_id":"502491640048153", #Reverse sub-single ID
"status_update_time":1603703663,
"trade_order_id":"252883361348153", #Associate forward single ID
"trade_order_line_id":"252883361948153" #Associate reverse single ID
},
"timestamp":1603715010436,
"site":"lazada_vn"
}
We recommend that you verify the validity of the received message.
Special note: Do not convert and modify the message body after receiving the message! Otherwise, signing again will not be inconsistent.
The request body is used as the message body, the AppSecret is the key, and the signature encryption algorithm is the HMAC-SHA256.
Signature to generate Sample Code
/*
Base = {your_app_key} + "{message_body_you_receieved}"
Secret = {your_app_Secret};
*/
Authorization = HEX_ENCODE(HMAC-SHA256(Base, Secret));
Use the following code to generate a signature to compare with the Authorization in the Header.
The data will be transmitted in clear text. For security reasons, please sign and compare the received messages!
import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; /** * Signature tool class * @author jianyan * @date 2020/12/01 */ public class SignatureUtil { private static final String HMAC_SHA256 = "HmacSHA256"; private static final Logger LOGGER = LoggerFactory.getLogger(SignatureUtil.class); /** * Generates a Hmac-SHA256-based, 16-decimal encoded signature. * @param base {AppKey} + {messageBody} * @param secret {AppSecret} * E.g.: AppKey = 123456, AppSecret = 3412gyo124goi3124 * The body of the received message JSON :{"seller_id":"1234567", "message_type":0, "data":{...}..} * * base = "123456" + "{\"seller_id\":\"1234567\", \"message_type\":0, "data":{...}..}" * secret = 3412gyo124goi3124 * signature = getSignature(base, secret); * signature = f3d2ca947f16a50b577c036adecd18bec126ea19cadedd59816e255d3b6104ab * @return signature */ public static String getSignature(String base, String secret) { try { Mac sha256Hmac = Mac.getInstance(HMAC_SHA256); SecretKeySpec secretKey = new SecretKeySpec(secret.getBytes(), HMAC_SHA256); sha256Hmac.init(secretKey); return byteArraytoHexString(sha256Hmac.doFinal(base.getBytes())); } catch (Exception e) { LOGGER.error("Failed to generate signature"); } return null; } /** * Hexadecimal Encode * @param bytes * @return */ private static String byteArraytoHexString(byte[] bytes) { if(bytes == null) { return null; } StringBuilder sb = new StringBuilder(); String stmp; for (byte aByte : bytes) { stmp = Integer.toHexString(aByte & 0XFF); if (stmp.length() == 1) { sb.append('0'); } sb.append(stmp); } return sb.toString().toLowerCase(); } }
Description: When a distributor calls an open platform API, it needs to use it with a messaging service. The main core is to synchronize data from the platform to its own system platform to maintain data consistency between the two sides.
Note that only scenarios are supported: Shopping Guide Mode
message_type:2
Trigger node: Distributor to/undistribute goods on cross-border supply platform (PANAMA Channel)
{ "seller_id":"12345", // "seller_id" can be obtained when the distributor is authorized. For more information, see: Interface AccessToken "message_type":2, "data":{ "seller_id":"12345", "spu_ids_list":[ "223244", "54543342" ] }, "timestamp":123456789 }
message_type:1
Trigger Node: Each time an inventory update is triggered. Sending at "100", "20", and "0" (PANAMA Channel)
{
"seller_id":"12345",
"message_type":1,
"data":{
"seller_id":"12345",
"item_id":"323434",
"sku_list":[
{
"sku_id":"123422"
}
],
"status":"STOCK_CHANGED"
},
"timestamp":123456787
}
message_type:0
Trigger node: The merchant or platform triggers the product to go up and down.
{
"seller_id":"12345",
"message_type":0,
"data":{
"seller_id":"12345",
"item_id":32242,
"sku_list":[
"223244",
"54543342"
]
},
"timestamp":123456789
}
Among them, commodity messages, because the data is pushed to developers through the API, the order of the messages received by developers cannot be guaranteed. Therefore, please check the API after receiving the commodity messages and then do relevant business processing.
When the merchant is authorized, you can obtain the seller_id of the merchant. For more information, see API AccessToken.
message_type:7
Trigger node: changes in supplier commodity prices
{
"seller_id":"12345",
"message_type":7,
"data":{
"item_id":600027239042390035,
"seller_id":2100000978004,
"sku_list":[
4511721254067,
5466335674566
]
},
"timestamp":123456789
}
message_type:3
Trigger node: The status of the purchase order has changed.
Message body:
{
"seller_id": "2100000927014",
"message_type": 3,
"data": {
"business_time": 1650939687564,
"outer_purchase_id": "FY20220426002",
"purchase_id": 200002638011,
"seller_id": 2100000927014,
"sku_list": [{
"item_id": 600123256363335043,
"logistic_company_name": "顺丰速运",
"logistic_number": "SF4548527307631",
"order_line_no": "1",
"sku_id": 4808332513272,
"status": "WAIT_BUYER_CONFIRM_GOODS"
}],
"status": "WAIT_SELLER_SEND_GOODS"
},
"timestamp": 1650939687,
"site": "taobao_hk"
}
The order-related message will be given to the specific status, and developers can trust to use it directly, provided that the following processing has been done:
-The message is out of order. You must use the reverse check API(/purchase/orders/query) to obtain the purchase order for synchronization.
The value of the purchase order status:
Purchase order status |
Description |
BULIDING |
BULIDING purchase order creation |
WAIT_BUYER_P |
WAIT_BUYER_P waiting for payment |
WAIT_SELLER_SEND_GOODS |
WAIT_SELLER_SEND_GOODS paid, to be shipped |
WAIT_BUYER_CONFIRM_GOODS |
WAIT_BUYER_CONFIRM_GOODS paid, shipped |
TRADE_CLOSED |
TRADE_CLOSED trading closed |
message_type:8
Note: Messages are out of order. Finally, you need to reverse the API(/purchase/orders/query) to obtain the purchase order for synchronization.
Trigger node: Create an order and contact the Taobao seller to change the price of the order!
{
"seller_id": "2100000927014",
"message_type": 8,
"data": {
"features": {},
"salesOrderId": "500000-GSP2021031415594",
"salesSellerId": 2100000927014,
"purchaseMarket": "PANAMA",
"purchaseOrderId": 200002372069,
"purchaseOrderPriceDTO": {
"purchaseCurrency": "CNY",
"purchaseTotalFee": 1,
"purchaseProductFee": 1,
"purchaseShippingFee": 0
},
"purchaseOrderLinePriceChangeMessageDTOList": [{
"features": {},
"salesOrderLineIdList": ["1"],
"purchaseOrderLineId": 200002372070,
"purchaseOrderItemPriceDTO": {
"purchaseCurrency": "CNY",
"purchaseTotalFee": 1,
"purchaseProductFee": 1,
"purchaseProductUnitFee": 1,
"purchaseShippingFee": 0
},
"bizFeatures": {}
}],
"actionTime": 1647306796326,
"bizFeatures": {
"appKey": "500000",
"orderSource": "taobao",
"purchase_warehouse_address": "{\"city\":\"广州市\",\"country\":\"中国\",\"detailAddress\":\"落潭镇长腰岭村第三经济合作社长兴工业路3号派亚物流\",\"district\":\"白云区\",\"divisionId\":\"440111108\",\"mobile\":\"18500176747\",\"name\":\"李澳洲\",\"phone\":\"\",\"state\":\"广东省\"}",
"sellerOrderNumber": "-"
}
},
"timestamp": 1647306796,
"site": "taobao_hk"
}
Precautions for price change
Description: When the status of the reverse order is changed, if the seller agrees to refund or return the goods, it will trigger a message to notify the distributor. Secondly, if the message is added (the seller's message) or update (the message is overwritten by the message), the distributor needs to get the corresponding message, synchronize the reverse order, or leave the message to maintain data consistency with the supply and marketing platform.
message_type:9
{
"seller_id": "2100000927014",
"message_type": 9,
"data": {
"sellerId": 2100000927014, // Distributor ID
"messageType": 2, // 1 Refund order synchronization | 2 Message synchronization
"refundId": 110000312001,
"businessTime": 1652266980661, // Message sending timestamp
"purchaseOrderId": 2608284132117736161 // Purchase order ID
},
"timestamp": 1652266980,
"site": "taobao_hk"
}
API (/product/get) to upgrade the full product
(1) Full commodity promotion
In order to help distributors in the cross-border supply platform can find more goods, avoid because the goods are not on the cross-border supply platform can not make orders, for this reason, the supply and marketing platform will be online in 2022-05-22 online "Tmall Taobao full quantity of goods" query, improve the success rate of commodity query. However, due to Tmall Taobao full access to goods need to follow
Taobao Compliance Regulations, non-cross-border goods will not provide product material information (pictures, descriptions, etc.). The original contracted goods are not affected by this. Before docking, Please query the document completely and understand the updated content of the interface to determine whether you need to adjust your own system to avoid affecting your business.
(1)Distribution(/product/get)
(2)Recommended API for similar models(/product/recommend)
Item_type |
Field Description |
Response model |
HAVE_MATERIAL |
"HAVE_MATERIAL" means that this is a supply and marketing product, will contain the full product material. |
All fields in response to the data are returned normally |
WITHOUT_MATERIAL |
"WITHOUT_MATERIAL" means that this is a full Taobao product, which only contains some product information (not including product pictures, descriptions, etc.)
|
Full product promotion and compliance: The response data is reduced by some SPU fields, and the SKU remains unchanged. 6 less SPU fields:: 1.category_path 2.category_id 3.product_unit 4.pic_urls 5.begin_amount 6.description |
Instructions for distributors: Development must be carried out according to the above rule points, otherwise it will affect the rendering of materials in its own system, and there will be missing pictures, details and other content, which will affect the user experience and single volume.
purchase orders query (/purchase/orders/query) adds a list of logistics to the suborder information
(1) purchase orders query (/purchase/orders/query)
Add logistic_orders field for returning a list of multiple logistics
There is a discrepancy between what is shown in the development platform documentation and the real return type, which is an array as shown below:
The original logistic information fields logistic_number, logistic_company_name, rts_time in /purchase/orders/query are obsolete and will not be maintained in the future. It is recommended to use the logistic_orders field to obtain logistics information.