Not able to update Customer's custom field individually.

Ankit GeeksAnkit Geeks Posts: 10Member
edited March 11 in Retail API

Hi Support,

I'm facing an issue when updating a custom field value for customer. I have 2 custom field for a customer. One is type= date and other is type text.

I am using lightspeed retail API to update custom field of a customer.

API ENdpoint = https://api.lightspeedapp.com/API/Account/{MYACCOUNTID}/Customer/{CUSTOMERID}.json?load_relations=["CustomFieldValues"]

1. When I updating both field in a single API call it os working, here is my json request body

{

"CustomFieldValues":{

"CustomFieldValue":[

{

"customFieldID": 7,

"value": "22-02-2020T00:00:00+05:00"

},

{

"customFieldID": 4,

"value": "This is test"

}

]

},

}

2. When I updating only date field, API request is working fie again. Here is my json request body:

{

"CustomFieldValues":{

"CustomFieldValue":[

{

"customFieldID": 7,

"value": "22-02-2020T00:00:00+05:00"

}

]

},

}

3. When I updating only text field it is throwing a error, here is my API request body [Not Working]


{

"CustomFieldValues":{

"CustomFieldValue":[

{

"customFieldID": 4,

"value": "This is test"

}

]

},

}

ERROR: Invalid CustomFieldValue date="2020-03-20T18:00:00-0600"

Could you please have a look into my request and let me know a solution.

Thanks

Post edited by Ankit Geeks on

Answers

  • messhiasmesshias Posts: 35Member

    How it's configured your custom field type? It's a string, date, number...?

  • messhiasmesshias Posts: 35Member

    Because I was got this problem too, but someone goes to the lightspeed dashboard for any reason and change the customField type, what it should not be allowed to do after has some record.

  • Ankit GeeksAnkit Geeks Posts: 10Member

    As I mentioned I have two field One is type= date and other is type text.

    When I updating a date field, it is working fine. But When I updating a text field it showing below error

    ERROR: Invalid CustomFieldValue date="2020-03-20T18:00:00-0600"

  • Alex LugoAlex Lugo Posts: 131Administrator, Lightspeed Staff moderator

    Hello @Ankit Geeks,

    The custom field type is date, this is why you can only enter a date value. The response provided misleads you, but the error message indicates that the custom field type is date.

    Alex Lugo
    API Support Specialist
    Lightspeed HQ
  • Ankit GeeksAnkit Geeks Posts: 10Member

    yes I understood but I only want to update one field (text)

    I'm not passing any value for date field.

    Here is my request payload, customFieldID=4 is a type string field.

    {

    "CustomFieldValues":{

    "CustomFieldValue":[

    {

    "customFieldID": 4,

    "value": "This is test"

    }

    ]

    },

    }

Sign In or Register to comment.