Hi @mpspw!
A fix was implemented for this, you should be able to update products now using that same mutation.
Let me know if you receive any other errors
Thanks!
Tom
Exception in Task: Unhandled errors
{“message”: “Unexpected error. Please contact a system administrator.”}Error getting HTTP response: The remote server returned an error: (400) Bad Request.
Looks like you are looking for the warehouse_product_update mutation.
That mutation will allow you to change both on hand and inventory, something like:
Product_update will allow you to change the information on the product, such as dimensions, name, country of manufacture or other characteristics, but warehouse_product_update will allow you to change values associated with inventory, such as on hand, inventory bin or some other characteristics such as price or value.
Let me know if there is anything else I can help you with.
Thanks!
At first glance, that looks like exactly what I want. Unfortunately, it didn’t work. I’ve tried this statement in various formats - exactly as it appears below, again removing all the newline characters (the API doesn’t seem to like them when it’s my automation tool that sends the request), again removing the “=” at the end of the warehouse ID (because I wasn’t sure if that was officially part of the ID since your example didn’t have one).
No, because the request doesn’t return a request ID. This is what it returns:
Exception in Task: Unhandled errors
{"message": "Unexpected error. Please contact a system administrator."}Error getting HTTP response: The remote server returned an error: (400) Bad Request.
This is the request I sent. It’s exactly like above (with the “=” added back into the warehouse ID), except that I removed the newline characters since they seem to confuse the API.
This is the query that I have working for the warehouse ID:
{"query":
"query {
account {
complexity
request_id
data {
id
legacy_id
email
username
status
is_3pl
warehouses {
id
legacy_id
identifier
}
}
}
}"
}
I find it strange that the API needs to be told twice what I’m sending it (i.e. a query) before it understands, but for some reason that’s what’s required, so I’m not complaining. I tried that same method with this mutation, thinking maybe it’d work, but still no luck. I tried both of these:
Is there any way to get the API to return more information? Simply saying “bad request” doesn’t tell me much. To me, what it means is that there’s a syntax error in the JSON I’m trying to send, but it doesn’t give me any hint as to where the error is. It’d be nice if it said “missing colon near position 43”, “missing close curly brace near position 156”, “invalid warehouse ID”, or something more informative like that. Or at the very least, continued to say “bad request” but did return a request ID so that I could provide that to you.
query {
account {
complexity
request_id
data {
id
legacy_id
email
username
status
is_3pl
warehouses {
id
legacy_id
identifier
}
}
}
}
What are you using to send the request? It may not be formatting the query/mutation correctly.
If you use Altair, GraphQL Playground or Insomnia IDEs, for example, do this query work on your account?
Another debug option would be to redirect that exact same mutation to some test endpoint such as the ones at https://requestbin.com/
And compare between the IDE and your APP, then see what’s missing and try to make them match
The one I’ve been trying with is VisualCron. I’ve gotten the Auth Token and Warehouse ID stuff to work, but it doesn’t want to work with anything else. I’ve also installed the Altair desktop client, but I can’t get that to do anything since it doesn’t like the API url:
I remember having that problem with the desktop client several months ago, so I installed the Chrome client (which worked), but now it seems my company has locked down that extension so I can’t turn it back on.
Well don’t I feel dumb now. The Altair desktop client wasn’t working because I forgot to add my auth token in the header. I’ll play around with that for a bit and see if I can figure something out.
So in particular, whenever something gets sent to the API, for some reason it has to be surrounded in this:
{"query": " <insert your JSON here> "}
That part, I had already been doing in my automation tool. But, notice that the JSON you want to send is enclosed in quotes. What was causing the issue is that the JSON itself also included quotes, which I needed to escape in the string. Once I did that, things started to work.