API Reference
中文

Order Status API (Strongly Recommended)

The Order Status API is a crucial functionality of the TD system aimed at ensuring the accuracy and timeliness of retrieving order information.

Through the Order Status API, we are able to accurately identify more cunning fraudsters who cleverly use normal identities and behaviors to evade detection at critical business checkpoints, thereby deceiving the system. Relying solely on individual business behaviors often proves difficult in revealing the true intentions of fraudsters.

Additionally, the application of the Order Status API enhances our ability to accurately identify occasional abnormal behaviors of legitimate users, thus reducing false positive rates and improving order conversion rates. We perform seamless data reporting on users at regular business checkpoints and make decisions at critical business checkpoints. This design helps minimize user interference and enhances user experience.

Through the Order Status API, we ensure that the TD system consistently receives the latest order information, thereby enhancing system security and reliability.

API Format

Base URL

API

URLRequest MethodsContent-TypeOutput FormatCharacter Set
api-base-url?partner_code=xxx&partner_key=xxxPOSTapplication/jsonJSONUTF-8

example: https://sg-event.apitd.net/order/v3?partner_code=test_code&partner_key=test_key

Authentication
ParameterTypeDescriptionRequired/OptionalNotes
partner_codeStringPartner Coderequiredassigned by TD
partner_keyStringPartner Keyrequiredassigned by TD

Request

A complete request parameter typically consists of two parts:

  1. Basic Parameter: These fields contain fundamental information related to the request itself, aiming to ensure the validity and security of the request.
  2. Event Parameter: These fields are related to the order status, such as order_payment, order_ship, and other events. Through these fields, we can pass data related to specific events, such as payment information, shipment details, and so on.

By combining the basic fields and event fields, a complete set of request parameters is formed. This design allows us to effectively transmit and process event data related to the account status, ensuring the accuracy and security of account information.

Basic Parameter

ParameterTypeDescriptionRequired/OptionalNotes
channelStringChannel Identifierrequiredassigned by TD
session_idStringSession IDrequiredThe session ID is a unique identifier assigned by the website server to a specific user during the visit, which is usually stored in the form of a cookie, form parameter, or URL
account_idStringAccount IDconditionally required: required when account registration/creation is finishednot required when the account doesn't exist
event_timeStringThe Actual Time of the EventrequiredISO 8601, format YYYY-MM-DDTHH:mm:ss.sssZ, example: 2021-10-12T14:20:50.521+07:00
event_typeStringEvent Typerequiredenumeration:
order_modify
order_cancel
order_payment
order_payment_result
order_ship
order_confirm
order_return
order_refund
order_chargeback
terminalTerminalDevice Informationrequired
extExtExtended Fieldoptionalextended field registered in the TD system

Event Parameter

Our API design restricts each request to only involve data related to a single event. This means that you cannot simultaneously initiate multiple different event data requests, such as order_ship and order_confirm.

To ensure data accuracy and system reliability, we recommend that you send separate requests for each event, considering the independence of each event. By handling each event separately, we can better manage and track the data processing process, avoiding confusion and conflicts.

Adhering to this rule will help improve system performance and reliability, ensuring that each event is correctly processed. If you need to handle multiple different events simultaneously, we suggest sending separate requests for each event to ensure data integrity and consistency.

EventEvent TypeRequired/Optional
OrderModifyorder_modifyoptional (strongly recommended)
OrderCancelorder_canceloptional (strongly recommended)
OrderPaymentorder_paymentoptional (strongly recommended), but if payment information have already been passed through the verification API, they should be ignored
OrderPaymentResultorder_payment_resultoptional (strongly recommended), but if payment result information have already been passed through the verification API, they should be ignored
OrderShiporder_shipoptional (strongly recommended)
OrderConfirmorder_confirmoptional (strongly recommended)
OrderReturnorder_returnoptional (strongly recommended)
OrderRefundorder_refundoptional (strongly recommended)
OrderChargebackorder_chargebackoptional (strongly recommended)

Request Example

Let's take the example of a order_ship event.

{
    "channel": "test",
    "session_id": "abc0123456789",
    "account_id": "123456789",
    "event_time": "2021-10-12T14:20:50.521+07:00",
    "event_type": "order_ship",
    "terminal": {
        "black_box": "aGPH1658920283672ropYaFxT7",
        "ip": "210.20.10.33"
    },
    "ext": {
        "ext_book_id": "LFOUHOFHOHFNOUH",
        "ext_book_num": 10
    },
    "order_id": "NX348566DIHD",
    "logistics": {
        "logistics_type": "Standard Shipping",
        "cost": {
            "currency": "USD",
            "amount_local": 68,
            "amount_usd": 10,
            "amount_cny": 68
        },
        "logistics_company": "SF"
    }
}

Response Parameter

ParameterTypeDescriptionRequired/OptionalNotes
codeIntegerAPI Status Coderequired
messageStringStatus Messagerequiredspecific abnormal reasons will be provided when the API is abnormal
sequence_idStringUnique ID of ResponserequiredA unique ID used to track each request

API Status Code

codeDescription
200Success
9001{Parameter} empty
9002{Parameter} check error
9003{Parameter} length or size exceeds 1024
9004Either black_box or ip exists
9200System error
9201Unknown error
9202Illegal Content-Type

Response Example

{
    "code": 200,
    "message": "",
    "sequence_id": "1648777165770866F82AC7F326307055"
}