v51

latestOpenAPI 3.0.0Apache 2.0raw.githubusercontent.com2026-08-011534301009.2 KB
Billing

Invoice a customer based on the pending line items

Create a new invoice from the pending line items.

This should be only called if for some reason we need to invoice a customer outside of the normal billing cycle.

When creating an invoice, the pending line items will be marked as invoiced and the invoice will be created with the total amount of the pending items.

New pending line items will be created for the period between now() and the next billing cycle's begining date for any metered item.

The call can return multiple invoices if the pending line items are in different currencies.

post/api/v1/billing/invoices/invoice

Request body

asOfstring date-time

The time as of which the invoice is created.

If not provided, the current time is used.

customerIdstring required

The customer ID for which to create the invoice.

progressiveBillingOverrideboolean

Override the progressive billing setting of the customer.

Can be used to disable/enable progressive billing in case the business logic requires it, if not provided the billing profile's progressive billing setting will be used.

Example request

{
  "filters": {
    "lineIds": [
      "01G65Z755AFWAKHE12NY0CQ9FH"
    ]
  },
  "asOf": "2023-01-01T01:01:01.001Z",
  "customerId": "01G65Z755AFWAKHE12NY0CQ9FH"
}

Response

The request has succeeded and a new resource has been created as a result.

idstring required

A unique identifier for the resource.

descriptionstring

Optional description of the resource. Maximum 1024 characters.

metadataMetadata

Set of key-value pairs. Metadata can be used to store additional information about a resource.

createdAtstring date-time required

Timestamp of when the resource was created.

updatedAtstring date-time required

Timestamp of when the resource was last updated.

deletedAtstring date-time

Timestamp of when the resource was permanently deleted.

type'standard' | 'credit_note' required

InvoiceType represents the type of invoice.

The type of invoice determines the purpose of the invoice and how it should be handled.

numberstring required

InvoiceNumber is a unique identifier for the invoice, generated by the invoicing app.

The uniqueness depends on a lot of factors:

  • app setting (unique per app or unique per customer)
  • multiple app scenarios (multiple apps generating invoices with the same prefix)
currencystring required

Three-letter ISO4217 currency code. Custom three-letter currency codes are also supported for convenience.

status'gathering' | 'draft' | 'issuing' | 'issued' | 'payment_processing' | 'overdue' | 'paid' | 'uncollectible' | 'voided' required

InvoiceStatus describes the status of an invoice.

issuedAtstring date-time

The time the invoice was issued.

Depending on the status of the invoice this can mean multiple things:

  • draft, gathering: The time the invoice will be issued based on the workflow settings.
  • issued: The time the invoice was issued.
draftUntilstring date-time

The time until the invoice is in draft status.

On draft invoice creation it is calculated from the workflow settings.

If manual approval is required, the draftUntil time is set.

quantitySnapshotedAtstring date-time

The time when the quantity snapshots on the invoice lines were taken.

collectionAtstring date-time

The time when the invoice will be/has been collected.

dueAtstring date-time

Due time of the fulfillment of the invoice (if available).

voidedAtstring date-time

The time the invoice was voided.

If the invoice was voided, this field will be set to the time the invoice was voided.

sentToCustomerAtstring date-time

The time the invoice was sent to customer.