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
| Environment | Base URL |
|---|---|
| Test | https://dev-api.globalticket.uz/esbo |
| Production | Provided at onboarding |
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
- Login — get an
accessTokenviaPOST /api/v1/public/agent/login. Refresh it viarefresh-tokenbeforeexpiresInruns out. - Catalog —
GET /catalogreturns the sales cards of the organizations available to you. - Card —
GET /sales-cards/{salesCardId}returnsversionId, the sale type, tariffs, services and benefits. - Session — for an event with sessions:
GET /sales-cards/{salesCardId}/sessions, then the session contentsGET /sessions/{sessionId}and the seating mapGET /sessions/{sessionId}/seating. - Order —
POST /orderscreates an order in theDRAFTstatus for 15 minutes. - Order items — seats (
/seats), standing sector tickets (/sectors) or tickets by quantity (/items); benefits and visitor data if needed. - Validation —
POST /orders/{orderId}/validatereturns the amount to pay,finalAmount. - Payment — you accept it from the buyer on your side before
expiresAt. - Confirmation —
POST /orders/{orderId}/confirm: the order becomesPAID, tickets are issued. - Tickets — generate a QR code from
qrTokenand 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 theAuthorization: Bearer <accessToken>header. Valid forexpiresIn(seconds).refreshToken— to get a new pair:POST {{base_url}}/api/v1/public/agent/refresh-tokenwith 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:
| Parameter | Description |
|---|---|
q | Search by card name and venue name |
cityIds, organizationTypeIds, organizationIds, venueIds | IDs from GET /catalog/filters |
categories | MUSEUM_VISIT, CONCERT, THEATER, CINEMA, EXHIBITION, EXCURSION, CULTURAL_EVENT, SPORT_EVENT, SHOW, CONFERENCE, EDUCATIONAL, OTHER |
dateFrom, dateTo | Inclusive 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 |
sort | POPULAR (default) or NEAREST |
page, limit | Page 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) orSCHEDULED_SESSION(event with sessions).minPrice— the minimum non-zero price for a "from N sum" label;nullif 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] }
]
}
| Field | Description |
|---|---|
versionId | Card version. Passed when creating an order |
tariffs, services | Trees: group → tariff (or service) → visitor type. rowType: GROUP, TARIFF or SERVICE, VISITOR_TYPE |
price | Filled only for tree leaves — only they can be sold. The leaf id is passed into the order as rowId |
benefits | Benefits: a discountPercent discount on the tariffs in tariffRowIds. The benefit id is passed as benefitId |
invite | true — an invitation tariff, issued in a separate order |
requiresData | true — visitor data is required before payment |
ticketCount | Ticket 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 contains | How to sell |
|---|---|
seats contains seats | POST /orders/{orderId}/seats — a specific seat |
sectors contains a sector with ga: true | POST /orders/{orderId}/sectors — by quantity within available |
The response is 404, and GET /sessions/{sessionId} returns 200 | The 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:
| Field | Description |
|---|---|
salesCardId | Sales card ID |
versionId | Card 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:
| Field | Method | Description |
|---|---|---|
sessionId | all | Session. In items it is required for a session and is not passed for a free visit |
seatId | seats | Seat ID from the map's seats[]. The seat immediately becomes taken for other orders |
sectorKey | sectors | Standing sector key from the map's sectors[] |
quantity | sectors, items | Quantity. In items, adding the same order item again increases the quantity |
itemType | items | The tree the leaf is taken from: TARIFF (from tariffs) or SERVICE (from services) |
rowId | all | In 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.
- Call
validateand charge thefinalAmountfrom its response. - With
requiresData: true, make sure that inGET /orders/{orderId}/datathefilledvalue equalstotal. - Accept payment with time to spare so that
confirmcompletes beforeexpiresAt.
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:
| Field | Description |
|---|---|
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 |
ticketLanguage | Required. Ticket language: RU, UZ, UZ_CYRL, EN, KAA |
group | true — 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.
| Response | Meaning | What to do |
|---|---|---|
200 | The order is paid, tickets issued | Deliver the tickets to the buyer |
400 | Request error | Fix the request and retry confirm with the same key |
401 | Token expired | Refresh the token and retry confirm with the same key |
409 | No sale: the order lifetime expired, the card or prices were updated, visitor data is not filled, the order amount is 0 | Refund the buyer |
5xx, timeout | The result is unknown | Retry 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.
| Field | Description |
|---|---|
groupQrToken | Shared order QR code with group: true; with group: false — null |
tickets[].qrToken | The string that is encoded into the ticket QR code |
tickets[].sessionId, sessionStartsAt, sessionEndsAt | Session; null for a free visit |
tickets[].sector, row, seat | Seat; null for a ticket without a seat |
tickets[].status | ACTIVE |
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)
| HTTP | code | When |
|---|---|---|
400 | 1006, 1007 | The request fails validation or has an invalid format |
401 | 1004 or an empty body | No token, token expired or invalid |
403 | — | The account has no agent sales permission |
404 | 1003 | The card, session or order was not found or is not available |
409 | 1008 | The 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 |
5xx | 1001 | Failure on the ESBO side |
Explanations and actions are in Errors.