Getting started
Authentication & API keys
Every API request is authenticated with a secret API key that belongs to one project. Keys are created in the dashboard and shown only once.
Create an API key#
- Sign in to the dashboard and pick the project in the project switcher (top left). Keys only work for the project they were created in.
- Open Settings → API keys.
- Give the key a name that says where it's used, e.g.
production-server, then click Create key. - Copy the key from the highlighted card. It's shown once: only a hash is stored, so it can't be shown again.
- Store it in your server's secret manager or environment, e.g.
JAGPAY_API_KEY, then click I've saved it.
Keys look like jp_9fK2… (the jp_ prefix plus 43 random characters). The keys table shows the first 12 characters, when each key was last used, and lets you revoke a key instantly. Creating a key sends a security alert email to the project owner.
Keep keys on your server
Never put an API key in a browser, mobile app or public repository. If a key leaks, revoke it in Settings → API keys and create a new one. Payouts additionally require a signature from a separate secret, so a leaked key alone can't move funds.Dashboard-only actions
Some things can only be done while signed in to the dashboard, never with an API key: creating and revoking API keys, revealing or rotating the webhook secret, generating the payout signing secret, two-factor authentication and auto-settle rules. Calling those endpoints with an API key returns 403.
Authenticate requests#
Send the key as a bearer token in the Authorization header on every request. Requests with a missing, revoked or wrong key fail with 401 Invalid API key. Send JSON bodies with Content-Type: application/json.
curl https://www.jagpay.io/api/v1/balances \ -H "Authorization: Bearer jp_9fK2…your_key…"Responses#
Every response uses the same envelope. Successful calls return { "status": true, "data": … } with HTTP 200 (or 201 when something was created). Amounts are always decimal strings in the currency's units ("251.25"), never floats, and timestamps are ISO 8601 in UTC.
{ "status": true, "data": { "balances": [ { "currency": "BSC_USDT", "amount": "12480.5" } ] }}Pagination
List endpoints return newest first, up to limit items (1–100, default 25), plus next_cursor. Pass it back as cursor to get the next page; it's null on the last page.
Errors#
Errors return "status": false with an error object: type (validation, app, db or unknown), a readable message, and details. For validation errors, details maps each field to its problem.
{ "status": false, "error": { "type": "validation", "message": "Please check form errors", "details": { "amount": "Must be greater than zero", "order_name": "Too small: expected string to have >=1 characters" } }}{ "status": false, "error": { "type": "app", "message": "A payment with this order_id already exists", "details": { "payment_id": "pay_8kQ2mZx7LrT4bW9e" } }}| HTTP | Meaning | Examples |
|---|---|---|
401 | Not authenticated | Invalid API key; payout request signature missing, expired, invalid or already used |
403 | Not allowed | Endpoint is dashboard-only; payouts need the project owner's 2FA (details.code: "two_factor_not_enabled") |
404 | Not found | Payment or payout ID doesn't exist in this project |
409 | Conflict with current state | Duplicate order_id, insufficient balance, refunding a payment that isn't underpaid / late |
410 | Gone | The payment expired before a coin was selected |
422 | Validation failed | Missing or malformed fields; see details |
500 | Server error | Something went wrong on our side. Safe to retry with the same order_id. |
- Retrying a create call with the same
order_idis safe: payments reject duplicates with409, payouts return the existing payout. - Don't parse
message; branch on the HTTP status anddetails.
