Discussion Forums >Shopify APIs & SDKs>402 ( payment required)
Does anyone know what this means in more detail?
402 ( payment required)
Well your description is very short, but maybe your shops plan is 'frozen', you need to select a plan?
Yea unfortunately the error message is very short and not very descriptive. This is happening to some of our clients for a Shopify app. It is not clear if this happens when
1. Stores are frozen and trials run out
2. Stores run out of products for the current plan
3. Other or multiple potential issues
If it's happening when you're using an app, then it's really up to the app developer as to why this happens. Apps can throw pretty much any error they want under any condition. There are certain conventions that people generally follow, but they're by no means mandatory (You could get an HTTP 418 "I'm a teapot", for instance.)
I suggest you contact the app's developers; they'd likely know what this means.
EDIT: Oh. Actually, if you're saying that this is happening to you as an app developer; what specific instances does this happen in? Any time you make a call to their shop?
It was my understanding the "402 (payment required)" was a Shopify specific message and not clear what triggers that specific error code so we can properly inform our app users of the issue.
Who reports this error? Do your customers receive this error when using your App? Or do you see it for example in your log files?
This is the response in logs
'http_status_message' => 'Payment Required','http_status_code' => '402','server' => 'nginx','date' => 'Tue, 28 May 2013 19:10:45 GMT','content-type' => 'application/json; charset=utf-8','transfer-encoding' => 'chunked','connection' => 'keep-alive','status' => '402 Payment Required',
And some users get the error when using the app.
Maybe you could drill down more to a specific action where the error occurs. For example "it only occurs when I'm accessing a Product using the ShopifyAPI" or "it occurs every time I'm using the ShopifyAPI".
If you're on Rails and use the shopify_api gem you can add logging with a rescue_from in the ApplicationController. Because the shopify_api gem uses ActiveResource you can rescue ActiveResource::ClientErrors. The example code below will rescue the error, do some logging and re-raise error.
rescue_from ActiveResource::ClientError do |exception|
Log in or sign up for an account to reply.
This thread has been closed! You will not be able to reply.
Build an online store with Shopify