# Merchant-Owned Payments


> Subscribe, connect your own provider account, and create isolated M2O payments.

Canonical: https://docs.bayargo.id/merchant-owned-payments

Merchant-owned payments (M2O) process a transaction through a provider account connected by the authenticated merchant. M2O transactions remain separate from platform account settlement and platform profit accounting.

All paths below are relative to the Core API base URL and require a merchant secret key in `Authorization: Bearer <merchant-secret-key>` or `X-Secret-Key`. The server derives the merchant identity from the key; do not send a merchant ID to these endpoints. Keep the key on a trusted server. Every account-slot request checks ownership. An active subscription and provider entitlement are required to create a slot, enable a slot, connect or reauthenticate an account, and create a payment. Listing owned slots and their history, disabling a slot, and disconnecting an owned account remain available if its subscription expires so the merchant can review history and manage existing credentials.

Set `Content-Type: application/json` for requests with a body. Every `POST` request on the public API requires an `Idempotency-Key` header containing 8–255 characters. Slot creation, subscription checkout, and M2O payment creation persist the key and return the original result when the same merchant repeats the same request. Reusing one of those keys for a different request returns `409 idempotency_conflict`. Other account-management `POST` actions also require the header, but their replay behavior is described with each operation; a required header alone does not mean that an operation stores a replay result.

## 1. List plans and provider access

Use the merchant API key to see active public plans and provider entitlements. Provider availability is data-driven; do not assume that every provider is supported for M2O. `connectable` means that an account authentication adapter is currently available.

`GET /m2o/plans`

`GET /m2o/providers`

```json
{
  "providers": [
    {
      "provider_code": "shopeepay",
      "display_name": "ShopeePay",
      "status": "active",
      "eligible": true,
      "connectable": true,
      "slot_limit": 2,
      "used_slots": 1,
      "remaining_slots": 1
    }
  ]
}
```

The response is `200 OK`. Each provider entry includes catalog status, whether it is eligible for the current subscription, whether account authentication is currently supported (`connectable`), and the subscription's slot limit, current usage, and remaining slots. Providers that cannot be used for M2O remain visible with `eligible: false`.

`GET /m2o/plans` returns `200 OK` with `plans`. Each plan contains `id`, `code`, `name`, `description`, `price`, `currency`, `duration_days`, `status`, `visibility`, `display_order`, `benefits`, `providers`, `created_at`, and `updated_at`. Each `providers` item contains `provider_code`, `display_name`, and `slot_limit`. Only active plans marked public are returned. `benefits` is plan-defined JSON; clients should render it as data and must not use it to infer provider entitlement.

## 2. Buy or renew a plan

Create a subscription order with an `Idempotency-Key`. The payment is created through the platform's existing QRIS checkout. The subscription becomes active only after the payment is confirmed. Plan name, price, duration, and provider limits are snapshotted when the order is created.

`POST /m2o/subscription-orders`

```json
{
  "plan_code": "merchant-standard",
  "provider": "gopay",
  "payment_method": "qris",
  "currency": "IDR",
  "customer": {
    "name": "Nara Store",
    "email": "billing@example.com"
  }
}
```

`POST /m2o/subscription-orders` returns `201 Created` with `order` and `payment`. `plan_code` may be an active public plan code or plan ID. `provider` and `payment_method` must be a supported combination; `currency` may be omitted to use the plan currency, and `customer` is optional. Replaying the same key with the same checkout request returns the original order and payment; reusing it with a different request returns `409 idempotency_conflict`. Only one unpaid subscription order may be open for a merchant. Pay the payment's `total_amount` before `expires_at`. A failed, expired, or cancelled payment does not grant provider slots.

The checkout response contains an order snapshot and the payment to complete:

```json
{
  "order": {
    "id": "a7c16e5a-8f67-4d4a-b2d8-842aa7f08b5c",
    "plan_id": "c3f2456a-bf53-4a32-a0be-bf0b4fd601d0",
    "payment_transaction_id": "f2b1d5b0-7b1f-4c5d-9c37-93f0c8f6a001",
    "status": "pending_payment",
    "plan_snapshot": {
      "entitlement_version": 1,
      "plan_id": "c3f2456a-bf53-4a32-a0be-bf0b4fd601d0",
      "code": "merchant-standard",
      "name": "Standard",
      "price": 150000,
      "currency": "IDR",
      "duration_days": 30,
      "benefits": [],
      "entitlements": { "bank_jago": 1, "gopay": 2 }
    },
    "created_at": "2026-11-22T14:00:00Z",
    "updated_at": "2026-11-22T14:00:00Z"
  },
  "payment": {
    "id": "f2b1d5b0-7b1f-4c5d-9c37-93f0c8f6a001",
    "reference_id": "PAY-LXAMPLE",
    "merchant_reference_id": "",
    "payment_method_code": "qris",
    "provider": "gopay",
    "currency": "IDR",
    "amount": 150000,
    "fee_amount": 1050,
    "net_amount": 150000,
    "total_amount": 151050,
    "fee_payer": "buyer",
    "fee_fixed": 0,
    "fee_percent_bps": 70,
    "status": "pending",
    "customer": { "name": "Nara Store", "email": "billing@example.com" },
    "payment_url": "https://pay.example.test/PAY-LXAMPLE",
    "expires_at": "2026-11-22T14:30:00Z",
    "created_at": "2026-11-22T14:00:00Z",
    "updated_at": "2026-11-22T14:00:00Z"
  }
}
```

In this example, the payment fee fields reflect one illustrative merchant fee schedule; BayarGO calculates them from the merchant's active payment-method configuration. QRIS payload and image fields are also returned when supplied by the selected provider.

After payment, poll `GET /m2o/subscription-orders/{orderID}` or consume the `subscription_order.*` webhook events. The order exposes its current `status`, linked `payment_status`, `payment_transaction_id`, and `subscription_id` when available. A paid order may activate a term immediately or schedule it after the current term; use `GET /m2o/subscriptions` to read the authoritative entitlement dates and provider-slot snapshot. Payment creation itself does not grant access before the confirmed order transition.

`GET /m2o/subscription-orders/{orderID}`

`GET /m2o/subscriptions`

The order endpoint returns `200 OK` and an order belonging to the authenticated merchant. Its status is `pending_payment`, `paid`, `failed`, `expired`, or `cancelled`; `payment_status` reports the linked payment state when available. The subscriptions endpoint returns `200 OK` with active, scheduled, and historical terms. Each subscription includes `id`, `plan_code`, `plan_name`, `price`, `currency`, `duration_days`, `entitlement_version`, `provider_slots`, `status`, optional `starts_at`, `ends_at`, and `cancellation_requested_at`, and `created_at`. Plan edits do not change an existing order's snapshot.

```json
{
  "subscriptions": [
    {
      "id": "5f9a4709-f2de-4a2f-8962-372f33c63832",
      "plan_code": "merchant-standard",
      "plan_name": "Standard",
      "price": 150000,
      "currency": "IDR",
      "duration_days": 30,
      "entitlement_version": 1,
      "provider_slots": { "bank_jago": 1, "gopay": 2 },
      "status": "active",
      "starts_at": "2026-11-22T14:00:00Z",
      "ends_at": "2026-12-22T14:00:00Z",
      "created_at": "2026-11-22T14:00:00Z"
    }
  ]
}
```

Stop renewal for an active term at its period end with:

`POST /m2o/subscriptions/{subscriptionID}/cancel`

This returns `200 OK` with the updated subscription. The cancellation request is safe to repeat, leaves the current provider entitlement active until `ends_at`, does not refund the term, and does not cancel a separately purchased future term. An `Idempotency-Key` header is required by the public API boundary; the cancellation transition itself is safe to repeat.

## 3. Reserve and connect an account

Create a slot for a provider included in the active subscription. The slot code is the stable public identifier; internal provider slot numbers and credentials are never returned.

`POST /m2o/accounts`

```json
{
  "provider_code": "shopeepay"
}
```

The endpoint returns `201 Created` with a credential-free `account` containing `provider_code`, `slot_code`, `status`, `enabled`, `suspended`, `created_at`, and optional `connected_at` and `last_checked_at`. A newly reserved slot has `status: "disconnected"` and `enabled: true` until the provider connection is completed. `provider_code` must name an active provider that supports merchant-owned accounts and is included in the merchant's current subscription. The generated `slot_code` has the form `ACCT-` followed by ten characters; use this stable code for subsequent account requests and M2O payment creation. Replaying the same key and provider returns the original slot; reusing the key for another provider returns `409 idempotency_conflict`.

```json
{
  "account": {
    "provider_code": "shopeepay",
    "slot_code": "ACCT-4J8QK2M7TX",
    "status": "disconnected",
    "enabled": true,
    "suspended": false,
    "created_at": "2026-11-22T14:00:00Z"
  }
}
```

List the merchant's slots with:

`GET /m2o/accounts`

The response is `200 OK` with `accounts`. Each item includes `provider_code`, `slot_code`, `status`, `enabled`, `suspended`, and connection timestamps. It never includes provider passwords, session tokens, mailbox passwords, or account-number ciphertext.

Use the returned `account.slot_code` to connect an account. Check `connectable` before offering a provider connection flow. ShopeePay uses phone and password authentication:

`POST /m2o/accounts/{accountSlotCode}/connect`

```json
{
  "phone": "6281234567890",
  "password": "provider-account-password"
}
```

The ShopeePay endpoint returns `200 OK` with a safe `account` projection. Credentials are encrypted at rest and are not included in account responses or logs. GoPay uses a staged GoBiz and GoPay Merchant sign-in flow. First save the account credentials:

`POST /m2o/accounts/{accountSlotCode}/gopay/credentials`

```json
{
  "email": "owner@example.com",
  "password": "gobiz-account-password"
}
```

Ask GoPay which verification methods are available, then select one of the returned values. Do not assume that SMS is available or select a method that GoPay did not return.

`POST /m2o/accounts/{accountSlotCode}/gopay/otp/methods`

`POST /m2o/accounts/{accountSlotCode}/gopay/otp/request`

```json
{
  "method": "email",
  "selection_token": "short-lived-selection-token"
}
```

Submit the challenge token and the code received from GoPay:

`POST /m2o/accounts/{accountSlotCode}/gopay/otp/verify`

```json
{
  "token": "short-lived-challenge-token",
  "otp": "123456"
}
```

Use these endpoints to inspect GoPay session status and choose an outlet:

`GET /m2o/accounts/{accountSlotCode}/gopay`

`POST /m2o/accounts/{accountSlotCode}/gopay/outlet`

The OTP methods endpoint returns `200 OK` with `selection_token`, `methods`, and optional `default_method`. The OTP request endpoint returns `200 OK` with `challenge`, containing `otp_token`, `phone_number`, optional `verification_method`, `stage`, `otp_length`, and `delivery_target`, plus `expires_at`. Use the exact method returned by GoPay and the same selection token to request the challenge. Verify with that challenge's `otp_token` and the received code.

The status endpoint returns `200 OK` with `provider`; it is marked `Cache-Control: no-store`. The safe provider projection contains `provider`, `status`, `connected`, `reason`, and optional account details (`phone`, `email`, `merchant_name`, `selected_outlet`, `connected_at`, `last_checked_at`, and `outlets`). Each outlet contains `id`, `name`, `suspension_status`, and `gopay_status`. It does not expose session credentials. Outlet selection takes `{ "outlet_id": "outlet-id" }` and returns the updated `provider` state. Challenge and selection tokens are temporary authentication material; keep them private and never log them. These provider operations resolve the slot against the authenticated merchant and require an active entitlement before changing or authenticating the account.

Provider authentication failures return a stable provider error code and an actionable message. Credentials are never included in responses or logs.

Bank Jago accounts use email notifications for transfer reconciliation. Configure the account through this endpoint:

`POST /m2o/accounts/{accountSlotCode}/bank-jago`

```json
{
  "account_name": "Nara Store",
  "account_number": "123456789012",
  "mailbox_email": "payments@example.com",
  "mailbox_app_password": "gmail-app-password",
  "email_language": "en",
  "unique_code_min": 1,
  "unique_code_max": 999,
  "payment_deadline_minutes": 30,
  "fallback_enabled": false
}
```

The endpoint returns `200 OK` with the credential-free account state after it verifies Gmail IMAP access. Use a Gmail app password for a mailbox that receives Bank Jago transaction notices. `email_language` is `id` or `en`; the unique-code range is inclusive and must be within `1`–`999`; `payment_deadline_minutes` must be within `1`–`1440`. The fallback setting applies only within the same account-ownership boundary and never permits routing to another merchant or to a platform account. The API returns only credential-free account state.

Mailbox verification returns `bank_jago_mailbox_unverified` if IMAP login fails. `invalid_bank_jago_configuration` means a field or allowed range must be corrected. A disconnected Jago account retains its slot and transaction history.

Enable or disable a slot with `PATCH`; disconnect it with `POST`. Disconnection clears provider credentials and session data while retaining the slot and its transaction history. Bank Jago disconnection is rejected while a payment may still need receipt reconciliation.

`PATCH /m2o/accounts/{accountSlotCode}`

```json
{ "enabled": false }
```

`POST /m2o/accounts/{accountSlotCode}/disconnect`

Both return `200 OK` with the safe `account` projection. `enabled` must be a JSON boolean. Repeating an enable/disable or disconnect operation is safe; these operations require an `Idempotency-Key` header but do not use it to persist a replay result. Disabling and disconnecting do not delete the account slot or its transaction history. Re-enabling a slot requires an active subscription with remaining entitlement; disconnecting a Bank Jago account is blocked while a payment may still need receipt reconciliation.

## 4. Create a payment

Create one payment at a time using the account slot code. This endpoint accepts one payment object and returns `201 Created` with `payment`; bulk `payments` arrays are not supported. The provider and payment method must be supported by that account and its adapter. Bank Jago payments use `bank_jago_transfer` and `bank_jago`:

`POST /m2o/payments/{accountSlotCode}`

```json
{
  "amount": 150000,
  "currency": "IDR",
  "payment_method": "bank_jago_transfer",
  "provider": "bank_jago",
  "merchant_reference_id": "ORDER-1024",
  "customer": {
    "name": "Nara",
    "email": "nara@example.com"
  }
}
```

For Bank Jago, the response also includes `payment_instructions` with the receiving account and exact `payable_amount` (the order amount plus its reserved unique code). Tell the payer to transfer that exact amount before `expires_at`. The unique amount is reserved against the selected account slot and is not globally unique across different Jago accounts. If no unambiguous amount is available, the API returns `503 bank_jago_amount_temporarily_unavailable`; retry after the supplied `Retry-After` interval rather than inventing an amount.

```json
{
  "payment": {
    "id": "f2b1d5b0-7b1f-4c5d-9c37-93f0c8f6a001",
    "reference_id": "PAY-LXAMPLE",
    "provider": "bank_jago",
    "amount": 150000,
    "total_amount": 150123,
    "status": "pending",
    "payment_instructions": {
      "bank_name": "Bank Jago",
      "recipient_account_number": "123456789012",
      "recipient_name": "Nara Store",
      "transfer_amount": 150000,
      "unique_code": 123,
      "payable_amount": 150123,
      "instructions": "Transfer the exact payable amount before the deadline."
    },
    "expires_at": "2026-11-22T14:30:00Z"
  }
}
```

Send an `Idempotency-Key` for each payment so network retries cannot create another transaction. Replaying the same key with the same payment intent returns the original transaction; changing the amount, currency, provider, method, account slot, customer, metadata, or merchant reference with that key returns `409 idempotency_conflict`. The key is scoped to the merchant and live environment; use a new key for a new payment. `amount` must be a positive integer in IDR. `payment_method` must be supported by the selected account; `provider` must match that account and may be omitted only when the method identifies it unambiguously. `merchant_reference_id`, `customer`, and `metadata` are optional. Retrieve status with `GET /payments/{payment_id}` using the same merchant API key or handle the existing webhook subscription. Cancel an eligible pending payment through the standard [payment cancellation endpoint](https://docs.bayargo.id/payment-cancel). M2O payments use the standard payment lifecycle events and statuses, including `created`, `pending`, `paid`, `expired`, `cancelled`, and `failed`; see [webhook events](https://docs.bayargo.id/webhooks) for payload examples.

## 5. Review one account's transactions

List only payments routed through one account slot. The slot code must belong to the merchant authenticated by the API key; an unknown slot and another merchant's slot both return `404 provider_account_unavailable`.

`GET /m2o/accounts/{accountSlotCode}/transactions`

| Query parameter | Type | Behavior |
| --- | --- | --- |
| `page` | integer | 1-based page index; defaults to 1. |
| `page_index` | integer | Compatibility alias for `page`; `page` takes precedence when both are supplied. |
| `limit` | integer | Page size from 1 to 200; defaults to 20. |
| `offset` | integer | Zero-based row offset from 0 to 100,000; when supplied, it overrides the offset derived from `page`. |
| `q` | string | Searches payment ID, payment reference, merchant reference, provider, or status. |
| `status` | string, repeatable or comma-separated | Filters by transaction status. |
| `receipt_status` | string, repeatable or comma-separated | Bank Jago only; filters normalized receipt events by `unmatched`, `matched`, `duplicate`, `ignored`, or `ambiguous`. |
| `currency` | string, repeatable or comma-separated | Filters by currency code. |
| `amount_min`, `amount_max` | integer | Inclusive bounds on payable `total_amount`. |
| `from`, `to` | `YYYY-MM-DD` | Supply both for an inclusive UTC creation-date range. |
| `from_at`, `to_at` | RFC3339 timestamp | Optional inclusive start and exclusive end bounds; either may be used alone. Use these instead of date-only bounds for precise time filtering. |
| `sort` | string | Transaction sort key: `reference`, `reference_id`, `merchant_reference_id`, `status`, `method`, `payment_method_code`, `provider`, `amount`, `total_amount`, `fee_amount`, `net_amount`, `created_at`, `received_at`, or `id`. Bank Jago receipts support `received_at`, `status`, or `amount`. |
| `dir` | `asc` or `desc` | Sort direction; defaults to descending. |
| `count` | `exact` or `true` | Requests an exact total and total page count. Without it, transaction pagination may report a lower-bound total. Bank Jago receipt totals are always exact. |

```json
{
  "transactions": [
    {
      "id": "f2b1d5b0-7b1f-4c5d-9c37-93f0c8f6a001",
      "reference_id": "PAY-LXAMPLE",
      "merchant_reference_id": "ORDER-1024",
      "provider": "shopeepay",
      "currency": "IDR",
      "amount": 150000,
      "total_amount": 151050,
      "status": "paid",
      "created_at": "2026-11-22T14:10:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "page_index": 1,
    "limit": 20,
    "offset": 0,
    "total": 1,
    "total_exact": true,
    "total_pages": 1,
    "has_more": false
  }
}
```

The endpoint returns `200 OK` with `transactions` and `pagination`. `page` is 1-based, `limit` defaults to 20 and is capped at 200, and offsets beyond the supported maximum are rejected. `page_index` is a compatibility alias; `offset` overrides the page-derived offset. Repeatable status and currency filters may be sent multiple times or as comma-separated values.

For a Bank Jago slot, the same response also contains a separately paginated `bank_jago_receipts` list and `receipt_pagination`. Receipt filters use the same search, amount, and date bounds as transactions; receipt pagination always reports an exact total. A receipt includes its stable `id`, parsed `amount` when available, reconciliation `status`, matched `transaction_id` when available, trusted mailbox `received_at`, and optional sender `message_date`. Mailbox IDs, message IDs, raw email content, and credentials are never returned. These receipt fields are omitted for other providers.

If a query returns no items, the account has no transactions matching the selected filters. Disconnected or subscription-suspended slots retain their transaction history for the owning merchant.

## Errors

| HTTP | Code | Meaning | Action |
| --- | --- | --- | --- |
| `403` | `subscription_required` | No active subscription grants M2O access. | Purchase or renew a plan. |
| `403` | `provider_not_entitled` | The plan or provider catalog does not grant access to this provider. | Choose a plan that includes an enabled M2O provider. |
| `403` | `merchant_not_approved` | The merchant is not approved to create payments. | Complete the merchant approval process before retrying. |
| `400` | `invalid_subscription_checkout` | Required checkout fields are missing or invalid. | Send `plan_code`, `provider`, and `payment_method`. |
| `400` | `invalid_subscription_payment_method` | The provider and payment method combination is unsupported. | Choose a supported combination returned by the payment-method API. |
| `400` | `invalid_subscription` | A subscription identifier is missing. | Use the subscription UUID returned by the subscriptions endpoint. |
| `400` | `invalid_payment_request` | The payment request is invalid or contains a bulk `payments` array. | Send one payment object with the documented fields. |
| `400` | `idempotency_key_header_required` | The payment idempotency key was sent in the JSON body. | Send it in the `Idempotency-Key` header. |
| `400` | `invalid_otp_method`, `invalid_otp`, `invalid_outlet` | A GoPay verification method, OTP, or outlet selection is invalid. | Use the current method/challenge/outlet returned by GoPay. |
| `400` | `invalid_date_range`, `page_too_deep` | A transaction-history date or page range is invalid. | Use the documented date formats and a lower page number. |
| `404` | `subscription_plan_unavailable` | The plan is not active or publicly available. | Select an active public plan. |
| `404` | `subscription_not_found` | The active subscription term is not available to this merchant. | Check the subscription UUID and current status. |
| `409` | `subscription_provider_unavailable` | A provider entitlement cannot currently be fulfilled. | Retry later or select another eligible plan. |
| `409` | `subscription_order_conflict` | Another pending order exists or the order state conflicts with this request. | Retrieve the pending order or resolve its payment before creating another. |
| `409` | `subscription_payment_method_unavailable` | The selected payment method is not enabled for this merchant. | Enable an eligible payment method or choose another. |
| `503` | `subscription_payment_unavailable` | The payment provider is temporarily unavailable. | Retry checkout with the same idempotency key. |
| `409` | `provider_slot_limit_reached` | All slots for this provider are in use. | Upgrade the plan or disconnect an unused account slot. |
| `404` | `provider_account_unavailable` | The code is unknown, belongs to another merchant, or cannot currently route payments. | Check ownership, connection state, and subscription entitlement. |
| `400` | `invalid_account_request` | A provider code, slot setting, or request field is invalid. | Correct the request fields. |
| `400` | `invalid_account_credentials` | Required provider credentials are missing. | Supply the fields required by the provider flow. |
| `400` | `invalid_bank_jago_configuration` | Jago details or an allowed range are invalid. | Check account details, language, code range, and deadline. |
| `400` | `unsupported_currency` | The requested currency is not currently supported. | Use `IDR`. |
| `422` | `bank_jago_mailbox_unverified` | Gmail IMAP could not authenticate the notification mailbox. | Enable IMAP and enter the mailbox's valid app password. |
| `409` | `bank_jago_payments_pending` | A Jago payment may still need receipt reconciliation. | Wait until the matching window closes before changing the configuration or disconnecting. |
| `502` | `provider_connection_failed` | A provider adapter could not verify the supplied account. | Check credentials and retry; secrets are never returned. |
| `502` | `payment_provider_rejected` | The provider rejected payment creation. | Retry later with the same idempotency key after checking payment status. |
| `503` | `bank_jago_amount_temporarily_unavailable` | No unambiguous unique payable amount is currently available in this ownership boundary. | Retry the same payment intent after `Retry-After`, using its original `Idempotency-Key`. |
| `503` | `m2o_unavailable`, `subscription_checkout_unavailable` | An M2O provider or subscription service is temporarily unavailable. | Retry after a delay; reuse the same key for the same checkout. |
| `400` | `invalid_amount` | The payment amount is missing, non-positive, or not a whole IDR amount. | Send a positive integer amount in IDR. |
| `400` | `unsupported_payment_method` | The requested provider and payment method do not match. | Use a combination supported by the selected account. |
| `409` | `payment_method_unavailable` | The payment method is disabled or unavailable to this merchant. | Choose an enabled payment method or retry after the provider recovers. |
| `409` | `idempotency_conflict` | An idempotency key was replayed with a different checkout, payment, or account-creation request. | Use a new key for a new request; retain the original key for retries of the same request. |
| `400` | `idempotency_key_required` | A public API `POST` request is missing an idempotency key or its key is outside the allowed length. | Send an 8–255 character `Idempotency-Key` header on the request. |
| `404` | `subscription_order_not_found` | The order is unknown or belongs to another merchant. | Check the order UUID returned during checkout. |
| `500` | `provider_catalog_unavailable`, `provider_accounts_unavailable`, `subscription_plans_unavailable`, `provider_account_operation_failed`, `subscription_checkout_failed`, `subscription_cancellation_failed` | Provider, plan, or account data could not be loaded or updated. | Retry later; do not repeat credential submission without checking account state. |
| `500` / `503` | `subscriptions_unavailable` | Subscription data or management is temporarily unavailable. | Retry after a delay. |
| `500` | `server_error` | An unexpected server error prevented payment creation. | Retry after a delay with the same payment idempotency key. |
| `401` | `invalid_api_key` | The key is missing, invalid, or revoked. | Check the server-side merchant key. |
| `403` | `api_key_ip_not_allowed` | The request IP is not in the key allowlist. | Add the server IP or CIDR to the allowlist. |
| `429` | `rate_limited` | The API rate limit was reached. | Wait before retrying. |
| `500` / `503` | `payment_unavailable` | A payment provider dependency is temporarily unavailable. | Retry after a delay with the same payment idempotency key. |

The server checks account ownership on slot-specific operations and requires an active subscription and matching provider entitlement for account activation and payment routing. A slot code does not grant access without the matching merchant API key. Errors use RFC 9457 problem details with a stable `code`, safe `detail`, and `request_id`; retryable responses may include a `Retry-After` header. See [Error Codes](https://docs.bayargo.id/errors) for the response shape and common API-key, allowlist, rate-limit, and retry behavior.
