Coinvera API
A small, REST-style JSON API to create crypto invoices, track payments, read balances and send payouts. This page documents the public merchant API only.
Introduction
All API calls are made over HTTPS to your gateway. The base URL is:
Requests and responses use JSON. Every response is wrapped in an envelope with a status field
(success or error) and a data object.
Authentication
Authenticate with your secret API key from Panel → API keys. Send it in the
Authorization header as a Bearer token (recommended), or in an X-API-KEY header.
Never put the key in the URL.
Authorization: Bearer YOUR_SECRET_KEY
Content-Type: application/json
Requests & responses
A successful response looks like this:
{
"status": "success",
"data": { "...": "..." }
}
An error response carries an HTTP error code and:
{
"status": "error",
"data": { "name": "Unauthorized", "message": "Missing API key", "code": 401 }
}
Create an invoice
Creates a hosted payment invoice and returns its URL. Redirect the customer to invoice_url.
Provide a fiat amount (source_currency + source_amount) and let the
customer pick the coin on the page, or pin a specific coin with currency + amount.
| Field | Type | Description |
|---|---|---|
| order_number required | string | Unique order id per merchant. |
| order_name required | string | Your internal order name/label. |
| source_currency | string | Fiat code, e.g. USD, EUR. |
| source_amount | number | Fiat amount to convert to crypto. |
| currency | string | Pin a crypto, e.g. BTC. Omit to let the buyer choose. |
| amount | number | Exact crypto amount (use instead of source_*). |
| description | string | Optional note shown internally. |
| callback_url | string | URL that receives signed status webhooks. |
| success_callback_url | string | Where the buyer returns after paying. |
| fail_callback_url | string | Return URL on failure/expiry. |
| string | Optional buyer email. | |
| expire_min | integer | Lifetime in minutes (1–10080). |
| return_existing | boolean | Return the existing invoice for this order_number instead of erroring. |
Example
curl -X POST http://37.59.154.5:8000/api/v1/invoices/new \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"order_number": "ORDER-1001",
"order_name": "Order #1001",
"source_currency": "USD",
"source_amount": 49.99,
"callback_url": "https://yourstore.com/crypto/callback",
"success_callback_url": "https://yourstore.com/thank-you",
"expire_min": 60
}'
{
"status": "success",
"data": {
"txn_id": "9f1c2a7b4d8e...",
"invoice_url": "http://37.59.154.5:8000/invoice/9f1c2a7b4d8e...",
"invoice_total_sum": "0"
}
}
Get invoice / status
Returns the current state of an invoice. Poll this, or rely on webhooks.
{
"status": "success",
"data": {
"txn_id": "9f1c2a7b4d8e...",
"status": "completed",
"currency": "TRX",
"amount": "6.078242",
"pending_amount": "0",
"wallet_hash": "T...",
"source_currency": "USD",
"source_rate": "0.123",
"expected_confirmations": 20,
"expire_at": "2026-06-23T20:08:25+00:00"
}
}
Possible status values:
Balances
Your available balance per currency.
{
"status": "success",
"data": { "balances": [ { "currency": "TRX", "amount": "18.158" } ] }
}
Create a payout
Withdraw to an external address. The network fee is taken according to your fee plan; the destination receives amount.
curl -X POST http://37.59.154.5:8000/api/v1/payouts/new \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{ "currency": "TRX", "amount": 10, "to_address": "T...", "note": "payout #1" }'
{
"status": "success",
"data": { "payout_id": "b2c3...", "state": "approved", "note": "Approved — queued for sending" }
}
Mass payout
Submit up to 1000 payouts in one batch.
{
"items": [
{ "currency": "TRX", "amount": 5, "to_address": "T..." },
{ "currency": "ETH", "amount": 0.01, "to_address": "0x..." }
]
}
List payouts
Returns your recent payouts and their states.
Callbacks (webhooks)
When an invoice changes state, Coinvera sends a POST with a JSON body to your
callback_url. Verify authenticity before trusting it.
The signature is HMAC-SHA256 over the string version.timestamp.canonical_json,
keyed with your webhook secret (from Panel → API keys). canonical_json
is the body serialized with sorted keys and compact separators. Reject the request if the timestamp is outside the
allowed tolerance or the signature does not match.
# pseudocode
signed = version + "." + timestamp + "." + canonical_json(body)
expected = hmac_sha256(webhook_secret, signed) # hex
valid = constant_time_equals(expected, received_signature)
Supported currencies
Token codes carry their network (e.g. USDT_TRC20, USDT_BEP20). Availability depends on which coins you enable.
Errors & status codes
| HTTP | Meaning |
|---|---|
| 200 | Success. |
| 401 | Missing or invalid API key. |
| 402 | Insufficient balance (payouts). |
| 422 | Invalid parameters (e.g. bad amount, duplicate order_number). |
| 429 | Rate limit exceeded — slow down. |
| 5xx | Server error — retry later. |
Need the raw OpenAPI schema? It is available at /openapi.json and an interactive explorer at /docs — both limited to this public API.