Jetron TicketFluid

Errors

The error envelope, status codes, and error_code identifiers.

Response envelope

Successful responses are wrapped as:

{ "data": { "...": "payload" }, "status": true }

Errors return an error envelope instead:

{
  "message": "Missing or invalid API key",
  "status": 401,
  "error_code": "unauthorized"
}
FieldDescription
messageHuman-readable description, safe to log.
statusThe HTTP status code, repeated in the body.
error_codeA stable, machine-readable identifier. Branch on this, not on message.

Status codes

StatusWhen
400Malformed body, failed validation, missing reservation token, or a Seat Map event (not supported).
401Missing or invalid API key.
403Valid key of the wrong type (use a jt_public_... key).
404The resource doesn't exist for this host. Other hosts' events look like 404s.
409An order for this reservation is already being processed.

Handling errors with the SDK

The SDK throws a typed ApiError for every non-2xx response, with the parsed envelope on the error object:

import { ApiError } from '@jetronticket/api'

try {
  await client.getEvent('missing-event')
} catch (err) {
  if (err instanceof ApiError) {
    console.error(err.status, err.errorCode, err.message)
  }
}

On this page