Crypto Payment Link API
This document provides a comprehensive guide to generate secure crypto payment links using Pay Agency's API. The API allows you to create encrypted payment links for crypto transactions, supporting onramp, offramp, and payin flows.
API Endpoint
Overview
The Crypto Payment Link API allows you to generate secure, encrypted payment links for various crypto transaction types:
- ONRAMP: Fiat to Crypto
- OFFRAMP: Crypto to Fiat
- PAYIN: Crypto Payment Collection
The API validates your secret key, checks the payment template, and returns a secure URL for your customer to complete the transaction.
Request Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
payment_template_id | String | Yes | ID of the payment template to use for this link. |
transaction_type | String | Yes | Transaction type: "ONRAMP", "OFFRAMP", or "PAYIN". |
order_id | String | No | Unique order from merchant side. |
terminal_id | String | No | Terminal ID to route the transaction through a specific connector. |
expiry_date | String | No | Expiry date must be in yyyy-mm-dd format. |
crypto_amount | String | Conditional | Amount in cryptocurrency (see rules below). |
fiat_amount | Number | Conditional | Amount in fiat currency (see rules below). |
crypto_currency | String | Conditional | Cryptocurrency code (e.g., BTC, ETH, USDT). |
fiat_currency | String | Conditional | Fiat currency code (e.g., USD, EUR). |
Transaction Type Rules
ONRAMP: crypto_amount
should not be provided.
OFFRAMP: fiat_amount
should not be provided.
PAYIN: crypto_amount
should not be provided.
Headers
Header Name | Description |
---|---|
Content-Type | Set to application/json . |
Authorization | Bearer token (your Secret key or Test key). |
Environment Behavior
- Test key returns a test payment link (with
/test
in the URL). - Secret key returns a live payment link (with
/live
in the URL).