Skip to main content
Each business on your platform transacts with its own customers, who often do not know you exist. So the account is the merchant of record: the charge is its sale, the money lands in its balance, and your cut comes back to you. In this guide you’ll create an account that sells, take a payment as that account, and read your fee back. By the end you’ll have run a full direct charge without moving real money.

Before you start

Every request below goes to https://sandbox-api.bachs.io. Going live is the same calls against https://api.bachs.io with an sk_live_ key. See Take Connect live.

Steps

1

Create the account, as a merchant

This account takes its own payments and gets paid out, so it needs both personas. Name merchant and recipient as keys in configuration, and name each capability it needs under the persona it belongs to.
Copy the id. Every step below uses it as the account id.The response lists exactly the five capabilities named above, one status per capability. In sandbox they are granted immediately; in live they start pending_review until a reviewer enables them. See Capabilities and Testing Connect.
2

Let it hold the currency it sells in

Holding a currency decides what the account settles in. A new account holds only USD. This walkthrough sells a subscription in NGN, so give the account NGN: its takings then stay in NGN instead of converting to USD on the way to the balance. Today holding the price currency is also required to create a recurring checkout at all (an unheld one is refused with BASE_CURRENCY_NOT_HELD_BY_ORG until renewals settle to USD like one-time charges do), so an account selling an NGN plan has to hold NGN first either way. Not every currency Bachs collects in can be held as a balance, so check Balance currencies before you build against one.
USD is always held, cannot be turned off, and does not appear in the list. See Accounts for the field, and Balance currencies for what you can ask for.
Skip this step and the checkout below is refused with BASE_CURRENCY_NOT_HELD_BY_ORG. It is the account’s own currencies that decide this, not yours.
3

Create the product as the account

The account is selling, so the product is the account’s. X-Account-Id is what makes a call act as the account rather than as you.
Copy the product id. Note organization_id: the product belongs to the account.
4

Create the checkout as the account

X-Account-Id, on its own, is what makes this a direct charge: the account becomes the merchant of record and the sale lands in its balance. platform_fee is your cut, taken out of its proceeds.
Copy the checkout_id and checkout_url.
This checkout is the account’s, not yours. Every later read of it needs X-Account-Id too. Without the header the answer is 404 Checkout not found, which reads as though the checkout was never created.
5

Send the customer to pay

In your integration the account’s customer pays on the page we host at checkout_url. To finish this guide, open the link and complete the payment there.This account is in sandbox, so the payment is simulated, no funds move. See Sandbox testing.
6

Confirm the payment landed

Read the checkout back until status is completed. Note the X-Account-Id: this is the account’s checkout.
In your integration you would not poll for this. Subscribe to checkout.completed instead. A direct charge’s event originates with the account, so your webhook endpoint needs event_source set to connect or all to receive it. See Connect events.
7

Read your cut back

Your fee is not a transfer: it settles as its own record once the charge settles, never sooner. Read it from GET /v1/platform_fees:
collected_from is the account and earned_by is you, because the sale was theirs and the fee is yours. charge ties it back to the sale.
8

Read the account's balance

The whole sale, accounted for:The account bears our processing fee because it is the merchant of record. That is the default, and Processing fees covers moving it. Your 10000.00 arrives whole.

How this differs from a marketplace

The same two calls, with the parties swapped. If you are still choosing, see Choose your integration.

What happens next

The account can withdraw its balance once it has given you a payout destination, which is one of the requirements it still owes. Read what is outstanding from requirements.currently_due on the account. A refund or a lost dispute debits the account here, not you. That is the point of this shape, and the reason its onboarding is longer than a marketplace seller’s. See Refunds and Disputes.

Next steps