Docs
llms.txt for AI agents Download OpenAPI spec

Organizations / Crypto / Client Spread

Client Spread on Crypto Rate Locks

As an organization admin you can add your own markup to a member's crypto rate lock (option or forward). Send an optional spread_percent with your admin keys and X-Crebit-Acting-As-Partner-Id. The member pays a slightly higher upfront amount; the locked rate and settlement payout stay the same. Your organization earns the difference when the contract is funded.

Everything else about the lock (customer reference, quote, contract, funding, exercise, margin calls and webhooks) works as described on the Crypto page. This page only covers what the spread adds. Examples use thesandbox host https://lock-apis-sandbox.crebitpay.com.

Fiat Spot and Deliverable Forward use a different model: the spread changes the client rate and revenue is recorded at settlement. See Fiat: Client spread.

Who Can Set a Spread

  • Only an organization admin calling with the acting-as header for an active member of their own organization.
  • A member calling with its own keys, or an admin calling for its own partner without the acting-as header, gets 403 client_spread_not_allowed for any non-zero spread.
  • The spread is chosen per quote. There is no saved default per member: if you leave it out, no spread is applied.
  • Applies to both contract_type forward and option.

The spread_percent Value

RuleDetail
UnitPercent of USD notional: "0.5" means 0.5% (not 50%)
Range0 to 5
PrecisionUp to 8 decimal places (for example 0.1, 0.125, 0.1255, 0.0001)
TypeDecimal string (recommended) or JSON number; booleans are rejected
OptionalOmitted, empty string and 0 are the same: no spread
Accepted onPOST /api/v1/fx/quotes (and the portal quote preview and quotes)

How the Economics Work

Unlike fiat, crypto client spread does not change locked_rate. It is a fixed USD add-on to what the member pays upfront:

QuantityFormula
spread_revenue_amountusd_notional × spread_percent / 100, rounded half-up to cents
amount_due (and premium / upfront fee)Crebit base amount_due + spread_revenue_amount
locked_rateUnchanged
deposit / settlement payoutUnchanged

Example: USD notional 50,000 with a 0.5% spread. Revenue is 250.00 USD. If Crebit's amount due was 5,565.00, the member's amount_due becomes 5,815.00. The strike stays 5.4200 and the settlement formula is unchanged.

Quote with a Spread

Preview

Add spread_percent to the normal preview body. The response includes the breakdown fields when you call as an org admin acting as the member.

HTTP code sample
curl -sS -X POST "https://lock-apis-sandbox.crebitpay.com/api/v1/fx/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: sandbox" \
  -H "X-Crebit-Acting-As-Partner-Id: 8f3c2a1e-4b5d-4e6f-9a7b-1c2d3e4f5a6b" \
  -d '{"contract_type":"option","direction":"USD_TO_BRL","notional_currency":"USD","notional_amount":"50000.00","strike_mode":"live_spot","window_start":"2026-11-02T00:00:00Z","window_end":"2026-11-09T00:00:00Z","chain":"solana","settlement_currency":"USDC","spread_percent":"0.5"}'

Create the Quote

Send the same spread_percent on quote create. The spread is frozen on the quote: amount_due, premium_amount /upfront_fee and total_amount already include it.

HTTP code sample
curl -sS -X POST "https://lock-apis-sandbox.crebitpay.com/api/v1/fx/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: sandbox" \
  -H "X-Crebit-Acting-As-Partner-Id: 8f3c2a1e-4b5d-4e6f-9a7b-1c2d3e4f5a6b" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"customer_reference_id":"member-cust-0042","customer_name":"Member Customer Ltda","contract_type":"forward","direction":"USD_TO_BRL","notional_currency":"USD","notional_amount":"50000.00","strike_mode":"live_spot","window_start":"2026-11-02T00:00:00Z","window_end":"2026-11-09T00:00:00Z","chain":"solana","settlement_currency":"USDC","payout_wallet_address":"EndUserSettlementWa11et1111111111111111111","oracle":"redstone","spread_percent":"0.5"}'
json, response (other quote fields omitted) code sample
json, response (other quote fields omitted)
{
  "id": "22222222-2222-4222-8222-222222222222",
  "status": "created",
  "locked_rate": "5.4200",
  "premium_amount": "815.00",
  "deposit_amount": "5000.00",
  "total_amount": "5815.00",
  "amount_due": "5815.00",
  "collateral_amount": "5000.00",
  "upfront_fee": "815.00",
  "spread_percent": "0.5",
  "base_amount_due": "5565.00",
  "spread_revenue_amount": "250.00",
  "spread_revenue_currency": "USD",
  "expires_at": "2026-09-28T14:16:30Z"
}

Contract and Funding

Create the contract from the quote as usual (POST /api/v1/fx/contracts). The contract inherits the frozen spread from the quote. You cannot change the spread after the quote is created.

When the member funds the deposit and the contract becomes active, Crebit credits spread_revenue_amountonce to your organization's spread ledger. Recovering a failed contract to active also credits once (idempotent per contract).

json, POST /api/v1/fx/contracts response for org admin acting-as (fields omitted) code sample
json, POST /api/v1/fx/contracts response for org admin acting-as (fields omitted)
{
  "id": "33333333-3333-4333-8333-333333333333",
  "status": "quote_created",
  "locked_rate": "5.4200",
  "amount_due": "5815.00",
  "deposit_amount": "5000.00",
  "premium_amount": "815.00",
  "spread_percent": "0.5",
  "base_amount_due": "5565.00",
  "spread_revenue_amount": "250.00",
  "spread_revenue_currency": "USD"
}
Portal contract list and detail return the breakdown under client_spread when you are acting as a member. Public GET /api/v1/fx/contracts responses currently omit the breakdown until that path wires include_spread; use quote responses or the partner portal for reconciliation in the meantime.

Response Fields

FieldMeaning
spread_percentApplied spread as a percent string; "0" when none
base_amount_dueCrebit amount_due before your markup
spread_revenue_amountYour organization's revenue for this lock (USD)
spread_revenue_currencyAlways USD
amount_due / premium_amount / upfront_feeAlready include the revenue
locked_rateUnchanged by the spread

Frozen at Create

The spread percent, base amount due and revenue are saved on the quote and copied to the contract. They never change afterwards, through funding, exercise and settlement. A different spread on a later quote does not affect earlier contracts.

HTTP code sample
curl -sS -X GET "https://lock-apis-sandbox.crebitpay.com/api/v1/fx/quotes/22222222-2222-4222-8222-222222222222" \
  -H "X-Crebit-Key-Id: ADMIN_KEY_ID" \
  -H "X-Crebit-Key-Secret: ADMIN_KEY_SECRET" \
  -H "X-Crebit-Environment: sandbox" \
  -H "X-Crebit-Acting-As-Partner-Id: 8f3c2a1e-4b5d-4e6f-9a7b-1c2d3e4f5a6b"

What the Member Sees

Your spread is not shown to the member. When the member calls with its own keys (or uses its own partner portal), the breakdown fields are null. The member still sees the higher amount_due they must fund — they just do not see that part of it is your markup.

HTTP code sample
curl -sS -X GET "https://lock-apis-sandbox.crebitpay.com/api/v1/fx/contracts/33333333-3333-4333-8333-333333333333" \
  -H "X-Crebit-Key-Id: MEMBER_KEY_ID" \
  -H "X-Crebit-Key-Secret: MEMBER_KEY_SECRET" \
  -H "X-Crebit-Environment: sandbox"
json, member's own view (other fields omitted) code sample
json, member's own view (other fields omitted)
{
  "id": "33333333-3333-4333-8333-333333333333",
  "status": "active",
  "locked_rate": "5.4200",
  "amount_due": "5815.00",
  "deposit_amount": "5000.00",
  "premium_amount": "815.00",
  "spread_percent": null,
  "base_amount_due": null,
  "spread_revenue_amount": null,
  "spread_revenue_currency": null
}

Spread Revenue

  1. Revenue is calculated in USD when the quote is created and shown in spread_revenue_amount.
  2. When the contract reaches active (deposit funded), Crebit records that amount once for your organization. Quotes that expire unused, and locks with no spread, record nothing.
  3. Fiat and crypto credits share one organization ledger (all USD). Net revenue = credits − reversals. Crebit ops can reverse a crypto credit (for example after a refund).
  4. In the partner portal, open Organization → Revenue for combined totals, per-member breakdown and the ledger (period filters: all time, this month, last month, last 30 days).
  5. The same data is available to the signed-in organization admin (not while acting as a member) at GET /api/v1/portal/organisation/spread-revenue.
HTTP code sample
curl -sS -X GET "https://lock-apis-sandbox.crebitpay.com/api/v1/portal/organisation/spread-revenue?limit=50" \
  -H "Authorization: Bearer PORTAL_SESSION_TOKEN"
json, response (entry fields abbreviated) code sample
json, response (entry fields abbreviated)
{
  "organisation_id": "oooooooo-oooo-4ooo-8ooo-oooooooooooo",
  "currency": "USD",
  "total_credited": "245.00",
  "entry_count": 3,
  "totals": {
    "credited": "250.00",
    "reversed": "5.00",
    "net": "245.00",
    "fiat_net": "0",
    "crypto_net": "245.00",
    "credit_count": 2,
    "reversal_count": 1
  },
  "members": [
    {
      "member_partner_id": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
      "member_name": "Member Partner Ltda",
      "credited": "250.00",
      "reversed": "5.00",
      "net": "245.00",
      "fiat_net": "0",
      "crypto_net": "245.00",
      "credit_count": 2,
      "reversal_count": 1
    }
  ],
  "payout_wallet": null,
  "entries": [
    {
      "id": "eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee",
      "entry_type": "spread_credit",
      "source_product": "fx_forward",
      "fx_contract_id": "33333333-3333-4333-8333-333333333333",
      "member_partner_id": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
      "member_name": "Member Partner Ltda",
      "amount": "250.00",
      "currency": "USD",
      "spread_percent": "0.5",
      "created_at": "2026-09-28T14:35:08Z"
    }
  ],
  "next_cursor": null
}

Query parameters: created_from / created_to (period), member_partner_id (filters the entry list only; totals stay org-wide for the period), limit and cursor for paging entries.

Revenue is recorded by Crebit. Automated org payout of crypto spread balances is not yet available in the API; Crebit ops can configure a payout wallet on the organization. Contact Crebit for statements and payout.

Errors

StatuscodeWhen
400invalid_spread_percentNot a number, negative, above 5, or more than 8 decimal places
422validation_errorspread_percent sent as a boolean, or unknown fields on the body
403client_spread_not_allowedNon-zero spread without the acting-as header, or by a caller that is not the member's organization admin
403acting_as_not_allowedThe partner is not an active member of your organization
400acting_as_selfActing-as header names your own partner id

Shared crypto errors are on the Crypto page.