Create a standalone invoice

Creates a standalone invoice for selling physical goods, services or other items on a non-recurring basis to your subscription customers.

To use this operation, you must have the "Create Standalone Invoice" and "Modify Invoice" user permissions. See Billing Roles for more information. As of Zuora Release 2022.03.R5, newly created standard Billing users have the “Create Standalone Invoice” permission enabled by default.

Request
header Parameters
Idempotency-Key
string <= 255 characters

Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types.

With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident.

Accept-Encoding
string

Include the Accept-Encoding: gzip header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.

If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a Content-Encoding header with the compression algorithm so that your client can decompress it.

Content-Encoding
string

Include the Content-Encoding: gzip header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload.

Authorization
string

The value is in the Bearer {token} format where {token} is a valid OAuth token generated by calling Create an OAuth token.

Zuora-Track-Id
string <= 64 characters

A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.

The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (:), semicolon (;), double quote ("), and quote (').

Zuora-Entity-Ids
string

An entity ID. If you have Zuora Multi-entity enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you should not set this header.

Zuora-Org-Ids
string

Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header.

The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails.

If the header is not set, the operation is performed in scope of the user's accessible orgs.

Request Body schema: application/json
required
accountId
string

The ID of the account associated with the invoice.

You must specify either accountNumber or accountId for a customer account. If both of them are specified, they must refer to the same customer account.

accountNumber
string

The Number of the account associated with the invoice. You must specify either accountNumber or accountId for a customer account. If both of them are specified, they must refer to the same customer account.

autoPay
boolean
Default: false

Whether invoices are automatically picked up for processing in the corresponding payment run.

object (Contact)

Container for bill-to or sold-to contact information. A new Contact will be created under the invoice owner account.

Note: If you have the Flexible Billing Attributes feature disabled, this field is unavailable in the request body.

billToContactId
string

The ID of the bill-to contact associated with the invoice. This field is mutually exclusive with the billToContact field.

Note: If you have the Flexible Billing Attributes feature disabled, this field is unavailable in the request body.

comments
string

Comments about the invoice.

currency
string

The code of a currency as defined in Billing Settings through the Zuora UI.

If you do not specify a currency during standalone invoice creation, the default account currency is applied. The currency that you specify in the request must be configured and activated in Billing Settings. Note: This field is available only if you have the Multiple Currencies feature enabled.

Array of objects (customRates) <= 2 items

It contains Home currency and Reporting currency custom rates currencies. The maximum number of items is 2 (you can pass the Home currency item or Reporting currency item or both).

Note:

  • This field is available only if you are on the latest Zuora API minor version, or you set the zuora-version request header to 224.0 or a later available version.
  • You cannot set the custom rates, if both the Automatically include additional Currency Conversion information in data source exports option and Fx data feature are enabled.
dueDate
string <date>

The date by which the payment for this invoice is due, in yyyy-mm-dd format.

invoiceDate
required
string <date>

The date that appears on the invoice being created, in yyyy-mm-dd format. The value cannot fall in a closed accounting period.

Array of objects (PostInvoiceItemType)

Container for invoice items. The maximum number of invoice items is 1,000.

Note: For the "Create a standalone invoice" and "Create standalone invoices" operations, note the following:

  • If tax has been calculated by an external tax engine, you need to create a standalone invoice with both invoiceItems and taxItems. The taxItems corresponds to the tax information processed by this external tax engine. In this case, you should not specify the taxMode and taxCode nested fields of the invoiceItems field. Instead, you need to specify the taxMode and taxCode nested fields of the taxItems field. You need to specify the taxMode field as TaxExclusive.
  • If tax has not been calculated by an external tax engine, you can create a standalone invoice only with invoiceItems, and decide whether Zuora includes the tax in the quoted charge price and invoice item by specifying the taxMode nested field of the invoiceItems field as either TaxExclusive or TaxInclusive. Meanwhile, you need to specify the taxCode field, indicating the charge price and invoice item are taxable.
invoiceNumber
string

A customized invoice number with the following format requirements:

  • Max length: 32 characters
  • Acceptable characters: a-z,A-Z,0-9,-,_,

Purely numerical prefixes or prefixes ending with a number are supported for standalone invoices. For example, you can use 202310000300, 2003, INV202310000300, or 2023-09-100009785 as invoice numbers.

The value must be unique in the system, otherwise it may cause issues with bill runs and subscribe/amend. Check out things to note and troubleshooting steps.

paymentTerm
string

The ID or name of the payment term associated with the invoice. For example, Net 30. The payment term determines the due dates of invoices.

Note: If you have the Flexible Billing Attributes feature disabled, this field is unavailable in the request body.

sequenceSet
string

The ID or name of the sequence set associated with the invoice.

Note: If you have the Flexible Billing Attributes feature disabled, this field is unavailable in the request body.

object (Contact)

Container for bill-to or sold-to contact information. A new Contact will be created under the invoice owner account.

Note: If you have the Flexible Billing Attributes feature disabled, this field is unavailable in the request body.

soldToContactId
string

The ID of the sold-to contact associated with the invoice. This field is mutually exclusive with the soldToContact field.

Note: If you have the Flexible Billing Attributes feature disabled, this field is unavailable in the request body.

soldToSameAsBillTo
boolean
Default: false

Whether the sold-to contact and bill-to contact are the same entity. This field is mutually exclusive with the soldToContact and soldToContactId fields.

The created invoice has the same bill-to contact and sold-to contact entity only when all the following conditions are met in the request body:

  • This field is set to true.
  • A bill-to contact or bill-to contact ID is specified.
  • Neither sold-to contact nor sold-to contact ID is specified.

Note: If you have the Flexible Billing Attributes feature disabled, this field is unavailable in the request body.

status
string
Default: "Draft"

The status of invoice. By default, the invoice status is Draft.

When creating an invoice, if you set this field to Posted, the invoice is created and posted directly.

Enum: "Draft" "Posted"
templateId
string

The ID of the invoice template associated with the invoice.

Note: If you have the Flexible Billing Attributes feature disabled, this field is unavailable in the request body.

transferredToAccounting
string
Enum: "Processing" "Error" "Ignore" "Yes" "No"
IntegrationId__NS
string <= 255 characters

ID of the corresponding object in NetSuite. Only available if you have installed the Zuora Connector for NetSuite.

IntegrationStatus__NS
string <= 255 characters

Status of the invoice's synchronization with NetSuite. Only available if you have installed the Zuora Connector for NetSuite.

SyncDate__NS
string <= 255 characters

Date when the invoice was synchronized with NetSuite. Only available if you have installed the Zuora Connector for NetSuite.

property name*
additional property
any

Custom fields of the Invoice object. The name of each custom field has the form customField__c. Custom field names are case sensitive. See Manage Custom Fields for more information.

Responses
200
500

Internal Server Error

4XX

Request Errors

post/v1/invoices
Request samples
application/json
{
  • "accountId": "8ad09be48db5aba7018db604776d4854",
  • "invoiceDate": "2024-07-30",
  • "invoiceItems": [
    ]
}
Response samples
application/json
{
  • "id": "8ad084db909fae930190a121c84957ff",
  • "invoiceNumber": "INV00000155",
  • "accountId": "8ad09be48db5aba7018db604776d4854",
  • "amount": 100,
  • "amountWithoutTax": 100,
  • "discount": 0,
  • "invoiceDate": "2024-07-30",
  • "dueDate": "2024-08-29",
  • "autoPay": false,
  • "comments": null,
  • "status": "Draft",
  • "taxAmount": 0,
  • "taxExemptAmount": 0,
  • "transferredToAccounting": null,
  • "sourceType": "Standalone",
  • "billToContactId": null,
  • "soldToContactId": null,
  • "templateId": null,
  • "paymentTerm": null,
  • "sequenceSetId": null,
  • "adjustmentAmount": 0,
  • "balance": 100,
  • "billToContactSnapshotId": null,
  • "creditMemoAmount": 0,
  • "includesOneTime": true,
  • "includesRecurring": true,
  • "includesUsage": true,
  • "lastEmailSentDate": null,
  • "paymentAmount": 0,
  • "postedBy": null,
  • "postedDate": null,
  • "refundAmount": 0,
  • "soldToContactSnapshotId": null,
  • "source": "API",
  • "sourceId": null,
  • "targetDate": null,
  • "taxMessage": null,
  • "taxStatus": "Complete",
  • "createdById": "b243314d594646d3b2651aeedd4be47e",
  • "createdDate": "2024-07-11 02:31:04",
  • "updatedById": "b243314d594646d3b2651aeedd4be47e",
  • "updatedDate": "2024-07-11 02:31:04",
  • "billRunId": null,
  • "currency": "USD",
  • "invoiceGroupNumber": null,
  • "success": true
}