Shop and content API
Every address a site uses for its products, checkout, orders, blog, content, forms, bookings, reviews and accounts, plus the admin routes.
The same API is available in two places:
- On the site's own address, under
/_vorjo/. For examplehttps://www.yourbrand.com/_vorjo/store/products. This is what the site itself uses. - On the API host, at
https://api.vorjo.com/v1/sites/<site>plus the route, where<site>is the site's address name (the part before.vorjo.app). CORS is open, so any front end can call it.
All bodies are JSON, all keys are camelCase, money is a number in the store currency with 2 decimals (whole numbers for zero-decimal currencies), weights are grams, and dates are ISO strings. Errors come back as { "error": "…" } with a 4xx status.
Store
store- Returns
- Currency, prices-include-tax, countries shipped to, pickup, payment methods, checkout fields and theme
store/products?collection=&q=&tag=&sort=&limit=&offset=&spec.Brand= - Returns
{ products, total }.sort:newest,price-asc,price-desc,title.limitup to 200. Active products only.spec.<Name>=<value>(repeatable, any case) keeps products with one of those values, e.g.spec.Brand=Daikin&spec.Brand=LG.
store/products/:handle - Returns
{ product }
store/specs?collection= - Returns
{ filters: [{ name, values: [{ value, count }] }] }: the specification names and values the active products use, for shop filters
store/collections - Returns
{ collections }
store/quote - Body
{ items: [{ variantId, qty }], address?, shipping?, discountCode? }- Returns
- Lines, subtotal, saleTotal, discount, shipping, tax, total, shipping options and any problems. Each line has
price(after any sale),originalPrice,salePrice,saleIdandsaleName. Prices sent by the page are ignored.
store/checkout - Body
- Quote body plus
{ customer: { name, email, phone }, address, note, payment, returnTo, cancelTo? } - Returns
{ order: { number, ref } }, plus aredirectfor redirect payments
store/orders/lookup - Body
{ number, email }- Returns
{ ref }
payment is "card", "manual" (cash on delivery) or "gear:<id>" for a payment Gear such as gear:paypal.
Digital products: quote lines of a download have digital: true, and a cart of downloads only has needsShipping: false (no address or shipping needed at checkout). Once an order is paid, GET store/orders/:ref adds downloads: [{ lineId, title, licenceKey, expiresAt, expired, files: [{ name, size, url, left }] }]; before that it has downloadsPending: true. Each url is a signed link that expires and counts downloads; the files themselves never appear in the API or in webhooks (order lines carry digital: true).
curl "https://api.vorjo.com/v1/sites/linen-and-loom/store/products?limit=2&sort=newest"const r = await fetch("https://api.vorjo.com/v1/sites/linen-and-loom/store/products?limit=2&sort=newest");
const { products, total } = await r.json();{
"products": [
{ "id": "p_3k9", "handle": "linen-shirt", "title": "Linen shirt", "priceMin": 48, "priceMax": 52, "image": "/_vorjo/files/shirt.jpg", "inventoryTotal": 31 },
{ "id": "p_7b2", "handle": "canvas-tote", "title": "Canvas tote", "priceMin": 24, "priceMax": 24, "image": "/_vorjo/files/tote.jpg", "inventoryTotal": null }
],
"total": 24
}Shapes
Product = {
id, handle, title, description /* markdown */, status: "active", type, vendor, tags: string[],
images: string[], options: { name, values: string[] }[], variants: Variant[],
specs: { name, value, group? }[] /* specifications, info only, in the owner's order: [{ name: "Brand", value: "Daikin" }, { name: "BTU", value: "12,000", group: "Cooling" }] */,
collectionIds: string[], seo: { title, description }, taxable, requiresShipping,
digital: boolean /* a download: never shipped; show "Instant download" (<DigitalBadge />). Files are never in the API */,
// list views also get priceMin, priceMax, inventoryTotal, image
}
Variant = {
id, title /* "M / Black" or "Default" */, options: { [name]: string }, sku, barcode,
price, compareAtPrice: number | null, weight, trackInventory, inventory, allowBackorder, image, position,
// automatic sales (public routes only): price is what it sells for now
originalPrice /* the saved price */, salePrice: number | null, sale: SaleBadge | null,
}
SaleBadge = { id, name, endsAt: string | null, countdown: boolean /* show a timer */, stacks: boolean /* codes apply on top */ }
// a product also gets originalPriceMin, originalPriceMax and sale (the variant's sale that saves the most); priceMin and
// priceMax are today's prices. While a sale is on, compareAtPrice is at least the original price.
Collection = { id, handle, title, description, image, productIds: string[], position }
// Options and variants are the choices a customer makes that change the price or stock; specs never do.
Address = { name, line1, line2, city, region, postcode, country /* ISO-2, e.g. "US" */, phone }Several currencies
A shop may offer more currencies than its store currency (Settings › More currencies). Send X-Vorjo-Fx: 1 (or ?currency=EUR) when your page shows prices in the currency the answer names; without it every price stays in the store currency. With it, GET /store names the shopper's currency plus shopCurrency, currencies (the picker's list) and chargedIn (which currency each way to pay charges); products, quotes and checkouts come in the shopper's currency (their pick in the vj_cur cookie, else their country). A quote also has shop: { currency, total, rate }: the same total in the store currency, which cash on delivery and other pay-later methods charge. In the admin API and webhooks an order's amounts stay in the store currency; an order placed in another currency also has presentment: { currency, rate, charged, subtotal, discountTotal, shippingTotal, taxTotal, total, refunded }.
Hosted pages
Vorjo runs these on every shop's own address. Link to them; don't rebuild them.
| Path | What |
|---|---|
/cart, /checkout | Cart and checkout. Checkout reads the cart from the browser, or ?items=<variantId>:<qty>,… from other front ends. |
/_vorjo/order/<ref> | Thank-you and order status page |
/track | Look up an order by number and email |
/account, /login, /signup, /forgot-password | Customer accounts |
/search, /policies/<key> | Search and policy pages |
/_vorjo/kit/kit.js | The script behind them. It adds window.Vorjo (openCart(), add(item), checkout()); any element with data-vorjo-cart opens the cart |
Blog
blog/posts?tag=&category=&limit=&offset= - Returns
{ posts, total, tags, categories }(published posts, no body)
blog/posts/:slug - Returns
{ post }
blog/categories - Returns
{ categories: [{ slug, name, count }] }
Post = { id, slug, title, excerpt, body /* markdown */, cover, tags, author,
category: { slug, name } | null, publishedAt, seo: { title, description } }Content, forms and bookings
content/:collection - Returns
{ items }: the site's content collection, like a menu or team list
forms/:name - Body
- Any fields (up to 40). Keys starting
_are dropped, except_page. - Returns
{ ok: true }
bookings- Returns
{ services, timezone, days }
bookings/slots?service=&date=YYYY-MM-DD - Returns
{ service, date, slots: [{ start, time }] }
bookings/days?service=&from=YYYY-MM-DD&to=YYYY-MM-DD&staff= - Returns
{ service, timezone, from, to, days: { "YYYY-MM-DD": [{ start, time }] } }: free times for up to 42 days in one call; only open days are listed, a full day is[]
bookings- Body
{ service, start, name, email, phone, note }- Returns
{ ok, booking }, or 409 if the slot was just taken
Reviews and search
reviews?product=&limit=&offset= - Returns
- Published reviews
reviews/summary?products=id1,id2 - Returns
- Average and count per product
reviews- Body
{ product, rating /* 1-5 */, title, body, name, email }- Returns
{ ok, published, verified }
search?q=&limit= - Returns
- Pages, products and posts that match
Customer accounts
Account calls use an HttpOnly cookie on the shop's own host and refuse requests from other origins. They work on the site's own address only (under /_vorjo/account/…), not on the API host. Accounts are on unless the owner turns them off in Settings › Checkout.
/_vorjo/account/me - Returns
{ customer: { name, email, phone, address, marketing } | null }
/_vorjo/account/register - Body
{ name, email, password /* 8+ */, marketing? }- Returns
- Creates the account and signs in
/_vorjo/account/login - Body
{ email, password }- Returns
- Signs in
/_vorjo/account/logout - Returns
- Signs out
/_vorjo/account/me - Body
{ name?, phone?, address?, marketing? }- Returns
{ customer }
/_vorjo/account/orders - Returns
- Every order placed with the account's email
/_vorjo/account/password - Body
{ current, password }- Returns
- Changes the password and signs out other devices
/_vorjo/account/reset/start - Body
{ email }- Returns
- Emails a 6-digit code
/_vorjo/account/reset/finish - Body
{ email, code, password }- Returns
- Sets a new password
/_vorjo/account/delete - Body
{ password }- Returns
- Closes the account (orders stay with the shop)
The admin API
The admin panel uses a separate, signed-in API under /api/p/:projectId/manage/…, with a permission per staff member: catalog routes need products, orders, customers and stats need orders, store settings need settings, and the blog needs blog. It isn't open to third parties. Hosted Gears reach the same routes at https://api.vorjo.com/v1/admin/… with an access token, limited to the permissions the owner accepted: see Build a Gear (hosted apps).
Products and inventory
store/products?q=&status=&collection= - Returns
{ products: Product[] }with the list extras
store/products - Body
Product(no ids needed; variants without an id are new)- Returns
{ product }
store/products/:id - Returns
{ product }
store/products/:id - Body
- The full
Product(variants with an id are updated, missing ones removed, no id = new) - Returns
{ product }
store/products/:id - Returns
{ ok }
store/products/:id/duplicate - Returns
{ product }
store/products/bulk - Body
{ ids, status?, delete? }- Returns
{ ok }
store/inventory?q=&low=1 - Returns
{ items: [{ variantId, productId, productTitle, variantTitle, sku, image, inventory, trackInventory, allowBackorder }] }
store/inventory/:variantId - Body
{ set?: number, delta?: number, reason?: string }- Returns
{ inventory }
store/inventory/:variantId/history - Returns
{ events: [{ at, delta, after, reason, by }] }
store/collections / POST / PUT :id / DELETE :id- Body
Collection- Returns
{ collections }/{ collection }
digital/products/:id - Returns
{ files: [{ id, name, size, type }], keys: { available, used }, settings, maxFile }
digital/products/:id/files?name=<file name> - Body
- The file itself (raw body)
- Returns
{ file }(private; up to the plan's size: Free 50 MB, Starter 500 MB, Pro 2 GB)
digital/products/:id/files/:fileId - Returns
{ ok }
Orders and customers
store/orders?status=open|cancelled|archived|all&payment=&fulfillment=&q= - Returns
{ orders: Order[] }(without events)
store/orders/:id - Returns
{ order }
store/orders/:id - Body
{ note?, tags?, archived? }- Returns
{ order }
store/orders/:id/fulfill - Body
{ lines?: [{ lineId, qty }] /* empty = everything left */, carrier, trackingNumber, trackingUrl, notify }- Returns
{ order }
store/orders/:id/fulfillments/:fid/delivered - Returns
{ order }
store/orders/:id/pay - Returns
{ order }(manual payments)
store/orders/:id/refund - Body
{ amount, reason, restock: [{ lineId, qty }], notify }- Returns
{ order }(card payments are refunded through Stripe)
store/orders/:id/cancel - Body
{ restock: boolean, notify: boolean, reason }- Returns
{ order }
store/orders/:id/note - Body
{ text }- Returns
{ order }
digital/orders/:id - Returns
{ digital, paid, downloads: [{ lineId, title, licenceKey, expiresAt, expired, max, files: [{ id, name, size, used, left }] }] }
digital/orders/:id/resend - Returns
{ ok }(emails the download links again; an expired link gets a new period)
digital/orders/:id/reset - Returns
{ ok }(download count back to zero, new period)
store/customers?q= - Returns
{ customers: Customer[] }
store/customers/:email - Returns
{ customer, orders: Order[] }
Discounts, settings, stats and the blog
store/discounts / POST / PUT :id / DELETE :id- Body
Discount- Returns
{ discounts }/{ discount }
store/sales / POST / GET :id / PUT :id / DELETE :id- Body
Sale(PUT changes only the fields sent)- Returns
{ sales }/{ sale }(each withstatus:active,scheduled,endedoroff)
store/sales/preview - Body
Sale(not saved)- Returns
{ count, total, currency, examples: [{ productId, title, variantTitle, price, salePrice }] }: what the draft would change, as if it were on now
store/settings / PUT store/settings- Body
StoreSettings- Returns
{ settings }
store/checkout / PUT store/checkout- Body
{ name, logo, accent, font, radius, colors: { mode, background, surface, text, muted, border, accentText }, badges, banner, cartNote, thankYou, supportEmail, policies: [{ label, url }] }- Returns
- The look of the hosted checkout (
settingspermission). Colours are#rrggbb; anything else is dropped, and pairs that read badly are adjusted (PUT answersfixes, one line per change). GET also returnssite, the site's own colours.
store/stats?days=30 - Returns
{ series: [{ date, sales, orders }], totals: { sales, orders, aov, customers, returning, refunded }, top, lowStock, pending: { toFulfill, awaitingPayment } }
blog/posts?q=&status=&category= / POST / GET :id / PUT :id / DELETE :id- Body
Post(category: a category's slug)- Returns
{ posts }/{ post }
blog/categories / POST / PUT :slug / DELETE :slug- Body
{ name }- Returns
{ categories: [{ slug, name, count }] }(deleting one clears its posts' category)
upload?name=x.png - Body
- The raw image as the body
- Returns
{ url }
Admin shapes
The admin routes see more than the public API: drafts, costs, inventory history, and orders with their customers and timeline.
Product = { ...public fields, status: "active" | "draft" | "archived", createdAt, updatedAt,
digitalSettings: { enabled, downloadLimit /* per file, default 5 */, expiryDays /* default 7 */, keys: "off" | "list" | "auto" } | null }
// POST/PUT store/products also take digitalSettings, and digitalKeysAdd: "KEY-1\nKEY-2" (licence keys added to the product's list)
Variant = { ...public fields, cost: number | null }
Discount = {
id, code /* UPPERCASE */, type: "percent" | "fixed" | "free_shipping", value /* 10 = 10% or 10 money */,
minSubtotal: number | null, startsAt: string | null, endsAt: string | null, usageLimit: number | null, used,
oncePerCustomer: boolean, appliesTo: { kind: "all" | "collections" | "products", ids: string[] }, active: boolean,
}
Sale = {
id, name, active: boolean, type: "percent" | "fixed",
tiers: { min, max: number | null, value }[], // by the item's own price, e.g. [{ min: 5, max: 20, value: 10 }, { min: 20, max: null, value: 15 }];
// or send just value: 10 for one amount on every price
targets: { kind: "all" | "collections" | "products" | "variants", ids: string[] },
excludes: { products: string[], variants: string[], collections: string[] },
startsAt: string | null, endsAt: string | null /* the sale is over at endsAt */, priority /* breaks ties */,
stacks: boolean /* discount codes apply on top */, countdown: boolean /* show "Sale ends in" (needs endsAt) */,
gearId: string | null /* the Gear that made it */, createdBy,
}
// One sale per line: the one that saves the most (equal savings: higher priority, then the older sale). A sale price is never
// below 0 and is rounded to the currency. Saved product prices never change. A discount code skips lines whose sale has
// stacks: false. Orders keep originalPrice, salePrice and saleId on each line.
StoreSettings = {
currency: "USD", pricesIncludeTax, taxShipping, defaultTaxRate /* percent */,
taxes: { id, country /* ISO-2 */, region /* "" = whole country */, rate /* percent */, name }[],
zones: { id, name, countries: string[] /* ["*"] = everywhere else */, regions: string[] /* [] = whole country */,
rates: { id, name, price, minSubtotal, maxSubtotal, minWeight, maxWeight, freeOver, estimate /* "2-4 days" */ }[] }[],
pickup: { enabled, locations: { id, name, address, hours }[] },
manualPayment: { enabled, label /* "Cash on delivery" */, note },
requirePhone, lowStock /* alert at or below */, orderNotes,
}
Order = {
id, number /* 1001… */, status: "open" | "cancelled" | "archived",
paymentStatus: "pending" | "paid" | "partially_refunded" | "refunded",
fulfillmentStatus: "unfulfilled" | "partial" | "fulfilled" | "delivered",
payment: "card" | "manual" | "gear:<id>", currency,
lines: { id, productId, variantId, title, variantTitle, sku, image, price, qty, discount, tax, total, fulfilled, weight, digital? /* true: a download */ }[],
subtotal, discountTotal, shippingTotal, taxTotal, total, refunded, discountCode: string | null,
shippingMethod: { kind: "ship" | "pickup", name, price, estimate, rateId, locationId },
customer: { name, email, phone }, shippingAddress: Address | null, billingAddress: Address | null /* only when different */,
note /* the customer's checkout note */, internalNote /* staff only; PATCH { note } sets it */, tags: string[],
fulfillments: { id, lines: { lineId, qty }[], carrier, trackingNumber, trackingUrl, status: "shipped" | "delivered", createdAt, deliveredAt }[],
events: { at, kind: "placed" | "paid" | "fulfilled" | "delivered" | "refunded" | "cancelled" | "note" | "email" | "edited", text, by }[],
test: boolean, createdAt,
}
Customer = { email, name, phone, orders, spent, firstOrderAt, lastOrderAt, lastAddress: Address | null }
Post = { ...public fields, status: "draft" | "published" | "scheduled", publishedAt /* in the future when scheduled */, createdAt, updatedAt }