Overview
This guide walks you through adding Forebit Payments to your product: create a payment, redirect to checkout, receive webhooks, and confirm the order.Prerequisites
- Business ID and API key from Payments → Settings → Developer
- Webhook signing secret (from Developer → Webhooks)
- Server capable of receiving webhooks (public URL for prod)
1) Create a Payment
Send aPOST request to create a payment. Only currency and amount are required.
| Field | Type | Required | Description |
|---|---|---|---|
currency | string | Yes | ISO 4217 currency code (e.g. USD, EUR) |
amount | number | Yes | Payment amount (minimum 0.5) |
name | string | No | Display name shown to customer on checkout |
description | string | No | Internal description, not visible to customers |
customerEmail | string (email) | No | Customer email for receipts and status updates |
redirectUrl | string (URI) | No | URL to redirect the customer after payment |
notifyUrl | string | No | Webhook URL for this specific payment |
metadata | object | No | Arbitrary key-value string pairs stored with the payment |
paymentMethods | object | No | Restrict which payment methods are available |
feeTransfers | array | No | Fee transfer configuration |
id (UUID) and a hosted checkout url:
Create Payment (Playground)
Available Payment Methods
Control which cryptocurrencies your customer can use by passing thepaymentMethods object. Each key is a charge type, and the value is an array of allowed coin identifiers.
Charge types
| Type | Description |
|---|---|
FOREBIT_CRYPTO | Native coins and tokens via Forebit wallets |
CONTRACT_CRYPTO | ERC-20 tokens via smart contract |
CONTRACT_TRX | TRC-20 tokens via smart contract |
NONE | No crypto payment method |
Supported coins
FOREBIT_CRYPTO:BITCOIN, ETHEREUM, LITECOIN, BITCOIN_CASH, ETH_USD_COIN, ETH_TETHER, MONERO, BNB, ETH_BUSD, ETH_MATIC, ETH_SHIBA_INU, ETH_APE_COIN, ETH_CRONOS, ETH_DAI, ETH_UNISWAP, TRON, TRX_TETHER, TRX_USD_C, SOLANA, SOL_TETHER, SOL_USD_COIN, TON
CONTRACT_CRYPTO: CONTRACT_ERC20_ETH, CONTRACT_ERC20_USDT, CONTRACT_ERC20_USDC
CONTRACT_TRX: CONTRACT_TRC20_TRX, CONTRACT_TRC20_USDT, CONTRACT_TRC20_USDC
If paymentMethods is omitted, all configured methods for your business are enabled.
2) Redirect to Checkout
After creating a payment, redirect the customer to theurl returned in the response. This is a Forebit-hosted checkout page where the customer selects a cryptocurrency and completes the payment.
3) Handle Webhook Events
Configure a webhook endpoint on your server to receive payment status updates. Verify signatures with Svix using the raw request body. The webhook payload includes the payment data with these key status transitions:| Status | Meaning |
|---|---|
AWAITING_PAYMENT | Payment created, waiting for customer |
PENDING | Payment detected, awaiting confirmation |
PROCESSING | Payment is being processed |
UNDERPAID | Customer sent less than required |
COMPLETED | Payment confirmed and completed |
FAILED | Payment failed |
CANCELLED | Payment was cancelled |
EXPIRED | Payment expired before completion |
Webhooks Guide
4) Verify Payment Status
After a webhook confirms completion, update your order and show a success screen. You can also fetch the payment directly to verify its current status:status, endAmount, currency, timeline, customer, charge details, and metadata.
Error Handling
API errors follow the RFC 7807ProblemDetails format:
| Status | Meaning |
|---|---|
400 | Invalid parameters or validation error |
401 | Invalid or missing API key |
403 | Insufficient permissions for this business |
404 | Payment or business not found |
Testing
- Create small‑amount test payments (minimum
0.5in your chosen currency) - Use Svix CLI or dashboard to replay webhooks to your endpoint
Next Steps
Webhooks
API Reference
Guide for AI Agents
Full integration context for Claude, Cursor, and Codex