POST /v1/invoices/batch

Creates multiple standalone invoices 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.

Limitations

This operation has the following limitations:

Servers

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Content-Encoding String No

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.

Zuora-Track-Id String No

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 (').

Authorization String No

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

Idempotency-Key String No

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.

Zuora-Entity-Ids String No

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 do not need to set this header.

Zuora-Org-Ids String No

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.

Accept-Encoding String No

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.

Request body fields

Name Type Required Description
useSingleTransaction Boolean No

Whether a batch request is handled with a single transaction.

  • true indicates that a batch request will be handled with a single transaction.
  • false indicates that the standalone invoices to be created in a batch request will be handled with separated transactions.

If the field is set to false, a failure in the batch request will not cause the whole request to fail, so you have to retry the whole batch request.

invoices[] Array No

Container for standalone invoices.

invoices[].IntegrationStatus__NS String No

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

invoices[].soldToSameAsBillTo Boolean No

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.

Default value: false

invoices[].accountId String No

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.

invoices[].IntegrationId__NS String No

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

invoices[].invoiceNumber String No

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.

invoices[].invoiceDate String Yes

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

invoices[].invoiceItems[] Array No

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.
invoices[].invoiceItems[].recognizedRevenueAccountingCode String No

The accounting code for the recognized revenue, such as Monthly Recurring Charges or Overage Charges.

Note: This field is only available if you have Zuora Finance enabled.

invoices[].invoiceItems[].serviceEndDate String No

The service end date of the invoice item.

invoices[].invoiceItems[].bookingReference String No

The booking reference of the invoice item.

invoices[].invoiceItems[].description String No

The description of the invoice item.

invoices[].invoiceItems[].revRecCode String No

The revenue recognition code.

invoices[].invoiceItems[].adjustmentRevenueAccountingCode String No

The accounting code for adjustment revenue.

Note: This field is only available if you have the Billing - Revenue Integration feature enabled.

invoices[].invoiceItems[].chargeDate String No

The date when the invoice item is charged, in yyyy-mm-dd hh:mm:ss format.

invoices[].invoiceItems[].uom String No

The unit of measure.

invoices[].invoiceItems[].itemType String No

The type of the invoice item.

invoices[].invoiceItems[].taxItems[] Array No

Container for taxation items. The maximum number of taxation items is 5.

Note: This field is only available only if you have Taxation enabled.

invoices[].invoiceItems[].taxItems[].exemptAmount String No

The calculated tax amount excluded due to the exemption.

invoices[].invoiceItems[].taxItems[].jurisdiction String No

The jurisdiction that applies the tax or VAT. This value is typically a state, province, county, or city.

invoices[].invoiceItems[].taxItems[].name String Yes

The name of taxation.

invoices[].invoiceItems[].taxItems[].taxRateType String Yes

The type of the tax rate applied to the invoice item.

Possible values:

  • "FlatFee"
  • "Percentage"
invoices[].invoiceItems[].taxItems[].taxAmount String Yes

The amount of the taxation item in the invoice item.

invoices[].invoiceItems[].taxItems[].locationCode String No

The identifier for the location based on the value of the taxCode field.

invoices[].invoiceItems[].taxItems[].taxCode String Yes

The tax code identifies which tax rules and tax rates to apply to a specific invoice item.

invoices[].invoiceItems[].taxItems[].taxDate String Yes

The date that the tax is applied to the invoice item, in yyyy-mm-dd format.

invoices[].invoiceItems[].taxItems[].taxRate String Yes

The tax rate applied to the invoice item.

invoices[].invoiceItems[].taxItems[].taxCodeDescription String No

The description of the tax code.

invoices[].invoiceItems[].taxItems[].taxMode String Yes

The tax mode of the invoice item, indicating whether the amount of the invoice item includes tax.

Possible values:

  • "TaxExclusive"
  • "TaxInclusive"
invoices[].invoiceItems[].taxItems[].taxRateDescription String No

The description of the tax rate.

invoices[].invoiceItems[].excludeItemBillingFromRevenueAccounting Boolean No

The flag to exclude the invoice item from revenue accounting.

Note: This field is only available if you have the Billing - Revenue Integration feature enabled.

invoices[].invoiceItems[].SyncDate__NS String No

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

invoices[].invoiceItems[].revRecTriggerCondition String No

The date when revenue recognition is triggered.

Possible values:

  • "ServiceActivationDate"
  • "ContractEffectiveDate"
  • "CustomerAcceptanceDate"
invoices[].invoiceItems[].sku String No

The SKU of the invoice item. The SKU of the invoice item must be different from the SKU of any existing product.

invoices[].invoiceItems[].accountingCode String No

The accounting code associated with the invoice item.

invoices[].invoiceItems[].contractAssetAccountingCode String No

The accounting code for contract asset.

Note: This field is only available if you have the Billing - Revenue Integration feature enabled.

invoices[].invoiceItems[].unbilledReceivablesAccountingCode String No

The accounting code for unbilled receivables.

Note: This field is only available if you have the Billing - Revenue Integration feature enabled.

invoices[].invoiceItems[].chargeName String No

The name of the charge associated with the invoice item.

This field is required if the productRatePlanChargeId field is not specified in the request.

invoices[].invoiceItems[].deferredRevenueAccountingCode String No

The accounting code for the deferred revenue, such as Monthly Recurring Liability.

Note: This field is only available if you have Zuora Finance enabled.

invoices[].invoiceItems[].unitPrice String No

The per-unit price of the invoice item. To pass Level 3 data to the gateway, this field is required and must be greater than zero.

invoices[].invoiceItems[].IntegrationStatus__NS String No

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

invoices[].invoiceItems[].IntegrationId__NS String No

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

invoices[].invoiceItems[].quantity String No

The number of units for the invoice item.

Default value: "1"

invoices[].invoiceItems[].revenueRecognitionRuleName String No

The name of the revenue recognition rule governing the revenue schedule.

Note: This field is only available if you have Zuora Finance enabled.

invoices[].invoiceItems[].discountItems[] Array No

Container for discount items. The maximum number of discount items is 10.

invoices[].invoiceItems[].discountItems[].recognizedRevenueAccountingCode String No

The accounting code for the recognized revenue, such as Monthly Recurring Charges or Overage Charges. Note: This field is only available if you have Zuora Finance enabled.

invoices[].invoiceItems[].discountItems[].bookingReference String No

The booking reference of the discount item.

invoices[].invoiceItems[].discountItems[].description String No

The description of the discount item.

invoices[].invoiceItems[].discountItems[].revRecCode String No

The revenue recognition code.

invoices[].invoiceItems[].discountItems[].adjustmentRevenueAccountingCode String No

The accounting code for adjustment revenue. Note: This field is only available if you have the Billing - Revenue Integration feature enabled.

invoices[].invoiceItems[].discountItems[].chargeDate String No

The date when the discount item is charged, in yyyy-mm-dd hh:mm:ss format.

invoices[].invoiceItems[].discountItems[].itemType String No

The type of the discount item.

invoices[].invoiceItems[].discountItems[].taxItems[] Array No

Container for taxation items. The maximum number of taxation items is 5.

Note: This field is only available only if you have Taxation enabled.

invoices[].invoiceItems[].discountItems[].taxItems[].exemptAmount String No

The calculated tax amount excluded due to the exemption.

invoices[].invoiceItems[].discountItems[].taxItems[].jurisdiction String No

The jurisdiction that applies the tax or VAT. This value is typically a state, province, county, or city.

invoices[].invoiceItems[].discountItems[].taxItems[].name String Yes

The name of taxation.

invoices[].invoiceItems[].discountItems[].taxItems[].taxRateType String Yes

The type of the tax rate applied to the invoice item.

Possible values:

  • "FlatFee"
  • "Percentage"
invoices[].invoiceItems[].discountItems[].taxItems[].taxAmount String Yes

The amount of the taxation item in the invoice item.

invoices[].invoiceItems[].discountItems[].taxItems[].locationCode String No

The identifier for the location based on the value of the taxCode field.

invoices[].invoiceItems[].discountItems[].taxItems[].taxCode String Yes

The tax code identifies which tax rules and tax rates to apply to a specific invoice item.

invoices[].invoiceItems[].discountItems[].taxItems[].taxDate String Yes

The date that the tax is applied to the invoice item, in yyyy-mm-dd format.

invoices[].invoiceItems[].discountItems[].taxItems[].taxRate String Yes

The tax rate applied to the invoice item.

invoices[].invoiceItems[].discountItems[].taxItems[].taxCodeDescription String No

The description of the tax code.

invoices[].invoiceItems[].discountItems[].taxItems[].taxMode String Yes

The tax mode of the invoice item, indicating whether the amount of the invoice item includes tax.

Possible values:

  • "TaxExclusive"
  • "TaxInclusive"
invoices[].invoiceItems[].discountItems[].taxItems[].taxRateDescription String No

The description of the tax rate.

invoices[].invoiceItems[].discountItems[].SyncDate__NS String No

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

invoices[].invoiceItems[].discountItems[].revRecTriggerCondition String No

The date when revenue recognition is triggered.

Possible values:

  • "ServiceActivationDate"
  • "ContractEffectiveDate"
  • "CustomerAcceptanceDate"
invoices[].invoiceItems[].discountItems[].sku String No

The SKU of the invoice item. The SKU of the discount item must be different from the SKU of any existing product.

invoices[].invoiceItems[].discountItems[].accountingCode String No

The accounting code associated with the discount item.

invoices[].invoiceItems[].discountItems[].contractAssetAccountingCode String No

The accounting code for contract asset. Note: This field is only available if you have the Billing - Revenue Integration feature enabled.

invoices[].invoiceItems[].discountItems[].unbilledReceivablesAccountingCode String No

The accounting code for unbilled receivables. Note: This field is only available if you have the Billing - Revenue Integration feature enabled.

invoices[].invoiceItems[].discountItems[].chargeName String No

The name of the charge associated with the discount item. This field is required if the productRatePlanChargeId field is not specified in the request body.

invoices[].invoiceItems[].discountItems[].deferredRevenueAccountingCode String No

The accounting code for the deferred revenue, such as Monthly Recurring Liability. Note: This field is only available if you have Zuora Finance enabled.

invoices[].invoiceItems[].discountItems[].unitPrice String No

The per-unit price of the discount item. If the discount charge associated with the discount item uses the percentage model, the unit price will display as a percentage amount in PDF. For example: if unit price is 5.00, it will display as 5.00% in PDF.

invoices[].invoiceItems[].discountItems[].IntegrationStatus__NS String No

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

invoices[].invoiceItems[].discountItems[].accountsReceivableAccountingCode String No

The accounting code for accounts receivable.

invoices[].invoiceItems[].discountItems[].IntegrationId__NS String No

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

invoices[].invoiceItems[].discountItems[].revenueRecognitionRuleName String No

The name of the revenue recognition rule governing the revenue schedule. Note: This field is only available if you have Zuora Finance enabled.

invoices[].invoiceItems[].discountItems[].purchaseOrderNumber String No

The purchase order number associated with the discount item.

invoices[].invoiceItems[].discountItems[].adjustmentLiabilityAccountingCode String No

The accounting code for adjustment liability. Note: This field is only available if you have the Billing - Revenue Integration feature enabled.

invoices[].invoiceItems[].discountItems[].amount String Yes

The amount of the discount item.

  • Should be a negative number. For example, -10.
  • Always a fixed amount no matter whether the discount charge associated with the discount item uses the fixed-amount model or percentage model.
  • For tax-exclusive discount items, this amount indicates the discount item amount excluding tax.
  • For tax-inclusive discount items, this amount indicates the discount item amount including tax.
invoices[].invoiceItems[].discountItems[].contractRecognizedRevenueAccountingCode String No

The accounting code for contract recognized revenue. Note: This field is only available if you have the Billing - Revenue Integration feature enabled.

invoices[].invoiceItems[].discountItems[].productRatePlanChargeId String No

The ID of the product rate plan charge that the discount item is created from.

If you specify a value for the productRatePlanChargeId field in the request, Zuora directly copies the values of the following fields from the corresponding product rate plan charge, regardless of the values specified in the request body:

  • chargeName
  • sku

If you specify a value for the productRatePlanChargeId field in the request, Zuora directly copies the values of the following fields from the corresponding discount charge that uses discount specific accounting codes, rule and segment to manage revenue, regardless of the values specified in the request body:

  • accountingCode
  • deferredRevenueAccountingCode
  • recognizedRevenueAccountingCode

If you specify a value for the productRatePlanChargeId field in the request, Zuora directly copies the values of the following fields from the corresponding invoice item charge if the discount charge DOES NOT use discount specific accounting codes, rule and segment to manage revenue, regardless of the values specified in the request body:

  • accountingCode
  • deferredRevenueAccountingCode
  • recognizedRevenueAccountingCode
invoices[].invoiceItems[].discountItems[].contractLiabilityAccountingCode String No

The accounting code for contract liability. Note: This field is only available if you have the Billing - Revenue Integration feature enabled.

invoices[].invoiceItems[].purchaseOrderNumber String No

The purchase order number associated with the invoice item.

invoices[].invoiceItems[].adjustmentLiabilityAccountingCode String No

The accounting code for adjustment liability.

Note: This field is only available if you have the Billing - Revenue Integration feature enabled.

invoices[].invoiceItems[].amount String Yes

The amount of the invoice item.

  • For tax-inclusive invoice items, the amount indicates the invoice item amount including tax.
  • For tax-exclusive invoice items, the amount indicates the invoice item amount excluding tax.
invoices[].invoiceItems[].serviceStartDate String Yes

The service start date of the invoice item.

invoices[].invoiceItems[].taxCode String No

The tax code identifies which tax rules and tax rates to apply to the invoice item.

Note: This field is only available only if you have Taxation enabled.

invoices[].invoiceItems[].contractRecognizedRevenueAccountingCode String No

The accounting code for contract recognized revenue.

Note: This field is only available if you have the Billing - Revenue Integration feature enabled.

invoices[].invoiceItems[].productRatePlanChargeId String No

The ID of the product rate plan charge that the invoice item is created from.

If you specify a value for the productRatePlanChargeId field in the request, Zuora directly copies the values of the following fields from the corresponding product rate plan charge, regardless of the values specified in the request body:

  • chargeName
  • sku
  • uom
  • taxCode
  • taxMode
  • accountingCode
  • deferredRevenueAccountingCode
  • recognizedRevenueAccountingCode
invoices[].invoiceItems[].taxMode String No

The tax mode of the invoice item, indicating whether the amount of the invoice item includes tax.

Note: This field is only available only if you have Taxation enabled.

Possible values:

  • "TaxExclusive"
  • "TaxInclusive"
invoices[].invoiceItems[].contractLiabilityAccountingCode String No

The accounting code for contract liability.

Note: This field is only available if you have the Billing - Revenue Integration feature enabled.

invoices[].paymentTerm String No

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.

invoices[].status String No

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.

Possible values:

  • "Draft"
  • "Posted"

Default value: "Draft"

invoices[].billToContactId String No

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.

invoices[].currency String No

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.

invoices[].accountNumber String No

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.

invoices[].dueDate String No

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

invoices[].SyncDate__NS String No

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

invoices[].templateId String No

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.

invoices[].autoPay Boolean No

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

Default value: false

invoices[].sequenceSet String No

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.

invoices[].soldToContactId String No

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.

invoices[].customRates[] Array No

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: The API custom rate feature is permission controlled.

invoices[].customRates[].rateDate String No

The date on which a particular currency rate is fixed or obtained on.

Note: This field is only available if you set the zuora-version request header to 224.0 or later available versions.

invoices[].customRates[].currency String Yes

The currency code for either Reporting or Home currency.

Note: This field is only available if you set the zuora-version request header to 224.0 or later available versions.

invoices[].customRates[].customFxRate Number Yes

The Custom FX conversion rate between Home/Reporting and Transactional currency items.

Note: This field is only available if you set the zuora-version request header to 224.0 or later available versions.

invoices[].transferredToAccounting String No

Possible values:

  • "Processing"
  • "Error"
  • "Yes"
  • "Ignore"
  • "No"
invoices[].comments String No

Comments about the invoice.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.