Search Documentation

Search for a documentation page...

API Reference

The YNS REST API provides programmatic access to your store's data. All endpoints are scoped to the authenticated store and served under /api/v1/.

Base URL

All API requests are made to your store's domain:

https://your-store.yns.store/api/v1/

Authentication

Every request requires a Bearer token in the Authorization header. API keys are managed in your store's admin settings under Settings → API → API keys.

curl https://your-store.yns.store/api/v1/products \
-H "Authorization: Bearer your_api_key"

Each API key is scoped to a single store. All data returned is isolated to that store. Keys can also be scoped to specific capabilities — see API Key Scopes for the full list.

Request Format

  • Content-Type: application/json for POST, PATCH, and PUT requests
  • Query parameters for filtering and pagination on GET requests
  • Path parameters use UUID v7 identifiers or URL slugs (e.g. /products/classic-tee)

Response Format

All responses return JSON. Successful list responses use this shape:

{
"data": [
{ "id": "019...", "name": "Classic Tee", "slug": "classic-tee" }
],
"meta": {
"count": 42
}
}

Single resource responses return the object directly:

{
"id": "019...",
"name": "Classic Tee",
"slug": "classic-tee"
}

Pagination

List endpoints support offset-based pagination:

ParameterTypeDefaultDescription
limitnumber10-50Max items to return (1-100)
offsetnumber0Items to skip

Some endpoints (inventory) use cursor-based pagination with a cursor parameter instead.

Error Responses

Errors return an appropriate HTTP status code with a JSON body:

{
"error": "Invalid request data",
"details": [
{
"code": "too_small",
"minimum": 1,
"message": "Product name is required",
"path": ["name"]
}
]
}
StatusMeaning
400Validation error — invalid parameters or request body
401Unauthorized — missing or invalid API key
403Forbidden — API key is missing the required scope for this endpoint
404Not found — resource doesn't exist
409Conflict — slug or unique constraint violation
500Server error

OpenAPI Spec

The full OpenAPI 3.1 specification is available at:

GET /api/v1/openapi

This spec is auto-generated from the actual Zod schemas used in route handlers, so it's always in sync with the API.

Available Endpoints

ResourceEndpoints
StoreRead the store profile, theme, enabled modules, languages, and currencies
LocalizationServe translated content and per-currency prices
ProductsList, create, get, update, delete, batch, CSV import, variants, reviews, filters, reset catalog
VariantsGet, update, and delete product variants
BundlesList, create, get, update, and delete product bundles
CollectionsList, create, get, update, delete, and CSV membership import
CategoriesList, create, get, update, and delete, with nesting
BrandsList, create, get, update, delete, and assign products
InventoryList stock levels and adjust inventory
SearchFull-text product search
ReviewsModerate reviews, plus list and create per product
OrdersList, get, update, shipments, labels, and refunds
CartsCreate, get, delete, line items, coupons, and checkout redirect
CustomersList, get, update, addresses, and customer orders
CouponsList, create, get, update, and delete discount codes
PromotionsList, create, get, update, and delete automatic promotions
Subscription PlansRecurring plans products can attach to
LoyaltySettings, tiers, and campaigns
ShippingList, create, get, update, and delete shipping methods
AddonsConnected services, carrier connections, and InstaView images
Tax RatesList, create, get, update, and delete manual tax rates
Pickup LocationsCollection points offered at checkout
EventsList, create, get, update, attendees, check-in roster, and networking directory
TicketsBuyer ticket lookup, attendee profiles, and door check-in
PostsBlog post CRUD and per-post comments
Blog CategoriesList, create, get, update, and delete blog categories
Post CommentsModerate, approve, reject, and delete comments
SubscribersList, create, import, and delete newsletter subscribers
Availability NotificationsRegister a back-in-stock alert request
NewslettersDraft, send, and retry newsletter campaigns
Contact MessagesStorefront messages: list, read, reply, and delete
MediaUpload files, ingest remote URLs, and manage the media library
ImportsStart and track catalog import jobs
ImagesAI image generation and generation history
Brand KitGet, update, and delete the store's brand kit
SocialsGet and set social profile links
AnalyticsOverview metrics and sales reporting
SettingsStore settings and checkout consents
TeamMembers, invitations, and ownership transfer
DomainConnect, verify, and remove a custom domain
Legal PagesList, create, get, and update legal documents
Support CasesOpen, track, update, and reply to support cases
Feedback SessionsStart, comment on, cancel, and finalize feedback sessions
PublishTrigger a storefront publish and poll its status