curl --request POST \
--url https://api.voucher-staging.allride.io/consumer/v1/redemption-links:batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"name": "Jobticket November - employee 42",
"redemptionEntity": {
"refId": "emp-42"
},
"maxRedemptions": 1
},
{
"name": "Jobticket November - employee 43",
"redemptionEntity": {
"refId": "emp-43"
},
"maxRedemptions": 1
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
name: 'Jobticket November - employee 42',
redemptionEntity: {refId: 'emp-42'},
maxRedemptions: 1
},
{
name: 'Jobticket November - employee 43',
redemptionEntity: {refId: 'emp-43'},
maxRedemptions: 1
}
]
})
};
fetch('https://api.voucher-staging.allride.io/consumer/v1/redemption-links:batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.voucher-staging.allride.io/consumer/v1/redemption-links:batch"
payload = { "items": [
{
"name": "Jobticket November - employee 42",
"redemptionEntity": { "refId": "emp-42" },
"maxRedemptions": 1
},
{
"name": "Jobticket November - employee 43",
"redemptionEntity": { "refId": "emp-43" },
"maxRedemptions": 1
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://api.voucher-staging.allride.io/consumer/v1/redemption-links:batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"name\": \"Jobticket November - employee 42\",\n \"redemptionEntity\": {\n \"refId\": \"emp-42\"\n },\n \"maxRedemptions\": 1\n },\n {\n \"name\": \"Jobticket November - employee 43\",\n \"redemptionEntity\": {\n \"refId\": \"emp-43\"\n },\n \"maxRedemptions\": 1\n }\n ]\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.voucher-staging.allride.io/consumer/v1/redemption-links:batch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"name\": \"Jobticket November - employee 42\",\n \"redemptionEntity\": {\n \"refId\": \"emp-42\"\n },\n \"maxRedemptions\": 1\n },\n {\n \"name\": \"Jobticket November - employee 43\",\n \"redemptionEntity\": {\n \"refId\": \"emp-43\"\n },\n \"maxRedemptions\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voucher-staging.allride.io/consumer/v1/redemption-links:batch",
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([
'items' => [
[
'name' => 'Jobticket November - employee 42',
'redemptionEntity' => [
'refId' => 'emp-42'
],
'maxRedemptions' => 1
],
[
'name' => 'Jobticket November - employee 43',
'redemptionEntity' => [
'refId' => 'emp-43'
],
'maxRedemptions' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"resource": "redemption-link-batch-result",
"createdCount": 1,
"items": [
{
"id": 8017,
"resource": "redemption-link",
"token": "ExampleLinkToken000001",
"url": "https://vouchers.example-transit.example.com/r/ExampleLinkToken000001",
"name": "Jobticket November - employee 42",
"mode": "entity-bound",
"redemptionEntity": {
"id": 9030,
"refId": "emp-42"
},
"status": "active",
"_links": {
"self": {
"href": "https://api.voucher.allride.io/consumer/v1/redemption-links/8017",
"type": "application/json"
}
}
}
]
}
}Create redemption links in bulk
Creates up to 100 links in one all-or-nothing call (for example one entity-bound link per employee). Any failing item creates nothing; item failures carry more.validationErrors[].property items[<index>]. The response lists summaries; read full links with GET. See Redemption links.
Required permissions: manage-consumer-redemption-links · API keys: allowed
curl --request POST \
--url https://api.voucher-staging.allride.io/consumer/v1/redemption-links:batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"name": "Jobticket November - employee 42",
"redemptionEntity": {
"refId": "emp-42"
},
"maxRedemptions": 1
},
{
"name": "Jobticket November - employee 43",
"redemptionEntity": {
"refId": "emp-43"
},
"maxRedemptions": 1
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
name: 'Jobticket November - employee 42',
redemptionEntity: {refId: 'emp-42'},
maxRedemptions: 1
},
{
name: 'Jobticket November - employee 43',
redemptionEntity: {refId: 'emp-43'},
maxRedemptions: 1
}
]
})
};
fetch('https://api.voucher-staging.allride.io/consumer/v1/redemption-links:batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.voucher-staging.allride.io/consumer/v1/redemption-links:batch"
payload = { "items": [
{
"name": "Jobticket November - employee 42",
"redemptionEntity": { "refId": "emp-42" },
"maxRedemptions": 1
},
{
"name": "Jobticket November - employee 43",
"redemptionEntity": { "refId": "emp-43" },
"maxRedemptions": 1
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://api.voucher-staging.allride.io/consumer/v1/redemption-links:batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"name\": \"Jobticket November - employee 42\",\n \"redemptionEntity\": {\n \"refId\": \"emp-42\"\n },\n \"maxRedemptions\": 1\n },\n {\n \"name\": \"Jobticket November - employee 43\",\n \"redemptionEntity\": {\n \"refId\": \"emp-43\"\n },\n \"maxRedemptions\": 1\n }\n ]\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.voucher-staging.allride.io/consumer/v1/redemption-links:batch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"name\": \"Jobticket November - employee 42\",\n \"redemptionEntity\": {\n \"refId\": \"emp-42\"\n },\n \"maxRedemptions\": 1\n },\n {\n \"name\": \"Jobticket November - employee 43\",\n \"redemptionEntity\": {\n \"refId\": \"emp-43\"\n },\n \"maxRedemptions\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voucher-staging.allride.io/consumer/v1/redemption-links:batch",
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([
'items' => [
[
'name' => 'Jobticket November - employee 42',
'redemptionEntity' => [
'refId' => 'emp-42'
],
'maxRedemptions' => 1
],
[
'name' => 'Jobticket November - employee 43',
'redemptionEntity' => [
'refId' => 'emp-43'
],
'maxRedemptions' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"resource": "redemption-link-batch-result",
"createdCount": 1,
"items": [
{
"id": 8017,
"resource": "redemption-link",
"token": "ExampleLinkToken000001",
"url": "https://vouchers.example-transit.example.com/r/ExampleLinkToken000001",
"name": "Jobticket November - employee 42",
"mode": "entity-bound",
"redemptionEntity": {
"id": 9030,
"refId": "emp-42"
},
"status": "active",
"_links": {
"self": {
"href": "https://api.voucher.allride.io/consumer/v1/redemption-links/8017",
"type": "application/json"
}
}
}
]
}
}Authorizations
Your API key in Authorization: Bearer <key>. Use vk_test_… keys against the sandbox and vk_live_… keys against production.
Headers
Optional key (1-255 printable ASCII characters, no spaces; a UUID is ideal) that makes this POST safe to retry: the same key with the same request replays the stored response for 24 hours. See Idempotency.
1 - 255^[\x21-\x7E]{1,255}$Body
All-or-nothing creation of up to 100 links.
1-100 link definitions.
1 - 100 elementsShow child attributes
Show child attributes
Response
Created
Single-object envelope around a RedemptionLinkBatchResult.
Result of a bulk link creation.
Show child attributes
Show child attributes