curl --request POST \
--url http://localhost:3000/v1/wristbands/{code}/topups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"amount": 50000,
"bonus_amount": 50000,
"bonus_rule": "<string>",
"granted_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "http://localhost:3000/v1/wristbands/{code}/topups"
payload = {
"amount": 50000,
"bonus_amount": 50000,
"bonus_rule": "<string>",
"granted_at": "2023-11-07T05:31:56Z"
}
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({
amount: 50000,
bonus_amount: 50000,
bonus_rule: '<string>',
granted_at: '2023-11-07T05:31:56Z'
})
};
fetch('http://localhost:3000/v1/wristbands/{code}/topups', 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/wristbands/{code}/topups",
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([
'amount' => 50000,
'bonus_amount' => 50000,
'bonus_rule' => '<string>',
'granted_at' => '2023-11-07T05:31:56Z'
]),
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/wristbands/{code}/topups"
payload := strings.NewReader("{\n \"amount\": 50000,\n \"bonus_amount\": 50000,\n \"bonus_rule\": \"<string>\",\n \"granted_at\": \"2023-11-07T05:31:56Z\"\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/wristbands/{code}/topups")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 50000,\n \"bonus_amount\": 50000,\n \"bonus_rule\": \"<string>\",\n \"granted_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/v1/wristbands/{code}/topups")
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 \"amount\": 50000,\n \"bonus_amount\": 50000,\n \"bonus_rule\": \"<string>\",\n \"granted_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"object": "topup_result",
"id": "<string>",
"amount": 123,
"previous_balance": 123,
"new_balance": 123,
"bonus_amount": 123,
"bonus_id": "<string>",
"previous_promo_balance": 123,
"new_promo_balance": 123,
"replayed": true
}{
"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>"
}
}Recargar el saldo de una pulsera
Añade saldo a una pulsera. Pensado para integradores que cobran la recarga en su propia plataforma (una aplicación de recarga online, por ejemplo) y necesitan reflejarla en VENTRY.
El movimiento se registra con método de pago online y contra el dispositivo virtual de tu API key. Aparecerá en el cierre de caja del evento como recarga online: el dinero lo has cobrado tú, fuera de las cajas del recinto, y el organizador tiene que poder verlo para cuadrar.
Si enseñaste una bonificación al cobrar (ver GET /topup-bonuses/quote), mándala en bonus_amount y bonus_rule. Se concede como mucho lo que permita la regla en granted_at, y bonus_amount en la respuesta dice cuánto se dio de verdad. El regalo va al saldo regalado: se gasta igual pero no se devuelve.
Exige Idempotency-Key. Reintentar con la misma clave no vuelve a recargar.
curl --request POST \
--url http://localhost:3000/v1/wristbands/{code}/topups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"amount": 50000,
"bonus_amount": 50000,
"bonus_rule": "<string>",
"granted_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "http://localhost:3000/v1/wristbands/{code}/topups"
payload = {
"amount": 50000,
"bonus_amount": 50000,
"bonus_rule": "<string>",
"granted_at": "2023-11-07T05:31:56Z"
}
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({
amount: 50000,
bonus_amount: 50000,
bonus_rule: '<string>',
granted_at: '2023-11-07T05:31:56Z'
})
};
fetch('http://localhost:3000/v1/wristbands/{code}/topups', 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/wristbands/{code}/topups",
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([
'amount' => 50000,
'bonus_amount' => 50000,
'bonus_rule' => '<string>',
'granted_at' => '2023-11-07T05:31:56Z'
]),
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/wristbands/{code}/topups"
payload := strings.NewReader("{\n \"amount\": 50000,\n \"bonus_amount\": 50000,\n \"bonus_rule\": \"<string>\",\n \"granted_at\": \"2023-11-07T05:31:56Z\"\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/wristbands/{code}/topups")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 50000,\n \"bonus_amount\": 50000,\n \"bonus_rule\": \"<string>\",\n \"granted_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/v1/wristbands/{code}/topups")
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 \"amount\": 50000,\n \"bonus_amount\": 50000,\n \"bonus_rule\": \"<string>\",\n \"granted_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"object": "topup_result",
"id": "<string>",
"amount": 123,
"previous_balance": 123,
"new_balance": 123,
"bonus_amount": 123,
"bonus_id": "<string>",
"previous_promo_balance": 123,
"new_promo_balance": 123,
"replayed": true
}{
"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>"
}
}Autorizaciones
API key del integrador, emitida desde el panel de VENTRY. Formato vk_live_... en producción y vk_test_... en entornos de prueba.
Encabezados
Parámetros de ruta
Cuerpo
Importe a añadir, en céntimos. 2500 son 25,00 €.
1 <= x <= 100000Regalo que se enseñó al cobrar, en céntimos.
1 <= x <= 100000Id de la bonificación que lo da, de GET /topup-bonuses/quote.
^[0-9a-fA-F]{24}$Cuándo se prometió el regalo (al cobrar). La regla se comprueba en ese momento: una recarga pagada antes del evento puede entregarse cuando la promoción ya terminó. Por defecto, ahora.
Respuesta
Resultado de la recarga.
Resultado de la recarga.
topup_result Regalo concedido, en céntimos. 0 si no se pidió o la regla ya no lo permite.
Id del movimiento del regalo en GET /topups, o null si no hubo.
Saldo regalado tras la recarga, ya con el regalo.
true si la respuesta se reprodujo de un intento anterior con la misma Idempotency-Key.