Skip to content

Response envelopes

Every endpoint wraps its payload in an envelope: a small set of fields that tell you whether the call succeeded and, if it did not, what went wrong.

The API uses two different envelopes. Both always carry a Success flag, but they report errors in different shapes. Knowing which one you are reading saves you from writing error handling that silently never fires.

Used by the activity read endpoints. The error is always global to the whole response.

FieldTypeMeaning
Successbooleantrue if the call succeeded. Always present.
Timestampdate-timeServer time when the response was produced.
ErrorMessagestringSingle human-readable description of the failure.
ErrorCodesarray of integerNumeric codes for the failure. See error codes.
ErrorEntityBreakDownarray of objectWhich entities caused the failure: Id, Name, AccessDate.
{
"Success": false,
"Timestamp": "2026-07-31T09:22:37",
"ErrorMessage": "The product is not available on the requested date",
"ErrorCodes": [],
"ErrorEntityBreakDown": [
{ "Id": "PRODUCT_ID", "Name": "Product name", "AccessDate": "2026-08-14" }
]
}

Used by the cart, package, accommodation and sale endpoints. The error can be per line, so each entry pairs its own message and code.

FieldTypeMeaning
Successbooleantrue if the call succeeded. Always present.
Errorsarray of objectOne entry per failure: ErrorMessage (string) and ErrorCode (integer, nullable).
{
"Success": false,
"Errors": [
{ "ErrorMessage": "The client's identification document is required (DNI, NIF, Passport...)", "ErrorCode": 5000 },
{ "ErrorMessage": "The product is not available on the requested date", "ErrorCode": null }
]
}

The second entry shows the common case of an error without a numeric code — ErrorCode is nullable, so with nulls omitted the key simply will not be there.

This is not an inconsistency that slipped through — it follows from where each contract comes from and from how precise the error can be.

Different origin. ExpertHub aggregates inventory on top of Experticket, the central sales engine. The activity read endpoints return Experticket’s own response contracts unchanged, so you get Experticket’s envelope. The transactional endpoints are ExpertHub’s own contracts, and they use ExpertHub’s envelope.

Different error granularity. A read either succeeds or fails as a whole: one catalog, one answer, so one ErrorMessage is enough, and ErrorEntityBreakDown is there to point at the entities involved. A transactional call operates on several lines at once — three tickets where one is sold out. There the response has to say which line failed, so Errors[] keeps every message glued to its own code, and you map each entry back to the line that produced it.

The API serializes with null values ignored, so absent is the normal case:

  • When Success is true, the error fields simply do not appear in the JSON. Do not expect ErrorMessage: null or Errors: [] — expect the keys to be missing.
  • ErrorCode inside Errors[] is nullable. Not every error carries a numeric code yet, as noted in error codes.

Treat a missing key and a null value as the same thing when you deserialize.

EnvelopeEndpoints
A — readAll /api/activity/* endpoints except PaymentMethods, plus PUT /api/Sale
B — transactionalAll /api/ShoppingCart/*, /api/Package/* and /api/Accommodation/* endpoints, plus GET /api/Sale, GET and POST /api/SaleCancellationRequest, and GET /api/activity/PaymentMethods

Four cases break the “activity means read, sale means transactional” rule of thumb. They are easy to get wrong, so they are worth memorising:

EndpointWhat you would expectWhat it actually returns
GET /api/activity/PaymentMethodsEnvelope A, like the rest of activityEnvelope B (Success + Errors[])
PUT /api/SaleEnvelope B, like the rest of saleEnvelope A (Success + Timestamp + ErrorCodes[])
GET /api/ShoppingCart/DocumentationA JSON envelopeNeither — it returns the document itself, not a JSON envelope
POST /api/content/AccommodationAn envelope, since it does return JSONNo envelope at all — no Success, no errors array, just data and pagination. See accommodation content