Aliexpress Affiliate Documentation
Aliexpress Affiliate Documentation
AliexpressOP Overview
Background
Dear partners, we are delighted to announce that we are launching the new Aliexpress open
platform! As the market evolves, current features and API deficiencies are becoming a
barrier to our mutual growth. In order to provide better services to our partners and further
empower them, we have fully migrated and upgraded to the new open platform. At the
same time, we have rebuilt our web services to improve the user experience.
Getting started
If you are new to the Aliexpress Open Platform, this guide will help you to familiarize
yourself with the platform step-by-step: start developing your app using the Aliexpress API,
deploy your app online, and share your app with Aliexpress sellers.
Initial Preparation:
1. Become a developer - Register a UAC (unified account center) account and sign up as
a Aliexpress developer.
2. Register your application in one of the application categories - Submit the request
and Aliexpress admins will review and approve your request.
3. Retrieve App Key and App Secret of your application - The unique identity of your
application on the Aliexpress Open Platform.
4. Request API permission for your application, so that your application can initiate
calls to Aliexpress APIs.
Integration Process:
1. Configure seller authorization - Manage a list of sellers who can authorize your
application to access their business data in Aliexpress marketplace
2. Seller authorization intruduction - Get the authorization from sellers
3. Call API with HTTP requests - Instructions on how to assemble HTTP requests to call
API
Currently, all interfaces are divided into two categories: System interfaces and Business
interfaces. And you need to choose the correct endponint to use for each type API.
System interfaces: Authorization relative APIs under 'System Tool' in the API
documentation.
Business interfaces: All other APIs except system APIs which mentioned above.
Notes:
1. {api_path} means the path of the specific API,{query} means the calling
parameters.
2. Here to see the detail HTTP request sample.
Calling parameters
Calls to the API must include system parameters in addition to the parameters associated
with the application. Different application specific parameters are needed for different
specific APIs.
System parameters
System parameters are required in the HTTP request of every API call, listed in the following
table:
Business parameters
In addition to the system parameters that must be included in the API call request, the
business parameters for the request are also required. Refer to the API documentation for
details about the business parameters of each API.
Signature algorithm
Aliexpress Open Platform verifies the identity of each API request, and the server will also
verify whether the call parameters are valid. Therefore, each HTTP request must contain the
signature information. The requests with invalid signature will be rejected.
Aliexpress Open Platform verifies the identity of the requests by the App Key and Secret
that are assigned to your application. The App Secret is used to generate the signature
string in the HTTP request URL and server-side signature string. It must be kept strictly
confidential.
If you compose HTTP request manually (instead of using the official SDK), you need to
understand the following signature algorithm.
The process of generating the signature is as follows:(Notice:The only difference between
System Interfaces and Business Interfaces is how to handle api_path.)
1.Sort all request parameters (including system and application parameters, but except the
“sign” and parameters with byte array type.If the API you used is Business Interface,
api_path should be used as the request parameter to participate in sorting) according to the
parameter name in ASCII table. For example:
PlainBashC++C#CSSDiffHTML/XMLJavaJavascriptMarkdownPHPPythonRubySQL
// Example of api_path key value pair
// method : aliexpress.offer.product.post
if (signMethod.equals(SIGN_METHOD_SHA256)) {
bytes = encryptHMACSHA256(query.toString(), appSecret);
}
/**
* Transfer binary array to HEX string.
*/
public static String byte2hex(byte[] bytes) {
StringBuilder sign = new StringBuilder();
for (int i = 0; i < bytes.length; i++) {
String hex = Integer.toHexString(bytes[i] & 0xFF);
if (hex.length() == 1) {
sign.append("0");
}
sign.append(hex.toUpperCase());
}
return
Notes:
1. All request and response data codes are in UTF-8 format.Please encode all
parameter names and parameter values in the URL. And all parameter values in the
HTTP body should also be encoded If the requested content type is application / x-
www-form-urlencoded.If it is in multipart / form data format, the parameter value of
each form field does not need to be encoded, but the charset part of each form field
needs to be specified as UTF-8.
2. When the length of the URL assembled by the parameter name and parameter value
is less than 1024 characters, you can use method "GET" to initiate the request; If the
parameter type contains byte [] type or the assembled request URL is too long, the
request must be initiated by method "POST". All APIs can initiate requests using
"POST".
3. Only those who do not use the official AE SDK need to generate the signature for API
calls.If the official AE SDK is used, the SDK will complete this step automatically.
Error messages
All API calls will return a response, which indicates the status of the operation (either
Success or Error) and optionally provides results and/or details related to the specified
action.
When an API call fails, the system returns the request ID and error codes as well. There are
3 categories of common API call errors:
1. SYSTEM: API platform error
2. ISV: Business data error
3. ISP: Backend service error
API platform error (SYSTEM 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 (ISV 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 Aliexpress 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 Aliexpress Partner Seller
Support to find out the business
Backend service error (ISP errors)
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.
demo
PlainBashC++C#CSSDiffHTML/XMLJavaJavascriptMarkdownPHPPythonRubySQL
1、Controller:
@RestController
public class PushMessageTestController {
@Autowired
private GopMessageHandlerFactory gopMessageHandlerFactory;
* @param request
* @return
*/
@PostMapping(value = "/images/receiveCallBack.do")
public ResponseEntity<?> receiveGopCallback(HttpServletRequest request, @RequestBody
String s) {
log.info("PushMessageTestController receiveCallBack s:【{}】", JSON.toJSONString(s));
String authorization = null == request.getHeader("authorization") ? null :
request.getHeader("authorization");
if (null == authorization) {
return ResponseEntity.badRequest().body("authorization is null");
} else {
//Signature authentication.
String base = TEST_APP_KEY + s;
String signature = SignatureUtil.getSignature(base, TEST_APP_SECRET);
if (!authorization.equals(signature)) {
return ResponseEntity.badRequest().body("authorization Don't match");
}
}
//product_delete_message s =
{"seller_id":"2060","message_type":15,"data":{"login_id":"ali****01","product_id":100009
6,"product_status":"product-deleted","status_update_time":"2022-05-09
15:48:11"},"timestamp":1652082492,"site":"ae_global"}
//order_create_message s =
{"seller_id":"2060","message_type":1,"data":{"login_id":"ali***01","order_status":"PLACE_
ORDER_SUCCESS","trade_order_id":"30160843","status_update_time":"2022-04-19
23:18:56"},"timestamp":1650435537,"site":"ae_global"}
JSONObject jsonObject = JSON.parseObject(s);
if (jsonObject != null && jsonObject.getInteger(MESSAGE_TYPE) != null) {
AbstractGopMessageHandler messageHandler =
gopMessageHandlerFactory.getMessageHandler(jsonObject.getInteger(MESSAGE_TYPE));
if (messageHandler != null) {
messageHandler.execute(jsonObject);
} else {
log.info("gop 未知消息类型 :{} " , s);
return ResponseEntity.badRequest().build();
}
} else {
log.info("gop 消息格式异常 :{} " , s);
return ResponseEntity.badRequest().build();
}
return ResponseEntity.ok().body(s);
}
}
@Autowired
public List<AbstractGopMessageHandler> messageHandlerList;
@PostConstruct
protected void init() {
for (AbstractGopMessageHandler messageHandler : messageHandlerList) {
map.put(messageHandler.getMessageType(),messageHandler);
}
}
/**
* Executor
* @param jsonObject
* @return
*/
public abstract Boolean execute(JSONObject jsonObject);
}
4、order_create_message handler:
@Component
@Slf4j
public class PlaceOrderSuccessMessageHandler extends AbstractGopMessageHandler {
@Override
public Integer getMessageType() {
return 1;
}
@Override
public Boolean execute(JSONObject jsonObject) {
log.info("收到下单成功消息 :request data 【{}】: ", jsonObject.toJSONString());
//todo 业务逻辑
return true;
}
}
4、product_delete_message handler:
@Component
@Slf4j
public class ProductDeletedMessageHandler extends AbstractGopMessageHandler {
@Override
public Integer getMessageType() {
return 15;
}
@Override
public Boolean execute(JSONObject jsonObject) {
log.info("收到商品删除消息 :request data 【{}】: ", jsonObject.toJSONString());
//todo 业务逻辑
re
Callback Data Integration
Let's take a look at an example of callback data (the data received by the callback URL):
PlainBashC++C#CSSDiffHTML/XMLJavaJavascriptMarkdownPHPPythonRubySQL
POST /example/uri HTTP/1.1
Host: www.example.com
Content-Type: application/json
Content-Length: 1238
Authorization: 34f7b258df045d4ed9341850ca85b866f34828fd7d51862f11137216294a894c
{
"havana_id":"17379911544",//Corresponding original TOP platform userId.
"seller_id": "200042360",
"message_type": 1,
"data": {
"login_id": "aliqatest01",
"order_status": "PLACE_ORDER_SUCCESS",
"trade_order_id": "3016467970010843",
"status_update_time": "2022-04-19 23:18:56"
},
"timestamp": 1650435537,
"site": "ae_global"
}
There are several important data points to pay attention to in the callback data:
1、Authorization: This header field is mainly used for signature authentication. It is
recommended for the ISV's callback interface to perform signature authentication to verify
the authenticity of the message and prevent malicious push. The specific signature
authentication method will be separately introduced below.
2、seller_id: Indicates the seller account to which the order belongs.
3、message_type: The subscribed message type in the background. Different message_type
values correspond to different data structures in the "data" field.
4、data: Contains the relevant information data for this order or product message.
Important Notes:
1. The callback URL must be using HTTPS.
2. Please verify your CA certificate. You need a certificate issued by a Certificate
Authority (self-signed certificates are not accepted). OV/EV level certificates are
required, DV level certificates are not accepted.
3. AOP currently provides request signature verification to prevent callback interfaces
from being flooded with fake data. If you still need to filter traffic by IP or other
means, please contact Alibaba Cloud Singapore to find domain names/IP addresses.
The platform does not provide support for this.
4. Message types and their corresponding business references: Developers can refer to
the message type reference table to identify and process the subscribed business
message types.
fail (At this point, it is necessary to confirm whether the callback interface is working
properly.)
4:Successful Receipt and Retry on Failure
Confirmation Mechanism
Currently, the client is required to respond with a 200 OK HTTP status code (not the
response body) to confirm the receipt of the message. If the server does not receive a 200
confirmation within 500ms, it considers the message delivery as failed. In case of failure, the
server will retry pushing the message after 30 minutes, and it will retry for a maximum of 12
times before completely giving up on delivery.
Recommended Handling Approach
As retrying on failure can consume more system resources and amplify the message
volume, it is recommended that the receiving app buffers the received messages (using a
processing method that includes a buffering queue in the callback interface service). This
ensures that the interface is not overwhelmed or encounters numerous timeouts when
there is a high volume of callbacks. It is advised not to process the messages directly to
minimize failures. If the failure rate of an app exceeds 50%, the opportunity for push
notifications to that address will be suspended.
Important Notes:
1、Will a successful message be pushed again?
No, it will not be pushed again.
2、If a message fails and is pushed after half an hour, will the status be the latest?
Yes, before retrying, the system will first check the latest status.
3、Is there a possibility of duplicate message pushes?
Yes, due to network or other uncontrollable reasons, there may be instances of duplicate
message pushes. Therefore, it is important to implement relevant idempotent handling in
the callback interface processing logic.
sign until:
PlainBashC++C#CSSDiffHTML/XMLJavaJavascriptMarkdownPHPPythonRubySQL
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
/**
* sign until
*/
public class SignatureUtil {
private static final String HMAC_SHA256 = "HmacSHA256";
/**
* Generate a signature based on Hmac-SHA256, and encode it in hexadecimal format.
* @param base {AppKey} + {messageBody}
* @param secret {AppSecret}
* E.g.: AppKey = 123456, AppSecret = 3412gyo124goi3124
* 收到的消息体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 sign
*/
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();
}
Note:
1、Is the signature mandatory?
Answer: It is not mandatory, but highly recommended.
2、What is this for? How do I use this code?
Answer: This is an algorithm to generate a string. After receiving a message, the client can
use the same algorithm to regenerate the same string and compare it with the string
received from the server to verify the integrity of the message and the identity of the
sender. Additionally, if you are using Java, you can simply copy the code and generate the
signature as instructed upon receiving the request. Then, compare it with the
"Authorization" header.
FAQ:
Q: If a certain SellerId did not receive any push notifications?
A: Before pushing the message, the system checks the authorization relationship between
the SellerId and the AppKey on the platform. If a SellerId does not receive any push
notifications, verify the validity of the Seller and App's token.
Q: How is the 500ms calculated? What should we do if it frequently exceeds 500ms due to
poor network conditions?
A: Do not consume order messages synchronously. Store them in a buffer and then
consume them. Based on current observations, the response time (RT) for mainstream
cloud servers in China is within 200ms. For network fluctuations, there is a 12-retry
compensation mechanism.
Q: Can the callback URL be changed after configuration? Should the callback for testing and
production be differentiated?
A: The callback URL can be changed. There is minimal necessity for a separate testing
callback because your existing order flow is based on pulling and is completely separate
from this callback. You can directly use a single callback URL.
Q: We used the example you provided for signature verification, but the signatures don't
match?
A: Many developers have reported issues with the sample code we provided. If you have
already checked all the possibilities below and are still encountering issues, please reach out
to us again. Do not couple the signature verification logic with the business logic. We
recommend designing the signature verification using the Chain of Responsibility pattern,
where signature verification is one link in the chain. Some developers map the fields in the
body to an object and then deserialize the object. This approach relies on the order of
object parsing and may vary depending on the parsing library used, leading to potential
issues. Moreover, this approach tightly couples the signature logic with the business logic
and can become cumbersome when the messages are updated or iterated upon. If
everything seems fine, pay attention to the AppSec value. If the issue persists, try resetting
the AppSec.
2. Product Management
Please refer to below documents
https://openservice.aliexpress.com/doc/doc.htm?spm=a2o9m.11193535.0.0.334159b2AHII
Cq&nodeId=27493&docId=118729#/?docId=1754
3. Orders
3.1 Flow of order status
4. Order Fulfillment
https://openservice.aliexpress.com/doc/doc.htm?spm=a2o9m.11193535.0.0.334159b2AHII
Cq&nodeId=27493&docId=118729#/?docId=1609
Category Mappings
How to do Category Mapping
aliexpress.solution.seller.category.tree.query
Parameters:
1. parent category id
2. Whether to filter out the categories which sellers do not have permissions.
Response:
1. child categories under this parent category.
Best practice:
1. passing 0 to fetch the level 1 categories.
2. Call the API recursively untill the child post category is a leaf.(is_leaf_category = true)
3. Only use leaf category for category mapping and posting products.
4. filter_no_permission equals to false means returning whole the category tree
(including categories that might not be authorised the seller), while true means only
returning categories from the tree which the seller is authorised. The authorised
category tree is a subset of the whole category tree.
5. Better to show both the authorised categories and non-authorised categories to the
sellers and give reminders to sellers of categories with no permission, for them to
directly apply in Aliexpress backend:
Sample Response:
PlainBashC++C#CSSDiffHTML/XMLJavaJavascriptMarkdownPHPPythonRubySQL
{
"aliexpress_solution_seller_category_tree_query_response": {
"children_category_list": {
"category_info": [
{
"children_category_id": 100001205,
"is_leaf_category": false,
"level": 2,
"multi_language_names": "{\"hi\":\"?????? ??? ????? ????? ?? ????????\",\"de\":\"Handy
Zubeh?r und Ersatzteile\",\"ru\":\"Аксессуары для мобильных телефонов\",\"ko\":\"?? ??
???? ? ??\",\"pt\":\"Acessórios Do Telefone móvel & Parts\",\"in\":\"Aksesoris Ponsel &
Parts\",\"en\":\"Mobile Phone Accessories\",\"it\":\"Accessori per
cellulari\",\"fr\":\"Mobile Téléphone Accessoires et Pièces\",\"zh\":\"手机配件
\",\"iw\":\"????? ???? ??????? & ?????\",\"es\":\"Accesorios\",\"ar\":\"?????? ???????
??????????\",\"vi\":\"?i?n Tho?i di ??ng Ph? Ki?n & Ph?
Tùng\",\"th\":\"????????????????????????????????\",\"ja\":\"携帯電話アクセサリー&パ
ーツ\",\"tr\":\"Cep Telefonu Aksesuarlar?\",\"nl\":\"mobiele Telefoon Accessoires &
Onderdelen\"}"
},
{
"children_category_id": 100001204,
"is_leaf_category": false,
"level": 2,
"multi_language_names": "{\"hi\":\"?????
?????\",\"de\":\"Kommunikationsger?te\",\"ru\":\"Оборудование для связи\",\"ko\":\"??
??\",\"pt\":\"Equipamentos de comunica??o\",\"in\":\"Peralatan
komunikasi\",\"en\":\"Communication Equipment\",\"it\":\"Apparecchiature di
comunicazione\",\"fr\":\"?quipements de Communication\",\"zh\":\"通信设备
\",\"iw\":\"???? ??????\",\"es\":\"Equipos de comunicación\",\"ar\":\"?????
?????????\",\"vi\":\"Thi?t b? th?ng tin liên l?c\",\"th\":\"??????? ??????????\",\"ja\":\"放
送、通信設備\",\"tr\":\"?leti?im Ekipman?\",\"nl\":\"Communicatie Materiaal\"}"
},
{
"children_category_id": 5090301,
"is_leaf_category": true,
"level": 2,
"multi_language_names": "{\"hi\":\"??????
???\",\"de\":\"Mobiltelefon\",\"ru\":\"Мобильные телефоны\",\"ko\":\"??
??\",\"pt\":\"Telefonia\",\"in\":\"Ponsel\",\"en\":\"Mobile Phones\",\"it\":\"Telefoni
cellulari\",\"fr\":\"Smartphones\",\"zh\":\"手机\",\"iw\":\"???????
??????\",\"es\":\"Smartphones\",\"ar\":\"????? ??????\",\"vi\":\"?i?n tho?i di
??ng\",\"th\":\"??????????????\",\"ja\":\"携帯電話\",\"tr\":\"Cep
Telefonu\",\"nl\":\"Mobiele telefoons\"}"
},
{
"children_category_id": 200380144,
"is_leaf_category": true,
"level": 2,
"multi_language_names": "{\"hi\":\"Wakie ???? ??????? ?? ????? ?????\",\"de\":\"Wakie
Talkie Teile & Zubeh?r\",\"ru\":\"Детали и аксессуары для раций\",\"ko\":\"Wakie ??? ??
? ????\",\"pt\":\"Wakie Talkie Pe?as & Acessórios\",\"in\":\"Wakie Talkie Parts &
Aksesoris\",\"en\":\"Walkie Talkie Parts & Accessories\",\"it\":\"Parti & accessori per
Walkie Talkie\",\"fr\":\"Wakie Walkie Pièces et Accessoires\",\"zh\":\"对讲机配附件
\",\"iw\":\"??? Wakie ???? ????? ???????\",\"es\":\"Piezas y accesorios para walkie-
talkies\",\"ar\":\"wakie ????? ???? ????????\",\"vi\":\"wakie ?àm & Ph?
Ki?n\",\"th\":\"Wakie Talkie?????????????????????\",\"ja\":\"wakieトランシーバーパー
ツ&アクセサリー\",\"tr\":\"Telsiz Par?alar? ve Aksesuarlar?\",\"nl\":\"Wakie Talkie
Onderdelen & Accessoires\"}"
},
{
"children_category_id": 50906,
"is_leaf_category": true,
"level": 2,
"multi_language_names": "{\"hi\":\"????
????\",\"de\":\"Walkietalki\",\"ru\":\"Рация\",\"ko\":\"???\",\"pt\":\"Walkie-
talkie\",\"in\":\"Walkie Talkie\",\"en\":\"Walkie Talkie\",\"it\":\"Walkie
talkie\",\"fr\":\"Talkie Walkie\",\"zh\":\"对讲机\",\"iw\":\"????? ???\",\"es\":\"Walkie-
talkies\",\"ar\":\"?????? ????????\",\"vi\":\"Walkie
?àm\",\"th\":\"??????????????????\",\"ja\":\"携帯無線\",\"tr\":\"El
Telsizi\",\"nl\":\"walkie talkie\"}"
},
{
"children_category_id": 201084002,
"is_leaf_category": false,
"level": 2,
"multi_language_names": "{\"de\":\"Handy Teile\",\"ru\":\"Детали для мобильных
телефонов\",\"ko\":\"Mobile Phone ?\",\"pt\":\"Pe?as de Telefone
celular\",\"in\":\"Handphone\",\"en\":\"Mobile Phone Parts\",\"it\":\"Ricambi per
cellulare\",\"fr\":\"Mobile Téléphone Pièces\",\"zh\":\"手机部件\",\"iw\":\"????? ????
?????\",\"es\":\"Piezas de teléfonos móviles\",\"ar\":\"?????? ??????? ?????\",\"vi\":\"?i?n
Tho?i di ??ng Các B? Ph?n\",\"th\":\"????????????????????\",\"ja\":\"携帯電話部品
\",\"tr\":\"Cep Telefonu Par?alar?\",\"nl\":\"Mobiele Telefoon Onderdelen\"}"
}
]
},
"is_success": true,
"request_id": "pr4mjuj3eklw"
}
}
1. Configure seller authorization- Manage a list of sellers who can authorize your
application to access their business data in Aliexpress marketplace
2. Call API with SDK - Invoke Api endpoint with sdk provided by AliExpress Open
Platform
1. Post/Edit products
https://openservice.aliexpress.com/doc/doc.htm?spm=a2o9m.11193535.0.0.723059b2233
9li&nodeId=27493&docId=118729#/?docId=1755
2. Online/Offline products
https://openservice.aliexpress.com/doc/doc.htm?spm=a2o9m.11193535.0.0.723059b2233
9li&nodeId=27493&docId=118729#/?docId=1756
API List
API Link
aliexpress.solution.product.list.get https://openservice.aliexpress.com/doc/api.htm?spm
aliexpress.solution.product.info.get https://openservice.aliexpress.com/doc/api.htm?spm
aliexpress.solution.batch.product.price.update https://openservice.aliexpress.com/doc/api.htm?spm
aliexpress.solution.batch.product.delete https://openservice.aliexpress.com/doc/api.htm?spm
aliexpress.solution.batch.product.inventory.update https://openservice.aliexpress.com/doc/api.htm?spm
Request Reference:
PlainBashC++C#CSSDiffHTML/XMLJavaJavascriptMarkdownPHPPythonRubySQL
// update prices
{
"product_id": 1005003120048613,
"multi_country_price_configuration": {
"price_type": "absolute",
"country_price_list": [
{
"sku_price_by_country_list": [
{
"price": "15",
"discount_price": "13.99",
"sku_code": "abc123"
}
],
"ship_to_country": "FR"
}
]
},
"multiple_sku_update_list": [
{
"price": "19.99",
"discount_price": "14.99",
"sku_code": "abc123"
}
]
}
//update inventory
{
"product_id":1005003120048613,
"multiple_sku_update_list":[
{
"inventory":5,
"sku_code":"abc123"
}
]
}
Online / Offline Products
Online / Offline a product
API List
API Link
aliexpress.postproduct.redefining.onlineaeproduct https://openservice.aliexpress.com/doc/api.htm?spm
aliexpress.solution.product.info.get https://openservice.aliexpress.com/doc/api.htm?spm
aliexpress.postproduct.redefining.offlineaeproduct https://openservice.aliexpress.com/doc/api.htm?spm
aliexpress.solution.product.list.get https://openservice.aliexpress.com/doc/api.htm?spm
Reference Code:
PlainBashC++C#CSSDiffHTML/XMLJavaJavascriptMarkdownPHPPythonRubySQL
{
"product_ids":"1005007011379841;1005007011379842"
}
Post/Edit Product
1. Post a new product
Here are some details that developers may want to figure out before integration:
1.1. aliexpress_category_id
aliexpress.solution.seller.category.tree.query
1.1.1. Parameters:
1. parent category id
2. Whether to filter out the categories which sellers do not have permissions.
1.1.2. Response
child categories under this parent category.
Best practice:
1. passing 0 to fetch the level 1 categories.
2. Call the API recursively untill the child post category is a leaf.(is_leaf_category = true)
3. Only use leaf category for category mapping and posting products.
4. filter_no_permission equals to false means returning whole the category tree
(including categories that might not be authorised the seller), while true means only
returning categories from the tree which the seller is authorised. The authorised
category tree is a subset of the whole category tree.
5. Better to show both the authorised categories and non-authorised categories to the
sellers and give reminders to sellers of categories with no permission, for them to
directly apply in Aliexpress backend:
Sample Response:
PlainBashC++C#CSSDiffHTML/XMLJavaJavascriptMarkdownPHPPythonRubySQL
{
"aliexpress_solution_seller_category_tree_query_response": {
"children_category_list": {
"category_info": [
{
"children_category_id": 100001205,
"is_leaf_category": false,
"level": 2,
"multi_language_names": "{\"hi\":\"?????? ??? ????? ????? ?? ????????\",\"de\":\"Handy
Zubeh?r und Ersatzteile\",\"ru\":\"Аксессуары для мобильных телефонов\",\"ko\":\"?? ??
???? ? ??\",\"pt\":\"Acessórios Do Telefone móvel & Parts\",\"in\":\"Aksesoris Ponsel &
Parts\",\"en\":\"Mobile Phone Accessories\",\"it\":\"Accessori per
cellulari\",\"fr\":\"Mobile Téléphone Accessoires et Pièces\",\"zh\":\"手机配件
\",\"iw\":\"????? ???? ??????? & ?????\",\"es\":\"Accesorios\",\"ar\":\"?????? ???????
??????????\",\"vi\":\"?i?n Tho?i di ??ng Ph? Ki?n & Ph?
Tùng\",\"th\":\"????????????????????????????????\",\"ja\":\"携帯電話アクセサリー&パ
ーツ\",\"tr\":\"Cep Telefonu Aksesuarlar?\",\"nl\":\"mobiele Telefoon Accessoires &
Onderdelen\"}"
},
{
"children_category_id": 100001204,
"is_leaf_category": false,
"level": 2,
"multi_language_names": "{\"hi\":\"?????
?????\",\"de\":\"Kommunikationsger?te\",\"ru\":\"Оборудование для связи\",\"ko\":\"??
??\",\"pt\":\"Equipamentos de comunica??o\",\"in\":\"Peralatan
komunikasi\",\"en\":\"Communication Equipment\",\"it\":\"Apparecchiature di
comunicazione\",\"fr\":\"?quipements de Communication\",\"zh\":\"通信设备
\",\"iw\":\"???? ??????\",\"es\":\"Equipos de comunicación\",\"ar\":\"?????
?????????\",\"vi\":\"Thi?t b? th?ng tin liên l?c\",\"th\":\"??????? ??????????\",\"ja\":\"放
送、通信設備\",\"tr\":\"?leti?im Ekipman?\",\"nl\":\"Communicatie Materiaal\"}"
},
{
"children_category_id": 5090301,
"is_leaf_category": true,
"level": 2,
"multi_language_names": "{\"hi\":\"??????
???\",\"de\":\"Mobiltelefon\",\"ru\":\"Мобильные телефоны\",\"ko\":\"??
??\",\"pt\":\"Telefonia\",\"in\":\"Ponsel\",\"en\":\"Mobile Phones\",\"it\":\"Telefoni
cellulari\",\"fr\":\"Smartphones\",\"zh\":\"手机\",\"iw\":\"???????
??????\",\"es\":\"Smartphones\",\"ar\":\"????? ??????\",\"vi\":\"?i?n tho?i di
??ng\",\"th\":\"??????????????\",\"ja\":\"携帯電話\",\"tr\":\"Cep
Telefonu\",\"nl\":\"Mobiele telefoons\"}"
},
{
"children_category_id": 200380144,
"is_leaf_category": true,
"level": 2,
"multi_language_names": "{\"hi\":\"Wakie ???? ??????? ?? ????? ?????\",\"de\":\"Wakie
Talkie Teile & Zubeh?r\",\"ru\":\"Детали и аксессуары для раций\",\"ko\":\"Wakie ??? ??
? ????\",\"pt\":\"Wakie Talkie Pe?as & Acessórios\",\"in\":\"Wakie Talkie Parts &
Aksesoris\",\"en\":\"Walkie Talkie Parts & Accessories\",\"it\":\"Parti & accessori per
Walkie Talkie\",\"fr\":\"Wakie Walkie Pièces et Accessoires\",\"zh\":\"对讲机配附件
\",\"iw\":\"??? Wakie ???? ????? ???????\",\"es\":\"Piezas y accesorios para walkie-
talkies\",\"ar\":\"wakie ????? ???? ????????\",\"vi\":\"wakie ?àm & Ph?
Ki?n\",\"th\":\"Wakie Talkie?????????????????????\",\"ja\":\"wakieトランシーバーパー
ツ&アクセサリー\",\"tr\":\"Telsiz Par?alar? ve Aksesuarlar?\",\"nl\":\"Wakie Talkie
Onderdelen & Accessoires\"}"
},
{
"children_category_id": 50906,
"is_leaf_category": true,
"level": 2,
"multi_language_names": "{\"hi\":\"????
????\",\"de\":\"Walkietalki\",\"ru\":\"Рация\",\"ko\":\"???\",\"pt\":\"Walkie-
talkie\",\"in\":\"Walkie Talkie\",\"en\":\"Walkie Talkie\",\"it\":\"Walkie
talkie\",\"fr\":\"Talkie Walkie\",\"zh\":\"对讲机\",\"iw\":\"????? ???\",\"es\":\"Walkie-
talkies\",\"ar\":\"?????? ????????\",\"vi\":\"Walkie
?àm\",\"th\":\"??????????????????\",\"ja\":\"携帯無線\",\"tr\":\"El
Telsizi\",\"nl\":\"walkie talkie\"}"
},
{
"children_category_id": 201084002,
"is_leaf_category": false,
"level": 2,
"multi_language_names": "{\"de\":\"Handy Teile\",\"ru\":\"Детали для мобильных
телефонов\",\"ko\":\"Mobile Phone ?\",\"pt\":\"Pe?as de Telefone
celular\",\"in\":\"Handphone\",\"en\":\"Mobile Phone Parts\",\"it\":\"Ricambi per
cellulare\",\"fr\":\"Mobile Téléphone Pièces\",\"zh\":\"手机部件\",\"iw\":\"????? ????
?????\",\"es\":\"Piezas de teléfonos móviles\",\"ar\":\"?????? ??????? ?????\",\"vi\":\"?i?n
Tho?i di ??ng Các B? Ph?n\",\"th\":\"????????????????????\",\"ja\":\"携帯電話部品
\",\"tr\":\"Cep Telefonu Par?alar?\",\"nl\":\"Mobiele Telefoon Onderdelen\"}"
}
]
},
"is_success": true,
"request_id": "pr4mjuj3eklw"
}
}
1.2.1. sku_attributes_list
The following picture shows how sku_attributes_list affects the front-end effect of a
product. In the picture, "Bundle" and "Color" corresponds to the field "sku_attribute_name"
of an element in "sku_attributes_list" , while "Bundle1", "Bundle2", "White", "Black"
corresponds to the field "sku_attribute_value" of an element in "sku_attributes_list".
1.2.2. attribute_list
The following picture shows how attribute_list is displayed in the front-end of a product.
As shown from the structure of attribute_list, there are four fields: attribute_name_id,
attribute_value_id, attribute_name, attribute_value.
attribute_name_id and attribute_value_id could be also obtained through the API Query
attribute info.
In the response of the API Query attribute info:
1. sku = false means the specific attribute was a genral attribute, which could be set in
the fields : aliexpress_attribute_name_id and aliexpress_attribute_value_id in
attribute_list
attribute_name and attribute_value corresponds to merchant's customized attributes'
names and values.
Basically the attributes and settings are the same as posting process, here is one example
request for reference:
PlainBashC++C#CSSDiffHTML/XMLJavaJavascriptMarkdownPHPPythonRubySQL
{
"product_id":1005003235892239,
"sku_info_list":[
{
"price":"12.21",
"discount_price":"11.21",
"inventory":90,
"sku_attributes_list":[
{
"sku_attribute_name":"Color",
"sku_attribute_value":"blue",
"sku_image":"https://upload.wikimedia.org/wikipedia/commons/b/b5/Winnersh_Meadows
_Trees.jpg"
}
],
"sku_code":"abc123"
},
{
"price":"12.21",
"inventory":100,
"sku_attributes_list":[
{
"sku_attribute_name":"Color",
"sku_attribute_value":"black",
"sku_image":"https://upload.wikimedia.org/wikipedia/commons/b/b5/Winnersh_Meadows
_Trees.jpg"
}
],
"sku_code":"abc989"
}
],
"shipping_lead_time":3,
"multi_country_price_configuration":{
"price_type":"absolute",
"country_price_list":[
{
"sku_price_by_country_list":[
{
"sku_code":"abc123",
"value":"14"
},
{
"sku_code":"abc989",
"value":"13"
}
],
"ship_to_country":"FR"
},
{
"sku_price_by_country_list":[
{
"sku_code":"abc123",
"value":"17"
}
],
"ship_to_country":"ES"
},
{
"sku_price_by_country_list":[
{
"sku_code":"abc989",
"value":"18"
}
],
"ship_to_country":"RU"
}
]
},
"marketing_images":[
{
"image_type":2,
"image_url":"https://ae01.alicdn.com/kf/Hf5987123b00246699ac4f86795d59e636.jpg"
},
{
"image_type":1,
"image_url":"https://ae01.alicdn.com/kf/Hf632c473b88f49f98258812039ab0b7eg.jpg"
}
]
}
API: aliexpress.trade.new.redefining.findorderbyid
https://openservice.aliexpress.com/doc/api.htm?spm=a2o9m.11193531.0.0.31a93b53SbbE
SQ#/api?cid=20905&path=aliexpress.trade.new.redefining.findorderbyid&methodType=GE
T/POST
API: aliexpress.trade.seller.orderlist.get
https://openservice.aliexpress.com/doc/api.htm?spm=a2o9m.11193531.0.0.31a93b53SbbE
SQ#/api?cid=20905&path=aliexpress.trade.seller.orderlist.get&methodType=GET/POST
Note that the following content only applies to local overseas ISVs (the main body of the
company in the open platform is a local overseas body, ERP and merchant self-developed
systems can be docked to the relevant APIs), does not apply to cross-border ISVs
1. Link:
https://openservice.aliexpress.com/?spm=a2o9m.11193535.0.0.f58259b2pYQ2rH
2. Registration rules:
https://openservice.aliexpress.com/announcement/index.htm?spm=a2o9m.11193487.0.0.1
919ee0csppqWf#/announcement/detail?id=1341&entitle=announcement&queryid=256&cn
title=announcement&_k=moqav9
https://openservice.aliexpress.com/doc/
get order detail information---
api.htm?spm=a2o9m.11193487.0.0.372
tr eee0cJTDFTF#/api?cid=20905&path=alie aliexpress.trade.new.redefining.findorderb
an xpress.trade.seller.orderlist.get&method yid
sa Type=GET/POST get order list information---
cti aliexpress.trade.seller.orderlist.get
on
aliexpress.solution.order.receiptinfo.get
aliexpress.solution.order.fulfill
aliexpress.trade.redefining.confirmshipping
mode
https://www.yuque.com/yinyanpengbei
niao/ph1q8r/zuekkaqtxp0r15zw?singleD
pr oc# 《海外托管服务-商品域 API对接操
od
uc 作指引 Aliexpress-Direct - Product
t Domain API Integration Operation Guide
》
Affiliate Developers
After replacement:
https://api-
sg.aliexpress.com/sync?app_key=24734337&met
hod=aliexpress.offer.product.query&v=2.0&sign
=A7D42DA3D532D5070CD260CA9D707F16&time
stamp=2022-06-
15+11%3A51%3A06&partner_id=top-
apitools&session=50000400e43kCExnqC93GWjM
wiywHecjTel0ucGlNIzfxxBDwKMhUI411f20e1acn
hs&format=json&sign_method=md5&product_id
=1307422965
contact us
You can submit a ticket to the AEOP open
platform, or contact us by email
ticket url:
https://openservice.aliexpress.com/support/ind
ex.htm?myTicket?_k=qwzbnv
affiliates Email:affiliates@service.alibaba.com
FAQ
1.Do I need to register a new account on the new
open platform?
You don’t need to register a new account during
the migration. After we complete the data
migration, you can use your existing developer
account to log in to the new platform.
HTTP request sample
Case 1: Business Interfaces
Taking
aliexpress.solution.product.schema.get(get
product schema) API call as example, the steps of
assembling the HTTP request is as follows:
Step 1. Populate parameters and values
Common parameters:
1. app_key = “123456”
2. access_token = “test”
3. timestamp = “1517820392000”
4. sign_method = “sha256”
Business parameters:
1. aliexpress_category_id = “200135143”
2. method =
“aliexpress.solution.product.schema.get”
Step 2. Sort all parameters and values according
to the parameter name in ASCII table
1. access_token = “test”
2. aliexpress_category_id = “200135143”
3. app_key = “123456”
4. sign_method = “sha256”
5. timestamp = “1517820392000”
Step 3. Concatenate the sorted parameters and
their values into a string
PlainBashC++C#CSSDiffHTML/XMLJavaJavascript
MarkdownPHPPythonRubySQL
access_tokentestaliexpress_category_id2001351
43app_key123456methodaliexpress.logistics.red
efining.getonlinelogisticsinfosign_methodsha256
timestamp1517820392000
Step 4. Generate signature
Assuming that the App Secret is “helloworld”,
the signature is:
PlainBashC++C#CSSDiffHTML/XMLJavaJavascript
MarkdownPHPPythonRubySQL
hex(sha256(access_tokentestaliexpress_category
_id200135143app_key123456methodaliexpress.l
ogistics.redefining.getonlinelogisticsinfosign_me
thodsha256timestamp1517820392000))=F7F792
6B67316C9D1E8E15F7E66940ED3059B1638C497
D77973F30046EFB5BBB
Step 5. Assemble HTTP request
Encode all the parameters and values (with the
“sign” parameter) using UTF-8 format (the order
of parameters can be arbitrary).The splicing
method is:https://api-
sg.aliexpress.com/sync?method={api_path}&{qu
ery}.
PlainBashC++C#CSSDiffHTML/XMLJavaJavascript
MarkdownPHPPythonRubySQL
https://api-
sg.aliexpress.com/sync?method=aliexpress.solut
ion.product.schema.get&app_key=12345678&ali
express_category_id=200135143&access_token=
test×tamp=1517820392000&sign_method
=sha256&sign=F7F7926B67316C9D1E8E15F7E669
40ED3059B1638C497D77973F30046EFB5BBB
Case 2: System Interfaces
Taking /auth/token/create(generate
access_token) API call as example, the steps of
assembling the HTTP request is as follows:
Step 1. Populate parameters and values
Common parameters:(access_token is not
needed in this API)
1. app_key = “12345678”
2. timestamp = “1517820392000”
3. sign_method = “sha256”
Business parameters:
1. code =
“3_500102_JxZ05Ux3cnnSSUm6dCxYg6Q26”
Step 2. Sort all parameters and values according
to the parameter name in ASCII table
1. app_key = “12345678”
2. code =
“3_500102_JxZ05Ux3cnnSSUm6dCxYg6Q26”
3. sign_method = “sha256”
4. timestamp = “1517820392000”
Step 3. Concatenate the sorted parameters and
their values into a string
PlainBashC++C#CSSDiffHTML/XMLJavaJavascript
MarkdownPHPPythonRubySQL
app_key12345678code3_500102_JxZ05Ux3cnnSS
Um6dCxYg6Q26sign_methodsha256timestamp1
517820392000
Step 4. Add the API name in front of the
concatenated string
PlainBashC++C#CSSDiffHTML/XMLJavaJavascript
MarkdownPHPPythonRubySQL
/auth/token/createapp_key12345678code3_500
102_JxZ05Ux3cnnSSUm6dCxYg6Q26sign_method
sha256timestamp1517820392000
Step 5. Generate signature
Assuming that the App Secret is “helloworld”,
the signature is:
PlainBashC++C#CSSDiffHTML/XMLJavaJavascript
MarkdownPHPPythonRubySQL
hex(sha256(/auth/token/createapp_key1234567
8code3_500102_JxZ05Ux3cnnSSUm6dCxYg6Q26s
ign_methodsha256timestamp1517820392000))=
35607762342831B6A417A0DED84B79C05FEFBF1
16969C48AD6DC00279A9F4D81
Step 6. Assemble HTTP request
Encode all the parameters and values (with the
“sign” parameter) using UTF-8 format (the order
of parameters can be arbitrary).The splicing
method is:https://api-
sg.aliexpress.com/rest{api_path}?{query}.
PlainBashC++C#CSSDiffHTML/XMLJavaJavascript
MarkdownPHPPythonRubySQL
https://api-
sg.aliexpress.com/rest/auth/token/create?app_
key=12345678&code=3_500102_JxZ05Ux3cnnSS
Um6dCxYg6Q26×tamp=1517820392000&si
gn_method=sha256&sign=35607762342831B6A4
17A0DED84B79C05FEFBF116969C48AD6DC00279
A9F4D81
Step 7 java case
PlainBashC++C#CSSDiffHTML/XMLJavaJavascript
MarkdownPHPPythonRubySQL
public static void main(String[] args) throws
Exception {
final String SIGN_METHOD = "sha256";
final String APP_KEY = "YOUR_APP_KEY";
final String APP_SECRET = "YOUR_APP_SECRET";
final String CODE = "YOUR_CODE";
final String API_NAME = "/auth/token/create";
String sign =
IopUtils.signApiRequest(API_NAME,params,
requestBody, APP_SECRET, SIGN_METHOD);
params.put("sign",sign);
String url = "https://api-sg.aliexpress.com/rest"
+ API_NAME + "?";
for (String key : params.keySet()) {
url += "&" + key + "=" +
URLEncoder.encode(params.get(key), "utf-8");
}
System.out.println(url);
String sendGet = HttpUtils.sendGet(url);
System.out.println("sendGet
Notes:
1. All request and response data codes are in
UTF-8 format.Please encode all parameter
names and parameter values in the URL. And
all parameter values in the HTTP body should
also be encoded If the requested content
type is application / x-www-form-
urlencoded.If it is in multipart / form data
format, the parameter value of each form
field does not need to be encoded, but the
charset part of each form field needs to be
specified as UTF-8.
2. When the length of the URL assembled by
the parameter name and parameter value is
less than 1024 characters, you can use
method "GET" to initiate the request; If the
parameter type contains byte [] type or the
assembled request URL is too long, the
request must be initiated by method "POST".
All APIs can initiate requests using "POST".
3. Only those who do not use the official AE
SDK need to generate the signature for API
calls.If the official AE SDK is used, the SDK
will complete this step automatically.
Notes:
1. {api_path} means the path of the specific API
,{query} means the calling parameters.
2. Here to see the detail HTTP request sample.
Calling parameters
Calls to the API must include system parameters
in addition to the parameters associated with
the application. Different application specific
parameters are needed for different specific
APIs.
System parameters
System parameters are required in the HTTP
request of every API call, listed in the following
table:
Business parameters
In addition to the system parameters that must
be included in the API call request, the business
parameters for the request are also required.
Refer to the API documentation for details about
the business parameters of each API.
Signature algorithm
Aliexpress Open Platform verifies the identity of
each API request, and the server will also verify
whether the call parameters are valid. Therefore,
each HTTP request must contain the signature
information. The requests with invalid signature
will be rejected.
Aliexpress Open Platform verifies the identity of
the requests by the App Key and Secret that are
assigned to your application. The App Secret is
used to generate the signature string in the HTTP
request URL and server-side signature string. It
must be kept strictly confidential.
if (signMethod.equals(SIGN_METHOD_SHA256))
{
bytes = encryptHMACSHA256(query.toString(),
appSecret);
}
/**
* Transfer binary array to HEX string.
*/
public static String byte2hex(byte[] bytes) {
StringBuilder sign = new StringBuilder();
for (int i = 0; i < bytes.length; i++) {
String hex = Integer.toHexString(bytes[i] & 0xFF);
if (hex.length() == 1) {
sign.append("0");
}
sign.append(hex.toUpperCase
get hotproducts
GET/POST
aliexpress.affiliate.hotproduct.query
Description:get hotproducts
Parameter
Required
Name Type Description
or not
app_signature String No API signature
List of category
category_ids String No
https://develop
fields String No Respond parame
keywords String No Filter products b
max_sale_price Number No Filter products b
min_sale_price Number No Filter products b
page_no Number No Page number
page_size Number No Record count of
platform_product_type String No product type:A
sort by:SALE_PR
sort String No
LAST_VOLUME_
target currency:
target_currency String No
JPY, IDR, SEK,KR
target
target_language String No
language:EN,RU
tracking_id String No Your trackingID
Required
Name Type Description
or not
Estimated delive
delivery_days String No
in 10 days
The Ship to coun
ship_to_country String No
Returns the pric
client = iop.IopClient(url, appkey ,appSecret)
request =
iop.IopRequest('aliexpress.affiliate.hotproduct.q
uery')
request.add_api_param('app_signature',
'sssfffxxgggg')
request.add_api_param('category_ids',
'111,222,333')
request.add_api_param('fields',
'app_sale_price,shop_id')
request.add_api_param('keywords', 'mp3')
request.add_api_param('max_sale_price',
'33333')
request.add_api_param('min_sale_price',
'22222')
request.add_api_param('page_no', '111')
request.add_api_param('page_size', '50')
request.add_api_param('platform_product_type
', 'ALL')
request.add_api_param('sort',
'SALE_PRICE_ASC')
request.add_api_param('target_currency', 'USD')
request.add_api_param('target_language', 'EN')
request.add_api_param('tracking_id',
'trackingId')
request.add_api_param('delivery_days', '3')
request.add_api_param('ship_to_country', 'US')
response = client.execute(request)
print(response.type)
print(response.body)
get products
GET/POST
aliexpress.affiliate.product.query
Description:get products
Parameter
Required
Name Type Description
or not
app_signature String No API signature
List of category
category_ids String No
https://develop
fields String No Respond parame
keywords String No Filter products b
max_sale_price Number No Filter products b
Required
Name Type Description
or not
min_sale_price Number No Filter products b
page_no Number No Page number
page_size Number No record count of
platform_product_type String No product type:A
sort by:SALE_PR
sort String No
LAST_VOLUME_
target currency:
target_currency String No
INR, JPY, IDR, SE
target
target_language String No
language:EN,RU
tracking_id String No Your trackingID
The Ship to coun
ship_to_country String No
Returns the pric
Estimated delive
delivery_days String No
:in 10 days
client = iop.IopClient(url, appkey ,appSecret)
request =
iop.IopRequest('aliexpress.affiliate.product.quer
y')
request.add_api_param('app_signature',
'asdasdasdsa')
request.add_api_param('category_ids',
'111,222,333')
request.add_api_param('fields',
'commission_rate,sale_price')
request.add_api_param('keywords', 'mp3')
request.add_api_param('max_sale_price', '100')
request.add_api_param('min_sale_price', '15')
request.add_api_param('page_no', '1')
request.add_api_param('page_size', '50')
request.add_api_param('platform_product_type
', 'ALL')
request.add_api_param('sort',
'SALE_PRICE_ASC')
request.add_api_param('target_currency', 'USD')
request.add_api_param('target_language', 'EN')
request.add_api_param('tracking_id',
'trackingId')
request.add_api_param('ship_to_country', 'US')
request.add_api_param('delivery_days', '3')
response = client.execute(request)
print(response.type)
print(response.body)