API Endpoints
Every HTTP route your platform needs to integrate Crebit Lock, with full request & response schemas, allowed-value dropdowns, and clickable sample payloads. Sandbox base URL: https://lock-apis-sandbox.crebitpay.com.
Register an opaque customer id before quoting.
customer_reference_id (unique per partner, no PII). Crebit stores the mapping so quotes and contracts can reference the same customer.POST /fx/customer-referencesPrice a rate lock for your customer over a time window.
notional_currency, direction, notional_amount), a market_rate benchmark, the lock window, settlement rail, and a strike_mode (cip_fair / live_spot / custom). Crebit returns the priced quote with the locked_rate and strike_advantage_bps vs market.POST /fx/quotesTurn the accepted quote into a binding contract.
quote_id the customer accepted. Crebit creates an immutable contract carrying the lock window, chain, settlement currency, and locked rate. The response includes the funding_wallet_address - send your deposit/premium there to activate the lock.POST /fx/contractsCustomer transacts on your platform at the live spot rate.
active waiting for the next webhook.Webhook tells Crebit the live rate and the customer's payout wallet.
event_type=contract_exercised with live_execution_rate and payout_wallet_address. Crebit uses these to compute the FX delta owed.POST /fx/webhooks/inboundCrebit sends the FX delta on-chain, then posts payout_success and contract_settled.
FX delta = notional × (live_execution_rate − locked_rate) (sign depends on direction), converts to settlement_currency, and transfers it on chain to the customer's wallet. You receive an outbound payout_success and contract_settled webhook with the on-chain transaction_hash.Webhook → your URLAll Routes
| Method | Path | Purpose |
|---|---|---|
| GET | /api/v1/partners/me | Verify API credentials |
| POST | /api/v1/fx/customer-references | Register a customer id |
| GET | /api/v1/fx/customer-references | List customer references |
| GET | /api/v1/fx/customer-references/{customer_reference_id} | Get one customer reference |
| POST | /api/v1/fx/quotes | Request a rate-lock quote |
| GET | /api/v1/fx/quotes | List quotes (paginated) |
| GET | /api/v1/fx/quotes/{quote_id} | Fetch one quote |
| GET | /api/v1/fx/supported-chains | List live/planned settlement chains |
| POST | /api/v1/fx/contracts | Lock the quote (create contract) |
| GET | /api/v1/fx/contracts | List all FX contracts (paginated) |
| GET | /api/v1/fx/contracts/{contract_id} | Get full contract detail |
| PUT | /api/v1/fx/contracts/{contract_id}/payout-destination | Save payout wallet before maturity |
| POST | /api/v1/fx/contracts/{contract_id}/retry | Recover a failed contract |
| GET | /api/v1/fx/contracts/by-reference/{crebit_contract_reference} | Poll contract status by human reference |
| GET | /api/v1/fx/contracts/{contract_id}/status | Poll contract status by UUID |
| GET | /api/v1/fx/contracts/{contract_id}/payments | List premium/deposit payment legs |
| GET | /api/v1/fx/contracts/{contract_id}/deposits | List deposit movement history |
| GET | /api/v1/fx/contracts/{contract_id}/payouts | List settlement payouts for a contract |
| POST | /api/v1/fx/contracts/{contract_id}/settlement-preview | Preview payout math before exercise |
| GET | /api/v1/fx/customers/{customer_reference_id}/locks | List FX locks for a customer |
| POST | /api/v1/fx/webhooks/inbound | Notify Crebit (funds, exercise) |
| GET | /api/v1/fx/webhook-events | Audit inbound + outbound webhook deliveries |
| GET | /api/v1/fiat/profile | Fiat partner profile & readiness flags |
| GET | /api/v1/fiat/bank-directory | US bank routing directory |
| GET | /api/v1/fiat/bank-accounts | List payout bank accounts |
| POST | /api/v1/fiat/bank-accounts | Create payout bank (PIX / ACH / wire / SWIFT / SEPA) |
| PUT | /api/v1/fiat/bank-accounts/{bank_account_id}/swift-document | Attach/replace SWIFT relationship document |
| GET | /api/v1/fiat/orders | Combined spot + forward orders list |
| POST | /api/v1/fiat/spot/quote-preview | Live spot rate preview |
| POST | /api/v1/fiat/spot/quotes | Lock live spot quote & fees |
| POST | /api/v1/fiat/spot/orders | Create fiat spot order |
| GET | /api/v1/fiat/spot/orders | List fiat spot orders |
| GET | /api/v1/fiat/spot/orders/{order_id} | Get fiat spot order detail |
| GET | /api/v1/fiat/spot/orders/{order_id}/receipt | Download spot receipt PDF |
| GET | /api/v1/fiat/spot/orders/{order_id}/share | Get spot shareable payment link |
| POST | /api/v1/fiat/spot/orders/{order_id}/compliance-documents | Submit SWIFT compliance docs |
| POST | /api/v1/fiat/forward/quote-preview | Deliverable forward details preview |
| POST | /api/v1/fiat/forward/quotes | Lock deliverable forward quote |
| POST | /api/v1/fiat/forward/orders | Create deliverable forward order |
| GET | /api/v1/fiat/forward/orders | List deliverable forward orders |
| GET | /api/v1/fiat/forward/orders/{order_id} | Get forward order detail |
| POST | /api/v1/fiat/forward/orders/{order_id}/execute | Open remaining notional payin |
| POST | /api/v1/fiat/forward/orders/{order_id}/confirm-payout | Confirm payout |
| GET | /api/v1/fiat/forward/orders/{order_id}/receipt | Download forward receipt PDF |
| GET | /api/v1/fiat/forward/orders/{order_id}/share | Get forward shareable payment link |
| POST | /api/v1/fiat/forward/orders/{order_id}/compliance-documents | Submit forward SWIFT docs |
Supported Values
Enum fields below render as real dropdowns on each schema, never have to guess what to send.
| Field | Allowed values | Notes |
|---|---|---|
| chain | solana, tron, ethereum, polygon | Settlement blockchain. Picked at quote time; immutable on the contract. Call GET /fx/supported-chains for live vs planned. |
| settlement_currency | USDC, USDT | Stablecoin (margin token) used for BOTH the upfront fee (you pay in) AND the FX delta payout (we pay out). USDC or USDT; your choice selects the live oracle pair. |
| oracle | redstone, binance, stable_coordinates, crebit_ngn, chainlink | Settlement price oracle at quote time. BRL/MXN: redstone (default) or binance. NGN: stable_coordinates (default) or crebit_ngn. CHF: chainlink. |
| contract_type | forward, option | forward = obligation; option = right but not obligation. |
| direction | BRL_TO_USD, USD_TO_BRL, MXN_TO_USD, USD_TO_MXN, NGN_TO_USD, USD_TO_NGN | FX corridor as FROM_TO_TO (e.g. USD_TO_BRL). Six values — BRL/USD, MXN/USD, and NGN/USD, both directions; see Concepts for notional_currency rules per pair. |
Account · GET /api/v1/partners/me
Confirm your API key, environment, and partner id after onboarding. No request body.
partner_iduuidRequiredStable Crebit partner identifier. Echo on support tickets.
Example11111111-…partner_namestringRequiredDisplay name configured at onboarding.
ExampleAcme FX (sandbox)api_key_iduuidRequiredPublic id of the API key used for this call.
Example55555555-…environmentstring (enum)RequiredMust match the X-Crebit-Environment header you sent.
2 options
{
"partner_id": "11111111-1111-4111-8111-111111111111",
"partner_name": "Acme FX (sandbox)",
"api_key_id": "55555555-5555-4555-8555-555555555555",
"environment": "sandbox"
}curl -sS -X GET "https://lock-apis-sandbox.crebitpay.com/api/v1/partners/me" \
-H "Content-Type: application/json" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: sandbox"Customer References · POST /api/v1/fx/customer-references
Register an opaque customer_reference_id for each end customer before creating quotes. Unique per partner; no PII. Idempotent — re-posting the same id returns HTTP 200 with the existing row.
customer_reference_idstring (1–256)RequiredYour stable opaque id for the end customer. Unique per partner. Register once, then reuse on every quote and contract for that customer.
Examplepartner-cust-ref-2026-0042
{
"customer_reference_id": "partner-cust-ref-2026-0042"
}curl -sS -X POST "https://lock-apis-sandbox.crebitpay.com/api/v1/fx/customer-references" \
-H "Content-Type: application/json" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: sandbox" \
-d '{"customer_reference_id":"partner-cust-ref-2026-0042"}'Response Body
iduuidRequiredCrebit internal id for this customer reference row.
Example66666666-…customer_reference_idstringRequiredEcho of the partner-supplied id from the request.
Examplepartner-cust-ref-2026-0042created_atdatetime (ISO-8601 UTC)RequiredWhen the id was first registered.
Example2026-05-24T16:00:00Z
GET /api/v1/fx/customer-references lists registered ids (cursor pagination). GET /api/v1/fx/customer-references/{customer_reference_id} fetches one by your external id.
{
"id": "66666666-6666-4666-8666-666666666666",
"customer_reference_id": "partner-cust-ref-2026-0042",
"created_at": "2026-05-24T16:00:00Z"
}{
"items": [
{
"id": "66666666-6666-4666-8666-666666666666",
"customer_reference_id": "partner-cust-ref-2026-0042",
"created_at": "2026-05-24T16:00:00Z"
}
],
"next_cursor": null
}Quotes · POST /api/v1/fx/quotes
Price a rate lock for a customer. The customer_reference_id must already be registered (see above). The lock window is a calendar range - the customer may execute on ANY day from window_start through window_end (inclusive). Send Idempotency-Key (8–128 ASCII printable chars) on POST /fx/webhooks/inbound (required). Recommended on POST /fx/quotes and POST /fx/contracts.
Request Body, Every Field
crebit-pricer (amount_due, collateral + upfront fee for forwards, premium for options). The locked rate uses live_spot_pricer TWAP when strike_mode=live_spot.customer_reference_idstring (1–256)RequiredYour stable id for the customer. Must be registered first via POST /api/v1/fx/customer-references. Crebit treats it as opaque and echoes it back; unknown ids return 404 not_found.
Examplepartner-cust-ref-2026-0042customer_namestring (1–256)RequiredHuman-readable customer / business name. Used in audit logs and contract documents.
ExampleAcme Imports Pvt Ltdcontract_typestring (enum)Requiredforward = obligation (refundable deposit). option = right but not obligation (upfront premium).
2 optionsdirectionstring (enum)RequiredFX corridor as BASE_TO_QUOTE. Six supported values — BRL/USD, MXN/USD, and NGN/USD, both directions (see SUPPORTED_DIRECTIONS).
6 optionsnotional_currencystring (enum)RequiredWhich side of the FX pair the notional_amount is denominated in. EITHER currency in the direction is valid, partner picks whichever the customer is fixing (the amount they're sending or the amount they want to receive). For direction=USD_TO_BRL, this can be USD or BRL; for direction=USD_TO_NGN, this can be USD or NGN.
4 optionsnotional_amountdecimal stringRequiredTrade size, denominated in notional_currency. Decimal string to preserve precision.
Example50000.00provider_ratedecimal stringOptionalYour live FX rate at quote time. Required unless strike_mode=live_spot (server fetches live TWAP for the strike).
Example5.42market_ratedecimal stringOptionalBenchmark mid-market FX rate you observed at quote time — interbank feed or equivalent stablecoin pair. Required with market_rate_timestamp unless strike_mode=live_spot (server fetches live TWAP).
Example5.4180market_rate_timestampdatetime (ISO-8601 UTC)OptionalUTC time when market_rate was observed. Required with market_rate unless strike_mode=live_spot. Must be within ~5 min of the request when sent.
Example2026-05-24T16:00:00Zprovider_extra_spreaddecimal stringOptionalOPTIONAL partner spread (in rate units). Persisted and echoed on the response; pricing math currently ignores this field.
Example0.0030strike_modestring (enum)OptionalHow Crebit picks the strike. cip_fair (default) = CIP-fair forward rate from market_rate + interest differential. live_spot = locked_rate from live_spot_pricer TWAP at quote time (provider_rate and market_rate optional). custom = uses target_strike you supply.
3 optionstarget_strikedecimal stringOptionalRequired ONLY when strike_mode=custom. The exact strike you want the lock to execute at, e.g. an option struck ATM/OTM/ITM, or a forward matching an externally-quoted rate. Ignored if strike_mode is anything else.
Example5.50window_startdatetime (ISO-8601 UTC)RequiredFirst moment the customer may execute the locked rate. Must be now or in the future (UTC). Must be strictly before window_end.
Example2026-08-04T00:00:00Zwindow_enddatetime (ISO-8601 UTC)RequiredLast moment the customer may execute. Must be strictly after window_start and after the current time (UTC). Equal start/end values return validation_error. Short locks: 1–24 hour span between start and end. Long locks: window_end calendar date up to 180 days ahead. Out-of-range durations return duration_out_of_range.
Example2026-08-11T00:00:00Zchainstring (enum)RequiredBlockchain Crebit settles on, same chain you fund on and same chain Crebit pays out on. Set at quote time; immutable for the life of the contract. Call GET /fx/supported-chains for live vs planned status.
4 optionssettlement_currencystring (enum)RequiredStablecoin Crebit and the partner settle in (margin token). Partner sends the upfront fee in this stablecoin to funding_wallet_address; Crebit pays out any FX delta in this stablecoin. USDC or USDT only. Also called margin token in the dashboard — your choice selects the live oracle pair (e.g. BRL/USDC vs BRL/USDT, NGN/USDT). Set at quote time; immutable on the contract.
2 optionspayout_wallet_addressstringRequiredDestination wallet for settlement payout on the contract chain (e.g. Solana address for USDC, Tron address for USDT). Stored on the quote and copied to the contract.
Example0xEndUserWalletForSettlementsource_chainstring (1–64)OptionalOptional funding origin chain when bridging stablecoins (Bridge Kit flows). Settlement chain is still `chain`.
Examplebaseoraclestring (enum)OptionalSettlement price oracle for exercise and maturity. BRL/MXN: redstone (default) or binance. NGN: stable_coordinates (default) or crebit_ngn. CHF: chainlink.
5 options
Sample Requests
Most common shape. Omit strike_mode (or set cip_fair) and Crebit derives the forward strike from market_rate + the USD/BRL interest-rate differential. For USD→BRL, this lifts the strike above spot, customer gets MORE BRL per USD.
{
"customer_reference_id": "partner-cust-ref-2026-0042",
"customer_name": "Acme Imports Pvt Ltd",
"contract_type": "forward",
"direction": "USD_TO_BRL",
"notional_currency": "USD",
"notional_amount": "50000.00",
"provider_rate": "5.42",
"provider_extra_spread": "0.0030",
"market_rate": "5.4180",
"market_rate_timestamp": "2026-05-24T16:00:00Z",
"strike_mode": "cip_fair",
"window_start": "2026-08-04T00:00:00Z",
"window_end": "2026-08-11T00:00:00Z",
"chain": "solana",
"settlement_currency": "USDC",
"payout_wallet_address": "EndUserSolanaWalletForSettlement",
"oracle": "redstone"
}How to Call (BRL Corridor Example)
Copy-paste example below uses USD_TO_BRL with settlement_currency=USDC on Solana.
curl -sS -X POST "https://lock-apis-sandbox.crebitpay.com/api/v1/fx/quotes" \
-H "Content-Type: application/json" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: sandbox" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"customer_reference_id":"partner-cust-ref-2026-0042","customer_name":"Acme Imports Pvt Ltd","contract_type":"forward","direction":"USD_TO_BRL","notional_currency":"USD","notional_amount":"50000.00","provider_rate":"5.42","market_rate":"5.4180","market_rate_timestamp":"2026-05-24T16:00:00Z","provider_extra_spread":"0.0005","strike_mode":"cip_fair","window_start":"2026-08-04T00:00:00Z","window_end":"2026-08-11T00:00:00Z","chain":"solana","settlement_currency":"USDC","payout_wallet_address":"EndUserSolanaWalletForSettlement","oracle":"redstone"}'How to Call (NGN Corridor Example)
Copy-paste example below uses NGN_TO_USD with settlement_currency=USDT on Solana. Pick MXN and other variants in Sample requests above.
400 contract_type_unsupported). window_end must be within 72 hours of the quote unless your account has the CIP forward feature (then up to 180 days). The oracle is stablecoin_rates (default) or crebit_ngn. With strike_mode=live_spotthe server fetches the rate, so you don't send provider_rate.curl -sS -X POST "https://lock-apis-sandbox.crebitpay.com/api/v1/fx/quotes" \
-H "Content-Type: application/json" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: sandbox" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"customer_reference_id":"partner-cust-ref-2026-0405","customer_name":"Lagos Exports Ltd","contract_type":"forward","direction":"NGN_TO_USD","notional_currency":"NGN","notional_amount":"50000000.00","strike_mode":"live_spot","window_start":"2026-08-05T15:45:00Z","window_end":"2026-08-05T16:00:00Z","chain":"solana","settlement_currency":"USDT","payout_wallet_address":"So11111111111111111111111111111111111111112","oracle":"stablecoin_rates"}'Response Body, 201 Created
iduuidRequiredQuote id. Pass to POST /api/v1/fx/contracts.
Example22222222-…statusstring (enum)RequiredQuote outcome: created when pricing succeeded, failed otherwise.
2 optionslocked_ratedecimal stringRequiredThe strike, the FX rate Crebit will honor if the customer exercises. For forwards, this is the CIP-fair forward rate (or your target_strike if you supplied one). For options, this is the option strike price.
Example5.42strike_modestring (enum)OptionalEchoes how the strike was chosen. cip_fair = Crebit derived it from covered-interest-parity. live_spot = strike from live_spot_pricer TWAP at quote time. custom = you supplied target_strike.
3 optionstarget_strikedecimal string | nullOptionalEchos the strike from the request, if strike_mode=custom and target_strike was provided.
Examplenullstrike_advantage_bpsintegerRequiredNon-negative basis points: absolute difference between locked_rate and market_rate (direction-aware customer messaging is planned; today the API returns magnitude only). Use with strike_mode and locked_rate to explain the quote to your customer.
Example12provider_extra_spreaddecimal string | nullOptionalYour spread from the request (zero if you didn't send provider_extra_spread).
Example0.0005premium_amountdecimal stringRequiredAll-in premium (option) or quoted fee (forward) the partner pays upfront. Denominated in settlement_currency.
Example1565.00deposit_amountdecimal string | nullOptionalSecurity deposit (forwards only; null for options). Typically 5-10% of notional, denominated in settlement_currency. Collateral against the customer's obligation to transact, released back to the partner on successful exercise, FORFEITED if the customer fails to transact within the window.
Example5000.00total_amountdecimal stringRequiredThe total amount that would be due to Crebit to activate the lock. Adds premium_amount and deposit_amount.
Example6565.00amount_duedecimal string | nullOptionalTotal stablecoin due now from crebit-pricer (premium + deposit for forwards, premium only for options). Denominated in settlement_currency.
Example6565.00collateral_amountdecimal string | nullOptionalForward refundable collateral from crebit-pricer (forwards only; null for options). Typically aligns with deposit_amount.
Example5000.00upfront_feedecimal string | nullOptionalForward only — non-refundable platform fee from crebit-pricer. Omitted for options (use premium_amount and amount_due only).
Example565.00pricing_tierstring | nullOptionalcrebit-pricer tier (e.g. ml_full, gk_*) for ML validation and audit.
Exampleml_fullpricing_greeksobject | nullOptionalcrebit-pricer delta/gamma when available. Shape: { delta, gamma } decimal strings.
Example{ "delta": "0.42", "gamma": "0.01" }window_startdatetime (ISO-8601 UTC)RequiredEchoes the lock-window start you sent.
Example2026-08-04T00:00:00Zwindow_enddatetime (ISO-8601 UTC)RequiredEchoes the lock-window end you sent.
Example2026-08-11T00:00:00Zchainstring (enum)RequiredBlockchain Crebit settles on, same chain you fund on and same chain Crebit pays out on. Set at quote time; immutable for the life of the contract. Call GET /fx/supported-chains for live vs planned status.
4 optionssettlement_currencystring (enum)RequiredStablecoin Crebit and the partner settle in (margin token). Partner sends the upfront fee in this stablecoin to funding_wallet_address; Crebit pays out any FX delta in this stablecoin. USDC or USDT only. Also called margin token in the dashboard — your choice selects the live oracle pair (e.g. BRL/USDC vs BRL/USDT, NGN/USDT). Set at quote time; immutable on the contract.
2 optionspayout_wallet_addressstring | nullOptionalEcho of the destination wallet from the quote request.
Example0xEndUserWalletForSettlementsource_chainstring | nullOptionalEcho of the optional funding origin chain from the request.
Examplebaseoraclestring (enum)RequiredSettlement price oracle selected at quote time.
5 optionsexpires_atdatetime (ISO-8601 UTC)RequiredQuote validity cutoff. POST the id to /contracts before this time. Default TTL is 15 minutes (server-configured via quote_expiry_minutes). Quotes are short-lived because FX moves; show the customer the quote with a countdown if you don't lock immediately.
Example2026-05-24T16:16:30Zcreated_atdatetime (ISO-8601 UTC)RequiredUTC timestamp the quote was issued.
Example2026-05-24T16:15:00Z
{
"id": "22222222-2222-4222-8222-222222222222",
"status": "created",
"locked_rate": "5.42",
"strike_mode": "cip_fair",
"target_strike": null,
"strike_advantage_bps": 12,
"provider_extra_spread": "0.0005",
"premium_amount": "1565.00",
"deposit_amount": "5000.00",
"total_amount": "6565.00",
"amount_due": "6565.00",
"collateral_amount": "5000.00",
"upfront_fee": "565.00",
"pricing_tier": "ml_full",
"pricing_greeks": {
"delta": "0.42",
"gamma": "0.01"
},
"window_start": "2026-08-04T00:00:00Z",
"window_end": "2026-08-11T00:00:00Z",
"chain": "solana",
"settlement_currency": "USDC",
"payout_wallet_address": "EndUserSolanaWalletForSettlement",
"oracle": "redstone",
"expires_at": "2026-05-24T16:30:00Z",
"created_at": "2026-05-24T16:15:00Z"
}List / Get
GET /api/v1/fx/quotes, cursor pagination. Optional filters: status (created includes accepted quotes; failed includes expired), customer_reference_id, limit, cursor.
statusstring (enum)OptionalOptional filter. created includes quotes still open and quotes already accepted into a contract. failed includes pricing failures and expired quotes.
2 optionscustomer_reference_idstringOptionalOptional filter to quotes for one customer.
Examplepartner-cust-ref-2026-0042limitintegerOptionalPage size (1–100). Default 25.
Example25cursorstringOptionalOpaque pagination cursor from a previous response's next_cursor.
ExampleeyJpZCI6IjIyMj…
GET /api/v1/fx/quotes/{quote_id}, fetch a single quote by id.
curl -sS -X GET "https://lock-apis-sandbox.crebitpay.com/api/v1/fx/quotes?status=created&limit=25" \
-H "Content-Type: application/json" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: sandbox"{
"items": [
{
"id": "22222222-2222-4222-8222-222222222222",
"status": "created",
"locked_rate": "5.42",
"strike_mode": "cip_fair",
"target_strike": null,
"strike_advantage_bps": 12,
"provider_extra_spread": "0.0005",
"premium_amount": "1565.00",
"deposit_amount": "5000.00",
"total_amount": "6565.00",
"amount_due": "6565.00",
"collateral_amount": "5000.00",
"upfront_fee": "565.00",
"pricing_tier": "ml_full",
"pricing_greeks": {
"delta": "0.42",
"gamma": "0.01"
},
"window_start": "2026-08-04T00:00:00Z",
"window_end": "2026-08-11T00:00:00Z",
"chain": "solana",
"settlement_currency": "USDC",
"payout_wallet_address": "EndUserSolanaWalletForSettlement",
"oracle": "redstone",
"expires_at": "2026-05-24T16:30:00Z",
"created_at": "2026-05-24T16:15:00Z"
}
],
"next_cursor": null
}Supported Chains · GET /api/v1/fx/supported-chains
Returns the settlement chain catalog with allowed stablecoins per chain. enabledis this partner's entitlement (solana + tron by default; polygon is opt-in). In production it is also false when payout-hot float is below the floor, andsettlement_currencies lists only funded tokens.funded_settlement_pairs is null in sandbox. Tron supports USDT only.
chainsarray<object>RequiredCatalog of supported settlement chains.
Show 5 nested fields
chainstring (enum)RequiredSettlement chain identifier.
4 optionssettlement_currenciesarray<string>RequiredStablecoins currently bookable on this chain. In production this list is payout-hot inventory at or above the floor; unfunded tokens are omitted.
Example["USDC", "USDT"]statusstring (enum)Requiredlive = production-ready. planned = schema reserved, not yet live.
2 optionsaddress_format_hintstringRequiredHuman-readable wallet address format for this chain.
Examplebase58 pubkey (~32–44 chars)enabledbooleanRequiredTrue when this partner may book the chain and, in production, at least one listed settlement currency is funded on payout-hot. Polygon is opt-in. False chains stay in the catalog for discovery.
Exampletrue
funded_settlement_pairsarray<object> | nullOptionalProduction payout-hot (chain, currency) pairs at or above the floor. Null in sandbox/test (gate off). Empty array means nothing is currently bookable.
Example[{"chain":"tron","currency":"USDT"}]
{
"chains": [
{
"chain": "solana",
"settlement_currencies": [
"USDC",
"USDT"
],
"status": "live",
"address_format_hint": "base58 pubkey (~32–44 chars)",
"enabled": true
},
{
"chain": "tron",
"settlement_currencies": [
"USDT"
],
"status": "live",
"address_format_hint": "Base58Check address starting with T (~34 chars)",
"enabled": true
},
{
"chain": "ethereum",
"settlement_currencies": [
"USDC",
"USDT"
],
"status": "planned",
"address_format_hint": "0x-prefixed 20-byte hex address",
"enabled": false
},
{
"chain": "polygon",
"settlement_currencies": [
"USDC",
"USDT"
],
"status": "planned",
"address_format_hint": "0x-prefixed 20-byte hex address (EVM)",
"enabled": false
}
],
"funded_settlement_pairs": null
}curl -sS -X GET "https://lock-apis-sandbox.crebitpay.com/api/v1/fx/supported-chains" \
-H "Content-Type: application/json" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: sandbox"Contracts · POST /api/v1/fx/contracts
Converts an accepted quote into a binding rate lock. The contract inherits the quote's lock window, chain, and payout currency - those terms are immutable once the contract exists.
Request Body
quote_iduuidRequiredid returned by POST /api/v1/fx/quotes.
Example22222222-…partner_transaction_referencestringOptionalOptional platform transaction id. When omitted, Crebit assigns a UUID automatically. Echoed in webhooks for reconciliation.
Exampleplatform-tx-9901payout_wallet_addressstringOptionalOptional settlement destination at lock time (CA-745). May also be set later via PUT .../payout-destination before maturity.
Example0xEndUserWalletForSettlementpayout_currencystring (enum)OptionalOptional payout stablecoin. Defaults from the quote settlement_currency when payout_wallet_address is set.
3 optionspayout_chainstring (enum)OptionalOptional payout chain. Defaults from the quote chain when payout_wallet_address is set.
4 options
Quote id from POST /api/v1/fx/quotes is the only required field.
{
"quote_id": "22222222-2222-4222-8222-222222222222"
}curl -sS -X POST "https://lock-apis-sandbox.crebitpay.com/api/v1/fx/contracts" \
-H "Content-Type: application/json" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: sandbox" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"quote_id":"22222222-2222-4222-8222-222222222222","partner_transaction_reference":"platform-tx-9901"}'Response Body, 201 Created
iduuidRequiredCrebit contract id. Use this in API calls, pass as fx_contract_id on inbound webhooks. NOT for showing humans (use crebit_contract_reference instead).
Example33333333-…crebit_contract_referencestringRequiredHuman-readable contract reference (format CREBIT-YYYYMMDD-XXXXXXXXXX), suitable for receipts, customer-facing emails, and support tickets. Don't use it as an API identifier — id is the canonical key.
ExampleCREBIT-20260524-7F3A9C2B1Dcontract_typestring (enum)RequiredProtection instrument from the originating quote (forward or option).
2 optionsdirectionstring (enum)RequiredFX corridor as FROM_TO_TO (e.g. USD_TO_BRL, MXN_TO_USD, NGN_TO_USD).
6 optionsnotional_currencystring (enum)RequiredCurrency of notional_amount / max_transaction_amount on this lock.
4 optionslocked_ratedecimal stringRequiredRate Crebit will honor if exercised.
Example5.42provider_rate_at_lockdecimal stringRequiredThe FX rate you provided at quote time.
Example5.42market_rate_at_lockdecimal stringRequiredThe market FX rate you provided at quote time.
Example5.4180premium_amountdecimal stringRequiredPremium / quoted fee due upfront, in settlement_currency.
Example1565.00deposit_amountdecimal string | nullOptionalRefundable deposit held until execution (forwards only). In settlement_currency.
Example5000.00total_amountdecimal stringRequiredThe total amount due to Crebit to activate the lock. Adds premium_amount and deposit_amount.
Example6565.00window_startdatetime (ISO-8601 UTC) | nullOptionalInherited from the quote.
Example2026-08-04T00:00:00Zwindow_enddatetime (ISO-8601 UTC) | nullOptionalInherited from the quote.
Example2026-08-11T00:00:00Zchainstring (enum)RequiredBlockchain Crebit settles on, same chain you fund on and same chain Crebit pays out on. Set at quote time; immutable for the life of the contract. Call GET /fx/supported-chains for live vs planned status.
4 optionssettlement_currencystring (enum)RequiredStablecoin Crebit and the partner settle in (margin token). Partner sends the upfront fee in this stablecoin to funding_wallet_address; Crebit pays out any FX delta in this stablecoin. USDC or USDT only. Also called margin token in the dashboard — your choice selects the live oracle pair (e.g. BRL/USDC vs BRL/USDT, NGN/USDT). Set at quote time; immutable on the contract.
2 optionsfunding_wallet_addressstringRequiredCrebit-controlled wallet address on `chain`. Send the deposit / premium here in `settlement_currency`. Poll GET …/status until `active` after funding is complete.
Example0xCrebitFundingWalletForThisContractpayout_wallet_addressstring | nullOptionalPartner-saved settlement destination (CA-745). Used for forward maturity force-exercise; contract_exercised may override at exercise time.
Example0xEndUserWalletForSettlementpayout_currencystring (enum) | nullOptionalSaved payout stablecoin when payout_wallet_address is set.
3 optionspayout_chainstring (enum) | nullOptionalSaved payout chain when payout_wallet_address is set.
4 optionsoraclestring (enum)RequiredSettlement price oracle copied from the originating quote.
5 optionssource_chainstring | nullOptionalFunding origin chain from the originating quote (Bridge Kit), when provided.
Examplebasecreated_atdatetime (ISO-8601 UTC)RequiredUTC timestamp the contract was created.
Example2026-05-24T16:20:00Zmax_transaction_amountdecimal stringRequiredThe maximum amount of money (in notional_currency) able to be processed.
Example50000.00settlement_rate_useddecimal string | nullOptionalOracle settlement rate used at exercise (including maturity force-exercise). Null until the contract is exercised/settled.
Example5.5100oracle_clamp_appliedboolean | nullOptionalWhether the conservative oracle clamp was applied at settlement. Null until exercised/settled.
Examplefalse
{
"id": "33333333-3333-4333-8333-333333333333",
"crebit_contract_reference": "CREBIT-20260524-7F3A9C2B1D",
"contract_type": "forward",
"direction": "USD_TO_BRL",
"notional_currency": "USD",
"locked_rate": "5.42",
"provider_rate_at_lock": "5.42",
"market_rate_at_lock": "5.4180",
"premium_amount": "1565.00",
"deposit_amount": "5000.00",
"total_amount": "6565.00",
"window_start": "2026-08-04T00:00:00Z",
"window_end": "2026-08-11T00:00:00Z",
"chain": "solana",
"settlement_currency": "USDC",
"funding_wallet_address": "CrebitSolanaFundingWalletForThisContract",
"payout_wallet_address": "EndUserSolanaWalletForSettlement",
"payout_currency": "USDC",
"payout_chain": "solana",
"oracle": "redstone",
"created_at": "2026-05-24T16:20:00Z",
"max_transaction_amount": "50000.00",
"partner_transaction_reference": "platform-tx-9901"
}Contract Lifecycle
Lifecycle is driven by webhooks and outbound events, not returned on POST /api/v1/fx/contracts. Typical states:
| status | Set by | What it means |
|---|---|---|
| quote_created | Crebit (on create) | Contract exists; awaiting funds at funding_wallet_address. |
| funds_in_route | Partner webhook (funds_in_route) | You've dispatched premium / deposit on-chain to funding_wallet_address. |
| active | Crebit (after funding complete) | Lock is live — poll GET …/status until status=active. No outbound funding webhook. |
| exercised | Partner webhook (contract_exercised) | Customer transacted. Crebit is computing & dispatching the payout. |
| settled | Crebit (after payout confirms) | Payout confirmed on-chain. Outbound contract_settled webhook fires. |
| expired | Crebit (window_end passed, options) | Customer did not transact within the window (options). Forwards may force-exercise at maturity instead. |
| failed | Crebit | Recoverable failure — retry via POST /fx/contracts/{id}/retry or resend funds_in_route webhook (validation/payment). Not terminal. |
| defaulted | Crebit | Forward obligation not met; deposit consumed. |
| deposit_forfeited | Crebit | Deposit forfeited after expiry without exercise. |
Poll / Payments / Deposits
Lightweight read APIs for status polling and funding audit. Poll routes return ETag — send If-None-Match to get 304 Not Modified when nothing changed.
fx_contract_iduuidRequiredContract UUID.
Example33333333-…crebit_contract_referencestringRequiredHuman-readable contract reference.
ExampleCREBIT-20260524-7F3A9C2B1DstatusstringRequiredCurrent lifecycle status.
9 optionspartner_transaction_referencestring | nullOptionalYour platform transaction id from contract creation.
Exampleplatform-tx-9901activated_atdatetime (ISO-8601 UTC) | nullOptionalWhen the lock became active (funding confirmed).
Example2026-05-24T16:35:08Zexercised_atdatetime (ISO-8601 UTC) | nullOptionalWhen contract_exercised was processed.
Examplenullsettled_atdatetime (ISO-8601 UTC) | nullOptionalWhen payout settled on-chain.
Examplenullexpired_atdatetime (ISO-8601 UTC) | nullOptionalWhen the lock window ended without exercise.
Examplenullfailed_atdatetime (ISO-8601 UTC) | nullOptionalWhen the contract entered a terminal failed state.
Examplenullfailure_reasonstring (enum) | nullOptionalMachine-readable failure category when status is failed. validation = business-rule rejection (e.g. exercise webhook); payment = funding leg failure; payout = settlement failure; system = internal error.
4 optionsupdated_atdatetime (ISO-8601 UTC)RequiredLast status change. Use with If-None-Match for polling.
Example2026-05-24T16:35:08Zsettlement_rate_useddecimal string | nullOptionalOracle settlement rate used at exercise (including maturity force-exercise). Null until exercised/settled. Same field as contract_settled / payout_success.
Examplenulloracle_clamp_appliedboolean | nullOptionalWhether the conservative oracle clamp was applied at settlement. Null until exercised/settled.
Examplenull
fx_contract_iduuidRequiredContract these legs belong to.
Example33333333-…contract_typestring (enum)Requiredforward or option.
2 optionspremium_amountdecimal stringRequiredQuoted premium from lock-in.
Example1565.00deposit_amountdecimal string | nullOptionalQuoted deposit (forwards only).
Example5000.00paymentsarray<object>RequiredPremium then deposit legs, ordered.
Show 12 nested fields
iduuidRequiredPayment leg id.
Example66666666-…fx_contract_iduuidRequiredParent contract.
Example33333333-…payment_typestring (enum)RequiredWhich funding leg.
2 optionsamountdecimal stringRequiredLeg amount in currency.
Example5000.00currencystringRequiredStablecoin of this leg.
ExampleUSDCchainstringRequiredBlockchain.
Exampleethereumstatusstring (enum)RequiredLeg lifecycle status.
4 optionswebhook_event_iduuid | nullOptionalInbound webhook that advanced this leg, if any.
Example44444444-…wallet_addressstring | nullOptionalSource wallet observed on-chain.
Example0xPartnerTreasury…transaction_hashstring | nullOptionalOn-chain tx hash when confirmed.
Example0xabc123…created_atdatetime (ISO-8601 UTC)RequiredWhen the expected leg was created at lock-in.
Example2026-05-24T16:20:00Zconfirmed_atdatetime (ISO-8601 UTC) | nullOptionalWhen Crebit confirmed this leg on-chain.
Example2026-05-24T16:35:08Z
fx_contract_iduuidRequiredContract these movements belong to.
Example33333333-…contract_typestring (enum)Requiredforward or option (options return an empty movements list).
2 optionsdeposit_amountdecimal string | nullOptionalQuoted deposit at lock-in.
Example5000.00movementsarray<object>RequiredDeposit history, oldest first.
Show 11 nested fields
iduuidRequiredMovement id.
Example88888888-…fx_contract_iduuidRequiredParent contract.
Example33333333-…movement_typestring (enum)RequiredWhat happened to deposit collateral.
3 optionsamountdecimal stringRequiredMovement amount.
Example5000.00currencystringRequiredStablecoin.
ExampleUSDCsourcestring (enum)RequiredWhat triggered this movement.
5 optionsreasonstring | nullOptionalOptional operator note.
Examplenullcontract_payment_iduuid | nullOptionalRelated payment leg, if any.
Example77777777-…webhook_event_iduuid | nullOptionalRelated webhook event, if any.
Example44444444-…payout_iduuid | nullOptionalRelated payout, if any.
Examplenullrecorded_atdatetime (ISO-8601 UTC)RequiredWhen Crebit recorded the movement.
Example2026-05-24T16:35:08Z
fx_contract_iduuidRequiredContract these payouts belong to.
Example33333333-…payoutsarray<object>RequiredPayout rows, oldest first.
Show 13 nested fields
iduuidRequiredPayout row id.
Example99999999-…fx_contract_iduuidRequiredParent contract id.
Example33333333-…amountdecimal stringRequiredPayout amount in currency.
Example4500.00currencystringRequiredStablecoin paid out.
ExampleUSDCchainstring (enum)RequiredBlockchain Crebit settles on, same chain you fund on and same chain Crebit pays out on. Set at quote time; immutable for the life of the contract. Call GET /fx/supported-chains for live vs planned status.
4 optionsstatusstring (enum)RequiredPayout lifecycle status.
5 optionstransaction_hashstring | nullOptionalOn-chain tx hash when submitted or confirmed.
Example0xf3a1...e29cpayout_wallet_addressstringRequiredDestination wallet.
Example0xEndUserWallet…failure_reasonstring | nullOptionalSet when status=failed.
Examplenullcreated_atdatetime (ISO-8601 UTC)RequiredWhen the payout row was created.
Example2026-08-07T13:42:30Zsubmitted_atdatetime (ISO-8601 UTC) | nullOptionalWhen the payout was broadcast on-chain.
Example2026-08-07T13:42:45Zconfirmed_atdatetime (ISO-8601 UTC) | nullOptionalWhen the payout was confirmed on-chain.
Example2026-08-07T13:43:08Zfailed_atdatetime (ISO-8601 UTC) | nullOptionalWhen the payout failed terminally.
Examplenull
GET /api/v1/fx/contracts/{contract_id} returns the full contract body (same fields as create response).
{
"fx_contract_id": "33333333-3333-4333-8333-333333333333",
"crebit_contract_reference": "CREBIT-20260524-7F3A9C2B1D",
"status": "active",
"partner_transaction_reference": "platform-tx-9901",
"activated_at": "2026-05-24T16:35:08Z",
"exercised_at": null,
"settled_at": null,
"expired_at": null,
"failed_at": null,
"failure_reason": null,
"updated_at": "2026-05-24T16:35:08Z",
"settlement_rate_used": null,
"oracle_clamp_applied": null
}curl -sS -X GET "https://lock-apis-sandbox.crebitpay.com/api/v1/fx/contracts/by-reference/CREBIT-20260524-7F3A9C2B1D" \
-H "Content-Type: application/json" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: sandbox"{
"fx_contract_id": "33333333-3333-4333-8333-333333333333",
"contract_type": "forward",
"premium_amount": "1565.00",
"deposit_amount": "5000.00",
"payments": [
{
"id": "66666666-6666-4666-8666-666666666666",
"fx_contract_id": "33333333-3333-4333-8333-333333333333",
"payment_type": "premium",
"amount": "1565.00",
"currency": "USDC",
"chain": "solana",
"status": "confirmed",
"webhook_event_id": "44444444-4444-4444-8444-444444444444",
"wallet_address": "PartnerSolanaTreasury…",
"transaction_hash": "5Kq3abc123…",
"created_at": "2026-05-24T16:20:00Z",
"confirmed_at": "2026-05-24T16:35:08Z"
},
{
"id": "77777777-7777-4777-8777-777777777777",
"fx_contract_id": "33333333-3333-4333-8333-333333333333",
"payment_type": "deposit",
"amount": "5000.00",
"currency": "USDC",
"chain": "solana",
"status": "confirmed",
"webhook_event_id": "44444444-4444-4444-8444-444444444444",
"wallet_address": "PartnerSolanaTreasury…",
"transaction_hash": "5Kq3abc123…",
"created_at": "2026-05-24T16:20:00Z",
"confirmed_at": "2026-05-24T16:35:08Z"
}
]
}{
"fx_contract_id": "33333333-3333-4333-8333-333333333333",
"contract_type": "forward",
"deposit_amount": "5000.00",
"movements": [
{
"id": "88888888-8888-4888-8888-888888888888",
"fx_contract_id": "33333333-3333-4333-8333-333333333333",
"movement_type": "collected",
"amount": "5000.00",
"currency": "USDC",
"source": "deposit_payment",
"reason": null,
"contract_payment_id": "77777777-7777-4777-8777-777777777777",
"webhook_event_id": "44444444-4444-4444-8444-444444444444",
"payout_id": null,
"recorded_at": "2026-05-24T16:35:08Z"
}
]
}{
"fx_contract_id": "33333333-3333-4333-8333-333333333333",
"payouts": [
{
"id": "99999999-9999-4999-8999-999999999999",
"fx_contract_id": "33333333-3333-4333-8333-333333333333",
"amount": "4183.30",
"currency": "USDC",
"chain": "solana",
"status": "confirmed",
"transaction_hash": "4f3a1...e29c",
"payout_wallet_address": "EndUserSolanaWallet…",
"failure_reason": null,
"created_at": "2026-08-07T13:42:30Z",
"submitted_at": "2026-08-07T13:42:45Z",
"confirmed_at": "2026-08-07T13:43:08Z",
"failed_at": null
}
]
}Payout Destination
PUT /api/v1/fx/contracts/{contract_id}/payout-destination saves the customer's settlement wallet anytime before window_end. Required for forward maturity force-exercise when not set at quote/contract create. You may also pass optional payout fields on POST /api/v1/fx/contracts.
payout_wallet_addressstringRequiredSettlement destination wallet. Required for forward maturity force-exercise; may be set anytime before window_end.
Example0xEndUserWalletForSettlementpayout_currencystring (enum)OptionalDefaults to the quote settlement_currency when omitted.
3 optionspayout_chainstring (enum)OptionalDefaults to the quote chain when omitted.
4 options
{
"payout_wallet_address": "EndUserSolanaWalletForSettlement",
"payout_currency": "USDC",
"payout_chain": "solana"
}curl -sS -X PUT "https://lock-apis-sandbox.crebitpay.com/api/v1/fx/contracts/33333333-3333-4333-8333-333333333333/payout-destination" \
-H "Content-Type: application/json" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: sandbox" \
-d '{"payout_wallet_address":"EndUserSolanaWalletForSettlement","payout_currency":"USDC","payout_chain":"solana"}'Forward Maturity (CA-745 / CA-747)
For forward contracts at window_end: if a payout destination is saved, Crebit force-exercises at the oracle rate and settles. If no wallet is saved, the contract stays active — expiry does not forfeit the deposit. Set the wallet via PUT payout-destination before maturity. After the window closes, partner contract_exercised is rejected (execution_window_closed).
Settlement Preview
POST /api/v1/fx/contracts/{contract_id}/settlement-preview returns read-only payout math for a hypothetical live_execution_rate. Uses the same settlement engine as the contract_exercised inbound webhook — it does not trigger a payout. Call this before exercise to show the customer their expected FX delta.
contract_exercised via POST /api/v1/fx/webhooks/inbound.live_execution_ratedecimal stringRequiredLive mid-market FX rate at the moment the customer transacted (or will transact). Same field as contract_exercised inbound webhook.
Example5.51transaction_amountdecimal string | nullOptionalOptional partial notional exercised. Defaults to the contract max_transaction_amount when omitted.
Example50000.00payout_currencystring (enum) | nullOptionalOptional payout stablecoin override. Defaults to the contract settlement_currency.
2 options
fx_contract_iduuidRequiredContract this preview applies to.
Example33333333-…payout_amountdecimal stringRequiredStablecoin amount Crebit would pay out (or zero if unfavorable).
Example4500.00payout_currencystringRequiredStablecoin denomination of payout_amount.
ExampleUSDCis_favorablebooleanRequiredTrue when the customer benefits from exercising at live_execution_rate vs locked_rate (Crebit owes a payout).
Exampletruepartner_live_execution_ratedecimal stringRequiredEcho of live_execution_rate from the request.
Example5.51oracle_live_execution_ratedecimal string | nullOptionalIndependent oracle rate used for clamping, when applicable.
Example5.5080oracle_sourcestring | nullOptionalOracle feed identifier: redstone, binance, stable_coordinates, crebit_ngn or chainlink.
Exampleredstonesettlement_rate_useddecimal stringRequiredEffective rate used in the payout formula after any oracle clamp.
Example5.51oracle_clamp_appliedbooleanRequiredTrue when partner live_execution_rate was adjusted toward the oracle bound before computing payout.
ExamplefalseformulastringRequiredHuman-readable description of the settlement math applied.
Examplefx_delta = notional × (locked_rate - settlement_rate_used)calculation_versionstringRequiredSettlement engine version for audit and support.
Example2026.05.1
curl -sS -X POST "https://lock-apis-sandbox.crebitpay.com/api/v1/fx/contracts/33333333-3333-4333-8333-333333333333/settlement-preview" \
-H "Content-Type: application/json" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: sandbox" \
-d '{"live_execution_rate":"5.51"}'{
"fx_contract_id": "33333333-3333-4333-8333-333333333333",
"payout_amount": "4183.30",
"payout_currency": "USDC",
"is_favorable": false,
"partner_live_execution_rate": "5.51",
"oracle_live_execution_rate": "5.5080",
"oracle_source": "redstone",
"settlement_rate_used": "5.51",
"oracle_clamp_applied": false,
"formula": "max(0, deposit + (transaction_amount * (locked_rate - live_rate) / live_rate))",
"calculation_version": "2026.05.1"
}List All Contracts
GET /api/v1/fx/contracts returns paginated FX contracts for your partner account, newest first. Optional status and customer_reference_id filters match the customer-scoped locks list.
curl -sS -X GET "https://lock-apis-sandbox.crebitpay.com/api/v1/fx/contracts?status=active&limit=25" \
-H "Content-Type: application/json" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: sandbox"Retry a Failed Contract
When a contract is failed with reason validation or payment, call POST /api/v1/fx/contracts/{contract_id}/retry to resume the lifecycle on the same contract (premium legs already confirmed are preserved). Alternatively, send a new funds_in_route inbound webhook with a fresh Idempotency-Key — Crebit auto-recovers then processes the payment. Use a new quote + contract only when recovery is not possible (execution window closed, system failure, exhausted payout retries).
curl -sS -X POST "https://lock-apis-sandbox.crebitpay.com/api/v1/fx/contracts/00000000-0000-4000-8000-000000000001/retry" \
-H "Content-Type: application/json" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: sandbox" \
-d '{}'List Customer Locks
GET /api/v1/fx/customers/{customer_reference_id}/locks returns paginated FX contracts (locks) for your opaque customer_reference_id, newest first. Use optional status to filter by lifecycle state.
customer_reference_idstringRequiredPath parameter. Your opaque customer id from quote/contract creation.
Examplepartner-cust-ref-2026-0042statusstring (enum)OptionalOptional filter. Return only locks in this lifecycle status.
9 optionslimitintegerOptionalPage size (1–100). Default 25.
Example25cursorstringOptionalOpaque pagination cursor from a previous response's next_cursor.
ExampleeyJpZCI6IjMzMz…
itemsarray<object>RequiredFX locks (contracts) for this customer, newest first.
Show 24 nested fields
iduuidRequiredCrebit contract id. Pass as fx_contract_id on inbound webhooks.
Example33333333-…crebit_contract_referencestringRequiredHuman-readable contract reference for receipts and support.
ExampleCREBIT-20260524-7F3A9C2B1Dcontract_typestring (enum)Requiredforward or option from the originating quote.
2 optionsdirectionstring (enum)RequiredFX corridor as FROM_TO_TO (e.g. USD_TO_BRL, MXN_TO_USD, NGN_TO_USD).
6 optionsnotional_currencystring (enum)RequiredCurrency of max_transaction_amount on this lock.
4 optionslocked_ratedecimal stringRequiredRate Crebit will honor if exercised.
Example5.42provider_rate_at_lockdecimal stringRequiredThe FX rate you provided at quote time.
Example5.42market_rate_at_lockdecimal stringRequiredThe market FX rate you provided at quote time.
Example5.4180premium_amountdecimal stringRequiredPremium / quoted fee due upfront, in settlement_currency.
Example1565.00deposit_amountdecimal string | nullOptionalRefundable deposit held until execution (forwards only). In settlement_currency.
Example5000.00total_amountdecimal stringRequiredTotal amount due to Crebit to activate the lock.
Example6565.00window_startdatetime (ISO-8601 UTC) | nullOptionalFirst moment the customer may execute the locked rate.
Example2026-08-04T00:00:00Zwindow_enddatetime (ISO-8601 UTC) | nullOptionalLast moment the customer may execute the locked rate.
Example2026-08-11T00:00:00Zchainstring (enum)RequiredBlockchain Crebit settles on, same chain you fund on and same chain Crebit pays out on. Set at quote time; immutable for the life of the contract. Call GET /fx/supported-chains for live vs planned status.
4 optionssettlement_currencystring (enum)RequiredStablecoin Crebit and the partner settle in (margin token). Partner sends the upfront fee in this stablecoin to funding_wallet_address; Crebit pays out any FX delta in this stablecoin. USDC or USDT only. Also called margin token in the dashboard — your choice selects the live oracle pair (e.g. BRL/USDC vs BRL/USDT, NGN/USDT). Set at quote time; immutable on the contract.
2 optionsfunding_wallet_addressstringRequiredSend premium and deposit here in settlement_currency on chain.
Example0xCrebitFundingWalletForThisContractcreated_atdatetime (ISO-8601 UTC)RequiredUTC timestamp the contract was created.
Example2026-05-24T16:20:00Zmax_transaction_amountdecimal stringRequiredMaximum notional amount processable under this lock.
Example50000.00statusstring (enum)RequiredCurrent lifecycle status of the lock.
9 optionsquote_iduuidRequiredQuote this lock was created from.
Example22222222-…customer_reference_idstringRequiredYour opaque customer id (same value you sent at quote time).
Examplepartner-cust-ref-2026-0042partner_transaction_referencestring | nullOptionalYour platform transaction id, echoed from the contract.
Exampleplatform-tx-9901settlement_rate_useddecimal string | nullOptionalOracle settlement rate used at exercise (including maturity force-exercise). Null until exercised/settled.
Example5.5100oracle_clamp_appliedboolean | nullOptionalWhether the conservative oracle clamp was applied at settlement. Null until exercised/settled.
Examplefalse
next_cursorstring | nullOptionalPass as cursor on the next page. null when there are no more results.
Examplenull
curl -sS -X GET "https://lock-apis-sandbox.crebitpay.com/api/v1/fx/customers/partner-cust-ref-2026-0042/locks?status=active&limit=25" \
-H "Content-Type: application/json" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: sandbox"{
"items": [
{
"id": "33333333-3333-4333-8333-333333333333",
"crebit_contract_reference": "CREBIT-20260524-7F3A9C2B1D",
"contract_type": "forward",
"direction": "USD_TO_BRL",
"notional_currency": "USD",
"locked_rate": "5.42",
"provider_rate_at_lock": "5.42",
"market_rate_at_lock": "5.4180",
"premium_amount": "1565.00",
"deposit_amount": "5000.00",
"total_amount": "6565.00",
"window_start": "2026-08-04T00:00:00Z",
"window_end": "2026-08-11T00:00:00Z",
"chain": "solana",
"settlement_currency": "USDC",
"funding_wallet_address": "CrebitSolanaFundingWalletForThisContract",
"created_at": "2026-05-24T16:20:00Z",
"max_transaction_amount": "50000.00",
"status": "active",
"quote_id": "22222222-2222-4222-8222-222222222222",
"customer_reference_id": "partner-cust-ref-2026-0042",
"partner_transaction_reference": "platform-tx-9901"
}
],
"next_cursor": null
}Fiat Spot & Deliverable Forwards
In addition to crypto rate locks, Crebit provides programmatic API-key access for BRL↔USD Fiat Spot conversions and Deliverable Forwards (DF) under /api/v1/fiat/.... Payouts and pay-ins are executed across local bank rails (PIX in Brazil; ACH, wire, and SWIFT in the US) through your dedicated virtual accounts.
/api/v1/fiat/spot/...) is a physical currency exchange product between BRL and USD executed via banking rails (PIX, ACH, wire, SWIFT). This is distinct from crypto rate-lock quotes with strike_mode="live_spot" under /api/v1/fx/quotes, which lock a live TWAP exchange rate for hedging on-chain crypto/stablecoin payments.Overview & Authentication
Fiat endpoints authenticate with the exact same three headers as all other partner API routes:
X-Crebit-Key-Id: Your partner key ID (cbk_sbx_...orcbk_live_...)X-Crebit-Key-Secret: Your API secretX-Crebit-Environment:sandboxorproduction
product_mode set to fiat or both (Crebit enables this in admin).GET /api/v1/fiat/profile still returns 200 when fiat is off — check spot_trading_enabled / product_mode. Quote, order, and other trading writes return 403 Forbidden with code fiat_spot_not_enabled.Profile & Bank Accounts
Check your fiat readiness flags and supported rails via GET /api/v1/fiat/profile. Payout banks are shared by Spot and Deliverable Forward — list existing ones with GET /api/v1/fiat/bank-accounts, then create new ones with POST /api/v1/fiat/bank-accounts (rails pix, ach, wire, swift / international_swift, and sepa for Spot USD→EUR).
partner_iduuidRequiredPartner ID.
Example00000000-0000-4000-8000-000000000001product_modestringRequiredConfigured partner product mode: fiat, crypto_lock, or both.
Examplebothvirtual_account_statusstring | nullOptionalUSD virtual account onboarding status (approved, pending, etc.).
Exampleapprovedusd_virtual_account_readybooleanRequiredTrue when the partner USD virtual account is ready for funding pay-ins.
Exampletruespot_trading_enabledbooleanRequiredTrue when fiat trading is enabled for this partner.
Exampletruesupported_directionsarray<string>RequiredAllowed trading directions for fiat operations.
Example["BRL_TO_USD", "USD_TO_BRL"]
bank_accountsarray<object>RequiredPayout bank accounts for this partner customer (shared by Spot and DF).
Show 8 nested fields
idstringRequiredPayout bank account id (ba_…). Pass as payout_destination.bank_account_id on Spot/DF orders.
Exampleba_pix_01namestring | nullOptionalDisplay name from create.
ExampleTreasury PIXtypestring | nullOptionalRail type: pix, ach, wire, swift, sepa, etc.
Examplepixcurrencystring | nullOptionalAccount currency when known (BRL, USD, EUR).
ExampleBRLlast4string | nullOptionalLast four of account / key when available.
Example8900labelstringRequiredUI-friendly label (name + masked last4).
ExampleTreasury PIX ••••8900recipient_relationshipstring | nullOptionalSWIFT originator–recipient relationship when set.
Examplevendor_or_supplierhas_swift_documentbooleanRequiredTrue when a SWIFT relationship document is stored for this ba_….
Examplefalse
typestring (enum)RequiredPayout rail. pix for USD→BRL; ach/wire for US USD; swift (or international_swift) for international SWIFT; sepa for Spot USD→EUR.
6 optionsnamestringRequiredDisplay label for this bank account.
ExampleTreasury PIXpix_keystring | nullOptionalRequired when type=pix. PIX key (CPF/CNPJ, email, phone, or EVP).
Example12345678900beneficiary_namestring | nullOptionalRequired for ACH/wire. Legal name on the USD bank account.
ExampleAcme Treasury LLCrouting_numberstring | nullOptional9-digit ABA routing transit number for US ACH / wire.
Example021000021account_numberstring | nullOptionalBank account number for ACH / wire.
Example1234567890account_typestring (enum)OptionalRequired for ACH/wire.
2 optionsaccount_classstring (enum)OptionalRequired for ACH/wire/SWIFT/SEPA.
2 optionsaddress_line_1string | nullOptionalBeneficiary street address (ACH/wire).
Example1 Market Stcitystring | nullOptionalBeneficiary city (ACH/wire).
ExampleSan Franciscostate_province_regionstring | nullOptionalBeneficiary state/region (ACH/wire).
ExampleCAcountrystring | nullOptionalBeneficiary country code (ACH/wire), e.g. US.
ExampleUSpostal_codestring | nullOptionalBeneficiary postal code (ACH/wire).
Example94105recipient_relationshipstring (enum)OptionalRequired for SWIFT. first_party needs no supporting file; other values require transaction_document_file (at create or via PUT …/swift-document).
10 optionsswift_code_bicstring | nullOptionalRequired for SWIFT. Beneficiary bank BIC.
ExampleCHASUS33swift_account_holder_namestring | nullOptionalRequired for SWIFT. Account holder legal name.
ExampleAcme International Ltdswift_account_number_ibanstring | nullOptionalRequired for SWIFT. Account number or IBAN.
ExampleGB29NWBK60161331926819transaction_document_typestring (enum)OptionalSWIFT relationship document type when not first_party.
8 optionstransaction_document_filestring | nullOptionalPDF / JPEG / PNG data-URL or HTTPS URL. Required for SWIFT when recipient_relationship is not first_party.
Examplehttps://example.com/invoice.pdfsepa_ibanstring | nullOptionalRequired when type=sepa (Spot USD→EUR).
ExampleDE89370400440532013000sepa_beneficiary_bicstring | nullOptionalRequired when type=sepa.
ExampleCOBADEFFXXXsepa_beneficiary_legal_namestring | nullOptionalRequired when type=sepa.
ExampleAcme Europe GmbH
{
"partner_id": "00000000-0000-4000-8000-000000000001",
"product_mode": "both",
"spot_trading_enabled": true,
"forward_trading_enabled": true,
"virtual_account_id": "va_000000000001",
"virtual_account_status": "approved",
"usd_virtual_account_ready": true,
"virtual_account_credentials": {
"ach": {
"routing_number": "021000021",
"account_number": "1234567890"
},
"wire": {
"routing_number": "021000021",
"account_number": "1234567890"
},
"swift": {
"swift_code": "CHASUS33",
"account_number": "1234567890"
}
},
"supported_directions": [
"BRL_TO_USD",
"USD_TO_BRL",
"BRL_TO_EUR"
],
"usd_receive_methods": [
"ach",
"wire",
"swift"
],
"supported_products": [
"spot",
"deliverable_forward"
],
"gbp_offramp_enabled": false,
"enabled_settlement_chains": [
"solana",
"tron"
]
}{
"bank_accounts": [
{
"id": "ba_pix_01",
"name": "Treasury PIX",
"type": "pix",
"currency": "BRL",
"last4": "8900",
"label": "Treasury PIX ••••8900",
"recipient_relationship": null,
"has_swift_document": false
},
{
"id": "ba_ach_01",
"name": "US Treasury ACH",
"type": "ach",
"currency": "USD",
"last4": "7890",
"label": "US Treasury ACH ••••7890",
"recipient_relationship": null,
"has_swift_document": false
},
{
"id": "ba_swift_01",
"name": "Vendor SWIFT",
"type": "swift",
"currency": "USD",
"last4": "6819",
"label": "Vendor SWIFT ••••6819",
"recipient_relationship": "vendor_or_supplier",
"has_swift_document": true
}
]
}USD→BRL payout destination
{
"type": "pix",
"name": "Treasury PIX",
"pix_key": "12345678900"
}{
"id": "ba_pix_01",
"name": "Treasury PIX",
"type": "pix",
"currency": "BRL",
"last4": "8900",
"label": "Treasury PIX ••••8900",
"recipient_relationship": null,
"has_swift_document": false
}SWIFT Relationship Documents
Third-party SWIFT payouts need an originator–recipient supporting file. Attach it when creating the bank (recipient_relationship + transaction_document_* on POST /api/v1/fiat/bank-accounts), or later via:
PUT /api/v1/fiat/bank-accounts/{bank_account_id}/swift-document— attach or replace the file on an existingba_…POST /api/v1/fiat/spot/orders/{order_id}/compliance-documentsand the DF equivalent — order-level retry if the payout still needs documents
recipient_relationship=first_party does not require a supporting file. Files must be PDF, JPEG, or PNG (HTTPS URL or data-URL).transaction_document_typestring (enum)RequiredOriginator–recipient supporting document type.
7 optionstransaction_document_idstring | nullOptionalOptional partner document reference id (max 128 chars).
ExampleINV-2026-0042transaction_document_filestringRequiredPDF / JPEG / PNG data-URL or HTTPS URL.
Examplehttps://example.com/invoice.pdf
{
"transaction_document_type": "invoice",
"transaction_document_id": "INV-2026-0042",
"transaction_document_file": "https://example.com/invoice.pdf"
}Payout Bank Rails
Spot and Deliverable Forward orders both require payout_destination.bank_account_id (ba_…). Register the bank first with POST /api/v1/fiat/bank-accounts. Inline PIX fields are not accepted on order create.
| Direction | usd_receive_method | Required payout bank type |
|---|---|---|
| USD→BRL | VA pay-in rail (ach / wire / swift) | pix |
| BRL→USD | USD payout rail (must match bank type) | ach, wire, or swift |
| USD→EUR (Spot only) | VA pay-in rail | sepa |
400 with fiat_payout_bank_rail_mismatch (see expected_bank_type or usd_receive_method in details). Missing / non-ba_… ids return fiat_payout_bank_account_required; unknown ids return fiat_payout_bank_account_not_found.Fiat Spot Flow
The Spot flow allows immediate conversion between BRL and USD (and Spot USD→EUR):
- 1. Preview Rate: Call
POST /api/v1/fiat/spot/quote-previewto fetch the current live corridor rate. - 2. Lock Spot Quote: Call
POST /api/v1/fiat/spot/quoteswith your chosen amount andusd_receive_method(ach,wire, orswift) to lock the rate, cover fee, and total pay-in amount for about 10 minutes (quote_expires_at). - 3. Create Order: Call
POST /api/v1/fiat/spot/orderswithamount/amount_side, rail, and a matchingba_…payout bank. The server re-prices live FX (do not sendlocked_rate). Returns deposit payment instructions (PIX string or US VA details) and a customer payment link (share_url). - 4. Download Receipt: Once settled, fetch a certified PDF receipt via
GET /api/v1/fiat/spot/orders/{order_id}/receipt.
- Customer Reference: The
customer_reference_idmust be an opaque identifier registered first viaPOST /api/v1/fx/customer-references. Unregistered customer IDs return404. - Payout Destination: Always pass
payout_destination.bank_account_id. See Payout bank rails for direction rules.
directionstring (enum)RequiredCorridor direction.
3 optionsamountdecimal stringRequiredFixed payin or payout amount.
Example1000.00amount_sidestring (enum)OptionalWhether amount specifies payin or payout. Default payin.
2 optionsusd_receive_methodstring (enum)RequiredACH, wire, or SWIFT — payout rail for BRL→USD; VA pay-in rail for USD→BRL / USD→EUR.
3 options
{
"direction": "USD_TO_BRL",
"amount": "1000.00",
"amount_side": "payin",
"usd_receive_method": "ach"
}{
"direction": "USD_TO_BRL",
"payin_amount": "1000.00",
"payin_currency": "USD",
"payout_amount": "5420.00",
"payout_currency": "BRL",
"locked_rate": "5.4200",
"market_rate": "5.4200",
"spread_bps": 30,
"quote_expires_at": "2026-09-08T12:15:00Z",
"usd_receive_method": "ach",
"cover_fee_usd": "0.50",
"cover_fee_payin_amount": "0.50",
"cover_fee_payin_currency": "USD",
"total_payin_amount": "1000.50"
}directionstring (enum)RequiredCorridor direction.
3 optionsamountdecimal stringRequiredFixed payin or payout amount (see amount_side). Server re-prices live FX — do not send locked_rate.
Example1000.00amount_sidestring (enum)OptionalWhether amount is the pay-in or payout leg. Default payin.
2 optionsusd_receive_methodstring (enum)RequiredACH, wire, or SWIFT — payout rail for BRL→USD; VA pay-in rail for USD→BRL / USD→EUR.
3 optionscustomer_reference_idstringRequiredPartner customer reference identifier (register first).
Examplepartner-cust-2026-001payout_destinationobjectRequiredPayout bank: { bank_account_id: "ba_…" }. USD→BRL requires a PIX ba_…; BRL→USD requires a bank whose type matches usd_receive_method; USD→EUR requires SEPA. Create banks via POST /api/v1/fiat/bank-accounts.
Example{ "bank_account_id": "ba_pix_01" }
{
"direction": "USD_TO_BRL",
"amount": "1000.00",
"amount_side": "payin",
"usd_receive_method": "ach",
"customer_reference_id": "partner-cust-2026-001",
"payout_destination": {
"bank_account_id": "ba_pix_01"
}
}{
"id": "44444444-4444-4444-8444-444444444444",
"direction": "USD_TO_BRL",
"status": "awaiting_payin",
"payer_role": "self",
"customer_reference_id": "partner-cust-2026-001",
"payin_amount": "1000.00",
"payin_currency": "USD",
"payout_amount": "5420.00",
"payout_currency": "BRL",
"locked_rate": "5.4200",
"usd_receive_method": "ach",
"share_token": "share_spot_abc123",
"share_url": "https://lock-apis.crebitpay.com/api/v1/fiat/pay/share_spot_abc123",
"payment_instructions": [
{
"id": "55555555-5555-4555-8555-555555555555",
"instruction_kind": "ach",
"rail": "ach",
"credentials": {
"routing_number": "021000021",
"account_number": "1234567890"
},
"display_text": "Send USD via ACH to Chase routing 021000021 account 1234567890",
"expires_at": "2026-09-08T14:15:00Z"
}
],
"created_at": "2026-09-08T12:00:00Z",
"updated_at": "2026-09-08T12:00:00Z"
}Deliverable Forwards
Deliverable Forwards lock a future BRL↔USD conversion. The server normalizes the execution window to exactly 24 hours from execution_window_start (a longer client execution_window_end is ignored). Locked DF quotes expire in about 4–5 minutes (quote_expires_at).
- 1. Quote Forward: Optionally call
POST /api/v1/fiat/forward/quote-preview(amount + window only — nousd_receive_method), thenPOST /api/v1/fiat/forward/quoteswithexecution_window_start,execution_window_end, andusd_receive_method. The response specifies the upfront premium, deposit, and locked forward rate. - 2. Book Order: Call
POST /api/v1/fiat/forward/orderswith the sameba_…payout rules as Spot. Payer funds the upfront deposit + premium leg. - 3. Execute: During the execution window, call
POST /api/v1/fiat/forward/orders/{order_id}/executeto open the remaining notional payment instructions. - 4. Payout: Payout is automatically triggered or confirmed via
POST /api/v1/fiat/forward/orders/{order_id}/confirm-payout, delivering the full guaranteed amount. Confirm-payout re-checks the payout bank rail for the order direction.
directionstring (enum)RequiredCorridor direction.
2 optionsamountdecimal stringRequiredNotional amount for the deliverable forward.
Example10000.00amount_sidestring (enum)OptionalWhether amount specifies payin or payout. Default payin.
2 optionsexecution_window_startdatetime (ISO-8601 UTC)RequiredExecution window start datetime.
Example2026-10-01T00:00:00Zexecution_window_enddatetime (ISO-8601 UTC)RequiredExecution window close. Server forces end = start + 24h (longer client values are ignored).
Example2026-10-02T00:00:00Zusd_receive_methodstring (enum)RequiredACH, wire, or SWIFT — payout rail for BRL→USD; VA pay-in rail for USD→BRL.
3 options
{
"direction": "USD_TO_BRL",
"amount": "10000.00",
"amount_side": "payin",
"execution_window_start": "2026-10-01T00:00:00Z",
"execution_window_end": "2026-10-02T00:00:00Z",
"usd_receive_method": "ach"
}{
"direction": "USD_TO_BRL",
"notional_amount": "10000.00",
"notional_currency": "USD",
"payin_currency": "USD",
"payout_currency": "BRL",
"locked_rate": "5.4500",
"market_rate": "5.4200",
"premium_amount": "200.00",
"deposit_amount": "1000.00",
"upfront_amount": "1200.00",
"remaining_notional": "9000.00",
"guaranteed_payout_amount": "54500.00",
"execution_window_start": "2026-10-01T00:00:00Z",
"execution_window_end": "2026-10-02T00:00:00Z",
"quote_expires_at": "2026-09-08T12:04:45Z",
"usd_receive_method": "ach"
}directionstring (enum)RequiredCorridor direction matching the accepted quote.
2 optionsamountdecimal stringRequiredNotional amount for the deliverable forward.
Example10000.00amount_sidestring (enum)OptionalWhether amount specifies payin or payout. Default payin.
2 optionsexecution_window_startdatetime (ISO-8601 UTC)RequiredExecution window start datetime.
Example2026-10-01T00:00:00Zexecution_window_enddatetime (ISO-8601 UTC)RequiredExecution window close. Server forces end = start + 24h (longer client values are ignored).
Example2026-10-02T00:00:00Zusd_receive_methodstring (enum)RequiredACH, wire, or SWIFT — payout rail for BRL→USD; VA pay-in rail for USD→BRL.
3 optionscustomer_reference_idstringRequiredPartner customer reference identifier (must be registered first).
Examplepartner-cust-2026-001payout_destinationobjectRequiredPayout bank: { bank_account_id: "ba_…" }. Same direction rules as Spot (PIX for USD→BRL; rail match for BRL→USD).
Example{ "bank_account_id": "ba_pix_01" }
{
"direction": "USD_TO_BRL",
"amount": "10000.00",
"amount_side": "payin",
"execution_window_start": "2026-10-01T00:00:00Z",
"execution_window_end": "2026-10-02T00:00:00Z",
"usd_receive_method": "ach",
"customer_reference_id": "partner-cust-2026-001",
"payout_destination": {
"bank_account_id": "ba_pix_01"
}
}{
"id": "66666666-6666-4666-8666-666666666666",
"direction": "USD_TO_BRL",
"status": "awaiting_upfront",
"payer_role": "self",
"customer_reference_id": "partner-cust-2026-001",
"notional_amount": "10000.00",
"notional_currency": "USD",
"payin_currency": "USD",
"payout_currency": "BRL",
"locked_rate": "5.4500",
"market_rate": "5.4200",
"premium_amount": "200.00",
"deposit_amount": "1000.00",
"upfront_amount": "1200.00",
"remaining_notional": "9000.00",
"guaranteed_payout_amount": "54500.00",
"execution_window_start": "2026-10-01T00:00:00Z",
"execution_window_end": "2026-10-02T00:00:00Z",
"upfront_share_token": "df_upfront_xyz789",
"upfront_share_url": "https://lock-apis.crebitpay.com/api/v1/fiat/pay/df_upfront_xyz789",
"created_at": "2026-09-08T12:00:00Z",
"updated_at": "2026-09-08T12:00:00Z"
}Idempotency & Retries
All fiat write endpoints accept an optional Idempotency-Key header. If a network timeout occurs, re-sending the same request with the same header and payload safely replays the original response:
POST /api/v1/fiat/bank-accountsPOST /api/v1/fiat/spot/quotesPOST /api/v1/fiat/spot/ordersPOST /api/v1/fiat/forward/quotesPOST /api/v1/fiat/forward/ordersPOST /api/v1/fiat/forward/orders/{order_id}/executePOST /api/v1/fiat/forward/orders/{order_id}/confirm-payout
Webhooks (In + Out)
Contract lifecycle and BRL→USDC collection events. Same envelope shape on both sides: event_type at the top discriminates which schema applies. Contract activation after funding is visible via polling — Crebit does not emit a funding confirmation outbound webhook.
| Direction | event_type | Who calls who | Trigger |
|---|---|---|---|
| Inbound | funds_in_route | Partner → Crebit | Partner announces an on-chain deposit/premium dispatch. |
| Inbound | contract_exercised | Partner → Crebit | Customer transacted within the lock window, Crebit pays out the FX delta. |
| Outbound | payout_success | Crebit → Partner | On-chain payout to customer confirmed. |
| Outbound | contract_settled | Crebit → Partner | Contract moved exercised → settled (usually follows payout_success). |
| Outbound | payout_failed | Crebit → Partner | Payout could not complete (inspect retry_planned). |
| Outbound | contract_expired | Crebit → Partner | Option expired without exercise. Forwards may force-exercise at maturity instead. |
| Outbound | fiat_collection_settled | Crebit → Partner | BRL→USDC collection newly settled (USDC on Base). |
| Outbound | fiat_collection_failed | Crebit → Partner | BRL→USDC collection newly failed. |
Inbound, Partner → Crebit
Single endpoint, single envelope: POST /api/v1/fx/webhooks/inbound. The first field is always event_type, Crebit uses it to pick the right schema. POST /api/v1/fx/webhooks/inbound requires Idempotency-Key (8–128 ASCII printable chars). Recommended on quote and contract POSTs.
Notify Crebit you've dispatched the deposit on-chain to funding_wallet_address. Optional but recommended, Crebit can pre-stage processing.
{
"event_type": "funds_in_route",
"fx_contract_id": "33333333-3333-4333-8333-333333333333",
"payment_type": "deposit",
"amount": "5000.00",
"currency": "USDC",
"chain": "solana",
"transaction_hash": "5Kq3abc123…",
"source_wallet_address": "PartnerSolanaTreasury…"
}funds_in_route, Schema
Notify Crebit that premium or deposit is on the way (or already on-chain). Crebit advances the contract from quote_created → funds_in_route, then to active once funding is complete. Poll GET …/status until status=active. When chain=solana and payment_type and transaction_hash are all set, Crebit verifies the funding transaction on-chain.
funds_in_routethe moment you've initiated the on-chain transfer (or queued the onramp that will produce it), NOT just because the customer has clicked "accept". Pre-firing puts Crebit's lock state out of sync with the on-chain reality and will trigger reconciliation alerts on our side. Accurate reporting keeps the hedge tight.event_typestring (const)RequiredDiscriminator. Must be the literal string funds_in_route.
1 optionfx_contract_iduuidRequiredContract id returned by POST /api/v1/fx/contracts.
Example33333333-…payment_typestring (enum)OptionalWhich leg you're funding. If you send any payment detail, you must send payment_type, amount, currency, and chain together (all four or none).
2 optionsamountdecimal stringOptionalAmount dispatched on-chain to funding_wallet_address. Required together with payment_type, currency, and chain.
Example5000.00currencystring (enum)OptionalStablecoin you sent. Required together with payment_type, amount, and chain. Must match the contract's settlement_currency (USDC or USDT) unless you use BRLA on a BRL corridor.
3 optionschainstring (enum)OptionalChain you sent on. Required together with payment_type, amount, and currency. Must match the contract's chain.
4 optionstransaction_hashstringOptionalOn-chain tx hash. When chain=solana and payment_type are also set, Crebit verifies the funding transaction on-chain before accepting.
Example0xabc123…source_wallet_addressstringOptionalWallet the funds were sent from.
Example0xPartnerTreasury…
contract_exercised, Schema (Triggers Payout)
locked_rate from the contract, compares against live_execution_rate, converts the delta to settlement_currency, and transfers it to payout_wallet_address on chain. Send the same chain and payout_currencyas the contract's locked rail. Fire the webhook while the lock window is open — Crebit checks receipt time (server clock), not executed_at. Rejections return 400 INVALID_ARGUMENT.event_typestring (const)RequiredDiscriminator. Must be the literal string contract_exercised. THIS IS THE CALL THAT TRIGGERS CREBIT TO PAY OUT.
1 optionfx_contract_iduuidRequiredContract the customer just transacted against.
Example33333333-…executed_atdatetime (ISO-8601 UTC)RequiredUTC timestamp of the customer's underlying transaction (audit / support). Crebit validates the lock window using webhook receipt time (server clock), not this field. Poll response exercised_at is stamped when Crebit processes the webhook.
Example2026-08-07T13:42:00Zlive_execution_ratedecimal stringRequiredLive mid-market FX rate the moment the customer transacted. Crebit compares against locked_rate to compute the FX delta.
Example5.51transaction_amountdecimal stringOptionalPartner-reported base-currency amount executed. Defaults to the contract notional when omitted.
Example50000.00payout_wallet_addressstringOptionalOn-chain destination for the FX delta payout. Optional when a payout destination is already saved on the contract (via create or PUT .../payout-destination).
Example0xEndUserWallet…payout_currencystring (enum)RequiredStablecoin Crebit pays out in (USDC, USDT, or BRLA). Must match the contract's settlement_currency. Tron payouts require USDT.
3 optionschainstring (enum)RequiredBlockchain Crebit pays out on. Send the same chain locked at quote time.
4 options
How to Call (Either Variant)
curl -sS -X POST "https://lock-apis-sandbox.crebitpay.com/api/v1/fx/webhooks/inbound" \
-H "Content-Type: application/json" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: sandbox" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"event_type":"contract_exercised","fx_contract_id":"33333333-3333-4333-8333-333333333333","executed_at":"2026-08-07T13:42:00Z","live_execution_rate":"5.51","payout_wallet_address":"EndUserSolanaWallet…","payout_currency":"USDC","chain":"solana"}'Inbound ACK Response, 200 OK
webhook_event_iduuidRequiredCrebit's id for the event. Echo in support tickets.
Example44444444-…statusstring (enum)Requiredreceived = accepted, async work pending. processed = handled. failed = business rule rejected the payload. retrying = outbound delivery in progress. Idempotent replays echo the stored status.
4 options
{
"webhook_event_id": "44444444-4444-4444-8444-444444444444",
"status": "processed"
}Outbound, Crebit → Partner
Crebit POSTs JSON to the webhook_url you configured during onboarding (one URL per environment). The first field is again event_type, switch on it. Every outbound event also has a top-level subjectthat says whether it is about your own account or one of your organization's members (see Who is this event for?).
GET /api/v1/fx/webhook-events?direction=outgoing to learn payout state on demand.On-chain payout confirmed. Arrives when the FX delta transfer is confirmed on-chain.
{
"event_type": "payout_success",
"fx_contract_id": "33333333-3333-4333-8333-333333333333",
"payout_id": "99999999-9999-4999-8999-999999999999",
"amount": "4183.30",
"currency": "USDC",
"chain": "solana",
"transaction_hash": "4f3a1...e29c",
"status": "confirmed",
"timestamp": "2026-08-07T13:43:08Z",
"crebit_contract_reference": "CREBIT-20260524-7F3A9C2B1D",
"partner_transaction_reference": "platform-tx-9901",
"payout_wallet_address": "EndUserSolanaWallet…",
"transaction_explorer_url": "https://solscan.io/tx/4f3a1...e29c",
"settlement_rate_used": "5.5100",
"oracle_clamp_applied": false,
"subject": {
"relationship": "self",
"partner_id": "11111111-1111-4111-8111-111111111111",
"partner_name": "Acme FX (sandbox)",
"organisation_id": null,
"organisation_name": null
}
}payout_success, Schema
Delivered when the on-chain FX delta payout is confirmed. Includes transaction_hash and optional transaction_explorer_url.
event_typestring (const)RequiredAlways the literal string payout_success.
1 optionfx_contract_iduuidRequiredContract whose payout was confirmed.
Example33333333-…payout_iduuidRequiredCrebit payout row id.
Example99999999-…amountdecimal stringRequiredFX delta amount paid out.
Example4500.00currencystring (enum)RequiredStablecoin Crebit paid out.
3 optionschainstring (enum)RequiredBlockchain where the payout was sent.
4 optionstransaction_hashstringRequiredOn-chain transaction hash for the payout transfer.
Example0xf3a1...e29cstatusstring (const)RequiredAlways confirmed on this event.
1 optiontimestampdatetime (ISO-8601 UTC)RequiredUTC timestamp when the payout was confirmed on-chain.
Example2026-08-07T13:43:08Zcrebit_contract_referencestringRequiredHuman-readable contract reference.
ExampleCREBIT-20260524-7F3A9C2B1Dpartner_transaction_referencestring | nullOptionalEchoed from the contract, your reconciliation id.
Exampleplatform-tx-9901payout_wallet_addressstringRequiredWallet that received the payout.
Example0xEndUserWallet…transaction_explorer_urlstring | nullOptionalBlock explorer URL for the payout transaction (e.g. Solana).
Examplehttps://etherscan.io/tx/0xf3a1...e29csettlement_rate_useddecimal stringOptionalOracle settlement rate used at exercise (including maturity force-exercise). Present when a payout settlement audit trace exists.
Example5.5100oracle_clamp_appliedbooleanOptionalWhether the conservative oracle clamp was applied at settlement.
ExamplefalsesubjectobjectRequiredWho the event is for. Part of the signed body; use it (not the delivery headers) to decide whether the event is yours or a member's.
Show 5 nested fields
relationshipstring (enum)Requiredself = the event is about your own partner account. organisation_member = a copy of an event that belongs to one of your organization's member partners.
2 optionspartner_iduuidRequiredPartner the event belongs to: your own partner id for self, the member's partner id for organisation_member.
Example11111111-…partner_namestringRequiredDisplay name of that partner.
ExampleAcme FX (sandbox)organisation_iduuid | nullRequiredOrganization the member belongs to. null for self.
Examplenullorganisation_namestring | nullRequiredName of that organization. null for self.
Examplenull
contract_settled, Schema
Delivered when the contract moves exercised → settled. Usually follows payout_success on the same contract.
event_typestring (const)RequiredAlways the literal string contract_settled.
1 optionfx_contract_iduuidRequiredContract that settled.
Example33333333-…crebit_contract_referencestringRequiredHuman-readable contract reference.
ExampleCREBIT-20260524-7F3A9C2B1Dpartner_transaction_referencestring | nullOptionalEchoed from the contract.
Exampleplatform-tx-9901settled_atdatetime (ISO-8601 UTC)RequiredUTC timestamp when the contract moved to settled.
Example2026-08-07T13:43:12Zsettlement_statusstring (const)RequiredAlways the literal string settled.
1 optionpayout_iduuidOptionalLatest confirmed payout id used as settlement proof.
Example99999999-…payout_amountdecimal stringOptionalAmount from the confirming payout.
Example4500.00payout_currencystring (enum)OptionalStablecoin from the confirming payout.
3 optionschainstring (enum)OptionalChain from the confirming payout.
4 optionstransaction_hashstringOptionalOn-chain proof from the confirming payout.
Example0xf3a1...e29csettlement_rate_useddecimal stringOptionalOracle settlement rate used at exercise (including maturity force-exercise). Present when a payout settlement audit trace exists.
Example5.5100oracle_clamp_appliedbooleanOptionalWhether the conservative oracle clamp was applied at settlement.
ExamplefalsesubjectobjectRequiredWho the event is for. Part of the signed body; use it (not the delivery headers) to decide whether the event is yours or a member's.
Show 5 nested fields
relationshipstring (enum)Requiredself = the event is about your own partner account. organisation_member = a copy of an event that belongs to one of your organization's member partners.
2 optionspartner_iduuidRequiredPartner the event belongs to: your own partner id for self, the member's partner id for organisation_member.
Example11111111-…partner_namestringRequiredDisplay name of that partner.
ExampleAcme FX (sandbox)organisation_iduuid | nullRequiredOrganization the member belongs to. null for self.
Examplenullorganisation_namestring | nullRequiredName of that organization. null for self.
Examplenull
payout_failed, Schema
event_typestring (const)RequiredAlways the literal string payout_failed.
1 optionfx_contract_iduuidRequiredContract whose payout failed.
Example33333333-…payout_iduuidRequiredCrebit payout row id.
Example99999999-…reasonstringRequiredHuman-readable failure reason.
Exampledestination_wallet_unreachablecrebit_contract_referencestringRequiredHuman-readable contract reference.
ExampleCREBIT-20260524-7F3A9C2B1Dpartner_transaction_referencestring | nullOptionalEchoed from the contract.
Exampleplatform-tx-9901retry_plannedboolean | nullOptionalWhether Crebit plans to retry the payout.
Exampletrueretry_countinteger | nullOptionalNumber of retry attempts so far.
Example1timestampdatetime (ISO-8601 UTC) | nullOptionalUTC timestamp when the failure was recorded.
Example2026-08-07T13:44:05ZsubjectobjectRequiredWho the event is for. Part of the signed body; use it (not the delivery headers) to decide whether the event is yours or a member's.
Show 5 nested fields
relationshipstring (enum)Requiredself = the event is about your own partner account. organisation_member = a copy of an event that belongs to one of your organization's member partners.
2 optionspartner_iduuidRequiredPartner the event belongs to: your own partner id for self, the member's partner id for organisation_member.
Example11111111-…partner_namestringRequiredDisplay name of that partner.
ExampleAcme FX (sandbox)organisation_iduuid | nullRequiredOrganization the member belongs to. null for self.
Examplenullorganisation_namestring | nullRequiredName of that organization. null for self.
Examplenull
contract_expired, Schema
Lock window passed and the customer never exercised.
- For forwards, the customer was obligated to transact and didn't, so the security deposit is forfeitedto cover Crebit's hedge cost. Payload carries
deposit_outcome.status="forfeited"with the amount, currency, chain, and forfeit timestamp. - For options, the premium was non-refundable anyway, so
deposit_outcomeisnulland this delivery is purely a terminal status notification.
event_idstringRequiredUse as your idempotency key.
Exampleevt_7c1d3e8b4a9f2d6cevent_typestring (const)RequiredAlways the literal string contract_expired.
1 optiondelivered_atdatetimeRequiredUTC timestamp Crebit emitted this delivery attempt.
Example2026-08-11T00:01:30Zfx_contract_iduuidRequiredContract that expired.
Example33333333-…crebit_contract_referencestringRequiredHuman-readable contract reference.
ExampleCREBIT-20260524-7F3A9C2B1Dpartner_transaction_referencestring | nullOptionalEchoed from the contract.
Exampleplatform-tx-9901contractobjectRequiredSnapshot of the expired contract.
Show 2 nested fields
contract_typestring (enum)Requiredforward or option.
2 optionsexpired_atdatetime (ISO-8601 UTC)RequiredUTC timestamp when the lock window ended.
Example2026-08-11T00:00:00Z
deposit_outcomeobject | nullOptionalForwards only (null for options). Reports what happened to the security deposit.
Show 5 nested fields
statusstring (const)RequiredAlways forfeited on contract_expired for forwards.
1 optionamountdecimal stringRequiredDeposit amount forfeited.
Example5000.00currencystring (enum)RequiredStablecoin of the forfeited deposit.
2 optionschainstring (enum)RequiredBlockchain where the deposit was held.
4 optionsforfeited_atdatetime (ISO-8601 UTC)RequiredUTC timestamp when Crebit marked the deposit forfeited.
Example2026-08-11T00:01:25Z
subjectobjectRequiredWho the event is for. Part of the signed body; use it (not the delivery headers) to decide whether the event is yours or a member's.
Show 5 nested fields
relationshipstring (enum)Requiredself = the event is about your own partner account. organisation_member = a copy of an event that belongs to one of your organization's member partners.
2 optionspartner_iduuidRequiredPartner the event belongs to: your own partner id for self, the member's partner id for organisation_member.
Example11111111-…partner_namestringRequiredDisplay name of that partner.
ExampleAcme FX (sandbox)organisation_iduuid | nullRequiredOrganization the member belongs to. null for self.
Examplenullorganisation_namestring | nullRequiredName of that organization. null for self.
Examplenull
fiat_collection_settled, Schema
Delivered when a BRL→USDC collection newly reaches settled (USDC on the beneficiary Base wallet). See Pix Automático.
event_typestring (const)RequiredAlways the literal string fiat_collection_settled.
1 optionfiat_collection_iduuidRequiredCrebit collection id.
Examplea7b8c9d0-…partner_iduuidRequiredPartner that owns the collection.
Example11111111-…beneficiary_iduuidRequiredBeneficiary whose Base wallet receives USDC.
Example9c1e2a3b-…collection_typestring (enum)RequiredCollection rail. va_deposit is created from permanent BRL VA activity (no create endpoint).
4 optionsstatusstring (enum)RequiredCollection status at delivery time.
6 optionsamount_brldecimal string | nullOptionalBRL amount on the collection, when known.
Example49.90amount_usdcdecimal string | nullOptionalUSDC settled to the beneficiary wallet, when known.
Example9.12client_reference_idstring | nullOptionalYour client reference on the collection.
ExampleSUB-1048-001bridge_transfer_idstring | nullOptionalOpaque Bridge transfer id when present.
Exampletransfer_01JX7K2M9Qbridge_deposit_idstring | nullOptionalOpaque Bridge deposit id when present.
Exampledep_01JX7K2M9Qbridge_event_idstring | nullOptionalOpaque Bridge event id that drove settlement, when present.
Exampleevt_bridge_01destination_wallet_addressstringOptionalBeneficiary Base USDC wallet.
Example0x1111…1111destination_chainstringOptionalAlways base for BRL→USDC collections.
Examplebasedestination_currencystringOptionalAlways usdc for BRL→USDC collections.
Exampleusdcbeneficiary_display_namestringOptionalBeneficiary display name.
ExampleAcme Pay treasurybeneficiary_external_referencestringOptionalYour external_reference on the beneficiary, when set.
Exampleacme-treasury-01timestampdatetime (ISO-8601 UTC)RequiredUTC timestamp when Crebit enqueued the webhook.
Example2026-11-10T12:20:01+00:00subjectobjectRequiredWho the event is for. Part of the signed body; use it (not the delivery headers) to decide whether the event is yours or a member's.
Show 5 nested fields
relationshipstring (enum)Requiredself = the event is about your own partner account. organisation_member = a copy of an event that belongs to one of your organization's member partners.
2 optionspartner_iduuidRequiredPartner the event belongs to: your own partner id for self, the member's partner id for organisation_member.
Example11111111-…partner_namestringRequiredDisplay name of that partner.
ExampleAcme FX (sandbox)organisation_iduuid | nullRequiredOrganization the member belongs to. null for self.
Examplenullorganisation_namestring | nullRequiredName of that organization. null for self.
Examplenull
settled_atdatetime (ISO-8601 UTC)OptionalUTC timestamp when the collection settled.
Example2026-11-10T12:20:00+00:00
{
"event_type": "fiat_collection_settled",
"fiat_collection_id": "a7b8c9d0-1e2f-4a3b-9c8d-0e1f2a3b4c5d",
"partner_id": "11111111-1111-4111-8111-111111111111",
"beneficiary_id": "9c1e2a3b-4d5f-4e6a-8b7c-1d2e3f4a5b6c",
"collection_type": "pix_automatico",
"status": "settled",
"amount_brl": "49.90",
"amount_usdc": "9.12",
"client_reference_id": "SUB-1048-001",
"bridge_transfer_id": "transfer_01JX7K2M9Q",
"bridge_deposit_id": null,
"bridge_event_id": "evt_bridge_01",
"destination_wallet_address": "0x1111111111111111111111111111111111111111",
"destination_chain": "base",
"destination_currency": "usdc",
"beneficiary_display_name": "Acme Pay treasury",
"beneficiary_external_reference": "acme-treasury-01",
"settled_at": "2026-11-10T12:20:00+00:00",
"timestamp": "2026-11-10T12:20:01+00:00",
"subject": {
"relationship": "self",
"partner_id": "11111111-1111-4111-8111-111111111111",
"partner_name": "Acme FX (sandbox)",
"organisation_id": null,
"organisation_name": null
}
}fiat_collection_failed, Schema
Delivered when a BRL→USDC collection newly reaches failed. Idempotency key: fiat_collection_failed:{collection_id}.
event_typestring (const)RequiredAlways the literal string fiat_collection_failed.
1 optionfiat_collection_iduuidRequiredCrebit collection id.
Examplea7b8c9d0-…partner_iduuidRequiredPartner that owns the collection.
Example11111111-…beneficiary_iduuidRequiredBeneficiary whose Base wallet receives USDC.
Example9c1e2a3b-…collection_typestring (enum)RequiredCollection rail. va_deposit is created from permanent BRL VA activity (no create endpoint).
4 optionsstatusstring (enum)RequiredCollection status at delivery time.
6 optionsamount_brldecimal string | nullOptionalBRL amount on the collection, when known.
Example49.90amount_usdcdecimal string | nullOptionalUSDC settled to the beneficiary wallet, when known.
Example9.12client_reference_idstring | nullOptionalYour client reference on the collection.
ExampleSUB-1048-001bridge_transfer_idstring | nullOptionalOpaque Bridge transfer id when present.
Exampletransfer_01JX7K2M9Qbridge_deposit_idstring | nullOptionalOpaque Bridge deposit id when present.
Exampledep_01JX7K2M9Qbridge_event_idstring | nullOptionalOpaque Bridge event id that drove settlement, when present.
Exampleevt_bridge_01destination_wallet_addressstringOptionalBeneficiary Base USDC wallet.
Example0x1111…1111destination_chainstringOptionalAlways base for BRL→USDC collections.
Examplebasedestination_currencystringOptionalAlways usdc for BRL→USDC collections.
Exampleusdcbeneficiary_display_namestringOptionalBeneficiary display name.
ExampleAcme Pay treasurybeneficiary_external_referencestringOptionalYour external_reference on the beneficiary, when set.
Exampleacme-treasury-01timestampdatetime (ISO-8601 UTC)RequiredUTC timestamp when Crebit enqueued the webhook.
Example2026-11-10T12:20:01+00:00subjectobjectRequiredWho the event is for. Part of the signed body; use it (not the delivery headers) to decide whether the event is yours or a member's.
Show 5 nested fields
relationshipstring (enum)Requiredself = the event is about your own partner account. organisation_member = a copy of an event that belongs to one of your organization's member partners.
2 optionspartner_iduuidRequiredPartner the event belongs to: your own partner id for self, the member's partner id for organisation_member.
Example11111111-…partner_namestringRequiredDisplay name of that partner.
ExampleAcme FX (sandbox)organisation_iduuid | nullRequiredOrganization the member belongs to. null for self.
Examplenullorganisation_namestring | nullRequiredName of that organization. null for self.
Examplenull
failure_reasonstringOptionalOpaque failure reason when present.
Examplepix_automatic.authorization.refused
{
"event_type": "fiat_collection_failed",
"fiat_collection_id": "a7b8c9d0-1e2f-4a3b-9c8d-0e1f2a3b4c5d",
"partner_id": "11111111-1111-4111-8111-111111111111",
"beneficiary_id": "9c1e2a3b-4d5f-4e6a-8b7c-1d2e3f4a5b6c",
"collection_type": "pix_automatico",
"status": "failed",
"amount_brl": "49.90",
"amount_usdc": null,
"client_reference_id": "SUB-1048-001",
"bridge_transfer_id": null,
"bridge_deposit_id": null,
"bridge_event_id": null,
"failure_reason": "pix_automatic.authorization.refused",
"destination_wallet_address": "0x1111111111111111111111111111111111111111",
"destination_chain": "base",
"destination_currency": "usdc",
"beneficiary_display_name": "Acme Pay treasury",
"beneficiary_external_reference": "acme-treasury-01",
"timestamp": "2026-11-10T12:12:00+00:00",
"subject": {
"relationship": "self",
"partner_id": "11111111-1111-4111-8111-111111111111",
"partner_name": "Acme FX (sandbox)",
"organisation_id": null,
"organisation_name": null
}
}Signature, Retries, Ordering
- Inbound signature. When a webhook endpoint is configured (or WEBHOOK_INBOUND_REQUIRE_SIGNATURE is enabled), inbound POSTs must include X-Crebit-Signature (t=<unix>,v1=<hex>) and X-Crebit-Timestamp. Signed payload is {timestamp}.{canonical JSON body}.
- Outbound signature. Outbound deliveries include X-Crebit-Signature (t=<unix>,v1=<hex>), X-Crebit-Timestamp, X-Crebit-Event-Id, and X-Crebit-Idempotency-Key. Signature is a hex HMAC-SHA256 of {timestamp}.{raw body bytes} with your webhook signing secret. Verify with your webhook signing secret before trusting the payload.
- Subject headers. Outbound deliveries also include X-Crebit-Subject-Relationship (self or organisation_member) and X-Crebit-Subject-Partner-Id. They mirror the body's subject for quick routing but are not signed; the signed body subject is canonical.
- Idempotency. Use
event_idas your idempotency key, Crebit may retry an identical delivery. - Retries. Reply 2xx within 15s. Crebit retries other responses and timeouts with exponential backoff (30s doubling, capped at 1h, with jitter) up to 8 attempts.
- Ordering. Not guaranteed across contracts. Within a single contract, Crebit serialises deliveries.
Audit Endpoints
GET /api/v1/fx/webhook-events returns both directions: every inbound POST you sent and every outbound delivery Crebit attempted to your webhook_url. Filter with direction and optional fx_contract_id.
directionstring (enum)OptionalFilter by webhook direction. incoming = partner → Crebit. outgoing = Crebit → partner (payout_success, contract_settled, etc.).
2 optionsfx_contract_iduuidOptionalOptional filter to events for one contract.
Example33333333-…limitintegerOptionalPage size (1–100). Default 25.
Example25cursorstringOptionalOpaque pagination cursor from a previous response's next_cursor.
ExampleeyJpZCI6IjMzMz…
To backfill outbound payout events when your endpoint was down, poll GET /api/v1/fx/webhook-events?direction=outgoing (optionally scoped with fx_contract_id).
curl -sS -X GET "https://lock-apis-sandbox.crebitpay.com/api/v1/fx/webhook-events?direction=incoming&limit=25" \
-H "Content-Type: application/json" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: sandbox"{
"items": [
{
"id": "44444444-4444-4444-8444-444444444444",
"partner_id": "11111111-1111-4111-8111-111111111111",
"fx_contract_id": "33333333-3333-4333-8333-333333333333",
"direction": "incoming",
"event_type": "funds_in_route",
"idempotency_key": "idem-funds-2026-05-24-001",
"status": "processed",
"retry_count": 0,
"last_error": null,
"payload": {
"event_type": "funds_in_route",
"fx_contract_id": "33333333-3333-4333-8333-333333333333",
"payment_type": "deposit",
"amount": "5000.00",
"currency": "USDC",
"chain": "solana",
"transaction_hash": "5Kq3abc123…",
"source_wallet_address": "PartnerSolanaTreasury…"
},
"created_at": "2026-05-24T17:00:00Z",
"processed_at": "2026-05-24T17:00:01Z"
},
{
"id": "55555555-5555-4555-8555-555555555556",
"partner_id": "11111111-1111-4111-8111-111111111111",
"fx_contract_id": "33333333-3333-4333-8333-333333333333",
"direction": "outgoing",
"event_type": "payout_success",
"idempotency_key": "payout_success:99999999-9999-4999-8999-999999999999",
"status": "processed",
"retry_count": 0,
"last_error": null,
"payload": {
"event_type": "payout_success",
"fx_contract_id": "33333333-3333-4333-8333-333333333333",
"payout_id": "99999999-9999-4999-8999-999999999999",
"amount": "4183.30",
"currency": "USDC",
"chain": "solana",
"transaction_hash": "4f3a1...e29c",
"status": "confirmed",
"timestamp": "2026-08-07T13:43:08Z",
"crebit_contract_reference": "CREBIT-20260524-7F3A9C2B1D",
"partner_transaction_reference": "platform-tx-9901",
"payout_wallet_address": "EndUserSolanaWallet…",
"transaction_explorer_url": "https://solscan.io/tx/4f3a1...e29c",
"settlement_rate_used": "5.5100",
"oracle_clamp_applied": false,
"subject": {
"relationship": "self",
"partner_id": "11111111-1111-4111-8111-111111111111",
"partner_name": "Acme FX (sandbox)",
"organisation_id": null,
"organisation_name": null
}
},
"created_at": "2026-08-07T13:43:08Z",
"processed_at": "2026-08-07T13:43:08Z"
},
{
"id": "55555555-5555-4555-8555-555555555557",
"partner_id": "11111111-1111-4111-8111-111111111111",
"fx_contract_id": "33333333-3333-4333-8333-333333333333",
"direction": "outgoing",
"event_type": "contract_settled",
"idempotency_key": "contract_settled:33333333-3333-4333-8333-333333333333",
"status": "processed",
"retry_count": 0,
"last_error": null,
"payload": {
"event_type": "contract_settled",
"fx_contract_id": "33333333-3333-4333-8333-333333333333",
"crebit_contract_reference": "CREBIT-20260524-7F3A9C2B1D",
"partner_transaction_reference": "platform-tx-9901",
"settled_at": "2026-08-07T13:43:12Z",
"settlement_status": "settled",
"payout_id": "99999999-9999-4999-8999-999999999999",
"payout_amount": "4183.30",
"payout_currency": "USDC",
"chain": "solana",
"transaction_hash": "4f3a1...e29c",
"settlement_rate_used": "5.5100",
"oracle_clamp_applied": false,
"subject": {
"relationship": "self",
"partner_id": "11111111-1111-4111-8111-111111111111",
"partner_name": "Acme FX (sandbox)",
"organisation_id": null,
"organisation_name": null
}
},
"created_at": "2026-08-07T13:43:12Z",
"processed_at": "2026-08-07T13:43:12Z"
}
],
"next_cursor": null
}curl -sS -X GET "https://lock-apis-sandbox.crebitpay.com/api/v1/fx/webhook-events?direction=outgoing&limit=25" \
-H "Content-Type: application/json" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: sandbox"
OpenAPI Spec
Every field, enum, and example documented above is also published as a standard OpenAPI 3.1 document, the same source of truth this docs site renders from. Use it for codegen (openapi-generator, swagger-typescript-api, etc.) or import it into Postman / Insomnia / Bruno to get an instant collection with the enum dropdowns and sample-payload pickers baked in.
- Partner spec (sandbox + production servers): /openapi-partner.json , only the routes your platform actually calls.
- Postman: File → Import → paste the URL above. Postman will surface every enum as a dropdown and the multi-example payloads as a request-body picker.
- Insomnia / Bruno: Same flow, import as OpenAPI 3.x.
- SDK codegen:
openapi-generator generate -i /openapi-partner.json -g typescript-fetch -o ./crebit-lock-sdk