Allows you to update OR create one or more sales invoices or purchase bills

POST {{baseUrl}}/Invoices?summarizeErrors=false&unitdp=<integer>

Request Params

KeyDatatypeRequiredDescription
summarizeErrorsbooleanIf false return 200 OK and mix of successfully created objects and any with validation errors
unitdpstringe.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

Request Body

{"Invoices"=>[{"Type"=>"<string>", "Contact"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "LineItems"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}], "Date"=>"<string>", "DueDate"=>"<string>", "LineAmountTypes"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "InvoiceNumber"=>"<string>", "Reference"=>"<string>", "BrandingThemeID"=>"<uuid>", "Url"=>"<string>", "CurrencyCode"=>"<string>", "CurrencyRate"=>"<double>", "Status"=>"<string>", "SentToContact"=>"<boolean>", "ExpectedPaymentDate"=>"<string>", "PlannedPaymentDate"=>"<string>", "InvoiceID"=>"<uuid>", "RepeatingInvoiceID"=>"<uuid>", "Attachments"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}], "HasErrors"=>"false", "StatusAttributeString"=>"<string>", "ValidationErrors"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}], "Warnings"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}]}, {"Type"=>"<string>", "Contact"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "LineItems"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}], "Date"=>"<string>", "DueDate"=>"<string>", "LineAmountTypes"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "InvoiceNumber"=>"<string>", "Reference"=>"<string>", "BrandingThemeID"=>"<uuid>", "Url"=>"<string>", "CurrencyCode"=>"<string>", "CurrencyRate"=>"<double>", "Status"=>"<string>", "SentToContact"=>"<boolean>", "ExpectedPaymentDate"=>"<string>", "PlannedPaymentDate"=>"<string>", "InvoiceID"=>"<uuid>", "RepeatingInvoiceID"=>"<uuid>", "Attachments"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}], "HasErrors"=>"false", "StatusAttributeString"=>"<string>", "ValidationErrors"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}], "Warnings"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}]}]}

HEADERS

KeyDatatypeRequiredDescription
xero-tenant-idstring(Required) Xero identifier for Tenant
Content-Typestring

RESPONSES

status: OK

{&quot;Id&quot;:&quot;ccece84a-075c-4fcd-9073-149d4f7a91cf&quot;,&quot;Status&quot;:&quot;OK&quot;,&quot;ProviderName&quot;:&quot;Provider Name Example&quot;,&quot;DateTimeUTC&quot;:&quot;/Date(1552327126164)/&quot;,&quot;Invoices&quot;:[{&quot;Type&quot;:&quot;ACCREC&quot;,&quot;InvoiceID&quot;:&quot;ed255415-e141-4150-aab7-89c3bbbb851c&quot;,&quot;InvoiceNumber&quot;:&quot;INV-0007&quot;,&quot;Reference&quot;:&quot;Website Design&quot;,&quot;Prepayments&quot;:[],&quot;Overpayments&quot;:[],&quot;AmountDue&quot;:40.0,&quot;AmountPaid&quot;:0.0,&quot;SentToContact&quot;:false,&quot;CurrencyRate&quot;:1.0,&quot;HasErrors&quot;:false,&quot;IsDiscounted&quot;:false,&quot;Contact&quot;:{&quot;ContactID&quot;:&quot;430fa14a-f945-44d3-9f97-5df5e28441b8&quot;,&quot;ContactStatus&quot;:&quot;ACTIVE&quot;,&quot;Name&quot;:&quot;Liam Gallagher&quot;,&quot;FirstName&quot;:&quot;Liam&quot;,&quot;LastName&quot;:&quot;Gallagher&quot;,&quot;EmailAddress&quot;:&quot;liam@rockstar.com&quot;,&quot;BankAccountDetails&quot;:&quot;&quot;,&quot;Addresses&quot;:[{&quot;AddressType&quot;:&quot;STREET&quot;,&quot;City&quot;:&quot;&quot;,&quot;Region&quot;:&quot;&quot;,&quot;PostalCode&quot;:&quot;&quot;,&quot;Country&quot;:&quot;&quot;,&quot;AttentionTo&quot;:&quot;&quot;},{&quot;AddressType&quot;:&quot;POBOX&quot;,&quot;City&quot;:&quot;Anytown&quot;,&quot;Region&quot;:&quot;NY&quot;,&quot;PostalCode&quot;:&quot;10101&quot;,&quot;Country&quot;:&quot;USA&quot;,&quot;AttentionTo&quot;:&quot;&quot;}],&quot;Phones&quot;:[{&quot;PhoneType&quot;:&quot;DEFAULT&quot;,&quot;PhoneNumber&quot;:&quot;222-2222&quot;,&quot;PhoneAreaCode&quot;:&quot;212&quot;,&quot;PhoneCountryCode&quot;:&quot;&quot;},{&quot;PhoneType&quot;:&quot;DDI&quot;,&quot;PhoneNumber&quot;:&quot;&quot;,&quot;PhoneAreaCode&quot;:&quot;&quot;,&quot;PhoneCountryCode&quot;:&quot;&quot;},{&quot;PhoneType&quot;:&quot;FAX&quot;,&quot;PhoneNumber&quot;:&quot;333-2233&quot;,&quot;PhoneAreaCode&quot;:&quot;212&quot;,&quot;PhoneCountryCode&quot;:&quot;&quot;},{&quot;PhoneType&quot;:&quot;MOBILE&quot;,&quot;PhoneNumber&quot;:&quot;444-3433&quot;,&quot;PhoneAreaCode&quot;:&quot;212&quot;,&quot;PhoneCountryCode&quot;:&quot;&quot;}],&quot;UpdatedDateUTC&quot;:&quot;/Date(1551747281053+0000)/&quot;,&quot;ContactGroups&quot;:[{&quot;ContactGroupID&quot;:&quot;17b44ed7-4389-4162-91cb-3dd5766e4e22&quot;,&quot;Name&quot;:&quot;Oasis&quot;,&quot;Status&quot;:&quot;ACTIVE&quot;,&quot;Contacts&quot;:[],&quot;HasValidationErrors&quot;:false}],&quot;IsSupplier&quot;:true,&quot;IsCustomer&quot;:true,&quot;SalesTrackingCategories&quot;:[],&quot;PurchasesTrackingCategories&quot;:[],&quot;ContactPersons&quot;:[{&quot;FirstName&quot;:&quot;Debbie&quot;,&quot;LastName&quot;:&quot;Gwyther&quot;,&quot;EmailAddress&quot;:&quot;debbie@rockstar.com&quot;,&quot;IncludeInEmails&quot;:false}],&quot;HasValidationErrors&quot;:false},&quot;DateString&quot;:&quot;2019-03-11T00:00:00&quot;,&quot;Date&quot;:&quot;/Date(1552262400000+0000)/&quot;,&quot;DueDateString&quot;:&quot;2018-12-10T00:00:00&quot;,&quot;DueDate&quot;:&quot;/Date(1544400000000+0000)/&quot;,&quot;Status&quot;:&quot;AUTHORISED&quot;,&quot;LineAmountTypes&quot;:&quot;Exclusive&quot;,&quot;LineItems&quot;:[{&quot;Description&quot;:&quot;Acme Tires&quot;,&quot;UnitAmount&quot;:20.0,&quot;TaxType&quot;:&quot;NONE&quot;,&quot;TaxAmount&quot;:0.0,&quot;LineAmount&quot;:40.0,&quot;AccountCode&quot;:&quot;200&quot;,&quot;Tracking&quot;:[],&quot;Quantity&quot;:2.0,&quot;LineItemID&quot;:&quot;5f7a612b-fdcc-4d33-90fa-a9f6bc6db32f&quot;,&quot;ValidationErrors&quot;:[]}],&quot;SubTotal&quot;:40.0,&quot;TotalTax&quot;:0.0,&quot;Total&quot;:40.0,&quot;UpdatedDateUTC&quot;:&quot;/Date(1552327126117+0000)/&quot;,&quot;CurrencyCode&quot;:&quot;NZD&quot;,&quot;StatusAttributeString&quot;:&quot;OK&quot;}]}