curl --request POST \
--url https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/checkout \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"items": [
{
"productId": "664f1a2b3c4d5e6f7a8b9c0d",
"quantity": 1,
"variantId": "664f1a2b3c4d5e6f7a8b9c11",
"variant": "30 dni"
}
],
"consents": {
"terms": true,
"immediateDelivery": true,
"legalVersion": "a3f1c20000000000000000000000000000000000000000000000000000000000"
},
"nick": "Steve",
"email": "gracz@example.com",
"discountCode": "LATO10",
"paymentMethodCode": "imoje",
"paymentChannel": "blik",
"returnUrl": "https://moj-sklep.pl/dziekujemy"
}
'import requests
url = "https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/checkout"
payload = {
"items": [
{
"productId": "664f1a2b3c4d5e6f7a8b9c0d",
"quantity": 1,
"variantId": "664f1a2b3c4d5e6f7a8b9c11",
"variant": "30 dni"
}
],
"consents": {
"terms": True,
"immediateDelivery": True,
"legalVersion": "a3f1c20000000000000000000000000000000000000000000000000000000000"
},
"nick": "Steve",
"email": "gracz@example.com",
"discountCode": "LATO10",
"paymentMethodCode": "imoje",
"paymentChannel": "blik",
"returnUrl": "https://moj-sklep.pl/dziekujemy"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
productId: '664f1a2b3c4d5e6f7a8b9c0d',
quantity: 1,
variantId: '664f1a2b3c4d5e6f7a8b9c11',
variant: '30 dni'
}
],
consents: {
terms: true,
immediateDelivery: true,
legalVersion: 'a3f1c20000000000000000000000000000000000000000000000000000000000'
},
nick: 'Steve',
email: 'gracz@example.com',
discountCode: 'LATO10',
paymentMethodCode: 'imoje',
paymentChannel: 'blik',
returnUrl: 'https://moj-sklep.pl/dziekujemy'
})
};
fetch('https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/checkout', 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}/checkout",
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' => [
[
'productId' => '664f1a2b3c4d5e6f7a8b9c0d',
'quantity' => 1,
'variantId' => '664f1a2b3c4d5e6f7a8b9c11',
'variant' => '30 dni'
]
],
'consents' => [
'terms' => true,
'immediateDelivery' => true,
'legalVersion' => 'a3f1c20000000000000000000000000000000000000000000000000000000000'
],
'nick' => 'Steve',
'email' => 'gracz@example.com',
'discountCode' => 'LATO10',
'paymentMethodCode' => 'imoje',
'paymentChannel' => 'blik',
'returnUrl' => 'https://moj-sklep.pl/dziekujemy'
]),
CURLOPT_HTTPHEADER => [
"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 := "https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/checkout"
payload := strings.NewReader("{\n \"items\": [\n {\n \"productId\": \"664f1a2b3c4d5e6f7a8b9c0d\",\n \"quantity\": 1,\n \"variantId\": \"664f1a2b3c4d5e6f7a8b9c11\",\n \"variant\": \"30 dni\"\n }\n ],\n \"consents\": {\n \"terms\": true,\n \"immediateDelivery\": true,\n \"legalVersion\": \"a3f1c20000000000000000000000000000000000000000000000000000000000\"\n },\n \"nick\": \"Steve\",\n \"email\": \"gracz@example.com\",\n \"discountCode\": \"LATO10\",\n \"paymentMethodCode\": \"imoje\",\n \"paymentChannel\": \"blik\",\n \"returnUrl\": \"https://moj-sklep.pl/dziekujemy\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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}/checkout")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"productId\": \"664f1a2b3c4d5e6f7a8b9c0d\",\n \"quantity\": 1,\n \"variantId\": \"664f1a2b3c4d5e6f7a8b9c11\",\n \"variant\": \"30 dni\"\n }\n ],\n \"consents\": {\n \"terms\": true,\n \"immediateDelivery\": true,\n \"legalVersion\": \"a3f1c20000000000000000000000000000000000000000000000000000000000\"\n },\n \"nick\": \"Steve\",\n \"email\": \"gracz@example.com\",\n \"discountCode\": \"LATO10\",\n \"paymentMethodCode\": \"imoje\",\n \"paymentChannel\": \"blik\",\n \"returnUrl\": \"https://moj-sklep.pl/dziekujemy\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/checkout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"productId\": \"664f1a2b3c4d5e6f7a8b9c0d\",\n \"quantity\": 1,\n \"variantId\": \"664f1a2b3c4d5e6f7a8b9c11\",\n \"variant\": \"30 dni\"\n }\n ],\n \"consents\": {\n \"terms\": true,\n \"immediateDelivery\": true,\n \"legalVersion\": \"a3f1c20000000000000000000000000000000000000000000000000000000000\"\n },\n \"nick\": \"Steve\",\n \"email\": \"gracz@example.com\",\n \"discountCode\": \"LATO10\",\n \"paymentMethodCode\": \"imoje\",\n \"paymentChannel\": \"blik\",\n \"returnUrl\": \"https://moj-sklep.pl/dziekujemy\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"orderId": "664f1a2b3c4d5e6f7a8b9c0d",
"orderNumber": "A1B2C3D4",
"statusKey": "k3m9x2p7qa",
"status": "pending",
"groupId": null,
"orderIds": [
"664f1a2b3c4d5e6f7a8b9c0d"
],
"redirectUrl": "https://pay.imoje.pl/…",
"free": false
}
}{
"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": {}
}{
"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": {}
}Create an order and get the payment redirect
Creates the order and the payment session; redirect the buyer to redirectUrl. Several lines (up to 20) = a payment group: one order per line (orderIds), one provider transaction for the total, orderId = groupId (returned in itemshop_order). Method amount limits apply to the total. Retrying with the same Idempotency-Key and the same body returns the same order/group.
curl --request POST \
--url https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/checkout \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"items": [
{
"productId": "664f1a2b3c4d5e6f7a8b9c0d",
"quantity": 1,
"variantId": "664f1a2b3c4d5e6f7a8b9c11",
"variant": "30 dni"
}
],
"consents": {
"terms": true,
"immediateDelivery": true,
"legalVersion": "a3f1c20000000000000000000000000000000000000000000000000000000000"
},
"nick": "Steve",
"email": "gracz@example.com",
"discountCode": "LATO10",
"paymentMethodCode": "imoje",
"paymentChannel": "blik",
"returnUrl": "https://moj-sklep.pl/dziekujemy"
}
'import requests
url = "https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/checkout"
payload = {
"items": [
{
"productId": "664f1a2b3c4d5e6f7a8b9c0d",
"quantity": 1,
"variantId": "664f1a2b3c4d5e6f7a8b9c11",
"variant": "30 dni"
}
],
"consents": {
"terms": True,
"immediateDelivery": True,
"legalVersion": "a3f1c20000000000000000000000000000000000000000000000000000000000"
},
"nick": "Steve",
"email": "gracz@example.com",
"discountCode": "LATO10",
"paymentMethodCode": "imoje",
"paymentChannel": "blik",
"returnUrl": "https://moj-sklep.pl/dziekujemy"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
productId: '664f1a2b3c4d5e6f7a8b9c0d',
quantity: 1,
variantId: '664f1a2b3c4d5e6f7a8b9c11',
variant: '30 dni'
}
],
consents: {
terms: true,
immediateDelivery: true,
legalVersion: 'a3f1c20000000000000000000000000000000000000000000000000000000000'
},
nick: 'Steve',
email: 'gracz@example.com',
discountCode: 'LATO10',
paymentMethodCode: 'imoje',
paymentChannel: 'blik',
returnUrl: 'https://moj-sklep.pl/dziekujemy'
})
};
fetch('https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/checkout', 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}/checkout",
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' => [
[
'productId' => '664f1a2b3c4d5e6f7a8b9c0d',
'quantity' => 1,
'variantId' => '664f1a2b3c4d5e6f7a8b9c11',
'variant' => '30 dni'
]
],
'consents' => [
'terms' => true,
'immediateDelivery' => true,
'legalVersion' => 'a3f1c20000000000000000000000000000000000000000000000000000000000'
],
'nick' => 'Steve',
'email' => 'gracz@example.com',
'discountCode' => 'LATO10',
'paymentMethodCode' => 'imoje',
'paymentChannel' => 'blik',
'returnUrl' => 'https://moj-sklep.pl/dziekujemy'
]),
CURLOPT_HTTPHEADER => [
"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 := "https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/checkout"
payload := strings.NewReader("{\n \"items\": [\n {\n \"productId\": \"664f1a2b3c4d5e6f7a8b9c0d\",\n \"quantity\": 1,\n \"variantId\": \"664f1a2b3c4d5e6f7a8b9c11\",\n \"variant\": \"30 dni\"\n }\n ],\n \"consents\": {\n \"terms\": true,\n \"immediateDelivery\": true,\n \"legalVersion\": \"a3f1c20000000000000000000000000000000000000000000000000000000000\"\n },\n \"nick\": \"Steve\",\n \"email\": \"gracz@example.com\",\n \"discountCode\": \"LATO10\",\n \"paymentMethodCode\": \"imoje\",\n \"paymentChannel\": \"blik\",\n \"returnUrl\": \"https://moj-sklep.pl/dziekujemy\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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}/checkout")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"productId\": \"664f1a2b3c4d5e6f7a8b9c0d\",\n \"quantity\": 1,\n \"variantId\": \"664f1a2b3c4d5e6f7a8b9c11\",\n \"variant\": \"30 dni\"\n }\n ],\n \"consents\": {\n \"terms\": true,\n \"immediateDelivery\": true,\n \"legalVersion\": \"a3f1c20000000000000000000000000000000000000000000000000000000000\"\n },\n \"nick\": \"Steve\",\n \"email\": \"gracz@example.com\",\n \"discountCode\": \"LATO10\",\n \"paymentMethodCode\": \"imoje\",\n \"paymentChannel\": \"blik\",\n \"returnUrl\": \"https://moj-sklep.pl/dziekujemy\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://itemshop.dev/api/v2/storefront/v1/shops/{shopId}/checkout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"productId\": \"664f1a2b3c4d5e6f7a8b9c0d\",\n \"quantity\": 1,\n \"variantId\": \"664f1a2b3c4d5e6f7a8b9c11\",\n \"variant\": \"30 dni\"\n }\n ],\n \"consents\": {\n \"terms\": true,\n \"immediateDelivery\": true,\n \"legalVersion\": \"a3f1c20000000000000000000000000000000000000000000000000000000000\"\n },\n \"nick\": \"Steve\",\n \"email\": \"gracz@example.com\",\n \"discountCode\": \"LATO10\",\n \"paymentMethodCode\": \"imoje\",\n \"paymentChannel\": \"blik\",\n \"returnUrl\": \"https://moj-sklep.pl/dziekujemy\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"orderId": "664f1a2b3c4d5e6f7a8b9c0d",
"orderNumber": "A1B2C3D4",
"statusKey": "k3m9x2p7qa",
"status": "pending",
"groupId": null,
"orderIds": [
"664f1a2b3c4d5e6f7a8b9c0d"
],
"redirectUrl": "https://pay.imoje.pl/…",
"free": false
}
}{
"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": {}
}{
"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
Cloudflare Turnstile token. Optional; required only after a burst of attempts from one IP (CAPTCHA_REQUIRED).
Random attempt key (32–128 chars [A-Za-z0-9_-], e.g. a UUID). Reuse only for an identical retry.
"3b0f6f1e-9c2a-4d1b-8a52-1f0e2c7d9a44"
Parametry ścieżki
Shop ID (ObjectId). Also accepts the uniqueName, an active custom domain or <uniqueName>.<hosting domain>.
"664f1a2b3c4d5e6f7a8b9c0d"
Treść
Cart lines (1–20). Several lines = a payment group: one order per line and one payment for the total (adr/0002)
1 - 20 elementsShow child attributes
Show child attributes
Show child attributes
Show child attributes
Player nick. Required when shop.kind = game (or the product runs {PLAYER} commands) — otherwise NICK_REQUIRED
^[a-zA-Z0-9_]{3,16}$"Steve"
Buyer email. Required without a nick (general shop) — it then identifies the buyer; otherwise EMAIL_REQUIRED
3 - 254"gracz@example.com"
1 - 50^[A-Za-z0-9_-]+$"LATO10"
Required for paid orders (from payment-methods)
1 - 100^[^:]+$"imoje"
Method channel (from payment-methods[].channel)
1 - 60"blik"
Where the gateway sends the buyer back. Must be on a shop domain (or a preview / localhost). The platform sets the query parameter itemshop_order=<orderId> and drops any fragment (#…); read it from location.search. Without returnUrl — the platform-hosted shop status page.
1 - 2048"https://moj-sklep.pl/dziekujemy"
Czy ta strona była pomocna?