Stickermaker.dev Docs
Support

Error Codes

A complete reference of error codes you might encounter.

The Sticker Maker API uses standard HTTP response codes to indicate the success or failure of an API request.

Standard HTTP Codes

CodeStatusMeaning
200OKThe request was successful.
201CreatedResource was created successfully.
202AcceptedThe request has been accepted for processing (Async).
400Bad RequestThe request was unacceptable, often due to missing a required parameter.
401UnauthorizedNo valid API key provided.
402Payment RequiredInsufficient credits to perform the operation.
403ForbiddenThe API key doesn't have permissions to perform the request.
404Not FoundThe requested resource doesn't exist.
429Too Many RequestsYou have hit the rate limit.
500Server ErrorSomething went wrong on our end.

Custom Error Codes

When an error occurs, the response body will contain a success: false flag and an error object with a specific code.

402 Payment Required

INSUFFICIENT_CREDITS

Problem: Your credit balance is too low for the requested operation. Solution: Purchase more credits in the dashboard or reduce the complexity of the request (e.g., lower resolution).

400 Bad Request

VALIDATION_ERROR

Problem: The request parameters do not match the expected schema. Solution: Check the details array in the response to see which fields failed validation and why.

INVALID_IMAGE_FORMAT

Problem: The source media format is not supported. Solution: Ensure you are uploading a valid JPEG, PNG, WebP, or GIF.

SOURCE_TOO_LARGE

Problem: The source file exceeds the maximum allowed size. Solution: Compress your image or trim your video before uploading.

429 Too Many Requests

RATE_LIMIT_EXCEEDED

Problem: You are making too many requests in a short period. Solution: Implement exponential backoff in your code. Check the Retry-After header for how many seconds to wait.

Handling Errors

We recommend wrapping your API calls in a try/catch block and checking the error code:

try {
  const result = await client.generateSticker(request);
} catch (err) {
  if (err.code === "INSUFFICIENT_CREDITS") {
    // Handle low balance
    console.error("Time to top up!");
  } else {
    // Handle other errors
    console.error(`Error: ${err.message}`);
  }
}

On this page