d
Topic
heart Member
Posts:
7
11 months ago

402 ( payment required) This post is outdated

Does anyone know what this means in more detail?

 

402 ( payment required)

 

i
Replies
hj Shopify Partner sudoit.nl
Posts:
201
11 months ago

Well your description is very short, but maybe your shops plan is 'frozen', you need to select a plan?

heart Member
Posts:
7
11 months ago

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

Adam Harrison Member
Posts:
127
Last edited 11 months ago
g
1
upvotes

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?

 

heart Member
Posts:
7
11 months ago

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.

hj Shopify Partner sudoit.nl
Posts:
201
11 months ago

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?

heart Member
Posts:
7
11 months ago

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',

heart Member
Posts:
7
11 months ago

And some users get the error when using the app.

hj Shopify Partner sudoit.nl
Posts:
201
11 months ago

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|
    logger.error exception.inspect
    logger.error request.fullpath.inspect
    logger.error request.params.inspect
    raise
  end

HJ

Log in or sign up for an account to reply.

This thread has been closed! You will not be able to reply.