HTTP Status Codes

Every request includes an HTTP status code with the result. The status code should examined before the response. In most error cases, the response body will contain an errors JSON document with more details.

Successful status codes (2xx)

  • 200 OK
  • The request was successful.
  • 201 Created
  • The resource was successfully created.
  • 204 No Content
  • The request was successful and there is no response body.

Client error status codes (4xx)

  • 400 Bad Request
  • The request was invalid or could not be understood by the server.
    Resubmitting the request will likely result in the same error.
  • 401 Unauthorized
  • Your API key/secret is missing or invalid.
  • 403 No Redemptions
  • Content-type: plain/text. Body: No Redemptions to Void. The call is attempting to record a redemption when there are no redemptions to void. Reject this offer at the point of sale.
  • 404 Not Found
  • The resource was not found with the given identifier. The response body will explain which resource was not found.
  • 405 Method Not Allowed
  • The requested method is not valid at the given URL.
  • 406 Not Acceptable
  • The request’s Accept header is not set to application/json.

Server error status codes (5xx)

  • 500 Internal Server Error
  • The server encountered an error while processing your request and failed.
  • 502 Gateway Error
  • The load balancer or web server has trouble connecting to the Koupon Media server. Please try the request again.
  • 503 Service Unavailable
  • The service is temporarily unavailable. Please try the request again.

Future compatibility

For future compatibility, please interpret the following status code ranges:

  • 200299 as success,
  • 400499 as client request errors,
  • 500599 as server errors