v52

latestOpenAPI 3.0.1AGPL-3.0raw.githubusercontent.com2026-08-01255473862.7 KB
Invoices

Create one-off invoice

Use when creating a manual or one-off invoice (e.g. custom charge or non-recurring billing). Invoice is created in draft; finalize when ready.

post/invoices

Request body

amount_duestring required

amount_due is the total amount that needs to be paid for this invoice

amount_paidstring

amount_paid is the amount that has been paid towards this invoice

billing_periodstring

billing_period is the period this invoice covers (e.g., "monthly", "yearly")

billing_reason'SUBSCRIPTION_CREATE' | 'SUBSCRIPTION_CYCLE' | 'SUBSCRIPTION_UPDATE' | 'SUBSCRIPTION_TRIAL_END' | 'SUBSCRIPTION_TRIAL_START' | 'PRORATION' | 'MANUAL' | 'AUTO_INVOICE_THRESHOLD' | 'WALLET_AUTO_TOPUP'
couponsstring[]

coupons

currencystring required

currency is the three-letter ISO currency code (e.g., USD, EUR) for the invoice

customer_idstring required

customer_id is the unique identifier of the customer this invoice belongs to

descriptionstring

description is an optional text description of the invoice

due_datestring date-time

due_date is the date by which payment is expected

force_sync_invoiceboolean

force_sync_invoice, when true, attempts to synchronously sync this invoice to Moyasar (if enabled) before returning, instead of relying solely on the async Kafka + Temporal vendor-sync pipeline. Only honored by CreateOneOffInvoice. Best-effort: sync failures do not fail invoice creation.

idempotency_keystring

idempotency_key is an optional key used to prevent duplicate invoice creation

invoice_numberstring

invoice_number is an optional human-readable identifier for the invoice

invoice_pdf_urlstring

invoice_pdf_url is the URL where customers can download the PDF version of this invoice

invoice_status'DRAFT' | 'FINALIZED' | 'VOIDED' | 'SKIPPED'
invoice_type'SUBSCRIPTION' | 'ONE_OFF' | 'CREDIT'
issue_datestring date-time

issue_date overrides the user-facing date of the invoice. Defaults to created_at if not provided.

metadataTypesMetadata
payment_status'INITIATED' | 'PENDING' | 'PROCESSING' | 'SUCCEEDED' | 'OVERPAID' | 'FAILED' | 'REFUNDED' | 'PARTIALLY_REFUNDED' | 'VOIDED'
period_endstring date-time

period_end is the end date of the billing period

period_startstring date-time

period_start is the start date of the billing period

subscription_idstring

subscription_id is the optional unique identifier of the subscription associated with this invoice

subtotalstring required

subtotal is the amount before taxes and discounts are applied

tax_ratesstring[]

tax_rates

totalstring required

total is the total amount of the invoice including taxes and discounts

total_prepaid_appliedstring

total_prepaid_applied is the total amount of prepaid applied to this invoice.

Response

Created

adjustment_amountstring

adjustment_amount is the total sum of credit notes of type "adjustment". These are non-cash reductions applied to the invoice (e.g. goodwill credit, billing correction).

amount_duestring

amount_due is the total amount that needs to be paid for this invoice

amount_paidstring

amount_paid is the amount that has already been paid towards this invoice

amount_remainingstring

amount_remaining is the outstanding amount still owed on this invoice (calculated as amount_due minus amount_paid)

billing_periodstring

billing_period describes the billing period this invoice covers (e.g., "January 2024", "Q1 2024")

billing_reasonstring

billing_reason indicates why this invoice was generated (e.g., "subscription_billing", "manual_charge")

billing_sequenceinteger

billing_sequence is the sequential number indicating the billing cycle for subscription invoices

created_atstring date-time
created_bystring
currencystring

currency is the three-letter ISO currency code (e.g., USD, EUR, GBP) that applies to all monetary amounts on this invoice

customer_idstring

customer_id is the ID of the customer who will receive this invoice

descriptionstring

description is an optional description or notes about this invoice

due_datestring date-time

due_date is the date when payment for this invoice is due

environment_idstring

environment_id is the ID of the environment this invoice belongs to (for multi-environment setups)

finalized_atstring date-time

finalized_at is the timestamp when this invoice was finalized and made ready for payment

idstring

id is the unique identifier for this invoice

idempotency_keystring

idempotency_key is a unique key used to prevent duplicate invoice creation when retrying API calls

invoice_numberstring

invoice_number is the human-readable invoice number displayed to customers (e.g., INV-2024-001)

invoice_pdf_urlstring

invoice_pdf_url is the URL where customers can download the PDF version of this invoice

invoice_status'DRAFT' | 'FINALIZED' | 'VOIDED' | 'SKIPPED'
invoice_type'SUBSCRIPTION' | 'ONE_OFF' | 'CREDIT'
issue_datestring date-time

issue_date is the user-facing date of the invoice. Defaults to created_at if not set.

last_computed_atstring date-time

last_computed_at is the timestamp when this invoice was last computed by ComputeInvoice

metadataTypesMetadata
overpaid_amountstring

overpaid_amount is the amount overpaid if payment_status is OVERPAID (amount_paid - total)

paid_atstring date-time

paid_at is the timestamp when this invoice was fully paid

payment_status'INITIATED' | 'PENDING' | 'PROCESSING' | 'SUCCEEDED' | 'OVERPAID' | 'FAILED' | 'REFUNDED' | 'PARTIALLY_REFUNDED' | 'VOIDED'
period_endstring date-time

period_end is the end date of the billing period covered by this invoice

period_startstring date-time

period_start is the start date of the billing period covered by this invoice

recalculated_invoice_idstring

recalculated_invoice_id is the ID of the replacement invoice created when this invoice was voided and recalculated. When set, it forms a parent→child link from this (voided) invoice to the new replacement invoice.

refunded_amountstring

refunded_amount is the total sum of credit notes of type "refund". These are actual refunds issued to the customer.

status'published' | 'deleted' | 'archived'
subscription_customer_idstring

subscription_customer_id is the subscription owner's customer ID (Subscription.CustomerID). It may differ from customer_id when the subscription uses an invoicing customer. Set internally; nullable in DB.

subscription_idstring

subscription_id is the ID of the subscription this invoice is associated with (only present for subscription-based invoices)

subtotalstring

subtotal is the sum of all line items before any taxes, discounts, or additional fees

tenant_idstring
totalstring

total is the final amount including taxes, fees, and discounts

total_discountstring

total_discount is the sum of all coupon discounts applied to the invoice

total_prepaid_credits_appliedstring

total_prepaid_credits_applied is the total amount of prepaid credits applied to this invoice.

total_taxstring

total_tax is the sum of all taxes combined at the invoice level.

updated_atstring date-time
updated_bystring
versioninteger

version is the version number for tracking changes to this invoice

voided_atstring date-time

voided_at is the timestamp when this invoice was voided or cancelled