POST /CreditNotes
Servers
- https://api.xero.com/api.xro/2.0
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
xero-tenant-id |
String | Yes |
Xero identifier for Tenant |
Idempotency-Key |
String | No |
This allows you to safely retry requests without the risk of duplicate processing. 128 character max. |
Query parameters
Name | Type | Required | Description |
---|---|---|---|
unitdp |
Integer | No |
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts |
summarizeErrors |
Boolean | No |
If false return 200 OK and mix of successfully created objects and any with validation errors Default value: false |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
pagination |
Object | No | |
pagination.page |
Integer | No | |
pagination.itemCount |
Integer | No | |
pagination.pageCount |
Integer | No | |
pagination.pageSize |
Integer | No | |
Warnings[] |
Array | No |
Displays array of warning messages from the API |
Warnings[].Message |
String | No |
Validation error message |
CreditNotes[] |
Array | No | |
CreditNotes[].HasErrors |
Boolean | No |
A boolean to indicate if a credit note has an validation errors Default value: false |
CreditNotes[].Payments[] |
Array | No |
See Payments |
CreditNotes[].Total |
Number | No |
The total of the Credit Note(subtotal + total tax) |
CreditNotes[].FullyPaidOnDate |
String | No |
Date when credit note was fully paid(UTC format) |
CreditNotes[].InvoiceAddresses[] |
Array | No |
An array of addresses used to auto calculate sales tax |
CreditNotes[].InvoiceAddresses[].City |
String | No |
City of a physical address |
CreditNotes[].InvoiceAddresses[].AddressLine2 |
String | No |
Second line of a physical address |
CreditNotes[].InvoiceAddresses[].Region |
String | No |
Region or state of a physical address |
CreditNotes[].InvoiceAddresses[].Country |
String | No |
Country of a physical address |
CreditNotes[].InvoiceAddresses[].AddressLine1 |
String | No |
First line of a physical address |
CreditNotes[].InvoiceAddresses[].InvoiceAddressType |
String | No |
Indicates whether the address is defined as origin (FROM) or destination (TO) Possible values:
|
CreditNotes[].InvoiceAddresses[].AddressLine4 |
String | No |
Fourth line of a physical address |
CreditNotes[].InvoiceAddresses[].AddressLine3 |
String | No |
Third line of a physical address |
CreditNotes[].InvoiceAddresses[].PostalCode |
String | No |
Postal code of a physical address |
CreditNotes[].UpdatedDateUTC |
String | No |
UTC timestamp of last update to the credit note |
CreditNotes[].CurrencyRate |
Number | No |
The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used |
CreditNotes[].RemainingCredit |
Number | No |
The remaining credit balance on the Credit Note |
CreditNotes[].Allocations[] |
Array | No |
See Allocations |
CreditNotes[].Contact |
Object | No | |
CreditNotes[].Contact.BankAccountDetails |
String | No |
Bank account number of contact |
CreditNotes[].Contact.Website |
String | No |
Website address for contact (read only) |
CreditNotes[].Contact.Name |
String | No |
Full name of contact/organisation (max length = 255) |
CreditNotes[].Contact.SalesTrackingCategories[] |
Array | No |
The default sales tracking categories for contacts |
CreditNotes[].Contact.SalesTrackingCategories[].TrackingOptionName |
String | No |
The default purchase tracking category name for contacts |
CreditNotes[].Contact.SalesTrackingCategories[].TrackingCategoryName |
String | No |
The default sales tracking category name for contacts |
CreditNotes[].Contact.SalesDefaultLineAmountType |
String | No |
The default sales line amount type for a contact. Only available when summaryOnly parameter or paging is used, or when fetch by ContactId or ContactNumber. Possible values:
|
CreditNotes[].Contact.TrackingCategoryOption |
String | No |
The name of the Tracking Option assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories |
CreditNotes[].Contact.TaxNumber |
String | No |
Tax number of contact – this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50) |
CreditNotes[].Contact.TrackingCategoryName |
String | No |
The name of the Tracking Category assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories |
CreditNotes[].Contact.LastName |
String | No |
Last name of contact person (max length = 255) |
CreditNotes[].Contact.IsSupplier |
Boolean | No |
true or false – Boolean that describes if a contact that has any AP invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts payable invoice is generated against this contact. |
CreditNotes[].Contact.PurchasesTrackingCategories[] |
Array | No |
The default purchases tracking categories for contacts |
CreditNotes[].Contact.PurchasesTrackingCategories[].TrackingOptionName |
String | No |
The default purchase tracking category name for contacts |
CreditNotes[].Contact.PurchasesTrackingCategories[].TrackingCategoryName |
String | No |
The default sales tracking category name for contacts |
CreditNotes[].Contact.UpdatedDateUTC |
String | No |
UTC timestamp of last update to contact |
CreditNotes[].Contact.BrandingTheme |
Object | No | |
CreditNotes[].Contact.BrandingTheme.Name |
String | No |
Name of branding theme |
CreditNotes[].Contact.BrandingTheme.BrandingThemeID |
String | No |
Xero identifier |
CreditNotes[].Contact.BrandingTheme.Type |
String | No |
Always INVOICE Possible values:
|
CreditNotes[].Contact.BrandingTheme.LogoUrl |
String | No |
The location of the image file used as the logo on this branding theme |
CreditNotes[].Contact.BrandingTheme.SortOrder |
Integer | No |
Integer – ranked order of branding theme. The default branding theme has a value of 0 |
CreditNotes[].Contact.BrandingTheme.CreatedDateUTC |
String | No |
UTC timestamp of creation date of branding theme |
CreditNotes[].Contact.IsCustomer |
Boolean | No |
true or false – Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts receivable invoice is generated against this contact. |
CreditNotes[].Contact.PurchasesDefaultLineAmountType |
String | No |
The default purchases line amount type for a contact Only available when summaryOnly parameter or paging is used, or when fetch by ContactId or ContactNumber. Possible values:
|
CreditNotes[].Contact.Attachments[] |
Array | No |
Displays array of attachments from the API |
CreditNotes[].Contact.Attachments[].ContentLength |
Integer | No |
Length of the file content |
CreditNotes[].Contact.Attachments[].IncludeOnline |
Boolean | No |
Include the file with the online invoice |
CreditNotes[].Contact.Attachments[].AttachmentID |
String | No |
Unique ID for the file |
CreditNotes[].Contact.Attachments[].MimeType |
String | No |
Type of file |
CreditNotes[].Contact.Attachments[].Url |
String | No |
URL to the file on xero.com |
CreditNotes[].Contact.Attachments[].FileName |
String | No |
Name of the file |
CreditNotes[].Contact.PurchasesDefaultAccountCode |
String | No |
The default purchases account code for contacts |
CreditNotes[].Contact.ContactID |
String | No |
Xero identifier |
CreditNotes[].Contact.AccountsPayableTaxType |
String | No |
The tax type from TaxRates |
CreditNotes[].Contact.ContactStatus |
String | No |
Current status of a contact – see contact status types Possible values:
|
CreditNotes[].Contact.Addresses[] |
Array | No |
Store certain address types for a contact – see address types |
CreditNotes[].Contact.Addresses[].City |
String | No |
max length = 255 |
CreditNotes[].Contact.Addresses[].AddressType |
String | No |
define the type of address Possible values:
|
CreditNotes[].Contact.Addresses[].AttentionTo |
String | No |
max length = 255 |
CreditNotes[].Contact.Addresses[].AddressLine2 |
String | No |
max length = 500 |
CreditNotes[].Contact.Addresses[].Region |
String | No |
max length = 255 |
CreditNotes[].Contact.Addresses[].Country |
String | No |
max length = 50, [A-Z], [a-z] only |
CreditNotes[].Contact.Addresses[].AddressLine1 |
String | No |
max length = 500 |
CreditNotes[].Contact.Addresses[].AddressLine4 |
String | No |
max length = 500 |
CreditNotes[].Contact.Addresses[].AddressLine3 |
String | No |
max length = 500 |
CreditNotes[].Contact.Addresses[].PostalCode |
String | No |
max length = 50 |
CreditNotes[].Contact.StatusAttributeString |
String | No |
Status of object |
CreditNotes[].Contact.CompanyNumber |
String | No |
Company registration number (max length = 50) |
CreditNotes[].Contact.Phones[] |
Array | No |
Store certain phone types for a contact – see phone types |
CreditNotes[].Contact.Phones[].PhoneType |
String | No |
Possible values:
|
CreditNotes[].Contact.Phones[].PhoneNumber |
String | No |
max length = 50 |
CreditNotes[].Contact.Phones[].PhoneAreaCode |
String | No |
max length = 10 |
CreditNotes[].Contact.Phones[].PhoneCountryCode |
String | No |
max length = 20 |
CreditNotes[].Contact.BatchPayments |
No |
Bank details for use on a batch payment stored with each contact |
|
CreditNotes[].Contact.FirstName |
String | No |
First name of contact person (max length = 255) |
CreditNotes[].Contact.SalesDefaultAccountCode |
String | No |
The default sales account code for contacts |
CreditNotes[].Contact.ContactNumber |
String | No |
This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero. |
CreditNotes[].Contact.AccountsReceivableTaxType |
String | No |
The tax type from TaxRates |
CreditNotes[].Contact.DefaultCurrency |
String | No |
3 letter alpha code for the currency – see list of currency codes Possible values:
|
CreditNotes[].Contact.HasValidationErrors |
Boolean | No |
A boolean to indicate if a contact has an validation errors Default value: false |
CreditNotes[].Contact.AccountNumber |
String | No |
A user defined account number. This can be updated via the API and the Xero UI (max length = 50) |
CreditNotes[].Contact.Balances |
Object | No |
The raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and overdue amounts, not converted to base currency (read only) |
CreditNotes[].Contact.Balances.AccountsReceivable |
Object | No | |
CreditNotes[].Contact.Balances.AccountsReceivable.Overdue |
Number | No | |
CreditNotes[].Contact.Balances.AccountsReceivable.Outstanding |
Number | No | |
CreditNotes[].Contact.Balances.AccountsPayable |
Object | No | |
CreditNotes[].Contact.Balances.AccountsPayable.Overdue |
Number | No | |
CreditNotes[].Contact.Balances.AccountsPayable.Outstanding |
Number | No | |
CreditNotes[].Contact.XeroNetworkKey |
String | No |
Store XeroNetworkKey for contacts. |
CreditNotes[].Contact.Discount |
Number | No |
The default discount rate for the contact (read only) |
CreditNotes[].Contact.MergedToContactID |
String | No |
ID for the destination of a merged contact. Only returned when using paging or when fetching a contact by ContactId or ContactNumber. |
CreditNotes[].Contact.ValidationErrors[] |
Array | No |
Displays validation errors returned from the API |
CreditNotes[].Contact.ValidationErrors[].Message |
String | No |
Validation error message |
CreditNotes[].Contact.EmailAddress |
String | No |
Email address of contact person (umlauts not supported) (max length = 255) |
CreditNotes[].Contact.HasAttachments |
Boolean | No |
A boolean to indicate if a contact has an attachment Default value: false |
CreditNotes[].Contact.PaymentTerms |
Object | No | |
CreditNotes[].Contact.PaymentTerms.Bills |
Object | No | |
CreditNotes[].Contact.PaymentTerms.Bills.Day |
Integer | No |
Day of Month (0-31) |
CreditNotes[].Contact.PaymentTerms.Bills.Type |
String | No |
Possible values:
|
CreditNotes[].Contact.PaymentTerms.Sales |
Object | No | |
CreditNotes[].Contact.PaymentTerms.Sales.Day |
Integer | No |
Day of Month (0-31) |
CreditNotes[].Contact.PaymentTerms.Sales.Type |
String | No |
Possible values:
|
CreditNotes[].Contact.ContactGroups[] |
Array | No |
Displays which contact groups a contact is included in |
CreditNotes[].Contact.ContactGroups[].Name |
String | No |
The Name of the contact group. Required when creating a new contact group |
CreditNotes[].Contact.ContactGroups[].Status |
String | No |
The Status of a contact group. To delete a contact group update the status to DELETED. Only contact groups with a status of ACTIVE are returned on GETs. Possible values:
|
CreditNotes[].Contact.ContactGroups[].ContactGroupID |
String | No |
The Xero identifier for an contact group – specified as a string following the endpoint name. e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 |
CreditNotes[].Contact.ContactGroups[].Contacts[] |
Array | No |
The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID is supplied in the URL. |
CreditNotes[].Contact.ContactPersons[] |
Array | No |
See contact persons |
CreditNotes[].Contact.ContactPersons[].IncludeInEmails |
Boolean | No |
boolean to indicate whether contact should be included on emails with invoices etc. |
CreditNotes[].Contact.ContactPersons[].EmailAddress |
String | No |
Email address of person |
CreditNotes[].Contact.ContactPersons[].LastName |
String | No |
Last name of person |
CreditNotes[].Contact.ContactPersons[].FirstName |
String | No |
First name of person |
CreditNotes[].CurrencyCode |
String | No |
3 letter alpha code for the currency – see list of currency codes Possible values:
|
CreditNotes[].CreditNoteID |
String | No |
Xero generated unique identifier |
CreditNotes[].LineAmountTypes |
String | No |
Line amounts are exclusive of tax by default if you don’t specify this element. See Line Amount Types Possible values:
|
CreditNotes[].Date |
String | No |
The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation |
CreditNotes[].CISDeduction |
Number | No |
CIS deduction for UK contractors |
CreditNotes[].SentToContact |
Boolean | No |
Boolean to set whether the credit note in the Xero app should be marked as “sent”. This can be set only on credit notes that have been approved |
CreditNotes[].Warnings[] |
Array | No |
Displays array of warning messages from the API |
CreditNotes[].Warnings[].Message |
String | No |
Validation error message |
CreditNotes[].Type |
String | No |
See Credit Note Types Possible values:
|
CreditNotes[].StatusAttributeString |
String | No |
A string to indicate if a invoice status |
CreditNotes[].DueDate |
String | No |
Date invoice is due – YYYY-MM-DD |
CreditNotes[].CISRate |
Number | No |
CIS Deduction rate for the organisation |
CreditNotes[].TotalTax |
Number | No |
The total tax on the credit note |
CreditNotes[].Reference |
String | No |
ACCRECCREDIT only – additional reference number |
CreditNotes[].LineItems[] |
Array | No |
See Invoice Line Items |
CreditNotes[].LineItems[].Quantity |
Number | No |
LineItem Quantity |
CreditNotes[].LineItems[].UnitAmount |
Number | No |
LineItem Unit Amount |
CreditNotes[].LineItems[].TaxAmount |
Number | No |
The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated is not correct. |
CreditNotes[].LineItems[].Item |
No | ||
CreditNotes[].LineItems[].AccountCode |
String | No |
See Accounts |
CreditNotes[].LineItems[].RepeatingInvoiceID |
String | No |
The Xero identifier for a Repeating Invoice |
CreditNotes[].LineItems[].LineItemID |
String | No |
LineItem unique ID |
CreditNotes[].LineItems[].Description |
String | No |
Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a element that contains at least 1 character |
CreditNotes[].LineItems[].TaxType |
String | No |
The tax type from TaxRates |
CreditNotes[].LineItems[].Taxability |
String | No |
The type of taxability Possible values:
|
CreditNotes[].LineItems[].TaxBreakdown[] |
Array | No |
An array of tax components defined for this line item |
CreditNotes[].LineItems[].TaxBreakdown[].TaxComponentId |
String | No |
The unique ID number of this component |
CreditNotes[].LineItems[].TaxBreakdown[].Name |
String | No |
The name of the jurisdiction |
CreditNotes[].LineItems[].TaxBreakdown[].Type |
String | No |
The type of the jurisdiction Possible values:
|
CreditNotes[].LineItems[].TaxBreakdown[].TaxAmount |
Number | No |
The amount of the tax |
CreditNotes[].LineItems[].TaxBreakdown[].TaxableAmount |
Number | No |
The amount that is taxable |
CreditNotes[].LineItems[].TaxBreakdown[].NonTaxableAmount |
Number | No |
The amount that is not taxable |
CreditNotes[].LineItems[].TaxBreakdown[].TaxPercentage |
Number | No |
The percentage of the tax |
CreditNotes[].LineItems[].TaxBreakdown[].ExemptAmount |
Number | No |
The amount that is exempt |
CreditNotes[].LineItems[].TaxBreakdown[].StateAssignedNo |
String | No |
The state assigned number of the jurisdiction |
CreditNotes[].LineItems[].TaxBreakdown[].JurisdictionRegion |
String | No |
Name identifying the region within the country |
CreditNotes[].LineItems[].LineAmount |
Number | No |
If you wish to omit either the Quantity or UnitAmount you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if either a DiscountRate or DiscountAmount has been used i.e. LineAmount = Quantity * Unit Amount * ((100 - DiscountRate)/100) or LineAmount = (Quantity * UnitAmount) - DiscountAmount |
CreditNotes[].LineItems[].AccountID |
String | No |
The associated account ID related to this line item |
CreditNotes[].LineItems[].SalesTaxCodeId |
Number | No |
The ID of the sales tax code |
CreditNotes[].LineItems[].ItemCode |
String | No |
See Items |
CreditNotes[].LineItems[].Tracking[] |
Array | No |
Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 elements. |
CreditNotes[].LineItems[].Tracking[].TrackingCategoryID |
String | No |
The Xero identifier for a tracking category |
CreditNotes[].LineItems[].Tracking[].Name |
String | No |
The name of the tracking category |
CreditNotes[].LineItems[].Tracking[].Option |
String | No |
See Tracking Options |
CreditNotes[].LineItems[].Tracking[].TrackingOptionID |
String | No |
The Xero identifier for a tracking category option |
CreditNotes[].LineItems[].DiscountAmount |
Number | No |
Discount amount being applied to a line item. Only supported on ACCREC invoices and quotes. ACCPAY invoices and credit notes in Xero do not support discounts. |
CreditNotes[].LineItems[].DiscountRate |
Number | No |
Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discounts |
CreditNotes[].SubTotal |
Number | No |
The subtotal of the credit note excluding taxes |
CreditNotes[].Status |
String | No |
See Credit Note Status Codes Possible values:
|
CreditNotes[].BrandingThemeID |
String | No |
See BrandingThemes |
CreditNotes[].AppliedAmount |
Number | No |
The amount of applied to an invoice |
CreditNotes[].ValidationErrors[] |
Array | No |
Displays array of validation error messages from the API |
CreditNotes[].ValidationErrors[].Message |
String | No |
Validation error message |
CreditNotes[].HasAttachments |
Boolean | No |
boolean to indicate if a credit note has an attachment Default value: false |
CreditNotes[].CreditNoteNumber |
String | No |
ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings) |
How to start integrating
- Add HTTP Task to your workflow definition.
- 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.
- Click Test request to test run your request to the API and see the API's response.