πDevelop Reference
1. Signature Verification
1.1 HTTP Header Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
app_id | string | Y | The key assigned by the system |
timestamp | number | Y | Seconds, difference from the server should not exceed 1h (1714492800) |
sign | string | Y | The signed string generated using the system-assigned secret key, the server will use the same rules to verify the validity of the request |
1.3 Request Body Specification
Only JSON objects are supported, and all key-value pairs are of type string.
1.3 Signing Rules
Signing Secret: The secret corresponding to the api_key
Signing Algorithm: HmacSHA1
Signing Content:
For example: timestamp is 1694958440 The body content is: {"sign": "xxxxadqw", "ba":"ba_content", "aa": "aa_content", "cb": "\t \t (the \t here is a tab)"}
The signing content would be: There is a space at the end (ignoring the double quotes) "1704959546aa_contentba_content "
2. Business Codes
π‘ Response code, not HTTP status code
Code | Description | Remark |
---|---|---|
0 | Success | Y |
419 | 'Api key status abnormal' | |
420 | Invalid parameters | Missing required parameters (sign, timestamp) in the header or invalid api-key |
421 | Invalid timestamp | Y |
422 | Other unknown exceptions | |
423 | Signature error |
3. API
3.1 Client
Initiate in-app purchase flow
3.2 Server
3.2.1 Order
3.2.1.1 Order Details
HTTP Request
GET https://developer-open-api.broearn.com/v1/dapp/order/info
Query Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
mer_order_id | string | Y | The order ID passed in by the dapp client (the order ID in the client's own system) |
The request body is empty
Response Body
Parameter Name | Parameter Type | Nullable | Content | Description |
---|---|---|---|---|
code | number | N | 0 | 0 - Request successful |
data | object (json) | Y | Order details instance |
Order Details Instance Description
Parameter Name | Parameter Type | Nullable | Content | Description |
---|---|---|---|---|
order_id | string | N | Platform order ID | |
product_id | string | N | Product ID | |
mer_order_id | string | N | Merchant order ID (the merchant must ensure uniqueness in their own system, the platform does not perform uniqueness validation) | |
product_name | string | N | Product name | |
status | number | N | Order status, 1 - Success, 2 - Refunded | |
purchase_time | number | N | Payment time, in milliseconds | |
refund_time | number | Y | Refund time, valid when status is 2 | |
amount | number | N | Payment amount (micros, actual payment amount * 10^6) | |
currency | number | N | Currency type (USD, etc.) | |
dapp_id | number | N | The Dapp ID the order belongs to |
Example Order Details Instance
3.2.1.2 Order List
HTTP Request
GET https://developer-open-api.broearn.com/v1/dapp/order/list
Query Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
start_time | number | Y | Start time, seconds (order payment time, greater than or equal to this time) |
end_time | number | Y | End time, seconds (order payment time, less than this time) |
page_num | number | Y | Pagination parameter, page number |
page_size | number | Y | Pagination parameter, number of items per page, maximum 1000, over 1000 will be automatically processed as 1000 |
status | number | N | Order status, if not passed, it will query all statuses |
dapp_id | number | N | Dapp ID, if not passed, it will query orders for all dapps under the organization |
The request body is empty
Response Body
Parameter Name | Parameter Type | Nullable | Content | Description |
---|---|---|---|---|
code | number | N | 0 | 0 - Request successful |
data | object (json) | Y | Order data instance |
Order Data Instance Description
Parameter Name | Parameter Type | Nullable | Content |
---|---|---|---|
count | string | N | Total records for the query condition |
list | array (json) | Y | List of order detail instances |
Example Order Data Instance
Last updated