Settlement Requests Overview
Request same-currency or cross-currency treasury settlements from your HoneyCoin B2B ledger balance to bank, SWIFT, mobile money, or crypto destinations.
Settlement Requests let B2B merchants sweep funds from their HoneyCoin ledger balance to an external treasury destination—local bank account (bank), international wire (swift), mobile money wallet (momo), or stablecoin wallet (crypto for USDC/USDT). Same-currency requests can be submitted directly; cross-currency requests first lock an FX rate via a single-use quote.
flowchart TD
A{"Same currency or cross-currency?"} -->|"Cross-currency"| B["POST /settlement-requests/quotes"]
B --> C["Inspect exchangeRate, receiverAmount, expiresAt"]
C --> D["POST /settlement-requests with quoteId"]
A -->|"Same-currency (no quoteId)"| D
D --> E["pending"]
E -->|"Merchant calls POST /:id/cancel"| F["cancelled"]
E -->|"Past expiresAt before pickup"| G["expired"]
E -->|"Ops starts processing"| H["processing"]
H -->|"Ops fulfills & debits ledger"| I["completed (settlementTransactionId)"]
H -->|"Ops rejects with reason"| J["rejected"]
Base URL & Feature Access
All endpoints in this guide are relative to:
- Production:
https://api-v2.honeycoin.app/api/b2b/settlement-requests - Sandbox:
https://api-v2.honeycoin.app/api/sandbox/b2b/settlement-requests(see Testing Settlement Requests)
Authenticate every request with Authorization: Bearer YOUR_BEARER_TOKEN. See Authentication for token generation.
Production access requirement: The Settlement Requests API is gated per merchant account in production. Calling any
/api/b2b/settlement-requests/*endpoint before your account is enabled returns403 FORBIDDEN. Contact HoneyCoin support to enable Settlement Requests on your production account. Sandbox is open for testing with sandbox credentials.
Supported Settlement Methods & Destination Schemas
destination.type must match settlementMethod, and unknown fields inside destination or the top-level body are rejected with 400 VALIDATION_ERROR.
settlementMethod | Allowed receiverCurrency | Required destination Fields | Optional destination Fields |
|---|---|---|---|
bank | Fiat currencies | type: "bank", accountName, accountNumber, bankName | bankCode, branchCode, routingNumber, iban, country |
swift | Fiat currencies | type: "swift", accountName, accountNumber, bankName, swiftCode (8 or 11 char BIC) | iban, bankAddress, beneficiaryAddress, intermediarySwiftCode, country |
momo | Fiat currencies | type: "momo", accountName, phoneNumber (E.164), operator | country |
crypto | USDC, USDT | type: "crypto", walletAddress, chain | memo |
- Using
settlementMethod: "crypto"with a fiatreceiverCurrency—or usingbank/swift/momowithUSDC/USDT—returns400 VALIDATION_ERROR. - For multi-country fiat currencies without a single default country (for example
XOForXAF), include the 2-letter ISOsenderCountry/receiverCountry.
Request Lifecycle & Statuses
| Status | Meaning | Cancellable by Merchant? |
|---|---|---|
pending | Submitted and awaiting HoneyCoin operations pickup | Yes (POST /{id}/cancel) |
processing | Operations has verified balance and begun executing the payout | No (409 Conflict) |
completed | Payout executed, ledger debited, and settlementTransactionId created | No (terminal) |
rejected | Declined by operations; see reason and rejectedAt | No (terminal) |
cancelled | Cancelled by the merchant while pending; see cancelledAt | No (terminal) |
expired | Cross-currency request passed expiresAt before operations moved it to processing; see expiredAt and reason | No (terminal) |
Quote & Request Expiry Windows
Cross-currency settlements have two distinct timestamps in Unix milliseconds:
- Quote acceptance deadline (
quote.expiresAt): A quote returned byPOST /quotesmust be consumed byPOST /settlement-requestsbeforequote.expiresAt(otherwise422 QUOTE_EXPIRED). Quotes are single-use—even if the resulting settlement request is later cancelled, rejected, or expired, the consumed quote cannot be reused. - Request fulfillment deadline (
request.expiresAt): Once created, a cross-currency settlement request receives a fulfillment deadline (default 12 hours fromcreatedAt). If operations has not moved the request intoprocessingbeforeexpiresAt, a background reconciler automatically marks itexpired(submit a new request with a fresh quote). Once operations moves the request toprocessing, it will not expire while the wire or on-chain payout is in flight. Same-currency requests setexpiresAt: null.
Step-by-Step API Sequence
1. Generate an FX Quote (Cross-Currency Only)
For cross-currency settlements (senderCurrency !== receiverCurrency), call POST /api/b2b/settlement-requests/quotes:
curl --request POST \
--url https://api-v2.honeycoin.app/api/b2b/settlement-requests/quotes \
--header 'Authorization: Bearer YOUR_BEARER_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"senderAmount": 130000,
"senderCurrency": "KES",
"receiverCurrency": "USDC"
}'Returns 201 Created:
{
"success": true,
"message": "Settlement quote generated successfully.",
"data": {
"id": "sq_01JXYZ123456",
"status": "active",
"senderAmount": 130000,
"senderCurrency": "KES",
"senderCountry": "KE",
"receiverAmount": 1000,
"receiverCurrency": "USDC",
"receiverCountry": null,
"exchangeRate": 0.0076923,
"expiresAt": 1796050720000,
"consumedAt": null,
"settlementRequestId": null,
"createdAt": 1796050000000
}
}Inspect GET /api/b2b/settlement-requests/quotes/{quoteId} at any time to check whether the quote is active, consumed, or expired.
2. Create a Settlement Request
Call POST /api/b2b/settlement-requests with a unique externalReference and X-Idempotency-Key. Pass quoteId for cross-currency requests, and omit quoteId for same-currency requests (quoteId is rejected on same-currency calls).
curl --request POST \
--url https://api-v2.honeycoin.app/api/b2b/settlement-requests \
--header 'Authorization: Bearer YOUR_BEARER_TOKEN' \
--header 'Content-Type: application/json' \
--header 'X-Idempotency-Key: sr-create-0194f1c2-7b3a' \
--data '{
"senderAmount": 130000,
"senderCurrency": "KES",
"receiverCurrency": "USDC",
"settlementMethod": "crypto",
"quoteId": "sq_01JXYZ123456",
"externalReference": "settle-2026-11-30-001",
"destination": {
"type": "crypto",
"walletAddress": "0x1234567890abcdef1234567890abcdef12345678",
"chain": "BASE"
},
"note": "Weekly treasury sweep"
}'Returns 201 Created:
{
"success": true,
"message": "Settlement request created successfully.",
"data": {
"id": "sr_01JXYZ123456",
"status": "pending",
"senderAmount": 130000,
"senderCurrency": "KES",
"senderCountry": "KE",
"receiverAmount": 1000,
"receiverCurrency": "USDC",
"receiverCountry": null,
"settlementMethod": "crypto",
"destination": {
"type": "crypto",
"walletAddress": "0x1234567890abcdef1234567890abcdef12345678",
"chain": "BASE"
},
"quoteId": "sq_01JXYZ123456",
"exchangeRate": 0.0076923,
"expiresAt": 1796093200000,
"feeAmount": null,
"startDate": null,
"endDate": null,
"externalReference": "settle-2026-11-30-001",
"note": "Weekly treasury sweep",
"settlementTransactionId": null,
"settlementDate": null,
"completedAt": null,
"rejectedAt": null,
"cancelledAt": null,
"expiredAt": null,
"createdAt": 1796050000000,
"updatedAt": 1796050000000
}
}- Balance verification: In production, HoneyCoin verifies your available balance in
(senderCurrency, senderCountry)at creation (422 INSUFFICIENT_BALANCEif belowsenderAmount), again when operations moves the request toprocessing, and debitssenderAmount + feeAmountatomically upon fulfillment. Keep sufficient balance available for both the settlement amount and any applicable settlement fee.
3. Track & List Settlement Requests
- Get one request:
GET /api/b2b/settlement-requests/{id} - List requests:
GET /api/b2b/settlement-requests?status=completed&settlementMethod=crypto&limit=20
List responses use cursor pagination via limit (1–50, default 20) and after (pagination.nextCursor) or before (pagination.prevCursor). When a request reaches completed, settlementTransactionId references the debited settlement transaction (which also triggers standard transaction webhooks, with amount and currency reflecting the payout leg).
4. Cancel a Pending Request
If you need to withdraw a request before operations moves it to processing, call POST /api/b2b/settlement-requests/{id}/cancel:
curl --request POST \
--url https://api-v2.honeycoin.app/api/b2b/settlement-requests/sr_01JXYZ123456/cancel \
--header 'Authorization: Bearer YOUR_BEARER_TOKEN' \
--header 'Content-Type: application/json' \
--header 'X-Idempotency-Key: sr-cancel-0194f1c2-991a' \
--data '{
"reason": "Updated treasury bank account"
}'Returns 200 OK with status: "cancelled" and cancelledAt. Requests already in processing, completed, rejected, cancelled, or expired return 409 Conflict.
Safe Retries with X-Idempotency-Key
X-Idempotency-KeyPOST /api/b2b/settlement-requests and POST /api/b2b/settlement-requests/{id}/cancel support the X-Idempotency-Key header (16–255 characters: letters, digits, -, or _) with a 1-hour replay window and 5-minute payload deduplication fallback when omitted. See Idempotency, Settlement Requests Enums, and Testing Settlement Requests.
Updated about 16 hours ago
