Pay an invoice with account credit
POST /api/v2/billing/invoices/{id}/actions/apply-credit
Pay all or part of an unpaid invoice from the account’s credit balance. Check paymentMethods.accountCredit on GET /api/v2/billing/invoices/{id} first. It shows the credit available and the most you can apply. The amount must be more than zero and no more than the available credit or the invoice balance. The invoice must be in the account’s currency. Account top-up invoices cannot be paid with credit. The credit is used at once. The response is the updated invoice.
Authentication: An API key with the scope write:billing. About keys and scopes
Request
Path parameters
idstringrequiredPublic invoice ID from
GET /api/v2/billing/invoices (inv_…).Body
amountnumberrequiredCredit to apply, in the invoice currency. Rounded to two decimals. At most 1000000.
Example
curl -X POST "https://cloud.hostup.se/api/v2/billing/invoices/inv_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/apply-credit" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 250 }'curl -X POST "https://cloud.hostup.se/api/v2/billing/invoices/inv_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/apply-credit" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 100 }'Responses
200 The updated invoice. This example pays the whole invoice.
{ "id": "inv_01hxa3b4c5d6e7f8g9h0j1k2m3", "number": "202600001", "orderId": "ord_01hxa3b4c5d6e7f8g9h0j1k2m3", "status": "paid", "dates": { "issuedAt": "2026-04-27T12:00:00.000Z", "dueAt": "2026-05-11T23:59:59.000Z", "paidAt": "2026-04-27T12:34:56.000Z" }, "totals": { "currencyCode": "SEK", "subtotal": 200, "taxAmount": 50, "taxRateDecimal": 0.25, "creditApplied": 250, "total": 0, "amountPaid": 0, "amountRefunded": 0, "outstanding": 0 }, "lineItemCount": 1, "lineItems": [ { "description": "Cloud VPS monthly service", "displayDescription": "Cloud VPS monthly service", "kind": "vps", "productName": "Cloud VPS", "quantity": 1, "unitAmount": 200, "totalAmount": 200, "currencyCode": "SEK", "period": { "startAt": "2026-04-27T12:00:00.000Z", "endAt": "2026-05-27T12:00:00.000Z" }, "resource": { "type": "vps", "id": "vps_01hxa3b4c5d6e7f8g9h0j1k2m3", "displayName": "example.com" }, "configurableOptions": [ { "key": "os", "label": "OS", "value": "Debian 13" }, { "key": "block_storage", "label": "Block Storage (NVMe)", "value": "50 GB" }, { "key": "bandwidth_limit", "label": "Bandwidth limit", "value": "2 TB" }, { "key": "backups", "label": "Backups", "value": "7" } ] } ], "actions": { "canPay": { "allowed": false, "reason": "Invoice is already paid." }, "canGeneratePaymentLink": { "allowed": false, "reason": "Invoice is already paid." }, "canBulkPay": { "allowed": false, "reason": "Invoice is already paid." }, "canCancel": { "allowed": false, "reason": "Only unpaid invoices can be cancelled.", "code": "invoice_not_unpaid" }, "canEmail": { "allowed": true, "reason": null }, "canDownload": { "allowed": true, "reason": null }, "canReissueInCurrency": { "allowed": false, "reason": "Swedish billing accounts pay SEK invoices by bankgiro, Swish or card.", "code": "account_country_not_eligible" } }, "paymentMethods": { "card": { "method": "card", "label": "Card", "available": false, "reason": "Invoice is already paid.", "checkoutMode": "payment", "requirements": { "minimumAmount": { "amount": 3, "currencyCode": "SEK", "comparison": "greater_than" } } }, "accountCredit": { "method": "accountCredit", "label": "Account credit", "available": false, "reason": "Invoice is already paid.", "checkoutMode": null, "requirements": { "invoiceCurrencyCode": "SEK", "accountCurrencyCode": "SEK", "availableBalance": { "amount": 50, "currencyCode": "SEK" }, "maximumAmount": { "amount": 0, "currencyCode": "SEK", "comparison": "less_than_or_equal" } } }, "swish": { "method": "swish", "label": "Swish", "available": false, "reason": "Invoice is already paid.", "checkoutMode": null, "requirements": { "invoiceCurrencyCode": "SEK", "accountCountryCode": "SE" } }, "bankgiro": { "method": "bankgiro", "label": "Bankgiro", "available": false, "reason": "Invoice is already paid.", "checkoutMode": null, "requirements": { "invoiceCurrencyCode": "SEK", "accountCountryCode": "SE" } }, "sepa": { "method": "sepa", "label": "SEPA bank transfer", "available": false, "reason": "Invoice is already paid.", "checkoutMode": "sepa_bank_transfer_payment", "requirements": { "invoiceCurrencyCode": "EUR" } }, "alipay": { "method": "alipay", "label": "Alipay", "available": false, "reason": "Invoice is already paid.", "checkoutMode": "alipay_payment", "requirements": { "invoiceCurrencyCodes": [ "EUR", "USD" ] } }, "crypto": { "method": "crypto", "label": "Cryptocurrency", "available": false, "reason": "Cryptocurrency payments are not available for Swedish billing accounts.", "checkoutMode": null, "requirements": { "invoiceCurrencyCodes": [ "SEK", "EUR", "USD" ], "accountCountryExcludedCode": "SE", "accountType": "private", "requiresCardVerification": true }, "visible": false } }, "paymentLinkGeneratorUrl": null, "isBulkPaymentChild": false, "bulkPaymentParentId": null}Response fields
idstringorderIdstringThe order ID (
ord_…) when the invoice belongs to an order. A domain renewal invoice whose order is still open is cancelled by cancelling that order first.numberstringThe invoice number shown to the customer.
statusstringOne of
draft, unpaid, partially_paid, paid, cancelled, refunded.datesobjectissuedAtstringdueAtstringpaidAtstringtotalsobjectcurrencyCodestringsubtotalnumbertaxAmountnumbertaxRateDecimalnumbercreditAppliednumbertotalnumberamountPaidnumberamountRefundednumberTotal refunded on this invoice. Zero when nothing was refunded.
outstandingnumberlineItemCountintegerNumber of line items.
lineItemsarray of objectkindstringWhat the line is for. One of
vps, shared_hosting, domain, addon, credit, setup, other.purposestringWhy the line was billed. Left out when it is not known. One of
renewal, registration, transfer, account_credit_top_up, credit, setup.resourceobjectThe service the line is for. Left out when the line is not for a service.
typestringOne of
vps, shared_hosting, domain.idstring or nullThe service’s ID. Null when the line cannot be linked to one.
displayNamestring or nullThe service’s name, for display. Null when not known.
productNamestringThe product or plan, when known.
configurableOptionsarray of objectOptions ordered with the service, such as OS or disk size.
key is the label in lower case with the bracket part dropped and other characters turned into _.keystringlabelstringvaluestringdescriptionstringThe line text. Left out when the line has none.
displayDescriptionstringThe text to show for the line.
displaySecondaryLinesarray of stringExtra lines to show under
displayDescription, such as the period.monthlyHintstringdetailsHintstringquantitynumberunitAmountnumberPrice per unit. Can be negative, for example on a discount line.
totalAmountnumbercurrencyCodestringperiodobjectThe period the line covers. Left out when not known.
startAtstringendAtstringoverpaymentCreditobjectPresent when the invoice was paid in full twice, once by card and once by bankgiro. The whole extra amount was added to account credit automatically and is still there. It explains the credit. It is not a refund. Other overpayments are not shown here.
decisionstringOne of
card_bankgiro_overpayment_already_credited.currencyCodestringOne of
SEK.invoiceAmountnumberexcessAmountnumbercreditedAtstringcurrentCreditBalancenumberAt least 0.
paymentsarray of objectkindstring or nullWhat the row is. No value or
payment: a payment of the invoice. account_credit_added: an overpayment added to account credit, not counted as a payment. refund: money returned (see refundedTo). rounding: a remainder under 1 SEK that Hostup wrote off so the invoice counts as paid. It is not money the customer paid. It is never a refund or a credit movement. One of payment, account_credit_added, refund, rounding.methodstring or nullThe payment method, as a fixed value. Use
methodLabel for the text to show. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto, paypal, invoice, rounding, other.methodLabelstring or nullThe name of the payment method, to show.
amountnumbercurrencyCodestringISO 4217 currency of
amount.refundedbooleanPresent and true on a payment that was later returned. The matching
refund row says where the money went.refundedTostringRefund rows only.
accountCredit: the money is on the account balance and pays the next invoice automatically. paymentMethod: returned to the payment method. unknown: not recorded. One of accountCredit, paymentMethod, unknown.atstringThe date of this row (ISO 8601), when known.
notestringactionsobjectcanPayobjectallowedbooleanreasonstring or nullcodestring or nullA machine-readable code for why the action is blocked.
canGeneratePaymentLinkobjectallowedbooleanreasonstring or nullcodestring or nullA machine-readable code for why the action is blocked.
canBulkPayobjectallowedbooleanreasonstring or nullcodestring or nullA machine-readable code for why the action is blocked.
canCancelobjectallowedbooleanreasonstring or nullcodestring or nullA machine-readable code for why the action is blocked.
canEmailobjectallowedbooleanreasonstring or nullcodestring or nullA machine-readable code for why the action is blocked.
canDownloadobjectallowedbooleanreasonstring or nullcodestring or nullA machine-readable code for why the action is blocked.
canReissueInCurrencyobjectWhether the account can switch to EUR and get this SEK invoice replaced by an EUR invoice for the same period. SEPA bank transfer is then possible. This is for customers outside Sweden. Do it with
POST /api/v2/billing/invoices/{id}/actions/reissue-in-currency. When it is blocked, branch on code: invoice_order_backed (a pending order or plan change backs the invoice: cancel that order, change currency, then order again), invoice_domain_renewal (cancel the renewal order, then renew again), invoice_partially_settled, invoice_multiple_services, invoice_usage_not_reissuable and renewal_period_ended (contact support), account_country_not_eligible (Swedish accounts pay by bankgiro, Swish or card).allowedbooleanreasonstring or nullcodestring or nullA machine-readable code for why the action is blocked.
paymentMethodsobjectWhich payment methods can pay this invoice now. The keys include
card, accountCredit, swish, bankgiro, sepa, alipay and crypto. Check them before you start a payment.cardobjectmethodstringThe payment method, the same as its key in
paymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.labelstringThe method’s name, for display.
availablebooleanvisiblebooleanPresent for restricted methods. When false, don’t show the method to the customer.
reasonstring or nullWhy the method cannot be used, when
available is false.checkoutModestring or nullThe kind of hosted checkout the payment session uses. Null for methods without a hosted checkout. One of
payment, sepa_bank_transfer_payment, alipay_payment.requirementsobjectWhat the payment method needs. Examples: a minimum amount for card, a Swedish account for Swish and bankgiro, EUR for a SEPA bank transfer, an eligible account for cryptocurrency, enough account credit.
invoiceCurrencyCodestringinvoiceCurrencyCodesarray of stringaccountCountryCodestringaccountCountryExcludedCodestringA billing country this method does not accept.
accountTypestringOne of
private, organisation.accountCurrencyCodestringrequiresCardVerificationbooleanWhether a saved card or an earlier successful card payment is needed.
availableBalanceobjectamountnumbercurrencyCodestringminimumAmountobjectamountnumbercurrencyCodestringcomparisonstringHow the payment amount must compare with
amount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.maximumAmountobjectamountnumbercurrencyCodestringcomparisonstringHow the payment amount must compare with
amount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.accountCreditobjectmethodstringThe payment method, the same as its key in
paymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.labelstringThe method’s name, for display.
availablebooleanvisiblebooleanPresent for restricted methods. When false, don’t show the method to the customer.
reasonstring or nullWhy the method cannot be used, when
available is false.checkoutModestring or nullThe kind of hosted checkout the payment session uses. Null for methods without a hosted checkout. One of
payment, sepa_bank_transfer_payment, alipay_payment.requirementsobjectWhat the payment method needs. Examples: a minimum amount for card, a Swedish account for Swish and bankgiro, EUR for a SEPA bank transfer, an eligible account for cryptocurrency, enough account credit.
invoiceCurrencyCodestringinvoiceCurrencyCodesarray of stringaccountCountryCodestringaccountCountryExcludedCodestringA billing country this method does not accept.
accountTypestringOne of
private, organisation.accountCurrencyCodestringrequiresCardVerificationbooleanWhether a saved card or an earlier successful card payment is needed.
availableBalanceobjectamountnumbercurrencyCodestringminimumAmountobjectamountnumbercurrencyCodestringcomparisonstringHow the payment amount must compare with
amount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.maximumAmountobjectamountnumbercurrencyCodestringcomparisonstringHow the payment amount must compare with
amount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.swishobjectmethodstringThe payment method, the same as its key in
paymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.labelstringThe method’s name, for display.
availablebooleanvisiblebooleanPresent for restricted methods. When false, don’t show the method to the customer.
reasonstring or nullWhy the method cannot be used, when
available is false.checkoutModestring or nullThe kind of hosted checkout the payment session uses. Null for methods without a hosted checkout. One of
payment, sepa_bank_transfer_payment, alipay_payment.requirementsobjectWhat the payment method needs. Examples: a minimum amount for card, a Swedish account for Swish and bankgiro, EUR for a SEPA bank transfer, an eligible account for cryptocurrency, enough account credit.
invoiceCurrencyCodestringinvoiceCurrencyCodesarray of stringaccountCountryCodestringaccountCountryExcludedCodestringA billing country this method does not accept.
accountTypestringOne of
private, organisation.accountCurrencyCodestringrequiresCardVerificationbooleanWhether a saved card or an earlier successful card payment is needed.
availableBalanceobjectamountnumbercurrencyCodestringminimumAmountobjectamountnumbercurrencyCodestringcomparisonstringHow the payment amount must compare with
amount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.maximumAmountobjectamountnumbercurrencyCodestringcomparisonstringHow the payment amount must compare with
amount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.bankgiroobjectmethodstringThe payment method, the same as its key in
paymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.labelstringThe method’s name, for display.
availablebooleanvisiblebooleanPresent for restricted methods. When false, don’t show the method to the customer.
reasonstring or nullWhy the method cannot be used, when
available is false.checkoutModestring or nullThe kind of hosted checkout the payment session uses. Null for methods without a hosted checkout. One of
payment, sepa_bank_transfer_payment, alipay_payment.requirementsobjectWhat the payment method needs. Examples: a minimum amount for card, a Swedish account for Swish and bankgiro, EUR for a SEPA bank transfer, an eligible account for cryptocurrency, enough account credit.
invoiceCurrencyCodestringinvoiceCurrencyCodesarray of stringaccountCountryCodestringaccountCountryExcludedCodestringA billing country this method does not accept.
accountTypestringOne of
private, organisation.accountCurrencyCodestringrequiresCardVerificationbooleanWhether a saved card or an earlier successful card payment is needed.
availableBalanceobjectamountnumbercurrencyCodestringminimumAmountobjectamountnumbercurrencyCodestringcomparisonstringHow the payment amount must compare with
amount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.maximumAmountobjectamountnumbercurrencyCodestringcomparisonstringHow the payment amount must compare with
amount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.sepaobjectmethodstringThe payment method, the same as its key in
paymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.labelstringThe method’s name, for display.
availablebooleanvisiblebooleanPresent for restricted methods. When false, don’t show the method to the customer.
reasonstring or nullWhy the method cannot be used, when
available is false.checkoutModestring or nullThe kind of hosted checkout the payment session uses. Null for methods without a hosted checkout. One of
payment, sepa_bank_transfer_payment, alipay_payment.requirementsobjectWhat the payment method needs. Examples: a minimum amount for card, a Swedish account for Swish and bankgiro, EUR for a SEPA bank transfer, an eligible account for cryptocurrency, enough account credit.
invoiceCurrencyCodestringinvoiceCurrencyCodesarray of stringaccountCountryCodestringaccountCountryExcludedCodestringA billing country this method does not accept.
accountTypestringOne of
private, organisation.accountCurrencyCodestringrequiresCardVerificationbooleanWhether a saved card or an earlier successful card payment is needed.
availableBalanceobjectamountnumbercurrencyCodestringminimumAmountobjectamountnumbercurrencyCodestringcomparisonstringHow the payment amount must compare with
amount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.maximumAmountobjectamountnumbercurrencyCodestringcomparisonstringHow the payment amount must compare with
amount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.alipayobjectmethodstringThe payment method, the same as its key in
paymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.labelstringThe method’s name, for display.
availablebooleanvisiblebooleanPresent for restricted methods. When false, don’t show the method to the customer.
reasonstring or nullWhy the method cannot be used, when
available is false.checkoutModestring or nullThe kind of hosted checkout the payment session uses. Null for methods without a hosted checkout. One of
payment, sepa_bank_transfer_payment, alipay_payment.requirementsobjectWhat the payment method needs. Examples: a minimum amount for card, a Swedish account for Swish and bankgiro, EUR for a SEPA bank transfer, an eligible account for cryptocurrency, enough account credit.
invoiceCurrencyCodestringinvoiceCurrencyCodesarray of stringaccountCountryCodestringaccountCountryExcludedCodestringA billing country this method does not accept.
accountTypestringOne of
private, organisation.accountCurrencyCodestringrequiresCardVerificationbooleanWhether a saved card or an earlier successful card payment is needed.
availableBalanceobjectamountnumbercurrencyCodestringminimumAmountobjectamountnumbercurrencyCodestringcomparisonstringHow the payment amount must compare with
amount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.maximumAmountobjectamountnumbercurrencyCodestringcomparisonstringHow the payment amount must compare with
amount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.cryptoobjectmethodstringThe payment method, the same as its key in
paymentMethods. Card checkout and wallets are all card. One of card, accountCredit, swish, bankgiro, sepa, alipay, crypto.labelstringThe method’s name, for display.
availablebooleanvisiblebooleanPresent for restricted methods. When false, don’t show the method to the customer.
reasonstring or nullWhy the method cannot be used, when
available is false.checkoutModestring or nullThe kind of hosted checkout the payment session uses. Null for methods without a hosted checkout. One of
payment, sepa_bank_transfer_payment, alipay_payment.requirementsobjectWhat the payment method needs. Examples: a minimum amount for card, a Swedish account for Swish and bankgiro, EUR for a SEPA bank transfer, an eligible account for cryptocurrency, enough account credit.
invoiceCurrencyCodestringinvoiceCurrencyCodesarray of stringaccountCountryCodestringaccountCountryExcludedCodestringA billing country this method does not accept.
accountTypestringOne of
private, organisation.accountCurrencyCodestringrequiresCardVerificationbooleanWhether a saved card or an earlier successful card payment is needed.
availableBalanceobjectamountnumbercurrencyCodestringminimumAmountobjectamountnumbercurrencyCodestringcomparisonstringHow the payment amount must compare with
amount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.maximumAmountobjectamountnumbercurrencyCodestringcomparisonstringHow the payment amount must compare with
amount. greater_than: more than it, used in minimumAmount. less_than_or_equal: at most it, used in maximumAmount. One of greater_than, less_than_or_equal.paymentLinkGeneratorUrlstring or nullPath to POST to for a payment link (
POST /api/v2/billing/invoices/{id}/actions/generate-payment-link). Null when actions.canGeneratePaymentLink.allowed is false.isBulkPaymentChildbooleanTrue when another invoice pays this one together with others. Pay
bulkPaymentParentId instead. actions.canPay can still be allowed on such an invoice.bulkPaymentParentIdstring or nullThe invoice that pays this one together with others. Null when
isBulkPaymentChild is false.coversInvoiceIdsarray of stringOn an invoice that pays several invoices at once: the invoices it pays. Absent on other invoices.
renewalInvoicingobjectHow the account groups its renewal invoices. Present only on the invoice detail, for a renewal invoice Hostup created automatically.
preferencestringOne of
consolidated, separate.generatedByAutomationbooleanTrue when Hostup created the invoice automatically for a renewal.
isConsolidatedbooleanTrue when this is an automatic renewal invoice and the account’s setting is to put renewals on one invoice.
labelstringsettingsUrlstringdeliveryobjectPresent only when the invoice is sent as a Peppol e-invoice. Absent for other invoices.
channelstringOne of
peppol.statusstringqueued: accepted for sending and waiting, for example for the send window. An unpaid invoice from today for an organisation registered in Peppol is also queued until it is sent. sent: sent into the Peppol network. delivered: the recipient’s access point confirmed receipt. A failed or ineligible delivery never shows here. Such an invoice has no delivery field. One of queued, sent, delivered.sentAtstring or nullWhen the e-invoice was sent into the Peppol network. Null while it is queued.
deliveredAtstring or nullWhen the recipient’s access point confirmed receipt. Null until then.
cancellationobjectWhy the invoice was cancelled. Present only on a cancelled invoice whose reason is known. Only the invoice detail has it. List items never do.
codestringA fixed value.
domain_registered_elsewhere: an unpaid order for a new domain registration was cancelled automatically. Someone else registered the name before the invoice was paid. A new domain is registered only once its invoice is paid. The name was never on this account and nothing was charged. One of domain_registered_elsewhere.reasonstringThe explanation, in English. Use
code to branch or to pick a translated text.domainNamestringThe domain name that was ordered.
registrarNamestring or nullThe registrar the name is now registered through, as the registry publishes it.
null when unknown.registeredAtstring or nullWhen the other registration was made at the registry (to the day, at midnight UTC).
null when unknown.cancelledAtstring or nullWhen the order and invoice were cancelled. It comes after
registeredAt, since the cancellation follows that registration.Errors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | The body is invalid. When the amount is too high, errors[0].code is amount_exceeds_available_credit (with availableCredit) or amount_exceeds_invoice_balance (with invoiceBalance). These error bodies carry actions.canApplyCredit.allowed: false even when a smaller amount would work. Read paymentMethods.accountCredit.requirements.maximumAmount on the invoice for the most you can apply. |
| 401 | Unauthorized. Authentication is required. |
| 403 | forbidden: the API key lacks write:billing. requiredScopes names it. The same code comes back when the account is not active. |
| 404 | Not found. The resource does not exist or is not owned by the caller; code is invoice_not_found. |
| 409 | The invoice cannot take credit. invoice_already_paid: it is already paid. invoice_not_payable: it is not unpaid, has nothing left to pay, is an account top-up invoice or is in another currency than the account. |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |
| 502 | upstream_failed: the credit balance, the currencies or the invoice balance could not be checked. Nothing was applied. Retry later. upstream_invoice_shape_invalid: the credit was applied, but the updated invoice could not be loaded. Do not apply it again. Read the invoice with GET /api/v2/billing/invoices/{id}?skipCache=1. |