Overview
Base URL, authentication, request format and pagination for the OpenStock API.
The OpenStock API is a JSON-over-HTTPS REST API. Requests and responses use application/json, timestamps are ISO 8601 strings in UTC, and amounts are plain numbers in the store’s currency.
OpenAPI specification#
Download the OpenAPI 3.1 specification to import the supported endpoints into your API client. It includes request parameters, permission requirements, and response examples from this reference.
Public API and dashboard endpoints
The public API currently covers the three groups below. An authenticated dashboard request is not automatically available to a store API key. Use the documented endpoints and permissions rather than copying an internal request from your browser.
Base URL#
https://openstock.devAuthentication#
Send a store API key as a bearer token on every request. See Authentication for permissions and key management.
Authorization: Bearer sk_your_secret_keyPagination#
List endpoints accept limit (1–100, default 20) and offset (default 0) and return the total alongside the page:
{
"data": [
"…"
],
"total": 42,
"limit": 20,
"offset": 0
}A reliable integration#
- Keep your store API key in a server environment variable.
- Start with a read-only request using the least permission you need.
- Inspect the HTTP status before parsing a response as successful.
- Record resource IDs and your own order reference when creating a session or payout.
- Verify payment using session status or a signed webhook before delivering custom goods.
- Check the recorded outcome before retrying a timed-out balance change or withdrawal.
Endpoints#
- POST
/api/checkout-api/sessionsCreate session - GET
/api/checkout-api/sessionsList sessions - GET
/api/checkout-api/sessions/{session_id}Retrieve session - POST
/api/checkout-api/sessions/{session_id}/cancelCancel session - GET
/api/withdrawal-api/walletsList wallets - POST
/api/withdrawal-api/withdrawalsCreate withdrawal - GET
/api/withdrawal-api/withdrawalsList withdrawals - GET
/api/withdrawal-api/withdrawals/{withdrawal_id}Retrieve withdrawal - GET
/api/customer-balance-api/customersList customers - POST
/api/customer-balance-api/customers/infoRetrieve customer - POST
/api/customer-balance-api/customers/add-balanceAdd balance - POST
/api/customer-balance-api/customers/deduct-balanceDeduct balance - POST
/api/customer-balance-api/customers/transactionsList transactions
OpenStock