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:

http://37.59.154.5:8000/api/v1

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
Keep your secret key on your server only. Anyone with it can create invoices and request payouts on your account.

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

POST http://37.59.154.5:8000/api/v1/invoices/new

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.

FieldTypeDescription
order_number requiredstringUnique order id per merchant.
order_name requiredstringYour internal order name/label.
source_currencystringFiat code, e.g. USD, EUR.
source_amountnumberFiat amount to convert to crypto.
currencystringPin a crypto, e.g. BTC. Omit to let the buyer choose.
amountnumberExact crypto amount (use instead of source_*).
descriptionstringOptional note shown internally.
callback_urlstringURL that receives signed status webhooks.
success_callback_urlstringWhere the buyer returns after paying.
fail_callback_urlstringReturn URL on failure/expiry.
emailstringOptional buyer email.
expire_minintegerLifetime in minutes (1–10080).
return_existingbooleanReturn 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

GET http://37.59.154.5:8000/api/v1/invoices/{txn_id}

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:

newpendingunderpaid overpaidcompletedexpired cancellederror

Balances

GET http://37.59.154.5:8000/api/v1/balances

Your available balance per currency.

{
  "status": "success",
  "data": { "balances": [ { "currency": "TRX", "amount": "18.158" } ] }
}

Create a payout

POST http://37.59.154.5:8000/api/v1/payouts/new

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

POST http://37.59.154.5:8000/api/v1/payouts/mass

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

GET http://37.59.154.5:8000/api/v1/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)
Always return HTTP 200 once you've stored the update. Failed deliveries are retried with backoff.

Supported currencies

BTCLTCDOGEETHUSDTUSDCTRXUSDT_TRC20BCHDASHZECBNBUSDT_BEP20MATICSOL

Token codes carry their network (e.g. USDT_TRC20, USDT_BEP20). Availability depends on which coins you enable.

Errors & status codes

HTTPMeaning
200Success.
401Missing or invalid API key.
402Insufficient balance (payouts).
422Invalid parameters (e.g. bad amount, duplicate order_number).
429Rate limit exceeded — slow down.
5xxServer 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.