Marketplaces and checkouts
You run a marketplace or an online shop and want buyers to pay in crypto, with each payment credited to the seller who made the sale. This guide shows how to give every seller an account, where the buyer's payment comes in, and how to reconcile and pay the seller out.
What you build
| Part of your product | What it does | API |
|---|---|---|
| Seller onboarding | Each seller becomes a connected account with a client account that receives its sales | clients.create, client_accounts.create |
| Taking the payment | A hosted payment page for each order, paid into the seller's account | Crypto checkout |
| Seller earnings | What each seller received and their balance | client_accounts.balances, deposits.list |
| Reconciliation | Deposits per seller, exports for finance, events | deposits.list, operations_activity_exports.create, events.list, webhook subscriptions |
| Seller payouts | Send a seller's balance to their own wallet | withdrawal_destinations.create, withdrawals.create |
Before you start
-
Sandbox access and a service account. Create the service account in the console under API Keys and exchange its credentials for a token as described in Authentication. New to the API? Do the Quickstart first.
-
Your enterprise ref.
GET /me/profilereturns it inworkspace.ref, for exampleenterprises/11111111-1111-4111-8111-111111111111. -
Capabilities for the service account's role:
Step Capabilities 1. Create a seller clients.create,clients.read,accounts.create,accounts.readReconcile deposits.read,accounts.read,operations_reports.create_export,events.read,webhooks.createPay out withdrawal_destinations.create,withdrawals.createSandbox simulations sandbox_simulator.run -
Concepts worth five minutes: Topology and refs (enterprise, connected accounts and their accounts), Accounts (balances) and Operations (the shared status model of deposits, transfers and withdrawals).
Samples use the sandbox base URL. Money is always an object with a decimal
string, such as {"value": "45.00", "currency": "USD"}.
How it works
sequenceDiagram
participant Buyer
participant Shop as Your server
participant Checkout as Crypto checkout
participant API as Business API
Shop->>API: POST /clients and POST /client-accounts for each seller
Buyer->>Shop: Pay for an order
Shop->>Checkout: payment request for the seller
Shop-->>Buyer: redirect to the hosted payment page
Buyer->>Checkout: sends the crypto
Checkout-->>Shop: webhook once the seller's account is credited
Shop->>API: GET /deposits and balances of the seller account
Shop->>API: POST /withdrawals to pay the seller out
- When a seller signs up, your server creates a connected account (API:
client) for them and a client account that will receive their sales. - A buyer pays for an order on a hosted payment page of Crypto checkout, and the money is credited to the seller.
- Later, your server reads the seller's deposits and balance to reconcile, and pays the seller out with a withdrawal.
Step 1 — Create the seller and their account
Each seller is a connected account (API: client) under your enterprise.
Send your own seller id as external_id, so that you can find the seller
again with GET /clients?scope_ref=<enterprise ref>&external_id=…
(scope_ref is required).
Create the connected account
POST https://b2b2x-sandbox.youhodler.com/api/clients
Authorization: Bearer <access_token>
Idempotency-Key: seller-pampa-leather
Content-Type: application/jsonKeep id from the 201 response: the seller's ref is clients/<id>. The
client comes with a first client account (default_client_account). To keep
sales apart from anything else the seller holds, open a dedicated client
account for them:
Open the seller's sales account
POST https://b2b2x-sandbox.youhodler.com/api/client-accounts
Authorization: Bearer <access_token>
Idempotency-Key: seller-pampa-leather-sales
Content-Type: application/jsonStore the returned id as the seller's receiving account,
client-accounts/<id>. In the console the seller appears under
Connected accounts, and this account as a client account of that
connected account.
Verify the seller before the first sale. A connected account counts as
verified when GET /clients/{client_id} returns kyb_stage verified (a
company) or kyc_stage verified (a person). The platform refuses a deposit
address for an unverified seller's account
(Provision funding endpoint
answers 422 not_admissible with CLIENT_NOT_VERIFIED), and Crypto checkout
takes payments only for verified connected accounts. Start verification as
described in
Crypto apps and embedded finance
(step 1). On sandbox Sandbox-only: Works on sandbox only. These routes return 404 in production. you can approve it with
Simulate client verification review.
Step 2 — Take the buyer's payment
Use Crypto checkout (beta) on sandbox. Connect the
seller's receiving account to Checkout and use a platform access token with
deposits.read and funding_endpoints.provision on that account. Create a
checkout with the seller's account_ref and your order_id, then send the
buyer to the returned hosted page. When a webhook arrives, read the checkout
and fulfil the order once its status is paid.
Where the money lands
A payment settles into the seller's connected account, so nothing has to be split afterwards: the deposit and the balance belong to the seller, and that is the attribution.
- What arrived. Each payment becomes a crypto deposit on the seller's
account. List deposits with
account_refset to the seller's account; a deposit'sfee_summarybreaks the fee into components. Crypto checkout reports the same payment per order, with its gross, fees and net; see Fees. - The seller's balance.
Get client-account balances
for the seller's account shows
available,heldandtotalper asset.
Take your commission. Two ways exist today. A fee in your enterprise
commercial agreement for the deposit_crypto service, for all connected
accounts or for one, is deducted from every crypto deposit into that
seller's accounts and paid into your enterprise's default master account.
It appears as an enterprise_fee component in the deposit's fee_summary.
See Commercial agreements.
Or move your share yourself with an internal transfer from the seller's
client account to your master account after the sale:
Move the commission to your master account
POST https://b2b2x-sandbox.youhodler.com/api/internal-transfers
Authorization: Bearer <access_token>
Idempotency-Key: commission-ORD-1042
Content-Type: application/jsonThe transfer answers 202 and follows the shared
operation statuses; it is done when its status is
settled.
If you prefer to hold buyers' money yourself and pay sellers later, take
payments with one of your master accounts as the checkout’s account_ref, and move each seller's share with the same internal
transfer, master account to client account.
Reconcile
- Per seller, from deposits.
List deposits with
account_refset to the seller's account. - Per order, from Crypto checkout. Use the checkout ID to read the payment with a
platform token that has
deposits.readon the receiving account. Match itsorder_idto the order in your shop. - Events. The platform's own events cover the account side, for example
operations.deposit.settled.v1for each credited deposit. Subscribe with a webhook subscription and backfill with List events. These are separate from the Crypto checkout webhooks: checkout says which order was paid, platform events say what happened on the account. See Transaction lifecycle and webhooks and Events and webhooks.
For finance, an operations activity export covers a period, filtered to sellers or accounts and to deposits:
Export a month of seller deposits
POST https://b2b2x-sandbox.youhodler.com/api/operations-activity-exports
Authorization: Bearer <access_token>
Idempotency-Key: export-2026-10-sellers
Content-Type: application/jsonRead the export until its status is ready, then download it from
download_path. See
Create operations activity export.
Pay sellers out
A seller's balance stays in their client account until you move it. To send
it to the seller's own wallet, register the wallet once as a withdrawal
destination for the seller (withdrawal_destinations.create with
scope_ref set to the seller's clients/<id>), then withdraw from the
seller's account:
Pay a seller out
POST https://b2b2x-sandbox.youhodler.com/api/withdrawals
Authorization: Bearer <access_token>
Idempotency-Key: payout-pampa-2026-10
Content-Type: application/jsonThe withdrawal answers 202 and is final at settled, failed or
cancelled. Policies can send it to approval first (pending_approval).
The full walkthrough, including destinations and statuses, is step 5 of
Crypto apps and embedded finance;
for fiat payouts see
Treasury and international payments.
Refunds, invoices and payment links
The platform API has no refund, invoice or payment-link operation of its own. For a hosted crypto payment page on sandbox, create a checkout for the order and use its returned URL. See Crypto checkout (beta).
Test it on sandbox
- Create a seller and their account (step 1), start the seller's
verification session, then approve it with
Simulate client verification review
Sandbox-only: Works on sandbox only. These routes return 404 in production.. Read the client until
kyb_stageorkyc_stageisverified, usually in a few minutes. - Take a test payment for the seller as described under Test on sandbox in the Crypto checkout guide.
- Check the deposit and the seller's balance, then pay part of it out (above).
Related
- Crypto checkout: payment requests, the hosted page, statuses, webhooks and beta limits.
- Topology and refs, Accounts, Operations.
- Crypto apps and embedded finance for verification, deposits and withdrawals per connected account.