Skip to main content

Create a Pay Link

Pay links are created with a single API call. The response returns the pay link ID and the shareable URL. Store both against your order record.


Endpoint

POST https://app.coinsnap.io/api/v1/stores/{storeId}/payment-requests

Authentication: x-api-key header with your API key.


Parameters

FieldTypeRequiredDescription
amountnumberYesFiat amount to charge. Must be greater than 0.
currencystringNo3-letter currency code (EUR, USD, etc.). If omitted, the backend accepts the request and applies its default handling.
titlestringYesCustomer-facing label — customer name, company, or order label
orderIdstringNoYour internal order or invoice number — echoed back in every webhook event
descriptionstringNoShort description shown to the customer on the payment page
redirectUrlstringNoWhere to send the customer after successful payment
customerEmailstringNoPre-filled customer email
discountnumberNoBitcoin discount as a percentage (e.g. 5 = 5% off)
internalNotestringNoMerchant-only note, not visible to the customer
expiryDatestringNoISO 8601 datetime. Defaults to 30 days from creation.

Response

{
"id": "3JUseUusmduemKeJkv3H",
"url": "https://pay-link.coinsnap.io/payment-requests/3JUseUusmduemKeJkv3H"
}
FieldWhat to do with it
idStore in your database — use to check status or update the pay link via API
urlShare with your customer — works in emails, PDFs, buttons, and QR codes

Code examples

curl -X POST \
'https://app.coinsnap.io/api/v1/stores/YOUR_STORE_ID/payment-requests' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"amount": 149.00,
"currency": "EUR",
"title": "John Smith",
"orderId": "ORD-2026-1045",
"description": "Order ORD-2026-1045",
"redirectUrl": "https://yourshop.com/payment-success",
"customerEmail": "john@example.com",
"discount": 5
}'

Minimal request

The backend currently requires amount and title. currency is optional.

{
"amount": 149.00,
"title": "John Smith"
}

Bitcoin discount

To offer a percentage discount to customers who pay with Bitcoin, include the discount field:

{
"amount": 149.00,
"currency": "EUR",
"orderId": "ORD-2026-1045",
"discount": 5
}

The customer sees the discounted Bitcoin amount on the payment page. The original fiat amount is unchanged in your system.


Best practices

  • Always pass orderId — it's your reconciliation key and appears in every webhook event
  • Store the returned id — you'll need it to check status or update the pay link via API
  • Use a meaningful description — the customer sees it on the payment page
  • Set expiryDate for time-limited invoices (e.g. quotes that expire)
  • Set redirectUrl to send the customer back to your site after payment

API reference

See API Reference → Create Pay Link for the full endpoint specification.