Skip to content

Incorrect 'taxes' field type in Customer entity causing inability to modify Customer object #28

@henriAbel

Description

@henriAbel

Problem
When 'taxes' are added to the customer entity, it renders the customer object unmodifiable. This issue seems to stem from the 'taxes' field type discrepancy. As per the documentation, the 'taxes' field should accept an array of tax IDs. However, the current implementation of this library sends the entire TaxRate object instead.
Error code when updating customer with existing tax {"type":"invalid_request","message":"Taxes is invalid","param":"taxes"}

EDIT: Same issue seems to affect Subscription entity also

Added bonus, the field is marked as 'JsonInclude.Include.NON_EMPTY', preventing this field from being set as empty or removing the last item from it, relates to my previous issue (Issue #27).

Example request made by Invoiced SDK

{
   "name":"...",
   "number":"1279",
   "email":"...",
   "autopay":false,
   "autopay_delay_days":-1,
   "payment_terms":"NET 14",
   "type":"company",
   "country":"..",
   "chase":true,
   "taxable":true,
   "tax_id":"...",
   "taxes":[
      {
         "name":"Estonia-20",
         "value":20.0,
         "is_percent":true,
         "inclusive":false
      }
   ],
   "credit_hold":false,
   "bill_to_parent":false
}

Same request made by web client

{
   "name":"...",
   "number":"1279",
   "email":"...",
   "autopay":false,
   "autopay_delay_days":-1,
   "payment_terms":"NET 14",
   "type":"company",
   "country":"..",
   "chase":true,
   "taxable":true,
   "tax_id":"...",
   "taxes": ["estonia-20"],
   "credit_hold":false,
   "bill_to_parent":false
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions