Skip to main content

Error Handling

HTTP Status Codes​

CodeMeaning
200Success
202Accepted — async confirmation initiated (async flow)
204Success (no content) — returned for deletes and updates
400Bad request — invalid parameters or business rule violation
401Unauthorized — invalid or expired booking session
404Not found — resource doesn't exist
424Failed dependency — e.g., availability selection expired
503Service unavailable — ticketing provider is down or confirmation failed

Error Response Formats​

The API does not use a single error response format. Depending on the error source, you may receive one of several different shapes. Your integration should handle all of them.

Format 1: Business Logic Errors (most common)​

Returned for known API error codes (reservation failures, ticket validation, provider issues, etc.):

{
"title": "400 Bad Request",
"description": "Attractions cannot be purchased together within the same transaction",
"code": 36,
"timestamp": "2024-02-06T14:24:02.172544+00:00",
"exception_id": "965dc1ac60d244b9b9a837a841e45fdd",
"request_id": "4351f39722a94630aaa64613359d1750"
}
  • code — numeric error code from the Known API Error Codes table
  • exception_id — share this with Coras support for debugging
  • request_id — correlates with server-side logs

Format 2: Validation Errors​

Returned when request parameters fail schema validation (e.g., missing required fields, wrong types):

{
"title": "400 Bad Request",
"description": "Bad Request",
"code": null,
"errors": {
"email": ["Not a valid email address."],
"tickets": ["Missing data for required field."]
}
}
  • errors — a map of field names to arrays of validation error messages
  • code is null (no numeric error code for validation errors)

Format 3: Standard HTTP Errors​

Returned by middleware (auth, content negotiation) and framework-level checks:

{
"title": "401 Unauthorized",
"description": "Authorization token required",
"code": null
}

No timestamp, exception_id, request_id, or errors fields are present.

Format 4: Stripe Errors​

Returned when Stripe payment operations fail:

{
"title": "400 Bad Request",
"description": "Your card was declined.",
"code": "card_declined"
}
  • code is a string (Stripe error code), not a numeric code

Format 5: Internal Server Errors​

Returned for unhandled exceptions:

{
"title": "500 Internal Server Error",
"description": "Internal Server Error",
"code": null
}

Since formats vary, parse error responses defensively:

  1. Always check for title and description — these are present in all formats.
  2. Treat code as optional and potentially a string or integer (or null).
  3. Check for the errors field to detect validation errors and display field-level messages.
  4. Use exception_id (when present) for support requests to Coras.

Known API Error Codes​

The table below lists the known error codes. Note that this is not an exhaustive list — additional error codes may be returned. Your integration should handle unknown codes gracefully (e.g., display the description to the user or log it for investigation).

Booking & Ticket Errors (HTTP 400)​

CodeNameDescriptionResolution
1Invalid splitInvalid number of tickets for selected price typeChoose a quantity from the valid_splits array
2Multipurchase not supportedCannot buy tickets from multiple price bandsCreate separate reservations per price band
24Multi-currency basketBasket items must use the same currencyEnsure all reservations use the same currency
25Missing attendeesAttendees required but not providedRegister attendees via POST /v2/attendees before confirming
26Invalid pickup pointPickup ID not from availability responseUse a coras_pickup_id from the availability check response
28Missing phone verificationPhone number confirmation code requiredCall POST /v2/phone-number-verification first
29Invalid phone codeConfirmation code is incorrectPrompt user to re-enter the verification code
30Seat selection not supportedAttraction does not support individual seat salesUse general admission (omit seats array)
31Max tickets exceededMaximum ticket count reached for reservationReduce the number of tickets
32Multi-row not supportedSeats selected from different rowsSelect seats from the same row
36Incompatible attractionsAttractions cannot be in the same transactionComplete transactions separately
37Minimum tickets not metBelow minimum booking sizeSelect at least min_booking_size tickets
38Incorrect total ticket countTotal tickets outside allowed rangeEnsure total is between min_booking_size and max_booking_size
39Incorrect price type countTicket count for a price type outside allowed rangeAdjust to fit the min/max for that price type
40Invalid exchange rate timestampExchange rate override timestamp too far from current timeUse a more recent exchange rate timestamp
50Invalid booking feeBooking fee is invalid (e.g., too low or too high)Ensure booking fee is a positive number within allowed limits
51Invalid ticket configurationTicket configuration is invalid compared to availability check requestMake sure the same data are sent as in the availability check request
52Missing attendees for ticketsAttendees must be registered for the number of ticketsRegister the correct number of attendees via POST /v2/attendees
53Updating reservation is not supportedCannot update an existing reservationCreate a new reservation with the updated details

Provider / Partner Errors (HTTP 503)​

CodeNameDescriptionResolution
0Provider unavailableTicketing partner is downRetry later
4Connection errorCannot connect to ticketing partnerRetry later
7Request failedPartner request failedRetry later
8Cannot confirmPartner cannot confirm the bookingRetry later; contact Coras support if persistent
9Cannot create reservationPartner cannot create the bookingRetry later
11Auth failedPartner authentication failedRetry later; contact Coras support if persistent
12Request timeoutPartner request timed outRetry later
14Unexpected responsePartner returned an unexpected responseRetry later; contact Coras support if persistent
22Retries exceededMax retry attempts reached for partnerRetry later
35Confirmation pipeline failedBackend confirmation process failedRetry later; contact Coras support

Payment / Payment Provider Errors​

CodeNameDescriptionResolution
1000Payment card errorAn error occurred with the provided payment cardDisplay the Stripe description to the user and prompt for a different card or payment method
1001Payment rate limit errorToo many payment attempts in a short periodAdvise the user to wait before trying again
1002Payment invalid request errorInvalid parameters were sent to the payment providerLog the error details and display a generic payment error message to the user
1003Payment authentication errorAuthentication with the payment provider failedAdvise the user to check their payment details and try again
1004Payment API connection errorNetwork communication with the payment provider failedAdvise the user to check their internet connection and try again
1005Payment processing errorAn error occurred while processing the paymentAdvise the user to try again later or contact support if the issue persists
1006Payment provider errorAn unknown error occurred during payment processingAdvise the user to try again later or contact support if the issue persists
1007Payment error parsing errorAn error occurred while parsing the payment provider's error responseLog the full response for debugging and display a generic payment error message to the user

Availability Errors (HTTP 424)​

CodeNameDescriptionResolution
33Selection expiredAvailability selection timed outRe-check availability and try again

Common Error Handling Patterns​

ScenarioAction
401 UnauthorizedBooking session expired — create a new one
Any code 0–22 (provider errors)Display "temporarily unavailable" and offer retry
Code 1, 31, 37, 38, 39 (ticket count errors)Guide user to adjust ticket selection
Code 36 (incompatible attractions)Remove conflicting reservations or complete separately
Code 33 (selection expired)Re-run availability check before reserving
Unknown error codeLog the full response and display the description to the user