Customs Declarations
The Customs Declaration API help merchants to complete customs clearance process as regulation required. This API applies only to China customs requirements and workflows.
POST /api/v1/pa/customs_declarations/createPOST /api/v1/pa/customs_declarations/{id}/updatePOST /api/v1/pa/customs_declarations/{id}/redeclareGET /api/v1/pa/customs_declarations/{id}
Create a customs declaration
POST /api/v1/pa/customs_declarations/create
Start the declaration process by creating a customs declaration. Please note that sub_order fields are required. If there is no need to split your original order, please fill the sub_order fields with your original order information for declaration. In this case, remember to use the provider_order_id in the response for your order information/shipment information declaration
Customs details
China customs code, please refer to here for information https://www.airwallex.com/docs/payments/apac/wechat-pay/customs-declaration,https://www.airwallex.com/docs/payments/apac/alipay/customs-declaration
Merchant's registered name in customs system. Maximum length is 256.
Merchant's registered number in customs system. Maximum length is 32.
Unique identifier of the payment intent on which customs declaration will be created
Unique request identifier specified by the merchant. Maximum length is 64.
Shopper details. Will be used for shopper identity check.
Mainland China unique identifier of the shopper.
Name of the shopper in simplified Chinese.
Suborder info, required when there are split orders
The total amount of your sub_order, shipping fee shall be included, unit is Yuan. Please refer to supported currencies for supported minor units.
Currency for the suborder, only CNY supported now.
Suborder number in merchant system. Maximum length is 128.
The unique transaction identifier assigned by the provider for your sub_order. Please use this field as the provider transaction no. for your order information/shipment information’s declaration. Example of our providers: Cards, WeChat, Alipay etc.
Suborder transport fee, unit is Yuan
Request unique identifier generated by AirWallex send to the provider for a PaymentAttempt
Time at which the CustomsDeclaration was created
Customs details
China customs code, please refer to here for information https://www.airwallex.com/docs/payments/apac/wechat-pay/customs-declaration,https://www.airwallex.com/docs/payments/apac/alipay/customs-declaration
Merchant's registered name in customs system. Maximum length is 256.
Merchant's registered number in customs system. Maximum length is 32.
Additional status message from customs
Unique identifier for the Customs Declaration
Payment method type of the PaymentAttempt
The unique transaction identifier assigned by the provider for a payment attempt. Example of our providers: Cards, WeChat, Alipay etc.
Unique request identifier specified by the merchant in the last operation
Identity check result of the shopper.
Customs processing status, UNDECLARED/PROCESSING/SUCCESS/FAIL
Suborder info, required for each customs declaration.
The total amount of your sub_order, shipping fee shall be included, unit is Yuan. Please refer to supported currencies for supported minor units.
Currency for the suborder, only CNY supported now.
Suborder number in merchant system. Maximum length is 128.
The unique transaction identifier assigned by the provider for your sub_order. Please use this field as the provider transaction no. for your order information/shipment information’s declaration. Example of our providers: Cards, WeChat, Alipay etc.
Suborder transport fee, unit is Yuan
Last time at which the CustomsDeclaration was updated or operated on
Verification department code
Transaction unique identifier returned by verification department
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 403 | Forbidden |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request POST \> --url 'https://api-demo.airwallex.com/api/v1/pa/customs_declarations/create' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json' \> --data '{> "request_id": "ac88c53b-f1bd-479b-a1b8-2686db548b39",> "payment_intent_id": "int_hkpdskz7vg1xc7uscdj",> "customs_details": {> "customs_code": "GUANGZHOU_ZS",> "merchant_customs_name": "Airwallex",> "merchant_customs_number": "C129000000"> },> "sub_order": {> "amount": 10,> "currency": "USD",> "order_number": "o100001213",> "provider_order_id": "T912345678901234569",> "shipping_fee": 0> }>}'
1{2 "id": "cdc_hkpdkjd4t98sa",3 "request_id": "ac88c53b-f1bd-479b-a1b8-2686db548b39",4 "status": "UNDECLARED",5 "payment_method_type": "card",6 "provider_transaction_id": "t202401091234567890123456789",7 "awx_request_id": "1234567890123456789",8 "verification_department_code": "OTHERS",9 "verification_department_transaction_id": "tx1202401091234567890123456789",10 "customs_details": {11 "customs_code": "GUANGZHOU_ZS",12 "merchant_customs_number": "C129000000",13 "merchant_customs_name": "Airwallex"14 },15 "sub_order": {16 "order_number": "o100001213",17 "provider_order_id": "T912345678901234569",18 "amount": 10,19 "shipping_fee": 0,20 "currency": "USD"21 },22 "shopper_identity_check_result": "UNCHECKED",23 "created_at": "2024-01-31T06:59:10+00:00",24 "updated_at": "2024-01-31T06:59:10+00:00"25}
Update customs declaration
POST /api/v1/pa/customs_declarations/{id}/update
Update an existing customs declaration. SHANGHAI_CBT does not support update after a successful declaration.
id
China customs code
Merchant's registered name in customs system. Maximum length is 256.
Merchant's registered number in customs system. Maximum length is 32.
Unique request identifier specified by the merchant. Maximum length is 64.
Shopper details. Will be used to update shopper identity check information.
Mainland China unique identifier of the shopper.
Name of the shopper in simplified Chinese.
Suborder amount. Please refer to supported currencies for supported minor units.
Request unique identifier generated by AirWallex send to the provider for a PaymentAttempt
Time at which the CustomsDeclaration was created
Customs details
China customs code, please refer to here for information https://www.airwallex.com/docs/payments/apac/wechat-pay/customs-declaration,https://www.airwallex.com/docs/payments/apac/alipay/customs-declaration
Merchant's registered name in customs system. Maximum length is 256.
Merchant's registered number in customs system. Maximum length is 32.
Additional status message from customs
Unique identifier for the Customs Declaration
Payment method type of the PaymentAttempt
The unique transaction identifier assigned by the provider for a payment attempt. Example of our providers: Cards, WeChat, Alipay etc.
Unique request identifier specified by the merchant in the last operation
Identity check result of the shopper.
Customs processing status, UNDECLARED/PROCESSING/SUCCESS/FAIL
Suborder info, required for each customs declaration.
The total amount of your sub_order, shipping fee shall be included, unit is Yuan. Please refer to supported currencies for supported minor units.
Currency for the suborder, only CNY supported now.
Suborder number in merchant system. Maximum length is 128.
The unique transaction identifier assigned by the provider for your sub_order. Please use this field as the provider transaction no. for your order information/shipment information’s declaration. Example of our providers: Cards, WeChat, Alipay etc.
Suborder transport fee, unit is Yuan
Last time at which the CustomsDeclaration was updated or operated on
Verification department code
Transaction unique identifier returned by verification department
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 403 | Forbidden |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request POST \> --url 'https://api-demo.airwallex.com/api/v1/pa/customs_declarations/cdc_hkpdkjd4t98sa/update' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json' \> --data '{> "customs_code": "GUANGZHOU_ZS",> "merchant_customs_name": "C129000000",> "merchant_customs_number": "Airwallex",> "request_id": "ce113401-b801-4722-b43b-1ddb50e8951f",> "shopper_details": {> "shopper_id": "800000206709306711",> "shopper_name": "nessus_was_textvpwjrhzt"> },> "sub_order_amount": 10>}'
1{2 "id": "cdc_hkpdkjd4t98sa",3 "request_id": "ce113401-b801-4722-b43b-1ddb50e8951f",4 "status": "DECLARED",5 "payment_method_type": "card",6 "provider_transaction_id": "t202401091234567890123456789",7 "awx_request_id": "1234567890123456789",8 "verification_department_code": "OTHERS",9 "verification_department_transaction_id": "tx1202401091234567890123456789",10 "customs_details": {11 "customs_code": "GUANGZHOU_ZS",12 "merchant_customs_number": "C129000000",13 "merchant_customs_name": "Airwallex"14 },15 "sub_order": {16 "order_number": "o100001213",17 "provider_order_id": "T912345678901234569",18 "amount": 10,19 "shipping_fee": 0,20 "currency": "USD"21 },22 "shopper_identity_check_result": "UNCHECKED",23 "created_at": "2024-01-31T06:59:10+00:00",24 "updated_at": "2024-01-31T06:59:10+00:00"25}
Redeclare customs declaration
POST /api/v1/pa/customs_declarations/{id}/redeclare
Redeclare an existing customs declaration. SHANGHAI_CBT does not support redeclaration after a successful declaration.
Customs Declaration unique identifier
Unique request identifier specified by the merchant. Maximum length is 64.
Request unique identifier generated by AirWallex send to the provider for a PaymentAttempt
Time at which the CustomsDeclaration was created
Customs details
China customs code, please refer to here for information https://www.airwallex.com/docs/payments/apac/wechat-pay/customs-declaration,https://www.airwallex.com/docs/payments/apac/alipay/customs-declaration
Merchant's registered name in customs system. Maximum length is 256.
Merchant's registered number in customs system. Maximum length is 32.
Additional status message from customs
Unique identifier for the Customs Declaration
Payment method type of the PaymentAttempt
The unique transaction identifier assigned by the provider for a payment attempt. Example of our providers: Cards, WeChat, Alipay etc.
Unique request identifier specified by the merchant in the last operation
Identity check result of the shopper.
Customs processing status, UNDECLARED/PROCESSING/SUCCESS/FAIL
Suborder info, required for each customs declaration.
The total amount of your sub_order, shipping fee shall be included, unit is Yuan. Please refer to supported currencies for supported minor units.
Currency for the suborder, only CNY supported now.
Suborder number in merchant system. Maximum length is 128.
The unique transaction identifier assigned by the provider for your sub_order. Please use this field as the provider transaction no. for your order information/shipment information’s declaration. Example of our providers: Cards, WeChat, Alipay etc.
Suborder transport fee, unit is Yuan
Last time at which the CustomsDeclaration was updated or operated on
Verification department code
Transaction unique identifier returned by verification department
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 403 | Forbidden |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request POST \> --url 'https://api-demo.airwallex.com/api/v1/pa/customs_declarations/cdc_hkpdkjd4t98sa/redeclare' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json' \> --data '{> "request_id": "a268d48f-f42a-438e-bf99-ca74b7f58d09">}'
1{2 "id": "cdc_hkpdkjd4t98sa",3 "request_id": "a268d48f-f42a-438e-bf99-ca74b7f58d09",4 "status": "REDECLARED",5 "payment_method_type": "card",6 "provider_transaction_id": "t202401091234567890123456789",7 "awx_request_id": "1234567890123456789",8 "verification_department_code": "OTHERS",9 "verification_department_transaction_id": "tx1202401091234567890123456789",10 "customs_details": {11 "customs_code": "GUANGZHOU_ZS",12 "merchant_customs_number": "C129000000",13 "merchant_customs_name": "Airwallex"14 },15 "sub_order": {16 "order_number": "o100001213",17 "provider_order_id": "T912345678901234569",18 "amount": 10,19 "shipping_fee": 0,20 "currency": "USD"21 },22 "shopper_identity_check_result": "UNCHECKED",23 "created_at": "2024-01-31T06:59:10+00:00",24 "updated_at": "2024-01-31T06:59:10+00:00"25}
Retrieve customs declaration
GET /api/v1/pa/customs_declarations/{id}
Retrieve an existing customs declaration .
Customs Declaration unique identifier
Request unique identifier generated by AirWallex send to the provider for a PaymentAttempt
Time at which the CustomsDeclaration was created
Customs details
China customs code, please refer to here for information https://www.airwallex.com/docs/payments/apac/wechat-pay/customs-declaration,https://www.airwallex.com/docs/payments/apac/alipay/customs-declaration
Merchant's registered name in customs system. Maximum length is 256.
Merchant's registered number in customs system. Maximum length is 32.
Additional status message from customs
Unique identifier for the Customs Declaration
Payment method type of the PaymentAttempt
The unique transaction identifier assigned by the provider for a payment attempt. Example of our providers: Cards, WeChat, Alipay etc.
Unique request identifier specified by the merchant in the last operation
Identity check result of the shopper.
Customs processing status, UNDECLARED/PROCESSING/SUCCESS/FAIL
Suborder info, required for each customs declaration.
The total amount of your sub_order, shipping fee shall be included, unit is Yuan. Please refer to supported currencies for supported minor units.
Currency for the suborder, only CNY supported now.
Suborder number in merchant system. Maximum length is 128.
The unique transaction identifier assigned by the provider for your sub_order. Please use this field as the provider transaction no. for your order information/shipment information’s declaration. Example of our providers: Cards, WeChat, Alipay etc.
Suborder transport fee, unit is Yuan
Last time at which the CustomsDeclaration was updated or operated on
Verification department code
Transaction unique identifier returned by verification department
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 403 | Forbidden |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request GET \> --url 'https://api-demo.airwallex.com/api/v1/pa/customs_declarations/cdc_hkpdkjd4t98sa' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json'
1{2 "id": "cdc_hkpdkjd4t98sa",3 "request_id": "4dd119d8-331d-41a0-b037-122f0113b227",4 "status": "DECLARED",5 "payment_method_type": "card",6 "provider_transaction_id": "t202401091234567890123456789",7 "awx_request_id": "1234567890123456789",8 "verification_department_code": "OTHERS",9 "verification_department_transaction_id": "tx1202401091234567890123456789",10 "customs_details": {11 "customs_code": "GUANGZHOU_ZS",12 "merchant_customs_number": "C129000000",13 "merchant_customs_name": "Airwallex"14 },15 "sub_order": {16 "order_number": "o100001213",17 "provider_order_id": "T912345678901234569",18 "amount": 10,19 "shipping_fee": 0,20 "currency": "USD"21 },22 "shopper_identity_check_result": "UNCHECKED",23 "created_at": "2024-01-31T06:59:10+00:00",24 "updated_at": "2024-01-31T06:59:10+00:00"25}