ocapi-shop Stores API
The stores the user owns or is a member of, and their public profile. Start here: every other endpoint takes a `store_id`.
The stores the user owns or is a member of, and their public profile. Start here: every other endpoint takes a `store_id`.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/ocapi-shop:ocapi-shop-stores-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Ocapi Stores API
version: '1'
description: 'Manage Ocapi stores from your own code: the catalog, categories, orders, images, the storefront''s
design and the store''s settings. It is the same API the Ocapi CLI, the iOS and Android apps and
the MCP server use.
Changes go live on the storefront as soon as a request succeeds. To prepare products before
shoppers see them, create them with `hidden: true` and publish them later. The storefront''s
design is the exception: changes to it go to a draft, which Publish storefront makes live.
## Authentication
The API uses OAuth 2.1 with the authorization code flow and PKCE. Discovery metadata is at
`/.well-known/oauth-authorization-server`, clients
register themselves at `/oauth/register`, and tokens come from `/oauth/token`.
Send the access token on every request:
```http
Authorization: Bearer
```
Access tokens last one hour; use the refresh token to get a new one. A token carries one or
both scopes:
- **`read`** allows `GET` requests.
- **`write`** allows everything else: creating, updating, reordering and deleting.
A request beyond the token''s scope gets `403 insufficient_scope`.
## Conventions
- **IDs** are prefixed by type: `str_` stores, `prd_` products, `cat_` categories, `ord_` orders,
`col_` collections, `pag_` pages, `lnk_` links, `dom_` domains, `usr_` users, `inv_` invitations, `whk_` webhooks.
- **Prices** are plain numbers in the store''s currency (`currency` on the store), not cents.
- **Timestamps** are ISO 8601 in UTC.
- **Lists** return `{ "data": [...], "next_page": 2 }`. Pass `page` and `per_page` (up to 100,
default 50); `next_page` is `null` on the last page.
- **Updates** with `PATCH` change only the fields you send.
## Errors
Every error has the same shape:
```json
{
"error": {
"code": "invalid",
"message": "Name can''t be blank",
"details": { "name": ["can''t be blank"] }
}
}
```
| Status | Code | Meaning |
| --- | --- | --- |
| 400 | `bad_request` | The body is malformed or a required parameter is missing |
| 401 | `unauthorized` | The token is missing, invalid or expired |
| 403 | `insufficient_scope` | The token can only read |
| 402 | `plan_limit_reached` | The change would add more than the store''s plan allows (products, images per product or shoppable videos); `details` has `limit`, `plan`, `allowed`, `used`, `upgrade_plan` and `upgrade_url`, where the owner upgrades (both left out when no plan allows more) |
| 404 | `not_found` | The resource doesn''t exist or belongs to a store you can''t reach |
| 422 | `invalid` | Validation failed; `details` maps each field to its messages, with dotted keys for nested fields (`items.0.quantity`) |
| 426 | `upgrade_required` | An Ocapi app build is too old; `details` has `min_version` and `update_url` |
| 429 | `rate_limited` | Over 300 requests in a minute for one sign-in; retry after a minute |
| 503 | `unavailable` | Uploads or image imports are temporarily unavailable |
`message` is written to be shown to people as is.
Plan limits only stop additions: a store over a limit after moving to a smaller plan keeps its
products, images and videos, and can still edit or remove them. During the free trial a store has
the Pro plan''s limits.'
servers:
- url: https://dashboard.ocapi.shop
security:
- bearer: []
tags:
- name: Stores
description: 'The stores the user owns or is a member of, and their public profile. Start here: every
other endpoint takes a `store_id`.'
paths:
/api/v1/stores:
get:
operationId: listStores
tags:
- Stores
summary: List stores
description: The stores the user owns or is a member of.
responses:
'200':
description: The user's stores
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
type: array
items:
$ref: '#/components/schemas/Store'
'401':
$ref: '#/components/responses/Unauthorized'
post:
operationId: createStore
tags:
- Stores
summary: Create a store
description: Creates the user's store, as the dashboard's onboarding does. A user has one store of their own; it is public on a 14-day free trial (active stays false until the merchant subscribes in the dashboard, and the store goes offline if the trial ends first).
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- name
- phone
- currency
properties:
name:
type: string
description: Store name shown on the storefront
slug:
type: string
description: The store's subdomain on ocapi.shop; made from the name when left out, so required when the name has no Latin letters
phone:
type: string
description: 'WhatsApp number that receives orders: + and its country code, then the number'
examples:
- '+573001234567'
currency:
type: string
description: ISO 4217 code for the store's prices
examples:
- COP
owner_name:
type: string
description: The merchant's name; the account's name when left out
description:
type: string
description: 'Onboarding: what describes the merchant best. With source, it completes onboarding, as the dashboard''s form does'
enum:
- I'm selling for the first time.
- I have a physical business and want to start selling online.
- I sell on social media and want my own virtual store.
- I already have an online store and want to move or expand to Ocapi.
- I'm just exploring.
selling:
type: array
description: 'Onboarding: what the merchant plans to sell'
items:
type: string
enum:
- Clothing / Accessories
- Books / Music / Video
- Accessories and collectibles
- Jewelry
- Art / Photography / Illustration
- Toys and games
- Beauty products
- Stationery
- Home and decor
- Food and beverages
- Gifts / Flowers
- Shoes
- Other
source:
type: string
description: 'Onboarding: how the merchant heard about Ocapi'
enum:
- Instagram
- Facebook
- TikTok
- Google
- Friends
- Other
responses:
'201':
description: The new store
content:
application/json:
schema:
$ref: '#/components/schemas/StoreDetail'
'403':
$ref: '#/components/responses/Forbidden'
'422':
$ref: '#/components/responses/Invalid'
/api/v1/stores/{store_id}:
parameters:
- $ref: '#/components/parameters/StoreId'
get:
operationId: getStore
tags:
- Stores
summary: Get a store
description: A store with its product count, the payment methods it accepts and a preview link.
responses:
'200':
description: The store
content:
application/json:
schema:
$ref: '#/components/schemas/StoreDetail'
'404':
$ref: '#/components/responses/NotFound'
patch:
operationId: updateStore
tags:
- Stores
summary: Update a store
description: Change the store's name, description, phone, logo or cover. Changes are live immediately.
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: Store name shown on the storefront
description:
type: string
description: A short description shown under the name
phone:
type: string
description: 'WhatsApp number that receives orders: its country code, then the number; the + is optional'
examples:
- '+573001234567'
logo_url:
type:
- string
- 'null'
description: HTTPS image URL from an upload or image import; null or an empty string removes the logo
cover_url:
type:
- string
- 'null'
description: HTTPS image URL from an upload or image import; null or an empty string removes the cover
responses:
'200':
description: The updated store
content:
application/json:
schema:
$ref: '#/components/schemas/StoreDetail'
'403':
$ref: '#/components/responses/Forbidden'
'422':
$ref: '#/components/responses/Invalid'
/api/v1/stores/{store_id}/duplicate:
parameters:
- $ref: '#/components/parameters/StoreId'
post:
operationId: duplicateStore
tags:
- Stores
summary: Duplicate a store
description: 'For the store''s owners: a new store with this one''s catalog (products, categories, collections, videos), design, pages, links, settings, shipping, hours, taxes, checkout questions and dine-in tables. Orders, customers, payment accounts, domains, subscriptions, the team, webhooks, API tokens and license keys are not copied; online payments are connected again in the new store. The new store opens at once (store_id) and the rest is copied in the background: follow it with Get a store duplication. It is unsubscribed: a subscribed store''s copy starts its own free trial, any other copy keeps what is left of the original''s trial. What its plan has no room for is left out (report). At most 5 duplications an hour.'
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: The new store's name; defaults to this one's name with "(copy)"
slug:
type: string
description: The new store's address (letters, numbers and hyphens); made from the name when left out
responses:
'202':
description: The new store, with the copy queued
content:
application/json:
schema:
$ref: '#/components/schemas/StoreDuplication'
'403':
$ref: '#/components/responses/OwnerOnly'
'404':
$ref: '#/components/responses/NotFound'
'422':
$ref: '#/components/responses/Invalid'
'429':
description: More than 5 duplications in an hour (rate_limited)
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/api/v1/stores/{store_id}/duplicates/{duplication_id}:
parameters:
- $ref: '#/components/parameters/StoreId'
- name: duplication_id
in: path
required: true
schema:
type: string
pattern: ^sdup_[0-9a-z]{26}$
description: The id Duplicate a store returned
get:
operationId: getStoreDuplication
tags:
- Stores
summary: Get a store duplication
description: How a copy is going. Poll it every few seconds until status is done (the new store at store_id is ready, and report counts what was copied and what the plan left out) or failed.
responses:
'200':
description: The copy
content:
application/json:
schema:
$ref: '#/components/schemas/StoreDuplication'
'403':
$ref: '#/components/responses/OwnerOnly'
'404':
$ref: '#/components/responses/NotFound'
components:
schemas:
Store:
type: object
required:
- id
- name
- slug
- description
- phone
- currency
- logo_url
- cover_url
- locale
- url
- active
- role
- created_at
properties:
id:
type: string
examples:
- str_01k70000000000000000000001
name:
type: string
slug:
type: string
description: The store's subdomain on ocapi.shop
description:
type:
- string
- 'null'
phone:
type:
- string
- 'null'
description: WhatsApp number that receives orders
currency:
type: string
description: ISO 4217 code; prices are in this currency
examples:
- COP
logo_url:
type:
- string
- 'null'
cover_url:
type:
- string
- 'null'
locale:
type: string
description: The storefront's language
examples:
- es
url:
type: string
description: The storefront
active:
type: boolean
role:
type:
- string
- 'null'
enum:
- owner
- member
- staff
- catalog
- viewer
- null
description: The user's role in the store (inviteTeamMember describes each role); the API refuses with 403 forbidden what the role doesn't allow
created_at:
type: string
format: date-time
loyalty:
$ref: '#/components/schemas/Loyalty'
Loyalty:
type: object
description: The store's points program and refer-a-friend rewards; change them with updateLoyalty.
required:
- enabled
- points_per_unit
- point_value
- minimum_redeem_points
- max_redeem_percent
- expiry_months
- referral_enabled
- referral_friend_percent
- referral_reward_points
- referral_window_days
properties:
enabled:
type: boolean
description: Whether customers earn and spend points
points_per_unit:
type: number
exclusiveMinimum: 0
description: 'Points earned per unit of the store''s currency spent, rounded down (0.001: 1 point per 1.000)'
point_value:
type: number
exclusiveMinimum: 0
description: What one point takes off at checkout, in the store's currency
minimum_redeem_points:
type: integer
minimum: 1
description: The fewest points a checkout can spend
max_redeem_percent:
type: integer
minimum: 1
maximum: 100
description: The most of the items, after discounts, points can pay
expiry_months:
type:
- integer
- 'null'
minimum: 1
maximum: 120
description: 'Months after which earned points expire; null: never'
referral_enabled:
type: boolean
description: Whether customers with an account get a share link (referral_url in getCustomerPoints)
referral_friend_percent:
type: integer
minimum: 1
maximum: 100
description: Percent off the friend's first order
referral_reward_points:
type: integer
minimum: 1
description: Points the customer who shared the link earns
referral_window_days:
type: integer
minimum: 0
maximum: 365
description: Days the friend's order must stay paid before the reward; a refund or cancellation before then voids it. Only new customers count, nobody can refer themselves (same email, account or phone), and a checkout an affiliate's link brought takes no referral discount.
StoreDuplication:
type: object
required:
- id
- source_store_id
- store_id
- status
- progress
- step
- report
- error
- created_at
- finished_at
properties:
id:
type: string
examples:
- sdup_01k70000000000000000000001
source_store_id:
type: string
description: The store copied
store_id:
type:
- string
- 'null'
description: The new store; null only if it was deleted since
status:
type: string
enum:
- queued
- running
- done
- failed
progress:
type: integer
minimum: 0
maximum: 100
description: Percent copied
step:
type:
- string
- 'null'
enum:
- settings
- pages
- categories
- products
- collections
- videos
- links
- tables
- null
description: What is being copied now
report:
type:
- object
- 'null'
description: Once done, how many of each were copied (products, categories, pages, collections, videos, links, tables) and what the new store's plan left out (products_left_out, images_left_out, videos_left_out)
additionalProperties:
type: integer
error:
type:
- string
- 'null'
description: Why it failed
created_at:
type: string
format: date-time
finished_at:
type:
- string
- 'null'
format: date-time
Error:
type: object
description: The body of every error response
required:
- error
properties:
error:
type: object
required:
- code
- message
properties:
code:
type: string
description: unauthorized, insufficient_scope, not_found, invalid, bad_request, rate_limited, unavailable, upgrade_required or plan_limit_reached
message:
type: string
description: Readable by people and models
details:
type: object
description: 'Field errors ({ field: [messages] }), min_version and update_url for upgrade_required, or for plan_limit_reached limit (products, images_per_product, videos or social_posts_per_day), plan (basic is Starter, plus is Pro), allowed, used, upgrade_plan and upgrade_url (both left out when no plan allows more)'
StoreDetail:
allOf:
- $ref: '#/components/schemas/Store'
- type: object
required:
- preview_url
- products_count
- payment_methods
- setup
properties:
preview_url:
type: string
description: A storefront link that works for 15 minutes, even unpublished
products_count:
type: integer
payment_methods:
type: array
items:
type: string
description: 'The payment methods an order can be recorded with: mercadopago, paypal, stripe, wompi or manualPayment'
setup:
type: object
description: Dashboard pages for what only the dashboard does, to share with the merchant as links. They open once the merchant signs in to the dashboard.
required:
- subscribed
- trial_ends_at
- plan_url
- editor_url
- payment_settings_url
- domains_url
- team_url
- dashboard_url
properties:
subscribed:
type: boolean
description: Whether the store has a plan; without one it goes offline when the trial ends
trial_ends_at:
type:
- string
- 'null'
format: date-time
description: When the free trial ends, while it runs
plan_url:
type: string
description: Subscribe to keep the store online, or manage billing once subscribed
editor_url:
type: string
description: The store editor, where the merchant reviews and publishes the storefront design
payment_settings_url:
type: string
description: Link payment providers (Stripe, PayPal, MercadoPago, Wompi)
domains_url:
type: string
description: Custom domains and their DNS instructions
team_url:
type: string
description: Who can manage the store
dashboard_url:
type: string
description: The store's dashboard home
responses:
OwnerOnly:
description: The token lacks the write scope, or the user isn't one of the store's owners
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Invalid:
description: Validation failed; details lists the problems by field
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
NotFound:
description: Not found, or in a store you can't reach
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Forbidden:
description: The token lacks the write scope
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Unauthorized:
description: Missing, invalid or expired token
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
parameters:
StoreId:
name: store_id
in: path
required: true
schema:
type: string
pattern: ^str_[0-9a-z]{26}$
description: The store's ID, from List stores
example: str_01k70000000000000000000001
securitySchemes:
bearer:
type: http
scheme: bearer
description: An OAuth access token. See Authentication above for how to get one.