Skip to content

Accept payments

Payment links & Payment Buttons

Real output captured from a running server in test mode (2026-10-02).

A payment link is a shareable page (https://razcryptogateway.com/l/{slug}) — send it on WhatsApp, email or as a QR; no code needed. A Payment Button is the same thing embedded on a website that has no server (static sites): the price lives in your dashboard, so nobody can change it in the browser. Every submission creates a normal payment; all payment webhooks apply.

Create — POST /v1/payment_links

ParamTypeNotes
kindlink (default) · buttonButtons default to reusable and enforce your app's allowed origins
titlestring ≤ 120Shown on the page
description, customer_namestringOptional
amount_typefixed · customcustom = customer types the amount
amountdecimal stringRequired for fixed
currencyfiat code or coin symbole.g. USD, INR, EUR, USDT
min_amount, max_amountdecimal stringsLimits for custom
collect{ name, email, phone }each off · optional · required
usageone_time · reusableOne-time links become completed after the first paid payment
allowed_chains, allowed_coinsstring[]Optional restrictions
redirect_urlURLWhere the customer goes after paying
expires_atISO timeOptional
metadataobjectCopied to every payment
Shell
curl https://razcryptogateway.com/v1/payment_links \
  -H "Authorization: Bearer sk_test_…" -H "Content-Type: application/json" \
  -d '{"title":"Logo design — 50% advance","customer_name":"Ravi Traders","amount_type":"fixed","amount":"120.00","currency":"USD","collect":{"name":"required","email":"optional"},"usage":"one_time"}'
JSON
{
  "id": "lnk_heWqzHlk5QC2SWzGMBk9",
  "object": "payment_link",
  "livemode": false,
  "kind": "link",
  "url": "https://razcryptogateway.com/l/3qH4EiHq",
  "slug": "3qH4EiHq",
  "title": "Logo design — 50% advance",
  "description": null,
  "customer_name": "Ravi Traders",
  "amount_type": "fixed",
  "amount": "120",
  "currency": "USD",
  "min_amount": null,
  "max_amount": null,
  "collect": {
    "name": "required",
    "email": "optional",
    "phone": "off"
  },
  "usage": "one_time",
  "status": "active",
  "allowed_chains": null,
  "allowed_coins": null,
  "redirect_url": null,
  "expires_at": null,
  "metadata": {},
  "stats": {
    "views": 0,
    "payments": 0,
    "paid_count": 0,
    "paid_amount": "0"
  },
  "created_at": "2026-10-02T12:51:14.858Z"
}

Other endpoints

MethodPathNotes
GET/v1/payment_links/{id}Includes stats (views, payments, paid_count, paid_amount)
GET/v1/payment_linksFilters status, kind; newest first, limit (default 20, max 100). Next page: starting_after={next_cursor} while has_more is true
PATCH/v1/payment_links/{id}title, description, expires_at, redirect_url, metadata, status (active/inactive)
POST/v1/payment_links/{id}/deactivateShortcut for status: "inactive"
GET/v1/payments?payment_link={id}Payments made through the link (payment.payment_link = link id)

Statuses: active, inactive, completed (one-time link paid), expired. Event: payment_link.completed when a one-time link is paid.

GET https://razcryptogateway.com/checkout/v1/links/{slug} → what the page shows (counts a view):

JSON
{
  "object": "payment_link_public",
  "title": "Logo design — 50% advance",
  "description": null,
  "customer_name": "Ravi Traders",
  "amount_type": "fixed",
  "amount": "120",
  "currency": "USD",
  "min_amount": null,
  "max_amount": null,
  "collect": {
    "name": "required",
    "email": "optional",
    "phone": "off"
  },
  "test_mode": true,
  "merchant": {
    "name": "Docs Demo Store",
    "accent_color": null,
    "logo_url": null
  }
}

POST https://razcryptogateway.com/checkout/v1/links/{slug}/payments with { "amount"?, "name"?, "email"?, "phone"? } (per the link's collect rules) → creates the payment and returns where to send the customer:

JSON
{
  "payment_id": "pay_hO8lGPIIJhYlNZ5jVPJS",
  "checkout_url": "https://razcryptogateway.com/pay_hO8lGPIIJhYlNZ5jVPJS?t=ct_…"
}

Missing a required field:

JSON
{
  "error": {
    "type": "invalid_request_error",
    "code": "parameter_missing",
    "message": "name is required",
    "param": "name",
    "request_id": "req_tAIwIJxz37T7PZWf",
    "doc_url": "https://razcryptogateway.com/docs/errors#parameter_missing"
  }
}

Payment Button for a static website (no server needed)

  1. Dashboard → Payment links & buttons → Buttons → New payment button (fixed price, or the customer enters the amount).
  2. Click Embed code and paste it where the button should appear:
HTML
<script src="https://razcryptogateway.com/v1/checkout.js" async></script>
<button type="button" data-razcrypto-button="O7MTkxHr">Pay with crypto</button>

checkout.js wires every data-razcrypto-button automatically. To open it from your own code:

JavaScript
RazCrypto.openButton({ button: "O7MTkxHr", onSuccess: (res) => console.log(res), onClose: () => {} });

The customer pays in a popup on your page. The price lives in your dashboard, so it cannot be changed in the browser. Confirm orders from webhooks or the dashboard — the browser result alone should not unlock paid content.