SmakeSmake API Docs
Basic Usage

HTTP Status

Smake Checkout API — HTTP Status

Along with the HTTP methods that the API responds to, it will also return standard HTTP statuses, including error codes.

In the case of a problem, the status contains the error code, while the body of the response will usually contain additional information about the problem that was encountered.

Successful

In general, if the status returned is in the 200 range, it indicates that the request was fulfilled successfully and that no error was encountered.

Client error

Return codes in the 400 range typically indicate that there was an issue with the request that was sent. Among other things, this could mean that you did not authenticate correctly, that you are requesting an action that you do not have authorization for, that the object you are requesting does not exist, or that your request is malformed.

Server Error

If you receive a status in the 500 range, this generally indicates a server-side problem. This means that we are having an issue on our end and cannot fulfill your request currently. The following table summarizes the typical status codes:

Codes

CodeDescription
200 - OKEverything works as expected.
201 - CreatedThe resource was created successfully.
202 - AcceptedThe request was accepted and is processed in the background.
204 - No ContentThe resource was successfully deleted.
400 - Bad RequestValid data was specified, but the request failed.
401 - UnauthorizedNo valid Api Key has been specified.
404 - Not FoundThe requested resource does not exist.
422 - Unprocessable EntityThe payload has missing required parameters or invalid data.
429 - Too Many RequestsToo many requests in a short time.
500 - Internal Server ErrorRequest failed due to an internal error in Smake.
503 - Service UnavailableSmake is offline for maintenance.

We recommend writing code that gracefully handles all possible API exceptions.

Please handle the status codes and not the message or errors. These only contain additional information for you to analyze the problem.

Examples

Generic Errors

HTTP/1.1 401 Unauthenticated

{
  "status_code": 401,
  "message":  "API Key is invalid.",
  "errors": []
}

Validation Errors

HTTP/1.1 422 Unprocessable Entity

{
    "status_code": 422,
    "message": "The request data you sent is not valid.",
    "errors": {
        "shipping_address": {
            "first_name": [
                "The firstname field is required."
            ]
        },
        "items": [
            {
                "quantity": [
                    "The items.0.quantity must be at least 1."
                ]
            }
        ]
    }
}

On this page