Skip to main content

Query status of an order

When a user successfully completes a payment, ZaloPay will send a callback (notification) to the Merchant. Upon receiving this, the Merchant should update the order status to "Success" in their system.
In practice, the callback might be missed due to issues such as network timeouts, Merchant service unavailability, or internal errors. Therefore, the Merchant should proactively implement an API call to query the order status.
Recommended timing for querying order status:
- Use a cron job or scheduled task to periodically query the order status until a callback is received or 15 minutes (the default order expiration time) have passed since the order was created.
- Perform a one-time query 15 minutes after the order is created if no callback has been received.

Request Body required
  • app_id integer required

    This is a Zalopay-provided identifier specific to the merchant's service or application, established during the integration agreement for payment methods.

  • app_trans_id string required

    The transaction ID that is used for querying (TXID of order transaction).

  • mac string required

    Authentication information mac = HMAC(hmac_algorihtm, mac key, hmacinput), see as below:
    - hmac_algorihtm: is a security method registered by Merchant with Zalopay, the default is HmacSHA256.
    - mac key: provided by Zalopay at registration.
    - hmacinput = app_id + | + app_trans_id + | + mac key

    Please refer to secure data transmission for detailed information.

Responses

OK


Schema
  • return_code integer

    Status code.
    Please refer to status code for possible values

  • return_message string

    Description of status code.

  • sub_return_code integer

    Status code detail.
    Please refer to sub status code for possible values

  • sub_return_message string

    Description of status code detail.

  • is_processing boolean

    Order processing status information (for Zalopay only).

  • amount int64

    Amount received (only available when the payment is successful).

  • zp_trans_id int64

    Zalopay's transaction code, initiate when users confirms payment at Zalopay site. Merchant uses this to request refund & reconciliation.

  • server_time int64

    Zalopay's Transaction processing time (unix timestamp in milliseconds).

  • discount_amount int64

    Discount amount user received.

Loading...