Creates an invoice for charge-items and one-time charges. The item prices must belong to items of type charge.
You can optionally override the line item name and description displayed on the invoice for charge-item prices and one-time charges. When create_pending_invoice is true, the invoice is created in pending status without collecting payment. You can review the invoice, add more charges if needed, and close it later via the close a pending invoice operation.
One-time charges are represented in an invoice as line_items with entity_type adhoc.
Sample Request
Sample Result[JSON]
URL Format
Input Parameters
Unique ID of the customer this invoice should be created for. Either this or subscription_id must be provided.
Note
The invoice is linked to the same business entity as this customer.
Unique ID of the subscription this invoice should be created for. Either this or customer_id must be provided.
Note
The invoice is linked to the same business entity as this subscription.
A note for this particular invoice. This, and all other notes for the invoice are displayed on the PDF invoice sent to the customer.
Set as true
to remove the general note
from this invoice.
If specified, the customer level auto collection will be overridden.
Note
- When
create_pending_invoiceistrue,auto_collectioncannot be passed. When the pending invoice is closed, the subscriptionauto_collectionsetting is used when available; otherwise, the customerauto_collectionsetting applies.
Whenever an invoice is created, an automatic attempt will be made to charge.
Whenever an invoice is created as payment due.
The document date displayed on the invoice PDF. By default, it is the date of creation of the invoice or, when Metered Billing is enabled, it can be the date of closing the invoice. Provide this value to backdate the invoice (set the invoice date to a value in the past). Backdating an invoice is done for reasons such as booking revenue for a previous date or when the non-recurring charge is effective as of a past date.
taxes
and
line_item_taxes
are computed based on the tax configuration as of this date. The date should not be more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
When set to true, the invoice is created with status as pending and payment is not collected. The invoice can be closed later via the close a pending invoice operation.
Prerequisites
- Usage-based billing must be enabled for the site.
subscription_idmust be provided.
Constraints
- Payment collection parameters cannot be passed when this parameter is
true. This includespayment_source_id,authorization_transaction_id,auto_collection,payment_methodparameters,cardparameters,payment_intentparameters, andtoken_id. auto_collectioncannot be overridden on this request. When the pending invoice is closed, the subscription or customerauto_collectionsetting applies.
The type of initiator to be used for the payment request triggered by this operation.
Pass this value to indicate that the request is initiated by the customer
Pass this value to indicate that the request is initiated by the merchant