Skip to content

Navigation

REST API / v1

Integrate crypto
payments.

Use a server integration, install WooCommerce, or share a payment link. Hosted checkout lets the buyer choose their coin and network.

Base URL https://api.coinavio.com/v1

Quickstart

  1. Get your merchant account approved and create a Test API key in Developers. Configure a webhook URL and save its Webhook secret on your server.
  2. Verify your site so success and cancel URLs on its domain are used as given.
  3. Create an invoice with the USD amount, your order ID and return URLs. Save the returned invoice ID with your order.
  4. Redirect the buyer to checkoutUrl. In test mode, select a coin and simulate the payment.
  5. Receive the signed webhook, verify it against the raw body, and process each event ID once.
  6. For invoice.paid or invoice.overpaid, match the invoice to your order and mark it paid. Switch to a Live key when ready to accept real payments.
Use the verified webhook to fulfil the order. A buyer visiting your success URL is not proof of payment.

Building for many merchants, such as a panel script, billing system or cart? Read the platform guide.

Authentication

Use Dashboard → Developers to create a Test or Live key. Key IDs start with ck_test_ or ck_live_. Copy the full key when it is created; send it as a bearer token from your server.

Test keys can only list, read, look up, cancel and simulate test invoices. Live keys access only live invoices. The same orderId can be used once in each mode; keep test and live order mappings separate. Invalid or revoked keys return 401; inaccessible invoices return 404.

API authentication
Authorization: Bearer <apiKey>

Swipe within the code to read long lines.

Dashboard endpoints use cookie authentication. Your integration uses the public invoice API with its bearer key. Never put an API key or webhook secret in browser code or a Buy button. Lost your authenticator? Contact support from the email address of your account.

Site-scoped keys

When you create a key in Dashboard → Developers you can bind it to one of your verified sites, or keep it for all sites (account-wide). You can create several Test and Live keys per site. Keys created before site scoping are account-wide and work exactly as before. GET /v1/account returns site with the bound site's id and domain, or null for an account-wide key.

  • With a Live site key, a successUrl or cancelUrl that is not on that site's domain, its www host or one of its subdomains is replaced with the site root https://<site domain>/ and reported in warnings. Test invoices skip this check.
  • If the site has its own webhook URL (set in Projects) and the request has no callbackUrl, the site webhook URL is saved as the invoice's callbackUrl. Changing the site webhook affects new invoices only. Signatures use the same webhook secret.
  • A site key lists, reads, looks up, cancels, accepts and simulates only its own site's invoices; any other invoice returns 404. Account-wide keys still see every invoice.
  • An orderId stays unique per account and mode. Reusing one that belongs to another site or to an account-wide invoice returns 409 ORDER_ID_IN_USE; prefix order ids per store.
  • Removing a site revokes its keys immediately. Its invoices are kept.

Create an invoice and redirect

POST /v1/invoices accepts a USD priceAmount as a decimal string. The default payment window is 60 minutes. expiresInMinutes accepts 5-1440. Selecting a coin fixes its amount until invoice expiry. Unknown request fields are rejected. Use a stable orderId from your store and optional description, return URLs and metadata.

  • callbackUrl (optional): an HTTPS webhook URL for this invoice only. In production it must resolve exclusively to public addresses, use port 80, 443, 8080 or 8443, and contain no credentials. Redirects are not followed. It overrides the webhook URL saved in Developers.
  • buyerPaysFee (optional): true adds the CoinAvio fee on top, so you receive the full priceAmount. The buyer pays price.amount; credit the order for price.baseAmount.

The processing fee for each new invoice is the lower of the current platform rate and any custom rate agreed for your account. Without a custom rate, the platform rate applies. A lower platform rate preserves your custom rate for later use; a custom zero rate stays zero. GET /v1/account reports your current effective rate. Each invoice keeps the feeBps saved at creation, even if rates change later.

cURL · Create invoice
curl -X POST "https://api.coinavio.com/v1/invoices" \
  -H "Authorization: Bearer $COINAVIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "priceAmount": "49.99",
  "orderId": "order-1001",
  "description": "Annual membership",
  "successUrl": "https://shop.example.com/thanks?order=1001",
  "cancelUrl": "https://shop.example.com/cart",
  "metadata": {
    "customerId": "c_42"
  }
}'

Swipe within the code to read long lines.

Node.js · Create invoice
// Node.js 18+; run on your server.
export async function createCheckout() {
  const response = await fetch("https://api.coinavio.com/v1/invoices", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.COINAVIO_API_KEY}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "priceAmount": "49.99",
      "orderId": "order-1001",
      "description": "Annual membership",
      "successUrl": "https://shop.example.com/thanks?order=1001",
      "cancelUrl": "https://shop.example.com/cart",
      "metadata": {
        "customerId": "c_42"
      }
    })
  });
  const invoice = await response.json();
  if (!response.ok) {
    throw new Error(invoice.message || "Invoice creation failed");
  }
  return invoice;
}
// In your checkout handler, save invoice.id with the order, then
// send an HTTP 303 redirect to invoice.checkoutUrl.

Swipe within the code to read long lines.

PHP · Create invoice and redirect
<?php
// PHP 7.4+ with cURL; keep the API key in server configuration.
$body = json_encode([
    'priceAmount' => '49.99',
    'orderId' => 'order-1001',
    'description' => 'Annual membership',
    'successUrl' => 'https://shop.example.com/thanks?order=1001',
    'cancelUrl' => 'https://shop.example.com/cart',
    'metadata' => ['customerId' => 'c_42'],
], JSON_THROW_ON_ERROR);
$ch = curl_init('https://api.coinavio.com/v1/invoices');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('COINAVIO_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => $body,
]);
$raw = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$error = curl_error($ch);
curl_close($ch);
if ($raw === false) throw new RuntimeException($error);
$invoice = json_decode($raw, true, 512, JSON_THROW_ON_ERROR);
if ($status < 200 || $status >= 300 || empty($invoice['checkoutUrl'])) {
    throw new RuntimeException($invoice['message'] ?? 'Invoice creation failed');
}
// Store $invoice['id'] with your order before redirecting.
header('Location: ' . $invoice['checkoutUrl'], true, 303);
exit;

Swipe within the code to read long lines.

Illustrative invoice response
{
  "id": "inv_example",
  "status": "NEW",
  "testMode": true,
  "price": {
    "amount": "49.99",
    "currency": "USD",
    "baseAmount": "49.99",
    "buyerPaysFee": false,
    "feeBps": 0,
    "fee": "0"
  },
  "checkoutUrl": "https://coinavio.com/pay/inv_example",
  "expiresAt": "2026-10-12T12:30:00.000Z",
  "warnings": []
}

Swipe within the code to read long lines.

Redirect the buyer to the returned checkoutUrl with an HTTP 303 response. Keep the invoice ID to match future webhooks. Handle failed API requests before redirecting.

Amounts are decimal strings without trailing zeros, for example "25" for 25.00; compare them as numbers.

Return URLs and warnings

For Live invoices, a successUrl or cancelUrl on a domain you verified in Projects is used as given; its www host and subdomains count, and so does the link of a verified Telegram bot (https://t.me/<username>). Any other domain, such as a mirror, is replaced instead of rejected: an account-wide key uses your verified website URL, or drops the link when none is verified; a site-scoped key uses its site root https://<site domain>/. The invoice's successUrl and cancelUrl show the stored values (null when dropped). Test invoices skip the domain check.

Create responses always include warnings: one RETURN_URL_REPLACED entry per replaced field, or an empty array when nothing changed, in test mode and on an idempotent replay. The message is for people and its wording may change; read code and field. GET responses and webhooks do not include warnings.

Create response · warnings
"warnings": [
  { "code": "RETURN_URL_REPLACED", "field": "successUrl", "message": "…" }
]

Swipe within the code to read long lines.

A return URL that is not a valid web address (another scheme, an IP address instead of a domain name, or text that cannot be parsed) still returns HTTP 400 in every mode. Payment links created in the dashboard still require verified domains.

Read an invoice

Invoice endpoints
GET https://api.coinavio.com/v1/invoices/{id}
GET https://api.coinavio.com/v1/invoices/by-order/{orderId}
GET https://api.coinavio.com/v1/invoices?status=PAID&limit=20&cursor=<lastId>
POST https://api.coinavio.com/v1/invoices/{id}/cancel
Authorization: Bearer <apiKey>

Swipe within the code to read long lines.

Look an invoice up by your own orderId when a buyer returns before the webhook arrives. Only NEW invoices can be cancelled. To check a key pasted into your settings, call GET /v1/account; the public list of coins and minimum amounts is at GET /v1/currencies.

Payment records have status DETECTED, CONFIRMED or ORPHANED. A confirmed payment arriving after EXPIRED, CANCELLED or UNDERPAID is credited to the merchant balance and emits invoice.payment_confirmed, but does not reopen the invoice. Paid tolerance uses the merchant preference or platform default (initially 0 % — exact amount required), snapshotted for each invoice. UNDERPAID can be explicitly accepted as PAID; late receipts alone keep it closed.

Each payment record has a unique id, its actual currency and network, requiredConfirmations, matchesSelectedAsset, fee and networkFeeRecovered. A payment in a different coin is credited to the merchant in that coin but does not settle the invoice. paymentDeadline adds a 60-minute grace period for PENDING and CONFIRMING invoices; the locked amount does not change. GRAM (TON) payments need the exact plain-text memo shown at checkout; a missing, different, encrypted or binary comment is not matched automatically and goes to manual review (encrypted comments are not decrypted). Test payments have no explorer link.

The default payment window is 60 minutes; expiresInMinutes accepts 5-1440. Selecting a coin fixes the crypto amount until expiry without changing the deadline. Statuses: NEW → PENDING → CONFIRMING → PAID | OVERPAID | UNDERPAID | EXPIRED | CANCELLED. Complete orders for PAID or OVERPAID. Review UNDERPAID orders before fulfilment. Accepting an underpayment is dashboard-only (Invoices → Accept as paid): it changes UNDERPAID to PAID and sends invoice.paid, with no additional ledger credit. With an API key, POST /v1/invoices/:id/accept-underpayment returns 403 ACCEPT_UNDERPAYMENT_DASHBOARD_ONLY and does not change the invoice. Test invoices include testMode: true.

Signed webhooks

Save your HTTPS webhook endpoint in Dashboard → Developers and copy its Webhook secret. An invoice created with callbackUrl sends its events there instead; invoices of a site-scoped key use the site's webhook URL when it is set. CoinAvio sends JSON events with these headers:

Webhook headers and payload
POST https://shop.example.com/webhooks/coinavio
X-Webhook-Id: evt_example
X-Webhook-Event: invoice.paid
X-Webhook-Timestamp: 1791806400000
X-Webhook-Signature: t=1791806400000,v1=<64-character hex HMAC>
X-CoinAvio-Mode: live
X-CoinAvio-Mode-Signature: t=1791806400000,v1=<mode-bound hex HMAC>
Content-Type: application/json

{
  "id": "evt_example",
  "type": "invoice.paid",
  "createdAt": "2026-10-12T12:00:00.000Z",
  "data": {
    "invoice": {
      "id": "inv_example",
      "orderId": "order-1001",
      "status": "PAID",
      "testMode": false,
      "price": { "amount": "49.99", "currency": "USD" }
    }
  }
}

Swipe within the code to read long lines.

Invoices and webhook snapshots include underpaidAccepted, underpaidAcceptedAt and underpaidAcceptedBy, plus pay.amount (expected), pay.received, pay.shortfall, pay.shortfallPercent and pay.tolerancePercent. The merchant chooses tolerance in Settings, initially 0 % — exact amount required with an administrator maximum of 10 %. Percentages up to two decimals, including 0.01 %, 0.1 %, 0.25 % and 0.99 %, are applied with decimal arithmetic. The paid threshold is rounded down to the asset's smallest unit. Checkout top-ups use that same threshold; shortfall still shows the full expected minus received amount. It is snapshotted for each new invoice and applies to the total including any buyer network fee. Shortfalls within tolerance are PAID with underpaidAccepted true; merchant credit uses only received principal less the platform fee and network recovery. Underpaid webhooks hold orders for review with the missing amount; WooCommerce records accepted shortfalls. This is an abbreviated invoice payload. The event envelope is { id, type, createdAt, data: { invoice } } for invoice events. Withdrawal events use data.withdrawal and the account-level webhook; handle those separately from order fulfilment. The payload is a snapshot of the event decision, so it may differ from a later invoice read.

The signature is v1 = HMAC_SHA256(secret, "<t>.<rawBody>"), encoded as hex. The signed timestamp t is in milliseconds. Reject timestamps more than five minutes in either direction from your server clock and compare signatures in constant time. Verify the exact raw bytes before parsing JSON.

The additive X-CoinAvio-Mode header is test or live. Verify X-CoinAvio-Mode-Signature using HMAC-SHA256 of <t>.<mode>.<rawBody> with the same secret and timestamp as the original signature. Both signatures must pass and timestamps must match. These production invoice examples reject any mode other than live and require data.invoice.testMode === false; they reject testMode:true and missing mode. Handle withdrawal events separately; they do not fulfil orders. The merchant secret and legacy signature stay unchanged.

Node.js · Verify webhook signature
import { createHmac, timingSafeEqual } from 'node:crypto';

// Production invoice handler. Route withdrawal events separately.
export function verifyWebhook(secret, signature, rawBody, mode, modeSignature) {
  if (!secret || mode !== 'live') return false;
  const pattern = /^t=([0-9]+),v1=([a-fA-F0-9]{64})$/;
  const legacy = typeof signature === 'string' && pattern.exec(signature);
  const signedMode = typeof modeSignature === 'string' && pattern.exec(modeSignature);
  if (!legacy || !signedMode || legacy[1] !== signedMode[1]) return false;
  const timestampMs = Number(legacy[1]);
  if (!Number.isSafeInteger(timestampMs) ||
      Math.abs(Date.now() - timestampMs) > 300_000) return false;
  const valid = (prefix, hex) => {
    const expected = createHmac('sha256', secret).update(prefix).update(rawBody).digest();
    return timingSafeEqual(expected, Buffer.from(hex, 'hex'));
  };
  if (!valid(legacy[1] + '.', legacy[2]) ||
      !valid(legacy[1] + '.' + mode + '.', signedMode[2])) return false;
  try {
    const event = JSON.parse(rawBody.toString('utf8'));
    return typeof event.type === 'string' && event.type.startsWith('invoice.') &&
      event.data?.invoice?.testMode === false;
  } catch { return false; }
}

// Read the exact raw bytes BEFORE JSON middleware:
// const rawBody = Buffer.concat(await Array.fromAsync(req));
// if (!verifyWebhook(process.env.COINAVIO_WEBHOOK_SECRET,
//     req.headers['x-webhook-signature'], rawBody,
//     req.headers['x-coinavio-mode'], req.headers['x-coinavio-mode-signature'])) {
//   res.writeHead(400); res.end(); return;
// }
// const event = JSON.parse(rawBody.toString('utf8'));
// Match invoice/order, currency and amount; only PAID/OVERPAID may fulfil.
// Persist event.id and the order update in one transaction before returning 200.

Swipe within the code to read long lines.

PHP · Verify webhook signature
<?php
// Production invoice handler. Route withdrawal events separately.
function verify_coinavio_webhook($secret, $signature, $rawBody, $mode, $modeSignature) {
    if (!$secret || $mode !== 'live') return false;
    $pattern = '/^t=([0-9]+),v1=([a-fA-F0-9]{64})$/D';
    if (!is_string($signature) || !is_string($modeSignature) ||
        !preg_match($pattern, $signature, $a) ||
        !preg_match($pattern, $modeSignature, $b) || $a[1] !== $b[1]) return false;
    if (abs(microtime(true) * 1000 - (float) $a[1]) > 300000) return false;
    $legacy = hash_hmac('sha256', $a[1] . '.' . $rawBody, $secret);
    $bound = hash_hmac('sha256', $a[1] . '.' . $mode . '.' . $rawBody, $secret);
    if (!hash_equals($legacy, strtolower($a[2])) ||
        !hash_equals($bound, strtolower($b[2]))) return false;
    $event = json_decode($rawBody, true);
    return is_array($event) && is_string($event['type'] ?? null) &&
        strpos($event['type'], 'invoice.') === 0 &&
        ($event['data']['invoice']['testMode'] ?? null) === false;
}

// In your HTTP handler, before processing an order:
$rawBody = file_get_contents('php://input');
if ($rawBody === false || !verify_coinavio_webhook(
    getenv('COINAVIO_WEBHOOK_SECRET'), $_SERVER['HTTP_X_WEBHOOK_SIGNATURE'] ?? '',
    $rawBody, $_SERVER['HTTP_X_COINAVIO_MODE'] ?? '',
    $_SERVER['HTTP_X_COINAVIO_MODE_SIGNATURE'] ?? ''
)) { http_response_code(400); exit; }
$event = json_decode($rawBody, true, 512, JSON_THROW_ON_ERROR);
// Match invoice/order, currency and amount; only PAID/OVERPAID may fulfil.
// Persist event ID and order update in one transaction before returning 200.
http_response_code(200);

Swipe within the code to read long lines.

Failed deliveries are retried: eight attempts in total, with waits of 30, 60, 120, 240, 480, 960 and 1920 seconds (63.5 minutes of waits, plus request and queue time). After the last attempt the event is marked exhausted; redeliver it from Dashboard → Developers. Return a 2xx response only after durable processing.

Mark the order paid once

  1. Verify the signature, then parse and validate the event. Reject a mismatched X-Webhook-Id or timestamp header if present.
  2. In one database transaction, check whether the signed payload's id has already been processed. Use a unique constraint on the event ID and return 200 for a completed duplicate.
  3. Match data.invoice.id and orderId to your stored invoice/order. Check the USD price against your order. Reject testMode:true in production even when its signature is valid. Keep test invoices within a separate test workflow.
  4. For invoice.paid or invoice.overpaid, mark the order paid once. Hold underpaid orders for review. A payment_confirmed event alone does not prove the full invoice is paid.
  5. Persist the event ID and order update before returning 200. Return an error for temporary processing failures so delivery can be retried. Do not let an older pending or underpaid event undo a completed payment.
Supported webhook event types
EventMeaning
invoice.pendingPayment detected; wait before fulfilling.
invoice.confirmingBlockchain confirmations are in progress.
invoice.paidInvoice paid; complete the matching order once.
invoice.overpaidInvoice paid with an excess; complete the matching order once.
invoice.underpaidHold the order for review; the amount is insufficient.
invoice.expiredInvoice expired; check the order before requesting another payment.
invoice.payment_confirmedAn individual payment confirmed; inspect the invoice's overall status.
invoice.payment_detectedAn additional, different-method or late receipt was detected. Inspect its coin, network and invoice status.
invoice.payment_orphanedA detected receipt failed after finality. Informational; inspect the overall invoice status.
invoice.cancelledInvoice cancelled while NEW; do not fulfil.
invoice.review_requestedA store cancellation was refused because a receipt exists. Informational.
invoice.discovery_delayedNetwork confirmation needs review. Informational; do not fulfil or request another payment.
withdrawal.completedWithdrawal completed.
withdrawal.failedWithdrawal failed.
withdrawal.rejectedWithdrawal rejected.

invoice.payment_detected, invoice.payment_confirmed, invoice.payment_orphaned, invoice.review_requested and invoice.discovery_delayed are informational and never authorize crediting an order. Do not fulfil from reviewReason. A payment under compliance review (reviewReason AML_SCREENING or AML_REVIEW) keeps the invoice PENDING or CONFIRMING; invoice.paid arrives after release.

Buyers who paid the wrong coin or after the invoice closed should contact the merchant; CoinAvio does not refund automatically. See Refunds and Payment problems.

Errors

Handle 400 validation errors, 401 authentication failures, 403 permission failures, 404 missing or inaccessible resources, 409 ORDER_ID_IN_USE and 429 rate limits (see Limits). Domain errors include an error code and message, such as { error: "ORDER_ID_IN_USE", message: "…" }. Do not blindly retry mutations; use the same orderId and mode for invoice retries.

Invoice writes may wait briefly before starting and can return 503 INVOICE_WRITE_BUSY with Retry-After: 1. This request did not run: wait at least that delay, add jitter and keep the same submission reference. Recover any earlier timed-out request before retrying; a generic 503 or timeout is still ambiguous. API-key reads and writes can also return INVOICE_AUTH_BUSY before the handler runs. Follow Retry-After and retain the same reference; a busy recovery lookup is not a missing invoice.

Download the full reference from Partner API Markdown or OpenAPI YAML.

Limits

API and webhook limits
ItemLimit
Minimum invoice0.50 USD (the amount the buyer is charged, after any buyer-paid fee)
priceAmountJSON string, digits with up to 2 decimals ("49.99", "25"), at most 21 characters, below 10^18
orderIdString, up to 128 characters, no character restrictions. Idempotent per merchant and mode. URL-encode it in by-order lookups.
descriptionUp to 500 characters
successUrl, cancelUrl, callbackUrlUp to 2048 characters each
Payment window60 minutes by default; expiresInMinutes accepts 5–1440. The crypto amount is fixed from coin selection until expiry.
Grace period60 minutes after expiresAt for PENDING/CONFIRMING invoices (paymentDeadline), for confirmations and top-ups
Rate limits300 requests per minute per IP for the whole API; POST /v1/invoices 60 per minute per IP. Excess returns 429.
Request body64 KiB
List page sizelimit 1–100, default 20
Webhook response2xx within 10 seconds; only the first 4 KB of your response is read
Webhook retries8 attempts: the first delivery, then waits of 30 s, 1, 2, 4, 8, 16 and 32 min (63.5 min of waits in total)
Signature timestampReject when t differs from your clock by more than 5 minutes

Site verification

Early access: a website you add in Dashboard → Projects is verified right away, so you can use it for return URLs and site keys at once. The methods below apply only when verification is required (for example, when another merchant already added the same domain).

In Dashboard → Projects, add your store's full URL. CoinAvio extracts its domain and gives you a token. Use any one of these methods; the page includes copy buttons for all three.

1. DNS TXT record

Add a TXT record on the domain. Use @ for the root host if your DNS provider asks. Allow time for DNS propagation.

DNS TXT value
coinavio-verify=<token>

Swipe within the code to read long lines.

2. Homepage meta tag

Publish this tag inside your public homepage's <head>.

HTML meta verification
<meta name="coinavio-verification" content="<token>">

Swipe within the code to read long lines.

3. Verification file

Make a public plain text file containing only the token at this HTTPS URL:

Verification file
https://<domain>/.well-known/coinavio-verify.txt

<token>

Swipe within the code to read long lines.

Choose Verify now to see the DNS, meta and file results. One successful check verifies the site and covers its www host and subdomains. Live return URLs on verified domains are used as given (others are replaced); verified sites also speed up merchant approval.

Telegram bots

No website? A Telegram bot can accept payments too. In Dashboard → Projects, choose Telegram bot and enter its username (for example @YourShopBot). During early access the bot is verified as soon as you add it. When verification is required, prove the bot is yours: open @BotFather → your bot → Edit Bot → Edit About and add the code shown on the page, then choose Verify now. CoinAvio reads it from the bot's public page https://t.me/<username>; Telegram can take a minute to show the new text. You can change the About text back afterwards.

Bot About text
coinavio-verify=<token>

Swipe within the code to read long lines.

Your bot's server creates invoices with the API, sends the buyer the checkoutUrl (as a message or an inline button) and fulfils the order on the signed invoice.paid webhook. To bring the buyer back to the bot after paying, use the bot link as successUrl, with Telegram's start parameter to identify the order:

Return to the bot
successUrl: https://t.me/yourshopbot?start=paid_1001

Swipe within the code to read long lines.

Only the verified bot's own https://t.me/<username> link counts. API keys can be bound to the bot like a site; for such a key GET /v1/account shows site.domain as t.me/<username>.

Payment inside the chat

The bot can also show the payment in the chat itself. List the coins with GET /v1/invoices/:id/options, ask for the network when a coin has several (USDT: put BEP20 first), then POST /v1/invoices/:id/select returns the invoice with pay.amount, pay.address and, for GRAM (TON), the required pay.memo. Make them copyable (tap-to-copy <code> text and copy buttons) so the buyer never has to open a link. No confirm button is needed: credit the buyer on the invoice.paid webhook. A Payment status button may read GET /v1/invoices/:id; it never credits anything.

Coins, then the chosen network
GET  https://api.coinavio.com/v1/invoices/<id>/options
POST https://api.coinavio.com/v1/invoices/<id>/select
{ "currency": "USDT", "network": "BSC" }

Swipe within the code to read long lines.

Show the texts in the buyer's language (English by default) and add ?lang= with en, ru, uk, uz or kk to checkoutUrl so the payment page matches. The Partner API Markdown has a complete bot example with ready-made texts in all five languages.

Mobile apps (Android and iOS)

An app uses the same API. Your server creates the invoice with its API key and returns only checkoutUrl to the app; the app opens it in the system browser tab; the buyer comes back through a Universal Link (iOS) or App Link (Android) on your verified domain; your server fulfils the order on the signed webhook.

Your server: create the invoice for the app
POST https://api.coinavio.com/v1/invoices
Authorization: Bearer <apiKey>          # server only, never inside the app

{ "priceAmount": "9.90", "orderId": "1042",
  "successUrl": "https://shop.example.com/app/paid?order=1042",
  "cancelUrl":  "https://shop.example.com/app/cart" }

→ return { checkoutUrl } to the app

Swipe within the code to read long lines.

Android: Custom Tabs and an App Link

Android (Kotlin)
// implementation("androidx.browser:browser:1.8.0")
val checkoutUrl = backend.createPayment(orderId = "1042") // from your server
CustomTabsIntent.Builder().build().launchUrl(context, Uri.parse(checkoutUrl))

<!-- AndroidManifest.xml: open https://shop.example.com/app/paid… in the app -->
<intent-filter android:autoVerify="true">
  <action android:name="android.intent.action.VIEW" />
  <category android:name="android.intent.category.DEFAULT" />
  <category android:name="android.intent.category.BROWSABLE" />
  <data android:scheme="https" android:host="shop.example.com" android:pathPrefix="/app/" />
</intent-filter>
<!-- plus https://shop.example.com/.well-known/assetlinks.json for your app's signing key -->

Swipe within the code to read long lines.

iOS: SFSafariViewController and a Universal Link

iOS (Swift)
import SafariServices

let checkoutUrl = try await backend.createPayment(orderId: "1042") // from your server
present(SFSafariViewController(url: checkoutUrl), animated: true)

// Associated Domains: applinks:shop.example.com
// + https://shop.example.com/.well-known/apple-app-site-association covering /app/*
// The link arrives in .onOpenURL / scene(_:continue:): close the browser view and
// ask YOUR server for the order status (the link itself proves nothing).

Swipe within the code to read long lines.

Never put an API key in the app: apps are easy to unpack. Custom schemes such as myapp:// are not accepted as return URLs (any app could claim them); use an https link on your verified domain. Do not load the checkout in a WebView; it refuses to be framed. Treat only the signed invoice.paid webhook as proof of payment.

After paying, the checkout shows a Return to … button and live invoices redirect to successUrl after about 4 seconds. iOS opens Universal Links reliably on the buyer's tap, so make the https page also work in a browser, with an Open the app button and the order status.

App store rules: Apple and Google generally require their own in-app purchase for digital goods or content used inside the app (coins, subscriptions, unlocks); crypto payment for those can get an app rejected. Physical goods and services used outside the app usually may use other payment methods. Check the current App Store Review Guidelines (3.1) and Google Play's Payments policy for your app; this is the app owner's decision.

Test mode

After your merchant account is approved, create a Test key in Developers. Invoices created with it have testMode: true. Open hosted checkout, choose a coin and network, then press Simulate payment (test mode).

Simulation runs through the normal payment pipeline, usually within about two minutes, and pays the remaining amount. Signed webhooks still fire, so you can test order matching, signature validation, duplicate handling and return redirects. No crypto moves; do not send real funds to test invoices.

Test checkout simulation
POST https://api.coinavio.com/v1/checkout/{invoiceId}/simulate

# or from your server, with the test key:
POST https://api.coinavio.com/v1/invoices/{invoiceId}/simulate
Authorization: Bearer <testApiKey>

{ "ok": true }

Swipe within the code to read long lines.

After a partial payment, only the remaining amount is simulated. USDT has a USD rate of exactly 1; TRON payment URIs are plain addresses. At a zero processing fee, the response reports buyerPaysFee as false.

Simulation requires a test invoice and a selected coin; server requests also require a Test key. Test addresses cannot receive real payments, and test balances are isolated and never withdrawable. Live keys accept the assets GET /v1/currencies reports as live; the webhook verification scheme is the same.

WooCommerce

The CoinAvio plugin creates an invoice from your USD order total, redirects the buyer to hosted checkout, and updates the order from verified webhooks. Requires PHP 7.4+ and WooCommerce 6+. Use WooCommerce's classic shortcode checkout; the Checkout block is not supported by this plugin.

Download WooCommerce plugin
  1. Download the zip. In WordPress, go to Plugins → Add New → Upload Plugin, upload it, install and activate.
  2. Verify the shop domain in CoinAvio Projects and use USD as the WooCommerce store currency.
  3. Open WooCommerce → Settings → Payments → CoinAvio. Enable the gateway, leave the API base URL as https://api.coinavio.com unless your deployment uses another HTTPS API, and enter your API key and webhook secret.
  4. In CoinAvio Developers, set your webhook endpoint to https://<shop>/?wc-api=coinavio. Copy the Webhook secret from CoinAvio into the plugin settings.
  5. Start with a Test key. Place a test order and simulate payment after selecting a coin. Confirm the order becomes paid before switching to a Live key.

The plugin completes an eligible order once from a verified paid or overpaid webhook, puts underpaid orders on hold, ignores duplicate events and leaves cancelled, refunded or completed orders unchanged. It also reconciles pending CoinAvio orders automatically every 15 minutes through WP-Cron, which needs site traffic or a real cron job.

Order-status emails and other WooCommerce automations can still run for simulated orders. Use a test store or test orders you can identify. Keep the public webhook accessible and update the plugin secret whenever you rotate it.

Any site · payment links and Buy buttons

Open Dashboard → Payment links, set a fixed USD amount and description, and optionally add verified success/cancel URLs. Copy the link into an email or paste its HTML into your site:

HTML · Buy with crypto button
<a href="https://coinavio.com/l/<linkId>">Buy with crypto</a>

Swipe within the code to read long lines.

Each visit to an active link creates an invoice and sends the buyer to hosted checkout. Deactivate the link to stop new checkouts. The dashboard lists uses and provides the exact HTML for each link. No API key belongs in the button.

For dynamic cart totals or automatic order fulfilment, create invoices on your server and use signed webhooks. A fixed link has no built-in order or customer association; reconcile the payment in your own workflow.

Create a payment link

Supported assets

CurrencyNetworkLive status
ETHEthereumGET /v1/currencies → live: true/false
USDTEthereum (ERC20)GET /v1/currencies → live: true/false
BNBBNB Smart ChainGET /v1/currencies → live: true/false
USDTBNB Smart Chain (BEP20)GET /v1/currencies → live: true/false
TRXTRONGET /v1/currencies → live: true/false
USDTTRON (TRC20)GET /v1/currencies → live: true/false
GRAM (TON)GRAM (TON)GET /v1/currencies → live: true/false
USDTGRAM (TON) (jetton)GET /v1/currencies → live: true/false
Public asset list
GET https://api.coinavio.com/v1/assets

Swipe within the code to read long lines.

ETH, BNB, TRX, GRAM (TON) and USDT on each network are supported. GET /v1/currencies reports current live availability. For each invoice, read GET /v1/invoices/:id/options and offer only available options: ETH, BSC and TRON may require a minimum invoice USD value before network fees. Below-minimum options expose minInvoiceUsd and unavailableReason: BELOW_NETWORK_MINIMUM. ETH, BSC and TRON add a buyer network fee using the higher of the configured floor and current estimate; GRAM (TON) retains its existing fee policy. pay.networkFee contains amount, currency and usd; pay.amount is the total to send. The surcharge is excluded from merchant credit and is separate from the buyer wallet’s sending fee. Test invoices use simulated funds and no buyer network surcharge.