This documentation will guide you through the process of interacting with the Entradas a tu alcance API. It is divided into two parts:
The whole workflow consists of:
Fetch Catalog.
Get the event list through the Events catalog endpoint. Here you can find an example response:
[
{
"categoryDescription": "Festival",
"sessions": [
{
"priceFrom": 40,
"priceTo": 70,
"id": 940,
"name": null,
"dateFrom": "2024-09-06T10:00:00+00:00",
"dateFromShowTime": true,
"dateTo": null,
"dateToShowTime": true,
"doorsOpenAt": null,
"timezone": "Europe/Madrid"
}
],
"place": {
"id": 1406,
"name": "Ciudad deportiva Alcoy",
"address": "Alcoy",
"zipcode": "03800",
"city": "Alcoy",
"province": "Alicante",
"country": "ES",
"timezone": "Europe/Madrid"
},
"id": 675,
"name": "Latina Fest 2024",
"slug": "latina-fest-2024",
"description": "\u003Cp\u003E\u003Cstrong\u003ELatina Fest 2024\u003C/strong\u003E, el mayor Beach Festival de Europa está de vuelta. Durante los próximos \u003Cstrong\u003E6\u003C/strong\u003E\u003Cstrong\u003E y 7 de septiembre de 2024\u003C/strong\u003E, \u003Cstrong\u003EAlcoy\u003C/strong\u003E será el epicentro del reggaeton, transmitiendo toda la energía y ganas de petarlo una vez más.\u003C/p\u003E\u003Cp\u003E\u003Cstrong\u003EEl mejor reggaeton\u003C/strong\u003E, la mejor compañía y los recintos más espectaculares que puedas imaginar, te están esperando durante el verano de 2024 para que vivas \u003Cstrong\u003Eel verano de tu vida\u003C/strong\u003E.\u003C/p\u003E\u003Cp\u003E\u003Cstrong\u003EARTISTAS CONFIRMADOS: ANUEL AA | SAIKO | TAINY | TIAGO PZK | BRYANT MYERS | MARIA BECERRA | NIO GARCIA | EL ALFA | ALVARO DIAZ\u003C/strong\u003E\u003C/p\u003E\u003Cp\u003ENo puedes pasar por alto la fecha que reunirá a los mayores amantes del reggaeton y \u003Cstrong\u003Eartistas TOP mundiales\u003C/strong\u003E, escogidos especialmente para la ocasión.\u003C/p\u003E\u003Cp\u003E¿Vas a dejar escapar la oportunidad de vivir \u003Cstrong\u003Eel evento más esperado del año\u003C/strong\u003E y de disfrutar de los mejores artistas del mundo?\u003C/p\u003E\u003Cp\u003ENo pierdas la oportunidad de vivir la mejor experiencia del verano y ¡\u003Cstrong\u003Ecompra ya tus entradas\u003C/strong\u003E!\u003C/p\u003E\u003Cp\u003E\u003Cbr /\u003E\u003C/p\u003E\u003Ch4\u003EPOLÍTICA DE MENORES\u003C/h4\u003E\u003Cp\u003EEdad mínima de acceso 16 años.\u003C/p\u003E\u003Cp\u003EMenores con 16 y 17 años con autorización firmada por padre/madre/tutor legal. \u003C/p\u003E\u003Cp\u003E\u003Ca\u003EDescarga aquí tu autorización.\u003C/a\u003E\u003C/p\u003E",
"descriptionImage": "799afa19-142a-4480-9afb-92b622bfe63e.jpeg",
"organizer": {
"id": 1,
"name": "TECTELTIC ON-LINE SL"
},
"logo": "eb569fa8-1cdf-418a-adf7-2111702e7856.jpeg",
"logoUrl": "https://stgtickets.imgix.net/images/events/eb569fa8-1cdf-418a-adf7-2111702e7856.jpeg",
"headerImage": "4c1ed0b1-8d58-43f3-9978-44cb9bb5d4ec.jpeg",
"headerImageUrl": "https://stgtickets.imgix.net/images/events/4c1ed0b1-8d58-43f3-9978-44cb9bb5d4ec.jpeg",
"widgetImage": "4a7ca56e-881c-4802-b6dd-54d06fb4d1e4.jpeg",
"widgetImageUrl": "https://stgtickets.imgix.net/images/events/4a7ca56e-881c-4802-b6dd-54d06fb4d1e4.jpeg",
"category": "FESTIVAL",
"marketingCategories": [],
"orderMinimumQuantity": 1,
"orderMaximumQuantity": 8,
"seoCanBeIndexed": true,
"updatedAt": "2024-08-06T09:17:41+00:00",
"pixels": [
{
"type": "view",
"provider": "facebook",
"data": {
"token": 123456
}
},
{
"type": "addToCart",
"provider": "facebook",
"data": {
"token": 123456
}
},
{
"type": "orderInfo",
"provider": "facebook",
"data": {
"token": 123456
}
},
{
"type": "checkout",
"provider": "facebook",
"data": {
"token": 123456
}
},
{
"type": "purchase",
"provider": "facebook",
"data": {
"token": 123456
}
}
]
},
]
List Events.
Present the events to the user.
Load Widget.
Load the Widget using the EATA Loader library.
If the event has only one session, it is loaded automatically.
Otherwise, it will render a list of sessions -or a calendar- to let the user choose one of them.
If the event has more than one session, you can preselect a session using the dataSession
if using the data attributes or session
if using the object.
You can choose between these two load methods:
<head>
<script src="https://stg.entradasatualcance.com/js/apps/eata-loader.js"></script>
</head>
<div
id="eata-widget-container"
data-sales-channel-host="demo.integrations.stg.entradasatualcance.com"
data-event="{{ eventId }}"
data-session="{{ sessionId }}" // This is optional
></div>
<script>
document.addEventListener('DOMContentLoaded', function () {
eata.loadWidget('#eata-widget-container').ready(function (widget) {
// ...
});
});
</script>
<head>
<script src="https://stg.entradasatualcance.com/js/apps/eata-loader.js"></script>
</head>
<div id="eata-widget-container"></div>
<script>
document.addEventListener('DOMContentLoaded', function () {
eata.loadWidget('#eata-widget-container', {
salesChannelHost: 'demo.integrations.stg.entradasatualcance.com',
event: eventId,
session: sessionId,
}).ready(function (widget) {
// ...
});
});
</script>
Get Order.
The Widget will emit an event after the order creation.
The uuid
is needed to query the Order details and to Confirm the order.
We strongly encourage you to keep it in a safe place while performing these operations.
<script>
document.addEventListener('DOMContentLoaded', function () {
eata.loadWidget(/* ... */).ready((widget) => {
widget.addEventListener('order.created', (e) => {
const { order } = e.detail.order;
fetch('https://my.backend.com/api/order', {
method: 'POST',
body: JSON.stringify(order),
headers: {
'Content-Type': 'application/json',
},
}).then(/* ... */);
});
});
});
</script>
Confirm Order.
Let the user complete the payment through your preferred payment method, then notify the API that the Order has been confirmed. After this step, the Order status will become paid
.
curl -X POST \
-d "access_token=${ACCESS_TOKEN}"
"${API_URL}/sell/orders/${ORDER_UUID}/confirm"
Get Tickets.
As the Tickets are asynchronously generated, the Order status endpoint should be polled. Keep checking it until the status is no longer set to paid
. A completed Order will be set to completed
and the Tickets may then be downloaded through Order tickets.
We recommend to poll in 1-second intervals up to a maximum of 60 seconds, with an initial delay of 1 second. Normally, the order should be completed within the first second. We can expect that an error has occurred if it is not completed after the grace period.
for i in $(seq 60); do
sleep 1
status=$(curl -X POST \
-d "access_token=${ACCESS_TOKEN}"
"${API_URL}/sell/orders/${ORDER_UUID}/confirm" | jq -r .status)
if [[ "${status}" != "paid" ]]; then
break;
fi
done
if [[ "${status}" == "completed" ]]; then
curl -X GET \
-d "access_token=${ACCESS_TOKEN}"
"${API_URL}/sell/orders/${ORDER_UUID}.pdf"
else
>&2 echo "Wrong status: ${status}"
fi
NOTE:
All methods require an access_token