Skip to main content

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:
MethodEndpointDescription
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

API Reference

Webhooks

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

FieldTypeRequiredDescription
currencystringYesISO 4217 currency code (e.g. USD, EUR)
amountnumberYesPayment amount (minimum 0.5)
namestringNoDisplay name shown to customer on checkout
descriptionstringNoInternal description, not visible to customers
customerEmailstring (email)NoCustomer email for receipts and status updates
customerIpstringNoCustomer IP address. Auto-detected from checkout page visit if omitted
customerUserAgentstringNoCustomer user-agent. Auto-detected from checkout page visit if omitted
redirectUrlstring (URI)NoURL to redirect the customer after payment
notifyUrlstringNoWebhook URL for this specific payment
metadataobjectNoArbitrary key-value string pairs stored with the payment
paymentMethodsobjectNoRestrict which payment methods are available to the customer
feeTransfersarrayNoFee 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

FieldTypeDescription
idstring (UUID)Payment identifier
namestringDisplay name
descriptionstringInternal description
endAmountnumberFinal payment amount
prePaymentAmountnumberAmount before payment processing
currencystringISO 4217 currency code
statusPaymentStatusCurrent payment status
createdAtdate-timeWhen the payment was created
expiresAtdate-timeWhen the payment expires
timelinearrayStatus change history
customerobjectCustomer details including email and IP info
metadataobjectCustom key-value pairs
selectedPaymentMethodPaymentMethodMethod chosen by the customer
forebitCryptoChargeobjectForebit crypto charge details (if applicable)
contractChargeobjectContract charge details (if applicable)
forebitFeenumberFee amount
notestringInternal note
netAmountUsdnumberNet 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

ParameterTypeDescription
PageNumberintegerPage number for pagination
PageSizeintegerNumber of results per page
fromTimedate-timeStart of date range filter
toTimedate-timeEnd of date range filter
statusesarrayFilter by payment statuses
cryptoCoinsarrayFilter by cryptocurrency
fromAmountnumberMinimum amount filter
toAmountnumberMaximum amount filter
searchStringstringFree-text search across description, name, note, or customer email
onBehalfOfBusinessIdintegerScope 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:
StatusDescription
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

CoinIdentifier
BitcoinBITCOIN
EthereumETHEREUM
LitecoinLITECOIN
Bitcoin CashBITCOIN_CASH
USDC (ERC-20)ETH_USD_COIN
USDT (ERC-20)ETH_TETHER
MoneroMONERO
BNBBNB
DAI (ERC-20)ETH_DAI
Uniswap (ERC-20)ETH_UNISWAP
MATIC (ERC-20)ETH_MATIC
SHIB (ERC-20)ETH_SHIBA_INU
APE (ERC-20)ETH_APE_COIN
CRO (ERC-20)ETH_CRONOS
BUSD (ERC-20)ETH_BUSD
TronTRON
USDT (TRC-20)TRX_TETHER
USDC (TRC-20)TRX_USD_C
SolanaSOLANA
USDT (Solana)SOL_TETHER
USDC (Solana)SOL_USD_COIN
TONTON
Contract ETHCONTRACT_ERC20_ETH
Contract USDT (ERC-20)CONTRACT_ERC20_USDT
Contract USDC (ERC-20)CONTRACT_ERC20_USDC
Contract TRXCONTRACT_TRC20_TRX
Contract USDT (TRC-20)CONTRACT_TRC20_USDT
Contract 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