curl --request POST \
--url https://api.voucher-staging.allride.io/consumer/v1/redemption-entities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"refId": "customer:48213",
"displayName": null,
"metadata": {
"segment": "jobticket"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({refId: 'customer:48213', displayName: null, metadata: {segment: 'jobticket'}})
};
fetch('https://api.voucher-staging.allride.io/consumer/v1/redemption-entities', 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-entities"
payload = {
"refId": "customer:48213",
"displayName": None,
"metadata": { "segment": "jobticket" }
}
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-entities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"refId\": \"customer:48213\",\n \"displayName\": null,\n \"metadata\": {\n \"segment\": \"jobticket\"\n }\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.voucher-staging.allride.io/consumer/v1/redemption-entities"
payload := strings.NewReader("{\n \"refId\": \"customer:48213\",\n \"displayName\": null,\n \"metadata\": {\n \"segment\": \"jobticket\"\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-entities",
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([
'refId' => 'customer:48213',
'displayName' => null,
'metadata' => [
'segment' => 'jobticket'
]
]),
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;
}Create a redemption entity
Creates a redemption entity. refId is unique per partner; a second create with the same refId answers 409 ref-id-taken with the existing id. Entities created with an API key do not send the redemption-entity-created webhook. You can also create entities inline when redeeming. See Redemption entities.
Required permissions: manage-consumer-redemption-entities · API keys: allowed
curl --request POST \
--url https://api.voucher-staging.allride.io/consumer/v1/redemption-entities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"refId": "customer:48213",
"displayName": null,
"metadata": {
"segment": "jobticket"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({refId: 'customer:48213', displayName: null, metadata: {segment: 'jobticket'}})
};
fetch('https://api.voucher-staging.allride.io/consumer/v1/redemption-entities', 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-entities"
payload = {
"refId": "customer:48213",
"displayName": None,
"metadata": { "segment": "jobticket" }
}
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-entities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"refId\": \"customer:48213\",\n \"displayName\": null,\n \"metadata\": {\n \"segment\": \"jobticket\"\n }\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.voucher-staging.allride.io/consumer/v1/redemption-entities"
payload := strings.NewReader("{\n \"refId\": \"customer:48213\",\n \"displayName\": null,\n \"metadata\": {\n \"segment\": \"jobticket\"\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-entities",
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([
'refId' => 'customer:48213',
'displayName' => null,
'metadata' => [
'segment' => 'jobticket'
]
]),
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;
}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 fields optional; {} creates an anonymous entity. email is not writable.
Your opaque reference; ^[A-Za-z0-9._:@/+=-]{1,128}$.
1 - 128^[A-Za-z0-9._:@/+=-]{1,128}$1-120 characters; an empty string is stored as null.
120Your own JSON object, stored and returned as sent (key order not preserved); at most 16 KiB, depth 5 and 100 keys per object. Never put personal data here.
{ "orderId": "8812", "channel": "app" }
Response
Created
Single-object envelope around a RedemptionEntity.
Your record of who or what redeems. An erased entity returns refId, displayName, email and metadata as null.
Show child attributes
Show child attributes