News for hackers. Stuff that matters.
Re:HTTP 402: Payment Required by jto1218 on Saturday February 01, 2020 @08:49PM (#22214608)
Shopify’s REST API returns 402s when the shop whose data you’re interacting with hasn’t paid its Shopify bill. Always thought it was an interesting usage cause the payment-required relationship is between the shop and Shopify, as opposed to the shop and the application hitting the API.
Re:HTTP 402: Payment Required by OJFord on Saturday February 01, 2020 @09:55PM (#22214850)
Actually I'm not sure that is interesting - from Shopify's perspective it is payment-required. If the shop's dodgy JS sent a malformed request body, you'd get a 400 - even though the bad-request relationship is between the shop and Shopify.
Re:HTTP 402: Payment Required by kedean on Saturday February 01, 2020 @11:59PM (#22215232)
It does violate the contract of 4xx errors though, that a 4xx indicates a client error. If the store hasn't paid up, that's not the clients fault nor can they fix it. It should be some kind of 5xx for customers.
Re:HTTP 402: Payment Required by krainboltgreene on Sunday February 02, 2020 @06:13AM (#22216416)
If an admin disables your account by accident, that's still a 401. Just because the client can't change something, doesn't mean it doesn't fit along with the 4XX brand.
Re:HTTP 402: Payment Required by takeda on Sunday February 02, 2020 @09:50PM (#22221030)
401 means authentication is required. If Shopify is sending that to clients, because admin disabled access, that's just another example of abusing the error codes
Re:HTTP 402: Payment Required by pyuser583 on Saturday February 01, 2020 @09:24PM (#22214745)
Yeah ... current practice treats the need for payment as a permissions issue and thus 403.

But in Shopify’s case, the client has no permissions problem.

What you’re describing really is a 500-range issue ... or even an old fashioned 404.

Like I said on another comment, this really is a header or body issue.

Re:HTTP 402: Payment Required by mewpmewp2 on Sunday February 02, 2020 @02:36AM (#22215717)
Yeah I am thinking 503 to be the most appropriate.