Status codes

SpectroCoin communicates the result of an API request using standard HTTP response codes. As a general rule, 2xx codes indicate success. 4xx codes point to errors resulting from the provided information, such as missing a required parameter or a charge failure. 5xx codes, though rare, indicate issues with our servers.

Certain programmatically resolvable 4xx errors (like a card being declined) include an error code briefly explaining the error.

Status codeDescription
200 - OKEverything worked as expected.
400 - Bad RequestThe request could not be processed due to the absence of a required parameter in the JSON string, such as an account identifier.
401 - UnauthorizedNo valid API key was provided.
403 - ForbiddenThe request has been denied as access to the specified endpoint is restricted, possibly due to the disallowed IP address from which the request was initiated.
404 - Not FoundThe requested resource doesn't exist.
422 - Unprocessable EntityThe request was not able to be processed due to incorrect syntax in the JSON string, such as a missing comma.
429 - Too Many RequestsAPI request limit is exceeded. Too many requests hit the API too quickly.
500, 502, 503, 504 - Server ErrorsSomething wrong with SpectroCoin. (These are rare.)

Errors

Error response example:

{
  "defaultMessage": "string",
  "errorCode": "GEN_1 - Internal server error occurred",
  "spanId": "string",
  "traceId": "string"
}
Field NameDescription
defaultMessageA human-readable message providing more details about the error.
errorCodeIn the event of a programmable error, our system will assertively report a brief error code, enabling you to promptly resolve the issue at hand.
spanIdA unique identifier for the specific operation within a request. This ID helps trace the error within a single request flow, particularly in microservices.
traceIdA unique identifier for tracking a request across multiple services in a distributed system.