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 productWhat it doesAPI
Seller onboardingEach seller becomes a connected account with a client account that receives its salesclients.create, client_accounts.create
Taking the paymentA hosted payment page for each order, paid into the seller's accountCrypto checkout
Seller earningsWhat each seller received and their balanceclient_accounts.balances, deposits.list
ReconciliationDeposits per seller, exports for finance, eventsdeposits.list, operations_activity_exports.create, events.list, webhook subscriptions
Seller payoutsSend a seller's balance to their own walletwithdrawal_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/profile returns it in workspace.ref, for example enterprises/11111111-1111-4111-8111-111111111111.

  • Capabilities for the service account's role:

    StepCapabilities
    1. Create a sellerclients.create, clients.read, accounts.create, accounts.read
    Reconciledeposits.read, accounts.read, operations_reports.create_export, events.read, webhooks.create
    Pay outwithdrawal_destinations.create, withdrawals.create
    Sandbox simulationssandbox_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
  1. When a seller signs up, your server creates a connected account (API: client) for them and a client account that will receive their sales.
  2. A buyer pays for an order on a hosted payment page of Crypto checkout, and the money is credited to the seller.
  3. 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
POST https://b2b2x-sandbox.youhodler.com/api/clients
Authorization: Bearer <access_token>
Idempotency-Key: seller-pampa-leather
Content-Type: application/json
{
  "scope_ref": "enterprises/11111111-1111-4111-8111-111111111111",
  "display_name": "Pampa Leather Co.",
  "external_id": "seller-pampa-leather",
  "metadata": {"marketplace_seller_id": "seller-pampa-leather"}
}

Keep 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
POST https://b2b2x-sandbox.youhodler.com/api/client-accounts
Authorization: Bearer <access_token>
Idempotency-Key: seller-pampa-leather-sales
Content-Type: application/json
{
  "scope_ref": "clients/88888888-8888-4888-8888-888888888888",
  "display_name": "Sales"
}

Store 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_ref set to the seller's account; a deposit's fee_summary breaks 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, held and total per 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
POST https://b2b2x-sandbox.youhodler.com/api/internal-transfers
Authorization: Bearer <access_token>
Idempotency-Key: commission-ORD-1042
Content-Type: application/json
{
  "source_ref": "client-accounts/33333333-3333-4333-8333-333333333333",
  "target_ref": "master-accounts/22222222-2222-4222-8222-222222222222",
  "amount": {"value": "4.50", "currency": "USDT"}
}

The 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_ref set 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.read on the receiving account. Match its order_id to the order in your shop.
  • Events. The platform's own events cover the account side, for example operations.deposit.settled.v1 for 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
POST https://b2b2x-sandbox.youhodler.com/api/operations-activity-exports
Authorization: Bearer <access_token>
Idempotency-Key: export-2026-10-sellers
Content-Type: application/json
{
  "format": "csv",
  "requested_scope": {
    "kind": "enterprise",
    "ref": "enterprises/11111111-1111-4111-8111-111111111111"
  },
  "filter_criteria": {
    "date_from_utc": "2026-10-01T00:00:00Z",
    "date_to_utc": "2026-10-31T23:59:59Z",
    "client_refs": ["clients/88888888-8888-4888-8888-888888888888"],
    "operation_families": ["deposit"]
  }
}

Read 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
POST https://b2b2x-sandbox.youhodler.com/api/withdrawals
Authorization: Bearer <access_token>
Idempotency-Key: payout-pampa-2026-10
Content-Type: application/json
{
  "account_ref": "client-accounts/33333333-3333-4333-8333-333333333333",
  "amount": {"value": "40.00", "currency": "USDT"},
  "rail": "crypto",
  "destination_id": "44444444-4444-4444-8444-444444444444"
}

The 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.

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

  1. 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_stage or kyc_stage is verified, usually in a few minutes.
  2. Take a test payment for the seller as described under Test on sandbox in the Crypto checkout guide.
  3. Check the deposit and the seller's balance, then pay part of it out (above).