Test this flow in sandbox. Margin is on by default there, so you can build
against it before it’s enabled on live. Start with the sandbox
quickstart, then conversion
simulation, and the cheat
sheet for every magic value and simulate endpoint.
Prerequisites
- Margin enabled for your organization on live. Until it is, any request carrying one returns
403 CLIENT_MARKUP_NOT_ENABLED. Contact Conduit to enable it. - An
activecustomer, and whatever that movement needs on its own — see Transact. - Your API key.
Which movements can carry a margin
The two shapes
Send one, both, or neither.Step 1 — Declare a margin on a conversion
markup.assetAmount is the whole margin — the percentage part plus the flat part — in the order’s source asset, fixed at quote time. The percentage is charged on the principal, not on the amount you sent: on a source-locked order the principal is amount less Conduit’s fee and less your flat margin, so 50 bps here earns 98.50 x 0.005 = 0.4925 on top of the 1.00 flat. owner on each fees[] entry tells the two charges apart: conduit is Conduit’s fee, you is your own money. Only the flat part appears there, because the percentage is already inside endUserRate.
A margin that comes to less than one minor unit of the source asset accrues
nothing, and
markup is then absent from the response. The rate still carries
the percentage. Declaring 1 bps on a USD 1.00 order is the case to watch.markupBps cannot ride a quote redemption — the locked rate is never recomputed, so there is nothing to fold it into. markupAmount works there and always adds to totalDebit.
Step 2 — Declare a margin on a fiat payout
assetAmount in full. The customer’s account is debited that amount plus Conduit’s fee plus your margin. Read it back on the payout’s fees[] as the entry with owner: "you".
To take a margin on the payout leg chained to a conversion, put the same two fields inside the order’s autoPayout block. That leg spends the order’s converted output, so the margin comes out of it: your recipient receives destinationAsset.amount less your margin and less Conduit’s payout fee. It is separate from the conversion’s own markup, and it accrues when the payout succeeds.
Step 3 — Read what you earned
A margin accrues when the movement succeeds, never before. A movement that never succeeds accrues nothing. A fiat payout that succeeded and was later returned by the receiving bank is the one case that is not either/or, and it has three shapes. If the monthly sweep had already claimed the accrual when the return opened, the reversal posts a second, negative line against the same transaction id — expect two lines for that payout and net them. If the return opened first, the sweep never claims it at all, and the payout contributes no line. Rarely, a returned payout keeps its positive line alone, unreversed — Conduit detects those and corrects them, and you need do nothing. Reconcile for all three shapes; neither a missing line nor an unreversed one is a discrepancy on your side.GET /v2/markup/statement-lines — one line per movement, newest first, over conversions and payouts alike. Each line names the movement, the percentage and flat amount you declared, what it accrued, the end customer, and when it succeeded.
Getting paid
Balances are paid monthly against a statement, one per asset per calendar month in UTC. Read them atGET /v2/markup/statements.
A line can be negative. If a receiving bank returns a payout you took a margin on, Conduit no longer holds your customer’s money and no longer owes you the margin, so the reversal posts as a negative line on the open statement and reduces what that period settles.
Errors
See also
- Charge a fee on a deposit — the one flow that carries no margin field, and what to do instead.
- Convert crypto and Send a payout — the movements a margin rides on.
- Quote before you order — a quote is always priced without your margin.