billduapp / api_documentation

Documentation for Billdu.com REST API
0 stars 2 forks source link

multiple properties not defined when updating a client #2

Open slano opened 5 years ago

slano commented 5 years ago

Hi Billdu,

when creating a client the following payload sent via POST request works without any issue:

{
  "company": "ACME Ltd.",
  "street": "1st Avenue",
  "street2": "",
  "zip": "",
  "city": "New York",
  "province": "New York",
  "country": "US",
  "shippingCompany": "",
  "shippingStreet": "",
  "shippingStreet2": "",
  "shippingZip": "",
  "shippingCity": "",
  "shippingProvince": "",
  "shippingCountry": "",
  "phone": "+555555555",
  "mobil": "+5555550000",
  "fax": "",
  "web": "example.com",
  "note": "",
  "email": "acme@example.com",
  "companyId": "",
  "vatId": "",
  "taxId": "US13456789"
}

However, updating using PATCH request only works for following properties:

{
  "company": "ACME Ltd.",
  "street": "1st Avenue",
  "zip": "",
  "city": "New York",
  "province": "New York",
  "country": "US",
  "phone": "+555555555",
  "mobil": "+5555550000",
  "fax": "",
  "web": "example.com",
  "note": "",
  "email": "acme@example.com",
  "companyId": "",
  "vatId": "",
  "taxId": "US13456789"
}

trying to update any of the following properties will trigger a 500 response:

{
  "street2": "",
  "shippingCompany": "",
  "shippingStreet": "",
  "shippingStreet2": "",
  "shippingZip": "",
  "shippingCity": "",
  "shippingProvince": "",
  "shippingCountry": ""
}

error message (example for "street2"): "message":"MF\\Json\\ValidationException:property []: The property street2 is not defined and the definition does not allow additional properties"

Unfortunately I didn't find a part related to updating a client in the API documentation. Is updating a client via API supported functionality?

Lordchapter commented 4 years ago

Hi Slano,

Did you actually get a response from Billdu? I am trying to do the same, but the API documentation is not complete...

Also, is it not strange that, in order to update Mobile and VAT fields you need to use "mobil" and "vatId", but the response has "mobile" and "vat_id"? Or is that just me? If I dit not see your post here, I would not have succeeded in updating those fields.

Thanks!

slano commented 4 years ago

Hi @Lordchapter, based on the response I received by email from the support team the issue should be fixed by now..