@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Xero Accounting API
@base https://api.xero.com/api.xro/2.0
@version 12.0.0
@auth OAuth2
@endpoints 237
@hint download_for_search
@toc Accounts(10), BatchPayments(7), BankTransactions(12), BankTransfers(10), BrandingThemes(4), Budgets(2), Contacts(14), ContactGroups(7), CreditNotes(15), Currencies(2), Employees(4), ExpenseClaims(6), Invoices(15), InvoiceReminders(1), Items(8), Journals(3), LinkedTransactions(5), ManualJournals(12), Organisation(3), Overpayments(6), Payments(7), PaymentServices(2), Prepayments(6), PurchaseOrders(14), Quotes(13), Receipts(11), RepeatingInvoices(12), Reports(11), Setup(1), TaxRates(4), TrackingCategories(8), Users(2)

@group Accounts
@endpoint GET /Accounts
@desc Retrieves the full chart of accounts
@optional {If-Modified-Since: str(date-time) # Only records created or modified since this timestamp will be returned, where: str # Filter by an any element, order: str # Order by an any element}
@returns(200) {Accounts: [map]} # Success - return response of type Accounts array with 0 to n Account

@endpoint PUT /Accounts
@desc Creates a new chart of accounts
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., Code: str # Customer defined alpha numeric account code e.g 200 or SALES (max length = 10), Name: str # Name of account (max length = 150), AccountID: str(uuid) # The Xero identifier for an account – specified as a string following  the endpoint name   e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9, Type: str(BANK/CURRENT/CURRLIAB/DEPRECIATN/DIRECTCOSTS/EQUITY/EXPENSE/FIXED/INVENTORY/LIABILITY/NONCURRENT/OTHERINCOME/OVERHEADS/PREPAYMENT/REVENUE/SALES/TERMLIAB/PAYG) # See Account Types, BankAccountNumber: str # For bank accounts only (Account Type BANK), Status: str(ACTIVE/ARCHIVED/DELETED) # Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes, Description: str # Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000), BankAccountType: str(BANK/CREDITCARD/PAYPAL/NONE/) # For bank accounts only. See Bank Account types, CurrencyCode: str(AED/AFN/ALL/AMD/ANG/AOA/ARS/AUD/AWG/AZN/BAM/BBD/BDT/BGN/BHD/BIF/BMD/BND/BOB/BRL/BSD/BTN/BWP/BYN/BYR/BZD/CAD/CDF/CHF/CLF/CLP/CNY/COP/CRC/CUC/CUP/CVE/CZK/DJF/DKK/DOP/DZD/EEK/EGP/ERN/ETB/EUR/FJD/FKP/GBP/GEL/GHS/GIP/GMD/GNF/GTQ/GYD/HKD/HNL/HRK/HTG/HUF/IDR/ILS/INR/IQD/IRR/ISK/JMD/JOD/JPY/KES/KGS/KHR/KMF/KPW/KRW/KWD/KYD/KZT/LAK/LBP/LKR/LRD/LSL/LTL/LVL/LYD/MAD/MDL/MGA/MKD/MMK/MNT/MOP/MRO/MRU/MUR/MVR/MWK/MXN/MXV/MYR/MZN/NAD/NGN/NIO/NOK/NPR/NZD/OMR/PAB/PEN/PGK/PHP/PKR/PLN/PYG/QAR/RON/RSD/RUB/RWF/SAR/SBD/SCR/SDG/SEK/SGD/SHP/SKK/SLE/SLL/SOS/SRD/STD/STN/SVC/SYP/SZL/THB/TJS/TMT/TND/TOP/TRY/TTD/TWD/TZS/UAH/UGX/USD/UYU/UZS/VEF/VES/VND/VUV/WST/XAF/XCD/XOF/XPF/YER/ZAR/ZMW/ZMK/ZWD) # 3 letter alpha code for the currency – see list of currency codes, TaxType: str # The tax type from taxRates, EnablePaymentsToAccount: bool # Boolean – describes whether account can have payments applied to it, ShowInExpenseClaims: bool # Boolean – describes whether account code is available for use with expense claims, Class: str(ASSET/EQUITY/EXPENSE/LIABILITY/REVENUE) # See Account Class Types, SystemAccount: str(DEBTORS/CREDITORS/BANKCURRENCYGAIN/GST/GSTONIMPORTS/HISTORICAL/REALISEDCURRENCYGAIN/RETAINEDEARNINGS/ROUNDING/TRACKINGTRANSFERS/UNPAIDEXPCLM/UNREALISEDCURRENCYGAIN/WAGEPAYABLES/CISASSETS/CISASSET/CISLABOUR/CISLABOUREXPENSE/CISLABOURINCOME/CISLIABILITY/CISMATERIALS/) # If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either “” or null., ReportingCode: str # Shown if set, ReportingCodeName: str # Shown if set, HasAttachments: bool=false # boolean to indicate if an account has an attachment (read only), UpdatedDateUTC: str # Last modified date UTC format, AddToWatchlist: bool # Boolean – describes whether the account is shown in the watchlist widget on the dashboard, ValidationErrors: [map{Message: str}] # Displays array of validation error messages from the API}
@returns(200) {Accounts: [map]} # Success - created new Account and return response of type Accounts array with new Account
@errors {400: Validation Error - some data was incorrect returns response of type Error}
@example_request {"Code":"123456","Name":"Foobar","Type":"EXPENSE","Description":"Hello World"}

@endpoint GET /Accounts/{AccountID}
@desc Retrieves a single chart of accounts by using a unique account Id
@required {AccountID: str(uuid) # Unique identifier for Account object}
@returns(200) {Accounts: [map]} # Success - return response of type Accounts array with one Account

@endpoint POST /Accounts/{AccountID}
@desc Updates a chart of accounts
@required {AccountID: str(uuid) # Unique identifier for Account object}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., Accounts: [map{Code: str, Name: str, AccountID: str(uuid), Type: str, BankAccountNumber: str, Status: str, Description: str, BankAccountType: str, CurrencyCode: str, TaxType: str, EnablePaymentsToAccount: bool, ShowInExpenseClaims: bool, Class: str, SystemAccount: str, ReportingCode: str, ReportingCodeName: str, HasAttachments: bool, UpdatedDateUTC: str, AddToWatchlist: bool, ValidationErrors: [map]}]}
@returns(200) {Accounts: [map]} # Success - update existing Account and return response of type Accounts array with updated Account
@errors {400: Validation Error - some data was incorrect returns response of type Error}
@example_request {"Accounts":[{"Code":"123456","Name":"BarFoo","AccountID":"99ce6032-0678-4aa0-8148-240c75fee33a","Type":"EXPENSE","Description":"GoodBye World","TaxType":"INPUT","EnablePaymentsToAccount":false,"ShowInExpenseClaims":false,"Class":"EXPENSE","ReportingCode":"EXP","ReportingCodeName":"Expense","UpdatedDateUTC":"2019-02-21T16:29:47.96-08:00"}]}

@endpoint DELETE /Accounts/{AccountID}
@desc Deletes a chart of accounts
@required {AccountID: str(uuid) # Unique identifier for Account object}
@returns(200) {Accounts: [map]} # Success - delete existing Account and return response of type Accounts array with deleted Account
@errors {400: Validation Error - some data was incorrect returns response of type Error}

@endpoint GET /Accounts/{AccountID}/Attachments
@desc Retrieves attachments for a specific accounts by using a unique account Id
@required {AccountID: str(uuid) # Unique identifier for Account object}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array of Attachment

@endpoint GET /Accounts/{AccountID}/Attachments/{AttachmentID}
@desc Retrieves a specific attachment from a specific account using a unique attachment Id
@required {AccountID: str(uuid) # Unique identifier for Account object, AttachmentID: str(uuid) # Unique identifier for Attachment object, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for Account as binary data

@endpoint GET /Accounts/{AccountID}/Attachments/{FileName}
@desc Retrieves an attachment for a specific account by filename
@required {AccountID: str(uuid) # Unique identifier for Account object, FileName: str # Name of the attachment, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for Account as binary data

@endpoint POST /Accounts/{AccountID}/Attachments/{FileName}
@desc Updates attachment on a specific account by filename
@required {AccountID: str(uuid) # Unique identifier for Account object, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array of Attachment
@errors {400: Validation Error - some data was incorrect returns response of type Error}

@endpoint PUT /Accounts/{AccountID}/Attachments/{FileName}
@desc Creates an attachment on a specific account
@required {AccountID: str(uuid) # Unique identifier for Account object, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array of Attachment
@errors {400: A failed request due to validation error}

@endgroup

@group BatchPayments
@endpoint GET /BatchPayments
@desc Retrieves either one or many batch payments for invoices
@optional {If-Modified-Since: str(date-time) # Only records created or modified since this timestamp will be returned, where: str # Filter by an any element, order: str # Order by an any element}
@returns(200) {BatchPayments: [map]} # Success - return response of type BatchPayments array of BatchPayment objects

@endpoint PUT /BatchPayments
@desc Creates one or many batch payments for invoices
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., BatchPayments: [map{Account: map, Reference: str, Particulars: str, Code: str, Details: str, Narrative: str, BatchPaymentID: str(uuid), DateString: str, Date: str, Amount: num(double), Payments: [map], Type: str, Status: str, TotalAmount: num(double), UpdatedDateUTC: str, IsReconciled: bool, ValidationErrors: [map]}]}
@returns(200) {BatchPayments: [map]} # Success - return response of type BatchPayments array of BatchPayment objects
@errors {400: A failed request due to validation error}
@example_request {"BatchPayments":[{"Account":{"AccountID":"00000000-0000-0000-0000-000000000000"},"Reference":"ref","Date":"2018-08-01","Payments":[{"Account":{"Code":"001"},"Date":"2019-12-31","Amount":500,"Invoice":{"InvoiceID":"00000000-0000-0000-0000-000000000000","LineItems":[],"Contact":{},"Type":"ACCPAY"}}]}]}

@endpoint POST /BatchPayments
@desc Updates a specific batch payment for invoices and credit notes
@required {BatchPaymentID: str(uuid) # The Xero generated unique identifier for the bank transaction (read-only), Status: str=DELETED # The status of the batch payment.}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {BatchPayments: [map]} # Success - return response of type BatchPayments array for updated BatchPayment
@errors {400: A failed request due to validation error}
@example_request {"BatchPaymentID":"9bf296e9-0748-4d29-a3dc-24dde1098030","Status":"DELETED"}

@endpoint GET /BatchPayments/{BatchPaymentID}
@desc Retrieves a specific batch payment using a unique batch payment Id
@required {BatchPaymentID: str(uuid) # Unique identifier for BatchPayment}
@returns(200) {BatchPayments: [map]} # Success - return response of type BatchPayments array with matching batch payment Id

@endpoint POST /BatchPayments/{BatchPaymentID}
@desc Updates a specific batch payment for invoices and credit notes
@required {BatchPaymentID: str(uuid) # Unique identifier for BatchPayment, Status: str=DELETED # The status of the batch payment.}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {BatchPayments: [map]} # Success - return response of type BatchPayments array for updated BatchPayment
@errors {400: A failed request due to validation error}
@example_request {"Status":"DELETED"}

@endpoint GET /BatchPayments/{BatchPaymentID}/History
@desc Retrieves history from a specific batch payment
@required {BatchPaymentID: str(uuid) # Unique identifier for BatchPayment}
@returns(200) {HistoryRecords: [map]} # Success - return response of HistoryRecords array of 0 to N HistoryRecord

@endpoint PUT /BatchPayments/{BatchPaymentID}/History
@desc Creates a history record for a specific batch payment
@required {BatchPaymentID: str(uuid) # Unique identifier for BatchPayment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]} # Success - return response of type HistoryRecords array of HistoryRecord objects
@errors {400: A failed request due to validation error}
@example_request {"HistoryRecords":[{"Details":"Hello World"}]}

@endgroup

@group BankTransactions
@endpoint GET /BankTransactions
@desc Retrieves any spent or received money transactions
@optional {If-Modified-Since: str(date-time) # Only records created or modified since this timestamp will be returned, where: str # Filter by an any element, order: str # Order by an any element, page: int # Up to 100 bank transactions will be returned in a single API call with line items details, unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts, pageSize: int # Number of records to retrieve per page}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], BankTransactions: [map]} # Success - return response of type BankTransactions array with 0 to n BankTransaction

@endpoint PUT /BankTransactions
@desc Creates one or more spent or received money transaction
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, BankTransactions: [map{Type!: str, Contact: map, LineItems!: [map], BankAccount!: map, IsReconciled: bool, Date: str, Reference: str, CurrencyCode: str, CurrencyRate: num(double), Url: str, Status: str, LineAmountTypes: str, SubTotal: num(double), TotalTax: num(double), Total: num(double), BankTransactionID: str(uuid), PrepaymentID: str(uuid), OverpaymentID: str(uuid), UpdatedDateUTC: str, HasAttachments: bool, StatusAttributeString: str, ValidationErrors: [map]}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], BankTransactions: [map]} # Success - return response of type BankTransactions array with new BankTransaction
@errors {400: A failed request due to validation error}
@example_request {"bankTransactions":[{"type":"BankTransaction.TypeEnum.SPEND","contact":{"contactID":"00000000-0000-0000-0000-000000000000"},"lineItems":[{"description":"Foobar","quantity":1,"unitAmount":20,"accountCode":"000"}],"bankAccount":{"code":"000"}}]}

@endpoint POST /BankTransactions
@desc Updates or creates one or more spent or received money transaction
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, BankTransactions: [map{Type!: str, Contact: map, LineItems!: [map], BankAccount!: map, IsReconciled: bool, Date: str, Reference: str, CurrencyCode: str, CurrencyRate: num(double), Url: str, Status: str, LineAmountTypes: str, SubTotal: num(double), TotalTax: num(double), Total: num(double), BankTransactionID: str(uuid), PrepaymentID: str(uuid), OverpaymentID: str(uuid), UpdatedDateUTC: str, HasAttachments: bool, StatusAttributeString: str, ValidationErrors: [map]}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], BankTransactions: [map]} # Success - return response of type BankTransactions array with new BankTransaction
@errors {400: A failed request due to validation error}
@example_request {"BankTransactions":[{"Type":"SPEND","Contact":{"ContactID":"00000000-0000-0000-0000-000000000000"},"Lineitems":[{"Description":"Foobar","Quantity":1,"UnitAmount":20,"AccountCode":"400"}],"BankAccount":{"Code":"088"}}]}

@endpoint GET /BankTransactions/{BankTransactionID}
@desc Retrieves a single spent or received money transaction by using a unique bank transaction Id
@required {BankTransactionID: str(uuid) # Xero generated unique identifier for a bank transaction}
@optional {unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], BankTransactions: [map]} # Success - return response of type BankTransactions array with a specific BankTransaction

@endpoint POST /BankTransactions/{BankTransactionID}
@desc Updates a single spent or received money transaction
@required {BankTransactionID: str(uuid) # Xero generated unique identifier for a bank transaction}
@optional {unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, BankTransactions: [map{Type!: str, Contact: map, LineItems!: [map], BankAccount!: map, IsReconciled: bool, Date: str, Reference: str, CurrencyCode: str, CurrencyRate: num(double), Url: str, Status: str, LineAmountTypes: str, SubTotal: num(double), TotalTax: num(double), Total: num(double), BankTransactionID: str(uuid), PrepaymentID: str(uuid), OverpaymentID: str(uuid), UpdatedDateUTC: str, HasAttachments: bool, StatusAttributeString: str, ValidationErrors: [map]}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], BankTransactions: [map]} # Success - return response of type BankTransactions array with updated BankTransaction
@errors {400: A failed request due to validation error}
@example_request {"BankTransactions":[{"Type":"SPEND","Contact":{"ContactID":"00000000-0000-0000-0000-000000000000","ContactStatus":"ACTIVE","Name":"Buzz Lightyear","FirstName":"Buzz","LastName":"Lightyear","EmailAddress":"buzz.Lightyear@email.com","ContactPersons":[],"BankAccountDetails":"","Addresses":[{"AddressType":"STREET","City":"","Region":"","PostalCode":"","Country":""},{"AddressType":"POBOX","AddressLine1":"","AddressLine2":"","AddressLine3":"","AddressLine4":"","City":"Palo Alto","Region":"CA","PostalCode":"94020","Country":"United States"}],"Phones":[{"PhoneType":"DEFAULT","PhoneNumber":"847-1294","PhoneAreaCode":"(626)","PhoneCountryCode":""},{"PhoneType":"DDI","PhoneNumber":"","PhoneAreaCode":"","PhoneCountryCode":""},{"PhoneType":"FAX","PhoneNumber":"","PhoneAreaCode":"","PhoneCountryCode":""},{"PhoneType":"MOBILE","PhoneNumber":"","PhoneAreaCode":"","PhoneCountryCode":""}],"UpdatedDateUTC":"2017-08-21T13:49:04.227-07:00","ContactGroups":[]},"Lineitems":[],"BankAccount":{"Code":"088","Name":"Business Wells Fargo","AccountID":"00000000-0000-0000-0000-000000000000"},"IsReconciled":false,"Date":"2019-02-25","Reference":"You just updated","CurrencyCode":"USD","CurrencyRate":1,"Status":"AUTHORISED","LineAmountTypes":"Inclusive","TotalTax":1.74,"BankTransactionID":"00000000-0000-0000-0000-000000000000","UpdatedDateUTC":"2019-02-26T12:39:27.813-08:00"}]}

@endpoint GET /BankTransactions/{BankTransactionID}/Attachments
@desc Retrieves any attachments from a specific bank transactions
@required {BankTransactionID: str(uuid) # Xero generated unique identifier for a bank transaction}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array with 0 to n Attachment

@endpoint GET /BankTransactions/{BankTransactionID}/Attachments/{AttachmentID}
@desc Retrieves specific attachments from a specific BankTransaction using a unique attachment Id
@required {BankTransactionID: str(uuid) # Xero generated unique identifier for a bank transaction, AttachmentID: str(uuid) # Unique identifier for Attachment object, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for BankTransaction as binary data

@endpoint GET /BankTransactions/{BankTransactionID}/Attachments/{FileName}
@desc Retrieves a specific attachment from a specific bank transaction by filename
@required {BankTransactionID: str(uuid) # Xero generated unique identifier for a bank transaction, FileName: str # Name of the attachment, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for BankTransaction as binary data

@endpoint POST /BankTransactions/{BankTransactionID}/Attachments/{FileName}
@desc Updates a specific attachment from a specific bank transaction by filename
@required {BankTransactionID: str(uuid) # Xero generated unique identifier for a bank transaction, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of Attachments array of Attachment
@errors {400: A failed request due to validation error}

@endpoint PUT /BankTransactions/{BankTransactionID}/Attachments/{FileName}
@desc Creates an attachment for a specific bank transaction by filename
@required {BankTransactionID: str(uuid) # Xero generated unique identifier for a bank transaction, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of Attachments array of Attachment
@errors {400: A failed request due to validation error}

@endpoint GET /BankTransactions/{BankTransactionID}/History
@desc Retrieves history from a specific bank transaction using a unique bank transaction Id
@required {BankTransactionID: str(uuid) # Xero generated unique identifier for a bank transaction}
@returns(200) {HistoryRecords: [map]} # Success - return response of HistoryRecords array of 0 to N HistoryRecord

@endpoint PUT /BankTransactions/{BankTransactionID}/History
@desc Creates a history record for a specific bank transactions
@required {BankTransactionID: str(uuid) # Xero generated unique identifier for a bank transaction}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]} # Success - return response of type HistoryRecords array of HistoryRecord objects
@errors {400: A failed request due to validation error}
@example_request {"HistoryRecords":[{"Details":"Hello World"}]}

@endgroup

@group BankTransfers
@endpoint GET /BankTransfers
@desc Retrieves all bank transfers
@optional {If-Modified-Since: str(date-time) # Only records created or modified since this timestamp will be returned, where: str # Filter by an any element, order: str # Order by an any element}
@returns(200) {BankTransfers: [map]} # Success - return response of BankTransfers array of 0 to N BankTransfer

@endpoint PUT /BankTransfers
@desc Creates a bank transfer
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., BankTransfers: [map{FromBankAccount!: map, ToBankAccount!: map, Amount!: num(double), Date: str, BankTransferID: str(uuid), CurrencyRate: num(double), FromBankTransactionID: str(uuid), ToBankTransactionID: str(uuid), FromIsReconciled: bool, ToIsReconciled: bool, Reference: str, HasAttachments: bool, CreatedDateUTC: str, ValidationErrors: [map]}]}
@returns(200) {BankTransfers: [map]} # Success - return response of BankTransfers array of one BankTransfer
@errors {400: A failed request due to validation error}
@example_request {"BankTransfers":[{"FromBankAccount":{"Code":"090","Name":"My Savings","AccountID":"00000000-0000-0000-0000-000000000000","Type":"BANK","BankAccountNumber":"123455","Status":"ACTIVE","BankAccountType":"BANK","CurrencyCode":"USD","TaxType":"NONE","EnablePaymentsToAccount":false,"ShowInExpenseClaims":false,"Class":"ASSET","ReportingCode":"ASS","ReportingCodeName":"Assets","HasAttachments":false,"UpdatedDateUTC":"2016-10-17T13:45:33.993-07:00"},"ToBankAccount":{"Code":"088","Name":"Business Wells Fargo","AccountID":"00000000-0000-0000-0000-000000000000","Type":"BANK","BankAccountNumber":"123455","Status":"ACTIVE","BankAccountType":"BANK","CurrencyCode":"USD","TaxType":"NONE","EnablePaymentsToAccount":false,"ShowInExpenseClaims":false,"Class":"ASSET","ReportingCode":"ASS","ReportingCodeName":"Assets","HasAttachments":false,"UpdatedDateUTC":"2016-06-03T08:31:14.517-07:00"},"Amount":"50.00","FromIsReconciled":true,"ToIsReconciled":true,"Reference":"Sub 098801"}]}

@endpoint GET /BankTransfers/{BankTransferID}
@desc Retrieves specific bank transfers by using a unique bank transfer Id
@required {BankTransferID: str(uuid) # Xero generated unique identifier for a bank transfer}
@returns(200) {BankTransfers: [map]} # Success - return response of BankTransfers array with one BankTransfer

@endpoint GET /BankTransfers/{BankTransferID}/Attachments
@desc Retrieves attachments from a specific bank transfer
@required {BankTransferID: str(uuid) # Xero generated unique identifier for a bank transfer}
@returns(200) {Attachments: [map]} # Success - return response of Attachments array of 0 to N Attachment for a Bank Transfer

@endpoint GET /BankTransfers/{BankTransferID}/Attachments/{AttachmentID}
@desc Retrieves a specific attachment from a specific bank transfer using a unique attachment ID
@required {BankTransferID: str(uuid) # Xero generated unique identifier for a bank transfer, AttachmentID: str(uuid) # Unique identifier for Attachment object, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of binary data from the Attachment to a Bank Transfer

@endpoint GET /BankTransfers/{BankTransferID}/Attachments/{FileName}
@desc Retrieves a specific attachment on a specific bank transfer by file name
@required {BankTransferID: str(uuid) # Xero generated unique identifier for a bank transfer, FileName: str # Name of the attachment, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of binary data from the Attachment to a Bank Transfer

@endpoint POST /BankTransfers/{BankTransferID}/Attachments/{FileName}
@required {BankTransferID: str(uuid) # Xero generated unique identifier for a bank transfer, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of Attachments array of 0 to N Attachment for a Bank Transfer
@errors {400: A failed request due to validation error}

@endpoint PUT /BankTransfers/{BankTransferID}/Attachments/{FileName}
@required {BankTransferID: str(uuid) # Xero generated unique identifier for a bank transfer, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of Attachments array of 0 to N Attachment for a Bank Transfer
@errors {400: A failed request due to validation error}

@endpoint GET /BankTransfers/{BankTransferID}/History
@desc Retrieves history from a specific bank transfer using a unique bank transfer Id
@required {BankTransferID: str(uuid) # Xero generated unique identifier for a bank transfer}
@returns(200) {HistoryRecords: [map]} # Success - return response of HistoryRecords array of 0 to N HistoryRecord

@endpoint PUT /BankTransfers/{BankTransferID}/History
@desc Creates a history record for a specific bank transfer
@required {BankTransferID: str(uuid) # Xero generated unique identifier for a bank transfer}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]} # Success - return response of type HistoryRecords array of HistoryRecord objects
@errors {400: A failed request due to validation error}
@example_request {"HistoryRecords":[{"Details":"Hello World"}]}

@endgroup

@group BrandingThemes
@endpoint GET /BrandingThemes
@desc Retrieves all the branding themes
@returns(200) {BrandingThemes: [map]} # Success - return response of type BrandingThemes

@endpoint GET /BrandingThemes/{BrandingThemeID}
@desc Retrieves a specific branding theme using a unique branding theme Id
@required {BrandingThemeID: str(uuid) # Unique identifier for a Branding Theme}
@returns(200) {BrandingThemes: [map]} # Success - return response of type BrandingThemes with one BrandingTheme

@endpoint GET /BrandingThemes/{BrandingThemeID}/PaymentServices
@desc Retrieves the payment services for a specific branding theme
@required {BrandingThemeID: str(uuid) # Unique identifier for a Branding Theme}
@returns(200) {PaymentServices: [any]} # Success - return response of type PaymentServices array with 0 to N PaymentService

@endpoint POST /BrandingThemes/{BrandingThemeID}/PaymentServices
@desc Creates a new custom payment service for a specific branding theme
@required {BrandingThemeID: str(uuid) # Unique identifier for a Branding Theme}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., PaymentServices: [any]}
@returns(200) {PaymentServices: [any]} # Success - return response of type PaymentServices array with newly created PaymentService
@errors {400: A failed request due to validation error}
@example_request {"PaymentServices":[{"PaymentServiceID":"54b3b4f6-0443-4fba-bcd1-61ec0c35ca55","PaymentServiceName":"PayUpNow","PaymentServiceUrl":"https://www.payupnow.com/","PaymentServiceType":"Custom","PayNowText":"Time To Pay"}]}

@endgroup

@group Budgets
@endpoint GET /Budgets
@desc Retrieve a list of budgets
@optional {IDs: str # Filter by BudgetID. Allows you to retrieve a specific individual budget., DateTo: str(date) # Filter by start date, DateFrom: str(date) # Filter by end date}
@returns(200) {Budgets: [map]} # Success - return response of type Budgets array with 0 to N Budgets

@endpoint GET /Budgets/{BudgetID}
@desc Retrieves a specific budget, which includes budget lines
@required {BudgetID: str(uuid) # Unique identifier for Budgets}
@optional {DateTo: str(date) # Filter by start date, DateFrom: str(date) # Filter by end date}
@returns(200) {Budgets: [map]} # Success - return response of type Invoices array with specified Invoices

@endgroup

@group Contacts
@endpoint GET /Contacts
@desc Retrieves all contacts in a Xero organisation
@optional {If-Modified-Since: str(date-time) # Only records created or modified since this timestamp will be returned, where: str # Filter by an any element, order: str # Order by an any element, IDs: [str(uuid)] # Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call., page: int # e.g. page=1 - Up to 100 contacts will be returned in a single API call., includeArchived: bool # e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response, summaryOnly: bool=false # Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient., searchTerm: str # Search parameter that performs a case-insensitive text search across the Name, FirstName, LastName, ContactNumber and EmailAddress fields., pageSize: int # Number of records to retrieve per page}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Contacts: [map]} # Success - return response of type Contacts array with 0 to N Contact

@endpoint PUT /Contacts
@desc Creates multiple contacts (bulk) in a Xero organisation
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, Contacts: [map{ContactID: str(uuid), MergedToContactID: str(uuid), ContactNumber: str, AccountNumber: str, ContactStatus: str, Name: str, FirstName: str, LastName: str, CompanyNumber: str, EmailAddress: str, ContactPersons: [map], BankAccountDetails: str, TaxNumber: str, TaxNumberType: str, AccountsReceivableTaxType: str, AccountsPayableTaxType: str, Addresses: [map], Phones: [map], IsSupplier: bool, IsCustomer: bool, SalesDefaultLineAmountType: str, PurchasesDefaultLineAmountType: str, DefaultCurrency: str, XeroNetworkKey: str, SalesDefaultAccountCode: str, PurchasesDefaultAccountCode: str, SalesTrackingCategories: [map], PurchasesTrackingCategories: [map], TrackingCategoryName: str, TrackingCategoryOption: str, PaymentTerms: map, UpdatedDateUTC: str, ContactGroups: [map], Website: str, BrandingTheme: map, BatchPayments: any, Discount: num(double), Balances: map, Attachments: [map], HasAttachments: bool, ValidationErrors: [map], HasValidationErrors: bool, StatusAttributeString: str}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Contacts: [map]} # Success - return response of type Contacts array with newly created Contact
@errors {400: Validation Error - some data was incorrect returns response of type Error}
@example_request {"Contacts":[{"ContactID":"3ff6d40c-af9a-40a3-89ce-3c1556a25591","ContactStatus":"ACTIVE","Name":"Foo9987","EmailAddress":"sid32476@blah.com","BankAccountDetails":"","Addresses":[{"AddressType":"STREET","City":"","Region":"","PostalCode":"","Country":""},{"AddressType":"POBOX","City":"","Region":"","PostalCode":"","Country":""}],"Phones":[{"PhoneType":"DEFAULT","PhoneNumber":"","PhoneAreaCode":"","PhoneCountryCode":""},{"PhoneType":"DDI","PhoneNumber":"","PhoneAreaCode":"","PhoneCountryCode":""},{"PhoneType":"FAX","PhoneNumber":"","PhoneAreaCode":"","PhoneCountryCode":""},{"PhoneType":"MOBILE","PhoneNumber":"555-1212","PhoneAreaCode":"415","PhoneCountryCode":""}],"UpdatedDateUTC":"/Date(1551399321043+0000)/","ContactGroups":[],"IsSupplier":false,"IsCustomer":false,"SalesTrackingCategories":[],"PurchasesTrackingCategories":[],"PaymentTerms":{"Bills":{"Day":15,"Type":"OFCURRENTMONTH"},"Sales":{"Day":10,"Type":"DAYSAFTERBILLMONTH"}},"ContactPersons":[]}]}

@endpoint POST /Contacts
@desc Updates or creates one or more contacts in a Xero organisation
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, Contacts: [map{ContactID: str(uuid), MergedToContactID: str(uuid), ContactNumber: str, AccountNumber: str, ContactStatus: str, Name: str, FirstName: str, LastName: str, CompanyNumber: str, EmailAddress: str, ContactPersons: [map], BankAccountDetails: str, TaxNumber: str, TaxNumberType: str, AccountsReceivableTaxType: str, AccountsPayableTaxType: str, Addresses: [map], Phones: [map], IsSupplier: bool, IsCustomer: bool, SalesDefaultLineAmountType: str, PurchasesDefaultLineAmountType: str, DefaultCurrency: str, XeroNetworkKey: str, SalesDefaultAccountCode: str, PurchasesDefaultAccountCode: str, SalesTrackingCategories: [map], PurchasesTrackingCategories: [map], TrackingCategoryName: str, TrackingCategoryOption: str, PaymentTerms: map, UpdatedDateUTC: str, ContactGroups: [map], Website: str, BrandingTheme: map, BatchPayments: any, Discount: num(double), Balances: map, Attachments: [map], HasAttachments: bool, ValidationErrors: [map], HasValidationErrors: bool, StatusAttributeString: str}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Contacts: [map]} # Success - return response of type Contacts array with newly created Contact
@errors {400: Validation Error - some data was incorrect returns response of type Error}
@example_request {"Contacts":[{"Name":"Bruce Banner","EmailAddress":"hulk@avengers.com","Phones":[{"PhoneType":"MOBILE","PhoneNumber":"555-1212","PhoneAreaCode":"415"}],"PaymentTerms":{"Bills":{"Day":15,"Type":"OFCURRENTMONTH"},"Sales":{"Day":10,"Type":"DAYSAFTERBILLMONTH"}}}]}

@endpoint GET /Contacts/{ContactNumber}
@desc Retrieves a specific contact by contact number in a Xero organisation
@required {ContactNumber: str # This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50).}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Contacts: [map]} # Success - return response of type Contacts array with a unique Contact

@endpoint GET /Contacts/{ContactID}
@desc Retrieves a specific contacts in a Xero organisation using a unique contact Id
@required {ContactID: str(uuid) # Unique identifier for a Contact}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Contacts: [map]} # Success - return response of type Contacts array with a unique Contact

@endpoint POST /Contacts/{ContactID}
@desc Updates a specific contact in a Xero organisation
@required {ContactID: str(uuid) # Unique identifier for a Contact}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, Contacts: [map{ContactID: str(uuid), MergedToContactID: str(uuid), ContactNumber: str, AccountNumber: str, ContactStatus: str, Name: str, FirstName: str, LastName: str, CompanyNumber: str, EmailAddress: str, ContactPersons: [map], BankAccountDetails: str, TaxNumber: str, TaxNumberType: str, AccountsReceivableTaxType: str, AccountsPayableTaxType: str, Addresses: [map], Phones: [map], IsSupplier: bool, IsCustomer: bool, SalesDefaultLineAmountType: str, PurchasesDefaultLineAmountType: str, DefaultCurrency: str, XeroNetworkKey: str, SalesDefaultAccountCode: str, PurchasesDefaultAccountCode: str, SalesTrackingCategories: [map], PurchasesTrackingCategories: [map], TrackingCategoryName: str, TrackingCategoryOption: str, PaymentTerms: map, UpdatedDateUTC: str, ContactGroups: [map], Website: str, BrandingTheme: map, BatchPayments: any, Discount: num(double), Balances: map, Attachments: [map], HasAttachments: bool, ValidationErrors: [map], HasValidationErrors: bool, StatusAttributeString: str}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Contacts: [map]} # Success - return response of type Contacts array with an updated Contact
@errors {400: A failed request due to validation error}
@example_request {"Contacts":[{"ContactID":"00000000-0000-0000-0000-000000000000","Name":"Thanos"}]}

@endpoint GET /Contacts/{ContactID}/Attachments
@desc Retrieves attachments for a specific contact in a Xero organisation
@required {ContactID: str(uuid) # Unique identifier for a Contact}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array with 0 to N Attachment

@endpoint GET /Contacts/{ContactID}/Attachments/{AttachmentID}
@desc Retrieves a specific attachment from a specific contact using a unique attachment Id
@required {ContactID: str(uuid) # Unique identifier for a Contact, AttachmentID: str(uuid) # Unique identifier for Attachment object, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for Contact as binary data

@endpoint GET /Contacts/{ContactID}/Attachments/{FileName}
@desc Retrieves a specific attachment from a specific contact by file name
@required {ContactID: str(uuid) # Unique identifier for a Contact, FileName: str # Name of the attachment, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for Contact as binary data

@endpoint POST /Contacts/{ContactID}/Attachments/{FileName}
@required {ContactID: str(uuid) # Unique identifier for a Contact, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array with an updated Attachment
@errors {400: A failed request due to validation error}

@endpoint PUT /Contacts/{ContactID}/Attachments/{FileName}
@required {ContactID: str(uuid) # Unique identifier for a Contact, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array with an newly created Attachment
@errors {400: A failed request due to validation error}

@endpoint GET /Contacts/{ContactID}/CISSettings
@desc Retrieves CIS settings for a specific contact in a Xero organisation
@required {ContactID: str(uuid) # Unique identifier for a Contact}
@returns(200) {CISSettings: [any]} # Success - return response of type CISSettings for a specific Contact

@endpoint GET /Contacts/{ContactID}/History
@desc Retrieves history records for a specific contact
@required {ContactID: str(uuid) # Unique identifier for a Contact}
@returns(200) {HistoryRecords: [map]} # Success - return response of HistoryRecords array of 0 to N HistoryRecord

@endpoint PUT /Contacts/{ContactID}/History
@desc Creates a new history record for a specific contact
@required {ContactID: str(uuid) # Unique identifier for a Contact}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]} # Success - return response of type HistoryRecords array of HistoryRecord objects
@errors {400: A failed request due to validation error}
@example_request {"HistoryRecords":[{"Details":"Hello World"}]}

@endgroup

@group ContactGroups
@endpoint GET /ContactGroups
@desc Retrieves the contact Id and name of each contact group
@optional {where: str # Filter by an any element, order: str # Order by an any element}
@returns(200) {ContactGroups: [map]} # Success - return response of type Contact Groups array of Contact Group

@endpoint PUT /ContactGroups
@desc Creates a contact group
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., ContactGroups: [map{Name: str, Status: str, ContactGroupID: str(uuid), Contacts: [map]}]}
@returns(200) {ContactGroups: [map]} # Success - return response of type Contact Groups array of newly created Contact Group
@errors {400: Validation Error - some data was incorrect returns response of type Error}
@example_request {"ContactGroups":[{"Name":"VIPs"}]}

@endpoint GET /ContactGroups/{ContactGroupID}
@desc Retrieves a specific contact group by using a unique contact group Id
@required {ContactGroupID: str(uuid) # Unique identifier for a Contact Group}
@returns(200) {ContactGroups: [map]} # Success - return response of type Contact Groups array with a specific Contact Group

@endpoint POST /ContactGroups/{ContactGroupID}
@desc Updates a specific contact group
@required {ContactGroupID: str(uuid) # Unique identifier for a Contact Group}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., ContactGroups: [map{Name: str, Status: str, ContactGroupID: str(uuid), Contacts: [map]}]}
@returns(200) {ContactGroups: [map]} # Success - return response of type Contact Groups array of updated Contact Group
@errors {400: A failed request due to validation error}
@example_request {"ContactGroups":[{"Name":"Suppliers"}]}

@endpoint PUT /ContactGroups/{ContactGroupID}/Contacts
@desc Creates contacts to a specific contact group
@required {ContactGroupID: str(uuid) # Unique identifier for a Contact Group}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, Contacts: [map{ContactID: str(uuid), MergedToContactID: str(uuid), ContactNumber: str, AccountNumber: str, ContactStatus: str, Name: str, FirstName: str, LastName: str, CompanyNumber: str, EmailAddress: str, ContactPersons: [map], BankAccountDetails: str, TaxNumber: str, TaxNumberType: str, AccountsReceivableTaxType: str, AccountsPayableTaxType: str, Addresses: [map], Phones: [map], IsSupplier: bool, IsCustomer: bool, SalesDefaultLineAmountType: str, PurchasesDefaultLineAmountType: str, DefaultCurrency: str, XeroNetworkKey: str, SalesDefaultAccountCode: str, PurchasesDefaultAccountCode: str, SalesTrackingCategories: [map], PurchasesTrackingCategories: [map], TrackingCategoryName: str, TrackingCategoryOption: str, PaymentTerms: map, UpdatedDateUTC: str, ContactGroups: [map], Website: str, BrandingTheme: map, BatchPayments: any, Discount: num(double), Balances: map, Attachments: [map], HasAttachments: bool, ValidationErrors: [map], HasValidationErrors: bool, StatusAttributeString: str}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Contacts: [map]} # Success - return response of type Contacts array of added Contacts
@errors {400: A failed request due to validation error}
@example_request {"Contacts":[{"ContactID":"a3675fc4-f8dd-4f03-ba5b-f1870566bcd7"},{"ContactID":"4e1753b9-018a-4775-b6aa-1bc7871cfee3"}]}

@endpoint DELETE /ContactGroups/{ContactGroupID}/Contacts
@desc Deletes all contacts from a specific contact group
@required {ContactGroupID: str(uuid) # Unique identifier for a Contact Group}
@returns(204) Success - return response 204 no content

@endpoint DELETE /ContactGroups/{ContactGroupID}/Contacts/{ContactID}
@desc Deletes a specific contact from a contact group using a unique contact Id
@required {ContactGroupID: str(uuid) # Unique identifier for a Contact Group, ContactID: str(uuid) # Unique identifier for a Contact}
@returns(204) Success - return response 204 no content
@errors {400: A failed request due to validation error}

@endgroup

@group CreditNotes
@endpoint GET /CreditNotes
@desc Retrieves any credit notes
@optional {If-Modified-Since: str(date-time) # Only records created or modified since this timestamp will be returned, where: str # Filter by an any element, order: str # Order by an any element, page: int # e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note, unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts, pageSize: int # Number of records to retrieve per page}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], CreditNotes: [map]} # Success - return response of type Credit Notes array of CreditNote

@endpoint PUT /CreditNotes
@desc Creates a new credit note
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, CreditNotes: [map{Type: str, Contact: map, Date: str, DueDate: str, Status: str, LineAmountTypes: str, LineItems: [map], SubTotal: num(double), TotalTax: num(double), Total: num(double), CISDeduction: num(double), CISRate: num(double), UpdatedDateUTC: str, CurrencyCode: str, FullyPaidOnDate: str, CreditNoteID: str(uuid), CreditNoteNumber: str, Reference: str, SentToContact: bool, CurrencyRate: num(double), RemainingCredit: num(double), Allocations: [map], AppliedAmount: num(double), Payments: [map], BrandingThemeID: str(uuid), StatusAttributeString: str, HasAttachments: bool, HasErrors: bool, ValidationErrors: [map], Warnings: [map], InvoiceAddresses: [map]}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], CreditNotes: [map]} # Success - return response of type Credit Notes array of newly created CreditNote
@errors {400: A failed request due to validation error}
@example_request {"CreditNotes":[{"Type":"ACCPAYCREDIT","Contact":{"ContactID":"430fa14a-f945-44d3-9f97-5df5e28441b8"},"Date":"2019-01-05","LineItems":[{"Description":"Foobar","Quantity":2,"UnitAmount":20,"AccountCode":"400"}]}]}

@endpoint POST /CreditNotes
@desc Updates or creates one or more credit notes
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, CreditNotes: [map{Type: str, Contact: map, Date: str, DueDate: str, Status: str, LineAmountTypes: str, LineItems: [map], SubTotal: num(double), TotalTax: num(double), Total: num(double), CISDeduction: num(double), CISRate: num(double), UpdatedDateUTC: str, CurrencyCode: str, FullyPaidOnDate: str, CreditNoteID: str(uuid), CreditNoteNumber: str, Reference: str, SentToContact: bool, CurrencyRate: num(double), RemainingCredit: num(double), Allocations: [map], AppliedAmount: num(double), Payments: [map], BrandingThemeID: str(uuid), StatusAttributeString: str, HasAttachments: bool, HasErrors: bool, ValidationErrors: [map], Warnings: [map], InvoiceAddresses: [map]}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], CreditNotes: [map]} # Success - return response of type Credit Notes array of newly created CreditNote
@errors {400: A failed request due to validation error}
@example_request {"CreditNotes":[{"Type":"ACCPAYCREDIT","Contact":{"ContactID":"430fa14a-f945-44d3-9f97-5df5e28441b8"},"Date":"2019-01-05","Status":"AUTHORISED","Reference":"HelloWorld","LineItems":[{"Description":"Foobar","Quantity":2,"UnitAmount":20,"AccountCode":"400"}]}]}

@endpoint GET /CreditNotes/{CreditNoteID}
@desc Retrieves a specific credit note using a unique credit note Id
@required {CreditNoteID: str(uuid) # Unique identifier for a Credit Note}
@optional {unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], CreditNotes: [map]} # Success - return response of type Credit Notes array with a unique CreditNote

@endpoint POST /CreditNotes/{CreditNoteID}
@desc Updates a specific credit note
@required {CreditNoteID: str(uuid) # Unique identifier for a Credit Note}
@optional {unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, CreditNotes: [map{Type: str, Contact: map, Date: str, DueDate: str, Status: str, LineAmountTypes: str, LineItems: [map], SubTotal: num(double), TotalTax: num(double), Total: num(double), CISDeduction: num(double), CISRate: num(double), UpdatedDateUTC: str, CurrencyCode: str, FullyPaidOnDate: str, CreditNoteID: str(uuid), CreditNoteNumber: str, Reference: str, SentToContact: bool, CurrencyRate: num(double), RemainingCredit: num(double), Allocations: [map], AppliedAmount: num(double), Payments: [map], BrandingThemeID: str(uuid), StatusAttributeString: str, HasAttachments: bool, HasErrors: bool, ValidationErrors: [map], Warnings: [map], InvoiceAddresses: [map]}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], CreditNotes: [map]} # Success - return response of type Credit Notes array with updated CreditNote
@errors {400: A failed request due to validation error}
@example_request {"CreditNotes":[{"Type":"ACCPAYCREDIT","Contact":{"ContactID":"430fa14a-f945-44d3-9f97-5df5e28441b8"},"Date":"2019-01-05","Status":"AUTHORISED","Reference":"HelloWorld","SentToContact":true,"LineItems":[{"Description":"Foobar","Quantity":2,"UnitAmount":20,"AccountCode":"400"}]}]}

@endpoint GET /CreditNotes/{CreditNoteID}/Attachments
@desc Retrieves attachments for a specific credit notes
@required {CreditNoteID: str(uuid) # Unique identifier for a Credit Note}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array with all Attachment for specific Credit Note

@endpoint GET /CreditNotes/{CreditNoteID}/Attachments/{AttachmentID}
@desc Retrieves a specific attachment from a specific credit note using a unique attachment Id
@required {CreditNoteID: str(uuid) # Unique identifier for a Credit Note, AttachmentID: str(uuid) # Unique identifier for Attachment object, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for Credit Note as binary data

@endpoint GET /CreditNotes/{CreditNoteID}/Attachments/{FileName}
@desc Retrieves a specific attachment on a specific credit note by file name
@required {CreditNoteID: str(uuid) # Unique identifier for a Credit Note, FileName: str # Name of the attachment, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for Credit Note as binary data

@endpoint POST /CreditNotes/{CreditNoteID}/Attachments/{FileName}
@desc Updates attachments on a specific credit note by file name
@required {CreditNoteID: str(uuid) # Unique identifier for a Credit Note, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array with updated Attachment for specific Credit Note
@errors {400: A failed request due to validation error}

@endpoint PUT /CreditNotes/{CreditNoteID}/Attachments/{FileName}
@desc Creates an attachment for a specific credit note
@required {CreditNoteID: str(uuid) # Unique identifier for a Credit Note, FileName: str # Name of the attachment}
@optional {IncludeOnline: bool=false # Allows an attachment to be seen by the end customer within their online invoice, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array with newly created Attachment for specific Credit Note
@errors {400: A failed request due to validation error}

@endpoint GET /CreditNotes/{CreditNoteID}/pdf
@desc Retrieves credit notes as PDF files
@required {CreditNoteID: str(uuid) # Unique identifier for a Credit Note}
@returns(200) Success - return response of binary data from the Attachment to a Credit Note

@endpoint PUT /CreditNotes/{CreditNoteID}/Allocations
@desc Creates allocation for a specific credit note
@required {CreditNoteID: str(uuid) # Unique identifier for a Credit Note}
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., Allocations: [map{AllocationID: str(uuid), Invoice!: map, Overpayment: map, Prepayment: map, CreditNote: map, Amount!: num(double), Date!: str, IsDeleted: bool, StatusAttributeString: str, ValidationErrors: [map]}]}
@returns(200) {Allocations: [map]} # Success - return response of type Allocations array with newly created Allocation for specific Credit Note
@errors {400: A failed request due to validation error}
@example_request {"Allocations":[{"Invoice":{"LineItems":[],"InvoiceID":"c45720a1-ade3-4a38-a064-d15489be6841"},"Amount":1,"Date":"2019-03-05"}]}

@endpoint DELETE /CreditNotes/{CreditNoteID}/Allocations/{AllocationID}
@desc Deletes an Allocation from a Credit Note
@required {CreditNoteID: str(uuid) # Unique identifier for a Credit Note, AllocationID: str(uuid) # Unique identifier for Allocation object}
@returns(200) {AllocationID: str(uuid), Invoice: map{Type: str, Contact: map{ContactID: str(uuid), MergedToContactID: str(uuid), ContactNumber: str, AccountNumber: str, ContactStatus: str, Name: str, FirstName: str, LastName: str, CompanyNumber: str, EmailAddress: str, ContactPersons: [map], BankAccountDetails: str, TaxNumber: str, TaxNumberType: str, AccountsReceivableTaxType: str, AccountsPayableTaxType: str, Addresses: [map], Phones: [map], IsSupplier: bool, IsCustomer: bool, SalesDefaultLineAmountType: str, PurchasesDefaultLineAmountType: str, DefaultCurrency: str, XeroNetworkKey: str, SalesDefaultAccountCode: str, PurchasesDefaultAccountCode: str, SalesTrackingCategories: [map], PurchasesTrackingCategories: [map], TrackingCategoryName: str, TrackingCategoryOption: str, PaymentTerms: map{Bills: map, Sales: map}, UpdatedDateUTC: str, ContactGroups: [map], Website: str, BrandingTheme: map{BrandingThemeID: str(uuid), Name: str, LogoUrl: str, Type: str, SortOrder: int, CreatedDateUTC: str}, BatchPayments: any, Discount: num(double), Balances: map{AccountsReceivable: map, AccountsPayable: map}, Attachments: [map], HasAttachments: bool, ValidationErrors: [map], HasValidationErrors: bool, StatusAttributeString: str}, LineItems: [map], Date: str, DueDate: str, LineAmountTypes: str, InvoiceNumber: str, Reference: str, BrandingThemeID: str(uuid), Url: str, CurrencyCode: str, CurrencyRate: num(double), Status: str, SentToContact: bool, ExpectedPaymentDate: str, PlannedPaymentDate: str, CISDeduction: num(double), CISRate: num(double), SubTotal: num(double), TotalTax: num(double), Total: num(double), TotalDiscount: num(double), InvoiceID: str(uuid), RepeatingInvoiceID: str(uuid), HasAttachments: bool, IsDiscounted: bool, Payments: [map], Prepayments: [map], Overpayments: [map], AmountDue: num(double), AmountPaid: num(double), FullyPaidOnDate: str, AmountCredited: num(double), UpdatedDateUTC: str, CreditNotes: [map], Attachments: [map], HasErrors: bool, StatusAttributeString: str, ValidationErrors: [map], Warnings: [map], InvoiceAddresses: [map]}, Overpayment: map{Type: str, Contact: map{ContactID: str(uuid), MergedToContactID: str(uuid), ContactNumber: str, AccountNumber: str, ContactStatus: str, Name: str, FirstName: str, LastName: str, CompanyNumber: str, EmailAddress: str, ContactPersons: [map], BankAccountDetails: str, TaxNumber: str, TaxNumberType: str, AccountsReceivableTaxType: str, AccountsPayableTaxType: str, Addresses: [map], Phones: [map], IsSupplier: bool, IsCustomer: bool, SalesDefaultLineAmountType: str, PurchasesDefaultLineAmountType: str, DefaultCurrency: str, XeroNetworkKey: str, SalesDefaultAccountCode: str, PurchasesDefaultAccountCode: str, SalesTrackingCategories: [map], PurchasesTrackingCategories: [map], TrackingCategoryName: str, TrackingCategoryOption: str, PaymentTerms: map{Bills: map, Sales: map}, UpdatedDateUTC: str, ContactGroups: [map], Website: str, BrandingTheme: map{BrandingThemeID: str(uuid), Name: str, LogoUrl: str, Type: str, SortOrder: int, CreatedDateUTC: str}, BatchPayments: any, Discount: num(double), Balances: map{AccountsReceivable: map, AccountsPayable: map}, Attachments: [map], HasAttachments: bool, ValidationErrors: [map], HasValidationErrors: bool, StatusAttributeString: str}, Date: str, Status: str, LineAmountTypes: str, LineItems: [map], SubTotal: num(double), TotalTax: num(double), Total: num(double), UpdatedDateUTC: str, CurrencyCode: str, OverpaymentID: str(uuid), CurrencyRate: num(double), RemainingCredit: num(double), Allocations: [map], AppliedAmount: num(double), Payments: [map], HasAttachments: bool, Reference: str, Attachments: [map]}, Prepayment: map{Type: str, Contact: map{ContactID: str(uuid), MergedToContactID: str(uuid), ContactNumber: str, AccountNumber: str, ContactStatus: str, Name: str, FirstName: str, LastName: str, CompanyNumber: str, EmailAddress: str, ContactPersons: [map], BankAccountDetails: str, TaxNumber: str, TaxNumberType: str, AccountsReceivableTaxType: str, AccountsPayableTaxType: str, Addresses: [map], Phones: [map], IsSupplier: bool, IsCustomer: bool, SalesDefaultLineAmountType: str, PurchasesDefaultLineAmountType: str, DefaultCurrency: str, XeroNetworkKey: str, SalesDefaultAccountCode: str, PurchasesDefaultAccountCode: str, SalesTrackingCategories: [map], PurchasesTrackingCategories: [map], TrackingCategoryName: str, TrackingCategoryOption: str, PaymentTerms: map{Bills: map, Sales: map}, UpdatedDateUTC: str, ContactGroups: [map], Website: str, BrandingTheme: map{BrandingThemeID: str(uuid), Name: str, LogoUrl: str, Type: str, SortOrder: int, CreatedDateUTC: str}, BatchPayments: any, Discount: num(double), Balances: map{AccountsReceivable: map, AccountsPayable: map}, Attachments: [map], HasAttachments: bool, ValidationErrors: [map], HasValidationErrors: bool, StatusAttributeString: str}, Date: str, Status: str, LineAmountTypes: str, LineItems: [map], SubTotal: num(double), TotalTax: num(double), Total: num(double), Reference: str, InvoiceNumber: str, UpdatedDateUTC: str, CurrencyCode: str, PrepaymentID: str(uuid), CurrencyRate: num(double), RemainingCredit: num(double), Allocations: [map], Payments: [map], AppliedAmount: num(double), HasAttachments: bool, Attachments: [map]}, CreditNote: map{Type: str, Contact: map{ContactID: str(uuid), MergedToContactID: str(uuid), ContactNumber: str, AccountNumber: str, ContactStatus: str, Name: str, FirstName: str, LastName: str, CompanyNumber: str, EmailAddress: str, ContactPersons: [map], BankAccountDetails: str, TaxNumber: str, TaxNumberType: str, AccountsReceivableTaxType: str, AccountsPayableTaxType: str, Addresses: [map], Phones: [map], IsSupplier: bool, IsCustomer: bool, SalesDefaultLineAmountType: str, PurchasesDefaultLineAmountType: str, DefaultCurrency: str, XeroNetworkKey: str, SalesDefaultAccountCode: str, PurchasesDefaultAccountCode: str, SalesTrackingCategories: [map], PurchasesTrackingCategories: [map], TrackingCategoryName: str, TrackingCategoryOption: str, PaymentTerms: map{Bills: map, Sales: map}, UpdatedDateUTC: str, ContactGroups: [map], Website: str, BrandingTheme: map{BrandingThemeID: str(uuid), Name: str, LogoUrl: str, Type: str, SortOrder: int, CreatedDateUTC: str}, BatchPayments: any, Discount: num(double), Balances: map{AccountsReceivable: map, AccountsPayable: map}, Attachments: [map], HasAttachments: bool, ValidationErrors: [map], HasValidationErrors: bool, StatusAttributeString: str}, Date: str, DueDate: str, Status: str, LineAmountTypes: str, LineItems: [map], SubTotal: num(double), TotalTax: num(double), Total: num(double), CISDeduction: num(double), CISRate: num(double), UpdatedDateUTC: str, CurrencyCode: str, FullyPaidOnDate: str, CreditNoteID: str(uuid), CreditNoteNumber: str, Reference: str, SentToContact: bool, CurrencyRate: num(double), RemainingCredit: num(double), Allocations: [map], AppliedAmount: num(double), Payments: [map], BrandingThemeID: str(uuid), StatusAttributeString: str, HasAttachments: bool, HasErrors: bool, ValidationErrors: [map], Warnings: [map], InvoiceAddresses: [map]}, Amount: num(double), Date: str, IsDeleted: bool, StatusAttributeString: str, ValidationErrors: [map]} # Success - return response of type Allocation with the isDeleted flag as true

@endpoint GET /CreditNotes/{CreditNoteID}/History
@desc Retrieves history records of a specific credit note
@required {CreditNoteID: str(uuid) # Unique identifier for a Credit Note}
@returns(200) {HistoryRecords: [map]} # Success - return response of HistoryRecords array of 0 to N HistoryRecord

@endpoint PUT /CreditNotes/{CreditNoteID}/History
@desc Retrieves history records of a specific credit note
@required {CreditNoteID: str(uuid) # Unique identifier for a Credit Note}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]} # Success - return response of type HistoryRecords array of HistoryRecord objects
@errors {400: A failed request due to validation error}
@example_request {"HistoryRecords":[{"Details":"Hello World"}]}

@endgroup

@group Currencies
@endpoint GET /Currencies
@desc Retrieves currencies for your Xero organisation
@optional {where: str # Filter by an any element, order: str # Order by an any element}
@returns(200) {Currencies: [map]} # Success - return response of type Currencies array with all Currencies

@endpoint PUT /Currencies
@desc Create a new currency for a Xero organisation
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., Code: str(AED/AFN/ALL/AMD/ANG/AOA/ARS/AUD/AWG/AZN/BAM/BBD/BDT/BGN/BHD/BIF/BMD/BND/BOB/BRL/BSD/BTN/BWP/BYN/BYR/BZD/CAD/CDF/CHF/CLF/CLP/CNY/COP/CRC/CUC/CUP/CVE/CZK/DJF/DKK/DOP/DZD/EEK/EGP/ERN/ETB/EUR/FJD/FKP/GBP/GEL/GHS/GIP/GMD/GNF/GTQ/GYD/HKD/HNL/HRK/HTG/HUF/IDR/ILS/INR/IQD/IRR/ISK/JMD/JOD/JPY/KES/KGS/KHR/KMF/KPW/KRW/KWD/KYD/KZT/LAK/LBP/LKR/LRD/LSL/LTL/LVL/LYD/MAD/MDL/MGA/MKD/MMK/MNT/MOP/MRO/MRU/MUR/MVR/MWK/MXN/MXV/MYR/MZN/NAD/NGN/NIO/NOK/NPR/NZD/OMR/PAB/PEN/PGK/PHP/PKR/PLN/PYG/QAR/RON/RSD/RUB/RWF/SAR/SBD/SCR/SDG/SEK/SGD/SHP/SKK/SLE/SLL/SOS/SRD/STD/STN/SVC/SYP/SZL/THB/TJS/TMT/TND/TOP/TRY/TTD/TWD/TZS/UAH/UGX/USD/UYU/UZS/VEF/VES/VND/VUV/WST/XAF/XCD/XOF/XPF/YER/ZAR/ZMW/ZMK/ZWD) # 3 letter alpha code for the currency – see list of currency codes, Description: str # Name of Currency}
@returns(200) {Currencies: [map]} # Unsupported - return response incorrect exception, API is not able to create new Currency
@example_request {"Code":"USD","Description":"United States Dollar"}

@endgroup

@group Employees
@endpoint GET /Employees
@desc Retrieves employees used in Xero payrun
@optional {If-Modified-Since: str(date-time) # Only records created or modified since this timestamp will be returned, where: str # Filter by an any element, order: str # Order by an any element}
@returns(200) {Employees: [map]} # Success - return response of type Employees array with all Employee

@endpoint PUT /Employees
@desc Creates new employees used in Xero payrun
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., Employees: [map{EmployeeID: str(uuid), Status: str, FirstName: str, LastName: str, ExternalLink: map, UpdatedDateUTC: str, StatusAttributeString: str, ValidationErrors: [map]}]}
@returns(200) {Employees: [map]} # Success - return response of type Employees array with new Employee
@errors {400: A failed request due to validation error}
@example_request {"Employees":[{"FirstName":"Nick","LastName":"Fury","ExternalLink":{"Url":"http://twitter.com/#!/search/Nick+Fury"}}]}

@endpoint POST /Employees
@desc Creates a single new employees used in Xero payrun
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., Employees: [map{EmployeeID: str(uuid), Status: str, FirstName: str, LastName: str, ExternalLink: map, UpdatedDateUTC: str, StatusAttributeString: str, ValidationErrors: [map]}]}
@returns(200) {Employees: [map]} # Success - return response of type Employees array with new Employee
@errors {400: A failed request due to validation error}
@example_request {"Employees":[{"FirstName":"Nick","LastName":"Fury","ExternalLink":{"Url":"http://twitter.com/#!/search/Nick+Fury"}}]}

@endpoint GET /Employees/{EmployeeID}
@desc Retrieves a specific employee used in Xero payrun using a unique employee Id
@required {EmployeeID: str(uuid) # Unique identifier for a Employee}
@returns(200) {Employees: [map]} # Success - return response of type Employees array with specified Employee

@endgroup

@group ExpenseClaims
@endpoint GET /ExpenseClaims
@desc Retrieves expense claims
@optional {If-Modified-Since: str(date-time) # Only records created or modified since this timestamp will be returned, where: str # Filter by an any element, order: str # Order by an any element}
@returns(200) {ExpenseClaims: [map]} # Success - return response of type ExpenseClaims array with all ExpenseClaims

@endpoint PUT /ExpenseClaims
@desc Creates expense claims
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., ExpenseClaims: [map{ExpenseClaimID: str(uuid), Status: str, Payments: [map], User: map, Receipts: [map], UpdatedDateUTC: str, Total: num(double), AmountDue: num(double), AmountPaid: num(double), PaymentDueDate: str, ReportingDate: str, ReceiptID: str(uuid)}]}
@returns(200) {ExpenseClaims: [map]} # Success - return response of type ExpenseClaims array with newly created ExpenseClaim
@errors {400: A failed request due to validation error}
@example_request {"ExpenseClaims":[{"Status":"SUBMITTED","User":{"UserID":"d1164823-0ac1-41ad-987b-b4e30fe0b273"},"Receipts":[{"Lineitems":[],"ReceiptID":"dc1c7f6d-0a4c-402f-acac-551d62ce5816"}]}]}

@endpoint GET /ExpenseClaims/{ExpenseClaimID}
@desc Retrieves a specific expense claim using a unique expense claim Id
@required {ExpenseClaimID: str(uuid) # Unique identifier for a ExpenseClaim}
@returns(200) {ExpenseClaims: [map]} # Success - return response of type ExpenseClaims array with specified ExpenseClaim

@endpoint POST /ExpenseClaims/{ExpenseClaimID}
@desc Updates a specific expense claims
@required {ExpenseClaimID: str(uuid) # Unique identifier for a ExpenseClaim}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., ExpenseClaims: [map{ExpenseClaimID: str(uuid), Status: str, Payments: [map], User: map, Receipts: [map], UpdatedDateUTC: str, Total: num(double), AmountDue: num(double), AmountPaid: num(double), PaymentDueDate: str, ReportingDate: str, ReceiptID: str(uuid)}]}
@returns(200) {ExpenseClaims: [map]} # Success - return response of type ExpenseClaims array with updated ExpenseClaim
@errors {400: A failed request due to validation error}
@example_request {"ExpenseClaims":[{"Status":"SUBMITTED","User":{"UserID":"d1164823-0ac1-41ad-987b-b4e30fe0b273"},"Receipts":[{"Lineitems":[],"ReceiptID":"dc1c7f6d-0a4c-402f-acac-551d62ce5816"}]}]}

@endpoint GET /ExpenseClaims/{ExpenseClaimID}/History
@desc Retrieves history records of a specific expense claim
@required {ExpenseClaimID: str(uuid) # Unique identifier for a ExpenseClaim}
@returns(200) {HistoryRecords: [map]} # Success - return response of HistoryRecords array of 0 to N HistoryRecord

@endpoint PUT /ExpenseClaims/{ExpenseClaimID}/History
@desc Creates a history record for a specific expense claim
@required {ExpenseClaimID: str(uuid) # Unique identifier for a ExpenseClaim}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]} # Success - return response of type HistoryRecords array of HistoryRecord objects
@example_request {"HistoryRecords":[{"Details":"Hello World"}]}

@endgroup

@group Invoices
@endpoint GET /Invoices
@desc Retrieves sales invoices or purchase bills
@optional {If-Modified-Since: str(date-time) # Only records created or modified since this timestamp will be returned, where: str # Filter by an any element, order: str # Order by an any element, IDs: [str(uuid)] # Filter by a comma-separated list of InvoicesIDs., InvoiceNumbers: [str] # Filter by a comma-separated list of InvoiceNumbers., ContactIDs: [str(uuid)] # Filter by a comma-separated list of ContactIDs., Statuses: [str] # Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter., page: int # e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice, includeArchived: bool # e.g. includeArchived=true - Invoices with a status of ARCHIVED will be included in the response, createdByMyApp: bool # When set to true you'll only retrieve Invoices created by your app, unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts, summaryOnly: bool=false # Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient., pageSize: int # Number of records to retrieve per page, searchTerm: str # Search parameter that performs a case-insensitive text search across the fields e.g. InvoiceNumber, Reference.}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Invoices: [map]} # Success - return response of type Invoices array with all Invoices

@endpoint PUT /Invoices
@desc Creates one or more sales invoices or purchase bills
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, Invoices: [map{Type: str, Contact: map, LineItems: [map], Date: str, DueDate: str, LineAmountTypes: str, InvoiceNumber: str, Reference: str, BrandingThemeID: str(uuid), Url: str, CurrencyCode: str, CurrencyRate: num(double), Status: str, SentToContact: bool, ExpectedPaymentDate: str, PlannedPaymentDate: str, CISDeduction: num(double), CISRate: num(double), SubTotal: num(double), TotalTax: num(double), Total: num(double), TotalDiscount: num(double), InvoiceID: str(uuid), RepeatingInvoiceID: str(uuid), HasAttachments: bool, IsDiscounted: bool, Payments: [map], Prepayments: [map], Overpayments: [map], AmountDue: num(double), AmountPaid: num(double), FullyPaidOnDate: str, AmountCredited: num(double), UpdatedDateUTC: str, CreditNotes: [map], Attachments: [map], HasErrors: bool, StatusAttributeString: str, ValidationErrors: [map], Warnings: [map], InvoiceAddresses: [map]}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Invoices: [map]} # Success - return response of type Invoices array with newly created Invoice
@errors {400: A failed request due to validation error}
@example_request {"Invoices":[{"Type":"ACCREC","Contact":{"ContactID":"430fa14a-f945-44d3-9f97-5df5e28441b8"},"LineItems":[{"Description":"Acme Tires","Quantity":2,"UnitAmount":20,"AccountCode":"200","TaxType":"NONE","LineAmount":40}],"Date":"2019-03-11","DueDate":"2018-12-10","Reference":"Website Design","Status":"AUTHORISED"}]}

@endpoint POST /Invoices
@desc Updates or creates one or more sales invoices or purchase bills
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, Invoices: [map{Type: str, Contact: map, LineItems: [map], Date: str, DueDate: str, LineAmountTypes: str, InvoiceNumber: str, Reference: str, BrandingThemeID: str(uuid), Url: str, CurrencyCode: str, CurrencyRate: num(double), Status: str, SentToContact: bool, ExpectedPaymentDate: str, PlannedPaymentDate: str, CISDeduction: num(double), CISRate: num(double), SubTotal: num(double), TotalTax: num(double), Total: num(double), TotalDiscount: num(double), InvoiceID: str(uuid), RepeatingInvoiceID: str(uuid), HasAttachments: bool, IsDiscounted: bool, Payments: [map], Prepayments: [map], Overpayments: [map], AmountDue: num(double), AmountPaid: num(double), FullyPaidOnDate: str, AmountCredited: num(double), UpdatedDateUTC: str, CreditNotes: [map], Attachments: [map], HasErrors: bool, StatusAttributeString: str, ValidationErrors: [map], Warnings: [map], InvoiceAddresses: [map]}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Invoices: [map]} # Success - return response of type Invoices array with newly created Invoice
@errors {400: A failed request due to validation error}
@example_request {"Invoices":[{"Type":"ACCREC","Contact":{"ContactID":"430fa14a-f945-44d3-9f97-5df5e28441b8"},"LineItems":[{"Description":"Acme Tires","Quantity":2,"UnitAmount":20,"AccountCode":"200","TaxType":"NONE","LineAmount":40}],"Date":"2019-03-11","DueDate":"2018-12-10","Reference":"Website Design","Status":"AUTHORISED"}]}

@endpoint GET /Invoices/{InvoiceID}
@desc Retrieves a specific sales invoice or purchase bill using a unique invoice Id
@required {InvoiceID: str(uuid) # Unique identifier for an Invoice}
@optional {unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Invoices: [map]} # Success - return response of type Invoices array with specified Invoices

@endpoint POST /Invoices/{InvoiceID}
@desc Updates a specific sales invoices or purchase bills
@required {InvoiceID: str(uuid) # Unique identifier for an Invoice}
@optional {unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, Invoices: [map{Type: str, Contact: map, LineItems: [map], Date: str, DueDate: str, LineAmountTypes: str, InvoiceNumber: str, Reference: str, BrandingThemeID: str(uuid), Url: str, CurrencyCode: str, CurrencyRate: num(double), Status: str, SentToContact: bool, ExpectedPaymentDate: str, PlannedPaymentDate: str, CISDeduction: num(double), CISRate: num(double), SubTotal: num(double), TotalTax: num(double), Total: num(double), TotalDiscount: num(double), InvoiceID: str(uuid), RepeatingInvoiceID: str(uuid), HasAttachments: bool, IsDiscounted: bool, Payments: [map], Prepayments: [map], Overpayments: [map], AmountDue: num(double), AmountPaid: num(double), FullyPaidOnDate: str, AmountCredited: num(double), UpdatedDateUTC: str, CreditNotes: [map], Attachments: [map], HasErrors: bool, StatusAttributeString: str, ValidationErrors: [map], Warnings: [map], InvoiceAddresses: [map]}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Invoices: [map]} # Success - return response of type Invoices array with updated Invoice
@errors {400: A failed request due to validation error}
@example_request {"Invoices":[{"Reference":"May the force be with you","InvoiceID":"00000000-0000-0000-0000-000000000000","LineItems":[],"Contact":{},"Type":"ACCPAY"}]}

@endpoint GET /Invoices/{InvoiceID}/pdf
@desc Retrieves invoices or purchase bills as PDF files
@required {InvoiceID: str(uuid) # Unique identifier for an Invoice}
@returns(200) Success - return response of byte array pdf version of specified Invoices

@endpoint GET /Invoices/{InvoiceID}/Attachments
@desc Retrieves attachments for a specific invoice or purchase bill
@required {InvoiceID: str(uuid) # Unique identifier for an Invoice}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array of Attachments for specified Invoices

@endpoint GET /Invoices/{InvoiceID}/Attachments/{AttachmentID}
@desc Retrieves a specific attachment from a specific invoices or purchase bills by using a unique attachment Id
@required {InvoiceID: str(uuid) # Unique identifier for an Invoice, AttachmentID: str(uuid) # Unique identifier for Attachment object, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for Invoice as binary data

@endpoint GET /Invoices/{InvoiceID}/Attachments/{FileName}
@desc Retrieves an attachment from a specific invoice or purchase bill by filename
@required {InvoiceID: str(uuid) # Unique identifier for an Invoice, FileName: str # Name of the attachment, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for Invoice as binary data

@endpoint POST /Invoices/{InvoiceID}/Attachments/{FileName}
@desc Updates an attachment from a specific invoices or purchase bill by filename
@required {InvoiceID: str(uuid) # Unique identifier for an Invoice, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array with updated Attachment
@errors {400: A failed request due to validation error}

@endpoint PUT /Invoices/{InvoiceID}/Attachments/{FileName}
@desc Creates an attachment for a specific invoice or purchase bill by filename
@required {InvoiceID: str(uuid) # Unique identifier for an Invoice, FileName: str # Name of the attachment}
@optional {IncludeOnline: bool=false # Allows an attachment to be seen by the end customer within their online invoice, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array with newly created Attachment
@errors {400: A failed request due to validation error}

@endpoint GET /Invoices/{InvoiceID}/OnlineInvoice
@desc Retrieves a URL to an online invoice
@required {InvoiceID: str(uuid) # Unique identifier for an Invoice}
@returns(200) {OnlineInvoices: [map]} # Success - return response of type OnlineInvoice array with one OnlineInvoice

@endpoint POST /Invoices/{InvoiceID}/Email
@desc Sends a copy of a specific invoice to related contact via email
@required {InvoiceID: str(uuid) # Unique identifier for an Invoice}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., Status: str # Need at least one field to create an empty JSON payload}
@returns(204) Success - return response 204 no content
@errors {400: A failed request due to validation error}
@example_request {}

@endpoint GET /Invoices/{InvoiceID}/History
@desc Retrieves history records for a specific invoice
@required {InvoiceID: str(uuid) # Unique identifier for an Invoice}
@returns(200) {HistoryRecords: [map]} # Success - return response of HistoryRecords array of 0 to N HistoryRecord

@endpoint PUT /Invoices/{InvoiceID}/History
@desc Creates a history record for a specific invoice
@required {InvoiceID: str(uuid) # Unique identifier for an Invoice}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]} # Success - return response of type HistoryRecords array of HistoryRecord objects
@errors {400: A failed request due to validation error}
@example_request {"HistoryRecords":[{"Details":"Hello World"}]}

@endgroup

@group InvoiceReminders
@endpoint GET /InvoiceReminders/Settings
@desc Retrieves invoice reminder settings
@returns(200) {InvoiceReminders: [map]} # Success - return response of Invoice Reminders

@endgroup

@group Items
@endpoint GET /Items
@desc Retrieves items
@optional {If-Modified-Since: str(date-time) # Only records created or modified since this timestamp will be returned, where: str # Filter by an any element, order: str # Order by an any element, unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts}
@returns(200) {Items: [map]} # Success - return response of type Items array with all Item

@endpoint PUT /Items
@desc Creates one or more items
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., Items: [map{Code!: str, InventoryAssetAccountCode: str, Name: str, IsSold: bool, IsPurchased: bool, Description: str, PurchaseDescription: str, PurchaseDetails: map, SalesDetails: map, IsTrackedAsInventory: bool, TotalCostPool: num(double), QuantityOnHand: num(double), UpdatedDateUTC: str, ItemID: str(uuid), StatusAttributeString: str, ValidationErrors: [map]}]}
@returns(200) {Items: [map]} # Success - return response of type Items array with newly created Item
@errors {400: A failed request due to validation error}
@example_request {"Items":[{"Code":"code123","Name":"Item Name XYZ","Description":"Foobar","InventoryAssetAccountCode":"140","PurchaseDetails":{"COGSAccountCode":"500"}}]}

@endpoint POST /Items
@desc Updates or creates one or more items
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., Items: [map{Code!: str, InventoryAssetAccountCode: str, Name: str, IsSold: bool, IsPurchased: bool, Description: str, PurchaseDescription: str, PurchaseDetails: map, SalesDetails: map, IsTrackedAsInventory: bool, TotalCostPool: num(double), QuantityOnHand: num(double), UpdatedDateUTC: str, ItemID: str(uuid), StatusAttributeString: str, ValidationErrors: [map]}]}
@returns(200) {Items: [map]} # Success - return response of type Items array with newly created Item
@errors {400: A failed request due to validation error}
@example_request {"Items":[{"Code":"ItemCode123","Name":"ItemName XYZ","Description":"Item Description ABC"}]}

@endpoint GET /Items/{ItemID}
@desc Retrieves a specific item using a unique item Id
@required {ItemID: str(uuid) # Unique identifier for an Item}
@optional {unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts}
@returns(200) {Items: [map]} # Success - return response of type Items array with specified Item

@endpoint POST /Items/{ItemID}
@desc Updates a specific item
@required {ItemID: str(uuid) # Unique identifier for an Item}
@optional {unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., Items: [map{Code!: str, InventoryAssetAccountCode: str, Name: str, IsSold: bool, IsPurchased: bool, Description: str, PurchaseDescription: str, PurchaseDetails: map, SalesDetails: map, IsTrackedAsInventory: bool, TotalCostPool: num(double), QuantityOnHand: num(double), UpdatedDateUTC: str, ItemID: str(uuid), StatusAttributeString: str, ValidationErrors: [map]}]}
@returns(200) {Items: [map]} # Success - return response of type Items array with updated Item
@errors {400: A failed request due to validation error}
@example_request {"Items":[{"Code":"ItemCode123","Description":"Description 123"}]}

@endpoint DELETE /Items/{ItemID}
@desc Deletes a specific item
@required {ItemID: str(uuid) # Unique identifier for an Item}
@returns(204) Success - return response 204 no content
@errors {400: A failed request due to validation error}

@endpoint GET /Items/{ItemID}/History
@desc Retrieves history for a specific item
@required {ItemID: str(uuid) # Unique identifier for an Item}
@returns(200) {HistoryRecords: [map]} # Success - return response of HistoryRecords array of 0 to N HistoryRecord

@endpoint PUT /Items/{ItemID}/History
@desc Creates a history record for a specific item
@required {ItemID: str(uuid) # Unique identifier for an Item}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]} # Success - return response of type HistoryRecords array of HistoryRecord objects
@example_request {"HistoryRecords":[{"Details":"Hello World"}]}

@endgroup

@group Journals
@endpoint GET /Journals
@desc Retrieves journals
@optional {If-Modified-Since: str(date-time) # Only records created or modified since this timestamp will be returned, offset: int # Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned, paymentsOnly: bool # Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default.}
@returns(200) {Warnings: [map], Journals: [map]} # Success - return response of type Journals array with all Journals

@endpoint GET /Journals/{JournalID}
@desc Retrieves a specific journal using a unique journal Id.
@required {JournalID: str(uuid) # Unique identifier for a Journal}
@returns(200) {Warnings: [map], Journals: [map]} # Success - return response of type Journals array with specified Journal

@endpoint GET /Journals/{JournalNumber}
@desc Retrieves a specific journal using a unique journal number.
@required {JournalNumber: int # Number of a Journal}
@returns(200) {Warnings: [map], Journals: [map]} # Success - return response of type Journals array with specified Journal

@endgroup

@group LinkedTransactions
@endpoint GET /LinkedTransactions
@desc Retrieves linked transactions (billable expenses)
@optional {page: int # Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1., LinkedTransactionID: str(uuid) # The Xero identifier for an Linked Transaction, SourceTransactionID: str(uuid) # Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice, ContactID: str(uuid) # Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer., Status: str # Filter by the combination of ContactID and Status. Get  the linked transactions associated to a  customer and with a status, TargetTransactionID: str(uuid) # Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice}
@returns(200) {LinkedTransactions: [map]} # Success - return response of type LinkedTransactions array with all LinkedTransaction

@endpoint PUT /LinkedTransactions
@desc Creates linked transactions (billable expenses)
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., SourceTransactionID: str(uuid) # Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice, SourceLineItemID: str(uuid) # The line item identifier from the source transaction., ContactID: str(uuid) # Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED., TargetTransactionID: str(uuid) # Filter by the TargetTransactionID. Get all the linked transactions  allocated to a particular ACCREC invoice, TargetLineItemID: str(uuid) # The line item identifier from the target transaction. It is possible  to link multiple billable expenses to the same TargetLineItemID., LinkedTransactionID: str(uuid) # The Xero identifier for an Linked Transaction e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9, Status: str(APPROVED/DRAFT/ONDRAFT/BILLED/VOIDED) # Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED., Type: str # This will always be BILLABLEEXPENSE. More types may be added in future., UpdatedDateUTC: str # The last modified date in UTC format, SourceTransactionTypeCode: str(ACCPAY/SPEND) # The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction., ValidationErrors: [map{Message: str}] # Displays array of validation error messages from the API}
@returns(200) {LinkedTransactions: [map]} # Success - return response of type LinkedTransactions array with newly created LinkedTransaction
@errors {400: A failed request due to validation error}
@example_request {"LinkedTransactions":[{"SourceTransactionID":"a848644a-f20f-4630-98c3-386bd7505631","SourceLineItemID":"b0df260d-3cc8-4ced-9bd6-41924f624ed3"}]}

@endpoint GET /LinkedTransactions/{LinkedTransactionID}
@desc Retrieves a specific linked transaction (billable expenses) using a unique linked transaction Id
@required {LinkedTransactionID: str(uuid) # Unique identifier for a LinkedTransaction}
@returns(200) {LinkedTransactions: [map]} # Success - return response of type LinkedTransactions array with a specified LinkedTransaction

@endpoint POST /LinkedTransactions/{LinkedTransactionID}
@desc Updates a specific linked transactions (billable expenses)
@required {LinkedTransactionID: str(uuid) # Unique identifier for a LinkedTransaction}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., LinkedTransactions: [map{SourceTransactionID: str(uuid), SourceLineItemID: str(uuid), ContactID: str(uuid), TargetTransactionID: str(uuid), TargetLineItemID: str(uuid), LinkedTransactionID: str(uuid), Status: str, Type: str, UpdatedDateUTC: str, SourceTransactionTypeCode: str, ValidationErrors: [map]}]}
@returns(200) {LinkedTransactions: [map]} # Success - return response of type LinkedTransactions array with updated LinkedTransaction
@errors {400: Success - return response of type LinkedTransactions array with updated LinkedTransaction}
@example_request {"LinkedTransactions":[{"SourceTransactionID":"00000000-0000-0000-0000-000000000000","SourceLineItemID":"00000000-0000-0000-0000-000000000000"}]}

@endpoint DELETE /LinkedTransactions/{LinkedTransactionID}
@desc Deletes a specific linked transactions (billable expenses)
@required {LinkedTransactionID: str(uuid) # Unique identifier for a LinkedTransaction}
@returns(204) Success - return response 204 no content
@errors {400: A failed request due to validation error}

@endgroup

@group ManualJournals
@endpoint GET /ManualJournals
@desc Retrieves manual journals
@optional {If-Modified-Since: str(date-time) # Only records created or modified since this timestamp will be returned, where: str # Filter by an any element, order: str # Order by an any element, page: int # e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment, pageSize: int # Number of records to retrieve per page}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], ManualJournals: [map]} # Success - return response of type ManualJournals array with a all ManualJournals

@endpoint PUT /ManualJournals
@desc Creates one or more manual journals
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, ManualJournals: [map{Narration!: str, JournalLines: [map], Date: str, LineAmountTypes: str, Status: str, Url: str, ShowOnCashBasisReports: bool, HasAttachments: bool, UpdatedDateUTC: str, ManualJournalID: str(uuid), StatusAttributeString: str, Warnings: [map], ValidationErrors: [map], Attachments: [map]}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], ManualJournals: [map]} # Success - return response of type ManualJournals array with newly created ManualJournal
@errors {400: A failed request due to validation error}
@example_request {"ManualJournals":[{"Narration":"Journal Desc","JournalLines":[{"LineAmount":100,"AccountCode":"400","Description":"Money Movement"},{"LineAmount":-100,"AccountCode":"400","Description":"Prepayment of things","Tracking":[{"Name":"North","Option":"Region"}]}],"Date":"2019-03-14"}]}

@endpoint POST /ManualJournals
@desc Updates or creates a single manual journal
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, ManualJournals: [map{Narration!: str, JournalLines: [map], Date: str, LineAmountTypes: str, Status: str, Url: str, ShowOnCashBasisReports: bool, HasAttachments: bool, UpdatedDateUTC: str, ManualJournalID: str(uuid), StatusAttributeString: str, Warnings: [map], ValidationErrors: [map], Attachments: [map]}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], ManualJournals: [map]} # Success - return response of type ManualJournals array with newly created ManualJournal
@errors {400: A failed request due to validation error}
@example_request {"ManualJournals":[{"Narration":"Journal Desc","JournalLines":[{"LineAmount":100,"AccountCode":"400","Description":"Money Movement"},{"LineAmount":-100,"AccountCode":"400","Description":"Prepayment of things","Tracking":[{"Name":"North","Option":"Region"}]}],"Date":"2019-03-14"}]}

@endpoint GET /ManualJournals/{ManualJournalID}
@desc Retrieves a specific manual journal
@required {ManualJournalID: str(uuid) # Unique identifier for a ManualJournal}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], ManualJournals: [map]} # Success - return response of type ManualJournals array with a specified ManualJournals

@endpoint POST /ManualJournals/{ManualJournalID}
@desc Updates a specific manual journal
@required {ManualJournalID: str(uuid) # Unique identifier for a ManualJournal}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, ManualJournals: [map{Narration!: str, JournalLines: [map], Date: str, LineAmountTypes: str, Status: str, Url: str, ShowOnCashBasisReports: bool, HasAttachments: bool, UpdatedDateUTC: str, ManualJournalID: str(uuid), StatusAttributeString: str, Warnings: [map], ValidationErrors: [map], Attachments: [map]}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], ManualJournals: [map]} # Success - return response of type ManualJournals array with an updated ManualJournal
@errors {400: A failed request due to validation error}
@example_request {"ManualJournals":[{"Narration":"Hello Xero","ManualJournalID":"00000000-0000-0000-0000-000000000000","JournalLines":[]}]}

@endpoint GET /ManualJournals/{ManualJournalID}/Attachments
@desc Retrieves attachment for a specific manual journal
@required {ManualJournalID: str(uuid) # Unique identifier for a ManualJournal}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array with all Attachments for a ManualJournals

@endpoint GET /ManualJournals/{ManualJournalID}/Attachments/{AttachmentID}
@desc Allows you to retrieve a specific attachment from a specific manual journal using a unique attachment Id
@required {ManualJournalID: str(uuid) # Unique identifier for a ManualJournal, AttachmentID: str(uuid) # Unique identifier for Attachment object, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for Manual Journal as binary data

@endpoint GET /ManualJournals/{ManualJournalID}/Attachments/{FileName}
@desc Retrieves a specific attachment from a specific manual journal by file name
@required {ManualJournalID: str(uuid) # Unique identifier for a ManualJournal, FileName: str # Name of the attachment, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for Manual Journal as binary data

@endpoint POST /ManualJournals/{ManualJournalID}/Attachments/{FileName}
@desc Updates a specific attachment from a specific manual journal by file name
@required {ManualJournalID: str(uuid) # Unique identifier for a ManualJournal, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array with an update Attachment for a ManualJournals
@errors {400: A failed request due to validation error}

@endpoint PUT /ManualJournals/{ManualJournalID}/Attachments/{FileName}
@desc Creates a specific attachment for a specific manual journal by file name
@required {ManualJournalID: str(uuid) # Unique identifier for a ManualJournal, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array with a newly created Attachment for a ManualJournals
@errors {400: A failed request due to validation error}

@endpoint GET /ManualJournals/{ManualJournalID}/History
@desc Retrieves history for a specific manual journal
@required {ManualJournalID: str(uuid) # Unique identifier for a ManualJournal}
@returns(200) {HistoryRecords: [map]} # Success - return response of HistoryRecords array of 0 to N HistoryRecord

@endpoint PUT /ManualJournals/{ManualJournalID}/History
@desc Creates a history record for a specific manual journal
@required {ManualJournalID: str(uuid) # Unique identifier for a ManualJournal}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]} # Success - return response of type HistoryRecords array of HistoryRecord objects
@errors {400: A failed request due to validation error}
@example_request {"HistoryRecords":[{"Details":"Hello World"}]}

@endgroup

@group Organisation
@endpoint GET /Organisation
@desc Retrieves Xero organisation details
@returns(200) {Organisations: [map]} # Success - return response of type Organisation array with all Organisation

@endpoint GET /Organisation/Actions
@desc Retrieves a list of the key actions your app has permission to perform in the connected Xero organisation.
@returns(200) {Actions: [any]} # Success - return response of type Actions array with all key actions

@endpoint GET /Organisation/{OrganisationID}/CISSettings
@desc Retrieves the CIS settings for the Xero organistaion.
@required {OrganisationID: str(uuid) # The unique Xero identifier for an organisation}
@returns(200) {CISSettings: [any]} # Success - return response of type Organisation array with specified Organisation

@endgroup

@group Overpayments
@endpoint GET /Overpayments
@desc Retrieves overpayments
@optional {If-Modified-Since: str(date-time) # Only records created or modified since this timestamp will be returned, where: str # Filter by an any element, order: str # Order by an any element, page: int # e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment, unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts, pageSize: int # Number of records to retrieve per page, References: [str] # Filter by a comma-separated list of References}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Overpayments: [map]} # Success - return response of type Overpayments array with all Overpayments

@endpoint GET /Overpayments/{OverpaymentID}
@desc Retrieves a specific overpayment using a unique overpayment Id
@required {OverpaymentID: str(uuid) # Unique identifier for a Overpayment}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Overpayments: [map]} # Success - return response of type Overpayments array with specified Overpayments

@endpoint PUT /Overpayments/{OverpaymentID}/Allocations
@desc Creates a single allocation for a specific overpayment
@required {OverpaymentID: str(uuid) # Unique identifier for a Overpayment}
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., Allocations: [map{AllocationID: str(uuid), Invoice!: map, Overpayment: map, Prepayment: map, CreditNote: map, Amount!: num(double), Date!: str, IsDeleted: bool, StatusAttributeString: str, ValidationErrors: [map]}]}
@returns(200) {Allocations: [map]} # Success - return response of type Allocations array with all Allocation for Overpayments
@errors {400: A failed request due to validation error}
@example_request {"Allocations":[{"Invoice":{"InvoiceID":"00000000-0000-0000-0000-000000000000","LineItems":[],"Contact":{},"Type":"ACCPAY"},"Amount":10,"Date":"2019-03-12"}]}

@endpoint DELETE /Overpayments/{OverpaymentID}/Allocations/{AllocationID}
@desc Deletes an Allocation from an overpayment
@required {OverpaymentID: str(uuid) # Unique identifier for a Overpayment, AllocationID: str(uuid) # Unique identifier for Allocation object}
@returns(200) {AllocationID: str(uuid), Invoice: map{Type: str, Contact: map{ContactID: str(uuid), MergedToContactID: str(uuid), ContactNumber: str, AccountNumber: str, ContactStatus: str, Name: str, FirstName: str, LastName: str, CompanyNumber: str, EmailAddress: str, ContactPersons: [map], BankAccountDetails: str, TaxNumber: str, TaxNumberType: str, AccountsReceivableTaxType: str, AccountsPayableTaxType: str, Addresses: [map], Phones: [map], IsSupplier: bool, IsCustomer: bool, SalesDefaultLineAmountType: str, PurchasesDefaultLineAmountType: str, DefaultCurrency: str, XeroNetworkKey: str, SalesDefaultAccountCode: str, PurchasesDefaultAccountCode: str, SalesTrackingCategories: [map], PurchasesTrackingCategories: [map], TrackingCategoryName: str, TrackingCategoryOption: str, PaymentTerms: map{Bills: map, Sales: map}, UpdatedDateUTC: str, ContactGroups: [map], Website: str, BrandingTheme: map{BrandingThemeID: str(uuid), Name: str, LogoUrl: str, Type: str, SortOrder: int, CreatedDateUTC: str}, BatchPayments: any, Discount: num(double), Balances: map{AccountsReceivable: map, AccountsPayable: map}, Attachments: [map], HasAttachments: bool, ValidationErrors: [map], HasValidationErrors: bool, StatusAttributeString: str}, LineItems: [map], Date: str, DueDate: str, LineAmountTypes: str, InvoiceNumber: str, Reference: str, BrandingThemeID: str(uuid), Url: str, CurrencyCode: str, CurrencyRate: num(double), Status: str, SentToContact: bool, ExpectedPaymentDate: str, PlannedPaymentDate: str, CISDeduction: num(double), CISRate: num(double), SubTotal: num(double), TotalTax: num(double), Total: num(double), TotalDiscount: num(double), InvoiceID: str(uuid), RepeatingInvoiceID: str(uuid), HasAttachments: bool, IsDiscounted: bool, Payments: [map], Prepayments: [map], Overpayments: [map], AmountDue: num(double), AmountPaid: num(double), FullyPaidOnDate: str, AmountCredited: num(double), UpdatedDateUTC: str, CreditNotes: [map], Attachments: [map], HasErrors: bool, StatusAttributeString: str, ValidationErrors: [map], Warnings: [map], InvoiceAddresses: [map]}, Overpayment: map{Type: str, Contact: map{ContactID: str(uuid), MergedToContactID: str(uuid), ContactNumber: str, AccountNumber: str, ContactStatus: str, Name: str, FirstName: str, LastName: str, CompanyNumber: str, EmailAddress: str, ContactPersons: [map], BankAccountDetails: str, TaxNumber: str, TaxNumberType: str, AccountsReceivableTaxType: str, AccountsPayableTaxType: str, Addresses: [map], Phones: [map], IsSupplier: bool, IsCustomer: bool, SalesDefaultLineAmountType: str, PurchasesDefaultLineAmountType: str, DefaultCurrency: str, XeroNetworkKey: str, SalesDefaultAccountCode: str, PurchasesDefaultAccountCode: str, SalesTrackingCategories: [map], PurchasesTrackingCategories: [map], TrackingCategoryName: str, TrackingCategoryOption: str, PaymentTerms: map{Bills: map, Sales: map}, UpdatedDateUTC: str, ContactGroups: [map], Website: str, BrandingTheme: map{BrandingThemeID: str(uuid), Name: str, LogoUrl: str, Type: str, SortOrder: int, CreatedDateUTC: str}, BatchPayments: any, Discount: num(double), Balances: map{AccountsReceivable: map, AccountsPayable: map}, Attachments: [map], HasAttachments: bool, ValidationErrors: [map], HasValidationErrors: bool, StatusAttributeString: str}, Date: str, Status: str, LineAmountTypes: str, LineItems: [map], SubTotal: num(double), TotalTax: num(double), Total: num(double), UpdatedDateUTC: str, CurrencyCode: str, OverpaymentID: str(uuid), CurrencyRate: num(double), RemainingCredit: num(double), Allocations: [map], AppliedAmount: num(double), Payments: [map], HasAttachments: bool, Reference: str, Attachments: [map]}, Prepayment: map{Type: str, Contact: map{ContactID: str(uuid), MergedToContactID: str(uuid), ContactNumber: str, AccountNumber: str, ContactStatus: str, Name: str, FirstName: str, LastName: str, CompanyNumber: str, EmailAddress: str, ContactPersons: [map], BankAccountDetails: str, TaxNumber: str, TaxNumberType: str, AccountsReceivableTaxType: str, AccountsPayableTaxType: str, Addresses: [map], Phones: [map], IsSupplier: bool, IsCustomer: bool, SalesDefaultLineAmountType: str, PurchasesDefaultLineAmountType: str, DefaultCurrency: str, XeroNetworkKey: str, SalesDefaultAccountCode: str, PurchasesDefaultAccountCode: str, SalesTrackingCategories: [map], PurchasesTrackingCategories: [map], TrackingCategoryName: str, TrackingCategoryOption: str, PaymentTerms: map{Bills: map, Sales: map}, UpdatedDateUTC: str, ContactGroups: [map], Website: str, BrandingTheme: map{BrandingThemeID: str(uuid), Name: str, LogoUrl: str, Type: str, SortOrder: int, CreatedDateUTC: str}, BatchPayments: any, Discount: num(double), Balances: map{AccountsReceivable: map, AccountsPayable: map}, Attachments: [map], HasAttachments: bool, ValidationErrors: [map], HasValidationErrors: bool, StatusAttributeString: str}, Date: str, Status: str, LineAmountTypes: str, LineItems: [map], SubTotal: num(double), TotalTax: num(double), Total: num(double), Reference: str, InvoiceNumber: str, UpdatedDateUTC: str, CurrencyCode: str, PrepaymentID: str(uuid), CurrencyRate: num(double), RemainingCredit: num(double), Allocations: [map], Payments: [map], AppliedAmount: num(double), HasAttachments: bool, Attachments: [map]}, CreditNote: map{Type: str, Contact: map{ContactID: str(uuid), MergedToContactID: str(uuid), ContactNumber: str, AccountNumber: str, ContactStatus: str, Name: str, FirstName: str, LastName: str, CompanyNumber: str, EmailAddress: str, ContactPersons: [map], BankAccountDetails: str, TaxNumber: str, TaxNumberType: str, AccountsReceivableTaxType: str, AccountsPayableTaxType: str, Addresses: [map], Phones: [map], IsSupplier: bool, IsCustomer: bool, SalesDefaultLineAmountType: str, PurchasesDefaultLineAmountType: str, DefaultCurrency: str, XeroNetworkKey: str, SalesDefaultAccountCode: str, PurchasesDefaultAccountCode: str, SalesTrackingCategories: [map], PurchasesTrackingCategories: [map], TrackingCategoryName: str, TrackingCategoryOption: str, PaymentTerms: map{Bills: map, Sales: map}, UpdatedDateUTC: str, ContactGroups: [map], Website: str, BrandingTheme: map{BrandingThemeID: str(uuid), Name: str, LogoUrl: str, Type: str, SortOrder: int, CreatedDateUTC: str}, BatchPayments: any, Discount: num(double), Balances: map{AccountsReceivable: map, AccountsPayable: map}, Attachments: [map], HasAttachments: bool, ValidationErrors: [map], HasValidationErrors: bool, StatusAttributeString: str}, Date: str, DueDate: str, Status: str, LineAmountTypes: str, LineItems: [map], SubTotal: num(double), TotalTax: num(double), Total: num(double), CISDeduction: num(double), CISRate: num(double), UpdatedDateUTC: str, CurrencyCode: str, FullyPaidOnDate: str, CreditNoteID: str(uuid), CreditNoteNumber: str, Reference: str, SentToContact: bool, CurrencyRate: num(double), RemainingCredit: num(double), Allocations: [map], AppliedAmount: num(double), Payments: [map], BrandingThemeID: str(uuid), StatusAttributeString: str, HasAttachments: bool, HasErrors: bool, ValidationErrors: [map], Warnings: [map], InvoiceAddresses: [map]}, Amount: num(double), Date: str, IsDeleted: bool, StatusAttributeString: str, ValidationErrors: [map]} # Success - return response of type Allocation with the isDeleted flag as true

@endpoint GET /Overpayments/{OverpaymentID}/History
@desc Retrieves history records of a specific overpayment
@required {OverpaymentID: str(uuid) # Unique identifier for a Overpayment}
@returns(200) {HistoryRecords: [map]} # Success - return response of HistoryRecords array of 0 to N HistoryRecord

@endpoint PUT /Overpayments/{OverpaymentID}/History
@desc Creates a history record for a specific overpayment
@required {OverpaymentID: str(uuid) # Unique identifier for a Overpayment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]} # Success - return response of type HistoryRecords array of HistoryRecord objects
@errors {400: A failed request due to validation error - API is not able to create HistoryRecord for Overpayments}
@example_request {"HistoryRecords":[{"Details":"Hello World"}]}

@endgroup

@group Payments
@endpoint GET /Payments
@desc Retrieves payments for invoices and credit notes
@optional {If-Modified-Since: str(date-time) # Only records created or modified since this timestamp will be returned, where: str # Filter by an any element, order: str # Order by an any element, page: int # Up to 100 payments will be returned in a single API call, pageSize: int # Number of records to retrieve per page}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Payments: [map]} # Success - return response of type Payments array for all Payments

@endpoint PUT /Payments
@desc Creates multiple payments for invoices or credit notes
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, Payments: [map{Invoice: map, CreditNote: map, Prepayment: map, Overpayment: map, InvoiceNumber: str, CreditNoteNumber: str, BatchPayment: map, Account: map, Code: str, Date: str, CurrencyRate: num(double), Amount: num(double), BankAmount: num(double), Reference: str, IsReconciled: bool, Status: str, PaymentType: str, UpdatedDateUTC: str, PaymentID: str(uuid), BatchPaymentID: str(uuid), BankAccountNumber: str, Particulars: str, Details: str, HasAccount: bool, HasValidationErrors: bool, StatusAttributeString: str, ValidationErrors: [map], Warnings: [map]}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Payments: [map]} # Success - return response of type Payments array for newly created Payment
@errors {400: A failed request due to validation error}
@example_request {"Payments":[{"Invoice":{"LineItems":[],"InvoiceID":"00000000-0000-0000-0000-000000000000"},"Account":{"Code":"970"},"Date":"2019-03-12","Amount":1}]}

@endpoint POST /Payments
@desc Creates a single payment for invoice or credit notes
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., Invoice: map{Type: str, Contact: map, LineItems: [map], Date: str, DueDate: str, LineAmountTypes: str, InvoiceNumber: str, Reference: str, BrandingThemeID: str(uuid), Url: str, CurrencyCode: str, CurrencyRate: num(double), Status: str, SentToContact: bool, ExpectedPaymentDate: str, PlannedPaymentDate: str, CISDeduction: num(double), CISRate: num(double), SubTotal: num(double), TotalTax: num(double), Total: num(double), TotalDiscount: num(double), InvoiceID: str(uuid), RepeatingInvoiceID: str(uuid), HasAttachments: bool, IsDiscounted: bool, Payments: [map], Prepayments: [map], Overpayments: [map], AmountDue: num(double), AmountPaid: num(double), FullyPaidOnDate: str, AmountCredited: num(double), UpdatedDateUTC: str, CreditNotes: [map], Attachments: [map], HasErrors: bool, StatusAttributeString: str, ValidationErrors: [map], Warnings: [map], InvoiceAddresses: [map]}, CreditNote: map{Type: str, Contact: map, Date: str, DueDate: str, Status: str, LineAmountTypes: str, LineItems: [map], SubTotal: num(double), TotalTax: num(double), Total: num(double), CISDeduction: num(double), CISRate: num(double), UpdatedDateUTC: str, CurrencyCode: str, FullyPaidOnDate: str, CreditNoteID: str(uuid), CreditNoteNumber: str, Reference: str, SentToContact: bool, CurrencyRate: num(double), RemainingCredit: num(double), Allocations: [map], AppliedAmount: num(double), Payments: [map], BrandingThemeID: str(uuid), StatusAttributeString: str, HasAttachments: bool, HasErrors: bool, ValidationErrors: [map], Warnings: [map], InvoiceAddresses: [map]}, Prepayment: map{Type: str, Contact: map, Date: str, Status: str, LineAmountTypes: str, LineItems: [map], SubTotal: num(double), TotalTax: num(double), Total: num(double), Reference: str, InvoiceNumber: str, UpdatedDateUTC: str, CurrencyCode: str, PrepaymentID: str(uuid), CurrencyRate: num(double), RemainingCredit: num(double), Allocations: [map], Payments: [map], AppliedAmount: num(double), HasAttachments: bool, Attachments: [map]}, Overpayment: map{Type: str, Contact: map, Date: str, Status: str, LineAmountTypes: str, LineItems: [map], SubTotal: num(double), TotalTax: num(double), Total: num(double), UpdatedDateUTC: str, CurrencyCode: str, OverpaymentID: str(uuid), CurrencyRate: num(double), RemainingCredit: num(double), Allocations: [map], AppliedAmount: num(double), Payments: [map], HasAttachments: bool, Reference: str, Attachments: [map]}, InvoiceNumber: str # Number of invoice or credit note you are applying payment to e.g.INV-4003, CreditNoteNumber: str # Number of invoice or credit note you are applying payment to e.g. INV-4003, BatchPayment: map{Account: map, Reference: str, Particulars: str, Code: str, Details: str, Narrative: str, BatchPaymentID: str(uuid), DateString: str, Date: str, Amount: num(double), Payments: [map], Type: str, Status: str, TotalAmount: num(double), UpdatedDateUTC: str, IsReconciled: bool, ValidationErrors: [map]}, Account: map{Code: str, Name: str, AccountID: str(uuid), Type: str, BankAccountNumber: str, Status: str, Description: str, BankAccountType: str, CurrencyCode: str, TaxType: str, EnablePaymentsToAccount: bool, ShowInExpenseClaims: bool, Class: str, SystemAccount: str, ReportingCode: str, ReportingCodeName: str, HasAttachments: bool, UpdatedDateUTC: str, AddToWatchlist: bool, ValidationErrors: [map]}, Code: str # Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value), Date: str # Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06, CurrencyRate: num(double) # Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500, Amount: num(double) # The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00, BankAmount: num(double) # The amount of the payment in the currency of the bank account., Reference: str # An optional description for the payment e.g. Direct Debit, IsReconciled: bool # An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET, Status: str(AUTHORISED/DELETED) # The status of the payment., PaymentType: str(ACCRECPAYMENT/ACCPAYPAYMENT/ARCREDITPAYMENT/APCREDITPAYMENT/AROVERPAYMENTPAYMENT/ARPREPAYMENTPAYMENT/APPREPAYMENTPAYMENT/APOVERPAYMENTPAYMENT) # See Payment Types., UpdatedDateUTC: str # UTC timestamp of last update to the payment, PaymentID: str(uuid) # The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9, BatchPaymentID: str(uuid) # Present if the payment was created as part of a batch., BankAccountNumber: str # The suppliers bank account number the payment is being made to, Particulars: str # The suppliers bank account number the payment is being made to, Details: str # The information to appear on the supplier's bank account, HasAccount: bool=false # A boolean to indicate if a contact has an validation errors, HasValidationErrors: bool=false # A boolean to indicate if a contact has an validation errors, StatusAttributeString: str # A string to indicate if a invoice status, ValidationErrors: [map{Message: str}] # Displays array of validation error messages from the API, Warnings: [map{Message: str}] # Displays array of warning messages from the API}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Payments: [map]} # Success - return response of type Payments array for newly created Payment
@errors {400: A failed request due to validation error}
@example_request {"Payments":[{"Invoice":{"LineItems":[],"InvoiceID":"00000000-0000-0000-0000-000000000000"},"Account":{"Code":"970"},"Date":"2019-03-12","Amount":1}]}

@endpoint GET /Payments/{PaymentID}
@desc Retrieves a specific payment for invoices and credit notes using a unique payment Id
@required {PaymentID: str(uuid) # Unique identifier for a Payment}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Payments: [map]} # Success - return response of type Payments array for specified Payment

@endpoint POST /Payments/{PaymentID}
@desc Updates a specific payment for invoices and credit notes
@required {PaymentID: str(uuid) # Unique identifier for a Payment, Status: str=DELETED # The status of the payment.}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Payments: [map]} # Success - return response of type Payments array for updated Payment
@errors {400: A failed request due to validation error}
@example_request {"Payments":[{"Status":"DELETED"}]}

@endpoint GET /Payments/{PaymentID}/History
@desc Retrieves history records of a specific payment
@required {PaymentID: str(uuid) # Unique identifier for a Payment}
@returns(200) {HistoryRecords: [map]} # Success - return response of HistoryRecords array of 0 to N HistoryRecord

@endpoint PUT /Payments/{PaymentID}/History
@desc Creates a history record for a specific payment
@required {PaymentID: str(uuid) # Unique identifier for a Payment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]} # Success - return response of type HistoryRecords array of HistoryRecord objects
@errors {400: A failed request due to validation error - API is not able to create HistoryRecord for Payments}
@example_request {"HistoryRecords":[{"Details":"Hello World"}]}

@endgroup

@group PaymentServices
@endpoint GET /PaymentServices
@desc Retrieves payment services
@returns(200) {PaymentServices: [any]} # Success - return response of type PaymentServices array for all PaymentService

@endpoint PUT /PaymentServices
@desc Creates a payment service
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., PaymentServices: [any]}
@returns(200) {PaymentServices: [any]} # Success - return response of type PaymentServices array for newly created PaymentService
@errors {400: A failed request due to validation error}
@example_request {"PaymentServices":[{"PaymentServiceName":"PayUpNow","PaymentServiceUrl":"https://www.payupnow.com/","PayNowText":"Time To Pay"}]}

@endgroup

@group Prepayments
@endpoint GET /Prepayments
@desc Retrieves prepayments
@optional {If-Modified-Since: str(date-time) # Only records created or modified since this timestamp will be returned, where: str # Filter by an any element, order: str # Order by an any element, page: int # e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment, unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts, pageSize: int # Number of records to retrieve per page, InvoiceNumbers: [str] # Filter by a comma-separated list of InvoiceNumbers}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Prepayments: [map]} # Success - return response of type Prepayments array for all Prepayment

@endpoint GET /Prepayments/{PrepaymentID}
@desc Allows you to retrieve a specified prepayments
@required {PrepaymentID: str(uuid) # Unique identifier for a PrePayment}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Prepayments: [map]} # Success - return response of type Prepayments array for a specified Prepayment

@endpoint PUT /Prepayments/{PrepaymentID}/Allocations
@desc Allows you to create an Allocation for prepayments
@required {PrepaymentID: str(uuid) # Unique identifier for a PrePayment}
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., Allocations: [map{AllocationID: str(uuid), Invoice!: map, Overpayment: map, Prepayment: map, CreditNote: map, Amount!: num(double), Date!: str, IsDeleted: bool, StatusAttributeString: str, ValidationErrors: [map]}]}
@returns(200) {Allocations: [map]} # Success - return response of type Allocations array of Allocation for all Prepayment
@errors {400: A failed request due to validation error}
@example_request {"Allocations":[{"Invoice":{"LineItems":[],"InvoiceID":"00000000-0000-0000-0000-000000000000"},"Amount":1,"Date":"2019-01-10"}]}

@endpoint DELETE /Prepayments/{PrepaymentID}/Allocations/{AllocationID}
@desc Deletes an Allocation from a Prepayment
@required {PrepaymentID: str(uuid) # Unique identifier for a PrePayment, AllocationID: str(uuid) # Unique identifier for Allocation object}
@returns(200) {AllocationID: str(uuid), Invoice: map{Type: str, Contact: map{ContactID: str(uuid), MergedToContactID: str(uuid), ContactNumber: str, AccountNumber: str, ContactStatus: str, Name: str, FirstName: str, LastName: str, CompanyNumber: str, EmailAddress: str, ContactPersons: [map], BankAccountDetails: str, TaxNumber: str, TaxNumberType: str, AccountsReceivableTaxType: str, AccountsPayableTaxType: str, Addresses: [map], Phones: [map], IsSupplier: bool, IsCustomer: bool, SalesDefaultLineAmountType: str, PurchasesDefaultLineAmountType: str, DefaultCurrency: str, XeroNetworkKey: str, SalesDefaultAccountCode: str, PurchasesDefaultAccountCode: str, SalesTrackingCategories: [map], PurchasesTrackingCategories: [map], TrackingCategoryName: str, TrackingCategoryOption: str, PaymentTerms: map{Bills: map, Sales: map}, UpdatedDateUTC: str, ContactGroups: [map], Website: str, BrandingTheme: map{BrandingThemeID: str(uuid), Name: str, LogoUrl: str, Type: str, SortOrder: int, CreatedDateUTC: str}, BatchPayments: any, Discount: num(double), Balances: map{AccountsReceivable: map, AccountsPayable: map}, Attachments: [map], HasAttachments: bool, ValidationErrors: [map], HasValidationErrors: bool, StatusAttributeString: str}, LineItems: [map], Date: str, DueDate: str, LineAmountTypes: str, InvoiceNumber: str, Reference: str, BrandingThemeID: str(uuid), Url: str, CurrencyCode: str, CurrencyRate: num(double), Status: str, SentToContact: bool, ExpectedPaymentDate: str, PlannedPaymentDate: str, CISDeduction: num(double), CISRate: num(double), SubTotal: num(double), TotalTax: num(double), Total: num(double), TotalDiscount: num(double), InvoiceID: str(uuid), RepeatingInvoiceID: str(uuid), HasAttachments: bool, IsDiscounted: bool, Payments: [map], Prepayments: [map], Overpayments: [map], AmountDue: num(double), AmountPaid: num(double), FullyPaidOnDate: str, AmountCredited: num(double), UpdatedDateUTC: str, CreditNotes: [map], Attachments: [map], HasErrors: bool, StatusAttributeString: str, ValidationErrors: [map], Warnings: [map], InvoiceAddresses: [map]}, Overpayment: map{Type: str, Contact: map{ContactID: str(uuid), MergedToContactID: str(uuid), ContactNumber: str, AccountNumber: str, ContactStatus: str, Name: str, FirstName: str, LastName: str, CompanyNumber: str, EmailAddress: str, ContactPersons: [map], BankAccountDetails: str, TaxNumber: str, TaxNumberType: str, AccountsReceivableTaxType: str, AccountsPayableTaxType: str, Addresses: [map], Phones: [map], IsSupplier: bool, IsCustomer: bool, SalesDefaultLineAmountType: str, PurchasesDefaultLineAmountType: str, DefaultCurrency: str, XeroNetworkKey: str, SalesDefaultAccountCode: str, PurchasesDefaultAccountCode: str, SalesTrackingCategories: [map], PurchasesTrackingCategories: [map], TrackingCategoryName: str, TrackingCategoryOption: str, PaymentTerms: map{Bills: map, Sales: map}, UpdatedDateUTC: str, ContactGroups: [map], Website: str, BrandingTheme: map{BrandingThemeID: str(uuid), Name: str, LogoUrl: str, Type: str, SortOrder: int, CreatedDateUTC: str}, BatchPayments: any, Discount: num(double), Balances: map{AccountsReceivable: map, AccountsPayable: map}, Attachments: [map], HasAttachments: bool, ValidationErrors: [map], HasValidationErrors: bool, StatusAttributeString: str}, Date: str, Status: str, LineAmountTypes: str, LineItems: [map], SubTotal: num(double), TotalTax: num(double), Total: num(double), UpdatedDateUTC: str, CurrencyCode: str, OverpaymentID: str(uuid), CurrencyRate: num(double), RemainingCredit: num(double), Allocations: [map], AppliedAmount: num(double), Payments: [map], HasAttachments: bool, Reference: str, Attachments: [map]}, Prepayment: map{Type: str, Contact: map{ContactID: str(uuid), MergedToContactID: str(uuid), ContactNumber: str, AccountNumber: str, ContactStatus: str, Name: str, FirstName: str, LastName: str, CompanyNumber: str, EmailAddress: str, ContactPersons: [map], BankAccountDetails: str, TaxNumber: str, TaxNumberType: str, AccountsReceivableTaxType: str, AccountsPayableTaxType: str, Addresses: [map], Phones: [map], IsSupplier: bool, IsCustomer: bool, SalesDefaultLineAmountType: str, PurchasesDefaultLineAmountType: str, DefaultCurrency: str, XeroNetworkKey: str, SalesDefaultAccountCode: str, PurchasesDefaultAccountCode: str, SalesTrackingCategories: [map], PurchasesTrackingCategories: [map], TrackingCategoryName: str, TrackingCategoryOption: str, PaymentTerms: map{Bills: map, Sales: map}, UpdatedDateUTC: str, ContactGroups: [map], Website: str, BrandingTheme: map{BrandingThemeID: str(uuid), Name: str, LogoUrl: str, Type: str, SortOrder: int, CreatedDateUTC: str}, BatchPayments: any, Discount: num(double), Balances: map{AccountsReceivable: map, AccountsPayable: map}, Attachments: [map], HasAttachments: bool, ValidationErrors: [map], HasValidationErrors: bool, StatusAttributeString: str}, Date: str, Status: str, LineAmountTypes: str, LineItems: [map], SubTotal: num(double), TotalTax: num(double), Total: num(double), Reference: str, InvoiceNumber: str, UpdatedDateUTC: str, CurrencyCode: str, PrepaymentID: str(uuid), CurrencyRate: num(double), RemainingCredit: num(double), Allocations: [map], Payments: [map], AppliedAmount: num(double), HasAttachments: bool, Attachments: [map]}, CreditNote: map{Type: str, Contact: map{ContactID: str(uuid), MergedToContactID: str(uuid), ContactNumber: str, AccountNumber: str, ContactStatus: str, Name: str, FirstName: str, LastName: str, CompanyNumber: str, EmailAddress: str, ContactPersons: [map], BankAccountDetails: str, TaxNumber: str, TaxNumberType: str, AccountsReceivableTaxType: str, AccountsPayableTaxType: str, Addresses: [map], Phones: [map], IsSupplier: bool, IsCustomer: bool, SalesDefaultLineAmountType: str, PurchasesDefaultLineAmountType: str, DefaultCurrency: str, XeroNetworkKey: str, SalesDefaultAccountCode: str, PurchasesDefaultAccountCode: str, SalesTrackingCategories: [map], PurchasesTrackingCategories: [map], TrackingCategoryName: str, TrackingCategoryOption: str, PaymentTerms: map{Bills: map, Sales: map}, UpdatedDateUTC: str, ContactGroups: [map], Website: str, BrandingTheme: map{BrandingThemeID: str(uuid), Name: str, LogoUrl: str, Type: str, SortOrder: int, CreatedDateUTC: str}, BatchPayments: any, Discount: num(double), Balances: map{AccountsReceivable: map, AccountsPayable: map}, Attachments: [map], HasAttachments: bool, ValidationErrors: [map], HasValidationErrors: bool, StatusAttributeString: str}, Date: str, DueDate: str, Status: str, LineAmountTypes: str, LineItems: [map], SubTotal: num(double), TotalTax: num(double), Total: num(double), CISDeduction: num(double), CISRate: num(double), UpdatedDateUTC: str, CurrencyCode: str, FullyPaidOnDate: str, CreditNoteID: str(uuid), CreditNoteNumber: str, Reference: str, SentToContact: bool, CurrencyRate: num(double), RemainingCredit: num(double), Allocations: [map], AppliedAmount: num(double), Payments: [map], BrandingThemeID: str(uuid), StatusAttributeString: str, HasAttachments: bool, HasErrors: bool, ValidationErrors: [map], Warnings: [map], InvoiceAddresses: [map]}, Amount: num(double), Date: str, IsDeleted: bool, StatusAttributeString: str, ValidationErrors: [map]} # Success - return response of type Allocation with the isDeleted flag as true

@endpoint GET /Prepayments/{PrepaymentID}/History
@desc Retrieves history record for a specific prepayment
@required {PrepaymentID: str(uuid) # Unique identifier for a PrePayment}
@returns(200) {HistoryRecords: [map]} # Success - return response of HistoryRecords array of 0 to N HistoryRecord

@endpoint PUT /Prepayments/{PrepaymentID}/History
@desc Creates a history record for a specific prepayment
@required {PrepaymentID: str(uuid) # Unique identifier for a PrePayment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]} # Success - return response of type HistoryRecords array of HistoryRecord objects
@errors {400: Unsupported - return response incorrect exception, API is not able to create HistoryRecord for Expense Claims}
@example_request {"HistoryRecords":[{"Details":"Hello World"}]}

@endgroup

@group PurchaseOrders
@endpoint GET /PurchaseOrders
@desc Retrieves purchase orders
@optional {If-Modified-Since: str(date-time) # Only records created or modified since this timestamp will be returned, Status: str(DRAFT/SUBMITTED/AUTHORISED/BILLED/DELETED) # Filter by purchase order status, DateFrom: str # Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31, DateTo: str # Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31, order: str # Order by an any element, page: int # To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned., pageSize: int # Number of records to retrieve per page}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], PurchaseOrders: [map]} # Success - return response of type PurchaseOrder array of all PurchaseOrder

@endpoint PUT /PurchaseOrders
@desc Creates one or more purchase orders
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, PurchaseOrders: [map{Contact: map, LineItems: [map], Date: str, DeliveryDate: str, LineAmountTypes: str, PurchaseOrderNumber: str, Reference: str, BrandingThemeID: str(uuid), CurrencyCode: str, Status: str, SentToContact: bool, DeliveryAddress: str, AttentionTo: str, Telephone: str, DeliveryInstructions: str, ExpectedArrivalDate: str, PurchaseOrderID: str(uuid), CurrencyRate: num(double), SubTotal: num(double), TotalTax: num(double), Total: num(double), TotalDiscount: num(double), HasAttachments: bool, UpdatedDateUTC: str, StatusAttributeString: str, ValidationErrors: [map], Warnings: [map], Attachments: [map]}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], PurchaseOrders: [map]} # Success - return response of type PurchaseOrder array for specified PurchaseOrder
@errors {400: A failed request due to validation error}
@example_request {"PurchaseOrders":[{"Contact":{"ContactID":"00000000-0000-0000-0000-000000000000"},"LineItems":[{"Description":"Foobar","Quantity":1,"UnitAmount":20,"AccountCode":"710"}],"Date":"2019-03-13"}]}

@endpoint POST /PurchaseOrders
@desc Updates or creates one or more purchase orders
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, PurchaseOrders: [map{Contact: map, LineItems: [map], Date: str, DeliveryDate: str, LineAmountTypes: str, PurchaseOrderNumber: str, Reference: str, BrandingThemeID: str(uuid), CurrencyCode: str, Status: str, SentToContact: bool, DeliveryAddress: str, AttentionTo: str, Telephone: str, DeliveryInstructions: str, ExpectedArrivalDate: str, PurchaseOrderID: str(uuid), CurrencyRate: num(double), SubTotal: num(double), TotalTax: num(double), Total: num(double), TotalDiscount: num(double), HasAttachments: bool, UpdatedDateUTC: str, StatusAttributeString: str, ValidationErrors: [map], Warnings: [map], Attachments: [map]}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], PurchaseOrders: [map]} # Success - return response of type PurchaseOrder array for specified PurchaseOrder
@errors {400: A failed request due to validation error}
@example_request {"PurchaseOrders":[{"Contact":{"ContactID":"00000000-0000-0000-0000-000000000000"},"LineItems":[{"Description":"Foobar","Quantity":1,"UnitAmount":20,"AccountCode":"710"}],"Date":"2019-03-13"}]}

@endpoint GET /PurchaseOrders/{PurchaseOrderID}/pdf
@desc Retrieves specific purchase order as PDF files using a unique purchase order Id
@required {PurchaseOrderID: str(uuid) # Unique identifier for an Purchase Order}
@returns(200) Success - return response of byte array pdf version of specified Purchase Orders

@endpoint GET /PurchaseOrders/{PurchaseOrderID}
@desc Retrieves a specific purchase order using a unique purchase order Id
@required {PurchaseOrderID: str(uuid) # Unique identifier for an Purchase Order}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], PurchaseOrders: [map]} # Success - return response of type PurchaseOrder array for specified PurchaseOrder

@endpoint POST /PurchaseOrders/{PurchaseOrderID}
@desc Updates a specific purchase order
@required {PurchaseOrderID: str(uuid) # Unique identifier for an Purchase Order}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}] # Displays array of warning messages from the API, PurchaseOrders: [map{Contact: map, LineItems: [map], Date: str, DeliveryDate: str, LineAmountTypes: str, PurchaseOrderNumber: str, Reference: str, BrandingThemeID: str(uuid), CurrencyCode: str, Status: str, SentToContact: bool, DeliveryAddress: str, AttentionTo: str, Telephone: str, DeliveryInstructions: str, ExpectedArrivalDate: str, PurchaseOrderID: str(uuid), CurrencyRate: num(double), SubTotal: num(double), TotalTax: num(double), Total: num(double), TotalDiscount: num(double), HasAttachments: bool, UpdatedDateUTC: str, StatusAttributeString: str, ValidationErrors: [map], Warnings: [map], Attachments: [map]}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], PurchaseOrders: [map]} # Success - return response of type PurchaseOrder array for updated PurchaseOrder
@errors {400: A failed request due to validation error}
@example_request {"PurchaseOrders":[{"AttentionTo":"Peter Parker","LineItems":[],"Contact":{}}]}

@endpoint GET /PurchaseOrders/{PurchaseOrderNumber}
@desc Retrieves a specific purchase order using purchase order number
@required {PurchaseOrderNumber: str # Unique identifier for a PurchaseOrder}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], PurchaseOrders: [map]} # Success - return response of type PurchaseOrder array for specified PurchaseOrder

@endpoint GET /PurchaseOrders/{PurchaseOrderID}/History
@desc Retrieves history for a specific purchase order
@required {PurchaseOrderID: str(uuid) # Unique identifier for an Purchase Order}
@returns(200) {HistoryRecords: [map]} # Success - return response of HistoryRecords array of 0 to N HistoryRecord

@endpoint PUT /PurchaseOrders/{PurchaseOrderID}/History
@desc Creates a history record for a specific purchase orders
@required {PurchaseOrderID: str(uuid) # Unique identifier for an Purchase Order}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]} # Success - return response of type HistoryRecords array of HistoryRecord objects
@errors {400: A failed request due to validation error}
@example_request {"HistoryRecords":[{"Details":"Hello World"}]}

@endpoint GET /PurchaseOrders/{PurchaseOrderID}/Attachments
@desc Retrieves attachments for a specific purchase order
@required {PurchaseOrderID: str(uuid) # Unique identifier for an Purchase Order}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array of Purchase Orders

@endpoint GET /PurchaseOrders/{PurchaseOrderID}/Attachments/{AttachmentID}
@desc Retrieves specific attachment for a specific purchase order using a unique attachment Id
@required {PurchaseOrderID: str(uuid) # Unique identifier for an Purchase Order, AttachmentID: str(uuid) # Unique identifier for Attachment object, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for Account as binary data

@endpoint GET /PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}
@desc Retrieves a specific attachment for a specific purchase order by filename
@required {PurchaseOrderID: str(uuid) # Unique identifier for an Purchase Order, FileName: str # Name of the attachment, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for Purchase Order as binary data

@endpoint POST /PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}
@desc Updates a specific attachment for a specific purchase order by filename
@required {PurchaseOrderID: str(uuid) # Unique identifier for an Purchase Order, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array of Attachment
@errors {400: Validation Error - some data was incorrect returns response of type Error}

@endpoint PUT /PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}
@desc Creates attachment for a specific purchase order
@required {PurchaseOrderID: str(uuid) # Unique identifier for an Purchase Order, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array of Attachment
@errors {400: A failed request due to validation error}

@endgroup

@group Quotes
@endpoint GET /Quotes
@desc Retrieves sales quotes
@optional {If-Modified-Since: str(date-time) # Only records created or modified since this timestamp will be returned, DateFrom: str(date) # Filter for quotes after a particular date, DateTo: str(date) # Filter for quotes before a particular date, ExpiryDateFrom: str(date) # Filter for quotes expiring after a particular date, ExpiryDateTo: str(date) # Filter for quotes before a particular date, ContactID: str(uuid) # Filter for quotes belonging to a particular contact, Status: str # Filter for quotes of a particular Status, page: int # e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote, order: str # Order by an any element, QuoteNumber: str # Filter by quote number (e.g. GET https://.../Quotes?QuoteNumber=QU-0001)}
@returns(200) {Quotes: [map]} # Success - return response of type quotes array with all quotes

@endpoint PUT /Quotes
@desc Create one or more quotes
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., Quotes: [map{QuoteID: str(uuid), QuoteNumber: str, Reference: str, Terms: str, Contact: map, LineItems: [map], Date: str, DateString: str, ExpiryDate: str, ExpiryDateString: str, Status: str, CurrencyCode: str, CurrencyRate: num(double), SubTotal: num(double), TotalTax: num(double), Total: num(double), TotalDiscount: num(double), Title: str, Summary: str, BrandingThemeID: str(uuid), UpdatedDateUTC: str, LineAmountTypes: str, StatusAttributeString: str, ValidationErrors: [map]}]}
@returns(200) {Quotes: [map]} # Success - return response of type Quotes with array with newly created Quote
@errors {400: A failed request due to validation error}
@example_request {"Quotes":[{"Contact":{"ContactID":"00000000-0000-0000-0000-000000000000"},"LineItems":[{"Description":"Foobar","Quantity":1,"UnitAmount":20,"AccountCode":"12775"}],"Date":"2020-02-01"}]}

@endpoint POST /Quotes
@desc Updates or creates one or more quotes
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., Quotes: [map{QuoteID: str(uuid), QuoteNumber: str, Reference: str, Terms: str, Contact: map, LineItems: [map], Date: str, DateString: str, ExpiryDate: str, ExpiryDateString: str, Status: str, CurrencyCode: str, CurrencyRate: num(double), SubTotal: num(double), TotalTax: num(double), Total: num(double), TotalDiscount: num(double), Title: str, Summary: str, BrandingThemeID: str(uuid), UpdatedDateUTC: str, LineAmountTypes: str, StatusAttributeString: str, ValidationErrors: [map]}]}
@returns(200) {Quotes: [map]} # Success - return response of type Quotes array with updated or created Quote
@errors {400: A failed request due to validation error}
@example_request {"Quotes":[{"Contact":{"ContactID":"00000000-0000-0000-0000-000000000000"},"LineItems":[{"Description":"Foobar","Quantity":1,"UnitAmount":20,"AccountCode":"12775"}],"Date":"2020-02-01"}]}

@endpoint GET /Quotes/{QuoteID}
@desc Retrieves a specific quote using a unique quote Id
@required {QuoteID: str(uuid) # Unique identifier for an Quote}
@returns(200) {Quotes: [map]} # Success - return response of type Quotes array with specified Quote

@endpoint POST /Quotes/{QuoteID}
@desc Updates a specific quote
@required {QuoteID: str(uuid) # Unique identifier for an Quote}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., Quotes: [map{QuoteID: str(uuid), QuoteNumber: str, Reference: str, Terms: str, Contact: map, LineItems: [map], Date: str, DateString: str, ExpiryDate: str, ExpiryDateString: str, Status: str, CurrencyCode: str, CurrencyRate: num(double), SubTotal: num(double), TotalTax: num(double), Total: num(double), TotalDiscount: num(double), Title: str, Summary: str, BrandingThemeID: str(uuid), UpdatedDateUTC: str, LineAmountTypes: str, StatusAttributeString: str, ValidationErrors: [map]}]}
@returns(200) {Quotes: [map]} # Success - return response of type Quotes array with updated Quote
@errors {400: A failed request due to validation error}
@example_request {"Quotes":[{"Reference":"I am an update","Contact":{"ContactID":"00000000-0000-0000-0000-000000000000"},"Date":"2020-02-01"}]}

@endpoint GET /Quotes/{QuoteID}/History
@desc Retrieves history records of a specific quote
@required {QuoteID: str(uuid) # Unique identifier for an Quote}
@returns(200) {HistoryRecords: [map]} # Success - return response of HistoryRecords array of 0 to N HistoryRecord

@endpoint PUT /Quotes/{QuoteID}/History
@desc Creates a history record for a specific quote
@required {QuoteID: str(uuid) # Unique identifier for an Quote}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]} # Success - return response of type HistoryRecords array of HistoryRecord objects
@errors {400: A failed request due to validation error}
@example_request {"HistoryRecords":[{"Details":"Hello World"}]}

@endpoint GET /Quotes/{QuoteID}/pdf
@desc Retrieves a specific quote as a PDF file using a unique quote Id
@required {QuoteID: str(uuid) # Unique identifier for an Quote}
@returns(200) Success - return response of byte array pdf version of specified Quotes

@endpoint GET /Quotes/{QuoteID}/Attachments
@desc Retrieves attachments for a specific quote
@required {QuoteID: str(uuid) # Unique identifier for an Quote}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array of Attachment

@endpoint GET /Quotes/{QuoteID}/Attachments/{AttachmentID}
@desc Retrieves a specific attachment from a specific quote using a unique attachment Id
@required {QuoteID: str(uuid) # Unique identifier for an Quote, AttachmentID: str(uuid) # Unique identifier for Attachment object, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for Quote as binary data

@endpoint GET /Quotes/{QuoteID}/Attachments/{FileName}
@desc Retrieves a specific attachment from a specific quote by filename
@required {QuoteID: str(uuid) # Unique identifier for an Quote, FileName: str # Name of the attachment, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for Quote as binary data

@endpoint POST /Quotes/{QuoteID}/Attachments/{FileName}
@desc Updates a specific attachment from a specific quote by filename
@required {QuoteID: str(uuid) # Unique identifier for an Quote, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array of Attachment
@errors {400: Validation Error - some data was incorrect returns response of type Error}

@endpoint PUT /Quotes/{QuoteID}/Attachments/{FileName}
@desc Creates attachment for a specific quote
@required {QuoteID: str(uuid) # Unique identifier for an Quote, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array of Attachment
@errors {400: A failed request due to validation error}

@endgroup

@group Receipts
@endpoint GET /Receipts
@desc Retrieves draft expense claim receipts for any user
@optional {If-Modified-Since: str(date-time) # Only records created or modified since this timestamp will be returned, where: str # Filter by an any element, order: str # Order by an any element, unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts}
@returns(200) {Receipts: [map]} # Success - return response of type Receipts array for all Receipt

@endpoint PUT /Receipts
@desc Creates draft expense claim receipts for any user
@optional {unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., Receipts: [map{Date: str, Contact: map, LineItems: [map], User: map, Reference: str, LineAmountTypes: str, SubTotal: num(double), TotalTax: num(double), Total: num(double), ReceiptID: str(uuid), Status: str, ReceiptNumber: str, UpdatedDateUTC: str, HasAttachments: bool, Url: str, ValidationErrors: [map], Warnings: [map], Attachments: [map]}]}
@returns(200) {Receipts: [map]} # Success - return response of type Receipts array for newly created Receipt
@errors {400: A failed request due to validation error}
@example_request {"Receipts":[{"Contact":{"ContactID":"00000000-0000-0000-0000-000000000000"},"Lineitems":[{"Description":"Foobar","Quantity":2,"UnitAmount":20,"AccountCode":"400","TaxType":"NONE","LineAmount":40}],"User":{"UserID":"00000000-0000-0000-0000-000000000000"},"LineAmountTypes":"NoTax","Status":"DRAFT"}]}

@endpoint GET /Receipts/{ReceiptID}
@desc Retrieves a specific draft expense claim receipt by using a unique receipt Id
@required {ReceiptID: str(uuid) # Unique identifier for a Receipt}
@optional {unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts}
@returns(200) {Receipts: [map]} # Success - return response of type Receipts array for a specified Receipt

@endpoint POST /Receipts/{ReceiptID}
@desc Updates a specific draft expense claim receipts
@required {ReceiptID: str(uuid) # Unique identifier for a Receipt}
@optional {unitdp: int # e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., Receipts: [map{Date: str, Contact: map, LineItems: [map], User: map, Reference: str, LineAmountTypes: str, SubTotal: num(double), TotalTax: num(double), Total: num(double), ReceiptID: str(uuid), Status: str, ReceiptNumber: str, UpdatedDateUTC: str, HasAttachments: bool, Url: str, ValidationErrors: [map], Warnings: [map], Attachments: [map]}]}
@returns(200) {Receipts: [map]} # Success - return response of type Receipts array for updated Receipt
@errors {400: A failed request due to validation error}
@example_request {"Receipts":[{"Lineitems":[],"User":{"UserID":"00000000-0000-0000-0000-000000000000"},"Reference":"Foobar"}]}

@endpoint GET /Receipts/{ReceiptID}/Attachments
@desc Retrieves attachments for a specific expense claim receipt
@required {ReceiptID: str(uuid) # Unique identifier for a Receipt}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array of Attachments for a specified Receipt

@endpoint GET /Receipts/{ReceiptID}/Attachments/{AttachmentID}
@desc Retrieves a specific attachments from a specific expense claim receipts by using a unique attachment Id
@required {ReceiptID: str(uuid) # Unique identifier for a Receipt, AttachmentID: str(uuid) # Unique identifier for Attachment object, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for Receipt as binary data

@endpoint GET /Receipts/{ReceiptID}/Attachments/{FileName}
@desc Retrieves a specific attachment from a specific expense claim receipts by file name
@required {ReceiptID: str(uuid) # Unique identifier for a Receipt, FileName: str # Name of the attachment, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for Receipt as binary data

@endpoint POST /Receipts/{ReceiptID}/Attachments/{FileName}
@desc Updates a specific attachment on a specific expense claim receipts by file name
@required {ReceiptID: str(uuid) # Unique identifier for a Receipt, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array with updated Attachment for a specified Receipt
@errors {400: A failed request due to validation error}

@endpoint PUT /Receipts/{ReceiptID}/Attachments/{FileName}
@desc Creates an attachment on a specific expense claim receipts by file name
@required {ReceiptID: str(uuid) # Unique identifier for a Receipt, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array with newly created Attachment for a specified Receipt
@errors {400: A failed request due to validation error}

@endpoint GET /Receipts/{ReceiptID}/History
@desc Retrieves a history record for a specific receipt
@required {ReceiptID: str(uuid) # Unique identifier for a Receipt}
@returns(200) {HistoryRecords: [map]} # Success - return response of HistoryRecords array of 0 to N HistoryRecord

@endpoint PUT /Receipts/{ReceiptID}/History
@desc Creates a history record for a specific receipt
@required {ReceiptID: str(uuid) # Unique identifier for a Receipt}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]} # Success - return response of type HistoryRecords array of HistoryRecord objects
@errors {400: Unsupported - return response incorrect exception, API is not able to create HistoryRecord for Receipts}
@example_request {"HistoryRecords":[{"Details":"Hello World"}]}

@endgroup

@group RepeatingInvoices
@endpoint GET /RepeatingInvoices
@desc Retrieves repeating invoices
@optional {where: str # Filter by an any element, order: str # Order by an any element}
@returns(200) {RepeatingInvoices: [map]} # Success - return response of type Repeating Invoices array for all Repeating Invoice

@endpoint PUT /RepeatingInvoices
@desc Creates one or more repeating invoice templates
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., RepeatingInvoices: [map{Type: str, Contact: map, Schedule: map, LineItems: [map], LineAmountTypes: str, Reference: str, BrandingThemeID: str(uuid), CurrencyCode: str, Status: str, SubTotal: num(double), TotalTax: num(double), Total: num(double), RepeatingInvoiceID: str(uuid), ID: str(uuid), HasAttachments: bool, Attachments: [map], ApprovedForSending: bool, SendCopy: bool, MarkAsSent: bool, IncludePDF: bool}]}
@returns(200) {RepeatingInvoices: [map]} # Success - return response of type RepeatingInvoices array with newly created RepeatingInvoice
@errors {400: A failed request due to validation error}
@example_request {"RepeatingInvoices":[{"Schedule":{"Period":1,"Unit":"MONTHLY","DueDate":10,"DueDateType":"OFFOLLOWINGMONTH","StartDate":"/Date(1555286400000+0000)/"},"Type":"ACCREC","Reference":"[Week]","ApprovedForSending":false,"SendCopy":false,"MarkAsSent":false,"IncludePDF":false,"Contact":{"ContactID":"430fa14a-f945-44d3-9f97-5df5e28441b8","Name":"Liam Gallagher"},"Status":"AUTHORISED","LineAmountTypes":"Exclusive","LineItems":[{"Description":"Guitars Fender Strat","UnitAmount":5000,"TaxType":"OUTPUT2","TaxAmount":750,"LineAmount":5000,"AccountCode":"200","Tracking":[],"Quantity":1,"LineItemID":"13a8353c-d2af-4d5b-920c-438449f08900","DiscountEnteredAsPercent":true}],"CurrencyCode":"NZD"}]}

@endpoint POST /RepeatingInvoices
@desc Creates or deletes one or more repeating invoice templates
@optional {summarizeErrors: bool=false # If false return 200 OK and mix of successfully created objects and any with validation errors, Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., RepeatingInvoices: [map{Type: str, Contact: map, Schedule: map, LineItems: [map], LineAmountTypes: str, Reference: str, BrandingThemeID: str(uuid), CurrencyCode: str, Status: str, SubTotal: num(double), TotalTax: num(double), Total: num(double), RepeatingInvoiceID: str(uuid), ID: str(uuid), HasAttachments: bool, Attachments: [map], ApprovedForSending: bool, SendCopy: bool, MarkAsSent: bool, IncludePDF: bool}]}
@returns(200) {RepeatingInvoices: [map]} # Success - return response of type RepeatingInvoices array with newly created RepeatingInvoice
@errors {400: A failed request due to validation error}
@example_request {"RepeatingInvoices":[{"Schedule":{"Period":1,"Unit":"MONTHLY","DueDate":10,"DueDateType":"OFFOLLOWINGMONTH","StartDate":"/Date(1555286400000+0000)/"},"Type":"ACCREC","Reference":"[Week]","ApprovedForSending":false,"SendCopy":false,"MarkAsSent":false,"IncludePDF":false,"Contact":{"ContactID":"430fa14a-f945-44d3-9f97-5df5e28441b8","Name":"Liam Gallagher"},"Status":"AUTHORISED","LineAmountTypes":"Exclusive","LineItems":[{"Description":"Guitars Fender Strat","UnitAmount":5000,"TaxType":"OUTPUT2","TaxAmount":750,"LineAmount":5000,"AccountCode":"200","Tracking":[],"Quantity":1,"LineItemID":"13a8353c-d2af-4d5b-920c-438449f08900","DiscountEnteredAsPercent":true}],"CurrencyCode":"NZD"}]}

@endpoint GET /RepeatingInvoices/{RepeatingInvoiceID}
@desc Retrieves a specific repeating invoice by using a unique repeating invoice Id
@required {RepeatingInvoiceID: str(uuid) # Unique identifier for a Repeating Invoice}
@returns(200) {RepeatingInvoices: [map]} # Success - return response of type Repeating Invoices array with a specified Repeating Invoice

@endpoint POST /RepeatingInvoices/{RepeatingInvoiceID}
@desc Deletes a specific repeating invoice template
@required {RepeatingInvoiceID: str(uuid) # Unique identifier for a Repeating Invoice}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., RepeatingInvoices: [map{Type: str, Contact: map, Schedule: map, LineItems: [map], LineAmountTypes: str, Reference: str, BrandingThemeID: str(uuid), CurrencyCode: str, Status: str, SubTotal: num(double), TotalTax: num(double), Total: num(double), RepeatingInvoiceID: str(uuid), ID: str(uuid), HasAttachments: bool, Attachments: [map], ApprovedForSending: bool, SendCopy: bool, MarkAsSent: bool, IncludePDF: bool}]}
@returns(200) {RepeatingInvoices: [map]} # Success - return response of type RepeatingInvoices array with deleted Invoice
@errors {400: A failed request due to validation error}
@example_request {"Schedule":{"Period":1,"Unit":"MONTHLY","DueDate":10,"DueDateType":"OFFOLLOWINGMONTH","StartDate":"/Date(1555286400000+0000)/","EndDate":"/Date(1569801600000+0000)/","NextScheduledDate":"/Date(1555286400000+0000)/"},"RepeatingInvoiceID":"428c0d75-909f-4b04-8403-a48dc27283b0","Type":"ACCREC","Reference":"[Week]","HasAttachments":true,"ApprovedForSending":false,"SendCopy":false,"MarkAsSent":false,"IncludePDF":false,"ID":"428c0d75-909f-4b04-8403-a48dc27283b0","Contact":{"ContactID":"430fa14a-f945-44d3-9f97-5df5e28441b8","Name":"Liam Gallagher","Addresses":[],"Phones":[],"ContactGroups":[],"ContactPersons":[],"HasValidationErrors":false},"Status":"DELETED","LineAmountTypes":"Exclusive","LineItems":[{"Description":"Guitars Fender Strat","UnitAmount":5000,"TaxType":"OUTPUT2","TaxAmount":750,"LineAmount":5000,"AccountCode":"200","Tracking":[],"Quantity":1,"LineItemID":"13a8353c-d2af-4d5b-920c-438449f08900","DiscountEnteredAsPercent":true}],"SubTotal":5000,"TotalTax":750,"Total":5750,"CurrencyCode":"NZD"}

@endpoint GET /RepeatingInvoices/{RepeatingInvoiceID}/Attachments
@desc Retrieves attachments from a specific repeating invoice
@required {RepeatingInvoiceID: str(uuid) # Unique identifier for a Repeating Invoice}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array with all Attachments for a specified Repeating Invoice

@endpoint GET /RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{AttachmentID}
@desc Retrieves a specific attachment from a specific repeating invoice
@required {RepeatingInvoiceID: str(uuid) # Unique identifier for a Repeating Invoice, AttachmentID: str(uuid) # Unique identifier for Attachment object, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for Repeating Invoice as binary data

@endpoint GET /RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}
@desc Retrieves a specific attachment from a specific repeating invoices by file name
@required {RepeatingInvoiceID: str(uuid) # Unique identifier for a Repeating Invoice, FileName: str # Name of the attachment, contentType: str # The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf}
@returns(200) Success - return response of attachment for Repeating Invoice as binary data

@endpoint POST /RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}
@desc Updates a specific attachment from a specific repeating invoices by file name
@required {RepeatingInvoiceID: str(uuid) # Unique identifier for a Repeating Invoice, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array with specified Attachment for a specified Repeating Invoice
@errors {400: A failed request due to validation error}

@endpoint PUT /RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}
@desc Creates an attachment from a specific repeating invoices by file name
@required {RepeatingInvoiceID: str(uuid) # Unique identifier for a Repeating Invoice, FileName: str # Name of the attachment}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max.}
@returns(200) {Attachments: [map]} # Success - return response of type Attachments array with updated Attachment for a specified Repeating Invoice
@errors {400: A failed request due to validation error}

@endpoint GET /RepeatingInvoices/{RepeatingInvoiceID}/History
@desc Retrieves history record for a specific repeating invoice
@required {RepeatingInvoiceID: str(uuid) # Unique identifier for a Repeating Invoice}
@returns(200) {HistoryRecords: [map]} # Success - return response of HistoryRecords array of 0 to N HistoryRecord

@endpoint PUT /RepeatingInvoices/{RepeatingInvoiceID}/History
@desc Creates a  history record for a specific repeating invoice
@required {RepeatingInvoiceID: str(uuid) # Unique identifier for a Repeating Invoice}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]} # Success - return response of type HistoryRecords array of HistoryRecord objects
@errors {400: A failed request due to validation error}
@example_request {"HistoryRecords":[{"Details":"Hello World"}]}

@endgroup

@group Reports
@endpoint GET /Reports/TenNinetyNine
@desc Retrieve reports for 1099
@optional {reportYear: str # The year of the 1099 report}
@returns(200) {Reports: [any]} # Success - return response of type Reports

@endpoint GET /Reports/AgedPayablesByContact
@desc Retrieves report for aged payables by contact
@required {contactId: str(uuid) # Unique identifier for a Contact}
@optional {date: str(date) # The date of the Aged Payables By Contact report, fromDate: str(date) # filter by the from date of the report e.g. 2021-02-01, toDate: str(date) # filter by the to date of the report e.g. 2021-02-28}
@returns(200) {Reports: [any]} # Success - return response of type ReportWithRows

@endpoint GET /Reports/AgedReceivablesByContact
@desc Retrieves report for aged receivables by contact
@required {contactId: str(uuid) # Unique identifier for a Contact}
@optional {date: str(date) # The date of the Aged Receivables By Contact report, fromDate: str(date) # filter by the from date of the report e.g. 2021-02-01, toDate: str(date) # filter by the to date of the report e.g. 2021-02-28}
@returns(200) {Reports: [any]} # Success - return response of type ReportWithRows

@endpoint GET /Reports/BalanceSheet
@desc Retrieves report for balancesheet
@optional {date: str(date) # The date of the Balance Sheet report, periods: int # The number of periods for the Balance Sheet report, timeframe: str(MONTH/QUARTER/YEAR) # The period size to compare to (MONTH, QUARTER, YEAR), trackingOptionID1: str # The tracking option 1 for the Balance Sheet report, trackingOptionID2: str # The tracking option 2 for the Balance Sheet report, standardLayout: bool # The standard layout boolean for the Balance Sheet report, paymentsOnly: bool # return a cash basis for the Balance Sheet report}
@returns(200) {Reports: [any]} # Success - return response of type ReportWithRows

@endpoint GET /Reports/BankSummary
@desc Retrieves report for bank summary
@optional {fromDate: str(date) # filter by the from date of the report e.g. 2021-02-01, toDate: str(date) # filter by the to date of the report e.g. 2021-02-28}
@returns(200) {Reports: [any]} # Success - return response of type ReportWithRows

@endpoint GET /Reports/{ReportID}
@desc Retrieves a specific report using a unique ReportID
@required {ReportID: str # Unique identifier for a Report}
@returns(200) {Reports: [any]} # Success - return response of type ReportWithRows

@endpoint GET /Reports/BudgetSummary
@desc Retrieves report for budget summary
@optional {date: str(date) # The date for the Bank Summary report e.g. 2018-03-31, periods: int # The number of periods to compare (integer between 1 and 12), timeframe: int # The period size to compare to (1=month, 3=quarter, 12=year)}
@returns(200) {Reports: [any]} # success- return a Report with Rows object

@endpoint GET /Reports/ExecutiveSummary
@desc Retrieves report for executive summary
@optional {date: str(date) # The date for the Bank Summary report e.g. 2018-03-31}
@returns(200) {Reports: [any]} # Success - return response of type ReportWithRows

@endpoint GET /Reports
@desc Retrieves a list of the organistaions unique reports that require a uuid to fetch
@returns(200) {Reports: [any]} # Success - return response of type ReportWithRows

@endpoint GET /Reports/ProfitAndLoss
@desc Retrieves report for profit and loss
@optional {fromDate: str(date) # filter by the from date of the report e.g. 2021-02-01, toDate: str(date) # filter by the to date of the report e.g. 2021-02-28, periods: int # The number of periods to compare (integer between 1 and 12), timeframe: str(MONTH/QUARTER/YEAR) # The period size to compare to (MONTH, QUARTER, YEAR), trackingCategoryID: str # The trackingCategory 1 for the ProfitAndLoss report, trackingCategoryID2: str # The trackingCategory 2 for the ProfitAndLoss report, trackingOptionID: str # The tracking option 1 for the ProfitAndLoss report, trackingOptionID2: str # The tracking option 2 for the ProfitAndLoss report, standardLayout: bool # Return the standard layout for the ProfitAndLoss report, paymentsOnly: bool # Return cash only basis for the ProfitAndLoss report}
@returns(200) {Reports: [any]} # Success - return response of type ReportWithRows

@endpoint GET /Reports/TrialBalance
@desc Retrieves report for trial balance
@optional {date: str(date) # The date for the Trial Balance report e.g. 2018-03-31, paymentsOnly: bool # Return cash only basis for the Trial Balance report}
@returns(200) {Reports: [any]} # Success - return response of type ReportWithRows

@endgroup

@group Setup
@endpoint POST /Setup
@desc Sets the chart of accounts, the conversion date and conversion balances
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., ConversionDate: map{Month: int, Year: int} # The date when the organisation starts using Xero, ConversionBalances: [map{AccountCode: str, Balance: num(double), BalanceDetails: [map]}] # Balance supplied for each account that has a value as at the conversion date., Accounts: [map{Code: str, Name: str, AccountID: str(uuid), Type: str, BankAccountNumber: str, Status: str, Description: str, BankAccountType: str, CurrencyCode: str, TaxType: str, EnablePaymentsToAccount: bool, ShowInExpenseClaims: bool, Class: str, SystemAccount: str, ReportingCode: str, ReportingCodeName: str, HasAttachments: bool, UpdatedDateUTC: str, AddToWatchlist: bool, ValidationErrors: [map]}]}
@returns(200) {ImportSummary: map{Accounts: map{Total: int(int32), New: int(int32), Updated: int(int32), Deleted: int(int32), Locked: int(int32), System: int(int32), Errored: int(int32), Present: bool, NewOrUpdated: int(int32)}, Organisation: map{Present: bool}}} # Success - returns a summary of the chart of accounts updates
@example_request {"ConversionDate":{},"ConversionBalances":[],"Accounts":[{"Code":"200","Name":"Sales","Type":"SALES","ReportingCode":"REV.TRA.GOO"},{"Code":"400","Name":"Advertising","Type":"OVERHEADS","ReportingCode":"EXP"},{"Code":"610","Name":"Accounts Receivable","Type":"CURRENT","SystemAccount":"DEBTORS","ReportingCode":"ASS.CUR.REC.TRA"},{"Code":"800","Name":"Accounts Payable","Type":"CURRLIAB","SystemAccount":"CREDITORS","ReportingCode":"LIA.CUR.PAY"}]}

@endgroup

@group TaxRates
@endpoint GET /TaxRates
@desc Retrieves tax rates
@optional {where: str # Filter by an any element, order: str # Order by an any element}
@returns(200) {TaxRates: [map]} # Success - return response of type TaxRates array with TaxRates

@endpoint PUT /TaxRates
@desc Creates one or more tax rates
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., TaxRates: [map{Name: str, TaxType: str, TaxComponents: [map], Status: str, ReportTaxType: str, CanApplyToAssets: bool, CanApplyToEquity: bool, CanApplyToExpenses: bool, CanApplyToLiabilities: bool, CanApplyToRevenue: bool, DisplayTaxRate: num(double), EffectiveRate: num(double)}]}
@returns(200) {TaxRates: [map]} # Success - return response of type TaxRates array newly created TaxRate
@errors {400: A failed request due to validation error}
@example_request {"TaxRates":[{"Name":"CA State Tax","TaxComponents":[{"Name":"State Tax","Rate":2.25}]}]}

@endpoint POST /TaxRates
@desc Updates tax rates
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., TaxRates: [map{Name: str, TaxType: str, TaxComponents: [map], Status: str, ReportTaxType: str, CanApplyToAssets: bool, CanApplyToEquity: bool, CanApplyToExpenses: bool, CanApplyToLiabilities: bool, CanApplyToRevenue: bool, DisplayTaxRate: num(double), EffectiveRate: num(double)}]}
@returns(200) {TaxRates: [map]} # Success - return response of type TaxRates array updated TaxRate
@errors {400: A failed request due to validation error}
@example_request {"TaxRates":[{"Name":"State Tax NY","TaxComponents":[{"Name":"State Tax","Rate":2.25}],"Status":"DELETED","ReportTaxType":"INPUT"}]}

@endpoint GET /TaxRates/{TaxType}
@desc Retrieves a specific tax rate according to given TaxType code
@required {TaxType: str # A valid TaxType code}
@returns(200) {TaxRates: [map]} # Success - return response of type TaxRates array with one TaxRate

@endgroup

@group TrackingCategories
@endpoint GET /TrackingCategories
@desc Retrieves tracking categories and options
@optional {where: str # Filter by an any element, order: str # Order by an any element, includeArchived: bool # e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response}
@returns(200) {TrackingCategories: [map]} # Success - return response of type TrackingCategories array of TrackingCategory

@endpoint PUT /TrackingCategories
@desc Create tracking categories
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., TrackingCategoryID: str(uuid) # The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9, TrackingOptionID: str(uuid) # The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f, Name: str # The name of the tracking category e.g. Department, Region (max length = 100), Option: str # The option name of the tracking option e.g. East, West (max length = 100), Status: str(ACTIVE/ARCHIVED/DELETED) # The status of a tracking category, Options: [map{TrackingOptionID: str(uuid), Name: str, Status: str, TrackingCategoryID: str(uuid)}] # See Tracking Options}
@returns(200) {TrackingCategories: [map]} # Success - return response of type TrackingCategories array of newly created TrackingCategory
@errors {400: A failed request due to validation error}
@example_request {"name":"FooBar"}

@endpoint GET /TrackingCategories/{TrackingCategoryID}
@desc Retrieves specific tracking categories and options using a unique tracking category Id
@required {TrackingCategoryID: str(uuid) # Unique identifier for a TrackingCategory}
@returns(200) {TrackingCategories: [map]} # Success - return response of type TrackingCategories array of specified TrackingCategory

@endpoint POST /TrackingCategories/{TrackingCategoryID}
@desc Updates a specific tracking category
@required {TrackingCategoryID: str(uuid) # Unique identifier for a TrackingCategory}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., TrackingCategoryID: str(uuid) # The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9, TrackingOptionID: str(uuid) # The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f, Name: str # The name of the tracking category e.g. Department, Region (max length = 100), Option: str # The option name of the tracking option e.g. East, West (max length = 100), Status: str(ACTIVE/ARCHIVED/DELETED) # The status of a tracking category, Options: [map{TrackingOptionID: str(uuid), Name: str, Status: str, TrackingCategoryID: str(uuid)}] # See Tracking Options}
@returns(200) {TrackingCategories: [map]} # Success - return response of type TrackingCategories array of updated TrackingCategory
@errors {400: A failed request due to validation error}
@example_request {"Name":"Avengers"}

@endpoint DELETE /TrackingCategories/{TrackingCategoryID}
@desc Deletes a specific tracking category
@required {TrackingCategoryID: str(uuid) # Unique identifier for a TrackingCategory}
@returns(200) {TrackingCategories: [map]} # Success - return response of type TrackingCategories array of deleted TrackingCategory
@errors {400: A failed request due to validation error}

@endpoint PUT /TrackingCategories/{TrackingCategoryID}/Options
@desc Creates options for a specific tracking category
@required {TrackingCategoryID: str(uuid) # Unique identifier for a TrackingCategory}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., TrackingOptionID: str(uuid) # The Xero identifier for a tracking option e.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a, Name: str # The name of the tracking option e.g. Marketing, East (max length = 100), Status: str(ACTIVE/ARCHIVED/DELETED) # The status of a tracking option, TrackingCategoryID: str(uuid) # Filter by a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9}
@returns(200) {Options: [map]} # Success - return response of type TrackingOptions array of options for a specified category
@errors {400: A failed request due to validation error}
@example_request {"name":" Bar"}

@endpoint POST /TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}
@desc Updates a specific option for a specific tracking category
@required {TrackingCategoryID: str(uuid) # Unique identifier for a TrackingCategory, TrackingOptionID: str(uuid) # Unique identifier for a Tracking Option}
@optional {Idempotency-Key: str # This allows you to safely retry requests without the risk of duplicate processing. 128 character max., TrackingOptionID: str(uuid) # The Xero identifier for a tracking option e.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a, Name: str # The name of the tracking option e.g. Marketing, East (max length = 100), Status: str(ACTIVE/ARCHIVED/DELETED) # The status of a tracking option, TrackingCategoryID: str(uuid) # Filter by a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9}
@returns(200) {Options: [map]} # Success - return response of type TrackingOptions array of options for a specified category
@errors {400: A failed request due to validation error}
@example_request {"name":"Vision"}

@endpoint DELETE /TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}
@desc Deletes a specific option for a specific tracking category
@required {TrackingCategoryID: str(uuid) # Unique identifier for a TrackingCategory, TrackingOptionID: str(uuid) # Unique identifier for a Tracking Option}
@returns(200) {Options: [map]} # Success - return response of type TrackingOptions array of remaining options for a specified category
@errors {400: A failed request due to validation error}

@endgroup

@group Users
@endpoint GET /Users
@desc Retrieves users
@optional {If-Modified-Since: str(date-time) # Only records created or modified since this timestamp will be returned, where: str # Filter by an any element, order: str # Order by an any element}
@returns(200) {Users: [map]} # Success - return response of type Users array of all User

@endpoint GET /Users/{UserID}
@desc Retrieves a specific user
@required {UserID: str(uuid) # Unique identifier for a User}
@returns(200) {Users: [map]} # Success - return response of type Users array of specified User

@endgroup

@end
