Attributes

Manage billing documents for subscriptions and one-time charges.

Overview

Invoices represent billing documents sent to customers. They can be generated automatically from subscriptions or created manually for one-time charges. Each invoice tracks amounts due, payments received, and billing status.


How It Works

  1. Invoice creation - Invoices are created automatically when subscriptions renew or manually via the API
  2. Payment collection - Invoices can be paid automatically or manually marked as paid
  3. Status tracking - Track invoice lifecycle from draft to paid, void, or uncollectible

Example: When a subscription renews, the system automatically creates an invoice with the plan amount, applies any discounts, calculates taxes, and attempts to collect payment from the customer's default payment method.


API Endpoints

MethodEndpointDescription
GET/api/v1/core/invoicesList all invoices
POST/api/v1/core/invoicesCreate an invoice
GET/api/v1/core/invoices/{id}Get an invoice
PUT/api/v1/core/invoices/{id}Update an invoice
POST/api/v1/core/invoices/{id}/pay_offlineRecord an offline payment
POST/api/v1/core/invoices/{id}/voidVoid an invoice
POST/api/v1/core/invoices/{id}/uncollectibleMark as uncollectible

Invoice Statuses

StatusDescription
draftInvoice is being prepared, not yet finalized
openInvoice is finalized and awaiting payment
paidPayment has been collected successfully
past_duePayment deadline has passed
voidInvoice has been canceled
uncollectibleInvoice has been marked as uncollectible

Billing Methods

MethodDescription
charge_automaticallySystem attempts to charge the customer's default payment method
send_invoiceCustomer receives an invoice to pay manually

Invoice Object

AttributeTypeDescription
idintegerUnique identifier for the invoice
user_idintegerID of the customer (expandable)
subscription_idintegerID of the associated subscription (expandable)
charge_idintegerID of the successful charge (expandable)
discount_idintegerID of the applied discount (expandable)
numberstringInvoice number
statusstringInvoice status (see statuses above)
currencystringThree-letter ISO currency code
amount_dueintegerAmount due in cents
amount_paidintegerAmount paid in cents
amount_remainingintegerRemaining amount in cents
subtotalintegerSubtotal before tax in cents
taxintegerTax amount in cents
totalintegerTotal amount in cents
paidbooleanWhether the invoice has been paid
billingstringBilling method
billing_reasonstringReason for the invoice
auto_advancebooleanWhether invoice auto-finalizes
due_datetimestampUnix timestamp when payment is due
period_starttimestampUnix timestamp of billing period start
period_endtimestampUnix timestamp of billing period end
starting_balanceintegerCustomer balance before invoice
ending_balanceintegerCustomer balance after invoice
plan_namestringName of the associated plan
product_namestringName of the associated product
customer_addressobjectCustomer's billing address
hosted_invoice_urlstringURL to hosted invoice page
invoice_pdfstringURL to download invoice PDF
payment_linkstringURL for customer to pay
post_payment_credit_notes_amountintegerCredit notes after payment
pre_payment_credit_notes_amountintegerCredit notes before payment
is_importedbooleanWhether invoice was imported
notesstringInvoice footer/notes
metadataobjectKey-value pairs for storing additional data
finalized_attimestampUnix timestamp when finalized
paid_attimestampUnix timestamp when paid
voided_attimestampUnix timestamp when voided
marked_uncollectible_attimestampUnix timestamp when marked uncollectible
created_attimestampUnix timestamp of creation
updated_attimestampUnix timestamp of last update
deleted_attimestampUnix timestamp of deletion

Related Endpoints