Docs
llms.txt for AI agents Download OpenAPI spec

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.

Directionevent_typeWho calls whoTrigger
Inboundfunds_in_routePartner → CrebitPartner announces an on-chain deposit/premium dispatch.
Inboundcontract_exercisedPartner → CrebitCustomer transacted within the lock window, Crebit pays out the FX delta.
Outboundpayout_successCrebit → PartnerOn-chain payout to customer confirmed.
Outboundcontract_settledCrebit → PartnerContract moved exercised → settled.
Outboundpayout_failedCrebit → PartnerPayout could not complete (inspect retry_planned).
Outboundcontract_expiredCrebit → PartnerOption expired without exercise.
Outboundfiat_collection_settledCrebit → PartnerBRL→USDC collection newly settled (USDC on Base).
Outboundfiat_collection_failedCrebit → PartnerBRL→USDC collection newly failed.
Outboundorganisation_member.kyb_status_changedCrebit → Organization adminA 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

Inbound event variants

Notify Crebit you've dispatched the deposit on-chain to funding_wallet_address. Optional but recommended, Crebit can pre-stage processing.

json code sample
json
{
  "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_type = funds_in_route
  • event_typestring (const)Required

    Discriminator. Must be the literal string funds_in_route.

    1 option
  • fx_contract_iduuidRequired

    Contract id returned by POST /api/v1/fx/contracts.

    Example33333333-…
  • payment_typestring (enum)Optional

    Which 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 options
  • amountdecimal stringOptional

    Amount dispatched on-chain to funding_wallet_address. Required together with payment_type, currency, and chain.

    Example5000.00
  • currencystring (enum)Optional

    Stablecoin 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 options
  • chainstring (enum)Optional

    Chain you sent on. Required together with payment_type, amount, and currency. Must match the contract's chain.

    4 options
  • transaction_hashstringOptional

    On-chain tx hash. When chain=solana and payment_type are also set, Crebit verifies the funding transaction on-chain before accepting.

    Example0xabc123…
  • source_wallet_addressstringOptional

    Wallet the funds were sent from.

    Example0xPartnerTreasury…

contract_exercised, Schema (Triggers Payout)

This is the call that triggers Crebit to pay out. Fire it the moment the customer transacts on your platform within the lock window. Crebit reads 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_type = contract_exercised
  • event_typestring (const)Required

    Discriminator. Must be the literal string contract_exercised. THIS IS THE CALL THAT TRIGGERS CREBIT TO PAY OUT.

    1 option
  • fx_contract_iduuidRequired

    Contract the customer just transacted against.

    Example33333333-…
  • executed_atdatetime (ISO-8601 UTC)Required

    UTC 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:00Z
  • live_execution_ratedecimal stringRequired

    Live mid-market FX rate the moment the customer transacted. Crebit compares against locked_rate to compute the FX delta.

    Example5.51
  • transaction_amountdecimal stringOptional

    Partner-reported base-currency amount executed. Defaults to the contract notional when omitted.

    Example50000.00
  • payout_wallet_addressstringOptional

    On-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)Required

    Stablecoin Crebit pays out in (USDC, USDT, or BRLA). Must match the contract's settlement_currency. Tron payouts require USDT.

    3 options
  • chainstring (enum)Required

    Blockchain Crebit pays out on. Send the same chain locked at quote time.

    4 options

How to Call (Either Variant)

HTTP code sample
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

Crebit's response to your inbound POST
  • webhook_event_iduuidRequired

    Crebit's id for the event. Echo in support tickets.

    Example44444444-…
  • statusstring (enum)Required

    received = 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
json, example response code sample
json, example response
{
  "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?).

No outbound webhook URL configured yet? Send Crebit support the URL and environment. Until then, poll GET /api/v1/fx/webhook-events?direction=outgoing to learn payout state on demand.
Outbound event variants

On-chain payout confirmed. Arrives when the FX delta transfer is confirmed on-chain.

json code sample
json
{
  "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_type = payout_success
  • event_typestring (const)Required

    Always the literal string payout_success.

    1 option
  • fx_contract_iduuidRequired

    Contract whose payout was confirmed.

    Example33333333-…
  • payout_iduuidRequired

    Crebit payout row id.

    Example99999999-…
  • amountdecimal stringRequired

    FX delta amount paid out.

    Example4500.00
  • currencystring (enum)Required

    Stablecoin Crebit paid out.

    3 options
  • chainstring (enum)Required

    Blockchain where the payout was sent.

    4 options
  • transaction_hashstringRequired

    On-chain transaction hash for the payout transfer.

    Example0xf3a1...e29c
  • statusstring (const)Required

    Always confirmed on this event.

    1 option
  • timestampdatetime (ISO-8601 UTC)Required

    UTC timestamp when the payout was confirmed on-chain.

    Example2026-08-07T13:43:08Z
  • crebit_contract_referencestringRequired

    Human-readable contract reference.

    ExampleCREBIT-20260524-7F3A9C2B1D
  • partner_transaction_referencestring | nullOptional

    Echoed from the contract, your reconciliation id.

    Exampleplatform-tx-9901
  • payout_wallet_addressstringRequired

    Wallet that received the payout.

    Example0xEndUserWallet…
  • transaction_explorer_urlstring | nullOptional

    Block explorer URL for the payout transaction (e.g. Solana).

    Examplehttps://etherscan.io/tx/0xf3a1...e29c
  • settlement_rate_useddecimal stringOptional

    Oracle settlement rate used at exercise (including maturity force-exercise). Present when a payout settlement audit trace exists.

    Example5.5100
  • oracle_clamp_appliedbooleanOptional

    Whether the conservative oracle clamp was applied at settlement.

    Examplefalse
  • subjectobjectRequired

    Who 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)Required

      self = 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 options
    • partner_iduuidRequired

      Partner the event belongs to: your own partner id for self, the member's partner id for organisation_member.

      Example11111111-…
    • partner_namestringRequired

      Display name of that partner.

      ExampleAcme FX (sandbox)
    • organisation_iduuid | nullRequired

      Organization the member belongs to. null for self.

      Examplenull
    • organisation_namestring | nullRequired

      Name of that organization. null for self.

      Examplenull

contract_settled, Schema

event_type = contract_settled
  • event_typestring (const)Required

    Always the literal string contract_settled.

    1 option
  • fx_contract_iduuidRequired

    Contract that settled.

    Example33333333-…
  • crebit_contract_referencestringRequired

    Human-readable contract reference.

    ExampleCREBIT-20260524-7F3A9C2B1D
  • partner_transaction_referencestring | nullOptional

    Echoed from the contract.

    Exampleplatform-tx-9901
  • settled_atdatetime (ISO-8601 UTC)Required

    UTC timestamp when the contract moved to settled.

    Example2026-08-07T13:43:12Z
  • settlement_statusstring (const)Required

    Always the literal string settled.

    1 option
  • payout_iduuidOptional

    Latest confirmed payout id used as settlement proof.

    Example99999999-…
  • payout_amountdecimal stringOptional

    Amount from the confirming payout.

    Example4500.00
  • payout_currencystring (enum)Optional

    Stablecoin from the confirming payout.

    3 options
  • chainstring (enum)Optional

    Chain from the confirming payout.

    4 options
  • transaction_hashstringOptional

    On-chain proof from the confirming payout.

    Example0xf3a1...e29c
  • settlement_rate_useddecimal stringOptional

    Oracle settlement rate used at exercise (including maturity force-exercise). Present when a payout settlement audit trace exists.

    Example5.5100
  • oracle_clamp_appliedbooleanOptional

    Whether the conservative oracle clamp was applied at settlement.

    Examplefalse
  • subjectobjectRequired

    Who 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)Required

      self = 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 options
    • partner_iduuidRequired

      Partner the event belongs to: your own partner id for self, the member's partner id for organisation_member.

      Example11111111-…
    • partner_namestringRequired

      Display name of that partner.

      ExampleAcme FX (sandbox)
    • organisation_iduuid | nullRequired

      Organization the member belongs to. null for self.

      Examplenull
    • organisation_namestring | nullRequired

      Name of that organization. null for self.

      Examplenull

payout_failed, Schema

event_type = payout_failed
  • event_typestring (const)Required

    Always the literal string payout_failed.

    1 option
  • fx_contract_iduuidRequired

    Contract whose payout failed.

    Example33333333-…
  • payout_iduuidRequired

    Crebit payout row id.

    Example99999999-…
  • reasonstringRequired

    Human-readable failure reason.

    Exampledestination_wallet_unreachable
  • crebit_contract_referencestringRequired

    Human-readable contract reference.

    ExampleCREBIT-20260524-7F3A9C2B1D
  • partner_transaction_referencestring | nullOptional

    Echoed from the contract.

    Exampleplatform-tx-9901
  • retry_plannedboolean | nullOptional

    Whether Crebit plans to retry the payout.

    Exampletrue
  • retry_countinteger | nullOptional

    Number of retry attempts so far.

    Example1
  • timestampdatetime (ISO-8601 UTC) | nullOptional

    UTC timestamp when the failure was recorded.

    Example2026-08-07T13:44:05Z
  • subjectobjectRequired

    Who 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)Required

      self = 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 options
    • partner_iduuidRequired

      Partner the event belongs to: your own partner id for self, the member's partner id for organisation_member.

      Example11111111-…
    • partner_namestringRequired

      Display name of that partner.

      ExampleAcme FX (sandbox)
    • organisation_iduuid | nullRequired

      Organization the member belongs to. null for self.

      Examplenull
    • organisation_namestring | nullRequired

      Name 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_outcome is null.
event_type = contract_expired
  • event_idstringRequired

    Use as your idempotency key.

    Exampleevt_7c1d3e8b4a9f2d6c
  • event_typestring (const)Required

    Always the literal string contract_expired.

    1 option
  • delivered_atdatetimeRequired

    UTC timestamp Crebit emitted this delivery attempt.

    Example2026-08-11T00:01:30Z
  • fx_contract_iduuidRequired

    Contract that expired.

    Example33333333-…
  • crebit_contract_referencestringRequired

    Human-readable contract reference.

    ExampleCREBIT-20260524-7F3A9C2B1D
  • partner_transaction_referencestring | nullOptional

    Echoed from the contract.

    Exampleplatform-tx-9901
  • contractobjectRequired

    Snapshot of the expired contract.

    Show 2 nested fields
    • contract_typestring (enum)Required

      forward or option.

      2 options
    • expired_atdatetime (ISO-8601 UTC)Required

      UTC timestamp when the lock window ended.

      Example2026-08-11T00:00:00Z
  • deposit_outcomeobject | nullOptional

    Forwards only (null for options). Reports what happened to the security deposit.

    Show 5 nested fields
    • statusstring (const)Required

      Always forfeited on contract_expired for forwards.

      1 option
    • amountdecimal stringRequired

      Deposit amount forfeited.

      Example5000.00
    • currencystring (enum)Required

      Stablecoin of the forfeited deposit.

      2 options
    • chainstring (enum)Required

      Blockchain where the deposit was held.

      4 options
    • forfeited_atdatetime (ISO-8601 UTC)Required

      UTC timestamp when Crebit marked the deposit forfeited.

      Example2026-08-11T00:01:25Z
  • subjectobjectRequired

    Who 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)Required

      self = 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 options
    • partner_iduuidRequired

      Partner the event belongs to: your own partner id for self, the member's partner id for organisation_member.

      Example11111111-…
    • partner_namestringRequired

      Display name of that partner.

      ExampleAcme FX (sandbox)
    • organisation_iduuid | nullRequired

      Organization the member belongs to. null for self.

      Examplenull
    • organisation_namestring | nullRequired

      Name 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_type = fiat_collection_settled
  • event_typestring (const)Required

    Always the literal string fiat_collection_settled.

    1 option
  • fiat_collection_iduuidRequired

    Crebit collection id.

    Examplea7b8c9d0-…
  • partner_iduuidRequired

    Partner that owns the collection.

    Example11111111-…
  • beneficiary_iduuidRequired

    Beneficiary whose Base wallet receives USDC.

    Example9c1e2a3b-…
  • collection_typestring (enum)Required

    Collection rail. va_deposit is created from permanent BRL VA activity (no create endpoint).

    4 options
  • statusstring (enum)Required

    Collection status at delivery time.

    6 options
  • amount_brldecimal string | nullOptional

    BRL amount on the collection, when known.

    Example49.90
  • amount_usdcdecimal string | nullOptional

    USDC settled to the beneficiary wallet, when known.

    Example9.12
  • client_reference_idstring | nullOptional

    Your client reference on the collection.

    ExampleSUB-1048-001
  • bridge_transfer_idstring | nullOptional

    Opaque Bridge transfer id when present.

    Exampletransfer_01JX7K2M9Q
  • bridge_deposit_idstring | nullOptional

    Opaque Bridge deposit id when present.

    Exampledep_01JX7K2M9Q
  • bridge_event_idstring | nullOptional

    Opaque Bridge event id that drove settlement, when present.

    Exampleevt_bridge_01
  • destination_wallet_addressstringOptional

    Beneficiary Base USDC wallet.

    Example0x1111…1111
  • destination_chainstringOptional

    Always base for BRL→USDC collections.

    Examplebase
  • destination_currencystringOptional

    Always usdc for BRL→USDC collections.

    Exampleusdc
  • beneficiary_display_namestringOptional

    Beneficiary display name.

    ExampleAcme Pay treasury
  • beneficiary_external_referencestringOptional

    Your external_reference on the beneficiary, when set.

    Exampleacme-treasury-01
  • timestampdatetime (ISO-8601 UTC)Required

    UTC timestamp when Crebit enqueued the webhook.

    Example2026-11-10T12:20:01+00:00
  • subjectobjectRequired

    Who 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)Required

      self = 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 options
    • partner_iduuidRequired

      Partner the event belongs to: your own partner id for self, the member's partner id for organisation_member.

      Example11111111-…
    • partner_namestringRequired

      Display name of that partner.

      ExampleAcme FX (sandbox)
    • organisation_iduuid | nullRequired

      Organization the member belongs to. null for self.

      Examplenull
    • organisation_namestring | nullRequired

      Name of that organization. null for self.

      Examplenull
  • settled_atdatetime (ISO-8601 UTC)Optional

    UTC timestamp when the collection settled.

    Example2026-11-10T12:20:00+00:00
json, fiat_collection_settled code sample
json, fiat_collection_settled
{
  "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_type = fiat_collection_failed
  • event_typestring (const)Required

    Always the literal string fiat_collection_failed.

    1 option
  • fiat_collection_iduuidRequired

    Crebit collection id.

    Examplea7b8c9d0-…
  • partner_iduuidRequired

    Partner that owns the collection.

    Example11111111-…
  • beneficiary_iduuidRequired

    Beneficiary whose Base wallet receives USDC.

    Example9c1e2a3b-…
  • collection_typestring (enum)Required

    Collection rail. va_deposit is created from permanent BRL VA activity (no create endpoint).

    4 options
  • statusstring (enum)Required

    Collection status at delivery time.

    6 options
  • amount_brldecimal string | nullOptional

    BRL amount on the collection, when known.

    Example49.90
  • amount_usdcdecimal string | nullOptional

    USDC settled to the beneficiary wallet, when known.

    Example9.12
  • client_reference_idstring | nullOptional

    Your client reference on the collection.

    ExampleSUB-1048-001
  • bridge_transfer_idstring | nullOptional

    Opaque Bridge transfer id when present.

    Exampletransfer_01JX7K2M9Q
  • bridge_deposit_idstring | nullOptional

    Opaque Bridge deposit id when present.

    Exampledep_01JX7K2M9Q
  • bridge_event_idstring | nullOptional

    Opaque Bridge event id that drove settlement, when present.

    Exampleevt_bridge_01
  • destination_wallet_addressstringOptional

    Beneficiary Base USDC wallet.

    Example0x1111…1111
  • destination_chainstringOptional

    Always base for BRL→USDC collections.

    Examplebase
  • destination_currencystringOptional

    Always usdc for BRL→USDC collections.

    Exampleusdc
  • beneficiary_display_namestringOptional

    Beneficiary display name.

    ExampleAcme Pay treasury
  • beneficiary_external_referencestringOptional

    Your external_reference on the beneficiary, when set.

    Exampleacme-treasury-01
  • timestampdatetime (ISO-8601 UTC)Required

    UTC timestamp when Crebit enqueued the webhook.

    Example2026-11-10T12:20:01+00:00
  • subjectobjectRequired

    Who 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)Required

      self = 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 options
    • partner_iduuidRequired

      Partner the event belongs to: your own partner id for self, the member's partner id for organisation_member.

      Example11111111-…
    • partner_namestringRequired

      Display name of that partner.

      ExampleAcme FX (sandbox)
    • organisation_iduuid | nullRequired

      Organization the member belongs to. null for self.

      Examplenull
    • organisation_namestring | nullRequired

      Name of that organization. null for self.

      Examplenull
  • failure_reasonstringOptional

    Opaque failure reason when present.

    Examplepix_automatic.authorization.refused
json, fiat_collection_failed code sample
json, fiat_collection_failed
{
  "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.

subject
  • relationshipstring (enum)Required

    self = 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 options
  • partner_iduuidRequired

    Partner the event belongs to: your own partner id for self, the member's partner id for organisation_member.

    Example11111111-…
  • partner_namestringRequired

    Display name of that partner.

    ExampleAcme FX (sandbox)
  • organisation_iduuid | nullRequired

    Organization the member belongs to. null for self.

    Examplenull
  • organisation_namestring | nullRequired

    Name 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:

json, your own event (self) code sample
json, your own event (self)
{
  "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
  }
}
json, on behalf of a member (organisation_member) code sample
json, on behalf of a member (organisation_member)
{
  "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:

HeaderValue
X-Crebit-Subject-Relationshipself or organisation_member (same as subject.relationship)
X-Crebit-Subject-Partner-IdPartner UUID (same as subject.partner_id)
The body 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

pseudo-code code sample
pseudo-code
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 200

Treat 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_type = organisation_member.kyb_status_changed
  • event_typestring (const)Required

    Always the literal string organisation_member.kyb_status_changed.

    1 option
  • organisation_iduuidRequired

    Your organization.

    Example2b7e9d4c-…
  • member_partner_iduuidRequired

    Member partner whose KYB status changed.

    Example8f3c2a1e-…
  • member_partner_namestringRequired

    Display name of the member.

    ExampleLoja Exemplo Ltda
  • previous_kyb_statusstring (enum)Required

    KYB status before the change.

    7 options
  • kyb_statusstring (enum)Required

    KYB status after the change.

    7 options
  • kyb_application_idstring | nullRequired

    KYB application the change relates to, when there is one.

    ExampleKYB-2026-000123
  • timestampdatetime (ISO-8601 UTC)Required

    UTC timestamp of the status change.

    Example2026-10-02T15:20:00Z
  • subjectobjectRequired

    Always relationship organisation_member, with partner_id and partner_name naming the member.

    Show 5 nested fields
    • relationshipstring (enum)Required

      self = 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 options
    • partner_iduuidRequired

      Partner the event belongs to: your own partner id for self, the member's partner id for organisation_member.

      Example11111111-…
    • partner_namestringRequired

      Display name of that partner.

      ExampleAcme FX (sandbox)
    • organisation_iduuid | nullRequired

      Organization the member belongs to. null for self.

      Examplenull
    • organisation_namestring | nullRequired

      Name of that organization. null for self.

      Examplenull
json, webhook body code sample
json, webhook body
{
  "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_id as 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.

Query parameters
  • directionstring (enum)Optional

    Filter by webhook direction. incoming = partner → Crebit. outgoing = Crebit → partner (payout_success, contract_settled, etc.).

    2 options
  • fx_contract_iduuidOptional

    Optional filter to events for one contract.

    Example33333333-…
  • limitintegerOptional

    Page size (1–100). Default 25.

    Example25
  • cursorstringOptional

    Opaque pagination cursor from a previous response's next_cursor.

    ExampleeyJpZCI6IjMzMz…
HTTP code sample
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"
json, example response code sample
json, example response
{
  "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.

HTTP code sample
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"