API Endpoints / Webhooks
Webhooks (In + Out)
Contract lifecycle and BRL→USDC collection events in both directions, plus organisation-admin events. Same envelope shape on both sides: event_type at the top discriminates which schema applies. Every outbound event also carries a subject block that says whose event it is. Poll contract status for activation — no outbound funding 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. |
| Outbound | payout_failed | Crebit → Partner | Payout could not complete (inspect retry_planned). |
| Outbound | contract_expired | Crebit → Partner | Option expired without exercise. |
| 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. |
| Outbound | organisation_member.kyb_status_changed | Crebit → Organization admin | A member partner's KYB status changed. |
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. Requires Idempotency-Key (8–128 ASCII printable chars).
Pick the Event You're Sending
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 → active as funds confirm.
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 subject object; for events about your own account it is "relationship": "self" (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
On-chain FX delta payout confirmed. Includes transaction_hash.
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
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 security deposit is forfeited.
deposit_outcome.status="forfeited". - For options,
deposit_outcomeisnull.
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
BRL→USDC collection newly 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
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
}
}Who Is This Event For?
Every outbound payload, for every event type, has a top-level subject object. Most partners only ever see self. If you are an organization admin with member webhooks enabled, your endpoint also receives copies of your member partners' events, marked organisation_member.
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
The same contract_settled event type, once for your own contract and once as a copy of a contract that belongs to your member Loja Exemplo Ltda:
{
"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
}
}{
"event_type": "contract_settled",
"fx_contract_id": "a3d8f1c6-5e2b-4c7a-9f0d-8b1e2c3d4f5a",
"crebit_contract_reference": "CREBIT-20260806-2C8E4A1F9B",
"partner_transaction_reference": "loja-tx-5521",
"settled_at": "2026-08-07T15:10:41Z",
"settlement_status": "settled",
"payout_id": "b7c2e9a4-1f6d-4b3e-8a5c-9d0e1f2a3b4c",
"payout_amount": "1250.00",
"payout_currency": "USDC",
"chain": "solana",
"transaction_hash": "4kMemberPayoutTxSignature1111111",
"settlement_rate_used": "5.5100",
"oracle_clamp_applied": false,
"subject": {
"relationship": "organisation_member",
"partner_id": "e91b4c7a-2d5f-4a3e-8b6c-0f7d1e2a3b4c",
"partner_name": "Loja Exemplo Ltda",
"organisation_id": "c4a7e2d1-6b3f-4e8a-9d5c-2f1b0a9e8d7c",
"organisation_name": "Acme FX"
}
}Each delivery also carries two convenience headers, so you can route before you parse the body:
| Header | Value |
|---|---|
| X-Crebit-Subject-Relationship | self or organisation_member (same as subject.relationship) |
| X-Crebit-Subject-Partner-Id | Partner UUID (same as subject.partner_id) |
subject is canonical and covered by the X-Crebit-Signature. The subject headers are not signed: verify the signature, then make decisions from the body.Recommended Routing
on webhook(request):
if not verifySignature(request.rawBody, request.headers["X-Crebit-Signature"], signingSecret):
return 401
event = parseJson(request.rawBody)
if alreadyProcessed(request.headers["X-Crebit-Event-Id"]):
return 200 # retry or replay, already handled
if event.subject.relationship == "organisation_member":
member = findMemberByPartnerId(event.subject.partner_id)
handleMemberEvent(member, event) # on behalf of a member partner
else: # "self"
handleOwnEvent(event) # your own partner account
markProcessed(request.headers["X-Crebit-Event-Id"])
return 200Treat each copy as its own delivery: it has its own X-Crebit-Event-Id and an idempotency key of the form org-member:{organisation_id}:{original_idempotency_key}, so it never collides with the member's own delivery of the same event.
organisation_member.kyb_status_changed, Schema
Sent to the organization admin whenever a member partner's KYB status changes. It is always sent, whether or not member webhooks are enabled, and only to the admin (never to the member). KYB runs on production, so expect it mostly there. You can also poll kyb_status on GET /api/v1/partners/organisation/members.
event_typestring (const)RequiredAlways the literal string organisation_member.kyb_status_changed.
1 optionorganisation_iduuidRequiredYour organization.
Example2b7e9d4c-…member_partner_iduuidRequiredMember partner whose KYB status changed.
Example8f3c2a1e-…member_partner_namestringRequiredDisplay name of the member.
ExampleLoja Exemplo Ltdaprevious_kyb_statusstring (enum)RequiredKYB status before the change.
7 optionskyb_statusstring (enum)RequiredKYB status after the change.
7 optionskyb_application_idstring | nullRequiredKYB application the change relates to, when there is one.
ExampleKYB-2026-000123timestampdatetime (ISO-8601 UTC)RequiredUTC timestamp of the status change.
Example2026-10-02T15:20:00ZsubjectobjectRequiredAlways relationship organisation_member, with partner_id and partner_name naming the member.
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
{
"event_type": "organisation_member.kyb_status_changed",
"organisation_id": "c4a7e2d1-6b3f-4e8a-9d5c-2f1b0a9e8d7c",
"member_partner_id": "e91b4c7a-2d5f-4a3e-8b6c-0f7d1e2a3b4c",
"member_partner_name": "Loja Exemplo Ltda",
"previous_kyb_status": "under_review",
"kyb_status": "approved",
"kyb_application_id": "KYB-2026-000123",
"timestamp": "2026-10-02T15:20:00Z",
"subject": {
"relationship": "organisation_member",
"partner_id": "e91b4c7a-2d5f-4a3e-8b6c-0f7d1e2a3b4c",
"partner_name": "Loja Exemplo Ltda",
"organisation_id": "c4a7e2d1-6b3f-4e8a-9d5c-2f1b0a9e8d7c",
"organisation_name": "Acme FX"
}
}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 inbound and outbound deliveries. 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…
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
}Backfill outbound payout events with GET /api/v1/fx/webhook-events?direction=outgoing.
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"