Authentication#
All merchant order endpoints require API key authentication. Requests and responses use JSON.
API Key Authentication#
Include these headers in every authenticated request.
| Header | Required | Description |
|---|---|---|
OK-ACCESS-KEY | Yes | API key |
OK-ACCESS-SIGN | Yes | Request signature |
OK-ACCESS-PASSPHRASE | Yes | API passphrase |
OK-ACCESS-TIMESTAMP | Yes | ISO 8601 timestamp |
Content-Type | Yes | Use application/json for POST requests. |
Authentication headers and signing follow the existing Onchain OS API key specification. The examples read credentials from environment variables. Generate OK_ACCESS_SIGN using the HTTP method, path, and request body you actually send. Keep the API key on your server for order requests. Share the checkout URL with the buyer so they can open the payment page.
Common Response Format#
Responses include the business fields code, msg, and data.
{
"code": 0,
"msg": "",
"data": {}
}
| Field | Type | Description |
|---|---|---|
code | Integer | 0 means the request succeeded. A nonzero value indicates a business or request error. |
msg | String | Description of the result or error. It can be empty on success. |
data | Object / null | Business data returned by the endpoint, when available. |
code is an integer. Clients should ignore unrecognized response fields.
code=0 confirms that the request was processed successfully. Read data.status to determine the payment result, even when the HTTP request succeeds.
Optional response fields may be null or omitted when no value is available. Handle both cases.
