@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
@optional {If-Modified-Since: str(date-time), where: str, order: str}
@returns(200) {Accounts: [map]}

@endpoint PUT /Accounts
@optional {Idempotency-Key: str, Code: str, Name: str, AccountID: str(uuid), Type: str(BANK/CURRENT/CURRLIAB/DEPRECIATN/DIRECTCOSTS/EQUITY/EXPENSE/FIXED/INVENTORY/LIABILITY/NONCURRENT/OTHERINCOME/OVERHEADS/PREPAYMENT/REVENUE/SALES/TERMLIAB/PAYG), BankAccountNumber: str, Status: str(ACTIVE/ARCHIVED/DELETED), Description: str, BankAccountType: str(BANK/CREDITCARD/PAYPAL/NONE/), 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), TaxType: str, EnablePaymentsToAccount: bool, ShowInExpenseClaims: bool, Class: str(ASSET/EQUITY/EXPENSE/LIABILITY/REVENUE), SystemAccount: str(DEBTORS/CREDITORS/BANKCURRENCYGAIN/GST/GSTONIMPORTS/HISTORICAL/REALISEDCURRENCYGAIN/RETAINEDEARNINGS/ROUNDING/TRACKINGTRANSFERS/UNPAIDEXPCLM/UNREALISEDCURRENCYGAIN/WAGEPAYABLES/CISASSETS/CISASSET/CISLABOUR/CISLABOUREXPENSE/CISLABOURINCOME/CISLIABILITY/CISMATERIALS/), ReportingCode: str, ReportingCodeName: str, HasAttachments: bool=false, UpdatedDateUTC: str, AddToWatchlist: bool, ValidationErrors: [map{Message: str}]}
@returns(200) {Accounts: [map]}
@errors {400}

@endpoint GET /Accounts/{AccountID}
@required {AccountID: str(uuid)}
@returns(200) {Accounts: [map]}

@endpoint POST /Accounts/{AccountID}
@required {AccountID: str(uuid)}
@optional {Idempotency-Key: str, 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]}
@errors {400}

@endpoint DELETE /Accounts/{AccountID}
@required {AccountID: str(uuid)}
@returns(200) {Accounts: [map]}
@errors {400}

@endpoint GET /Accounts/{AccountID}/Attachments
@required {AccountID: str(uuid)}
@returns(200) {Attachments: [map]}

@endpoint GET /Accounts/{AccountID}/Attachments/{AttachmentID}
@required {AccountID: str(uuid), AttachmentID: str(uuid), contentType: str}
@returns(200)

@endpoint GET /Accounts/{AccountID}/Attachments/{FileName}
@required {AccountID: str(uuid), FileName: str, contentType: str}
@returns(200)

@endpoint POST /Accounts/{AccountID}/Attachments/{FileName}
@required {AccountID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endpoint PUT /Accounts/{AccountID}/Attachments/{FileName}
@required {AccountID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endgroup

@group BatchPayments
@endpoint GET /BatchPayments
@optional {If-Modified-Since: str(date-time), where: str, order: str}
@returns(200) {BatchPayments: [map]}

@endpoint PUT /BatchPayments
@optional {summarizeErrors: bool=false, Idempotency-Key: str, 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]}
@errors {400}

@endpoint POST /BatchPayments
@required {BatchPaymentID: str(uuid), Status: str=DELETED}
@optional {Idempotency-Key: str}
@returns(200) {BatchPayments: [map]}
@errors {400}

@endpoint GET /BatchPayments/{BatchPaymentID}
@required {BatchPaymentID: str(uuid)}
@returns(200) {BatchPayments: [map]}

@endpoint POST /BatchPayments/{BatchPaymentID}
@required {BatchPaymentID: str(uuid), Status: str=DELETED}
@optional {Idempotency-Key: str}
@returns(200) {BatchPayments: [map]}
@errors {400}

@endpoint GET /BatchPayments/{BatchPaymentID}/History
@required {BatchPaymentID: str(uuid)}
@returns(200) {HistoryRecords: [map]}

@endpoint PUT /BatchPayments/{BatchPaymentID}/History
@required {BatchPaymentID: str(uuid)}
@optional {Idempotency-Key: str, HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]}
@errors {400}

@endgroup

@group BankTransactions
@endpoint GET /BankTransactions
@optional {If-Modified-Since: str(date-time), where: str, order: str, page: int, unitdp: int, pageSize: int}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], BankTransactions: [map]}

@endpoint PUT /BankTransactions
@optional {summarizeErrors: bool=false, unitdp: int, Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint POST /BankTransactions
@optional {summarizeErrors: bool=false, unitdp: int, Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint GET /BankTransactions/{BankTransactionID}
@required {BankTransactionID: str(uuid)}
@optional {unitdp: int}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], BankTransactions: [map]}

@endpoint POST /BankTransactions/{BankTransactionID}
@required {BankTransactionID: str(uuid)}
@optional {unitdp: int, Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint GET /BankTransactions/{BankTransactionID}/Attachments
@required {BankTransactionID: str(uuid)}
@returns(200) {Attachments: [map]}

@endpoint GET /BankTransactions/{BankTransactionID}/Attachments/{AttachmentID}
@required {BankTransactionID: str(uuid), AttachmentID: str(uuid), contentType: str}
@returns(200)

@endpoint GET /BankTransactions/{BankTransactionID}/Attachments/{FileName}
@required {BankTransactionID: str(uuid), FileName: str, contentType: str}
@returns(200)

@endpoint POST /BankTransactions/{BankTransactionID}/Attachments/{FileName}
@required {BankTransactionID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endpoint PUT /BankTransactions/{BankTransactionID}/Attachments/{FileName}
@required {BankTransactionID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endpoint GET /BankTransactions/{BankTransactionID}/History
@required {BankTransactionID: str(uuid)}
@returns(200) {HistoryRecords: [map]}

@endpoint PUT /BankTransactions/{BankTransactionID}/History
@required {BankTransactionID: str(uuid)}
@optional {Idempotency-Key: str, HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]}
@errors {400}

@endgroup

@group BankTransfers
@endpoint GET /BankTransfers
@optional {If-Modified-Since: str(date-time), where: str, order: str}
@returns(200) {BankTransfers: [map]}

@endpoint PUT /BankTransfers
@optional {Idempotency-Key: str, 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]}
@errors {400}

@endpoint GET /BankTransfers/{BankTransferID}
@required {BankTransferID: str(uuid)}
@returns(200) {BankTransfers: [map]}

@endpoint GET /BankTransfers/{BankTransferID}/Attachments
@required {BankTransferID: str(uuid)}
@returns(200) {Attachments: [map]}

@endpoint GET /BankTransfers/{BankTransferID}/Attachments/{AttachmentID}
@required {BankTransferID: str(uuid), AttachmentID: str(uuid), contentType: str}
@returns(200)

@endpoint GET /BankTransfers/{BankTransferID}/Attachments/{FileName}
@required {BankTransferID: str(uuid), FileName: str, contentType: str}
@returns(200)

@endpoint POST /BankTransfers/{BankTransferID}/Attachments/{FileName}
@required {BankTransferID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endpoint PUT /BankTransfers/{BankTransferID}/Attachments/{FileName}
@required {BankTransferID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endpoint GET /BankTransfers/{BankTransferID}/History
@required {BankTransferID: str(uuid)}
@returns(200) {HistoryRecords: [map]}

@endpoint PUT /BankTransfers/{BankTransferID}/History
@required {BankTransferID: str(uuid)}
@optional {Idempotency-Key: str, HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]}
@errors {400}

@endgroup

@group BrandingThemes
@endpoint GET /BrandingThemes
@returns(200) {BrandingThemes: [map]}

@endpoint GET /BrandingThemes/{BrandingThemeID}
@required {BrandingThemeID: str(uuid)}
@returns(200) {BrandingThemes: [map]}

@endpoint GET /BrandingThemes/{BrandingThemeID}/PaymentServices
@required {BrandingThemeID: str(uuid)}
@returns(200) {PaymentServices: [any]}

@endpoint POST /BrandingThemes/{BrandingThemeID}/PaymentServices
@required {BrandingThemeID: str(uuid)}
@optional {Idempotency-Key: str, PaymentServices: [any]}
@returns(200) {PaymentServices: [any]}
@errors {400}

@endgroup

@group Budgets
@endpoint GET /Budgets
@optional {IDs: str, DateTo: str(date), DateFrom: str(date)}
@returns(200) {Budgets: [map]}

@endpoint GET /Budgets/{BudgetID}
@required {BudgetID: str(uuid)}
@optional {DateTo: str(date), DateFrom: str(date)}
@returns(200) {Budgets: [map]}

@endgroup

@group Contacts
@endpoint GET /Contacts
@optional {If-Modified-Since: str(date-time), where: str, order: str, IDs: [str(uuid)], page: int, includeArchived: bool, summaryOnly: bool=false, searchTerm: str, pageSize: int}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Contacts: [map]}

@endpoint PUT /Contacts
@optional {summarizeErrors: bool=false, Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint POST /Contacts
@optional {summarizeErrors: bool=false, Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint GET /Contacts/{ContactNumber}
@required {ContactNumber: str}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Contacts: [map]}

@endpoint GET /Contacts/{ContactID}
@required {ContactID: str(uuid)}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Contacts: [map]}

@endpoint POST /Contacts/{ContactID}
@required {ContactID: str(uuid)}
@optional {Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint GET /Contacts/{ContactID}/Attachments
@required {ContactID: str(uuid)}
@returns(200) {Attachments: [map]}

@endpoint GET /Contacts/{ContactID}/Attachments/{AttachmentID}
@required {ContactID: str(uuid), AttachmentID: str(uuid), contentType: str}
@returns(200)

@endpoint GET /Contacts/{ContactID}/Attachments/{FileName}
@required {ContactID: str(uuid), FileName: str, contentType: str}
@returns(200)

@endpoint POST /Contacts/{ContactID}/Attachments/{FileName}
@required {ContactID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endpoint PUT /Contacts/{ContactID}/Attachments/{FileName}
@required {ContactID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endpoint GET /Contacts/{ContactID}/CISSettings
@required {ContactID: str(uuid)}
@returns(200) {CISSettings: [any]}

@endpoint GET /Contacts/{ContactID}/History
@required {ContactID: str(uuid)}
@returns(200) {HistoryRecords: [map]}

@endpoint PUT /Contacts/{ContactID}/History
@required {ContactID: str(uuid)}
@optional {Idempotency-Key: str, HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]}
@errors {400}

@endgroup

@group ContactGroups
@endpoint GET /ContactGroups
@optional {where: str, order: str}
@returns(200) {ContactGroups: [map]}

@endpoint PUT /ContactGroups
@optional {Idempotency-Key: str, ContactGroups: [map{Name: str, Status: str, ContactGroupID: str(uuid), Contacts: [map]}]}
@returns(200) {ContactGroups: [map]}
@errors {400}

@endpoint GET /ContactGroups/{ContactGroupID}
@required {ContactGroupID: str(uuid)}
@returns(200) {ContactGroups: [map]}

@endpoint POST /ContactGroups/{ContactGroupID}
@required {ContactGroupID: str(uuid)}
@optional {Idempotency-Key: str, ContactGroups: [map{Name: str, Status: str, ContactGroupID: str(uuid), Contacts: [map]}]}
@returns(200) {ContactGroups: [map]}
@errors {400}

@endpoint PUT /ContactGroups/{ContactGroupID}/Contacts
@required {ContactGroupID: str(uuid)}
@optional {Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint DELETE /ContactGroups/{ContactGroupID}/Contacts
@required {ContactGroupID: str(uuid)}
@returns(204)

@endpoint DELETE /ContactGroups/{ContactGroupID}/Contacts/{ContactID}
@required {ContactGroupID: str(uuid), ContactID: str(uuid)}
@returns(204)
@errors {400}

@endgroup

@group CreditNotes
@endpoint GET /CreditNotes
@optional {If-Modified-Since: str(date-time), where: str, order: str, page: int, unitdp: int, pageSize: int}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], CreditNotes: [map]}

@endpoint PUT /CreditNotes
@optional {summarizeErrors: bool=false, unitdp: int, Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint POST /CreditNotes
@optional {summarizeErrors: bool=false, unitdp: int, Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint GET /CreditNotes/{CreditNoteID}
@required {CreditNoteID: str(uuid)}
@optional {unitdp: int}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], CreditNotes: [map]}

@endpoint POST /CreditNotes/{CreditNoteID}
@required {CreditNoteID: str(uuid)}
@optional {unitdp: int, Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint GET /CreditNotes/{CreditNoteID}/Attachments
@required {CreditNoteID: str(uuid)}
@returns(200) {Attachments: [map]}

@endpoint GET /CreditNotes/{CreditNoteID}/Attachments/{AttachmentID}
@required {CreditNoteID: str(uuid), AttachmentID: str(uuid), contentType: str}
@returns(200)

@endpoint GET /CreditNotes/{CreditNoteID}/Attachments/{FileName}
@required {CreditNoteID: str(uuid), FileName: str, contentType: str}
@returns(200)

@endpoint POST /CreditNotes/{CreditNoteID}/Attachments/{FileName}
@required {CreditNoteID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endpoint PUT /CreditNotes/{CreditNoteID}/Attachments/{FileName}
@required {CreditNoteID: str(uuid), FileName: str}
@optional {IncludeOnline: bool=false, Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endpoint GET /CreditNotes/{CreditNoteID}/pdf
@required {CreditNoteID: str(uuid)}
@returns(200)

@endpoint PUT /CreditNotes/{CreditNoteID}/Allocations
@required {CreditNoteID: str(uuid)}
@optional {summarizeErrors: bool=false, Idempotency-Key: str, 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]}
@errors {400}

@endpoint DELETE /CreditNotes/{CreditNoteID}/Allocations/{AllocationID}
@required {CreditNoteID: str(uuid), AllocationID: str(uuid)}
@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]}

@endpoint GET /CreditNotes/{CreditNoteID}/History
@required {CreditNoteID: str(uuid)}
@returns(200) {HistoryRecords: [map]}

@endpoint PUT /CreditNotes/{CreditNoteID}/History
@required {CreditNoteID: str(uuid)}
@optional {Idempotency-Key: str, HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]}
@errors {400}

@endgroup

@group Currencies
@endpoint GET /Currencies
@optional {where: str, order: str}
@returns(200) {Currencies: [map]}

@endpoint PUT /Currencies
@optional {Idempotency-Key: str, 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), Description: str}
@returns(200) {Currencies: [map]}

@endgroup

@group Employees
@endpoint GET /Employees
@optional {If-Modified-Since: str(date-time), where: str, order: str}
@returns(200) {Employees: [map]}

@endpoint PUT /Employees
@optional {summarizeErrors: bool=false, Idempotency-Key: str, Employees: [map{EmployeeID: str(uuid), Status: str, FirstName: str, LastName: str, ExternalLink: map, UpdatedDateUTC: str, StatusAttributeString: str, ValidationErrors: [map]}]}
@returns(200) {Employees: [map]}
@errors {400}

@endpoint POST /Employees
@optional {summarizeErrors: bool=false, Idempotency-Key: str, Employees: [map{EmployeeID: str(uuid), Status: str, FirstName: str, LastName: str, ExternalLink: map, UpdatedDateUTC: str, StatusAttributeString: str, ValidationErrors: [map]}]}
@returns(200) {Employees: [map]}
@errors {400}

@endpoint GET /Employees/{EmployeeID}
@required {EmployeeID: str(uuid)}
@returns(200) {Employees: [map]}

@endgroup

@group ExpenseClaims
@endpoint GET /ExpenseClaims
@optional {If-Modified-Since: str(date-time), where: str, order: str}
@returns(200) {ExpenseClaims: [map]}

@endpoint PUT /ExpenseClaims
@optional {Idempotency-Key: str, 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]}
@errors {400}

@endpoint GET /ExpenseClaims/{ExpenseClaimID}
@required {ExpenseClaimID: str(uuid)}
@returns(200) {ExpenseClaims: [map]}

@endpoint POST /ExpenseClaims/{ExpenseClaimID}
@required {ExpenseClaimID: str(uuid)}
@optional {Idempotency-Key: str, 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]}
@errors {400}

@endpoint GET /ExpenseClaims/{ExpenseClaimID}/History
@required {ExpenseClaimID: str(uuid)}
@returns(200) {HistoryRecords: [map]}

@endpoint PUT /ExpenseClaims/{ExpenseClaimID}/History
@required {ExpenseClaimID: str(uuid)}
@optional {Idempotency-Key: str, HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]}

@endgroup

@group Invoices
@endpoint GET /Invoices
@optional {If-Modified-Since: str(date-time), where: str, order: str, IDs: [str(uuid)], InvoiceNumbers: [str], ContactIDs: [str(uuid)], Statuses: [str], page: int, includeArchived: bool, createdByMyApp: bool, unitdp: int, summaryOnly: bool=false, pageSize: int, searchTerm: str}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Invoices: [map]}

@endpoint PUT /Invoices
@optional {summarizeErrors: bool=false, unitdp: int, Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint POST /Invoices
@optional {summarizeErrors: bool=false, unitdp: int, Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint GET /Invoices/{InvoiceID}
@required {InvoiceID: str(uuid)}
@optional {unitdp: int}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Invoices: [map]}

@endpoint POST /Invoices/{InvoiceID}
@required {InvoiceID: str(uuid)}
@optional {unitdp: int, Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint GET /Invoices/{InvoiceID}/pdf
@required {InvoiceID: str(uuid)}
@returns(200)

@endpoint GET /Invoices/{InvoiceID}/Attachments
@required {InvoiceID: str(uuid)}
@returns(200) {Attachments: [map]}

@endpoint GET /Invoices/{InvoiceID}/Attachments/{AttachmentID}
@required {InvoiceID: str(uuid), AttachmentID: str(uuid), contentType: str}
@returns(200)

@endpoint GET /Invoices/{InvoiceID}/Attachments/{FileName}
@required {InvoiceID: str(uuid), FileName: str, contentType: str}
@returns(200)

@endpoint POST /Invoices/{InvoiceID}/Attachments/{FileName}
@required {InvoiceID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endpoint PUT /Invoices/{InvoiceID}/Attachments/{FileName}
@required {InvoiceID: str(uuid), FileName: str}
@optional {IncludeOnline: bool=false, Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endpoint GET /Invoices/{InvoiceID}/OnlineInvoice
@required {InvoiceID: str(uuid)}
@returns(200) {OnlineInvoices: [map]}

@endpoint POST /Invoices/{InvoiceID}/Email
@required {InvoiceID: str(uuid)}
@optional {Idempotency-Key: str, Status: str}
@returns(204)
@errors {400}

@endpoint GET /Invoices/{InvoiceID}/History
@required {InvoiceID: str(uuid)}
@returns(200) {HistoryRecords: [map]}

@endpoint PUT /Invoices/{InvoiceID}/History
@required {InvoiceID: str(uuid)}
@optional {Idempotency-Key: str, HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]}
@errors {400}

@endgroup

@group InvoiceReminders
@endpoint GET /InvoiceReminders/Settings
@returns(200) {InvoiceReminders: [map]}

@endgroup

@group Items
@endpoint GET /Items
@optional {If-Modified-Since: str(date-time), where: str, order: str, unitdp: int}
@returns(200) {Items: [map]}

@endpoint PUT /Items
@optional {summarizeErrors: bool=false, unitdp: int, Idempotency-Key: str, 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]}
@errors {400}

@endpoint POST /Items
@optional {summarizeErrors: bool=false, unitdp: int, Idempotency-Key: str, 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]}
@errors {400}

@endpoint GET /Items/{ItemID}
@required {ItemID: str(uuid)}
@optional {unitdp: int}
@returns(200) {Items: [map]}

@endpoint POST /Items/{ItemID}
@required {ItemID: str(uuid)}
@optional {unitdp: int, Idempotency-Key: str, 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]}
@errors {400}

@endpoint DELETE /Items/{ItemID}
@required {ItemID: str(uuid)}
@returns(204)
@errors {400}

@endpoint GET /Items/{ItemID}/History
@required {ItemID: str(uuid)}
@returns(200) {HistoryRecords: [map]}

@endpoint PUT /Items/{ItemID}/History
@required {ItemID: str(uuid)}
@optional {Idempotency-Key: str, HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]}

@endgroup

@group Journals
@endpoint GET /Journals
@optional {If-Modified-Since: str(date-time), offset: int, paymentsOnly: bool}
@returns(200) {Warnings: [map], Journals: [map]}

@endpoint GET /Journals/{JournalID}
@required {JournalID: str(uuid)}
@returns(200) {Warnings: [map], Journals: [map]}

@endpoint GET /Journals/{JournalNumber}
@required {JournalNumber: int}
@returns(200) {Warnings: [map], Journals: [map]}

@endgroup

@group LinkedTransactions
@endpoint GET /LinkedTransactions
@optional {page: int, LinkedTransactionID: str(uuid), SourceTransactionID: str(uuid), ContactID: str(uuid), Status: str, TargetTransactionID: str(uuid)}
@returns(200) {LinkedTransactions: [map]}

@endpoint PUT /LinkedTransactions
@optional {Idempotency-Key: str, SourceTransactionID: str(uuid), SourceLineItemID: str(uuid), ContactID: str(uuid), TargetTransactionID: str(uuid), TargetLineItemID: str(uuid), LinkedTransactionID: str(uuid), Status: str(APPROVED/DRAFT/ONDRAFT/BILLED/VOIDED), Type: str, UpdatedDateUTC: str, SourceTransactionTypeCode: str(ACCPAY/SPEND), ValidationErrors: [map{Message: str}]}
@returns(200) {LinkedTransactions: [map]}
@errors {400}

@endpoint GET /LinkedTransactions/{LinkedTransactionID}
@required {LinkedTransactionID: str(uuid)}
@returns(200) {LinkedTransactions: [map]}

@endpoint POST /LinkedTransactions/{LinkedTransactionID}
@required {LinkedTransactionID: str(uuid)}
@optional {Idempotency-Key: str, 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]}
@errors {400}

@endpoint DELETE /LinkedTransactions/{LinkedTransactionID}
@required {LinkedTransactionID: str(uuid)}
@returns(204)
@errors {400}

@endgroup

@group ManualJournals
@endpoint GET /ManualJournals
@optional {If-Modified-Since: str(date-time), where: str, order: str, page: int, pageSize: int}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], ManualJournals: [map]}

@endpoint PUT /ManualJournals
@optional {summarizeErrors: bool=false, Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint POST /ManualJournals
@optional {summarizeErrors: bool=false, Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint GET /ManualJournals/{ManualJournalID}
@required {ManualJournalID: str(uuid)}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], ManualJournals: [map]}

@endpoint POST /ManualJournals/{ManualJournalID}
@required {ManualJournalID: str(uuid)}
@optional {Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint GET /ManualJournals/{ManualJournalID}/Attachments
@required {ManualJournalID: str(uuid)}
@returns(200) {Attachments: [map]}

@endpoint GET /ManualJournals/{ManualJournalID}/Attachments/{AttachmentID}
@required {ManualJournalID: str(uuid), AttachmentID: str(uuid), contentType: str}
@returns(200)

@endpoint GET /ManualJournals/{ManualJournalID}/Attachments/{FileName}
@required {ManualJournalID: str(uuid), FileName: str, contentType: str}
@returns(200)

@endpoint POST /ManualJournals/{ManualJournalID}/Attachments/{FileName}
@required {ManualJournalID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endpoint PUT /ManualJournals/{ManualJournalID}/Attachments/{FileName}
@required {ManualJournalID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endpoint GET /ManualJournals/{ManualJournalID}/History
@required {ManualJournalID: str(uuid)}
@returns(200) {HistoryRecords: [map]}

@endpoint PUT /ManualJournals/{ManualJournalID}/History
@required {ManualJournalID: str(uuid)}
@optional {Idempotency-Key: str, HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]}
@errors {400}

@endgroup

@group Organisation
@endpoint GET /Organisation
@returns(200) {Organisations: [map]}

@endpoint GET /Organisation/Actions
@returns(200) {Actions: [any]}

@endpoint GET /Organisation/{OrganisationID}/CISSettings
@required {OrganisationID: str(uuid)}
@returns(200) {CISSettings: [any]}

@endgroup

@group Overpayments
@endpoint GET /Overpayments
@optional {If-Modified-Since: str(date-time), where: str, order: str, page: int, unitdp: int, pageSize: int, References: [str]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Overpayments: [map]}

@endpoint GET /Overpayments/{OverpaymentID}
@required {OverpaymentID: str(uuid)}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Overpayments: [map]}

@endpoint PUT /Overpayments/{OverpaymentID}/Allocations
@required {OverpaymentID: str(uuid)}
@optional {summarizeErrors: bool=false, Idempotency-Key: str, 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]}
@errors {400}

@endpoint DELETE /Overpayments/{OverpaymentID}/Allocations/{AllocationID}
@required {OverpaymentID: str(uuid), AllocationID: str(uuid)}
@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]}

@endpoint GET /Overpayments/{OverpaymentID}/History
@required {OverpaymentID: str(uuid)}
@returns(200) {HistoryRecords: [map]}

@endpoint PUT /Overpayments/{OverpaymentID}/History
@required {OverpaymentID: str(uuid)}
@optional {Idempotency-Key: str, HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]}
@errors {400}

@endgroup

@group Payments
@endpoint GET /Payments
@optional {If-Modified-Since: str(date-time), where: str, order: str, page: int, pageSize: int}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Payments: [map]}

@endpoint PUT /Payments
@optional {summarizeErrors: bool=false, Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint POST /Payments
@optional {Idempotency-Key: str, 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, CreditNoteNumber: str, 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, Date: str, CurrencyRate: num(double), Amount: num(double), BankAmount: num(double), Reference: str, IsReconciled: bool, Status: str(AUTHORISED/DELETED), PaymentType: str(ACCRECPAYMENT/ACCPAYPAYMENT/ARCREDITPAYMENT/APCREDITPAYMENT/AROVERPAYMENTPAYMENT/ARPREPAYMENTPAYMENT/APPREPAYMENTPAYMENT/APOVERPAYMENTPAYMENT), UpdatedDateUTC: str, PaymentID: str(uuid), BatchPaymentID: str(uuid), BankAccountNumber: str, Particulars: str, Details: str, HasAccount: bool=false, HasValidationErrors: bool=false, StatusAttributeString: str, ValidationErrors: [map{Message: str}], Warnings: [map{Message: str}]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Payments: [map]}
@errors {400}

@endpoint GET /Payments/{PaymentID}
@required {PaymentID: str(uuid)}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Payments: [map]}

@endpoint POST /Payments/{PaymentID}
@required {PaymentID: str(uuid), Status: str=DELETED}
@optional {Idempotency-Key: str}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Payments: [map]}
@errors {400}

@endpoint GET /Payments/{PaymentID}/History
@required {PaymentID: str(uuid)}
@returns(200) {HistoryRecords: [map]}

@endpoint PUT /Payments/{PaymentID}/History
@required {PaymentID: str(uuid)}
@optional {Idempotency-Key: str, HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]}
@errors {400}

@endgroup

@group PaymentServices
@endpoint GET /PaymentServices
@returns(200) {PaymentServices: [any]}

@endpoint PUT /PaymentServices
@optional {Idempotency-Key: str, PaymentServices: [any]}
@returns(200) {PaymentServices: [any]}
@errors {400}

@endgroup

@group Prepayments
@endpoint GET /Prepayments
@optional {If-Modified-Since: str(date-time), where: str, order: str, page: int, unitdp: int, pageSize: int, InvoiceNumbers: [str]}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Prepayments: [map]}

@endpoint GET /Prepayments/{PrepaymentID}
@required {PrepaymentID: str(uuid)}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], Prepayments: [map]}

@endpoint PUT /Prepayments/{PrepaymentID}/Allocations
@required {PrepaymentID: str(uuid)}
@optional {summarizeErrors: bool=false, Idempotency-Key: str, 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]}
@errors {400}

@endpoint DELETE /Prepayments/{PrepaymentID}/Allocations/{AllocationID}
@required {PrepaymentID: str(uuid), AllocationID: str(uuid)}
@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]}

@endpoint GET /Prepayments/{PrepaymentID}/History
@required {PrepaymentID: str(uuid)}
@returns(200) {HistoryRecords: [map]}

@endpoint PUT /Prepayments/{PrepaymentID}/History
@required {PrepaymentID: str(uuid)}
@optional {Idempotency-Key: str, HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]}
@errors {400}

@endgroup

@group PurchaseOrders
@endpoint GET /PurchaseOrders
@optional {If-Modified-Since: str(date-time), Status: str(DRAFT/SUBMITTED/AUTHORISED/BILLED/DELETED), DateFrom: str, DateTo: str, order: str, page: int, pageSize: int}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], PurchaseOrders: [map]}

@endpoint PUT /PurchaseOrders
@optional {summarizeErrors: bool=false, Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint POST /PurchaseOrders
@optional {summarizeErrors: bool=false, Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint GET /PurchaseOrders/{PurchaseOrderID}/pdf
@required {PurchaseOrderID: str(uuid)}
@returns(200)

@endpoint GET /PurchaseOrders/{PurchaseOrderID}
@required {PurchaseOrderID: str(uuid)}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], PurchaseOrders: [map]}

@endpoint POST /PurchaseOrders/{PurchaseOrderID}
@required {PurchaseOrderID: str(uuid)}
@optional {Idempotency-Key: str, pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map{Message: str}], 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]}
@errors {400}

@endpoint GET /PurchaseOrders/{PurchaseOrderNumber}
@required {PurchaseOrderNumber: str}
@returns(200) {pagination: map{page: int, pageSize: int, pageCount: int, itemCount: int}, Warnings: [map], PurchaseOrders: [map]}

@endpoint GET /PurchaseOrders/{PurchaseOrderID}/History
@required {PurchaseOrderID: str(uuid)}
@returns(200) {HistoryRecords: [map]}

@endpoint PUT /PurchaseOrders/{PurchaseOrderID}/History
@required {PurchaseOrderID: str(uuid)}
@optional {Idempotency-Key: str, HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]}
@errors {400}

@endpoint GET /PurchaseOrders/{PurchaseOrderID}/Attachments
@required {PurchaseOrderID: str(uuid)}
@returns(200) {Attachments: [map]}

@endpoint GET /PurchaseOrders/{PurchaseOrderID}/Attachments/{AttachmentID}
@required {PurchaseOrderID: str(uuid), AttachmentID: str(uuid), contentType: str}
@returns(200)

@endpoint GET /PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}
@required {PurchaseOrderID: str(uuid), FileName: str, contentType: str}
@returns(200)

@endpoint POST /PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}
@required {PurchaseOrderID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endpoint PUT /PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}
@required {PurchaseOrderID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endgroup

@group Quotes
@endpoint GET /Quotes
@optional {If-Modified-Since: str(date-time), DateFrom: str(date), DateTo: str(date), ExpiryDateFrom: str(date), ExpiryDateTo: str(date), ContactID: str(uuid), Status: str, page: int, order: str, QuoteNumber: str}
@returns(200) {Quotes: [map]}

@endpoint PUT /Quotes
@optional {summarizeErrors: bool=false, Idempotency-Key: str, 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]}
@errors {400}

@endpoint POST /Quotes
@optional {summarizeErrors: bool=false, Idempotency-Key: str, 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]}
@errors {400}

@endpoint GET /Quotes/{QuoteID}
@required {QuoteID: str(uuid)}
@returns(200) {Quotes: [map]}

@endpoint POST /Quotes/{QuoteID}
@required {QuoteID: str(uuid)}
@optional {Idempotency-Key: str, 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]}
@errors {400}

@endpoint GET /Quotes/{QuoteID}/History
@required {QuoteID: str(uuid)}
@returns(200) {HistoryRecords: [map]}

@endpoint PUT /Quotes/{QuoteID}/History
@required {QuoteID: str(uuid)}
@optional {Idempotency-Key: str, HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]}
@errors {400}

@endpoint GET /Quotes/{QuoteID}/pdf
@required {QuoteID: str(uuid)}
@returns(200)

@endpoint GET /Quotes/{QuoteID}/Attachments
@required {QuoteID: str(uuid)}
@returns(200) {Attachments: [map]}

@endpoint GET /Quotes/{QuoteID}/Attachments/{AttachmentID}
@required {QuoteID: str(uuid), AttachmentID: str(uuid), contentType: str}
@returns(200)

@endpoint GET /Quotes/{QuoteID}/Attachments/{FileName}
@required {QuoteID: str(uuid), FileName: str, contentType: str}
@returns(200)

@endpoint POST /Quotes/{QuoteID}/Attachments/{FileName}
@required {QuoteID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endpoint PUT /Quotes/{QuoteID}/Attachments/{FileName}
@required {QuoteID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endgroup

@group Receipts
@endpoint GET /Receipts
@optional {If-Modified-Since: str(date-time), where: str, order: str, unitdp: int}
@returns(200) {Receipts: [map]}

@endpoint PUT /Receipts
@optional {unitdp: int, Idempotency-Key: str, 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]}
@errors {400}

@endpoint GET /Receipts/{ReceiptID}
@required {ReceiptID: str(uuid)}
@optional {unitdp: int}
@returns(200) {Receipts: [map]}

@endpoint POST /Receipts/{ReceiptID}
@required {ReceiptID: str(uuid)}
@optional {unitdp: int, Idempotency-Key: str, 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]}
@errors {400}

@endpoint GET /Receipts/{ReceiptID}/Attachments
@required {ReceiptID: str(uuid)}
@returns(200) {Attachments: [map]}

@endpoint GET /Receipts/{ReceiptID}/Attachments/{AttachmentID}
@required {ReceiptID: str(uuid), AttachmentID: str(uuid), contentType: str}
@returns(200)

@endpoint GET /Receipts/{ReceiptID}/Attachments/{FileName}
@required {ReceiptID: str(uuid), FileName: str, contentType: str}
@returns(200)

@endpoint POST /Receipts/{ReceiptID}/Attachments/{FileName}
@required {ReceiptID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endpoint PUT /Receipts/{ReceiptID}/Attachments/{FileName}
@required {ReceiptID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endpoint GET /Receipts/{ReceiptID}/History
@required {ReceiptID: str(uuid)}
@returns(200) {HistoryRecords: [map]}

@endpoint PUT /Receipts/{ReceiptID}/History
@required {ReceiptID: str(uuid)}
@optional {Idempotency-Key: str, HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]}
@errors {400}

@endgroup

@group RepeatingInvoices
@endpoint GET /RepeatingInvoices
@optional {where: str, order: str}
@returns(200) {RepeatingInvoices: [map]}

@endpoint PUT /RepeatingInvoices
@optional {summarizeErrors: bool=false, Idempotency-Key: str, 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]}
@errors {400}

@endpoint POST /RepeatingInvoices
@optional {summarizeErrors: bool=false, Idempotency-Key: str, 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]}
@errors {400}

@endpoint GET /RepeatingInvoices/{RepeatingInvoiceID}
@required {RepeatingInvoiceID: str(uuid)}
@returns(200) {RepeatingInvoices: [map]}

@endpoint POST /RepeatingInvoices/{RepeatingInvoiceID}
@required {RepeatingInvoiceID: str(uuid)}
@optional {Idempotency-Key: str, 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]}
@errors {400}

@endpoint GET /RepeatingInvoices/{RepeatingInvoiceID}/Attachments
@required {RepeatingInvoiceID: str(uuid)}
@returns(200) {Attachments: [map]}

@endpoint GET /RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{AttachmentID}
@required {RepeatingInvoiceID: str(uuid), AttachmentID: str(uuid), contentType: str}
@returns(200)

@endpoint GET /RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}
@required {RepeatingInvoiceID: str(uuid), FileName: str, contentType: str}
@returns(200)

@endpoint POST /RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}
@required {RepeatingInvoiceID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endpoint PUT /RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}
@required {RepeatingInvoiceID: str(uuid), FileName: str}
@optional {Idempotency-Key: str}
@returns(200) {Attachments: [map]}
@errors {400}

@endpoint GET /RepeatingInvoices/{RepeatingInvoiceID}/History
@required {RepeatingInvoiceID: str(uuid)}
@returns(200) {HistoryRecords: [map]}

@endpoint PUT /RepeatingInvoices/{RepeatingInvoiceID}/History
@required {RepeatingInvoiceID: str(uuid)}
@optional {Idempotency-Key: str, HistoryRecords: [map{Details: str, Changes: str, User: str, DateUTC: str}]}
@returns(200) {HistoryRecords: [map]}
@errors {400}

@endgroup

@group Reports
@endpoint GET /Reports/TenNinetyNine
@optional {reportYear: str}
@returns(200) {Reports: [any]}

@endpoint GET /Reports/AgedPayablesByContact
@required {contactId: str(uuid)}
@optional {date: str(date), fromDate: str(date), toDate: str(date)}
@returns(200) {Reports: [any]}

@endpoint GET /Reports/AgedReceivablesByContact
@required {contactId: str(uuid)}
@optional {date: str(date), fromDate: str(date), toDate: str(date)}
@returns(200) {Reports: [any]}

@endpoint GET /Reports/BalanceSheet
@optional {date: str(date), periods: int, timeframe: str(MONTH/QUARTER/YEAR), trackingOptionID1: str, trackingOptionID2: str, standardLayout: bool, paymentsOnly: bool}
@returns(200) {Reports: [any]}

@endpoint GET /Reports/BankSummary
@optional {fromDate: str(date), toDate: str(date)}
@returns(200) {Reports: [any]}

@endpoint GET /Reports/{ReportID}
@required {ReportID: str}
@returns(200) {Reports: [any]}

@endpoint GET /Reports/BudgetSummary
@optional {date: str(date), periods: int, timeframe: int}
@returns(200) {Reports: [any]}

@endpoint GET /Reports/ExecutiveSummary
@optional {date: str(date)}
@returns(200) {Reports: [any]}

@endpoint GET /Reports
@returns(200) {Reports: [any]}

@endpoint GET /Reports/ProfitAndLoss
@optional {fromDate: str(date), toDate: str(date), periods: int, timeframe: str(MONTH/QUARTER/YEAR), trackingCategoryID: str, trackingCategoryID2: str, trackingOptionID: str, trackingOptionID2: str, standardLayout: bool, paymentsOnly: bool}
@returns(200) {Reports: [any]}

@endpoint GET /Reports/TrialBalance
@optional {date: str(date), paymentsOnly: bool}
@returns(200) {Reports: [any]}

@endgroup

@group Setup
@endpoint POST /Setup
@optional {Idempotency-Key: str, ConversionDate: map{Month: int, Year: int}, ConversionBalances: [map{AccountCode: str, Balance: num(double), BalanceDetails: [map]}], 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}}}

@endgroup

@group TaxRates
@endpoint GET /TaxRates
@optional {where: str, order: str}
@returns(200) {TaxRates: [map]}

@endpoint PUT /TaxRates
@optional {Idempotency-Key: str, 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]}
@errors {400}

@endpoint POST /TaxRates
@optional {Idempotency-Key: str, 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]}
@errors {400}

@endpoint GET /TaxRates/{TaxType}
@required {TaxType: str}
@returns(200) {TaxRates: [map]}

@endgroup

@group TrackingCategories
@endpoint GET /TrackingCategories
@optional {where: str, order: str, includeArchived: bool}
@returns(200) {TrackingCategories: [map]}

@endpoint PUT /TrackingCategories
@optional {Idempotency-Key: str, TrackingCategoryID: str(uuid), TrackingOptionID: str(uuid), Name: str, Option: str, Status: str(ACTIVE/ARCHIVED/DELETED), Options: [map{TrackingOptionID: str(uuid), Name: str, Status: str, TrackingCategoryID: str(uuid)}]}
@returns(200) {TrackingCategories: [map]}
@errors {400}

@endpoint GET /TrackingCategories/{TrackingCategoryID}
@required {TrackingCategoryID: str(uuid)}
@returns(200) {TrackingCategories: [map]}

@endpoint POST /TrackingCategories/{TrackingCategoryID}
@required {TrackingCategoryID: str(uuid)}
@optional {Idempotency-Key: str, TrackingCategoryID: str(uuid), TrackingOptionID: str(uuid), Name: str, Option: str, Status: str(ACTIVE/ARCHIVED/DELETED), Options: [map{TrackingOptionID: str(uuid), Name: str, Status: str, TrackingCategoryID: str(uuid)}]}
@returns(200) {TrackingCategories: [map]}
@errors {400}

@endpoint DELETE /TrackingCategories/{TrackingCategoryID}
@required {TrackingCategoryID: str(uuid)}
@returns(200) {TrackingCategories: [map]}
@errors {400}

@endpoint PUT /TrackingCategories/{TrackingCategoryID}/Options
@required {TrackingCategoryID: str(uuid)}
@optional {Idempotency-Key: str, TrackingOptionID: str(uuid), Name: str, Status: str(ACTIVE/ARCHIVED/DELETED), TrackingCategoryID: str(uuid)}
@returns(200) {Options: [map]}
@errors {400}

@endpoint POST /TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}
@required {TrackingCategoryID: str(uuid), TrackingOptionID: str(uuid)}
@optional {Idempotency-Key: str, TrackingOptionID: str(uuid), Name: str, Status: str(ACTIVE/ARCHIVED/DELETED), TrackingCategoryID: str(uuid)}
@returns(200) {Options: [map]}
@errors {400}

@endpoint DELETE /TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}
@required {TrackingCategoryID: str(uuid), TrackingOptionID: str(uuid)}
@returns(200) {Options: [map]}
@errors {400}

@endgroup

@group Users
@endpoint GET /Users
@optional {If-Modified-Since: str(date-time), where: str, order: str}
@returns(200) {Users: [map]}

@endpoint GET /Users/{UserID}
@required {UserID: str(uuid)}
@returns(200) {Users: [map]}

@endgroup

@end
