Allows you to create a credit note
PUT {{baseUrl}}/CreditNotes?summarizeErrors=false&unitdp=<integer>
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
summarizeErrors | boolean | If false return 200 OK and mix of successfully created objects and any with validation errors | |
unitdp | string | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts |
Request Body
{"CreditNotes"=>[{"Type"=>"<string>", "Contact"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "Date"=>"<string>", "DueDate"=>"<string>", "Status"=>"<string>", "LineAmountTypes"=>{"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>"}], "SubTotal"=>"<double>", "TotalTax"=>"<double>", "Total"=>"<double>", "CurrencyCode"=>"<string>", "FullyPaidOnDate"=>"<string>", "CreditNoteID"=>"<uuid>", "CreditNoteNumber"=>"<string>", "Reference"=>"<string>", "CurrencyRate"=>"<double>", "RemainingCredit"=>"<double>", "Allocations"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}], "AppliedAmount"=>"<double>", "Payments"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}], "BrandingThemeID"=>"<uuid>", "StatusAttributeString"=>"<string>", "HasAttachments"=>"false", "HasErrors"=>"false", "ValidationErrors"=>[{"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>"}, "Date"=>"<string>", "DueDate"=>"<string>", "Status"=>"<string>", "LineAmountTypes"=>{"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>"}], "SubTotal"=>"<double>", "TotalTax"=>"<double>", "Total"=>"<double>", "CurrencyCode"=>"<string>", "FullyPaidOnDate"=>"<string>", "CreditNoteID"=>"<uuid>", "CreditNoteNumber"=>"<string>", "Reference"=>"<string>", "CurrencyRate"=>"<double>", "RemainingCredit"=>"<double>", "Allocations"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}], "AppliedAmount"=>"<double>", "Payments"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}], "BrandingThemeID"=>"<uuid>", "StatusAttributeString"=>"<string>", "HasAttachments"=>"false", "HasErrors"=>"false", "ValidationErrors"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}]}]}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
xero-tenant-id | string | (Required) Xero identifier for Tenant | |
Content-Type | string |
RESPONSES
status: OK
{"Id":"5e57a661-42da-4a19-96a0-00405a0e946d","Status":"OK","ProviderName":"Provider Name Example","DateTimeUTC":"/Date(1551812702713)/","CreditNotes":[{"CreditNoteID":"f9256f04-5a99-4680-acb9-6b4639cc439a","CreditNoteNumber":"","Payments":[],"ID":"f9256f04-5a99-4680-acb9-6b4639cc439a","CurrencyRate":1.0,"Type":"ACCPAYCREDIT","Reference":"","RemainingCredit":46.0,"Allocations":[],"Contact":{"ContactID":"430fa14a-f945-44d3-9f97-5df5e28441b8","ContactStatus":"ACTIVE","Name":"Liam Gallagher","FirstName":"Liam","LastName":"Gallagher","EmailAddress":"liam@rockstar.com","BankAccountDetails":"","Addresses":[{"AddressType":"STREET","City":"","Region":"","PostalCode":"","Country":"","AttentionTo":""},{"AddressType":"POBOX","City":"Anytown","Region":"NY","PostalCode":"10101","Country":"USA","AttentionTo":""}],"Phones":[{"PhoneType":"DEFAULT","PhoneNumber":"222-2222","PhoneAreaCode":"212","PhoneCountryCode":""},{"PhoneType":"DDI","PhoneNumber":"","PhoneAreaCode":"","PhoneCountryCode":""},{"PhoneType":"FAX","PhoneNumber":"333-2233","PhoneAreaCode":"212","PhoneCountryCode":""},{"PhoneType":"MOBILE","PhoneNumber":"444-3433","PhoneAreaCode":"212","PhoneCountryCode":""}],"UpdatedDateUTC":"/Date(1551747281053+0000)/","ContactGroups":[],"ContactPersons":[],"HasValidationErrors":false},"DateString":"2019-01-05T00:00:00","Date":"/Date(1546646400000+0000)/","Status":"DRAFT","LineAmountTypes":"Exclusive","LineItems":[{"Description":"Foobar","UnitAmount":20.0,"TaxType":"INPUT2","TaxAmount":6.0,"LineAmount":40.0,"AccountCode":"400","Tracking":[],"Quantity":2.0,"ValidationErrors":[]}],"SubTotal":40.0,"TotalTax":6.0,"Total":46.0,"UpdatedDateUTC":"/Date(1551812702650+0000)/","CurrencyCode":"NZD","StatusAttributeString":"OK","ValidationErrors":[{"Message":"An existing Credit Note with the specified CreditNoteID could not be found"}]}]}