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.
Envelope A — read endpoints
Section titled “Envelope A — read endpoints”Used by the activity read endpoints. The error is always global to the whole response.
| Field | Type | Meaning |
|---|---|---|
Success | boolean | true if the call succeeded. Always present. |
Timestamp | date-time | Server time when the response was produced. |
ErrorMessage | string | Single human-readable description of the failure. |
ErrorCodes | array of integer | Numeric codes for the failure. See error codes. |
ErrorEntityBreakDown | array of object | Which 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" } ]}Envelope B — transactional endpoints
Section titled “Envelope B — transactional endpoints”Used by the cart, package, accommodation and sale endpoints. The error can be per line, so each entry pairs its own message and code.
| Field | Type | Meaning |
|---|---|---|
Success | boolean | true if the call succeeded. Always present. |
Errors | array of object | One 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.
Why there are two
Section titled “Why there are two”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.
Null fields are omitted
Section titled “Null fields are omitted”The API serializes with null values ignored, so absent is the normal case:
- When
Successistrue, the error fields simply do not appear in the JSON. Do not expectErrorMessage: nullorErrors: []— expect the keys to be missing. ErrorCodeinsideErrors[]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.
Which endpoint uses which
Section titled “Which endpoint uses which”| Envelope | Endpoints |
|---|---|
| A — read | All /api/activity/* endpoints except PaymentMethods, plus PUT /api/Sale |
| B — transactional | All /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:
| Endpoint | What you would expect | What it actually returns |
|---|---|---|
GET /api/activity/PaymentMethods | Envelope A, like the rest of activity | Envelope B (Success + Errors[]) |
PUT /api/Sale | Envelope B, like the rest of sale | Envelope A (Success + Timestamp + ErrorCodes[]) |
GET /api/ShoppingCart/Documentation | A JSON envelope | Neither — it returns the document itself, not a JSON envelope |
POST /api/content/Accommodation | An envelope, since it does return JSON | No envelope at all — no Success, no errors array, just data and pagination. See accommodation content |