PUT command to update Customer does not modify my resource

24 views
Skip to first unread message

Jonathan Barksdale

unread,
Jun 2, 2017, 7:21:49 AM6/2/17
to Lightspeed Retail API Developers
Hello,

I am running into some strange behavior from LSR and hoping that you someone can shed some light on this.  I am trying to use a PUT command in order to update a few fields in a specific Customer record.   The URL is valid as shown below (where AccountNumberHere is actually our Account Number, which I am not displaying here for security purposes):

https://api.merchantos.com/API/Account/<AccountNumberHere>/Customer/5030

I know that I am passing a valid JSON set to the API because the call returns a 200 status and returns the resource in my response body;  however, NONE of my changes are updated on the customer record.

Is the PUT command working in the Customer API?  Why would it return 200 if it is not updating anything correctly?  Does anyone have any experience with a similar type of behavior?  I'm very confused by this...

Thanks,
Jonathan

PS:  Does anyone actively monitor and curate this group?  I've asked a question before and not received any responses...

Justin Hildreth

unread,
Jun 2, 2017, 8:35:19 AM6/2/17
to Lightspeed Retail API Developers
Hi Jonathan,

I can't speak definitively about the backend workings of the API, but I can say that I share your experiences here. I have had cases where I've attempted to update a field via a PUT that can not be updated, and I received a failure response and message. However, I've also tried to update fields that simply return a 200 with no change, as you describe. I've found this is also the case if one provides fields that are not present on the data object at all - so I would suspect the backend code is simply scanning for expected fields, and ignoring any it does not expect to receive.
Listing the fields you're attempting to update may allow some to comment on those fields.
As for this group - I've had mixed results. I've gotten some good responses from Lightspeed support here, though at times it's in the form of a ticket that's opened for me, so that isn't necessarily visible to others. I've had really good results with contacting support with API questions directly. I know Lightspeed also has another group discussion platform in the works, but I'm not sure it's in full use yet - others could provide better insight to that.

Have a good one.
Justin

Jonathan Barksdale

unread,
Jun 2, 2017, 8:48:09 AM6/2/17
to Lightspeed Retail API Developers
Just to add to the original post (per Justin's suggestion), I want to add that the fields that I am attempting to modify are:

CustomFieldValues (my primary need is to modify these custom field settings),   

and...

Title.

The title should be an especially simple update, but nothing changes.

Thanks...

tby...@gmail.com

unread,
Jul 26, 2017, 11:06:30 PM7/26/17
to Lightspeed Retail API Developers
Did not test your specific issue but the idea of getting a 200 but actually failing is unfortunately not news.
First break your update into two calls, 1 for the title and 1 for the customfieldvalues. If that resolved your issue submit a ticket.
If that did not resolve double-check that the customer object already has these customfieldvalues associated. If the customer does not set them in the UI then PUT the change, did that work? If so....well submit a ticket but don't hold your breath on resolution.
Reply all
Reply to author
Forward
0 new messages