InvoiceItemAdjustment
From API Documentation
This object is an adjustment of an InvoiceItem, and allows you to adjust either invoice charge items or taxes. See use cases below for how to work with InvoiceItemAdjustments.
Contents |
Fields
In addition to the following fields, zObject contributes additional fields. For information on the field types, see Field Types.
| Name | Required? | Type | Allowed Operations: ● Yes ○ No | Allowable Values | Description |
|---|---|---|---|---|---|
| AccountId | No, system generated, and available for query only. Not specified for create(). | zns:ID | ○ Create
● Query | Valid Account ID. | The ID of the Account/owner of invoice. |
| AccountingCode | No | string | ● Create
● Query | Valid accounting code entered in Z-Billing administration. 100 characters maximum | This can be used to enter your accounting code for the adjustment. |
| AdjustmentDate | Yes | dateTime | ● Create
● Query | A valid dateTime object, must be greater to or equal to invoice date | The date the adjustment is applied. |
| AdjustmentNumber | No, system generated, and available for query only. Not specified for create(). | String | ○ Create
● Query | A valid adjustment number, 255 characters maximum | The number/identifier for the Adjustment. Useful when working with InvoiceItemAdjustment in the Z-Billing web application. |
| Amount | Yes | decimal | ● Create
● Query | Valid currency amount | The amount of the adjustment. |
| CancelledById | System generated, exists if InvoiceItemAdjustment has been canceled. | ZNS:Id | ○ Create
● Query | This field is not editable. 32 characters maximum. | This read-only field is the ID of the user who canceled the adjustment (if applicable). |
| CancelledDate | System generated, exists if InvoiceItemAdjustment has been canceled. | dateTime | ○ Create
● Query | This is automatically generated | This read-only field is the date when adjustment was canceled (if applicable). |
| Comment | No | String | ● Create
● Query | 255 characters maximum | An additional, free form comment field for the line item adjustment. |
| CreatedById | System generated, always exists | ZNS:Id | ○ Create
● Query | This field is not editable. 32 characters maximum. | The Zuora system automatically generates this Id of the user who created the object. |
| CreatedDate | System generated, always exists | dateTime | ○ Create
● Query | This field is not editable. | The Zuora system automatically generates this, and denotes when the objects was first created. |
| CustomerName | No, for query() only. Not specified for create(). | string | ○ Create
● Query | 50 characters maximum | The name of the customer account. Inherited from InvoiceAdjustment. |
| CustomerNumber | No, for query() only. Not specified for create(). | string | ○ Create
● Query | A customer number. 70 characters maximum. | The customer account number. Inherited from InvoiceAdjustment. |
| InvoiceId | Yes, if InvoiceNumber is not specified. InvoiceId or InvoiceNumber must be specified for the create() call. | ZNS:Id | ● Create
● Query | Valid Invoice Id | The ID of the invoice that is being adjusted (which the InvoiceItem belongs to). |
| InvoiceItemName | No, for query() only. Not specified for create(). | String | ○ Create
● Query | This is a read-only field, 255 characters maximum. | This is the InvoiceItem name/description. |
| InvoiceNumber | Yes, if InvoiceId is not specified. InvoiceId or InvoiceNumber must be specified for the create() call. | String | ● Create
● Query | A valid Invoice Number for an existing Invoice. 32 characters maximum. | The InvoiceNumber of the invoice that is being adjusted (which the InvoiceItem belongs to). |
| ReferenceId | No | string | ● Create
● Query | A valid code. 60 characters maximum. | Use this to reference an external (non-Zuora) object. For example, you could use this to reference a case number in an external system. |
| ServiceEndDate | No, for query() only. Not specified for create(). | dateTime | ○ Create
● Query | A valid date and time | This is the service end date for the invoice line item. Inherited from Invoice. |
| ServiceStartDate | No, for query() only. Not specified for create(). | dateTime | ○ Create
● Query | A valid date and time | This is the service start date for the invoice line item. Inherited from Invoice. |
| SourceId | Yes | zns:ID | ● Create
● Query | A valid Id for an InvoiceItem or TaxationItem, 32 characters maximum. | The source type of the adjustment: Adjust invoice item or adjust tax item. |
| SourceType | Yes | enum | ● Create
● Query | InvoiceDetail or Tax | The starting date for the period for which the item is being billed for. For one-time charges, this is the date of the charge. |
| Status | No, system generated. Not specified during create() call, for query() only. | string | ○ Create
● Query | Canceled, Processed. | Provides the status of the InvoiceItemAdjustment. |
| TransferredToAccounting | No | String | ○ Create
● Query | Processing, Yes, Error, Ignore | Available in version 26.0 and greater. Specifies whether or not the object has been transferred to an external accounting system. Used for integrations with accounting systems such as NetSuite. |
| Type | Yes | String | ● Create
● Query | Credit or Charge | The type of adjustment to be made, whether to debit or credit the amount: if you are creating a credit memo (giving credit to the customer/lowering a charge), or creating a debit memo (increasing a charge). |
| UpdatedById | System generated, always exists | ZNS:Id | ○ Create
● Query | This field is not editable. 32 characters maximum. | Available as of version 20.0 of the API. The Zuora system automatically generates this Id of the user who last updated the object. |
| UpdatedDate | System generated, always exists | dateTime | ○ Create
● Query | This field is not editable. | Available as of version 20.0 of the API. The Zuora system automatically generates this, and denotes when the objects was last updated. |
Creating an InvoiceItemAdjustment
An InvoiceItemAdjustment is used when you want to adjust a line item from an invoice. The line item can be either an InvoiceItem or TaxationItem.
Create a $2.00 credit InvoiceItemAdjustment for an invoice line item where the Invoice Number is specified:
<soapenv:Body> <ns1:create xmlns:ns1="http://api.zuora.com/"> <ns1:zObjects xmlns:ns2="http://object.api.zuora.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:InvoiceItemAdjustment"> <ns2:AccountingCode>test-1</ns2:AccountingCode> <ns2:AdjustmentDate>2010-02-02T12:00:00.343+08:00</ns2:AdjustmentDate> <ns2:Amount>2.00</ns2:Amount> <ns2:Comment>test</ns2:Comment> <ns2:InvoiceNumber>INV-1278576579796</ns2:InvoiceNumber> <ns2:SourceId>402892df29b119720129b11a55030007</ns2:SourceId> <ns2:SourceType>InvoiceDetail</ns2:SourceType> <ns2:Type>Credit</ns2:Type> </ns1:zObjects> </ns1:create> </soapenv:Body>
Create a $5.00 credit InvoiceItemAdjustment for an taxation line item where the InvoiceId is specified:
<soapenv:Body> <ns1:create xmlns:ns1="http://api.zuora.com/"> <ns1:zObjects xmlns:ns2="http://object.api.zuora.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:InvoiceItemAdjustment"> <ns2:AccountingCode>Accountind Code-2</ns2:AccountingCode> <ns2:AdjustmentDate>2010-02-02T12:00:00.343+08:00</ns2:AdjustmentDate> <ns2:Amount>5.00</ns2:Amount> <ns2:Comment>Adjust taxation line item</ns2:Comment> <ns2:InvoiceId>4028923a29b11e420129b11a55a0b8cd</ns2:InvoiceId> <ns2:SourceId>402892df29b119720129b11a55030007</ns2:SourceId> <ns2:SourceType>Tax</ns2:SourceType> <ns2:Type>Credit</ns2:Type> </ns1:zObjects> </ns1:create> </soapenv:Body>
Canceling an InvoiceItemAdjustment
You can cancel an InvoiceItemAdjustment programmatically. To do so, update its status to Canceled.
<ns1:update xmlns:ns1="http://api.zuora.com/"> <ns1:zObjects xmlns:ns2="http://object.api.zuora.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:InvoiceItemAdjustment"> <ns2:Id>402892df29b11b9f0129b11c75150008</ns2:Id> <ns2:Status>Canceled</ns2:Status> </ns1:zObjects> </ns1:update>
