Skip to main content

Selling tickets through the API

You show the buyer the ESBO catalog on your storefront, reserve the selected seats or tickets, accept payment on your side and confirm it in ESBO. In return, ESBO issues tickets with a QR code. The catalog, holds and tickets are stored in ESBO — you do not need to maintain your own seat database.

Base URL​

EnvironmentBase URL
Testhttps://dev-api.globalticket.uz/esbo
ProductionProvided at onboarding
Getting started

The agent account (email and password) and the list of organizations whose tickets you are allowed to sell are issued by the ESBO team. Start the integration in the test environment.

Interaction overview​

Sequence of actions​

  1. Login — get an accessToken via POST /api/v1/public/agent/login. Refresh it via refresh-token before expiresIn runs out.
  2. Catalog — GET /catalog returns the sales cards of the organizations available to you.
  3. Card — GET /sales-cards/{salesCardId} returns versionId, the sale type, tariffs, services and benefits.
  4. Session — for an event with sessions: GET /sales-cards/{salesCardId}/sessions, then the session contents GET /sessions/{sessionId} and the seating map GET /sessions/{sessionId}/seating.
  5. Order — POST /orders creates an order in the DRAFT status for 15 minutes.
  6. Order items — seats (/seats), standing sector tickets (/sectors) or tickets by quantity (/items); benefits and visitor data if needed.
  7. Validation — POST /orders/{orderId}/validate returns the amount to pay, finalAmount.
  8. Payment — you accept it from the buyer on your side before expiresAt.
  9. Confirmation — POST /orders/{orderId}/confirm: the order becomes PAID, tickets are issued.
  10. Tickets — generate a QR code from qrToken and deliver it to the buyer.

The paths below are given without the /api/v1/private/agent prefix: GET /catalog means GET {{base_url}}/api/v1/private/agent/catalog. In all private methods pass Authorization: Bearer <accessToken>.

Detailed description of actions​

Getting an authorization token​

Request: POST {{base_url}}/api/v1/public/agent/login

Request body:

{
"email": "agent@example.com",
"password": "<password>"
}

Response example:

{
"accessToken": "eyJhbGciOi...",
"refreshToken": "eyJhbGciOi...",
"expiresIn": 3600
}
  • accessToken — pass it in the Authorization: Bearer <accessToken> header. Valid for expiresIn (seconds).
  • refreshToken — to get a new pair: POST {{base_url}}/api/v1/public/agent/refresh-token with the body { "refreshToken": "…" }.

The login and refresh methods are called without the Authorization header. Details: Access and environments.

Getting the catalog​

Request: GET {{base_url}}/api/v1/private/agent/catalog?dateFrom=2026-12-01&sort=NEAREST&page=1&limit=20

Parameters:

ParameterDescription
qSearch by card name and venue name
cityIds, organizationTypeIds, organizationIds, venueIdsIDs from GET /catalog/filters
categoriesMUSEUM_VISIT, CONCERT, THEATER, CINEMA, EXHIBITION, EXCURSION, CULTURAL_EVENT, SPORT_EVENT, SHOW, CONFERENCE, EDUCATIONAL, OTHER
dateFrom, dateToInclusive period, YYYY-MM-DD; without dateTo — the single day dateFrom. A card with sessions is included if the period has a session on sale; a free-visit card is always included
sortPOPULAR (default) or NEAREST
page, limitPage starting at 1, up to 100 items

Response example:

{
"items": [
{
"id": 7,
"name": "Symphony concert",
"category": "CONCERT",
"saleType": "SCHEDULED_SESSION",
"photo": {
"id": 31,
"photoType": "HORIZONTAL",
"ru": { "fileId": 501, "fileUrl": "https://…/banner-ru.jpg" },
"uz": { "fileId": 502, "fileUrl": "https://…/banner-uz.jpg" }
},
"venue": { "id": 3, "name": "Grand Hall" },
"organization": { "id": 2, "name": "Concert organization" },
"minPrice": 80000,
"nearestSession": { "startsAt": "2026-12-01T19:00:00", "endsAt": "2026-12-01T21:00:00" },
"sessionCount": 4
}
],
"totalElements": 1,
"page": 1,
"size": 20,
"totalPages": 1
}
  • saleType — FREE_VISIT (free visit, without a session) or SCHEDULED_SESSION (event with sessions).
  • minPrice — the minimum non-zero price for a "from N sum" label; null if there are no tariffs.
  • nearestSession, sessionCount — the nearest session and the number of sessions in the selected period.

Getting a sales card​

Request: GET {{base_url}}/api/v1/private/agent/sales-cards/7

Response example:

{
"id": 7,
"versionId": 70,
"name": "Symphony concert",
"category": "CONCERT",
"saleType": "SCHEDULED_SESSION",
"venue": { "id": 3, "name": "Grand Hall" },
"organization": { "id": 2, "name": "Concert organization" },
"tariffs": [
{
"id": 3, "rowType": "TARIFF", "name": "VIP", "price": 300000, "color": "#E53935",
"ticketCount": null, "invite": false, "requiresData": false, "children": []
},
{
"id": 4, "rowType": "TARIFF", "name": "Stalls", "price": null, "color": "#1E88E5",
"invite": false, "requiresData": false,
"children": [
{ "id": 81, "rowType": "VISITOR_TYPE", "name": "Adult", "price": 150000, "children": [] },
{ "id": 82, "rowType": "VISITOR_TYPE", "name": "Child", "price": 80000, "children": [] }
]
}
],
"services": [],
"benefits": [
{ "id": 9, "name": "Seniors", "discountPercent": 30, "color": "#43A047", "tariffRowIds": [3, 81] }
]
}
FieldDescription
versionIdCard version. Passed when creating an order
tariffs, servicesTrees: group → tariff (or service) → visitor type. rowType: GROUP, TARIFF or SERVICE, VISITOR_TYPE
priceFilled only for tree leaves — only they can be sold. The leaf id is passed into the order as rowId
benefitsBenefits: a discountPercent discount on the tariffs in tariffRowIds. The benefit id is passed as benefitId
invitetrue — an invitation tariff, issued in a separate order
requiresDatatrue — visitor data is required before payment
ticketCountTicket limit for the tariff; null — unlimited

For a free visit, take tariffs, services and benefits from the card; for a session, from GET /sessions/{sessionId}: a session may have different contents and prices.

Getting sessions and the seating map​

Request: GET {{base_url}}/api/v1/private/agent/sales-cards/7/sessions?dateFrom=2026-12-01&dateTo=2026-12-31

Response example:

[
{ "id": 50, "versionId": 501, "startsAt": "2026-12-01T19:00:00", "endsAt": "2026-12-01T21:00:00", "availableTickets": 412 }
]

availableTickets — tickets remaining for the session; null — unlimited. Sessions are returned in ascending order of start time.

Request: GET {{base_url}}/api/v1/private/agent/sessions/50/seating

The response contains the hall tariffs, seats and sectors with statuses. Format, seat statuses and display rules are in Seating map.

Choosing the sales method based on the response:

What the /seating response containsHow to sell
seats contains seatsPOST /orders/{orderId}/seats — a specific seat
sectors contains a sector with ga: truePOST /orders/{orderId}/sectors — by quantity within available
The response is 404, and GET /sessions/{sessionId} returns 200The session has no seating map: POST /orders/{orderId}/items with sessionId — by quantity

Creating an order​

Request: POST {{base_url}}/api/v1/private/agent/orders

Request body:

{
"salesCardId": 7,
"versionId": 70
}

Fields:

FieldDescription
salesCardIdSales card ID
versionIdCard version from GET /sales-cards/{salesCardId}. If the card has been updated in the meantime, the response is 409: re-read the card and retry

Response example (201 Created):

{
"id": 1234,
"salesCardId": 7,
"versionId": 70,
"status": "DRAFT",
"expiresAt": "2026-12-01T12:16:00",
"items": [],
"totalAmount": 0,
"discountAmount": 0,
"finalAmount": 0,
"requiresData": false
}

The order is valid for 15 minutes from creation; changes do not extend it.

Adding order items​

All order item methods return the whole order with recalculated amounts.

A seat from the map: POST {{base_url}}/api/v1/private/agent/orders/1234/seats

{ "sessionId": 50, "seatId": "seat-parter-3-10" }

Standing sector tickets: POST {{base_url}}/api/v1/private/agent/orders/1234/sectors

{ "sessionId": 50, "sectorKey": "6fa459ea-ee8a-3ca4-894e-db77e160355e", "quantity": 2 }

Tickets by quantity (free visit — without sessionId, session without a seating map — with sessionId): POST {{base_url}}/api/v1/private/agent/orders/1234/items

{ "itemType": "TARIFF", "rowId": 12, "quantity": 2, "sessionId": 51 }

Fields:

FieldMethodDescription
sessionIdallSession. In items it is required for a session and is not passed for a free visit
seatIdseatsSeat ID from the map's seats[]. The seat immediately becomes taken for other orders
sectorKeysectorsStanding sector key from the map's sectors[]
quantitysectors, itemsQuantity. In items, adding the same order item again increases the quantity
itemTypeitemsThe tree the leaf is taken from: TARIFF (from tariffs) or SERVICE (from services)
rowIdallIn items — the id of the tree leaf. In seats and sectors — only if the seat's tariff has visitor types, for example 81

Response example:

{
"id": 1234,
"salesCardId": 7,
"versionId": 70,
"status": "DRAFT",
"expiresAt": "2026-12-01T12:16:00",
"items": [
{
"id": 1, "itemType": "TARIFF", "rowId": 3, "name": "VIP", "visitorType": null, "color": "#E53935",
"quantity": 1, "unitPrice": 300000, "totalAmount": 300000, "discountAmount": 0, "finalAmount": 300000,
"invite": false, "requiresData": false,
"sessionId": 50, "sessionStartsAt": "2026-12-01T19:00:00", "sessionEndsAt": "2026-12-01T21:00:00",
"seatId": "seat-parter-3-10", "sector": "Stalls", "row": "3", "seat": "10", "sectorKey": null,
"benefits": []
}
],
"totalAmount": 300000,
"discountAmount": 0,
"finalAmount": 300000,
"requiresData": false
}

To change the quantity — PATCH /orders/{orderId}/items/{itemId} with the body { "quantity": 3 }. To delete an order item — DELETE /orders/{orderId}/items/{itemId}: the seat is released.

Applying benefits​

Request: PUT {{base_url}}/api/v1/private/agent/orders/1234/items/1/benefits

Request body:

{ "benefits": [ { "benefitId": 9, "quantity": 1 } ] }

The list fully replaces the order item's previous benefits; an empty list clears them. quantity is how many tickets of the order item are issued with the benefit. In the response, the order item gets benefits[] with discountAmount, and the order gets discountAmount and a reduced finalAmount.

Visitor data​

Required if the order has requiresData: true.

Request: GET {{base_url}}/api/v1/private/agent/orders/1234/data

Response example:

{
"filled": 0,
"total": 1,
"tickets": [
{
"itemId": 1, "ticketIndex": 1, "name": "VIP", "visitorType": null,
"sector": "Stalls", "row": "3", "seat": "10",
"fields": [
{ "fieldId": 4, "name": "Last name", "fieldType": "TEXT", "required": true, "value": null, "options": [] }
]
}
]
}

Request: PUT {{base_url}}/api/v1/private/agent/orders/1234/data

{ "values": [ { "itemId": 1, "ticketIndex": 1, "fieldId": 4, "value": "Smith" } ] }

A ticket is identified by the pair itemId + ticketIndex (the ticket number within the order item, starting at 1). For a field with fieldType: OPTION the value is the id of an option from options[]; an empty value deletes the saved one. The response is the same filled / total state.

Validating the order before payment​

Request: POST {{base_url}}/api/v1/private/agent/orders/1234/validate

The server checks that the order is not empty and has not expired, the card is still on sale, and the tariffs, services and benefits have not been deleted and their prices have not changed. On a mismatch — 409. The response is the whole order.

Before charging the money
  1. Call validate and charge the finalAmount from its response.
  2. With requiresData: true, make sure that in GET /orders/{orderId}/data the filled value equals total.
  3. Accept payment with time to spare so that confirm completes before expiresAt.

Payment confirmation​

You accept the buyer's payment through your own acquiring and issue the fiscal receipt yourself. After a successful payment:

Request: POST {{base_url}}/api/v1/private/agent/orders/1234/confirm

Headers: Idempotency-Key: 7c9e6679-7425-40de-944b-e07fc1f90ae7

Request body:

{ "ticketLanguage": "EN", "group": false }

Fields:

FieldDescription
Idempotency-Key (header)Optional, but always pass it. A string of up to 100 characters, for example a UUID — unique for each confirmation; do not change it when retrying the same confirmation
ticketLanguageRequired. Ticket language: RU, UZ, UZ_CYRL, EN, KAA
grouptrue — one shared QR code for the whole order; false — a separate QR code for each ticket

Response example:

{
"order": {
"id": 1234,
"status": "PAID",
"paymentType": "AGENT",
"ticketLanguage": "EN",
"group": false,
"finalAmount": 300000
},
"tickets": {
"orderId": 1234,
"group": false,
"groupQrToken": null,
"paidAt": "2026-12-01T12:05:00",
"tickets": [
{
"id": "3f2c8a1e-6b1d-4c55-9a51-2e4b7c0d9f10",
"number": "000123",
"itemId": 1,
"name": "VIP",
"visitorType": null,
"sessionId": 50,
"sessionStartsAt": "2026-12-01T19:00:00",
"sessionEndsAt": "2026-12-01T21:00:00",
"sector": "Stalls",
"row": "3",
"seat": "10",
"price": 300000,
"benefit": null,
"qrToken": "<QR code string>",
"language": "EN",
"status": "ACTIVE"
}
]
}
}

In the response, order is the full order (shortened in the example). A repeated confirm for the same order does not create a second sale: if the order is already paid, the server returns it with the same tickets.

ResponseMeaningWhat to do
200The order is paid, tickets issuedDeliver the tickets to the buyer
400Request errorFix the request and retry confirm with the same key
401Token expiredRefresh the token and retry confirm with the same key
409No sale: the order lifetime expired, the card or prices were updated, visitor data is not filled, the order amount is 0Refund the buyer
5xx, timeoutThe result is unknownRetry confirm unchanged or check GET /orders/{orderId}: status PAID means the sale went through

Getting tickets​

Request: GET {{base_url}}/api/v1/private/agent/orders/1234/tickets

The response is the same object as tickets in the confirm response; you can request it repeatedly. A ticket is issued for each unit of each order item, including services.

FieldDescription
groupQrTokenShared order QR code with group: true; with group: false — null
tickets[].qrTokenThe string that is encoded into the ticket QR code
tickets[].sessionId, sessionStartsAt, sessionEndsAtSession; null for a free visit
tickets[].sector, row, seatSeat; null for a ticket without a seat
tickets[].statusACTIVE
qrToken is the ticket

Deliver qrToken only to the buyer: in an email, a PDF or an app. Do not write it to open logs and do not pass it in a URL.

Returned errors (HTTP)​

HTTPcodeWhen
4001006, 1007The request fails validation or has an invalid format
4011004 or an empty bodyNo token, token expired or invalid
403—The account has no agent sales permission
4041003The card, session or order was not found or is not available
4091008The seat is taken, not enough places in the sector, the card or prices were updated, the order lifetime expired, visitor data is not filled, the amount is 0
429—Login from the IP address is blocked after 5 failed attempts
5xx1001Failure on the ESBO side

Explanations and actions are in Errors.