curl --request POST \
--url http://localhost:3000/v1/tickets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"ticket_type": "<string>",
"valid_days": [
"<string>"
],
"attendee": {
"name": "<string>",
"email": "[email protected]",
"document_type": "<string>",
"document_number": "<string>",
"date_of_birth": "2023-12-25"
},
"code": "<string>",
"extra_zones": [
"<string>"
]
}
'import requests
url = "http://localhost:3000/v1/tickets"
payload = {
"ticket_type": "<string>",
"valid_days": ["<string>"],
"attendee": {
"name": "<string>",
"email": "[email protected]",
"document_type": "<string>",
"document_number": "<string>",
"date_of_birth": "2023-12-25"
},
"code": "<string>",
"extra_zones": ["<string>"]
}
headers = {
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
ticket_type: '<string>',
valid_days: ['<string>'],
attendee: {
name: '<string>',
email: '[email protected]',
document_type: '<string>',
document_number: '<string>',
date_of_birth: '2023-12-25'
},
code: '<string>',
extra_zones: ['<string>']
})
};
fetch('http://localhost:3000/v1/tickets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/v1/tickets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ticket_type' => '<string>',
'valid_days' => [
'<string>'
],
'attendee' => [
'name' => '<string>',
'email' => '[email protected]',
'document_type' => '<string>',
'document_number' => '<string>',
'date_of_birth' => '2023-12-25'
],
'code' => '<string>',
'extra_zones' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"idempotency-key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3000/v1/tickets"
payload := strings.NewReader("{\n \"ticket_type\": \"<string>\",\n \"valid_days\": [\n \"<string>\"\n ],\n \"attendee\": {\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"date_of_birth\": \"2023-12-25\"\n },\n \"code\": \"<string>\",\n \"extra_zones\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3000/v1/tickets")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ticket_type\": \"<string>\",\n \"valid_days\": [\n \"<string>\"\n ],\n \"attendee\": {\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"date_of_birth\": \"2023-12-25\"\n },\n \"code\": \"<string>\",\n \"extra_zones\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/v1/tickets")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ticket_type\": \"<string>\",\n \"valid_days\": [\n \"<string>\"\n ],\n \"attendee\": {\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"date_of_birth\": \"2023-12-25\"\n },\n \"code\": \"<string>\",\n \"extra_zones\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"object": "ticket",
"id": "<string>",
"code": "VTR-8F2K-1029",
"status": "active",
"ticket_type": {
"id": "<string>",
"name": "<string>"
},
"attendee": {
"name": "<string>",
"email": "<string>",
"document": {
"type": "<string>",
"last4": "<string>"
}
},
"valid_days": [
{
"id": "<string>",
"name": "<string>"
}
],
"extra_zones": [
{
"id": "<string>",
"name": "<string>"
}
],
"wristband": {
"id": "<string>",
"nfc": "<string>"
},
"checked_in_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
],
"has_more": true,
"next_cursor": "<string>"
}{
"error": {
"type": "authentication_error",
"code": "ticket_not_found",
"message": "<string>",
"request_id": "req_9f2c1a4e7b304d51",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "ticket_not_found",
"message": "<string>",
"request_id": "req_9f2c1a4e7b304d51",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "ticket_not_found",
"message": "<string>",
"request_id": "req_9f2c1a4e7b304d51",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "ticket_not_found",
"message": "<string>",
"request_id": "req_9f2c1a4e7b304d51",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "ticket_not_found",
"message": "<string>",
"request_id": "req_9f2c1a4e7b304d51",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "ticket_not_found",
"message": "<string>",
"request_id": "req_9f2c1a4e7b304d51",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "ticket_not_found",
"message": "<string>",
"request_id": "req_9f2c1a4e7b304d51",
"param": "<string>"
}
}Crear entradas
Da de alta una o varias entradas (máximo 500 por llamada).
Es una operación de todo o nada: si algún código ya existe o alguna referencia no es válida, no se crea ninguna. Reintenta con el lote corregido.
Exige la cabecera Idempotency-Key. Repetir la llamada con la misma clave devuelve la respuesta original sin crear nada nuevo.
curl --request POST \
--url http://localhost:3000/v1/tickets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"ticket_type": "<string>",
"valid_days": [
"<string>"
],
"attendee": {
"name": "<string>",
"email": "[email protected]",
"document_type": "<string>",
"document_number": "<string>",
"date_of_birth": "2023-12-25"
},
"code": "<string>",
"extra_zones": [
"<string>"
]
}
'import requests
url = "http://localhost:3000/v1/tickets"
payload = {
"ticket_type": "<string>",
"valid_days": ["<string>"],
"attendee": {
"name": "<string>",
"email": "[email protected]",
"document_type": "<string>",
"document_number": "<string>",
"date_of_birth": "2023-12-25"
},
"code": "<string>",
"extra_zones": ["<string>"]
}
headers = {
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
ticket_type: '<string>',
valid_days: ['<string>'],
attendee: {
name: '<string>',
email: '[email protected]',
document_type: '<string>',
document_number: '<string>',
date_of_birth: '2023-12-25'
},
code: '<string>',
extra_zones: ['<string>']
})
};
fetch('http://localhost:3000/v1/tickets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/v1/tickets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ticket_type' => '<string>',
'valid_days' => [
'<string>'
],
'attendee' => [
'name' => '<string>',
'email' => '[email protected]',
'document_type' => '<string>',
'document_number' => '<string>',
'date_of_birth' => '2023-12-25'
],
'code' => '<string>',
'extra_zones' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"idempotency-key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3000/v1/tickets"
payload := strings.NewReader("{\n \"ticket_type\": \"<string>\",\n \"valid_days\": [\n \"<string>\"\n ],\n \"attendee\": {\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"date_of_birth\": \"2023-12-25\"\n },\n \"code\": \"<string>\",\n \"extra_zones\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3000/v1/tickets")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ticket_type\": \"<string>\",\n \"valid_days\": [\n \"<string>\"\n ],\n \"attendee\": {\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"date_of_birth\": \"2023-12-25\"\n },\n \"code\": \"<string>\",\n \"extra_zones\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/v1/tickets")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ticket_type\": \"<string>\",\n \"valid_days\": [\n \"<string>\"\n ],\n \"attendee\": {\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"date_of_birth\": \"2023-12-25\"\n },\n \"code\": \"<string>\",\n \"extra_zones\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"object": "ticket",
"id": "<string>",
"code": "VTR-8F2K-1029",
"status": "active",
"ticket_type": {
"id": "<string>",
"name": "<string>"
},
"attendee": {
"name": "<string>",
"email": "<string>",
"document": {
"type": "<string>",
"last4": "<string>"
}
},
"valid_days": [
{
"id": "<string>",
"name": "<string>"
}
],
"extra_zones": [
{
"id": "<string>",
"name": "<string>"
}
],
"wristband": {
"id": "<string>",
"nfc": "<string>"
},
"checked_in_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
],
"has_more": true,
"next_cursor": "<string>"
}{
"error": {
"type": "authentication_error",
"code": "ticket_not_found",
"message": "<string>",
"request_id": "req_9f2c1a4e7b304d51",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "ticket_not_found",
"message": "<string>",
"request_id": "req_9f2c1a4e7b304d51",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "ticket_not_found",
"message": "<string>",
"request_id": "req_9f2c1a4e7b304d51",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "ticket_not_found",
"message": "<string>",
"request_id": "req_9f2c1a4e7b304d51",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "ticket_not_found",
"message": "<string>",
"request_id": "req_9f2c1a4e7b304d51",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "ticket_not_found",
"message": "<string>",
"request_id": "req_9f2c1a4e7b304d51",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "ticket_not_found",
"message": "<string>",
"request_id": "req_9f2c1a4e7b304d51",
"param": "<string>"
}
}Authorizations
API key del integrador, emitida desde el panel de VENTRY. Formato vk_live_... en producción y vk_test_... en entornos de prueba.
Headers
Identificador único de la operación, generado por tu sistema.
Body
- Option 1
- Option 2
Id de GET /ticket-types.
Ids de GET /days en los que la entrada es válida.
1Show child attributes
Show child attributes
Código del QR. Si se omite, VENTRY genera uno. Conviene enviar el propio para poder reconciliar después.
4 - 64Zonas adicionales concedidas a esta entrada por complementos, además de las de su tipo.