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 returns 403 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.

settlementMethodAllowed receiverCurrencyRequired destination FieldsOptional destination Fields
bankFiat currenciestype: "bank", accountName, accountNumber, bankNamebankCode, branchCode, routingNumber, iban, country
swiftFiat currenciestype: "swift", accountName, accountNumber, bankName, swiftCode (8 or 11 char BIC)iban, bankAddress, beneficiaryAddress, intermediarySwiftCode, country
momoFiat currenciestype: "momo", accountName, phoneNumber (E.164), operatorcountry
cryptoUSDC, USDTtype: "crypto", walletAddress, chainmemo
  • Using settlementMethod: "crypto" with a fiat receiverCurrency—or using bank/swift/momo with USDC/USDT—returns 400 VALIDATION_ERROR.
  • For multi-country fiat currencies without a single default country (for example XOF or XAF), include the 2-letter ISO senderCountry / receiverCountry.

Request Lifecycle & Statuses

StatusMeaningCancellable by Merchant?
pendingSubmitted and awaiting HoneyCoin operations pickupYes (POST /{id}/cancel)
processingOperations has verified balance and begun executing the payoutNo (409 Conflict)
completedPayout executed, ledger debited, and settlementTransactionId createdNo (terminal)
rejectedDeclined by operations; see reason and rejectedAtNo (terminal)
cancelledCancelled by the merchant while pending; see cancelledAtNo (terminal)
expiredCross-currency request passed expiresAt before operations moved it to processing; see expiredAt and reasonNo (terminal)

Quote & Request Expiry Windows

Cross-currency settlements have two distinct timestamps in Unix milliseconds:

  1. Quote acceptance deadline (quote.expiresAt): A quote returned by POST /quotes must be consumed by POST /settlement-requests before quote.expiresAt (otherwise 422 QUOTE_EXPIRED). Quotes are single-use—even if the resulting settlement request is later cancelled, rejected, or expired, the consumed quote cannot be reused.
  2. Request fulfillment deadline (request.expiresAt): Once created, a cross-currency settlement request receives a fulfillment deadline (default 12 hours from createdAt). If operations has not moved the request into processing before expiresAt, a background reconciler automatically marks it expired (submit a new request with a fresh quote). Once operations moves the request to processing, it will not expire while the wire or on-chain payout is in flight. Same-currency requests set expiresAt: 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_BALANCE if below senderAmount), again when operations moves the request to processing, and debits senderAmount + feeAmount atomically 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

POST /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.