Portal pengembangan

Authentication#

All merchant order endpoints require API key authentication. Requests and responses use JSON.

API Key Authentication#

Include these headers in every authenticated request.

HeaderRequiredDescription
OK-ACCESS-KEYYesAPI key
OK-ACCESS-SIGNYesRequest signature
OK-ACCESS-PASSPHRASEYesAPI passphrase
OK-ACCESS-TIMESTAMPYesISO 8601 timestamp
Content-TypeYesUse 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.

json
{
  "code": 0,
  "msg": "",
  "data": {}
}
FieldTypeDescription
codeInteger0 means the request succeeded. A nonzero value indicates a business or request error.
msgStringDescription of the result or error. It can be empty on success.
dataObject / nullBusiness 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.