API
The Stakk Developer API.
Developer calls go to https://stakk.cc/api/dev/v1 over HTTPS. Send Authorization: Bearer sk_live_your_api_key.
A hosted product checkout is POST https://stakk.cc/checkout/{shopId}/sessions and does not use an API key. A payment for your own UI is POST https://stakk.cc/checkout/{shopId}/payments and does use a key for that shop.
A store's public products, prices, and stock are at GET https://stakk.cc/api/v1/catalog/{shop} with no key. See Public catalog.
Conventions
| Topic | Rule |
|---|---|
| Envelope | /api/dev/v1 answers { "data": ... }. A failure is { "error": { "code", "message" } } with a 4xx or 5xx status. The /checkout/{shopId}/... routes answer the object itself, without data. Their failures use the same error shape. New fields can be added to any response. Ignore fields you do not know. |
| Money | Prices, totals, and amount_paid are decimal strings with two places, such as "29.00", in the order or shop currency. Amounts you send can be numbers or strings. |
| Currency | Three-letter ISO code. A product checkout uses the shop currency. A custom amount can name its own. |
| Times | created_at on webhook envelopes is unix seconds. Order and product times are ISO 8601 in UTC. |
| Lists | limit is 1 to 100, default 50. A page ends with pagination.has_more and pagination.next_cursor. Send next_cursor back as cursor for the next page. A cursor keeps working when its row has since left the filter, for example an order that got paid while you list PENDING ones. A cursor that cannot be read is 400 INVALID_CURSOR. |
| Retries | Send an Idempotency-Key header (1 to 255 printable characters, no spaces) on POST /checkout/{shopId}/sessions, POST /checkout/{shopId}/payments, and POST /payments. The same key and body within 24 hours return the first response with Idempotent-Replayed: true. The same key with a different body is 422 IDEMPOTENCY_KEY_REUSED. A request that failed does not keep the key. |
Every call that creates a checkout needs the buyer's email (customer_email, or email). Without one it fails with 400 EMAIL_REQUIRED and nothing is created. Payment links ask the buyer for it before the order exists. | |
| Your ids | reference (alias client_reference_id, up to 200 characters) and metadata (up to 20 keys, string values up to 500 characters) are stored on the order and returned on GET /orders/:id and in webhooks. |
| Test mode | There are no separate test keys yet. A shop with test mode on uses processor sandboxes, and webhooks still fire. Use a second shop for tests. |
Authentication
GET/me
No body. The key in the header is the only input.
Request
curl https://stakk.cc/api/dev/v1/me \
-H "Authorization: Bearer sk_live_your_api_key"
Response
{
"data": {
"id": "shop_1",
"name": "Sable",
"currency": "EUR",
"slug": "sable",
"plan": "pro",
"test_mode": false,
"created_at": 1710000000
}
}
test_mode: true means the shop uses processor test hosts and sandbox payment notifications. Webhooks still fire. A shop that charges customers returns test_mode: false.
Coupons
Create a coupon
POST/coupons
codestringrequired
discount_valuenumberrequired
FIXED amount is in the shop currency.discount_typestring
PERCENTAGE or FIXED. Default PERCENTAGE.max_usesinteger
-1, 0, or left out means no limit.max_uses_per_customerinteger
max_uses.all_productsboolean
true when no products or variants are given.products_boundstring[]
variants_boundstring[]
min_order_amountnumber
min_amount_scopestring
CART (default) measures the minimum on the whole cart subtotal. PRODUCTS measures it only on the lines the coupon covers.min_quantityinteger
max_discountnumber
applies_tostring
TOTAL (default) takes the discount off the order. PAYMENT_FEES leaves the order price alone and only takes it off the extra charge of the payment method the buyer picks, such as a +15% card fee. It never takes off more than that fee, and a method with no fee gets no discount.first_order_onlyboolean
allowed_emailsstring[]
all_payment_methodsboolean
true when no methods are given.allowed_payment_gatewaysstring[]
STRIPE or BTC. CRYPTO or STAKK_WALLET covers every coin.valid_frominteger
expire_atinteger
valid_from and, on create, in the future.Request
curl https://stakk.cc/api/dev/v1/coupons \
-X POST \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"code":"BLACK_FRIDAY","discount_value":35,"max_uses":50,"products_bound":["demo_pro-license"],"discount_type":"PERCENTAGE"}'
Response
{
"data": {
"uniqid": "8f3c0b2a",
"code": "BLACK_FRIDAY",
"type": "PERCENTAGE",
"discount": 35,
"max_uses": 50,
"used": 0,
"products_bound": ["demo_pro-license"]
}
}
A duplicate code returns 409 COUPON_EXISTS. A coupon that could never work (0% off, an end before its start, a per-customer limit above the total, a bad email) returns 400 VALIDATION with the reason in message.
How uses are counted is a shop setting: when the checkout is created (default; a cancelled or expired order gives its use back) or when payment completes. An order that already holds a coupon keeps it when the buyer changes the cart, tip, or email. If the coupon stops qualifying (for example the cart drops below the minimum), it is removed from the order and its use is given back.
The payment method is checked when the buyer starts paying. A coupon limited to other methods returns 400 COUPON_PAYMENT_METHOD. So does any coupon when the shop turned off stacking with a payment method that has its own discount.
Get a coupon
GET/coupons/:uniqid
| Parameter | Meaning |
|---|---|
| uniqid | Path. The coupon id or its code. |
Request
curl https://stakk.cc/api/dev/v1/coupons/BLACK_FRIDAY \
-H "Authorization: Bearer sk_live_your_api_key"
Response
{ "data": { "code": "BLACK_FRIDAY", "type": "PERCENTAGE", "discount": 35 } }
List coupons
GET/coupons
| Parameter | Meaning |
|---|---|
| limit | Query. Page size. |
| cursor | Query. pagination.next_cursor from the previous page. |
Request
curl "https://stakk.cc/api/dev/v1/coupons?limit=25" \
-H "Authorization: Bearer sk_live_your_api_key"
Response
{ "data": [{ "uniqid": "8f3c0b2a", "code": "BLACK_FRIDAY", "discount": 35 }] }
Edit a coupon
PATCH/coupons/:uniqid
Same fields as create. Send only the fields that change. :uniqid is the id or the code.
Request
curl https://stakk.cc/api/dev/v1/coupons/BLACK_FRIDAY \
-X PATCH \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"max_uses":10}'
Response
{ "data": { "code": "BLACK_FRIDAY", "max_uses": 10 } }
Delete a coupon
DELETE/coupons/:uniqid
| Parameter | Meaning |
|---|---|
| uniqid | Path. Id or code. |
If the code was already used on an order, the coupon is turned off instead of removed.
Request
curl https://stakk.cc/api/dev/v1/coupons/BLACK_FRIDAY \
-X DELETE \
-H "Authorization: Bearer sk_live_your_api_key"
Response
{ "data": { "deactivated": false } }
Products
Create a product
POST/products
titlestring
Untitled.pricenumber
0.00. 0 or more. A comma decimal such as "9,99" is read as 9.99. Anything else is 400 VALIDATION.descriptionstring
typestring
FILE, SERIALS, SERVICE, DYNAMIC, or SUBSCRIPTION. Default FILE. DYNAMIC asks your server for the goods after payment; see Dynamic delivery.dynamic_webhookstring
DYNAMIC only. Public https URL Stakk calls after payment.dynamic_secretstring
DYNAMIC only. 16 to 200 characters. Signs each request. Never returned; responses show dynamic_secret_set.serialsstring[]
type is SERIALS.recurring_intervalstring
DAY, WEEK, MONTH, or YEAR for a subscription.recurring_interval_countinteger
1.trial_periodinteger
0.Currency is the shop currency.
Request
curl https://stakk.cc/api/dev/v1/products \
-X POST \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"title":"Software Activation Keys","price":12.5,"description":"Product description example.","type":"SERIALS","serials":["activation-key-1"]}'
Response
201 with the created product in data, including its uniqid.
Get a product
GET/products/:uniqid
| Parameter | Meaning |
|---|---|
| uniqid | Path. Product id. |
Request
curl https://stakk.cc/api/dev/v1/products/demo_pro-license \
-H "Authorization: Bearer sk_live_your_api_key"
Response
{ "data": { "uniqid": "demo_pro-license", "title": "Pro License", "price": "29.00" } }
List products
GET/products
| Parameter | Meaning |
|---|---|
| limit | Query. Page size. |
| cursor | Query. pagination.next_cursor from the previous page. |
Request
curl "https://stakk.cc/api/dev/v1/products?limit=25" \
-H "Authorization: Bearer sk_live_your_api_key"
Response
{ "data": [{ "uniqid": "demo_pro-license", "title": "Pro License" }] }
Edit a product
PATCH/products/:uniqid
Send the product fields you want to change, such as title or price.
Request
curl https://stakk.cc/api/dev/v1/products/demo_pro-license \
-X PATCH \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"price":"19.00"}'
Response
200 with the updated product in data.
Delete a product
DELETE/products/:uniqid
| Parameter | Meaning |
|---|---|
| uniqid | Path. Product id. |
Request
curl https://stakk.cc/api/dev/v1/products/demo_pro-license \
-X DELETE \
-H "Authorization: Bearer sk_live_your_api_key"
Response
204 with an empty body. 404 if the product is not on this shop.
Orders
Orders and invoices are the same record.
GET/orders
| Parameter | Meaning |
|---|---|
| limit | Query. Page size. |
| cursor | Query. pagination.next_cursor from the previous page. |
| status | Query. Optional status filter, such as PENDING or COMPLETED. |
| Query. Optional buyer email, matched without regard to case. |
GET /invoices is the same list.
Request
curl "https://stakk.cc/api/dev/v1/orders?limit=25" \
-H "Authorization: Bearer sk_live_your_api_key"
Response
{ "data": [{ "uniqid": "inv_1", "status": "COMPLETED", "total": "29.00" }] }
GET/orders/:id
| Parameter | Meaning |
|---|---|
| id | Path. Order or invoice id. |
GET /invoices/:uniqid is the same read.
Request
curl https://stakk.cc/api/dev/v1/orders/inv_1 \
-H "Authorization: Bearer sk_live_your_api_key"
Response
{
"data": {
"uniqid": "inv_1",
"status": "COMPLETED",
"gateway": "STRIPE",
"currency": "USD",
"subtotal": "50.00",
"discount": "5.00",
"total": "45.00",
"amount_paid": "45.00",
"coupon_code": "LUMA10",
"customer_email": "buyer@example.com",
"reference": "user_42_order_7",
"client_reference_id": "user_42_order_7",
"metadata": { "user_id": "42" },
"created_at": "2026-11-04T10:00:00.000Z",
"paid_at": "2026-11-04T10:01:12.000Z",
"items": [
{ "product_id": "gb_resi", "variant_id": null, "title": "Residential GB", "quantity": 20, "unit_price": "2.50", "fulfillment_status": "delivered" }
]
}
}
The order has more fields than shown, such as delivery details for each item. These are the ones to build on:
| Field | Meaning |
|---|---|
| uniqid | Stakk order id. The same value as id on a session. |
| status | See the table below. |
| total | What the buyer owes after discounts, as a string. |
| amount_paid | What has been received. Equal to total once paid. Lower while an order is UNDERPAID. |
| reference | Your id from the session or payment call. client_reference_id is the same value. |
| metadata | Your key-value pairs, as strings. |
| items | One row per line: product_id, variant_id, title, quantity, unit_price, and fulfillment_status. Custom-amount lines have no product_id. |
| paid_at | When payment was confirmed. null until then. |
| Status | Meaning |
|---|---|
PENDING | Created. Not paid yet. |
PROCESSING, WAITING_FOR_CONFIRMATIONS | A payment is in flight. Crypto is waiting for confirmations. |
UNDERPAID | Less than the total arrived. A later payment can complete it. |
COMPLETED | Paid. Deliver on this, or on the order:paid webhook. |
REFUNDED, PARTIALLY_REFUNDED | Money went back to the buyer. |
VOIDED, CANCELLED, EXPIRED | Closed without payment. |
Other values can appear for older orders. Treat anything not listed as not paid.
POST/orders/:id/complete
| Parameter | Meaning |
|---|---|
| id | Path. Order id. |
No body. Marks an unpaid order paid and delivers it. Needs the orders.complete scope. Orders paid by card or crypto complete on their own and answer 409 COMPLETION_NOT_ALLOWED. Calling it on an order that is already paid delivers anything still undelivered and returns the order. A closed or refunded order is 409 INVOICE_NOT_PAYABLE.
POST /orders/:id/fulfill needs the orders.fulfill scope and only delivers a paid order's items. It never marks an order paid: an unpaid order is 409 INVOICE_NOT_PAID.
Request
curl https://stakk.cc/api/dev/v1/orders/inv_1/complete \
-X POST \
-H "Authorization: Bearer sk_live_your_api_key"
Response
200 with the updated order in data.
POST/orders/:id/refund
| Parameter | Meaning |
|---|---|
| id | Path. Order id. |
Request
curl https://stakk.cc/api/dev/v1/orders/inv_1/refund \
-X POST \
-H "Authorization: Bearer sk_live_your_api_key"
Response
200 with the refunded order in data. The whole amount paid is refunded; partial refunds are not supported yet. Only a paid order can be refunded. Any other order is 409 INVOICE_NOT_REFUNDABLE. Refunding an order that is already refunded returns it unchanged. A refund revokes delivered license keys and cancels the order's subscriptions.
Customers
POST/customers
| Field | Meaning |
|---|---|
| Required. | |
| name | Display name. |
Request
curl https://stakk.cc/api/dev/v1/customers \
-X POST \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"email":"buyer@example.com","name":"Alex"}'
Response
{ "data": { "id": "cus_1", "email": "buyer@example.com", "name": "Alex" } }
GET/customers/:id
| Parameter | Meaning |
|---|---|
| id | Path. Customer id. |
Response
{ "data": { "id": "cus_1", "email": "buyer@example.com", "name": "Alex" } }
DELETE/customers/:id
| Parameter | Meaning |
|---|---|
| id | Path. Customer id. |
Response
204 with an empty body.
Categories
POST/categories
| Field | Meaning |
|---|---|
| title | Category name. name is accepted too. |
| products_bound | Product IDs in this category. |
Request
curl https://stakk.cc/api/dev/v1/categories \
-X POST \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"title":"Software","products_bound":["demo_pro-license"]}'
Response
{ "data": { "id": "cat_1", "title": "Software", "products_count": 1 } }
Groups
POST/groups
| Field | Meaning |
|---|---|
| title | Group name. |
| products_bound | Product IDs in the group. |
| unlisted | true hides the group. |
Request
curl https://stakk.cc/api/dev/v1/groups \
-X POST \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"title":"Bundles","products_bound":["demo_pro-license"]}'
Response
201 with the group in data, including uniqid and products_count.
Feedback
POST/reviews/:id/reply
| Field | Meaning |
|---|---|
| id | Path. Review id. feedback reads use the same id. |
| body | Reply text. reply is accepted too. |
Request
curl https://stakk.cc/api/dev/v1/reviews/rev_1/reply \
-X POST \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"body":"Thanks for the review."}'
Response
200 with the review in data, including the saved reply. 404 if the review is not on this shop.
GET/feedback
No body. Returns the shop's reviews.
Response
{ "data": [{ "id": "rev_1", "score": 5, "message": "Works." }] }
Subscriptions
POST/subscriptions
| Field | Meaning |
|---|---|
| customer_email | Buyer email. email is accepted too. |
| product_id | Product id. Must belong to the shop. |
| invoice_id | Optional invoice id. |
| interval | Default month. |
| status | Default ACTIVE. |
Request
curl https://stakk.cc/api/dev/v1/subscriptions \
-X POST \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"customer_email":"buyer@example.com","product_id":"demo_pro-license","interval":"month"}'
Response
{ "data": { "id": "sub_1", "status": "ACTIVE" } }
POST/subscriptions/:id/cancel
| Parameter | Meaning |
|---|---|
| id | Path. Subscription id. |
Response
{ "data": { "status": "CANCELED" } }
Licenses
POST/licenses
| Field | Meaning |
|---|---|
| key | License key. One is generated if you omit it. |
| product_id | Optional product id. |
| Buyer email. | |
| hwid | Hardware id to bind. |
| max_uses | Use limit. |
| expires_at | Expiry time. |
Request
curl https://stakk.cc/api/dev/v1/licenses \
-X POST \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"product_id":"demo_pro-license","email":"buyer@example.com"}'
Response
{ "data": { "id": "lic_1", "key": "KEY-AB12CD" } }
POST/licenses/validate
| Field | Meaning |
|---|---|
| key | Required. The license key. |
| hwid | Optional. Bound on the first check. A different id is rejected. |
Request
curl https://stakk.cc/api/dev/v1/licenses/validate \
-X POST \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"key":"KEY-AB12CD","hwid":"device-1"}'
Response
{ "data": { "valid": true, "status": "active" } }
Payments
POST/checkout/{shopId}/sessions
No API key. Opens a hosted checkout for catalog products and returns its URL. Prices, currency, stock, and discounts come from the shop. Do not send amount, value, currency, or unit_price.
| Field | Meaning |
|---|---|
| shopId | Path. Shop id or slug. |
| items | One to twenty lines of { "product_id", "quantity", "variant_id" }. quantity defaults to 1. variant_id is optional. |
| product_ids | Older form. One to twenty ids that share one quantity. Use items for different quantities. |
| quantity | With product_ids only. Default 1. |
| customer_email | Required. |
| success_url | Required. http or https URL after payment. |
| cancel_url | Required. http or https URL if the buyer leaves. |
| coupon | Optional coupon code. Applied as if the buyer typed it. |
| reference | Optional. Your id for this order. client_reference_id is accepted too. |
| metadata | Optional. Up to 20 keys with string, number, or boolean values. Stored as strings. |
Quantity limits are each product's own minimum and maximum (up to 999,999), then its stock. A quantity outside them is 400 INVALID_QUANTITY. Volume discounts set on a product apply on their own. Their tiers are in the public catalog.
Sending the same reference again with the same cart returns the open order instead of a new one. A different cart is 409 REFERENCE_CONFLICT. A paid one is 409 REFERENCE_USED. A cancelled or expired one does not block the reference. A variant_id that does not exist or cannot be bought is 400 INVALID_VARIANT.
Coupon error (400) | Meaning |
|---|---|
COUPON_NOT_FOUND | No coupon with that code. |
COUPON_INACTIVE | The merchant turned it off. |
COUPON_NOT_STARTED / COUPON_EXPIRED | Before valid_from / after expire_at. |
COUPON_MAX_USES_REACHED | max_uses is used up. |
COUPON_CUSTOMER_LIMIT | This email used it max_uses_per_customer times. |
COUPON_NOT_FOR_CUSTOMER | The email is not in allowed_emails. |
COUPON_FIRST_ORDER_ONLY | The email already has a paid order. |
COUPON_PRODUCT | None of the cart's products are covered. |
COUPON_MIN_ORDER / COUPON_MIN_QUANTITY | Below the minimum spend / item count. |
Request
curl https://stakk.cc/checkout/sable/sessions \
-X POST \
-H "Content-Type: application/json" \
-H "Idempotency-Key: cart_7f2a" \
-d '{
"items": [{ "product_id": "gb_resi", "quantity": 250 }, { "product_id": "ip_dc", "quantity": 5 }],
"coupon": "LUMA10",
"reference": "user_42_order_7",
"metadata": { "user_id": "42" },
"customer_email": "buyer@example.com",
"success_url": "https://example.com/thanks",
"cancel_url": "https://example.com/cancel"
}'
Response
{
"id": "inv_1",
"url": "https://stakk.cc/checkout/invoice/inv_1",
"client_reference_id": "user_42_order_7",
"metadata": { "user_id": "42" },
"currency": "USD",
"total": "567.00"
}
GET/checkout/{shopId}/methods
No API key. Lists the methods this shop has turned on. Use provider as gateway on the payment call below.
| type | Meaning |
|---|---|
card | Card form. The payment call returns client_secret. |
wallet | Apple Pay, Google Pay, and similar. |
redirect | The buyer pays on the provider's page. The payment call returns redirect_url. |
crypto | The payment call returns an address and a coin amount. |
p2p | Peer-to-peer apps such as Cash App. |
manual | Bank transfer or another method the merchant confirms. Show instructions from the payment call. |
crypto.coins lists every coin a buyer can pay with right now, one row per coin and network. To let the buyer pick, show these and send the chosen row's gateway and crypto_gateway on the payment call. It is empty when the shop takes no crypto.
Response
{
"payment_methods": [{ "provider": "STRIPE", "type": "card", "name": "Card" }, { "provider": "MANUAL_BANK", "type": "manual", "name": "Bank transfer" }],
"crypto": {
"coins": [
{ "id": "BITCOIN", "name": "Bitcoin", "network": null, "gateway": "BTC", "crypto_gateway": "BTC" },
{ "id": "USDT_TRC20", "name": "Tether", "network": "Tron", "gateway": "NOWPAYMENTS", "crypto_gateway": "USDT_TRC20" }
]
}
}
POST/checkout/{shopId}/payments
Requires Authorization: Bearer with an API key whose shop matches shopId. There is no hosted page. You don't need any products: send name, amount and gateway, like a Stripe payment. Or send product_id / product_ids and gateway. The body is the processor payload for your UI. Do not send card numbers.
| Field | Meaning |
|---|---|
| gateway | Required. A provider from the methods list, or a coin row's gateway. |
| crypto_gateway | For crypto: the coin row's crypto_gateway. |
| name | What the buyer pays for, shown on the order. title and description are accepted too. |
| amount | Custom charge. Omit when you send products. |
| currency | Three-letter code. Defaults to the shop currency. |
| line_items | Custom charge only. Up to 50 display lines of { "title", "quantity", "unit_price" }. They show on the order. amount can be left out, and if sent it has to equal their sum. |
| items | Catalog products, the same as on sessions. product_id / product_ids with quantity work too. |
| customer_email | Required. Buyer email. No checkout is created without one. |
| reference | Your id for this payment. client_reference_id is accepted too and has to match. |
| metadata | Up to 20 keys. Returned on the order and in webhooks. |
Send an Idempotency-Key header so a retried request cannot charge twice.
Request
curl https://stakk.cc/checkout/sable/payments \
-X POST \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"name":"60 min consultation","amount":29,"currency":"USD","gateway":"BTC","crypto_gateway":"BTC","customer_email":"buyer@example.com"}'
Response
{
"id": "inv_1",
"amount": "29.00",
"currency": "USD",
"gateway": "BTC",
"address": "bc1q...",
"amount_crypto": "0.00041",
"coin": "BTC",
"payment_uri": "bitcoin:bc1q...?amount=0.00041",
"qr": { "format": "uri", "label": "Wallet QR", "payload": "bitcoin:bc1q...?amount=0.00041" }
}
A card gateway returns client_secret and publishable_key. A redirect gateway returns redirect_url. Crypto returns payment_uri, the wallet link with the address and the amount (bitcoin:, ethereum: with the token contract for stablecoins, tron:, solana:…), and qr, which is the same link to draw as a QR code. A custom method made from a template returns display (see Custom payment methods), with a bank QR code in display.qr when the method has one.
POST/payments
Creates a hosted checkout for a custom amount. The buyer picks the method on the page. For your own UI, use POST /checkout/{shopId}/payments above.
| Field | Meaning |
|---|---|
Required. Buyer email. customer_email is accepted too. No checkout is created without one. | |
| value | Amount. amount is accepted too. Optional when line_items is sent, and has to equal their sum if both are sent. |
| currency | Defaults to the shop currency. |
| line_items | Up to 50 display lines of { "title", "quantity", "unit_price" }. items is accepted too. They deliver nothing. |
| title | Shown on the invoice. |
| success_url | Where the buyer goes after paying. |
| cancel_url | Where the buyer goes if they leave. |
| reference | Your id. client_reference_id is accepted too. |
| metadata | Up to 20 keys. |
Request
curl https://stakk.cc/api/dev/v1/payments \
-X POST \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: topup_991" \
-d '{"email":"buyer@example.com","currency":"USD","line_items":[{"title":"Balance top-up","quantity":1,"unit_price":25},{"title":"Service fee","unit_price":0.5}],"reference":"topup_991","success_url":"https://example.com/thanks","cancel_url":"https://example.com/cancel"}'
Response
{
"data": {
"uniqid": "inv_1",
"url": "/checkout/invoice/inv_1",
"checkout_url": "https://stakk.cc/checkout/invoice/inv_1",
"total": 25.5,
"currency": "USD",
"status": "PENDING",
"reference": "topup_991",
"line_items": [
{ "title": "Balance top-up", "quantity": 1, "unit_price": "25.00" },
{ "title": "Service fee", "quantity": 1, "unit_price": "0.50" }
]
}
}
url is a path on stakk.cc and is kept for older clients. Use checkout_url. total here is a number for the same reason. The order itself uses strings.
POST/payments/:uniqid/complete
| Parameter | Meaning |
|---|---|
| uniqid | Path. Payment id. |
Needs the orders.complete scope.
Response
200 with the completed invoice in data.
A custom method is a gateway id that starts with MANUAL_. It is created in the dashboard under Settings, Payments, Methods, on the Pro plan. Business includes it. Pass that id as gateway on the payment calls above. GET /checkout/{shopId}/methods lists it once the method is enabled and its Checkout switch is on.
Every custom method is built from a template. Pick one, fill its fields, and Stakk shows the buyer the same screen in the hosted checkout and the embed: the amount, copyable rows, numbered steps, and a button when there is a link. You cannot upload your own JSON flow for a new method. Methods created from an uploaded file before templates existed keep working until you pick a template for them.
| Template | You fill in | The buyer sees |
|---|---|---|
| Bank transfer | Account holder, IBAN and/or account number, bank, BIC. Payments are confirmed by you, or automatically with a Fio API token. A payment QR code is on unless you turn it off. | Each detail with a copy button, the order's payment reference (variable symbol), and a QR code for their banking app. |
| Payment app | The app (Revolut, Wise, PayPal, Zelle, Cash App, Venmo, Monzo, or another), your username or tag, and an optional https payment link. | Your account, the note to put on the payment, and an "Open {app}" button. |
| Payment link | An https page, a button text, and an optional note. | The order reference and a button to your page. It opens in a new tab, so checkout stays open. |
| Crypto address | Coin, network, and address. | The three values with copy buttons and a warning to use that network. |
| Other (instructions) | A few lines of text. | Your text and the order reference. |
In links and texts, {amount}, {currency}, and {reference} are filled in for each order. Links must start with https://.
The bank transfer QR code fills in the account, the exact amount, and the reference, so the buyer only confirms the payment. Which code is shown depends on the account:
| Account | Code | Currencies |
|---|---|---|
Czech IBAN, or a Czech account number like 19-2000145399/0800 | QR Platba (SPAYD 1.0), with the reference as the variable symbol | Any |
| Any other IBAN | European Payments Council SEPA code (EPC, version 002), with the reference as the payment text | EUR only |
Otherwise no code is shown and the buyer copies the details. IBANs are checked when you save the method, so a typo is caught before a buyer pays to it.
The payment reference is a 10-digit number made from the order id. It never changes for an order, so you can search for it in your bank statement.
With the Fio option, Stakk reads your account at most once every 35 seconds, however many orders are waiting. Fio allows one call per token every 30 seconds, so Stakk makes one call for the whole account and checks every open order against that answer. The timing is kept on Stakk's server, so buyers keeping several checkouts open can't use up the limit. For each order Stakk adds up the transfers with the order's reference in the order's currency. Enough money completes the order. Less is shown to the buyer as "received X of Y, send the rest". More completes the order and the extra shows on the order as overpaid. The token is stored like a password and never shown again.
Each method has two switches, Checkout and Invoices, so one method can serve either place or both:
| Switch | Default | When on |
|---|---|---|
| Checkout | On | Buyers can pick the method in the hosted checkout and the embed, and GET /checkout/{shopId}/methods lists it. Off, it is hidden from buyers and left out of that list. |
| Invoices | Off | The method can be picked as the way to pay an invoice you make under Orders, Invoices. |
An invoice is paid in one of two ways, chosen in its Payment field:
| Payment | What the invoice shows |
|---|---|
| Pay online | A QR code with the Stakk mark that opens the invoice's own pay page on Stakk. The client pays there with any method that has its Checkout switch on, and the invoice is marked paid when the payment completes. |
| A custom method | What checkout shows for that template. Bank transfer: the account details and the payment QR code, with the invoice number's digits as the reference (variable symbol), for example 14 for invoice INV-0014. Crypto address: the coin, network, and address, with the address as a QR code. Payment app or payment link: the account or note, with the link as a QR code. Other: your text. |
An invoice paid to a custom method is not checked by Stakk, Fio included. Mark it paid yourself from the invoice's menu once the money arrives. Secret fields, such as the Fio API token, are never printed on an invoice.
The payment calls above return a display object for a template method, so your own UI can show the same thing:
{
"data": {
"status": "PENDING",
"uniqid": "inv_1",
"checks_payment": true,
"display": {
"template": "bank_transfer",
"title": "Send CZK 500.00",
"rows": [
{ "key": "holder", "label": "Account holder", "value": "Simon s.r.o." },
{ "key": "iban", "label": "IBAN", "value": "CZ6508000000192000145399", "mono": true },
{ "key": "reference", "label": "Payment reference", "value": "8203097538", "mono": true }
],
"steps": [
{ "title": "Scan the QR code", "body": "Scan it in your banking app. It fills in the account, the amount, and the reference." }
],
"qr": {
"format": "spayd",
"label": "QR Platba",
"payload": "SPD*1.0*ACC:CZ6508000000192000145399*AM:500.00*CC:CZK*X-VS:8203097538*RN:Simon s.r.o.*MSG:Order 8203097538"
}
}
}
}
link ({ "url", "label" }), note, and qr appear when the template has them. Render qr.payload as a QR code as it is; format is spayd or epc. message still carries the same instructions as plain text. Posting the same payment again (to run the check) returns display again, so you don't need to keep the first answer.
Blacklist
POST/blacklist
| Field | Meaning |
|---|---|
| type | What you are blocking. Default email. |
| value | Required. The email or other value. |
| reason | Optional note. |
Request
curl https://stakk.cc/api/dev/v1/blacklist \
-X POST \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type":"email","value":"blocked@example.com","reason":"Chargeback"}'
Response
{ "data": { "id": "blk_1" } }
DELETE/blacklist/:id
| Parameter | Meaning |
|---|---|
| id | Path. Blacklist row id. |
Response
204 with an empty body.
Whitelist
POST/allowlist
| Field | Meaning |
|---|---|
| type | Default email. |
| value | Required. |
Request
curl https://stakk.cc/api/dev/v1/allowlist \
-X POST \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type":"email","value":"vip@example.com"}'
Response
{ "data": { "id": "alw_1" } }
Queries
POST/tickets
| Field | Meaning |
|---|---|
| Required. | |
| subject | Required. |
| invoice_id | Optional order id. Must belong to the shop. |
Request
curl https://stakk.cc/api/dev/v1/tickets \
-X POST \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"email":"buyer@example.com","subject":"Download failed","invoice_id":"inv_1"}'
Response
{ "data": { "id": "tkt_1" } }
POST/tickets/:id/messages
| Field | Meaning |
|---|---|
| id | Path. Ticket id. |
| body | Required. The reply. message is accepted too. |
Request
curl https://stakk.cc/api/dev/v1/tickets/tkt_1/messages \
-X POST \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"body":"Sent a fresh download link."}'
Response
{ "data": { "ok": true } }
POST/tickets/:id/close
| Parameter | Meaning |
|---|---|
| id | Path. Ticket id. |
Response
{ "data": { "status": "Closed" } }
POST/tickets/:id/reopen
| Parameter | Meaning |
|---|---|
| id | Path. Ticket id. |
Response
{ "data": { "status": "Open" } }
Public catalog
No API key. Anyone can read what a storefront already shows: public products, prices, stock, quantity limits, variants, and volume discounts. Orders, customers, revenue, costs, delivery content, and private or unlisted products are never included. A storefront in maintenance mode or behind a password returns 403 SHOP_UNAVAILABLE.
GET/api/v1/catalog/{shop}
| Parameter | Meaning |
|---|---|
| shop | Path. Shop slug or shop id. |
The response has an ETag. Send it back as If-None-Match and an unchanged catalog answers 304 with no body. That is the cheapest way to watch for price or stock changes. Any origin can call it.
Request
curl https://stakk.cc/api/v1/catalog/sable
Response
{
"data": {
"shop": { "id": "shop_1", "slug": "sable", "name": "Sable", "currency": "USD", "url": "https://sable.mystakk.cc" },
"products": [
{
"id": "gb_resi",
"slug": "residential-gb",
"type": "SERVICE",
"title": "Residential GB",
"description": "",
"price": "2.50",
"currency": "USD",
"pay_what_you_want": false,
"image": null,
"stock": null,
"in_stock": true,
"orderable": true,
"quantity": { "min": 1, "max": 1000 },
"variants": [],
"volume_discounts": [{ "min_quantity": 100, "type": "percentage", "value": 10 }],
"url": "https://sable.mystakk.cc/product/gb_resi",
"created_at": "2026-10-01T09:00:00.000Z"
}
]
}
}
GET/api/v1/catalog/{shop}/products/{id}
| Parameter | Meaning |
|---|---|
| shop | Path. Shop slug or shop id. |
| id | Path. Product id or slug. |
404 PRODUCT_NOT_FOUND for a product that is private, unlisted, or gone.
stock is null when the product does not track stock. quantity.max is the most one checkout accepts, after stock. A percentage volume discount takes value percent off the line from min_quantity units. A fixed_per_unit one takes value off each unit. The highest tier reached applies. A session prices all of this for you.
GET /api/v1/storefront/{slug} is the older feed for custom storefront themes. New integrations should use the catalog.
Count visits from your own storefront
Stakk storefronts count their own visits. A site you build yourself on the catalog is not counted until it tells Stakk about each page view. Without this, Dashboard → Analytics shows your orders but no visitors, no conversion rate, and no traffic sources.
Call this from the visitor's browser, once per page, so Stakk sees the visitor's own address and browser. It needs no API key and sets no cookie.
POST/api/v1/storefront/visit
| Field | Meaning |
|---|---|
| shop | Required. Your shop slug. |
| path | The page that was opened, like /product/pro-license. Defaults to /. |
| referrer | Where the visitor came from. Send document.referrer. Pages of your own site are not counted as a source. |
| utm_source, utm_medium, utm_campaign, utm_term, utm_content | The UTM tags from the page address, when it has them. |
The answer is always 204 with no body, whether the view was counted or not. Bots and scripts are not counted. A browser can send up to 120 views a minute.
Request
const query = new URLSearchParams(location.search);
fetch("https://stakk.cc/api/v1/storefront/visit", {
method: "POST",
headers: { "Content-Type": "application/json" },
keepalive: true,
body: JSON.stringify({
shop: "sable",
path: location.pathname,
referrer: document.referrer,
utm_source: query.get("utm_source") || undefined,
utm_campaign: query.get("utm_campaign") || undefined,
}),
});
A visitor is counted once per day per shop. Stakk stores no IP address: it keeps a one-day hash of the address and browser, plus the country, region, device, browser, referrer and UTM tags of the first page they opened that day.
Webhooks
Add an endpoint in Dashboard → Developers → Webhooks and pick its events. An endpoint with no events picked, or with "*", gets every event. Stakk sends a POST with a JSON body. Creating or editing one through the API with an event that is not below is 400 VALIDATION_ERROR. events can be an array or a comma-separated string.
| Event | When |
|---|---|
order:paid | Payment confirmed, for every method including bank transfers and other manual methods. Deliver on this. |
order:refunded | The order was refunded. Refunds are always for the whole amount paid. |
product:created | A product was created or duplicated. |
product:edited | A product's details, price, stock, or visibility changed. |
product:deleted | A product was deleted. data has only id and updated_at. |
reseller:tier.advanced | A reseller moved up a tier. |
GET /webhooks/events lists exactly these. POST /webhooks/:id/test sends a sample of the event you name (default order:paid) with the same envelope (id, event, created_at, data) and "test": true, signed with that endpoint's secret.
order:paid
{
"id": "evt_9b1f0c2d4e6a8b0c1d2e3f40",
"event": "order:paid",
"created_at": 1761400800,
"data": {
"uniqid": "inv_1",
"type": "PRODUCT",
"status": "COMPLETED",
"gateway": "STRIPE",
"payment_method_type": "card",
"reference": "user_42_order_7",
"client_reference_id": "user_42_order_7",
"metadata": { "user_id": "42" },
"paid_at": "2026-11-04T10:01:12.000Z",
"total": "45.00",
"amount_paid": "45.00",
"currency": "USD",
"customer_email": "buyer@example.com",
"quantity": 20,
"line_items": [
{ "product_id": "gb_resi", "title": "Residential GB", "variant_id": null, "variant_title": null, "quantity": 20, "unit_price": "2.50" }
],
"created_at": "2026-11-04T10:00:00.000Z",
"updated_at": "2026-11-04T10:01:12.000Z"
}
}
product:edited
{
"id": "evt_1c2d3e4f5a6b7c8d9e0f1a2b",
"event": "product:edited",
"created_at": 1761400800,
"data": { "id": "gb_resi", "slug": "residential-gb", "title": "Residential GB", "type": "SERVICE", "price": "2.50", "currency": "USD", "stock": null, "visibility": "public", "updated_at": "2026-11-04T10:00:00.000Z" }
}
order:refunded has the same shape as order:paid, plus refunded_at (ISO time) and refunded_amount. Its updated_at is the refund time. Match orders on reference. payment_method_type is one of the method types above.
Verify
| Header | Value |
|---|---|
X-Stakk-Signature | t=<unix seconds>,v1=<hex> |
X-Stakk-Timestamp | The same unix seconds. |
X-Stakk-Event-Id | The body's id. |
X-Stakk-Delivery-Id | This attempt's delivery id. |
X-Stakk-Delivery-Attempt | 1 for the first send, higher for a manual retry. |
v1 is HMAC-SHA256 of {t}.{raw body} with the endpoint's signing secret, as hex. Compute it over the raw bytes before parsing JSON, compare in constant time, and reject a t more than 300 seconds from now.
import { createHmac, timingSafeEqual } from "node:crypto";
function verify(rawBody, header, secret) {
const parts = Object.fromEntries(header.split(",").map((kv) => kv.split("=")));
if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) return false;
const expected = createHmac("sha256", secret).update(`${parts.t}.${rawBody}`).digest("hex");
return expected.length === parts.v1?.length && timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}
Rotating the secret in the dashboard takes effect on the next delivery. There is no overlap window, so deploy the new secret right after rotating.
Delivery
A 2xx response within 8 seconds counts as delivered. Anything else is logged as failed. Stakk does not resend on its own. A merchant can resend from Webhook logs, and that sends the same body and the same event id. Store event ids and ignore ones you have seen.
Events are sent as they happen and can arrive out of order. Use paid_at and updated_at, or read GET /orders/:id, when order matters. If your endpoint was down, list GET /orders?status=COMPLETED to catch up.
Dynamic delivery
A product of type DYNAMIC has no stock in Stakk. After an order is paid, Stakk asks your server for the goods (license keys, accounts, download links, anything) and shows the buyer exactly what you answer, on the receipt and in the order email.
Set it up in Dashboard → Products → (product) → Delivery: pick Dynamic, enter your Dynamic Webhook URL, and generate a Signing Secret. Send test request posts a sample order to your URL and tells you what buyers would get, without creating an order. Through the API, send type: "DYNAMIC", dynamic_webhook, and dynamic_secret (16 to 200 characters) when you create or edit the product. The secret is never returned; responses have dynamic_secret_set: true instead. A variant can have its own dynamic_webhook, which wins over the product's. It is signed with the product's secret.
The request
Stakk sends one POST per order line, right after the payment is confirmed.
| Rule | Value |
|---|---|
| URL | Public https only. Private and local addresses are refused when you save. |
| Method | POST with Content-Type: application/json. |
| Timeout | 10 seconds for the whole request, connection included. Answer first, do slow work later. |
| Redirects | Not followed. A 3xx is a failed attempt. Use the final URL. |
| Response size | Up to 64 KB. A bigger body is a failed attempt. |
| Header | Value |
|---|---|
X-Stakk-Signature | t=<unix seconds>,v1=<hex>, the same scheme as webhooks. See Verify. Missing only when no secret is saved. |
X-Stakk-Timestamp | The same unix seconds. |
X-Stakk-Event | delivery.requested |
User-Agent | Stakk-Dynamic-Delivery/1.0 |
Request body
{
"id": "dlv_4f1c2b7e-3a9d-4e51-8c0b-1d2e3f4a5b6c",
"event": "delivery.requested",
"created_at": 1761400800,
"attempt": 1,
"test": false,
"data": {
"order": {
"uniqid": "inv_1",
"status": "COMPLETED",
"reference": "user_42_order_7",
"metadata": { "user_id": "42" },
"customer_email": "buyer@example.com",
"currency": "USD",
"total": "20.00",
"gateway": "STRIPE",
"paid_at": "2026-11-04T10:01:12.000Z"
},
"item": {
"line_item_id": "4f1c2b7e-3a9d-4e51-8c0b-1d2e3f4a5b6c",
"product_id": "game_key",
"product_title": "Game key",
"variant_id": null,
"variant_title": null,
"quantity": 2,
"unit_price": "10.00",
"buyer_input": null
}
}
}
| Field | Meaning |
|---|---|
| id | Stable for this order line. Every retry sends the same id. Store it and answer a repeat with the same goods instead of creating new ones. |
| attempt | 1 for the first try, then 2, 3, and so on. |
| test | true only for Send test request. Do not hand out real goods for it. |
| data.order | The paid order. reference and metadata are what you sent when you created the checkout, or null and {}. |
| data.item.quantity | Units bought on this line. items in your answer must have exactly this many entries. |
| data.item.buyer_input | What the buyer typed in the product's delivery instructions field, or null. |
Your answer
Answer 2xx with a JSON object. It needs items, text, or both. Other fields are ignored.
| Field | Type | Rule |
|---|---|---|
| items | string[] | One entry per unit, exactly data.item.quantity entries. Each up to 2,000 characters. Shown as a copyable list, like license keys. |
| text | string | Up to 10,000 characters of plain text. Shown as is. Use it for instructions, login details, or a link. |
Two keys and a note
{ "items": ["AAAA-BBBB-CCCC", "DDDD-EEEE-FFFF"], "text": "Redeem at example.com/redeem" }
Text only
{ "text": "Your account: user_7781 / temporary password 9f2kQ. Change it after the first login." }
A line counts as failed, and is retried, when your server:
- does not answer within 10 seconds, or cannot be reached;
- answers anything other than
2xx, including a redirect; - answers something that is not a JSON object, or is over 64 KB;
- sends neither
itemsnortext, sendsitemswith the wrong number of entries, or sends values of the wrong type.
Retries
| Attempt | Sent |
|---|---|
| 1 | Right after payment. |
| 2 | 1 minute after attempt 1 failed. |
| 3 | 5 minutes after attempt 2. |
| 4 | 30 minutes after attempt 3. |
| 5 | 2 hours after attempt 4. |
| 6 | 6 hours after attempt 5. |
After 6 failed attempts (about 8.5 hours), the line is marked failed and nothing more is sent. The order page shows the reason for the last failure and a Retry delivery button, which starts again at attempt 1. A product with no URL stops at once, so fix the product and retry.
The order stays paid the whole time. The buyer's receipt says the delivery is being prepared, and the order email is sent once every dynamic line has been delivered or has stopped, so it carries the goods. A refunded or cancelled order is never requested again.
Example server
import express from "express";
import { createHmac, timingSafeEqual } from "node:crypto";
const app = express();
const SECRET = process.env.STAKK_DYNAMIC_SECRET;
const issued = new Map(); // use your database
app.post("/stakk/deliver", express.raw({ type: "application/json" }), async (req, res) => {
const header = req.get("X-Stakk-Signature") || "";
const parts = Object.fromEntries(header.split(",").map((kv) => kv.split("=")));
const expected = createHmac("sha256", SECRET).update(`${parts.t}.${req.body}`).digest("hex");
const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) <= 300;
if (!fresh || expected.length !== parts.v1?.length || !timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1))) {
return res.status(401).end();
}
const event = JSON.parse(req.body);
if (event.test) return res.json({ text: "Test OK" });
if (!issued.has(event.id)) {
const keys = await takeKeys(event.data.item.product_id, event.data.item.quantity);
issued.set(event.id, keys);
}
res.json({ items: issued.get(event.id) });
});
Internal endpoints
POST /api/v1/checkout/start and the other /api/v1/checkout/* routes serve Stakk's own checkout page and embed. They change without notice. Use POST /checkout/{shopId}/sessions instead.