Before you start
- A sandbox API key (
sk_sandbox_...). See Authentication. - The
connectcapabilityactiveon your account. See Become a platform.
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 Copy the
merchant and recipient as keys in configuration, and name each capability it needs under the persona it belongs to.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 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.
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.3
Create the product as the account
The account is selling, so the product is the account’s. Copy the product
X-Account-Id is what makes a call act as the account rather than as you.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.checkout_id and checkout_url.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 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
status is completed. Note the X-Account-Id: this is the account’s checkout.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 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 fromrequirements.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.

