Storefront API
Used by Tienda's own shop, no stability promise
These endpoints are the ones the public online shop of Tienda calls. They are listed so an integrator knows what exists. Their fields can change between releases, and this page does not describe the answers field by field.
The shop is not named in the path. It is chosen by the host the browser comes
from, as described in Shop fronts and domains: send
the shop's host in the Origin header or in X-Shop-Host. If no shop claims the
host, the answer is 404 with {"error": "Unknown shop"}. Module rules still
apply: a shop without the Storefront or Catalog module gets module_disabled.
Public reads need no token. If a staff token is sent, it is read but not
required. Texts come in the visitor's language: send Accept-Language.
Public reads
| Request | What it returns |
|---|---|
GET /api/v1/shop_fronts/current | The shop front: name, ordering switch and closed notice, hours (hours), contact details, social links, languages. |
GET /api/v1/shop_fronts/menu?slug= | A navigation menu. Without slug, the menu the shop front names (default main-nav). Only visible items. |
GET /api/v1/inventory/products, GET /api/v1/inventory/products/:id | Products. |
GET /api/v1/inventory/categories, GET /api/v1/inventory/categories/:id | Categories. |
POST /api/v1/inventory/stock/availability | Whether products are in stock. |
GET /api/v1/search | Search across the shop. |
GET /api/v1/cms/pages, GET /api/v1/cms/pages/:id | Pages. Ask for one with ?path=/page/about-us. |
GET /api/v1/cms/pages/:id/blocks | The blocks of a page. |
GET /api/v1/cms/heros, cms/announcements, cms/faq_lists, cms/feature_rows | Content blocks (index and show). |
GET /api/v1/cms/product_viewers/:id, .../:id/products | A product list block and its products. |
GET /api/v1/pos/delivery_time_slots, GET /api/v1/pos/pickup_time_slots | Delivery and pickup slots (index and show; ?available=true for slots that can be booked). |
GET /api/v1/events/events, GET /api/v1/events/events/:id, GET /api/v1/events/event_questions | Events and the questions on their forms. |
GET /api/v1/inventory/subscription_plans, .../:id | Subscription plans. |
GET /api/v1/events/public_tickets/:guid | A ticket by its link (needs the ticket's own identifier). |
Public writes the shop uses
| Request | What it does |
|---|---|
POST /api/v1/pos/orders | Places an order as a guest or customer. Refused with 422 webshop_closed while the shop is closed to orders. For a web order the answer carries a payment_token. |
POST /api/v1/pos/coupons/validate | Checks a coupon code. Wrong guesses by a visitor who is not signed in are limited. |
POST /api/v1/pos/gift_cards/balance | Reads a gift card's balance by code. Limited in the same way. |
GET /api/v1/payment_gateway/shop_payments/available | Which payment gateways the shop offers. |
POST /api/v1/payment_gateway/shop_payments | Starts an online payment for an order, with the payment_token. |
GET /api/v1/payment_gateway/shop_payments/:id | The state of a payment. See Payment gateways. |
GET/POST /api/v1/payment_gateway/pay_links | Pay links for an order. |
POST /api/v1/inventory/subscription_plans/:id/signup | Signs a customer up for a plan. |
POST /api/v1/events/events/:event_id/tickets | Reserves or orders tickets. |
GET /api/v1/shop/loyalty, POST /api/v1/shop/loyalty/redeem | A customer's loyalty balance, and spending points. |
GET /api/v1/subscriptions/mine and its actions | A customer's own subscriptions: pause, resume, cancel. |
The customer account
A shop customer signs in with an e-mailed code, with no password. The customer token is issued for one shop and means nothing at another shop. A staff token is refused here.
| Request | What it does |
|---|---|
POST /api/v1/storefront/account/session/request_code with {email, locale} | Sends a code. The answer is the same for a known and an unknown address. |
POST /api/v1/storefront/account/session with {email, code, name?, phone?, locale?} | Signs in, and makes the account on first use. Returns a token. |
GET, PATCH /api/v1/storefront/account | The customer's profile. |
GET /api/v1/storefront/account/orders, .../orders/:id | Their orders. |
GET, POST, PATCH, DELETE /api/v1/storefront/account/addresses | Their addresses. |
GET /api/v1/storefront/account/loyalty | Their loyalty balance. |
GET /api/v1/storefront/account/tickets, .../tickets/:guid, POST .../tickets/:guid/cancel | Their event tickets. |
The code requests are rate limited: 5 per address and 30 per IP address in ten minutes, and 10 sign-in attempts per address in ten minutes. A limited request answers with a rate limit error.
Send the customer token as Authorization: Bearer <token>. The account data is
limited to this shop and to the customer's own e-mail address.
What is not here
Registering as an API client for the shop, webhooks for shop customers, and a stable catalogue API for third parties are not available yet. For reading products from another system use the products feed.