Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3820

What is HTTP status code for a disabled REST API feature?

$
0
0

We have REST API endpoints that all users are free to use and other endpoints that users can use if they have explicitly enabled and paid for some specific feature.

What should be the correct status code returned from the paid endpoints if it has not been enabled by the user?

I see 2 options:

  1. 402 Payment required
  2. 403 Forbidden

402 is described as a nonstandard client error status response code that is reserved for future use, so I do not feel like this is the right status code for this case.

Are there any other status codes that would fit this case better?


Viewing all articles
Browse latest Browse all 3820

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>