Updating customer phone

Hello,

i’m having issues adding/updating customers phone number.

So e.g. we have existing customer that may or may not have phone number set. If i try to add or update phone with patch request as suggested, patch data looking like this:

[{op: ‘add’, path: ‘/phones’, value: {:MOBILE=>{:areaCode=>‘44’, :localPhoneNumber=>‘7786675605’}}}]

request goes through and everything seems to be fine.

But when i try to fetch this customer afterwards, i’m getting this error:

JSON patch is invalid: Null key for a Map not allowed in JSON (use a converting NullKeySerializer?) (through reference chain: co.poynt.api.model.Customer[ " phones " ]->java.util.HashMap[ " null " ])

Just one note to add, if i create new customer with same json structure, meaning:
{phones: {:MOBILE=>{:areaCode=>‘44’, :localPhoneNumber=>‘7786675605’}}}
everything is fine, customer is created with phone and reachable afterwards.

Also creating and adding/updating customers emails works fine, its just phones that are making issues for me.

Any help would be appreciated.

Cheers

The patch request should have values for these two as well:
Boolean isPrimaryDayTime
Boolean isPrimaryEvening

Hey kastureema,

thanks for the response.

So patch request body should look like this:

[{op: ‘add’, path: ‘/phones’, value: {:MOBILE=>{:areaCode=>‘44’, :localPhoneNumber=>‘7786675605’}}, isPrimaryDayTime: truefalse, isPrimaryEvening: true/false}]

Did i get this right? And this is only when updating phones, or always?
What does this parameters mean?

Also, now since i’ve updated one customer with patch data from previous post, my get customers api (businesses/#business_id/customers) doesn’t work anymore, im getting this error when trying to do GET:

Could not write content: Null key for a Map not allowed in JSON (use a converting NullKeySerializer?) (through reference chain: co.poynt.api.model.CustomerList[ " customers " ]->java.util.ArrayList[0]->co.poynt.api.model.Customer[ " phones " ]->java.util.HashMap[ " null " ]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Null key for a Map not allowed in JSON (use a converting NullKeySerializer?) (through reference chain: co.poynt.api.model.CustomerList[ " customers " ]->java.util.ArrayList[0]->co.poynt.api.model.Customer[ " phones " ]->java.util.HashMap[ " null " ])

How can i fix this?

Thanks