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>"
}
}Top up a wristband's balance
Adds balance to a wristband. Meant for integrators who charge the top-up on their own platform (an online top-up app, for instance) and need to reflect it in VENTRY.
The movement is recorded with payment method online and against your API key’s virtual device. It will show up in the event’s closeout as an online top-up: you collected the money, outside the venue’s tills, and the organiser has to be able to see it to reconcile.
If you showed a bonus when charging (see GET /topup-bonuses/quote), send it in bonus_amount and bonus_rule. At most what the rule allowed at granted_at is granted, and bonus_amount in the response tells you how much was actually given. The gift goes to the gifted balance: it is spent the same way but never refunded.
Requires Idempotency-Key. Retrying with the same key does not top up again.
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>"
}
}Authorizations
Integrator API key, issued from the VENTRY dashboard. Format vk_live_... in production and vk_test_... in test environments.
Headers
Path Parameters
Body
Amount to add, in cents. 2500 is €25.00.
1 <= x <= 100000Gift shown when charging, in cents.
1 <= x <= 100000Id of the bonus that gives it, from GET /topup-bonuses/quote.
^[0-9a-fA-F]{24}$When the gift was promised (when charging). The rule is checked at that moment: a top-up paid before the event may be delivered after the promotion has ended. Defaults to now.
Response
Result of the top-up.
Result of the top-up.
topup_result Gift granted, in cents. 0 if none was requested or the rule no longer allows it.
Id of the gift's movement in GET /topups, or null if there was none.
Gifted balance after the top-up, gift included.
true if the response was replayed from an earlier attempt with the same Idempotency-Key.