Zrealizuj 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
Zrealizuj voucher
Zakłada darmowe zamówienie na produkt z vouchera dla podanego nicku.
POST
/
api
/
v2
/
storefront
/
v1
/
shops
/
{shopId}
/
vouchers
/
redeem
Zrealizuj 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
Token Turnstile (zamiast pola turnstileToken). Opcjonalny; wymagany dopiero po serii prób z jednego IP (CAPTCHA_REQUIRED)
Parametry ścieżki
ID sklepu (ObjectId). Przyjmuje też uniqueName, aktywną własną domenę albo <uniqueName>.<domena hostingu>.
Przykład:
"664f1a2b3c4d5e6f7a8b9c0d"
Treść
application/json
Kod vouchera (wielkość liter bez znaczenia)
Pattern:
^[A-Z0-9]{4,12}$Przykład:
"ABC123"
Nick gracza w Minecraft
Pattern:
^[a-zA-Z0-9_]{3,16}$Przykład:
"Steve"
E-mail na treść cyfrową, gdy produkt vouchera ją ma (deliveryKind ≠ commands). Bez niego treść jest do odebrania przez GET /orders/by-number/{n}/delivery
Maximum string length:
254Przykład:
"jan@example.com"
Token Cloudflare Turnstile (albo nagłówek cf-turnstile-response). Opcjonalny — tryb adaptacyjny jak w kasie: wymagany dopiero po 403 CAPTCHA_REQUIRED
Required string length:
1 - 4096Czy ta strona była pomocna?
⌘I