My Products
Help
mrtnsn
CONTRIBUTOR ***

CustomerUpdate issues

by mrtnsn

Hi, trying to update a customer but some of the fields is not updated.

 

Endpoint: /controller/api/v1/customer/{customerCd}

 

JSON:

{
    "sendInvoicesByEmail" => {
        "value" => true
    }
}

 

Response: 204

 

GUI:

Screenshot 2020-10-26 at 09.50.15.png

 

The field I tried to update did not set properly.

I have also tried to update "printInvoices", "acceptAutoInvoices", "printStatements", and most of the other checkboxes that can be found in this window without success. I have also tried to add other fields and these fields do update just fine, e.g. add a char to the name of the customer.

 

The first update I did today did work, I set "acceptAutoInvoices" to "false", after this no other update call have worked.

 

Also it seems the field "MailDunningLetters" is missing from the API.

6 REPLIES 6

by Magnus Johnsen

Hi,

 

The JSON should look like this:

 

{
    "sendInvoicesByEmail" : {
        "value" : true
    }
}

We have just tested this and the update goes through without issues.

Regarding fields that you wish were exposed, please write a post in the ideas part of the forum. The posts there will be reviewed by the development team.

 

Thank you. 

mrtnsn
CONTRIBUTOR ***

by mrtnsn

Just copy pasted the json from PHP without correcting it. The JSON that is sent is correct.

 

Can you try with setting all the checkboxes to false first? And then updating a single of them to true again? Because with this current customer I cannot set a single of those fields to true via the API.

by Magnus Johnsen

The result:

1. Set all to false
PUT Customer/10000

{
    "printInvoices": {
    "value": false
  },
  "acceptAutoInvoices": {
    "value": false
  },
  "sendInvoicesByEmail": {
    "value": false
  },
  "printStatements": {
    "value": false
  },
  "sendStatementsByEmail": {
    "value": false
  },
  "printMultiCurrencyStatements": {
    "value": false
  }
}

2020-10-26 10_18_42-Customers.png

2. Set all to true

PUT Customer/10000

{
    "printInvoices": {
    "value": true
  },
  "acceptAutoInvoices": {
    "value": true
  },
  "sendInvoicesByEmail": {
    "value": true
  },
  "printStatements": {
    "value": true
  },
  "sendStatementsByEmail": {
    "value": true
  },
  "printMultiCurrencyStatements": {
    "value": true
  }
}

2020-10-26 10_20_35-Customers.png

mrtnsn
CONTRIBUTOR ***

by mrtnsn

Thank you for testing it. Is there something else, like settings, customer profile, etc, that can stop it from working?

 

Because running the same query here does not work.

Accepted solution
Magnus Johnsen
VISMA

by Magnus Johnsen

Could you please test to run the query from Postman or swagger? Are you having the same issue on several customers or is it only this one?

There is not setting that comes to mind that should prevent you from ticking any of the boxes.

mrtnsn
CONTRIBUTOR ***

by mrtnsn

It worked via Postman so I will investigate what is happening when setting a field to true from the code.