Error Codes

Learn more about error codes

Some responses from the LootLocker API will include an error code. These error codes are designed to help you understand what went wrong with your request. Errors containing codes will always follow a common schema:

  • request_id and trace_id are unique identifiers for the request and trace, respectively. These are important pieces of information to provide when contacting support for troubleshooting, as they allow the support team to quickly locate the details of the specific transaction in question.

  • code indicates the type of error. This is the field you should use to determine how to handle the error in your code. The possible values are documented below.

  • doc_url provides a link to the documentation for further information about this error code.

  • message provides a brief, human-readable description of the error. It's important to note that this field should not be used for flow control in your code, as its content may change and is not guaranteed to be consistent. It is intended for debugging and logging purposes, and to provide a readable error message to the end user.

Some error codes may also include additional fields, such as param to indicate which parameter was missing or invalid. These fields are not guaranteed to be present outside of the error code they are documented for.

internal_server_error

Internal server error is returned when an unknown, internal error happened. It is recommended to contact LootLocker support with the request id and trace id if this error persists.

  • Example:

{
  "request_id": "132e392b-5a75-4ecb-99b4-e30610d1a8fe",
  "trace_id": "7c55f99f086390a7731a8430233cb158",
  "code": "internal_server_error",
  "doc_url": "https://docs.lootlocker.com/reference/error-codes#internal_server_error",
  "message": "Internal server error occurred. Please reach out to us with the request id if this issue persists.",
 }

parameter_missing

Parameter missing is returned when a parameter required for the request is missing.

  • Example:

{
  "request_id": "132e392b-5a75-4ecb-99b4-e30610d1a8fe",
  "trace_id": "7c55f99f086390a7731a8430233cb158",
  "code": "parameter_missing",
  "doc_url": "https://docs.lootlocker.com/reference/error-codes#parameter_missing",
  "message": "Parameter \"game_id\" is missing",
  "param": "game_id"
}

parameter_invalid

Parameter invalid is returned when a parameter required for the request is invalid.

  • Example:

{
  "request_id": "132e392b-5a75-4ecb-99b4-e30610d1a8fe",
  "trace_id": "7c55f99f086390a7731a8430233cb158",
  "code": "parameter_invalid",
  "doc_url": "https://docs.lootlocker.com/reference/error-codes#parameter_invalid",
  "message": "Parameter \"game_id\" is invalid",
  "param": "game_id"
 }

request_body_invalid

Request body invalid is returned when the request body is invalid. This can be because the request body is empty or it is not valid JSON.

  • Example:

{
  "request_id": "132e392b-5a75-4ecb-99b4-e30610d1a8fe",
  "trace_id": "7c55f99f086390a7731a8430233cb158",
  "code": "request_body_invalid",
  "doc_url": "https://docs.lootlocker.com/reference/error-codes#request_body_invalid",
  "message": "Request body is not valid JSON"
 }

expectation_not_met

Expectation not met is returned when the request is valid but does not meet the expectations of the endpoint. This can be because the request contains an invalid parameter, or because the state of the server does not reflect the action being taken.

  • Example:

{
  "request_id": "132e392b-5a75-4ecb-99b4-e30610d1a8fe",
  "trace_id": "7c55f99f086390a7731a8430233cb158",
  "code": "expectation_not_met",
  "doc_url": "https://docs.lootlocker.com/reference/error-codes#expectation_not_met",
  "message": "Expectation not met: Game is not subscribed",
}

transaction_insufficient_funds

The transaction_insufficient_funds error code is triggered when a player attempts to perform an action that requires more virtual currency than they currently possess.

This error code is specifically returned when a player tries to make a purchase using in-game virtual currency and their balance is insufficient to complete the transaction.

  • Example:

{
  "request_id": "132e392b-5a75-4ecb-99b4-e30610d1a8fe",
  "trace_id": "7c55f99f086390a7731a8430233cb158",
  "code": "transaction_insufficient_funds",
  "doc_url": "https://docs.lootlocker.com/reference/error-codes#transaction_insufficient_funds",
  "message": "Insufficient funds",
 }

insufficient_permissions

The insufficient_permissions error code is triggered when a user attempts to perform an action that requires a higher level of permissions than they currently possess.

  • Example:

{
  "request_id": "132e392b-5a75-4ecb-99b4-e30610d1a8fe",
  "trace_id": "7c55f99f086390a7731a8430233cb158",
  "code": "insufficient_permissions",
  "doc_url": "https://docs.lootlocker.com/reference/error-codes#insufficient_permissions",
  "message": "Insufficient permissions",
 }

Last updated