codat test Posted July 5, 2021 Share Posted July 5, 2021 Hi All, Whenever I try to update an invoice from a EU to a non EU customer I get a validation error saying that the line item Tax rate must be Zero Related for customers outside the EU. However I am providing the tax rate Id (GB_ZERO) in the payload but I'm still not having any luck. Please could you advise? Error Messages: - Tax rate is not included in the list - Tax rate must be 'Zero Rated' for Customers outside the EU. Payload (Invoice Line Item) { "sales_invoice":{ "invoice_lines": [ { "description": "Test Item Line", "quantity": "1.0", "unit_price": "100.0", "net_amount": "100.0", "tax_rate_id": "GB_ZERO", "tax_amount": "0.0", "ledger_account_id": "2c8ec978b3bb11ebb35d02665419b6eb", "eu_goods_services_type_id": "SERVICES" } ] } } Regard, Abraham Link to comment Share on other sites More sharing options...
Steel, Mark Posted July 6, 2021 Share Posted July 6, 2021 Hi Abraham, thank you for your question. I've attempted to replicate your issue but cannot invoke the response you are seeing. You did not state where the business is located so I have defaulted to a UK VAT registered business as in your last post. I changed the contact on a sales invoice from an EU VAT registered contact to a rest of world contact without issue. The JSON you provided does not set a new contact_id, do you have the full request please? Understanding the locations and VAT treatment of the current and new contact would also be helpful. { "sales_invoice":{ "contact_id": "bb6929c332e144529d76a15611d5f8ea", "exchange_rate":1, "invoice_lines": [ { "description": "Test Item Line", "quantity": "1.0", "unit_price": "100.0", "net_amount": "100.0", "tax_rate_id": "GB_ZERO", "tax_amount": "0.0", "ledger_account_id": "2c8ec978b3bb11ebb35d02665419b6eb", "eu_goods_services_type_id": "SERVICES" } ] } } Thanks Mark Link to comment Share on other sites More sharing options...
codat test Posted July 6, 2021 Author Share Posted July 6, 2021 Hi Mark, Thanks for your response. Yes the business is located in the UK. Please find the full body below: { "SalesInvoice": { "Id": "a47ccf7e05b64c3682617a6dca046f26", "DisplayedAs": null, "Transaction": null, "CreatedAt": null, "UpdatedAt": null, "DeletedAt": "0001-01-01T00:00:00", "InvoiceNumber": null, "ContactName": null, "ContactReference": null, "Contact": null, "ContactId": "cc80e0fb747e4ddaab743d778d04ec4a", "Date": "2021-07-01T00:00:00", "DueDate": "2021-07-31T00:00:00", "Reference": null, "MainAddressFreeForm": null, "MainAddress": { "Id": "37415aa11e8a4d379b423d961181cd15", "Name": null, "DisplayedAs": "1st Street\nJacksonville FL 0081\nUnited States", "$path": null, "AddressType": null, "AddressTypeId": null, "address_line_1": "1st Street", "address_line_2": null, "City": "Jacksonville", "Region": "FL", "PostalCode": "0081", "Country": null, "CountryId": null, "CountryGroup": null, "CountryGroupId": null }, "DeliveryAddressFreeForm": null, "DeliveryAddress": null, "Notes": null, "TermsAndConditions": null, "ShippingNetAmount": null, "ShippingTaxRate": null, "ShippingTaxAmount": null, "ShippingTaxBreakdown": null, "ShippingTotalAmount": null, "NetAmount": 0, "TaxAmount": 0, "TotalAmount": 0, "TotalPaid": null, "OutstandingAmount": 0, "Currency": null, "CurrencyId": "GBP", "ExchangeRate": 1, "BaseCurrencyShippingNetAmount": null, "BaseCurrencyShippingTaxAmount": null, "BaseCurrencyShippingTaxBreakdown": null, "BaseCurrencyShippingTotalAmount": null, "TotalDiscountAmount": null, "BaseCurrencyTotalDiscountAmount": null, "BaseCurrencyNetAmount": null, "BaseCurrencyTaxAmount": null, "BaseCurrencyTotalAmount": null, "BaseCurrencyOutstandingAmount": null, "Status": null, "Sent": false, "VoidReason": null, "InvoiceLines": [ { "Id": null, "DisplayedAs": null, "Description": "US Customer - PUT", "Product": null, "LedgerAccount": null, "LedgerAccountId": "9a994b92267a11e797950a57719b2edb", "Quantity": 10.0000000000, "UnitPrice": 10.0000000000, "NetAmount": 0, "TaxRate": null, "TaxRateId": "GB_ZERO", "TaxAmount": 0.00, "TaxBreakdown": null, "TotalAmount": 100.00, "BaseCurrencyUnitPrice": null, "BaseCurrencyNetAmount": null, "BaseCurrencyTaxAmount": null, "BaseCurrencyTaxBreakdown": null, "BaseCurrencyTotalAmount": 0, "EuGoodsServicesType": null, "Service": null, "ServiceId": null, "ProductId": null, "DiscountAmount": 0, "BaseCurrencyDiscountAmount": null, "DiscountPercentage": null, "EuGoodsServicesTypeId": "SERVICES" } ], "TaxAddressRegion": null, "WithholdingTaxRate": null, "WithholdingTaxAmount": null, "BaseCurrencyWithholdingTaxAmount": null, "LastPaid": null } } Regards, Abraham Link to comment Share on other sites More sharing options...
Steel, Mark Posted July 6, 2021 Share Posted July 6, 2021 Thanks for the information. The problem is with the setting of the tax_rate_id. You are trying to set an attribute that doesn't exist ("TaxRateId": "GB_ZERO",) should be "tax_rate_id": "GB_ZERO". Thanks Mark Link to comment Share on other sites More sharing options...
codat test Posted July 6, 2021 Author Share Posted July 6, 2021 Hi Mark, When I update the invoice with the same object but with an EU customer its works and sets the correct Tax provided. So I'm not sure were this is going wrong. Regards, Abraham Link to comment Share on other sites More sharing options...
codat test Posted July 6, 2021 Author Share Posted July 6, 2021 I also changed the property name as you suggested but still getting he same response. { "Id": "a47ccf7e05b64c3682617a6dca046f26", "DisplayedAs": null, "Transaction": null, "CreatedAt": null, "UpdatedAt": null, "DeletedAt": "0001-01-01T00:00:00", "InvoiceNumber": null, "ContactName": null, "ContactReference": null, "Contact": null, "ContactId": "cc80e0fb747e4ddaab743d778d04ec4a", "Date": "2021-07-01T00:00:00", "DueDate": "2021-07-31T00:00:00", "Reference": null, "MainAddressFreeForm": null, "MainAddress": { "Id": "37415aa11e8a4d379b423d961181cd15", "Name": null, "DisplayedAs": "1st Street\nJacksonville FL 0081\nUnited States", "$path": null, "AddressType": null, "AddressTypeId": null, "address_line_1": "1st Street", "address_line_2": null, "City": "Jacksonville", "Region": "FL", "PostalCode": "0081", "Country": null, "CountryId": null, "CountryGroup": null, "CountryGroupId": null }, "DeliveryAddressFreeForm": null, "DeliveryAddress": null, "Notes": null, "TermsAndConditions": null, "ShippingNetAmount": null, "ShippingTaxRate": null, "ShippingTaxAmount": null, "ShippingTaxBreakdown": null, "ShippingTotalAmount": null, "NetAmount": 0, "TaxAmount": 0, "TotalAmount": 0, "TotalPaid": null, "OutstandingAmount": 0, "Currency": null, "CurrencyId": "GBP", "ExchangeRate": 1, "BaseCurrencyShippingNetAmount": null, "BaseCurrencyShippingTaxAmount": null, "BaseCurrencyShippingTaxBreakdown": null, "BaseCurrencyShippingTotalAmount": null, "TotalDiscountAmount": null, "BaseCurrencyTotalDiscountAmount": null, "BaseCurrencyNetAmount": null, "BaseCurrencyTaxAmount": null, "BaseCurrencyTotalAmount": null, "BaseCurrencyOutstandingAmount": null, "Status": null, "Sent": false, "VoidReason": null, "InvoiceLines": [ { "Id": null, "DisplayedAs": null, "Description": "US Customer - PUT", "Product": null, "LedgerAccount": null, "LedgerAccountId": "9a994b92267a11e797950a57719b2edb", "Quantity": 10.0000000000, "UnitPrice": 10.0000000000, "NetAmount": 0, "TaxRate": null, "tax_rate_id": "GB_ZERO", "TaxAmount": 0.00, "TaxBreakdown": null, "TotalAmount": 100.00, "BaseCurrencyUnitPrice": null, "BaseCurrencyNetAmount": null, "BaseCurrencyTaxAmount": null, "BaseCurrencyTaxBreakdown": null, "BaseCurrencyTotalAmount": 0, "EuGoodsServicesType": null, "Service": null, "ServiceId": null, "ProductId": null, "DiscountAmount": 0, "BaseCurrencyDiscountAmount": null, "DiscountPercentage": null, "EuGoodsServicesTypeId": "SERVICES", "EUSalesDescriptionId": "ZERO" } ], "TaxAddressRegion": null, "WithholdingTaxRate": null, "WithholdingTaxAmount": null, "BaseCurrencyWithholdingTaxAmount": null, "LastPaid": null } Link to comment Share on other sites More sharing options...
Steel, Mark Posted July 7, 2021 Share Posted July 7, 2021 Hi Abraham If what you have provided above is the PUT request for the sales_invoice it will fail. It looks as if you're using the response from a GET request to then change the value and pass it in to a PUT request. This will not work, the attribute names need to be passed in snake case (tax_rate_id) and not CamelCase (EuGoodsServicesTypeId) as they are seen above. You are also including a lot of un-required values, for example you are passing the sales invoice Id as Id, this is already set in the header of the request. Ideally you should be setting the minimum number of attribute values to make the PUT possible. You can find an example of a sales_invoice PUT request here. Once you've corrected the request please let us know if you are still seeing the response. Regards Mark Link to comment Share on other sites More sharing options...
codat test Posted July 7, 2021 Author Share Posted July 7, 2021 Thanks Mark. I had to provide the LineitemId for it to work. Abraham Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now