Preview: CrypCash checkout is not open yet, and plans and features can still change before launch.

All guides

Connect CrypCash from your own code

For developers: create invoices with the REST API, send your customer to the payment page or build your own, and update orders from signed webhooks.

Before launch: these guides describe how setup will work. The CrypCash dashboard, the WooCommerce plugin and the payment page are not open yet.

What you need

  • Your secret key, kept on your server (see Before you start)
  • An HTTPS address on your server for notifications
  1. Create an invoice when the order is placed

    Call the API from your server with the order's total, in USDT, or in your store's currency with currency (for example INR or EUR). CrypCash converts it at the market rate and fixes the amount for the invoice's time. Send the order's ID as Idempotency-Key: if the request is retried, you get the same invoice back, not a second one.

    network is TRON or BSC, and the coin is USDT. Optional fields: orderId, description, customerEmail, metadata (up to 20 keys), successUrl, cancelUrl and expiresInMinutes (5 to 60, 15 by default).

    Create an invoice
    curl -X POST https://api.crypcash.io/api/v1/invoices \
      -H "Authorization: Bearer $CRYPCASH_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: order-1042" \
      -d '{"amount":"4199","currency":"INR","network":"TRON","orderId":"1042","successUrl":"https://your-store.com/thanks"}'

    Click or tap the code once to select all of it.

  2. Send your customer to pay

    Redirect to checkoutUrl from the response. The hosted page shows the amount, the address and a QR code, and follows the payment until it's final. For a price in another currency, price keeps your original price and exchangeRate the rate it was converted at.

    Building your own page? Show payAmount, not amount: on a single TRON or BNB Smart Chain address it's up to 0.0999 USDT higher, and that difference is what matches the payment to the invoice.

    The response, shortened
    201 Created
    {
      "id": "inv_…",
      "status": "PENDING",
      "network": "TRON",
      "currency": "USDT",
      "amount": "47.48",
      "payAmount": "47.4837",
      "price": { "amount": "4199", "currency": "INR" },
      "exchangeRate": { "currency": "INR", "asset": "USDT", "price": "88.4512", "source": "coingecko", "at": "2026-11-04T12:00:00.000Z" },
      "depositAddress": "T…",
      "paymentUri": null,
      "checkoutUrl": "https://crypcash.io/i/inv_…",
      "expiresAt": "2026-11-04T12:15:00.000Z"
    }
  3. Add your webhook address

    Add the HTTPS address that receives notifications, then copy the signing secret CrypCash shows. Keep it on the server, next to your secret key.

    CrypCash dashboard

    1. Stores
    2. Your store
    3. Webhooks
    4. Add address
  4. Check every notification's signature

    Each notification carries CrypCash-Signature: t=<seconds>,v1=<hex>: an HMAC-SHA256 with your signing secret over t, a dot and the raw body. Reject a wrong signature, and one older than five minutes.

    Read the body raw, before a JSON parser touches it. JSON that was parsed and written again no longer matches the signature.

    Node.js (Express)
    import express from "express";
    import { createHmac, timingSafeEqual } from "node:crypto";
    
    function verify(secret, rawBody, header = "") {
      const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
      if (!/^\d+$/.test(t ?? "") || Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
      const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest();
      const given = Buffer.from(v1 ?? "", "hex");
      return given.length === expected.length && timingSafeEqual(given, expected);
    }
    
    const app = express();
    app.post("/api/crypcash/webhook", express.raw({ type: "application/json" }), (req, res) => {
      const raw = req.body.toString("utf8");
      if (!verify(process.env.CRYPCASH_WEBHOOK_SECRET, raw, req.get("CrypCash-Signature"))) return res.sendStatus(400);
      const event = JSON.parse(raw);
      if (event.type === "invoice.paid" || event.type === "invoice.overpaid") {
        markOrderPaid(event.data.invoice.orderId, event.id);
      }
      res.sendStatus(200);
    });
    PHP
    <?php
    function crypcash_verify(string $secret, string $rawBody, string $header): bool {
        $parts = [];
        foreach (explode(',', $header) as $pair) {
            [$key, $value] = array_pad(explode('=', $pair, 2), 2, '');
            $parts[$key] = $value;
        }
        $t = $parts['t'] ?? '';
        if (!ctype_digit($t) || abs(time() - (int) $t) > 300) {
            return false;
        }
        $expected = hash_hmac('sha256', $t . '.' . $rawBody, $secret);
        return hash_equals($expected, $parts['v1'] ?? '');
    }
    
    $raw = file_get_contents('php://input');
    if (!crypcash_verify((string) getenv('CRYPCASH_WEBHOOK_SECRET'), $raw, $_SERVER['HTTP_CRYPCASH_SIGNATURE'] ?? '')) {
        http_response_code(400);
        exit;
    }
    $event = json_decode($raw, true);
    if (in_array($event['type'], ['invoice.paid', 'invoice.overpaid'], true)) {
        mark_order_paid($event['data']['invoice']['orderId'], $event['id']);
    }
    http_response_code(200);
  5. Update the order from the event

    The event's name is in type and in the CrypCash-Event header, and the invoice is in data.invoice with your orderId. Answer with any 2xx status within 10 seconds; otherwise CrypCash tries again, waiting longer each time, from a minute up to a day.

    A repeated event keeps its id. Save the IDs you have handled and skip repeats.

    invoice.confirming
    The payment is seen but not final. Show it as confirming; don't ship yet.
    invoice.paid
    Paid in full. Mark the order paid.
    invoice.overpaid
    Paid more than asked. Mark it paid; data.invoice.receivedAmount has what arrived.
    invoice.underpaid
    Time ran out with part of the amount received. Decide with your customer.
    invoice.expired
    Nothing arrived in time. Release the order.
  6. Test it with a real payment

    Create an invoice for 1 USDT and pay it from a second wallet of yours. The money arrives at your own address, so you pay only the network fee. Check that your server accepted the signature and moved the order.

If something doesn't work

401 unauthorized

The key is missing, wrong or revoked. Send the secret key, starting with cc_sk_, as Authorization: Bearer.

402 volume_cap_exceeded

This invoice would go over your plan's monthly volume. The error says how much is left; upgrade, or wait for next month.

403 publishable_key_not_allowed

Invoices with an amount need the secret key, from your server. The publishable key can't set an amount, because a customer can change anything in their browser.

422 wallet_not_configured

The store has no active wallet for that network. Add one in the dashboard.

422 asset_not_supported

The coin isn't accepted on that network. Send USDT on TRON or BNB Smart Chain.

422 asset_not_accepted

The store turned that coin off for its wallet on this network. Turn it on in the dashboard, or send the other coin.

422 currency_not_supported

CrypCash has no market rate for that currency. Send the amount in the invoice's coin, or in a currency it converts.

503 rate_unavailable

The rate for that currency is out of date, so CrypCash will not convert with it. Try again after the time in Retry-After.

429 rate_limited

Too many requests at once. Wait the number of seconds in the Retry-After header.

The signature never matches.

You are most likely checking JSON that was already parsed. Use the raw body, the signing secret (not the API key), and t, a dot, then the body.

Next guideOther platformsThe API, a payment link or a manual payment method

Shopify, WooCommerce, WordPress, Framer, Webflow, v0, Lovable, Bolt and Trustpilot are trademarks of their owners. CrypCash is not affiliated with them.