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:
Authentication
Every request requires a Bearer token in the Authorization header. API keys are managed in your store's admin settings under Settings > API Keys.
Each API key is scoped to a single store. All data returned is isolated to that store.
Request Format
- Content-Type:
application/jsonfor 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:
Single resource responses return the object directly:
Pagination
List endpoints support offset-based pagination:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | number | 10-50 | Max items to return (1-100) |
offset | number | 0 | Items 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:
| Status | Meaning |
|---|---|
400 | Validation error — invalid parameters or request body |
401 | Unauthorized — missing or invalid API key |
404 | Not found — resource doesn't exist |
409 | Conflict — slug or unique constraint violation |
500 | Server error |
OpenAPI Spec
The full OpenAPI 3.1 specification is available at:
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
| Resource | Endpoints |
|---|---|
| Products | List, create, get, update, delete, batch import, variants, reviews |
| Orders | List, get, update status and tracking |
| Customers | List, get, update, addresses, customer orders |
| Carts | Create, get, delete, add/remove line items |
| Collections | List, create, get (manual and dynamic) |
| Categories | List, create, get, update (with nesting) |
| Inventory | List stock levels, adjust inventory |
| Variants | Get, update, delete product variants |
| Search | Full-text product search |
| Posts | Blog post CRUD |
| Subscribers | Newsletter subscriber management |
| Images | AI image generation |