---
title: "Buy top-up with saved card"
method: POST
path: "/api/billing/topup/confirm-saved-payment"
---

# Buy top-up with saved card

`POST /api/billing/topup/confirm-saved-payment`

## Request

- Base URL: `https://app.base44.com`
- URL: `https://app.base44.com/api/billing/topup/confirm-saved-payment`
- Auth: HTTP bearer

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

<Warning>This endpoint charges real money right away. When the workspace has a saved card, a call charges it immediately, with no confirmation step and no approval from the card owner. Call it only when the workspace owner has explicitly asked you to buy this exact amount. To let the card owner review and approve the payment first, use [Create top-up checkout](/api-reference/create-top-up-checkout) instead.</Warning>

Buys top-up credits for your workspace by charging a saved payment method, with no checkout page. Get the amounts and prices from [List top-up packs](/api-reference/list-top-up-packs). Send at least one of `message_credits` (a multiple of 50, up to 400) or `integration_credits` (a multiple of 1,000, up to 8,000), so one purchase buys at most 8 packs of each type.

Get `payment_method_id` from [Get billing info](/api-reference/get-billing-info). On a workspace billed through Stripe, use `default_card_payment_method_id`, the card that pays for the plan, or the `id` of another card in `payment_methods`. `default_card_payment_method_id` is `null` when the plan isn't paid by card, and always `null` on a workspace billed through Wix, so use an `id` from `payment_methods` there.

Send a new key (8 to 100 characters) with every purchase, in the `Idempotency-Key` header or the `idempotency_key` field. If you send both and they differ, you get 422 `idempotency_key_mismatch`. On a workspace billed through Stripe, repeating a request with the same key within 24 hours doesn't charge the card a second time. The repeat doesn't return the first result, though: once the first request reached the charge step, the repeat fails, and so does reusing a key with different amounts. A key is only remembered for 24 hours, so reusing it later can start a new purchase. On a workspace billed through Wix, don't rely on the key to prevent a second charge. Before you retry a request whose response you didn't get, check the workspace's invoices in Get billing info.

A `charge_accepted` status means the payment went through. Base44 adds the credits once it processes the payment confirmation, so they can take a few moments to show up. A `fallback_required` status means the card couldn't be charged without the card owner, for example because it was declined or the bank asked them to authenticate. Nothing is charged, and the card owner can pay with Create top-up checkout. On a workspace billed through Wix, a declined payment returns a 402 instead, and checkout isn't available there.

Only the workspace owner can buy top-ups, and the workspace needs a paid plan other than Enterprise that isn't past due. A workspace with an open payment dispute can't buy top-ups, and neither can one whose plan is paid through the App Store or Google Play. A workspace billed through Wix can buy them only where Base44 has turned on Wix top-ups. Purchases billed through Stripe in shekels have VAT added. This endpoint is limited to 5 requests an hour per user, and requests it rejects count toward the limit. Some workspaces have a different limit. A read-only token is refused, and workspace API keys aren't accepted.

<Note>Top-ups are only available to accounts Base44 has enrolled in top-up credits. Other accounts get a 403.</Note>

<Warning>The response includes fields beyond the ones documented here. Don't rely on undocumented response fields, as they can change at any time.</Warning>

## Headers

- `Idempotency-Key` string: A key you generate for this purchase, sent instead of or with the `idempotency_key` field.

## Request body

- ConfirmTopupSavedPaymentRequest: Request model for confirming a top-up purchase with a saved payment method.
  - `message_credits` integer: Message credits to buy: a multiple of 50, up to 400. Defaults to 0.
  - `integration_credits` integer: Integration credits to buy: a multiple of 1,000, up to 8,000. Defaults to 0.
  - `payment_method_id` string, required: ID of the saved payment method to charge, from `default_card_payment_method_id` or `payment_methods[].id` in Get billing info.
  - `idempotency_key` string, nullable: A key you generate for this purchase. Send a new one for every purchase. Required unless you send the `Idempotency-Key` header instead.

## Response `200`

The card was charged, or the card owner has to pay through checkout instead.

- TopUpPurchaseResult
  - `status` 'charge_accepted' | 'fallback_required', required: `charge_accepted` when the payment went through. The credits are added shortly after. `fallback_required` when the card couldn't be charged without the card owner. Nothing is charged, and the card owner can pay with Create top-up checkout.
  - `invoice_id` string: ID of the invoice for this purchase. Present only when `status` is `charge_accepted`.
  - `reason` string: Why the card couldn't be charged. Present only when `status` is `fallback_required`. `payment_confirmation_failed` when the card was declined or the bank asked the card owner to authenticate. Otherwise it's the invoice's status, such as `open`.

## Other responses

- `400`: An amount isn't a multiple of its pack size, is negative or over the cap, or both are 0. Also returned when the workspace has no active paid plan (free, Enterprise, or past due) or its billing doesn't support top-ups. On a workspace billed through Wix, also when it has no saved payment method or Base44 can't reach its billing account.
- `401`: Missing or invalid credentials.
- `402`: Workspaces billed through Wix only: the payment method was declined.
- `403`: Your account isn't enrolled in top-up credits, you aren't the workspace owner, a payment dispute is open on the workspace, `payment_method_id` isn't saved for this workspace, or your token is read-only.
- `422`: Validation Error
- `429`: Rate limit exceeded (5 requests an hour).

## Changes

> 66 revisions in range; 1 not diffed.

- **2026-10-26** `395a6758864a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/adexad/apis/base44-app-management-api/changes/api/billing/topup/confirm-saved-payment/post.md)

---

[API](https://skmtc.dev/adexad/apis/base44-app-management-api.md) - [All operations](https://skmtc.dev/adexad/apis/base44-app-management-api/llms.txt) - [OpenAPI document](https://skmtc.dev/adexad/apis/base44-app-management-api/revisions/d877a932dc19?raw)
