Buy top-up with saved card
Changed on<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 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. 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. 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>
Request
- Base URLhttps://app.base44.com
- URLhttps://app.base44.com/api/billing/topup/confirm-saved-payment
- AuthHTTP bearer
Headers
A key you generate for this purchase, sent instead of or with the idempotency_key field.
Request body
Example request
{
"message_credits": 100,
"integration_credits": 1000,
"payment_method_id": "pm_1QxYz2AbCdEf3GhIjKlMnOpQ",
"idempotency_key": "topup-2026-10-25-7f3c9a1e"
}Response
The card was charged, or the card owner has to pay through checkout instead.
Example response
{
"status": "charge_accepted",
"invoice_id": "in_1QxYz2AbCdEf3GhIjKlMnOpQ",
"reason": "payment_confirmation_failed"
}Changes
- info
endpoint added
- info