Skip to content

Your first API request

By the end of this guide you will have authenticated against the ExpertHub API, fetched the activity catalog, and know the path from catalog to confirmed sale.

  1. Set up your headers

    Every request to the API requires these three HTTP headers:

    HeaderValue
    Acceptapplication/json
    Content-Typeapplication/json
    AuthorizationApiKey YOUR_API_KEY

    Replace YOUR_API_KEY with the key provided by the Experticket support team. Without it, every call will return an authentication error.

  2. Fetch the activity catalog

    The catalog is your source of truth for the identifiers you will need in every subsequent call. Fetch it once and store it locally — polling it on every sale is a misuse of the API.

    POST /activity/Catalog

    A minimal request body:

    {}

    Key fields in the response to hold on to:

    • ProviderId — identifies the activity provider
    • ProductId — the product you will add to the cart
    • TicketId — the specific ticket type
    • TicketsQuestionsProfileId — if present, this ticket requires question answers before the sale

    See Activities catalog for the full field reference and filtering options.

  3. Build and complete a sale

    A sale follows four calls in sequence:

    StepEndpointWhat it does
    1. Create cartPOST /ShoppingCart/CreateOpens a new cart, returns a ShoppingCartId
    2. Add itemsPOST /ShoppingCart/AddAdds activities, packages, or accommodations
    3. ReservePOST /ShoppingCart/ConfirmBlocks stock — items reserved, not yet charged
    4. CompletePOST /ShoppingCart/SaleCharges the customer and issues the tickets
  4. Check the response

    The API always returns HTTP 200 — even when something goes wrong. Always inspect the Success field.

    How the error is reported depends on the endpoint family. The catalog call above is a read, so a failure looks like this:

    { "Success": false, "ErrorMessage": "...", "ErrorCodes": [123] }

    The cart and sale calls are transactional, and report one error per line:

    { "Success": false, "Errors": [{ "ErrorMessage": "...", "ErrorCode": 123 }] }

    A Success: false with no errors reported means the request was valid but produced no results (for example, a catalog query with no matching products). See response envelopes for both formats and error codes for the full list of codes.

The API reference can run these calls against your own instance straight from the browser, which is the fastest way to see a real response before you write a line of code.

  1. Point it at your instance

    Type your API base URL in the API base URL field at the top of the reference and press Apply. Each client has its own ExpertHub instance, so until you do this the examples point at a placeholder host that does not resolve.

    You can type just the host, without https:// — the scheme is added for you.

  2. Enter your API key

    Open the authentication section and paste your key including the ApiKey prefix:

    ApiKey YOUR_API_KEY

    The value is sent verbatim as the Authorization header, so pasting the key on its own results in an authentication error.

  3. Send the request

    Pick an endpoint and send it. The cURL example shown alongside it uses the base URL you set, so you can copy it straight into a terminal.