Skip to content

Preview a subscription's next invoice

The invoices.upcoming operation: GET /api/v1/invoices/upcoming in the REST API and the invoices_upcoming tool in the MCP server.

GET/api/v1/invoices/upcoming

Shows the invoice a subscription's next renewal will issue, computed by the renewal's own code in a transaction that is rolled back: licensed items for the next period (after a change scheduled for then), metered usage of the ending period so far, late usage, pending invoice items, discounts, tax at the rates known today and the customer's credit balance. It has no number (number: null) and nothing is kept.

For a trial it is the first invoice; for a subscription set to cancel, its final invoice (usage and pending items). A subscription that bills nothing next (ended, paused without invoices, unpaid, or nothing to bill) returns invoice_upcoming_none. Usage recorded until the period end still changes the real invoice.

At a glance

  • REST: GET /api/v1/invoices/upcoming
  • MCP tool: invoices_upcoming
  • Operation ID: invoices.upcoming
  • Scope: Brand
  • Permission: invoices:read
  • Risk tier: read
  • Dry run: Not supported
  • Idempotency: Not needed (read only)
  • Modes: Test and live
  • Authentication: API key with the invoices:read scope
  • Since: M5

Request

Query parameters

FieldTypeRequiredDescription
subscriptionIdsub_… IDYesThe subscription whose next invoice to preview (sub_…).

Response

200 OK with a JSON object:

FieldTypeDescription
idinv_… ID
object"invoice"
livemodeboolean
entityIdent_… ID
brandIdbrd_… ID
numberstring or nullThe invoice number: gap-free per legal entity, mode, brand series and year (§18.2). Null for a draft: the number is taken at finalization.
numberingobject or null
customerIdcus_… ID or null
subscriptionIdsub_… ID or null
collectionMethodone of charge_automatically, send_invoice
kindone of invoice, receipt or nullinvoice (business customers) or receipt (the receipt-invoice consumers get); null for a draft.
statusone of 9 values, e.g. draft, pending_registration, issued (all in the OpenAPI document)draft → open (finalized) → paid, void or uncollectible. Checkout invoices are issued (paid at once), or pending_registration: a full invoice charged before the tax registration exists; the receipt went out and the formal invoice follows (§18.1).
languageone of en, de, fr, hr, it, es or null
issuedAtdate-time or null
issueDatestring or nullThe issue date in the seller's time zone.
taxPointdate-time or null
taxPointDatestring or nullThe date of supply in the seller's time zone.
daysUntilDueinteger or nullsend_invoice: days from the issue date to the due date.
dueDatestring or nullsend_invoice: when payment is due (fixed at finalization).
sellerobject or null
buyerobject or null
currencystring
linesarray of object
lines[].idstringThe tax quote's line ID.
lines[].descriptionstring
lines[].productIdprod_… ID or null
lines[].priceIdprice_… ID or null
lines[].quantityinteger
lines[].taxCategoryIdone of 9 values, e.g. electronically_supplied_service, saas, ebook (all in the OpenAPI document)
lines[].taxBehaviorone of inclusive, exclusive
lines[].unitAmountmoneyThe net price of one unit (may be finer than the minor unit).
lines[].netmoney
lines[].taxobject
lines[].tax.ratePpmstringParts per million as a string (19% = "190000").
lines[].tax.amountmoney
lines[].tax.jurisdictionIdstring or null
lines[].tax.regimeIdstring or null
lines[].tax.decisionone of charge, reverse_charge, exempt, not_taxable, out_of_scope, not_collected, blockedWhat happened to the tax: charge, reverse_charge, exempt, not_taxable, out_of_scope, not_collected.
lines[].tax.rateKindone of standard, reduced, super_reduced, parking, zero, exempt, not_taxable or null
lines[].tax.rateIdstring or null
lines[].tax.pendingRegistrationboolean
lines[].grossmoney
lines[].kindone of licensed, metered, late_usage, proration, invoice_item or nullWhere the line came from (§16.3 order); null on checkout invoices.
lines[].periodobject or null
lines[].subscriptionItemIdstring or null
lines[].invoiceItemIdii_… ID or null
lines[].discountmoney or nullWhat discounts took off the line before tax.
lines[].meteredQuantitystring or nullA metered line's usage (its quantity is 1).
totalsobject or null
taxCurrencyTotalsobject or nullThe tax in the seller's tax currency when the invoice is in another one (§18.3).
creditAppliedmoney or nullTaken from the customer's credit balance at finalization (§16.11).
amountDuemoney or nullWhat the customer pays: the gross total less the credit applied. Null on checkout invoices.
notesarray of object
notes[].codeone of reverse_charge, exempt, out_of_scope, registration_pending, oss_scheme
notes[].textstringThe note as printed.
fieldCheckobject or nullWhat the knowledge base's invoicing rules ask for that the invoice lacks (missing), and requirements Ownrecord can't check yet (unchecked).
pendingRegistrationbooleanA full invoice with a line charged before the registration exists (§18.1).
paymentIdsarray of pay_… ID
creditNoteIdsarray of cn_… ID
ledgerTxnIdsarray of txn_… ID
quoteIdtq_… ID or nullThe tax quote the invoice shows (null for a draft).
quoteIdsarray of tq_… IDEvery quote of the invoice: lines taxed at another date (prorations) have their own quote.
pdfobject or nullNull for a draft: the PDF is rendered at finalization.
finalizedAtdate-time or null
paidAtdate-time or null
paymentobject or nullHow the invoice was paid: bank_transfer (marked paid), processor (a card or debit payment) or credit_balance.
voidedAtdate-time or null
markedUncollectibleAtdate-time or null
emailedAtdate-time or null
sentAtdate-time or nullWhen invoices.send last emailed the invoice.
draftobject or nullA draft's lines before tax (tax is quoted at finalization); null once finalized.
metadataobject
versionintegerPass it as expectedVersion to refuse a change if the invoice changed. Rendering the PDF and emailing the invoice change it too.
createdAtdate-time
updatedAtdate-time

Examples

The next renewal of a monthly subscription with metered usage

HTTP
GET /api/v1/invoices/upcoming?subscriptionId=sub_01jacq4m3xf0v8w9zq2y7k5n6s
Authorization: Bearer or_test_…

Response (200):

JSON
{
  "id": "inv_01m4tx5nj8emwbyf7y9vcf47yk",
  "object": "invoice",
  "livemode": false,
  "entityId": "ent_01m4tx5nj8emwbyf7y9vcf47x2",
  "brandId": "brd_01m4tx5nj8emwbyf7y9vcf47x4",
  "number": null,
  "numbering": null,
  "customerId": "cus_01m4tx5nj8emwbyf7y9vcf47ym",
  "subscriptionId": "sub_01jacq4m3xf0v8w9zq2y7k5n6s",
  "collectionMethod": "charge_automatically",
  "kind": "invoice",
  "status": "open",
  "language": "en",
  "issuedAt": "2026-11-20T10:00:00.000Z",
  "issueDate": "2026-11-20",
  "taxPoint": "2026-11-20T10:00:00.000Z",
  "taxPointDate": "2026-11-20",
  "daysUntilDue": 14,
  "dueDate": null,
  "seller": {
    "entityId": "ent_01m4tx5nj8emwbyf7y9vcf47x2",
    "legalName": "Acme Digital d.o.o.",
    "tradingName": null,
    "address": {
      "line1": "Ilica 1",
      "line2": null,
      "city": "Zagreb",
      "postalCode": "10000",
      "region": null,
      "country": "HR"
    },
    "companyRegistryId": "080000001",
    "taxIds": [
      {
        "type": "eu_vat",
        "value": "HR12345678901",
        "regimeId": null
      }
    ],
    "brand": {
      "brandId": "brd_01m4tx5nj8emwbyf7y9vcf47x4",
      "name": "Genno",
      "primaryColor": "#0E6B5C",
      "accentColor": null,
      "supportEmail": "help@genno.example",
      "supportUrl": null
    },
    "footerText": null
  },
  "buyer": {
    "type": "b2b",
    "customerId": "cus_01m4tx5nj8emwbyf7y9vcf47ym",
    "name": "Alpen Apps GmbH",
    "email": "billing@alpen.example",
    "address": null,
    "country": "AT",
    "taxId": {
      "type": "eu_vat",
      "value": "ATU00000000",
      "country": "AT"
    }
  },
  "currency": "EUR",
  "lines": [
    {
      "id": "1",
      "description": "App (Pro)",
      "productId": "prod_01jacq4m3xf0v8w9zq2y7k5n6p",
      "priceId": "price_01jacq4m3xf0v8w9zq2y7k5n6p",
      "quantity": 3,
      "taxCategoryId": "saas",
      "taxBehavior": "exclusive",
      "unitAmount": {
        "amount": "30000000",
        "currency": "EUR"
      },
      "net": {
        "amount": "90000000",
        "currency": "EUR"
      },
      "tax": {
        "ratePpm": "0",
        "amount": {
          "amount": "0",
          "currency": "EUR"
        },
        "jurisdictionId": "AT",
        "regimeId": "EU_OSS_UNION",
        "decision": "reverse_charge",
        "rateKind": null,
        "rateId": null,
        "pendingRegistration": false
      },
      "gross": {
        "amount": "90000000",
        "currency": "EUR"
      },
      "kind": "licensed",
      "period": {
        "start": "2026-11-20T10:00:00.000Z",
        "end": "2026-12-20T10:00:00.000Z"
      },
      "subscriptionItemId": "si_01jacq4m3xf0v8w9zq2y7k5n6i",
      "invoiceItemId": null,
      "discount": null,
      "meteredQuantity": null
    },
    {
      "id": "2",
      "description": "API",
      "productId": "prod_01jacq4m3xf0v8w9zq2y7k5n6a",
      "priceId": "price_01jacq4m3xf0v8w9zq2y7k5n6a",
      "quantity": 1,
      "taxCategoryId": "saas",
      "taxBehavior": "exclusive",
      "unitAmount": {
        "amount": "12500000",
        "currency": "EUR"
      },
      "net": {
        "amount": "12500000",
        "currency": "EUR"
      },
      "tax": {
        "ratePpm": "0",
        "amount": {
          "amount": "0",
          "currency": "EUR"
        },
        "jurisdictionId": "AT",
        "regimeId": "EU_OSS_UNION",
        "decision": "reverse_charge",
        "rateKind": null,
        "rateId": null,
        "pendingRegistration": false
      },
      "gross": {
        "amount": "12500000",
        "currency": "EUR"
      },
      "kind": "metered",
      "period": {
        "start": "2026-10-20T09:00:00.000Z",
        "end": "2026-11-20T10:00:00.000Z"
      },
      "subscriptionItemId": "si_01jacq4m3xf0v8w9zq2y7k5n6m",
      "invoiceItemId": null,
      "discount": null,
      "meteredQuantity": "1250"
    }
  ],
  "totals": {
    "net": {
      "amount": "102500000",
      "currency": "EUR"
    },
    "tax": {
      "amount": "0",
      "currency": "EUR"
    },
    "gross": {
      "amount": "102500000",
      "currency": "EUR"
    },
    "taxByRate": [
      {
        "ratePpm": "0",
        "jurisdictionId": "AT",
        "regimeId": "EU_OSS_UNION",
        "decision": "reverse_charge",
        "net": {
          "amount": "102500000",
          "currency": "EUR"
        },
        "tax": {
          "amount": "0",
          "currency": "EUR"
        }
      }
    ]
  },
  "taxCurrencyTotals": null,
  "creditApplied": null,
  "amountDue": {
    "amount": "102500000",
    "currency": "EUR"
  },
  "notes": [
    {
      "code": "reverse_charge",
      "text": "Prijenos porezne obveze (reverse charge) – čl. 17. st. 1. Zakona o PDV-u"
    }
  ],
  "fieldCheck": {
    "invoicingRuleIds": [],
    "missing": ["buyer_address"],
    "unchecked": []
  },
  "pendingRegistration": false,
  "paymentIds": [],
  "creditNoteIds": [],
  "ledgerTxnIds": ["txn_01m4tx5nj8emwbyf7y9vcf47yn"],
  "quoteId": "tq_01m4tx5nj8emwbyf7y9vcf47xr",
  "quoteIds": ["tq_01m4tx5nj8emwbyf7y9vcf47xr"],
  "pdf": {
    "status": "pending",
    "fileId": null,
    "sha256": null,
    "size": null,
    "templateVersion": null,
    "renderedAt": null,
    "url": "/api/v1/invoices/inv_01m4tx5nj8emwbyf7y9vcf47yk/pdf"
  },
  "finalizedAt": "2026-10-20T09:00:00.000Z",
  "paidAt": null,
  "payment": null,
  "voidedAt": null,
  "markedUncollectibleAt": null,
  "emailedAt": null,
  "sentAt": null,
  "draft": null,
  "metadata": {
    "contract": "ENT-2026-07"
  },
  "version": 2,
  "createdAt": "2026-10-20T08:30:00.000Z",
  "updatedAt": "2026-10-20T09:00:00.000Z"
}

Errors

CodeHTTP statusWhenWhat to do
validation_failed400subscriptionId is missing or malformed.Fix the fields listed in details.issues and send the request again.
resource_not_found404No subscription with this ID exists for the brand in this mode.Check the ID and that your credentials are scoped to the right organization, entity, brand and mode.
invoice_upcoming_none404Nothing is billed at the next period end: ended, set to end with nothing to bill, paused without invoices, or unpaid (details.reason).Nothing is billed at the next period end: the subscription has ended, is set to end without anything left to bill, is paused without invoices, or is unpaid. Read the subscription for its status.
registration_required422The invoice couldn't be taxed now: the seller isn't registered where the customer is.Register the entity for the regime named in details.regime (see its prerequisites and deadline), or arm the jurisdiction once the prerequisites are done. The customer can join the waitlist meanwhile.
jurisdiction_blocked422The customer's location is blocked.This jurisdiction isn't covered by usable tax knowledge for this seller. Contact support if you need to sell there.
evidence_conflict422The customer's stored location evidence isn't enough to tax the invoice (§13.3).Collect another piece of location evidence (billing address, card country, or the customer's confirmation of their country) and quote again.
permission_denied403The credentials can't read this brand's invoices (invoices:read).Ask an organization owner or admin for a role or scope that allows this action.

It can also return these common errors: api_version_unsupported, authentication_required, api_key_invalid, scope_required, dry_run_not_supported, rate_limited, internal_error.