Submit trade order

POST: /amsin/api/v1/business/account/submitTradeOrder

This API is used to submit trade orders. The Partner calls submitAttachment API to submit the required attachments.

Structure

A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:

Request body parameters

Field

Data type

Required

Description

requestId

String

Yes

The unique ID assigned by the Partner to identify a trade order submission request.

More information about this field:

  • This field is an API idempotency field. The Partner can use it to do the idempotent check.
  • Maximum length: 64 characters

sceneCode

String

Yes

The code that represents the business scenario. Valid values:

  • CREATE_ORDERS_AND_ASSOCIATE: the trade order is created and associated one time, applied to the marketplace scenario.
  • CREATE_ORDERS_AND_ASSOCIATE_BIG_MERCHANT: the trade order is created and associated one time, applied to the key merchant scenario.
  • PAY_INTO_CHINA: applied to the foreign exchange scenario without the association of the trade order.

tradeOrders

Array <TradeOrder Object>

Yes

The list of trade orders.

If the value of the sceneCode parameter is PAY_INTO_CHINA, the maximum size of this parameter is 100 elements.

platformOnly for B2C

String

No (Conditional)

The platform where the trade order occurs. Specify this parameter if he value of the sceneCode parameter is PAY_INTO_CHINA.

More information about this parameter:

  • Maximum length: 32 characters

transferId

Only for B2B

String

No (Conditional)

Indicates the transfer or collection order number. Specify this parameter if the value of the sceneCode parameter is CREATE_ORDERS_AND_ASSOCIATE or CREATE_ORDERS_AND_ASSOCIATE_BIG_MERCHANT.

More information about this field:

  • Maximum length: 64 characters

quotaAccumulationMethod

Only for B2C

String

No (Conditional)

The method that is used for the quota accumulation. Valid values are:

  • USER_ID: indicates the quota is accumulated by the user ID.
  • BATCH_NO: indicates the quota is accumulated by the batch number of trade orders.
  • RECEIVING_ACCOUNT: indicates the quota is accumulated by the receiving account.

Specify this parameter if the value of the sceneCode parameter is PAY_INTO_CHINA.

referenceBatchNo

Only for B2C

String

No (Conditional)

The batch number of trade orders.

Specify this parameter if the value of the quotaAccumulationMethod parameter is BATCH_NO.

More information about this field:

  • Maximum length: 64 characters

notifyUrl

String

String

No

The asynchronous URL where the notification of trade order submission result is sent.

More information about this field:

  • Maximum length: 256 characters

Response parameters

Field

Data type

Required

Description

result

Result Object

Yes

Indicates the result of trade order submission.

requestId

String

Yes

The unique ID assigned by the Partner to identify a trade order submission request.

More information about this field:

  • This field is an API idempotency field. The Partner can use it to do the idempotent check.
  • Maximum length: 64 characters

acceptOrderId

String

Yes

Accepted order number

More information about this field:

  • Maximum length: 128 characters

tradeOrderResult

Only for B2C

Array <TradeOrderResult object> 

Conditional

The trade order information, including the trade order number and the trade order status. This parameter is returned if the value of the sceneCode parameter is PAY_INTO_CHINA

Result processing logic

Once the Partner calls API, WorldFirst returns with its result. The range of result.resultStatus field is:

result.resultStatus

Description

S

API is called with success.

F

API is called with failure.

For reasons, refer to result.resultCode and result.resultMessage.

U

When API returns with UNKNOWN, retry calling it.

Retry strategy:

  • Maximum times of retrying: 7
  • Interval of retrying: 5 minutes, 10 minutes, 20 minutes, 40 minutes, 80 minutes, 160 minutes, 320 minutes.

Please contact WorldFirst technical support if the issue remains.

Result code

result.resultCode

resultCode

resultStatus

resultMessage

Further action

SUCCESS

S

Success

PROCESS_FAIL

F

A general business failure occurred. Do Not retry.

Contact WorldFirst technical support for human intervention.

PARAM_ILLEGAL

F

Illegal parameters exist. For example, a non-numeric input, or an invalid date.

Update the trade order, change requestId, and retry it.

INVALID_SIGNATURE

F

The signature is invalid.

Validate the signing request, change requestId, and retry it.

REPEAT_REQ_INCONSISTENT

F

Repeated requests are inconsistent.

It's a idempotent request. Do Not retry.

UNKNOWN_EXCEPTION

U

The API call is failed, which is caused by unknown reasons.

Do not change requestId. Retry it.

FUND_ORDER_NOT_EXIST

F

The fund order does not exit.

Contact WorldFirst technical support.

ACCESS_DENIED

F

Access is denied for submitting trade orders.

Contact WorldFirst technical support.

ORDER_COUNT_EXCEED_LIMIT

F

The number of associated trade orders exceeds the limit.

Update the number of order associations, change order reqeustId, and retry it.

WRONG_TRADE_TYPE

F

tradeType is not supported, or tradeType values are inconsistent across trade orders.

Contact WorldFirst technical support.

REQUEST_PARAM_AMOUNT_ERROR

F

Invalid amount parameter exists.

Update the trade order or its associated details, change the order reqeustId, and retry it.

TRADE_ORDER_AUTH_STATUS_ILLEGAL

F

The associated trade order already exists, and its verification has not passed.

Contact WorldFirst technical support.

RELATE_AMOUNT_ERROR

F

The intended association amount is incorrect.

Update the associated amount of trade order, change order reqeustId, and retry.

Note: The amount of the submitted order can not be modified.

ENTITY_REGISTRATION_REQUIRED

F

Entity registration is required for uploading customs declarations.

Contact WorldFirst technical support.

INCONSISTENT_TRADE_TYPE

F

tradeType values are inconsistent for partial associations of the same collection order.

Contact WorldFirst technical support.

UN_SUPPORT_BUSINESS

F

Unsupported business.

Invalid parameter. Retry with the correct parameters.

CONTRACT_CHECK_FAIL

F

The contract check has failed.

Check the contract status then retry.

REGULATED_COUNTRY_NOT_SUPPORTEDFThe tradeCountry or deliverCountry of the trade order is not supported. We do not support the order temporarily for the safety of customers' funds.

For the full list of regulated countries, refer to the parameter introduction . Please contact WorldFirst Support Team for further details. 

Sample code

Sample 1: B2C senario where the value of quotaAccmulationMethod is USER_ID

Request

copy
{
    "requestId": "20230222191210001100300007*****",
    "sceneCode": "PAY_INTO_CHINA",
    "quotaAccumulateTarget": "USER_ID",
    "platform": "AER",
    "tradeOrder": [
        {
            "referenceOrderNo": "50957342066*****",
            "orderTime": "2023-01-10T21:18:24Z",
            "payTime": "2023-01-10T21:28:24Z",
            "orderType": "PAYMENT",
            "tradeBizType": "B2C",
            "tradeType": "GOODS",
            "tradeAmount": {
                "value": 500,
                "currency": "USD"
            },
            "transAmount": {
                "value": 500,
                "currency": "USD"
            },
            "merchant": {
                "store": {
                    "storeShopUrl": "//www.aliexpress.com/store/56*****"
                }
            },
            "buyer": {
                "referenceBuyerId": "7175*****",
                "buyerName": {
                    "fullName": "ekaterina tsip*****"
                }
            },
            "seller": {
                "customerId": "21201200791*****"
            },
            "goods": [
                {
                    "goodsName": "*****",
                    "goodsCategory": "Jewelry & Access*****",
                    "goodsQuantity": "1"
                }
            ],
            "shipping": {
                "wayBillInfo": [
                    {
                        "shippingOrderReferenceNo": "RM450941*****",
                        "shippingAddress": {
                            "address1": "Калининград г, Калининградская обл, Менделее*****",
                            "city": "Калининг*****",
                            "region": "RU"
                        }
                    }
                ]
            }
        }
    ]
}

Response

copy
{
    "result": {
        "resultCode": "SUCCESS",
        "resultStatus": "S",
        "resultMessage": "success"
    },
    "requestId": "*****",
    "tradeOrderResults": [
        {
            "referenceOrderNo": "*****",
            "orderStatus": "ACCEPT",
            "statusMessage": "Accepted, pending process."
        }
    ]
}

Sample 2: B2C senario where the value of quotaAccmulationMethod is RECEIVING_ACCOUNT

Request

copy
{
    "requestId": "20230222191210001100300007*****",
    "sceneCode": "PAY_INTO_CHINA",
    "quotaAccumulateTarget": "RECEIVING_ACCOUNT",
    "platform": "AER",
    "tradeOrder": [
        {
            "referenceOrderNo": "50957342066*****",
            "orderTime": "2023-01-10T21:18:24Z",
            "payTime": "2023-01-10T21:28:24Z",
            "orderType": "PAYMENT",
            "tradeBizType": "B2C",
            "tradeType": "GOODS",
            "tradeAmount": {
                "value": 500,
                "currency": "USD"
            },
            "transAmount": {
                "value": 500,
                "currency": "USD"
            },
            "merchant": {
                "store": {
                    "storeShopUrl": "//www.aliexpress.com/store/56*****"
                }
            },
            "buyer": {
                "referenceBuyerId": "7175*****",
                "buyerName": {
                    "fullName": "ekaterina tsip*****"
                }
            },
            "seller": {
                "referenceCustomerId": "7276*****"
            },
                        "sellerAccount": {
                "bankAccountNo": "*****"
            }
            "goods": [
                {
                    "goodsName": "*****",
                    "goodsCategory": "Jewelry & Access*****",
                    "goodsQuantity": "1"
                }
            ],
            "shipping": {
                "wayBillInfo": [
                    {
                        "shippingOrderReferenceNo": "RM450941*****",
                        "shippingAddress": {
                            "address1": "Калининград г, Калининградская обл, Менделее*****",
                            "city": "Калининг*****",
                            "region": "RU"
                        }
                    }
                ]
            }
        }
    ]
}

Response

copy
{
    "result": {
        "resultCode": "SUCCESS",
        "resultStatus": "S",
        "resultMessage": "success"
    },
    "requestId": "*****",
    "tradeOrderResults": [
        {
            "referenceOrderNo": "*****",
            "orderStatus": "ACCEPT",
            "statusMessage": "Accepted, pending process."
        }
    ]
}

Sample 3: B2B scenario

Request

copy
{
    "requestId": "16782687*****",
    "sceneCode": "CREATE_ORDERS_AND_ASSOCIATE",
    "transferId": "20230308191210001100300007*****",
    "tradeOrders": [
        {
            "referenceOrderNo": "trade_order16782687*****",
            "tradeBizType": "B2B",
            "tradeType": "GOODS",
            "orderTime": "2023-01-10T21:18:24Z",
            "isUsedForExchange": "Y",
            "purposeCode": "ACM",
            "tradeAmount": {
                "currency": "USD",
                "value": "2999"
            },
            "transAmount": {
                "currency": "USD",
                "value": "2999"
            },
            "bizContractInfo": {
                "buyerEnName": "阿联*****",
                "contractList": [
                    {
                        "fileKey": "sd*****",
                        "fileName": "sa*****"
                    }
                ],
                "deliverCountry": "JP",
                "tradeCountry": "JP"
            },
            "goods": [
                {
                    "goodsCnName": "微软*****",
                    "goodsName": "Microsoft Ergonomic Keyboard (LXM-0*****",
                    "goodsQuantity": "3",
                    "goodsUnit": "KG",
                    "storeUrl": "http://sd*****"
                }
            ],
            "shipping": {
                "expectedShippingDate": "16594306*****",
                "isDeclared": "N",
                "isNewBuyer": "N",
                "isShipped": "N",
                "tradeTerms": "CFR",
                "wayBillInfos": [
                    {
                        "logisticsCompany": {
                            "providerKey": "HYESL",
                            "providerValue": "阿联酋*****"
                        },
                        "shippingMethod": "RAILWAY",
                        "shippingOrderReferenceNo": "12*****",
                        "shippingProofAttachmentList": [
                            {
                                "fileKey": "sd*****",
                                "fileName": "sa*****"
                            }
                        ]
                    }
                ]
            },
            "storeWebSites": {
                "fileKey": "sd*****",
                "fileName": "sa*****"
            },
            "otherAttachmentList": [
                {
                    "fileKey": "remarkfilefi*****",
                    "fileName": "remarkfilefil*****"
                }
            ],
            "attachmentDesc": "123*****"
        }
    ]
}

Response

copy
{
  "acceptOrderId": "20230308191680008004600000*****",
  "result": {
        "resultCode": "SUCCESS",
        "resultStatus": "S",
        "resultMessage": "success"
    }
}

@2024 WorldFirst