Payments
Developer-facing Amba Payments admin surface — onboard a connected account, set the platform fee, create charges, and read balance + payouts.
The admin payments surface onboards your app to accept payments, configures the platform fee, creates charges server-side, and reports your balance + payouts. Your app is the seller; Amba is the platform that takes a configurable fee; the money settles to your own connected account. See the Payments guide for the end-to-end flow.
All routes mount under /v1/admin/projects/:projectId/payments/* and require
developer credentials (a PAT or console session) — payments configuration is
an owner action. The end-user (app-side) intent surface is documented at
Client API — payments.
Amba Payments availability is enabled per platform. Routes that move money or hit the payment
provider return 503 PAYMENTS_NOT_ENABLED until the platform owner finishes enabling it. Pure
status reads off Amba's own state (GET /accounts) work regardless. Check amba payments status.
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /admin/projects/:projectId/payments/accounts | Create the project's connected account (idempotent — returns existing). |
| POST | /admin/projects/:projectId/payments/accounts/link | Generate a hosted onboarding setup link (single-use, short-lived). |
| GET | /admin/projects/:projectId/payments/accounts | Read connected-account status (onboarding + capability flags). |
| PUT | /admin/projects/:projectId/payments/config | Set the default platform fee (basis points). |
| POST | /admin/projects/:projectId/payments/charges | Create a charge with a platform fee on behalf of the connected account. |
| GET | /admin/projects/:projectId/payments/balance | Read the connected account's balance. |
| GET | /admin/projects/:projectId/payments/payouts | List the connected account's payouts. |
POST /admin/projects/:projectId/payments/accounts
Creates the project's connected account. Idempotent — if an account already exists it is returned unchanged (one project → one account).
Request
| Field | Type | Required | Description |
|---|---|---|---|
country | string | no | Two-letter uppercase ISO country code (e.g. US). |
email | string | no | Email to seed onboarding with. |
Response 201
An idempotent return of an existing account responds 200 with the same shape.
Errors
400 INVALID_BODY— body is not valid JSON.503 PAYMENTS_NOT_ENABLED— Amba Payments is not enabled on this platform yet.503 CONTROL_PLANE_UNAVAILABLE— could not read/persist the account; retry.502 STRIPE_UNAVAILABLE— the payment provider is unavailable; retry.
POST /admin/projects/:projectId/payments/accounts/link
Generates a hosted onboarding setup link the developer opens to finish account setup (business + bank details). The URL is single-use and short-lived — request a fresh one each time. Surface it to the human as a copy box.
Response 200
Errors
409 NO_CONNECTED_ACCOUNT— create the account first (POST /payments/accounts).503 PAYMENTS_NOT_ENABLED— Amba Payments is not enabled on this platform yet.503 CONTROL_PLANE_UNAVAILABLE— could not read the account; retry.502 STRIPE_UNAVAILABLE— the payment provider is unavailable; retry.
GET /admin/projects/:projectId/payments/accounts
Reads connected-account status from Amba's own state. Not gated (no money moves)
— returns connected_account: null when no account exists yet so an agent can
branch on it.
Response 200
charges_enabled must be true before you can create a charge.
Errors
503 CONTROL_PLANE_UNAVAILABLE— could not read the account; retry.
PUT /admin/projects/:projectId/payments/config
Sets the default platform fee taken on every charge, in basis points
(250 = 2.5%). Pass null to clear the default (each charge must then specify
its own fee). A per-charge fee always overrides the default.
Request
| Field | Type | Required | Description |
|---|---|---|---|
default_platform_fee_bps | integer|null | yes | Basis points 0–10000, or null to clear the default. |
Response 200
Errors
400 INVALID_BODY— body missingdefault_platform_fee_bpsor not valid JSON.400 INVALID_FEE— fee is not an integer0–10000(ornull).409 NO_CONNECTED_ACCOUNT— create the account first.503 CONTROL_PLANE_UNAVAILABLE— could not update config; retry.
POST /admin/projects/:projectId/payments/charges
Creates a charge (a destination charge with an application fee) on behalf of the
connected account: the net (amount minus the platform fee) routes to the
connected account, which is the settlement merchant. Returns a client_secret
your app completes on-device with the platform's standard payment sheet.
Request
| Field | Type | Required | Description |
|---|---|---|---|
amount | integer | yes | Positive integer in the smallest currency unit (e.g. cents). |
currency | string | yes | Three-letter ISO currency code, lowercase (e.g. usd). |
application_fee_amount | integer | no | Explicit platform fee (smallest unit). Overrides platform_fee_bps and the default. |
platform_fee_bps | integer | no | Platform fee in basis points 0–10000. Used if application_fee_amount is absent. |
client_reference | string | no | Your order reference (≤255 chars). When set, makes a retried charge idempotent on this key. |
A fee is required: pass application_fee_amount, platform_fee_bps, or
configure a default via PUT /payments/config. The fee must be less than the
amount.
Response 200
Errors
400 INVALID_BODY— body is not valid JSON.400 INVALID_AMOUNT—amountis not a positive integer.400 INVALID_CURRENCY—currencyis not a lowercase 3-letter ISO code.400 INVALID_FEE— a fee field is out of range.400 NO_PLATFORM_FEE— no fee resolved (pass one or set a default).400 FEE_EXCEEDS_AMOUNT— the fee is not less than the amount.409 NO_CONNECTED_ACCOUNT— create the account first.409 CHARGES_NOT_ENABLED— onboarding incomplete; charges aren't enabled yet.503 PAYMENTS_NOT_ENABLED— Amba Payments is not enabled on this platform yet.503 CONTROL_PLANE_UNAVAILABLE— could not read the account; retry.502 STRIPE_UNAVAILABLE— the payment provider is unavailable; retry.
GET /admin/projects/:projectId/payments/balance
Reads the connected account's balance.
Response 200
Errors
409 NO_CONNECTED_ACCOUNT— create the account first.503 PAYMENTS_NOT_ENABLED— Amba Payments is not enabled on this platform yet.503 CONTROL_PLANE_UNAVAILABLE— could not read the account; retry.502 STRIPE_UNAVAILABLE— the payment provider is unavailable; retry.
GET /admin/projects/:projectId/payments/payouts
Lists the connected account's payouts, newest first.
Query parameters
| Param | Type | Description |
|---|---|---|
limit | integer | Page size 1–100 (default 10). |
Response 200
Errors
409 NO_CONNECTED_ACCOUNT— create the account first.503 PAYMENTS_NOT_ENABLED— Amba Payments is not enabled on this platform yet.503 CONTROL_PLANE_UNAVAILABLE— could not read the account; retry.502 STRIPE_UNAVAILABLE— the payment provider is unavailable; retry.
Reference
- Payments guide — the end-to-end onboarding + charging flow.
- Client API — payments — the end-user intent surface.