Query interface

The query interface (optional interface)

It is used to actively check whether the order is paid successfully. Generally, only the originating payment + callback interface can be used. If your server has been down for a while, you can use this interface to quickly get the payment status of the order during the interruption period. Note: This interface cannot be queried frequently, and each order can only be checked once per minute. It is not an alternative to the callback interface.

Interface URL:


Transfer method:GET

Parameter request

Parameters Required Types Description
order_id Required string(32) The merchant order number, please ensure the uniqueness of the order number.
time Required long The server time when initiating payment, with 13-bit timestamp, is used for security reasons to defend against request resend attacks
app_key Required string(16) The APP key is generated by the platform. Get in "Business Backend - Business Information
sign Required string(32) Sign it, then click here to view the signature generation method

Example request

  1. curl 'https://bapi.app/api/v2/order?sign=e1f73a0b4f11eed4147a6ac761556e2b&order_id=1&app_key=4789e57f8629eb9e&time=1234567890123'

Returned parameter

Parameter format::application/json

Parameters Types Description
code int The status code, 200 means successful acquisition, other status codes, please refer to the information content returned by msg
msg string Prompt message
data object -
data.bapp_id string(32) The platform order number, this order number is unique on B.app
data.order_id string(32) The merchant order number, please ensure the uniqueness of the order number.
data.order_state int The Order status,0: Waiting for user payment 1: Payment success 2: Order timeout is automatically closed
data.body string(128) The product name, UTF8 format, is used to display the location of the product name on the payment page, as well as the list of orders in your business backend.
data.notify_url string The callback address
data.order_ip string The Order originator ip
data.amount long The order amount, unit characters (Cent)
data.amount_type string(16) The currency unit of the order, Input 3 capital letters, support: USD - US dollar, CNY - RMB, HKD - Hong Kong dollar, TWD - New Taiwan dollar, KRW - Korean dollar, MOP - Macao dollar, JPY - Japanese yen, GBP - pound, SGD - Singapore dollar, EUR - Euro, RUB - ruble
data.amount_btc long The Bitcoin amount, unit (Satoshi)
data.pay_time long The payment timestamp (13 characters), if it is unpaid or failed to pay, this value is 0
data.create_time long The order creation timestamp (13 characters)
data.order_type int The order type,1: Scan code payment 2: H5 payment 3: APP primary payment
data.app_key string Platform generated app key, 16-bit character
data.extra string The extra parameters, up to 256 characters

Returned example

  1. {
  2. "code": 200,
  3. "msg": "ok",
  4. "data": {
  5. "bapp_id": "20190618171802840b6a",
  6. "order_id": "1",
  7. "order_state": 1,
  8. "body": "goods_name",
  9. "notify_url": "https://bapi.app/api/experience/notify/test",
  10. "order_ip": "",
  11. "amount": 1,
  12. "amount_type": "CNY",
  13. "amount_btc": 16,
  14. "pay_time": 1560859623468,
  15. "create_time": 1560849482796,
  16. "order_type": 2,
  17. "app_key": "4789e57f8629eb9e",
  18. "extra": ""
  19. }
  20. }