API Reference
Create Payment Link
Create a hosted crypto checkout link for your customers. Supports multiple networks and tokens, success/cancel redirects, and webhooks.
Endpoint
v1
POST
/api/create-payment-link
Auth:
Authorization: Bearer <api_key>
or X-API-Key: <api_key>
Quickstart
- 1. Get your API key from the dashboard (supports live and test).
- 2. Make a request to
POST /api/create-payment-link
with your payload. - 3. Redirect your customer to the returned payment_link URL.
Provide a global payout configuration or include payout_address for each allowed token.
curl -X POST https://fync.xyz/api/create-payment-link \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"amount": "20.00",
"currency": "USD",
"order_id": "ORD-983245",
"description": "Payment for Order #983245",
"allowed_payment_tokens": [
{"name":"BitCoin","symbol":"btc","network":"bitcoin","payout_address":"CPj7TP5..."},
{"name":"ethereum","symbol":"ETH","network":"ethereum","payout_address":"CPj7TP5..."},
{"name":"Solana","symbol":"SOL","network":"solana","payout_address":"CPj7TP5..."},
{"name":"Matic","symbol":"POL","network":"polygon","payout_address":"CPj7TP5..."},
{"name":"trx","symbol":"trx","network":"tron","payout_address":"CPj7TP5..."},
{"name":"USDC","symbol":"usdc","network":"solana","payout_address":"So1..."},
{"name":"USDT","symbol":"usdt","network":"ethereum","payout_address":"0x..."}
],
"callback_url": "https://merchant.com/api/payment/callback",
"success_url": "https://merchant.com/payment/success",
"cancel_url": "https://merchant.com/payment/cancel",
"expire_minutes": 60,
"customer": {"name":"John Doe","email":"john@example.com"},
"metadata": {"important":"P12345"}
}'
import requests
url = "https://fync.xyz/api/create-payment-link"
headers = {"Content-Type": "application/json", "X-API-Key": "YOUR_API_KEY"}
payload = {
"amount": "20.00",
"currency": "USD",
"order_id": "ORD-983245",
"description": "Payment for Order #983245",
"allowed_payment_tokens": [
{"name":"BitCoin","symbol":"btc","network":"bitcoin","payout_address":"CPj7TP5..."},
{"name":"ethereum","symbol":"ETH","network":"ethereum","payout_address":"CPj7TP5..."}
],
"callback_url": "https://merchant.com/api/payment/callback",
"success_url": "https://merchant.com/payment/success",
"cancel_url": "https://merchant.com/payment/cancel",
"expire_minutes": 60,
"customer": {"name":"John Doe","email":"john@example.com"},
"metadata": {"important":"P12345"}
}
resp = requests.post(url, json=payload, headers=headers, timeout=30)
print(resp.status_code, resp.json())
const res = await fetch("https://fync.xyz/api/create-payment-link", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
},
body: JSON.stringify({
amount: "20.00",
currency: "USD",
order_id: "ORD-983245",
description: "Payment for Order #983245",
allowed_payment_tokens: [
{ name: "BitCoin", symbol: "btc", network: "bitcoin", payout_address: "CPj7TP5..." },
{ name: "ethereum", symbol: "ETH", network: "ethereum", payout_address: "CPj7TP5..." }
],
callback_url: "https://merchant.com/api/payment/callback",
success_url: "https://merchant.com/payment/success",
cancel_url: "https://merchant.com/payment/cancel",
expire_minutes: 60,
customer: { name: "John Doe", email: "john@example.com" },
metadata: { important: "P12345" }
})
});
const data = await res.json();
console.log(data);
Request
Method: POST
Path: /api/create-payment-link
Auth: Authorization: Bearer <key>
or X-API-Key: <key>
(request body fallback api_key
supported)
Body (JSON)
amount
(string, required)currency
(string, required; ISO, e.g., USD)order_id
(string, optional)description
(string, optional)allowed_payment_tokens
(array[object], optional but payout address is required via this array or merchant defaults)name
(string)symbol
(string; e.g., btc, eth, usdc)network
(string; e.g., bitcoin, ethereum, solana, polygon, tron)payout_address
(string; required if merchant global payout not set)
callback_url
(string, optional)success_url
(string, optional)cancel_url
(string, optional)expire_minutes
(integer, optional; minutes until expiry)customer
(object, optional)metadata
(object, optional)
Response
201 Created on success
{
"success": true,
"payment_link": "https://your-domain.com/pay/txn_...",
"transaction_id": "txn_..."
}
Note: The URL will be a publicly accessible link served by GET /pay/<transaction_id>
.
Errors
400 Bad Request
{"success": false, "error": "Missing required fields: amount, currency"}
401 Unauthorized
{"success": false, "error": "Missing API key"}
403 Forbidden
{"success": false, "error": "Invalid API key"}
500 Internal Server Error
{"success": false, "error": "<details>"}
Webhook (optional)
If you pass callback_url
, Fync will POST settlement events to your endpoint. Example:
{
"type": "payment_settled",
"transaction_id": "txn_...",
"stage": "settled",
"status": "success",
"amount": 12.345678,
"asset": {"token": "usdc", "network": "solana"}
}
Secure your webhook endpoint with your own auth or allow-listing. Signature delivery may be added in future versions.