Base URL
https://api.fivo.financeAuthentication
Protected endpoints require authentication via API Key or JWT token.
# Option 1: API Key (recommended for server-side)
X-API-Key: your_api_key_here
# Option 2: JWT Token (for user sessions)
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...Idempotency
The Fivo API has built-in idempotency protections to prevent duplicate operations:
Payments
Each payment's is unique. If you submit a payment with a that already exists, the API returns with the existing payment data instead of creating a duplicate.txHashtxHash200
Checkout Sessions
Each session has a unique . A single checkout session can only produce one payment.payment_id
Notifications
Webhook deliveries and emails use an internal idempotency system to prevent duplicate notifications for the same event.
Handling POST responses
200201Payments
/payments/create-publicCreates a payment record after a successful blockchain transaction. This endpoint is called automatically by the Fivo widget.
Request Body
merchantIdstringRequiredMerchant ID with prefix (fivo_live_UUID)
txHashstringRequiredBlockchain transaction hash (0x...)
amountnumberRequiredPayment amount (0.01 - 1,000,000)
expectedAmountnumberOptionalExpected amount for on-chain validation. Required for same-chain payments, optional for cross-chain.
tokenstringRequired"USDC" or "EURC"
chainIdnumberRequiredSource blockchain chain ID
fromAddressstringRequiredSender wallet address
toAddressstringRequiredMerchant wallet address
isCrossChainbooleanOptionalWhether this is a CCTP cross-chain payment
bridgeKitobjectOptionalBridge Kit payload for cross-chain payments: { burnTxHash: string, mintTxHash?: string }. Required for Bridge Kit cross-chain flow.
feeQuoteobjectOptionalSigned fee quote for legacy CCTP cross-chain (deprecated). Use bridgeKit instead.
destinationChainIdnumberOptionalDestination chain (if cross-chain)
sessionIdstringOptionalCheckout session ID to link this payment to (if using checkout sessions)
customerEmailstringRequiredCustomer email address for receipt delivery. Max 255 chars.
referencestringOptionalYour internal reference (order ID, invoice number). Max 255 chars.
descriptionstringOptionalPayment description. Max 500 chars.
metadataobjectOptionalCustom key-value pairs for your internal use. Max 10KB.
| Name | Type | Required | Description |
|---|---|---|---|
merchantId | string | Required | Merchant ID with prefix (fivo_live_UUID) |
txHash | string | Required | Blockchain transaction hash (0x...) |
amount | number | Required | Payment amount (0.01 - 1,000,000) |
expectedAmount | number | Optional | Expected amount for on-chain validation. Required for same-chain payments, optional for cross-chain. |
token | string | Required | "USDC" or "EURC" |
chainId | number | Required | Source blockchain chain ID |
fromAddress | string | Required | Sender wallet address |
toAddress | string | Required | Merchant wallet address |
isCrossChain | boolean | Optional | Whether this is a CCTP cross-chain payment |
bridgeKit | object | Optional | Bridge Kit payload for cross-chain payments: { burnTxHash: string, mintTxHash?: string }. Required for Bridge Kit cross-chain flow. |
feeQuote | object | Optional | Signed fee quote for legacy CCTP cross-chain (deprecated). Use bridgeKit instead. |
destinationChainId | number | Optional | Destination chain (if cross-chain) |
sessionId | string | Optional | Checkout session ID to link this payment to (if using checkout sessions) |
customerEmail | string | Required | Customer email address for receipt delivery. Max 255 chars. |
reference | string | Optional | Your internal reference (order ID, invoice number). Max 255 chars. |
description | string | Optional | Payment description. Max 500 chars. |
metadata | object | Optional | Custom key-value pairs for your internal use. Max 10KB. |
const response = await fetch(`https://api.fivo.finance/payments/create-public`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
merchantId: 'fivo_live_969c4442-5741-4624-8305-427391683190',
txHash: '0x1234567890abcdef...',
amount: 49.99,
expectedAmount: 49.99,
token: 'USDC',
chainId: 137,
fromAddress: '0xCustomerWallet...',
toAddress: '0xMerchantWallet...',
isCrossChain: false,
customerEmail: 'customer@example.com',
reference: 'ORD-2024-001',
metadata: { product_id: 'plan_pro' }
})
});{
"success": true,
"data": {
"paymentId": "payment-uuid-here",
"status": "completed",
"isCrossChain": false
}
}Minimal response
GET /payments/:id/payments/:id/statusReturns the current status of a payment. Useful for polling payment completion.
Path Parameters
idstringRequiredPayment UUID
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | Payment UUID |
{
"success": true,
"data": {
"id": "payment-uuid-here",
"status": "completed",
"is_cross_chain": true,
"cctp_attestation_status": null,
"updated_at": "2026-03-04T10:32:00.000Z"
}
}Minimal public endpoint
GET /payments/:idcctp_attestation_statusnullPayment Status Values
| Status | Description |
|---|---|
completed | Payment successful and funds received |
pending | Payment created, awaiting processing |
pending_attestation | Cross-chain: waiting for CCTP attestation from Circle |
ready_to_mint | Cross-chain: attestation received, minting on destination chain |
minted_pending_transfer | Cross-chain: minted, transferring to merchant wallet |
failed | Payment failed (check failure_reason) |
/paymentsReturns paginated list of payments for the authenticated merchant.
Query Parameters
statusstringOptionalFilter: "pending", "completed", "failed"
currencystringOptionalFilter: "USDC" or "EURC"
startDatestringOptionalFilter: ISO date string
endDatestringOptionalFilter: ISO date string
searchstringOptionalSearch in tx_hash, from_address, customer_email, reference (min 3 chars)
limitnumberOptionalResults per page (default: 50)
offsetnumberOptionalPagination offset (default: 0)
sortBystringOptionalSort field (e.g., "created_at", "amount")
sortDirectionstringOptional"asc" or "desc"
sincestringOptionalISO datetime: only return payments created after this date. Useful for real-time polling.
| Name | Type | Required | Description |
|---|---|---|---|
status | string | Optional | Filter: "pending", "completed", "failed" |
currency | string | Optional | Filter: "USDC" or "EURC" |
startDate | string | Optional | Filter: ISO date string |
endDate | string | Optional | Filter: ISO date string |
search | string | Optional | Search in tx_hash, from_address, customer_email, reference (min 3 chars) |
limit | number | Optional | Results per page (default: 50) |
offset | number | Optional | Pagination offset (default: 0) |
sortBy | string | Optional | Sort field (e.g., "created_at", "amount") |
sortDirection | string | Optional | "asc" or "desc" |
since | string | Optional | ISO datetime: only return payments created after this date. Useful for real-time polling. |
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" \
"https://api.fivo.finance/payments?status=completed&limit=10&sortBy=created_at&sortDirection=desc"/payments/:idReturns full details of a specific payment including all CCTP fields.
/payments/api/listReturns paginated list of payments for the merchant authenticated via API Key. Useful for server-side reconciliation and verifying webhook data.
Query Parameters
statusstringOptionalFilter: "pending", "completed", "failed"
currencystringOptionalFilter: "USDC" or "EURC"
startDatestringOptionalFilter: ISO date string
endDatestringOptionalFilter: ISO date string
searchstringOptionalSearch in tx_hash, from_address, customer_email, reference (min 3 chars)
limitnumberOptionalResults per page (default: 50, max: 200)
offsetnumberOptionalPagination offset (default: 0)
sortBystringOptionalSort field (e.g., "created_at", "amount")
sortDirectionstringOptional"asc" or "desc"
sincestringOptionalISO datetime: only return payments created after this date
| Name | Type | Required | Description |
|---|---|---|---|
status | string | Optional | Filter: "pending", "completed", "failed" |
currency | string | Optional | Filter: "USDC" or "EURC" |
startDate | string | Optional | Filter: ISO date string |
endDate | string | Optional | Filter: ISO date string |
search | string | Optional | Search in tx_hash, from_address, customer_email, reference (min 3 chars) |
limit | number | Optional | Results per page (default: 50, max: 200) |
offset | number | Optional | Pagination offset (default: 0) |
sortBy | string | Optional | Sort field (e.g., "created_at", "amount") |
sortDirection | string | Optional | "asc" or "desc" |
since | string | Optional | ISO datetime: only return payments created after this date |
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.fivo.finance/payments/api/list?status=completed&limit=10"{
"success": true,
"data": {
"payments": [
{
"id": "payment-uuid",
"amount": "49.990000",
"currency": "USDC",
"status": "completed",
"tx_hash": "0x1234567890abcdef...",
"from_address": "0xCustomer...",
"to_address": "0xMerchant...",
"source_chain": "BASE",
"is_cross_chain": false,
"customer_email": "customer@example.com",
"reference": "ORD-2024-001",
"metadata": { "product_id": "plan_pro" },
"created_at": "2026-02-28T10:30:00.000Z"
}
],
"total": 1,
"limit": 10,
"offset": 0
}
}/payments/api/:idReturns full details of a specific payment. Use this to verify a payment after receiving a webhook notification.
Path Parameters
idstringRequiredPayment UUID
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | Payment UUID |
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.fivo.finance/payments/api/abc123-payment-uuid"{
"success": true,
"data": {
"id": "abc123-payment-uuid",
"amount": "49.990000",
"expected_amount": "49.990000",
"currency": "USDC",
"status": "completed",
"tx_hash": "0x1234567890abcdef...",
"from_address": "0xCustomer...",
"to_address": "0xMerchant...",
"source_chain": "BASE",
"destination_chain": null,
"is_cross_chain": false,
"bridge_provider": null,
"customer_email": "customer@example.com",
"reference": "ORD-2024-001",
"metadata": { "product_id": "plan_pro" },
"created_at": "2026-02-28T10:30:00.000Z",
"updated_at": "2026-02-28T10:30:00.000Z"
}
}Typical flow
payment.completedGET /payments/api/:id/payments/cctp-feeReturns a signed fee quote for a cross-chain (CCTP) payment. The widget calls this automatically, but you can use it for custom integrations to show fee breakdowns before the user pays.
Query Parameters
destinationChainstringRequiredDestination blockchain name (e.g., "ETH", "BASE", "ARB")
productPricestringRequiredProduct price in USD (e.g., "49.99")
| Name | Type | Required | Description |
|---|---|---|---|
destinationChain | string | Required | Destination blockchain name (e.g., "ETH", "BASE", "ARB") |
productPrice | string | Required | Product price in USD (e.g., "49.99") |
curl "https://api.fivo.finance/payments/cctp-fee?destinationChain=BASE&productPrice=49.99"{
"success": true,
"data": {
"productPrice": 49.99,
"amountToBurn": 50.74,
"feeGas": 0.5,
"feeCircle": 0.25,
"feeTotal": 0.75,
"totalUserPays": 50.74,
"merchantReceives": 49.99,
"destinationChain": "BASE",
"validUntil": 1739871300,
"validForSeconds": 300,
"breakdown": {
"gasEstimateUSD": 0.35,
"gasWithBuffer": 0.5,
"minGasFee": 0.5,
"bufferPercent": 40
},
"signature": "hmac-sha256-hex..."
}
}Signed quote
POST /payments/create-publicfeeQuoteMerchants
/merchants/:id/walletReturns the merchant's wallet address and blockchain. Used by the widget to know where to send payments.
{
"success": true,
"data": {
"wallet": {
"id": "wallet-uuid",
"address": "0x1234567890abcdef...",
"blockchain": "MATIC",
"chainId": 137
}
}
}/merchants/:id/infoReturns public merchant information like name and accepted currencies.
{
"success": true,
"data": {
"name": "My Store",
"blockchain": "MATIC",
"accepted_currencies": "USDC,EURC"
}
}Checkout Sessions
Checkout Sessions let you create a Fivo-hosted payment page and redirect your customer to it. After payment, the customer is redirected back to your site. Similar to Stripe Checkout.
/public/checkout/sessionsCreates a new checkout session and returns a URL to redirect your customer to.
Request Body
amountstring | numberOptionalPayment amount (0.01 - 1,000,000). Omit for variable amount.
currencystringOptional"USDC" or "EURC". Defaults to "USDC".
return_urlstringRequiredURL to redirect after payment. Must be HTTPS in production.
cancel_urlstringOptionalURL to redirect on cancel. Must be HTTPS in production.
metadataobjectOptionalUp to 5 key-value pairs for your reference (e.g. order_id).
expires_innumberOptionalSession lifetime in seconds (60 - 86400). Default: 1800 (30 min).
| Name | Type | Required | Description |
|---|---|---|---|
amount | string | number | Optional | Payment amount (0.01 - 1,000,000). Omit for variable amount. |
currency | string | Optional | "USDC" or "EURC". Defaults to "USDC". |
return_url | string | Required | URL to redirect after payment. Must be HTTPS in production. |
cancel_url | string | Optional | URL to redirect on cancel. Must be HTTPS in production. |
metadata | object | Optional | Up to 5 key-value pairs for your reference (e.g. order_id). |
expires_in | number | Optional | Session lifetime in seconds (60 - 86400). Default: 1800 (30 min). |
curl -X POST https://api.fivo.finance/checkout/sessions \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"amount": "49.99",
"currency": "USDC",
"return_url": "https://yoursite.com/success",
"cancel_url": "https://yoursite.com/cancel",
"metadata": { "order_id": "order_123" }
}'{
"success": true,
"data": {
"id": "cs_live_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"url": "https://checkout.fivo.finance?session=cs_live_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"expires_at": "2026-02-18T11:00:00.000Z"
}
}/checkout/sessions/:idReturns the session status and linked payment data. Use this to verify payment completion after the customer returns to your site.
{
"success": true,
"data": {
"id": "cs_live_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "complete",
"amount": "49.99",
"currency": "USDC",
"metadata": { "order_id": "order_123" },
"return_url": "https://yoursite.com/success",
"cancel_url": "https://yoursite.com/cancel",
"payment": {
"id": "payment-uuid",
"status": "completed",
"tx_hash": "0x1234567890abcdef...",
"amount": "49.99",
"is_cross_chain": false
},
"created_at": "2026-02-18T10:30:00.000Z",
"expires_at": "2026-02-18T11:00:00.000Z"
}
}Session Status Values
| Status | Description |
|---|---|
open | Session created, waiting for customer to pay |
complete | Payment confirmed and funds received |
expired | Session expired before payment was made |
/checkout/sessions/:id/publicPublic endpoint used by the checkout widget to load session details. Returns only the fields needed to render the payment UI (no metadata). You do not need to call this endpoint directly.
API Keys
/api-keysRequest Body
namestringRequiredDescriptive name for the key (1-50 chars)
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Required | Descriptive name for the key (1-50 chars) |
{
"success": true,
"message": "API key created successfully",
"data": {
"id": "key-uuid",
"name": "Production Server",
"key": "fivo_live_abc123...",
"created_at": "2024-01-15T10:30:00.000Z"
}
}Save Your Key
/api-keysReturns all API keys for the authenticated merchant. Keys are masked for security (only last 4 characters shown).
{
"success": true,
"data": [
{
"id": "key-uuid-1",
"name": "Production Server",
"last4": "••••",
"created_at": "2024-01-15T10:30:00.000Z"
},
{
"id": "key-uuid-2",
"name": "Staging Server",
"last4": "••••",
"created_at": "2024-01-10T08:00:00.000Z"
}
]
}/api-keys/:idPermanently revokes an API key. Any requests using this key will fail immediately.
{
"success": true,
"message": "API key deleted successfully"
}Invoices
Invoices are generated automatically when a withdrawal completes. Each invoice includes a fee breakdown and is stored as a PDF. All endpoints require JWT authentication.
/invoicesReturns all invoices for the authenticated merchant, sorted by date (newest first).
Query Parameters
yearnumberOptionalFilter by year (e.g. 2026)
statusstringOptional"issued" or "rectified"
| Name | Type | Required | Description |
|---|---|---|---|
year | number | Optional | Filter by year (e.g. 2026) |
status | string | Optional | "issued" or "rectified" |
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" \
"https://api.fivo.finance/invoices?year=2026"{
"success": true,
"data": [
{
"id": "invoice-uuid",
"invoice_number": "FIV-2026-0001",
"issued_at": "2026-02-25T14:30:00.000Z",
"gross_amount": "1000.000000",
"fivo_fee": "5.0000",
"fivo_fee_eur": "4.6500",
"tax_amount": "0.0000",
"net_amount": "994.500000",
"currency": "USDC",
"status": "issued",
"pdf_url": "invoices/2026/merchant-id/FIV-2026-0001.pdf",
"blockchain": "BASE"
}
]
}/invoices/:id/pdfReturns the invoice PDF file directly. Use mode=view to display inline or mode=download to trigger a save dialog.
Path Parameters
idstringRequiredInvoice UUID
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | Invoice UUID |
Direct PDF response
Webhook Management (API Key)
Manage your webhook endpoints programmatically via API Key. These endpoints mirror the dashboard webhook configuration.
X-API-Key/merchant-webhooks/api/listReturns all webhook endpoints configured for your merchant account.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.fivo.finance/merchant-webhooks/api/list"{
"success": true,
"data": [
{
"id": "webhook-uuid",
"url": "https://yoursite.com/webhooks/fivo",
"events": ["payment.completed", "payment.failed"],
"description": "Production webhook",
"is_active": true,
"failure_count": 0,
"created_at": "2026-02-20T10:00:00.000Z"
}
]
}/merchant-webhooks/api/createRequest Body
urlstringRequiredHTTPS webhook URL
eventsstring[]RequiredEvents to subscribe to (see available events below)
descriptionstringOptionalDescription (max 200 chars)
| Name | Type | Required | Description |
|---|---|---|---|
url | string | Required | HTTPS webhook URL |
events | string[] | Required | Events to subscribe to (see available events below) |
description | string | Optional | Description (max 200 chars) |
curl -X POST https://api.fivo.finance/merchant-webhooks/api/create \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yoursite.com/webhooks/fivo",
"events": ["payment.completed", "payment.failed"],
"description": "Production webhook"
}'/merchant-webhooks/api/:idPath Parameters
idstringRequiredWebhook UUID
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | Webhook UUID |
/merchant-webhooks/api/:idRequest Body
urlstringOptionalNew webhook URL
eventsstring[]OptionalNew events list
descriptionstringOptionalNew description
is_activebooleanOptionalEnable/disable the webhook
| Name | Type | Required | Description |
|---|---|---|---|
url | string | Optional | New webhook URL |
events | string[] | Optional | New events list |
description | string | Optional | New description |
is_active | boolean | Optional | Enable/disable the webhook |
/merchant-webhooks/api/:idPath Parameters
idstringRequiredWebhook UUID
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | Webhook UUID |
/merchant-webhooks/api/:id/regenerate-secretGenerates a new HMAC secret for signature verification. The old secret stops working immediately.
/merchant-webhooks/api/:id/testSends a test event to the webhook URL. Useful for verifying your endpoint.payment.completed
/merchant-webhooks/api/:id/logsQuery Parameters
limitnumberOptionalNumber of logs to return (default: 20, max: 100)
| Name | Type | Required | Description |
|---|---|---|---|
limit | number | Optional | Number of logs to return (default: 20, max: 100) |
/merchant-webhooks/api/eventsReturns all webhook events you can subscribe to, with descriptions.
Balance (API Key)
/wallets/api/balanceReturns the USDC and EURC balance of your primary wallet. Useful for monitoring available funds before triggering withdrawals.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.fivo.finance/wallets/api/balance"{
"success": true,
"data": {
"wallet_id": "wallet-uuid",
"address": "0x1234567890abcdef...",
"blockchain": "MATIC",
"balances": [
{ "token": "USDC", "amount": "1250.50" },
{ "token": "EURC", "amount": "340.00" }
]
}
}No cache
Cache-Control: no-storeInvoices (API Key)
Access your invoices programmatically via API Key. Invoices are generated automatically when a withdrawal completes.
/invoices/api/listQuery Parameters
yearnumberOptionalFilter by year (e.g. 2026)
statusstringOptional"issued" or "rectified"
| Name | Type | Required | Description |
|---|---|---|---|
year | number | Optional | Filter by year (e.g. 2026) |
status | string | Optional | "issued" or "rectified" |
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.fivo.finance/invoices/api/list?year=2026"/invoices/api/:id/pdfPath Parameters
idstringRequiredInvoice UUID
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | Invoice UUID |
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.fivo.finance/invoices/api/INVOICE_UUID/pdf?mode=download"Direct PDF response
Refunds (API Key)
Issue refunds for completed payments. Refunds are sent on-chain to the original sender address. All endpoints require API Key authentication via header.X-API-Key
/refunds/api/createCreates a refund for a completed payment. By default, refunds the full payment amount. Partial refunds are supported by specifying an .amount
Request Body
paymentIdstringRequiredUUID of the payment to refund
amountstringOptionalAmount to refund (defaults to full payment amount)
reasonstringRequired"duplicate", "fraudulent", "requested_by_customer", or "other"
notestringOptionalInternal note about the refund (max 500 chars)
| Name | Type | Required | Description |
|---|---|---|---|
paymentId | string | Required | UUID of the payment to refund |
amount | string | Optional | Amount to refund (defaults to full payment amount) |
reason | string | Required | "duplicate", "fraudulent", "requested_by_customer", or "other" |
note | string | Optional | Internal note about the refund (max 500 chars) |
curl -X POST https://api.fivo.finance/refunds/api/create \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"paymentId": "payment-uuid-here",
"amount": "49.99",
"reason": "requested_by_customer",
"note": "Customer requested refund"
}'{
"success": true,
"data": {
"id": "refund-uuid",
"payment_id": "payment-uuid-here",
"amount": "49.990000",
"currency": "USDC",
"status": "pending",
"destination_address": "0xCustomer...",
"blockchain": "BASE",
"reason": "requested_by_customer"
}
}Refund window
/refunds/api/listReturns a paginated list of refunds for the authenticated merchant.
Query Parameters
statusstringOptionalFilter: "pending", "processing", "completed", "failed", "cancelled"
currencystringOptionalFilter: "USDC" or "EURC"
searchstringOptionalSearch in payment ID, destination address, tx hash
limitnumberOptionalResults per page (default: 50, max: 200)
offsetnumberOptionalPagination offset (default: 0)
| Name | Type | Required | Description |
|---|---|---|---|
status | string | Optional | Filter: "pending", "processing", "completed", "failed", "cancelled" |
currency | string | Optional | Filter: "USDC" or "EURC" |
search | string | Optional | Search in payment ID, destination address, tx hash |
limit | number | Optional | Results per page (default: 50, max: 200) |
offset | number | Optional | Pagination offset (default: 0) |
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.fivo.finance/refunds/api/list?status=completed&limit=10"{
"success": true,
"data": {
"refunds": [
{
"id": "refund-uuid",
"payment_id": "payment-uuid",
"amount": "49.990000",
"currency": "USDC",
"status": "completed",
"destination_address": "0xCustomer...",
"blockchain": "BASE",
"reason": "requested_by_customer",
"tx_hash": "0xabc123...",
"created_at": "2026-03-01T10:30:00.000Z"
}
],
"total": 1,
"limit": 10,
"offset": 0
}
}/refunds/api/:idReturns full details of a specific refund, including the linked payment data.
Path Parameters
idstringRequiredRefund UUID
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | Refund UUID |
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.fivo.finance/refunds/api/REFUND_UUID"{
"success": true,
"data": {
"id": "refund-uuid",
"payment_id": "payment-uuid",
"amount": "49.990000",
"currency": "USDC",
"status": "completed",
"destination_address": "0xCustomer...",
"blockchain": "BASE",
"reason": "requested_by_customer",
"note": "Customer requested refund",
"tx_hash": "0xabc123...",
"failure_reason": null,
"created_at": "2026-03-01T10:30:00.000Z",
"completed_at": "2026-03-01T10:31:00.000Z",
"payment": {
"id": "payment-uuid",
"amount": "49.990000",
"currency": "USDC",
"status": "completed",
"tx_hash": "0xoriginal...",
"from_address": "0xCustomer...",
"created_at": "2026-02-28T10:30:00.000Z"
}
}
}/refunds/api/:id/cancelCancels a refund that is still in status. Refunds that are already processing or completed cannot be cancelled.pending
Path Parameters
idstringRequiredRefund UUID
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | Refund UUID |
curl -X POST https://api.fivo.finance/refunds/api/REFUND_UUID/cancel \
-H "X-API-Key: YOUR_API_KEY"{
"success": true
}Webhooks
Webhooks notify your server in real-time when payment events occur. Configure webhooks in your or via the .dashboardWebhook Management API
Events
| Event | Description |
|---|---|
payment.completed | Payment successful and funds received by merchant |
payment.failed | Payment failed |
refund.created | A refund has been created for a payment |
refund.completed | Refund completed on-chain and sent to customer |
refund.failed | Refund failed (check failure_reason) |
Payload
{
"event": "payment.completed",
"timestamp": "2026-02-18T10:30:45.123Z",
"data": {
"payment_id": "abc123-uuid",
"amount": "49.99",
"currency": "USDC",
"tx_hash": "0x1234567890abcdef...",
"from_address": "0xCustomerWallet...",
"to_address": "0xMerchantWallet...",
"source_chain": "ETH",
"destination_chain": null,
"is_cross_chain": false,
"status": "completed"
}
}Headers
| Header | Description |
|---|---|
X-Fivo-Signature | HMAC-SHA256 signature ()sha256=hex |
X-Fivo-Event | Event type (e.g. )payment.completed |
X-Fivo-Timestamp | Unix timestamp (seconds) when webhook was sent |
X-Fivo-Test | or , whether this is a test webhooktruefalse |
Verifying Signatures
Always verify the header to ensure the webhook came from Fivo.X-Fivo-Signature
const crypto = require('crypto');
function verifyWebhookSignature(payload, signature, timestamp, secret) {
const signaturePayload = timestamp + '.' + JSON.stringify(payload);
const expected = 'sha256=' + crypto
.createHmac('sha256', secret)
.update(signaturePayload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}
// In your webhook handler:
app.post('/webhook', (req, res) => {
const signature = req.headers['x-fivo-signature'];
const timestamp = req.headers['x-fivo-timestamp'];
if (!verifyWebhookSignature(req.body, signature, timestamp, WEBHOOK_SECRET)) {
return res.status(401).send('Invalid signature');
}
// Process the event
const { event, data } = req.body;
console.log(event, data.payment_id, data.amount);
res.status(200).send('OK');
});Webhook Reliability
Response Format
All API responses follow a consistent format:
{
"success": true,
"data": { ... },
"message": "Optional message"
}{
"success": false,
"error": "Error description",
"details": [ ... ]
}Need help?
Check out our error handling guide or contact support.