How do I "uncheck" a multi_choice field with the PUT/update customer API?

ChrisSteeleChrisSteele Posts: 1Member
edited July 22 in Development

I have a custom field which has 12 options (months of the year) that can be checked or unchecked as needed. I can update a field to turn it on, but I can't figure out how to turn it off. The value seems to have no effect. Here's what I'm sending in the PUT body to turn on a month. How would I turn this month back off?

{
    "CustomFieldValues": {
        "CustomFieldValue": [{
            "customFieldID": "13",
            "value": {
                "customFieldChoiceID": "11",
                "value": ""
            }
        }]
    }
}

The api I'm using is a PUT with https://api.lightspeedapp.com/API/Account/${accountId}/Customer/$[custId}.json

Tags:

1 comment

  • Adrian SamuelAdrian Samuel Posts: 495Moderator, Lightspeed Staff moderator

    Hey @ChrisSteele,

    A boolean set to true would check the box and a boolean set to false would uncheck the checkbox.

    Here's a similar payload I've just tested in my own sandbox:

    {
    
      "CustomFieldValues": {
        "CustomFieldValue": [{
          "customFieldID": "{{id}}",
          "value": false    
        }]
      }
    
    }
    


    I hope this helps!

    Adrian Samuel

    API Integrations Consultant - Strategic Solutions

    Lightspeed HQ

Sign In or Register to comment.