DOCUMENTATION
Payment Links
Create and manage payment sessions.
Create a Payment Link
This is the primary endpoint for integrating the Payment Gateway. It creates a new payment session URL that you can redirect your users to.
POST
/api/v1/payment-linksRequest Body
Field
Type
Required
Description
amount
number
Yes
Amount to charge (positive).
success_url
string
Yes
URL to redirect after payment.
currency
string
No
Default: "USD".
title
string
No
Product name shown to payer.
receive_token
string
No
Token to receive (e.g. "USDC").
receive_chain
string
No
Chain name or ID (e.g. "base", "8453").
cancel_url
string
No
URL if user cancels payment.
metadata
object
No
Custom key-value pairs for your use.
max_uses
integer
No
Max number of payments allowed.
expires_at
ISO 8601
No
Expiration datetime for the link.
Request Example
curl -X POST https://flash-protocol.vercel.app/api/v1/payment-links \
-H "Authorization: Bearer pg_live_..." \
-H "Content-Type: application/json" \
-d '{
"amount": 49.99,
"currency": "USD",
"title": "Premium Subscription",
"success_url": "https://myapp.com/success",
"metadata": { "order_id": "ORD-123" }
}'201 Created
{
"id": "pl_abc123456",
"url": "https://flash-protocol.vercel.app/pay/pl_abc123456",
"amount": 49.99,
"currency": "USD",
"status": "active",
"created_at": "2024-03-20T14:00:00Z",
"metadata": { "order_id": "ORD-123" }
}List Payment Links
Retrieve a paginated list of all your payment links.
GET
/api/v1/payment-linksQuery Parameters
limit— Max items to return (default: 10, max: 100).offset— Pagination offset (default: 0).
curl -X GET "https://flash-protocol.vercel.app/api/v1/payment-links?limit=10" \
-H "Authorization: Bearer pg_live_..."Get Payment Link Details
Retrieve full details for a specific payment link, including its 5 most recent transactions.
GET
/api/v1/payment-links/:idcurl -X GET https://flash-protocol.vercel.app/api/v1/payment-links/pl_abc123 \
-H "Authorization: Bearer pg_live_..."200 OK
{
"id": "pl_abc123456",
"url": "https://flash-protocol.vercel.app/pay/pl_abc123456",
"amount": 49.99,
"currency": "USD",
"status": "active",
"current_uses": 3,
"max_uses": 10,
"metadata": { "order_id": "ORD-123" },
"created_at": "2024-03-20T14:00:00Z",
"transactions": [
{
"id": "tx_987654",
"status": "completed",
"actual_output": "49.99",
"customer_wallet": "0x123...abc",
"completed_at": "2024-03-20T14:05:00Z"
}
]
}Update Payment Link Status
Pause, resume, or archive a payment link. Only the status field can be updated.
PATCH
/api/v1/payment-links/:idAllowed Status Values
activepausedarchived
curl -X PATCH https://flash-protocol.vercel.app/api/v1/payment-links/pl_abc123 \
-H "Authorization: Bearer pg_live_..." \
-H "Content-Type: application/json" \
-d '{ "status": "paused" }'200 OK
{
"id": "pl_abc123456",
"status": "paused",
"updated_at": "2024-03-21T10:00:00Z"
}Tip: You can assume the payment is pending until the user is redirected to your
success_url or you receive a webhook.