Documentation Index Fetch the complete documentation index at: https://developer.forebit.io/llms.txt
Use this file to discover all available pages before exploring further.
Getting Started with Payments API
Welcome! This guide will help you get started quickly.
Authentication
All API requests require a Bearer token in the Authorization header.
Authorization: Bearer YOUR_PAYMENTS_API_KEY
Base URL
https://prod-payments-api.forebit.io
All requests must use HTTPS.
Core Endpoints
The API provides four operations scoped to a business:
Method Endpoint Description GET/v1/businesses/{businessId}/paymentsFetch a paginated set of payments POST/v1/businesses/{businessId}/paymentsCreate a new payment GET/v1/businesses/{businessId}/payments/{paymentId}Retrieve a single payment’s full record PUT/v1/businesses/{businessId}/payments/{paymentId}/noteSet or update an internal note on a payment
Creating a Payment
Send a POST request to create a new payment. The currency and amount fields are required.
curl -X POST https://prod-payments-api.forebit.io/v1/businesses/{businessId}/payments \
-H "Authorization: Bearer YOUR_PAYMENTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"currency": "USD",
"amount": 25.00,
"name": "Order #1234",
"description": "Internal order note",
"customerEmail": "customer@example.com",
"redirectUrl": "https://yoursite.com/thank-you",
"notifyUrl": "https://yoursite.com/webhooks/forebit",
"metadata": {
"orderId": "1234",
"plan": "premium"
}
}'
CreatePaymentRequest fields
Field Type Required Description currencystring Yes ISO 4217 currency code (e.g. USD, EUR) amountnumber Yes Payment amount (minimum 0.5) namestring No Display name shown to customer on checkout descriptionstring No Internal description, not visible to customers customerEmailstring (email) No Customer email for receipts and status updates customerIpstring No Customer IP address. Auto-detected from checkout page visit if omitted customerUserAgentstring No Customer user-agent. Auto-detected from checkout page visit if omitted redirectUrlstring (URI) No URL to redirect the customer after payment notifyUrlstring No Webhook URL for this specific payment metadataobject No Arbitrary key-value string pairs stored with the payment paymentMethodsobject No Restrict which payment methods are available to the customer feeTransfersarray No Fee transfer configuration
Payment methods
You can restrict which cryptocurrencies a customer can use by specifying the paymentMethods object. Each key is a charge type, and the value is an array of allowed coin names.
{
"paymentMethods" : {
"FOREBIT_CRYPTO" : [ "BITCOIN" , "ETHEREUM" , "SOLANA" ],
"CONTRACT_CRYPTO" : [ "CONTRACT_ERC20_USDT" , "CONTRACT_ERC20_USDC" ]
}
}
Charge types: FOREBIT_CRYPTO, CONTRACT_CRYPTO, CONTRACT_TRX, NONE
Successful response
{
"data" : {
"id" : "a1b2c3d4-e5f6-7890-abcd-ef1234567890" ,
"url" : "https://pay.forebit.io/payment/a1b2c3d4-e5f6-7890-abcd-ef1234567890"
},
"message" : null ,
"errors" : null
}
The url is the hosted checkout page you redirect your customer to.
Retrieving a Payment
Fetch the full record for a single payment including customer info, event timeline, on-chain transaction data, and fee details.
curl https://prod-payments-api.forebit.io/v1/businesses/{businessId}/payments/{paymentId} \
-H "Authorization: Bearer YOUR_PAYMENTS_API_KEY"
GetPaymentResponse fields
Field Type Description idstring (UUID) Payment identifier namestring Display name descriptionstring Internal description endAmountnumber Final payment amount prePaymentAmountnumber Amount before payment processing currencystring ISO 4217 currency code statusPaymentStatus Current payment status createdAtdate-time When the payment was created expiresAtdate-time When the payment expires timelinearray Status change history customerobject Customer details including email and IP info metadataobject Custom key-value pairs selectedPaymentMethodPaymentMethod Method chosen by the customer forebitCryptoChargeobject Forebit crypto charge details (if applicable) contractChargeobject Contract charge details (if applicable) forebitFeenumber Fee amount notestring Internal note netAmountUsdnumber Net amount in USD
Listing Payments
Fetch a paginated, filterable list of payments for a business.
curl "https://prod-payments-api.forebit.io/v1/businesses/{businessId}/payments?PageSize=20&statuses=COMPLETED&statuses=PENDING" \
-H "Authorization: Bearer YOUR_PAYMENTS_API_KEY"
Query parameters
Parameter Type Description PageNumberinteger Page number for pagination PageSizeinteger Number of results per page fromTimedate-time Start of date range filter toTimedate-time End of date range filter statusesarray Filter by payment statuses cryptoCoinsarray Filter by cryptocurrency fromAmountnumber Minimum amount filter toAmountnumber Maximum amount filter searchStringstring Free-text search across description, name, note, or customer email onBehalfOfBusinessIdinteger Scope results to a specific on-behalf-of business
Updating a Payment Note
Set or overwrite the internal note attached to a payment (max 256 characters). Notes are only visible to your team.
curl -X PUT https://prod-payments-api.forebit.io/v1/businesses/{businessId}/payments/{paymentId}/note \
-H "Authorization: Bearer YOUR_PAYMENTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"note": "Customer requested expedited processing"
}'
Payment Statuses
Payments progress through these statuses:
Status Description AWAITING_PAYMENTPayment created, waiting for customer to pay PENDINGPayment detected, awaiting confirmation PROCESSINGPayment is being processed UNDERPAIDCustomer sent less than the required amount COMPLETEDPayment confirmed and completed FAILEDPayment failed CANCELLEDPayment was cancelled EXPIREDPayment expired before completion
Supported Cryptocurrencies
Coin Identifier Bitcoin BITCOINEthereum ETHEREUMLitecoin LITECOINBitcoin Cash BITCOIN_CASHUSDC (ERC-20) ETH_USD_COINUSDT (ERC-20) ETH_TETHERMonero MONEROBNB BNBDAI (ERC-20) ETH_DAIUniswap (ERC-20) ETH_UNISWAPMATIC (ERC-20) ETH_MATICSHIB (ERC-20) ETH_SHIBA_INUAPE (ERC-20) ETH_APE_COINCRO (ERC-20) ETH_CRONOSBUSD (ERC-20) ETH_BUSDTron TRONUSDT (TRC-20) TRX_TETHERUSDC (TRC-20) TRX_USD_CSolana SOLANAUSDT (Solana) SOL_TETHERUSDC (Solana) SOL_USD_COINTON TONContract ETH CONTRACT_ERC20_ETHContract USDT (ERC-20) CONTRACT_ERC20_USDTContract USDC (ERC-20) CONTRACT_ERC20_USDCContract TRX CONTRACT_TRC20_TRXContract USDT (TRC-20) CONTRACT_TRC20_USDTContract USDC (TRC-20) CONTRACT_TRC20_USDC
Networks: ETHEREUM, TRON, BTC, LTC, SOLANA
Handling Responses
All API responses follow a consistent structure:
Success response
{
"data" : { ... },
"message" : null ,
"errors" : null
}
Error responses
400 - Validation Error:
{
"type" : "https://tools.ietf.org/html/rfc7231#section-6.5.1" ,
"title" : "Bad Request" ,
"status" : 400 ,
"detail" : "Validation failed"
}
401 - Unauthorized:
{
"type" : "https://tools.ietf.org/html/rfc7235#section-3.1" ,
"title" : "Unauthorized" ,
"status" : 401
}
403 - Forbidden and 404 - Not Found follow the same ProblemDetails format.
Need Help?
Support Get help from our payment team