Redeem a voucher
curl --request POST \
--url https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/vouchers/redeem \
--header 'Content-Type: application/json' \
--data '
{
"code": "ABC123",
"nick": "Steve",
"email": "jan@example.com",
"turnstileToken": "<string>"
}
'import requests
url = "https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/vouchers/redeem"
payload = {
"code": "ABC123",
"nick": "Steve",
"email": "jan@example.com",
"turnstileToken": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
code: 'ABC123',
nick: 'Steve',
email: 'jan@example.com',
turnstileToken: '<string>'
})
};
fetch('https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/vouchers/redeem', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/vouchers/redeem",
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([
'code' => 'ABC123',
'nick' => 'Steve',
'email' => 'jan@example.com',
'turnstileToken' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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 := "https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/vouchers/redeem"
payload := strings.NewReader("{\n \"code\": \"ABC123\",\n \"nick\": \"Steve\",\n \"email\": \"jan@example.com\",\n \"turnstileToken\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/vouchers/redeem")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"ABC123\",\n \"nick\": \"Steve\",\n \"email\": \"jan@example.com\",\n \"turnstileToken\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/vouchers/redeem")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"ABC123\",\n \"nick\": \"Steve\",\n \"email\": \"jan@example.com\",\n \"turnstileToken\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"orderId": "664f1a2b3c4d5e6f7a8b9c0d",
"orderNumber": "A1B2C3D4",
"statusKey": "k3m9x2p7qa",
"status": "paid",
"productName": "Ranga VIP",
"serverName": "Survival",
"nick": "Steve"
}
}{
"success": false,
"statusCode": 404,
"code": "SHOP_NOT_FOUND",
"message": "Shop not found",
"error": "Shop not found",
"timestamp": "2026-10-27T12:00:00.000Z",
"path": "/api/v2/storefront/v1/shops/moj-sklep",
"details": {}
}{
"success": false,
"statusCode": 404,
"code": "SHOP_NOT_FOUND",
"message": "Shop not found",
"error": "Shop not found",
"timestamp": "2026-10-27T12:00:00.000Z",
"path": "/api/v2/storefront/v1/shops/moj-sklep",
"details": {}
}{
"success": false,
"statusCode": 404,
"code": "SHOP_NOT_FOUND",
"message": "Shop not found",
"error": "Shop not found",
"timestamp": "2026-10-27T12:00:00.000Z",
"path": "/api/v2/storefront/v1/shops/moj-sklep",
"details": {}
}{
"success": false,
"statusCode": 404,
"code": "SHOP_NOT_FOUND",
"message": "Shop not found",
"error": "Shop not found",
"timestamp": "2026-10-27T12:00:00.000Z",
"path": "/api/v2/storefront/v1/shops/moj-sklep",
"details": {}
}Storefront v1
Redeem a voucher
Creates a free order for the voucher product for the given nick.
POST
/
api
/
v2
/
storefront
/
v1
/
shops
/
{shopId}
/
vouchers
/
redeem
Redeem a voucher
curl --request POST \
--url https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/vouchers/redeem \
--header 'Content-Type: application/json' \
--data '
{
"code": "ABC123",
"nick": "Steve",
"email": "jan@example.com",
"turnstileToken": "<string>"
}
'import requests
url = "https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/vouchers/redeem"
payload = {
"code": "ABC123",
"nick": "Steve",
"email": "jan@example.com",
"turnstileToken": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
code: 'ABC123',
nick: 'Steve',
email: 'jan@example.com',
turnstileToken: '<string>'
})
};
fetch('https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/vouchers/redeem', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/vouchers/redeem",
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([
'code' => 'ABC123',
'nick' => 'Steve',
'email' => 'jan@example.com',
'turnstileToken' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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 := "https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/vouchers/redeem"
payload := strings.NewReader("{\n \"code\": \"ABC123\",\n \"nick\": \"Steve\",\n \"email\": \"jan@example.com\",\n \"turnstileToken\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/vouchers/redeem")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"ABC123\",\n \"nick\": \"Steve\",\n \"email\": \"jan@example.com\",\n \"turnstileToken\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/vouchers/redeem")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"ABC123\",\n \"nick\": \"Steve\",\n \"email\": \"jan@example.com\",\n \"turnstileToken\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"orderId": "664f1a2b3c4d5e6f7a8b9c0d",
"orderNumber": "A1B2C3D4",
"statusKey": "k3m9x2p7qa",
"status": "paid",
"productName": "Ranga VIP",
"serverName": "Survival",
"nick": "Steve"
}
}{
"success": false,
"statusCode": 404,
"code": "SHOP_NOT_FOUND",
"message": "Shop not found",
"error": "Shop not found",
"timestamp": "2026-10-27T12:00:00.000Z",
"path": "/api/v2/storefront/v1/shops/moj-sklep",
"details": {}
}{
"success": false,
"statusCode": 404,
"code": "SHOP_NOT_FOUND",
"message": "Shop not found",
"error": "Shop not found",
"timestamp": "2026-10-27T12:00:00.000Z",
"path": "/api/v2/storefront/v1/shops/moj-sklep",
"details": {}
}{
"success": false,
"statusCode": 404,
"code": "SHOP_NOT_FOUND",
"message": "Shop not found",
"error": "Shop not found",
"timestamp": "2026-10-27T12:00:00.000Z",
"path": "/api/v2/storefront/v1/shops/moj-sklep",
"details": {}
}{
"success": false,
"statusCode": 404,
"code": "SHOP_NOT_FOUND",
"message": "Shop not found",
"error": "Shop not found",
"timestamp": "2026-10-27T12:00:00.000Z",
"path": "/api/v2/storefront/v1/shops/moj-sklep",
"details": {}
}Nagłówki
Turnstile token (instead of the turnstileToken field). Optional; required only after a burst of attempts from one IP (CAPTCHA_REQUIRED)
Parametry ścieżki
Shop ID (ObjectId). Also accepts the uniqueName, an active custom domain or <uniqueName>.<hosting domain>.
Przykład:
"664f1a2b3c4d5e6f7a8b9c0d"
Treść
application/json
Voucher code (case-insensitive)
Pattern:
^[A-Z0-9]{4,12}$Przykład:
"ABC123"
Minecraft player nickname
Pattern:
^[a-zA-Z0-9_]{3,16}$Przykład:
"Steve"
E-mail for digital content when the voucher product has it (deliveryKind ≠ commands). Without it, collect the content via GET /orders/by-number/{n}/delivery
Maximum string length:
254Przykład:
"jan@example.com"
Cloudflare Turnstile token (or the cf-turnstile-response header). Optional — adaptive like checkout: required only after 403 CAPTCHA_REQUIRED
Required string length:
1 - 4096Czy ta strona była pomocna?
⌘I