Closed cameronbourgeois closed 1 year ago
Wow, ok, so I need to add summarize_errors: false
to my call, like so:
api_response = xero_client.accounting_api.create_invoices(stored_tenant_id, invoice_params, unitdp: 4, summarize_errors: false)
Now the XeroRuby::ApiError is not raised, and the api_response
does contain the successful invoices as expected.
accounting_api.create_invoices
fails to return data regarding any successful invoices when 1 or more of the invoices within the same payload fail validation.My code:
The result of the above code is that
error_response
contains data pertaining only to the failed invoice with ref 002. The invoice with ref 001 has been successfully created in Xero, butapi_response
isnil
so I immediately lose track of the invoice that was created.Note that the validation error that is triggering the XeroRuby::ApiError is an invalid item_code:
"Item code 'X' is not valid"
.