Gram Shop
EN
Sign in Request access
Documentation

Everything you need to automate a Store.

Guides for operators, reference for developers, and runbooks for the parts where money moves. Start with the four-minute Store setup, then wire the API.

Documentation preview. The API example below is usable; the complete searchable guide library is being prepared for Beta access.
Launch your first Store

Create a Team, verify a bot token, add one product with finite units, and take a test payment end to end.

4 minutes
Authenticate the API

Mint a Store-scoped token with only the abilities you need, then make your first authenticated request.

6 minutes
Receive webhooks

Verify the signature, absorb duplicates idempotently, and replay a failed attempt from the dashboard.

10 minutes

API reference · v1

Create an order

Creates an order in a Store you have scope over, reserving finite inventory atomically. Send an Idempotency-Key so a retry returns the original order instead of reserving a second unit.

POST /api/v1/stores/{store}/orders
# request curl -X POST https://api.gramshop.io/v1/stores/str_9d1/orders \ -H "Authorization: Bearer gs_live_…" \ -H "Idempotency-Key: 8f14e45f-ea3c" \ -H "Content-Type: application/json" \ -d '{ "customer_telegram_id": 704112893, "items": [{ "product_id": "prd_41a", "quantity": 1 }], "currency": "VND", "payment_method": "vietqr" }'
# 201 Created { "id": "ord_7f2ac91", "state": "awaiting_payment", "total": { "amount_minor": 129000, "currency": "VND" }, "reservation": { "unit_count": 1, "expires_at": "2026-08-26T14:12:04Z" }, "payment": { "method": "vietqr", "reference": "8813", "qr_url": "https://…" } }

Parameters

FieldTypeNotes
customer_telegram_id integer, required The Customer must already exist in this Store. Customers are Store-scoped, never Team-scoped.
items[].product_id string, required Must belong to the same Store. Finite products reserve one unit per quantity.
items[].quantity integer, required Capped by available units. A shortfall fails the whole order rather than partially reserving.
currency string, required ISO 4217. Fiat amounts are integer minor units throughout the API.
payment_method enum, required vietqr · crypto · wallet · wallet_plus_gateway
voucher_code string, optional Applied before the quote is fixed. An invalid code fails the request; it is never silently ignored.
Reservation expiry is real
If the payment does not verify before expires_at, the reservation is released and the unit returns to inventory. Create a new order rather than extending an expired one.

Missing something?

Docs gaps are bugs. Tell us which page let you down.

Report a docs gap