Docs
llms.txt for AI agents Download OpenAPI spec

Organizations / Fiat / Spot

Fiat Spot for Members

Convert BRL and USD at the live rate on behalf of a member: quote, create the order, have the payer send the pay-in, and Crebit pays out to the member's bank account automatically. Every request below uses your admin keys plus X-Crebit-Acting-As-Partner-Id.

Before You Start

  • The member is approved for fiat (otherwise 403 fiat_spot_not_enabled). See Fiat readiness.
  • The member has a payout bank account on the right rail and a registered customer reference. See Payout bank accounts and Customer references.
  • Examples use the production host https://lock-apis.crebitpay.com.

Corridors

directionPay-inusd_receive_method meansPayout bank
BRL_TO_USDPIX (BRL)Payout rail: ach, wire or swiftach / wire / swift, same as usd_receive_method
USD_TO_BRLUSD deposit accountPay-in rail: ach, wire or swiftpix
USD_TO_EURUSD deposit accountPay-in rail: ach, wire or swiftsepa

USD pay-in corridors need the member's USD deposit account to be approved (usd_virtual_account_ready on the profile). Rail cover fees are charged in the pay-in currency: ACH $0.50, wire $15, SWIFT $29.

1. Rate Preview

Optional. The live rate for a corridor, before you know the amount or rail. Returns a cached preview unless you send "refresh": true. market_rate is BRL per 1 USD (EUR per 1 USD for USD_TO_EUR).

HTTP code sample
curl -sS -X POST "https://lock-apis.crebitpay.com/api/v1/fiat/spot/quote-preview" \
  -H "Content-Type: application/json" \
  -H "X-Crebit-Key-Id: ADMIN_KEY_ID" \
  -H "X-Crebit-Key-Secret: ADMIN_KEY_SECRET" \
  -H "X-Crebit-Environment: production" \
  -H "X-Crebit-Acting-As-Partner-Id: 8f3c2a1e-4b5d-4e6f-9a7b-1c2d3e4f5a6b" \
  -d '{"direction":"BRL_TO_USD"}'
json, response code sample
json, response
{
  "direction": "BRL_TO_USD",
  "market_rate": "5.4700",
  "quote_expires_at": "2026-09-28T14:10:00Z"
}

2. Quote

Prices a fixed amount on one side (amount_side: payin or payout) with the rail cover fee. Spot uses the live rate with no Crebit spread, so locked_rate equals market_rate unless you add a client spread. The same parameters return the cached quote for up to 10 minutes; send "refresh": true for a fresh one. Limits are checked here.

HTTP code sample
curl -sS -X POST "https://lock-apis.crebitpay.com/api/v1/fiat/spot/quotes" \
  -H "Content-Type: application/json" \
  -H "X-Crebit-Key-Id: ADMIN_KEY_ID" \
  -H "X-Crebit-Key-Secret: ADMIN_KEY_SECRET" \
  -H "X-Crebit-Environment: production" \
  -H "X-Crebit-Acting-As-Partner-Id: 8f3c2a1e-4b5d-4e6f-9a7b-1c2d3e4f5a6b" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"direction":"BRL_TO_USD","amount":"50000.00","amount_side":"payin","usd_receive_method":"wire"}'
json, response code sample
json, response
{
  "spread_percent": "0",
  "base_rate": "5.4700",
  "client_rate": "5.4700",
  "spread_revenue_amount": "0",
  "spread_revenue_currency": "USD",
  "direction": "BRL_TO_USD",
  "payin_amount": "50000.00",
  "payin_currency": "BRL",
  "payout_amount": "9140.77",
  "payout_currency": "USD",
  "locked_rate": "5.4700",
  "market_rate": "5.4700",
  "spread_bps": 0,
  "quote_expires_at": "2026-09-28T14:10:00Z",
  "usd_receive_method": "wire",
  "cover_fee_usd": "15.00",
  "cover_fee_payin_amount": "82.05",
  "cover_fee_payin_currency": "BRL",
  "total_payin_amount": "50082.05"
}
The quote is for display. Order create re-prices at the live rate on the server and never takes rates or amounts from the client, so the order amounts can differ slightly from the quote if the rate moved.

3. Create the Order

FieldRequiredNotes
directionyesBRL_TO_USD, USD_TO_BRL or USD_TO_EUR
amountyesDecimal string, fixed on amount_side
amount_sidenopayin (default) or payout
usd_receive_methodyesach, wire or swift (see Corridors)
customer_reference_idyesRegistered customer reference (1-256 chars)
payout_destination.bank_account_idyesMember's bank account on the matching rail
payer_rolenoself (default) or third_party, when someone else sends the pay-in
spread_percentnoYour markup as a percent (0.5 = 0.5%); see Client spread
To add your own markup to the member's rate, send spread_percent on the quote and order. See Client spread.
HTTP code sample
curl -sS -X POST "https://lock-apis.crebitpay.com/api/v1/fiat/spot/orders" \
  -H "Content-Type: application/json" \
  -H "X-Crebit-Key-Id: ADMIN_KEY_ID" \
  -H "X-Crebit-Key-Secret: ADMIN_KEY_SECRET" \
  -H "X-Crebit-Environment: production" \
  -H "X-Crebit-Acting-As-Partner-Id: 8f3c2a1e-4b5d-4e6f-9a7b-1c2d3e4f5a6b" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"direction":"BRL_TO_USD","amount":"50000.00","amount_side":"payin","payer_role":"self","usd_receive_method":"wire","customer_reference_id":"cust_7781","payout_destination":{"bank_account_id":"ba_4f7c2d9e1a3b"}}'
json, response (201) code sample
json, response (201)
{
  "spread_percent": "0",
  "base_rate": "5.4700",
  "client_rate": "5.4700",
  "spread_revenue_amount": "0",
  "spread_revenue_currency": "USD",
  "id": "7e1f2a3b-4c5d-4e6f-8a9b-0c1d2e3f4a5b",
  "direction": "BRL_TO_USD",
  "status": "awaiting_payin",
  "payer_role": "self",
  "customer_reference_id": "cust_7781",
  "payin_amount": "50000.00",
  "payin_currency": "BRL",
  "payout_amount": "9140.77",
  "payout_currency": "USD",
  "locked_rate": "5.4700",
  "spread_bps": 0,
  "quote_expires_at": "2026-09-28T14:10:00Z",
  "payin_expires_at": "2026-09-28T14:05:00Z",
  "usd_receive_method": "wire",
  "cover_fee_usd": "15.00",
  "cover_fee_payin_amount": "82.05",
  "cover_fee_payin_currency": "BRL",
  "total_payin_amount": "50082.05",
  "payout_destination": {
    "bank_account_id": "ba_4f7c2d9e1a3b",
    "name": "Member Co operating",
    "beneficiary_name": "Member Co LLC"
  },
  "failure_reason": null,
  "share_token": "q3V9xkT2bLr8…",
  "share_url": "https://developers.crebitpay.com/fiat/pay/q3V9xkT2bLr8…",
  "payment_instructions": [
    {
      "id": "3a4b5c6d-7e8f-4a9b-8c0d-1e2f3a4b5c6d",
      "instruction_kind": "payin",
      "rail": "pix",
      "credentials": {
        "pix_code": "00020126580014br.gov.bcb.pix0136…5204000053039865406500082.055802BR…6304A1B2"
      },
      "display_text": "Pay 50082.05 BRL (BRL TO USD)\nRail: PIX\nPIX: 00020126580014br.gov.bcb.pix0136…",
      "expires_at": "2026-09-28T14:05:00Z"
    }
  ],
  "created_at": "2026-09-28T14:00:00Z",
  "updated_at": "2026-09-28T14:00:00Z",
  "swift_compliance": null
}

The order is created in awaiting_payinwith its pay-in instructions. It belongs to the member and shows up in the member's partner portal.

4. Pay In

Send the payer the instruction in payment_instructions (or the share link). The payer must send total_payin_amount.

  • BRL_TO_USD: a PIX code in credentials.pix_code. It expires about 5 minutes after the order is created (payin_expires_at). The order then moves to awaiting_payin_confirmation for a webhook grace window (default 15 minutes) so a late payment confirmation can still settle a payment made just before the PIX timed out; only after that grace does it become expired. Minimum BRL pay-in is 5.00.
  • USD_TO_BRL and USD_TO_EUR:the member's USD deposit account details for the chosen rail. The window is 120 hours by default.
json, USD pay-in instruction code sample
json, USD pay-in instruction
{
  "id": "5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f",
  "instruction_kind": "payin",
  "rail": "ach",
  "credentials": {
    "routing_number": "021000021",
    "account_number": "000123456789",
    "beneficiary_name": "Member Co Ltda"
  },
  "display_text": "Pay 10000.50 USD (USD TO BRL)\nRail: ACH\nRouting Number: 021000021\nAccount Number: 000123456789\nBeneficiary Name: Member Co Ltda",
  "expires_at": "2026-10-03T14:00:00Z"
}

5. Poll Until Settled

There are no fiat webhooks. Poll the order with the acting-as header until it is settled, expired or failed. Once the pay-in arrives Crebit converts and submits the payout on its own; no further call is needed.

HTTP code sample
curl -sS -X GET "https://lock-apis.crebitpay.com/api/v1/fiat/spot/orders/7e1f2a3b-4c5d-4e6f-8a9b-0c1d2e3f4a5b" \
  -H "X-Crebit-Key-Id: ADMIN_KEY_ID" \
  -H "X-Crebit-Key-Secret: ADMIN_KEY_SECRET" \
  -H "X-Crebit-Environment: production" \
  -H "X-Crebit-Acting-As-Partner-Id: 8f3c2a1e-4b5d-4e6f-9a7b-1c2d3e4f5a6b"
json, response code sample
json, response
{
  "spread_percent": "0",
  "base_rate": "5.4700",
  "client_rate": "5.4700",
  "spread_revenue_amount": "0",
  "spread_revenue_currency": "USD",
  "id": "7e1f2a3b-4c5d-4e6f-8a9b-0c1d2e3f4a5b",
  "direction": "BRL_TO_USD",
  "status": "settled",
  "payer_role": "self",
  "customer_reference_id": "cust_7781",
  "payin_amount": "50000.00",
  "payin_currency": "BRL",
  "payout_amount": "9140.77",
  "payout_currency": "USD",
  "locked_rate": "5.4700",
  "spread_bps": 0,
  "quote_expires_at": "2026-09-28T14:10:00Z",
  "payin_expires_at": "2026-09-28T14:05:00Z",
  "usd_receive_method": "wire",
  "cover_fee_usd": "15.00",
  "cover_fee_payin_amount": "82.05",
  "cover_fee_payin_currency": "BRL",
  "total_payin_amount": "50082.05",
  "payout_destination": {
    "bank_account_id": "ba_4f7c2d9e1a3b",
    "name": "Member Co operating",
    "beneficiary_name": "Member Co LLC"
  },
  "failure_reason": null,
  "share_token": "q3V9xkT2bLr8…",
  "share_url": "https://developers.crebitpay.com/fiat/pay/q3V9xkT2bLr8…",
  "payment_instructions": [
    {
      "id": "3a4b5c6d-7e8f-4a9b-8c0d-1e2f3a4b5c6d",
      "instruction_kind": "payin",
      "rail": "pix",
      "credentials": {
        "pix_code": "00020126580014br.gov.bcb.pix0136…5204000053039865406500082.055802BR…6304A1B2"
      },
      "display_text": "Pay 50082.05 BRL (BRL TO USD)\nRail: PIX\nPIX: 00020126580014br.gov.bcb.pix0136…",
      "expires_at": "2026-09-28T14:05:00Z"
    }
  ],
  "created_at": "2026-09-28T14:00:00Z",
  "updated_at": "2026-09-28T14:21:40Z",
  "swift_compliance": null
}

Status Lifecycle

statusMeaningNext
quotedOrder row created; pay-in instructions being issued (not normally visible)awaiting_payin, expired
awaiting_payinWaiting for the payer; see payin_expires_atpayin_detected, awaiting_payin_confirmation, failed
awaiting_payin_confirmationPay-in window closed; waiting for the payment confirmation (grace window, default 15 min)payin_detected, expired, failed
payin_detectedPay-in receivedconverting
convertingConverting and submitting the payout (retried automatically if submission fails)payout_submitted, failed
payout_submittedPayout sent to the member's bank; SWIFT payouts may wait for compliance documentssettled, failed
settledPayout completed (terminal)
expiredGrace ended with no confirmed pay-in (or quote expired). Late payin.complete can still revive.payin_detected
failedPay-in failed, or the payout failed after the automatic retries were used up; see failure_reason (terminal)

SWIFT Compliance Documents

SWIFT payouts can be held for a document showing the payer and recipient relationship. While held, the order's swift_compliance.status is waiting_documents. If you stored a document on the bank account, Crebit submits it automatically. Otherwise send one once the order is payout_submitted:

  • transaction_document_type: invoice, purchase_order, delivery_slip, contract, customs_declaration, bill_of_lading, first_party or others.
  • transaction_document_file: PDF, JPEG or PNG as an HTTPS URL or data URL, under about 8 MB. Not needed for first_party.
  • Optional transaction_document_id (max 128) and description (max 512).
HTTP code sample
curl -sS -X POST "https://lock-apis.crebitpay.com/api/v1/fiat/spot/orders/7e1f2a3b-4c5d-4e6f-8a9b-0c1d2e3f4a5b/compliance-documents" \
  -H "Content-Type: application/json" \
  -H "X-Crebit-Key-Id: ADMIN_KEY_ID" \
  -H "X-Crebit-Key-Secret: ADMIN_KEY_SECRET" \
  -H "X-Crebit-Environment: production" \
  -H "X-Crebit-Acting-As-Partner-Id: 8f3c2a1e-4b5d-4e6f-9a7b-1c2d3e4f5a6b" \
  -d '{"transaction_document_type":"invoice","transaction_document_id":"INV-2026-0042","transaction_document_file":"data:application/pdf;base64,JVBERi0xLjQK…","description":"Invoice for September supplies"}'
json, response code sample
json, response
{
  "spread_percent": "0",
  "base_rate": "5.4700",
  "client_rate": "5.4700",
  "spread_revenue_amount": "0",
  "spread_revenue_currency": "USD",
  "id": "7e1f2a3b-4c5d-4e6f-8a9b-0c1d2e3f4a5b",
  "direction": "BRL_TO_USD",
  "status": "payout_submitted",
  "payer_role": "self",
  "customer_reference_id": "cust_7781",
  "payin_amount": "50000.00",
  "payin_currency": "BRL",
  "payout_amount": "9140.77",
  "payout_currency": "USD",
  "locked_rate": "5.4700",
  "spread_bps": 0,
  "quote_expires_at": "2026-09-28T14:10:00Z",
  "payin_expires_at": "2026-09-28T14:05:00Z",
  "usd_receive_method": "swift",
  "cover_fee_usd": "15.00",
  "cover_fee_payin_amount": "82.05",
  "cover_fee_payin_currency": "BRL",
  "total_payin_amount": "50082.05",
  "payout_destination": {
    "bank_account_id": "ba_4f7c2d9e1a3b",
    "name": "Member Co operating",
    "beneficiary_name": "Member Co LLC"
  },
  "failure_reason": null,
  "share_token": "q3V9xkT2bLr8…",
  "share_url": "https://developers.crebitpay.com/fiat/pay/q3V9xkT2bLr8…",
  "payment_instructions": [],
  "created_at": "2026-09-28T14:00:00Z",
  "updated_at": "2026-09-28T14:00:00Z",
  "swift_compliance": {
    "required": true,
    "status": "compliance_reviewing",
    "document_type": "invoice",
    "document_id": "INV-2026-0042",
    "submitted_at": "2026-09-28T14:30:02Z"
  }
}

swift_compliance.status moves from waiting_documents to compliance_reviewing to approved.

List Orders

The member's spot orders, newest first. Optional status filter and limit (1-200, default 100). List items don't include payment instructions; get the order for those. For spot and forward orders together with pagination, use GET /api/v1/fiat/orders.

HTTP code sample
curl -sS -X GET "https://lock-apis.crebitpay.com/api/v1/fiat/spot/orders?status=settled&limit=50" \
  -H "X-Crebit-Key-Id: ADMIN_KEY_ID" \
  -H "X-Crebit-Key-Secret: ADMIN_KEY_SECRET" \
  -H "X-Crebit-Environment: production" \
  -H "X-Crebit-Acting-As-Partner-Id: 8f3c2a1e-4b5d-4e6f-9a7b-1c2d3e4f5a6b"
json, response code sample
json, response
{
  "items": [
    {
      "spread_percent": "0",
      "base_rate": "5.4700",
      "client_rate": "5.4700",
      "spread_revenue_amount": "0",
      "spread_revenue_currency": "USD",
      "id": "7e1f2a3b-4c5d-4e6f-8a9b-0c1d2e3f4a5b",
      "direction": "BRL_TO_USD",
      "status": "settled",
      "payer_role": "self",
      "customer_reference_id": "cust_7781",
      "payin_amount": "50000.00",
      "payin_currency": "BRL",
      "payout_amount": "9140.77",
      "payout_currency": "USD",
      "locked_rate": "5.4700",
      "spread_bps": 0,
      "quote_expires_at": "2026-09-28T14:10:00Z",
      "payin_expires_at": "2026-09-28T14:05:00Z",
      "usd_receive_method": "wire",
      "cover_fee_usd": "15.00",
      "cover_fee_payin_amount": "82.05",
      "cover_fee_payin_currency": "BRL",
      "total_payin_amount": "50082.05",
      "payout_destination": {
        "bank_account_id": "ba_4f7c2d9e1a3b",
        "name": "Member Co operating",
        "beneficiary_name": "Member Co LLC"
      },
      "failure_reason": null,
      "share_token": "q3V9xkT2bLr8…",
      "share_url": "https://developers.crebitpay.com/fiat/pay/q3V9xkT2bLr8…",
      "payment_instructions": [],
      "created_at": "2026-09-28T14:00:00Z",
      "updated_at": "2026-09-28T14:21:40Z",
      "swift_compliance": null
    }
  ]
}

Share and Receipt

Share the Payment Instructions

Ready-made text and links for the payer (useful with payer_role: third_party). The share_url opens a public payment page.

HTTP code sample
curl -sS -X GET "https://lock-apis.crebitpay.com/api/v1/fiat/spot/orders/7e1f2a3b-4c5d-4e6f-8a9b-0c1d2e3f4a5b/share" \
  -H "X-Crebit-Key-Id: ADMIN_KEY_ID" \
  -H "X-Crebit-Key-Secret: ADMIN_KEY_SECRET" \
  -H "X-Crebit-Environment: production" \
  -H "X-Crebit-Acting-As-Partner-Id: 8f3c2a1e-4b5d-4e6f-9a7b-1c2d3e4f5a6b"
json, response code sample
json, response
{
  "order_id": "7e1f2a3b-4c5d-4e6f-8a9b-0c1d2e3f4a5b",
  "share_token": "q3V9xkT2bLr8…",
  "share_url": "https://developers.crebitpay.com/fiat/pay/q3V9xkT2bLr8…",
  "share_text": "Pay 50082.05 BRL (BRL TO USD)\nRail: PIX\nPIX: 00020126580014br.gov.bcb.pix0136…",
  "mailto_url": "mailto:?subject=…&body=…",
  "whatsapp_url": "https://wa.me/?text=…"
}

Download the Receipt

Returns a PDF (application/pdf, sent as an attachment).

HTTP code sample
curl -sS -X GET "https://lock-apis.crebitpay.com/api/v1/fiat/spot/orders/7e1f2a3b-4c5d-4e6f-8a9b-0c1d2e3f4a5b/receipt" \
  -H "X-Crebit-Key-Id: ADMIN_KEY_ID" \
  -H "X-Crebit-Key-Secret: ADMIN_KEY_SECRET" \
  -H "X-Crebit-Environment: production" \
  -H "X-Crebit-Acting-As-Partner-Id: 8f3c2a1e-4b5d-4e6f-9a7b-1c2d3e4f5a6b"

Errors

Spot-specific codes. Readiness, bank account, limit and idempotency errors are on the fiat overview.

StatuscodeWhen
400bad_requestUnsupported direction (EUR pay-in is not supported), invalid amount, BRL pay-in below 5.00
400(per-transaction limit)Amount outside the member's per-transaction USD range; details include min_usd and max_usd
400fiat_daily_limit_exceeded / fiat_monthly_limit_exceededMember's volume cap reached
403fiat_virtual_account_not_readyUSD_TO_BRL or USD_TO_EUR before the USD deposit account is approved
400fiat_payout_bank_rail_mismatchPayout bank type does not match the corridor
404not_foundcustomer_reference_id not registered for the member
404fiat_spot_order_not_foundUnknown order id, or an order of another partner
502live_spot_rate_unavailableLive rate unavailable; retry
400not_swift_payoutCompliance documents sent for a non-SWIFT order
409payout_not_submittedCompliance documents sent before the order is payout_submitted
400document_requiredDocument file missing for a non first_party document type
400document_too_largeDocument over about 8 MB
  1. Expired orders can't be revived. Create a new order (with a new Idempotency-Key).
  2. For a failed order, check failure_reason and contact Crebit if funds were received.