Dokumentacja API
Endpoint Index
Base URL: https://your-openshopy-domain/api/public/v1 (plus media at https://your-openshopy-domain/api/public/media/:storeId/:productId/:filename).
| Method | Path | Scope | Description |
|---|---|---|---|
| OPTIONS | * | — | CORS preflight, no auth |
| GET | /store | store:read | Get store settings, currencies, payment/bank info |
| GET | /products | products:read | List products (filters, sort, pagination, currency conversion) |
| GET | /products/:id | products:read | Get one product by id or slug |
| POST | /products | products:write | Create a product (+ variants/images/collections) |
| PATCH | /products/:id | products:write | Update a product |
| DELETE | /products/:id | products:write | Delete a product and its images |
| POST | /products/:id/variants | products:write | Add a variant |
| PATCH | /variants/:id | products:write | Update a variant (stock changes go through inventory adjust) |
| DELETE | /variants/:id | products:write | Delete a variant (fails if it's the last one) |
| POST | /products/:id/images | products:write | Upload an image (multipart file or JSON url) |
| PATCH | /products/:id/images/:imageId | products:write | Update image alt/position/variant link |
| POST | /products/:id/images/reorder | products:write | Reorder a product's images |
| DELETE | /products/:id/images/:imageId | products:write | Delete an image |
| GET | /collections | products:read | List collections |
| GET | /collections/:id | products:read | Get a collection by id or slug |
| POST | /collections | products:write | Create a collection |
| PATCH | /collections/:id | products:write | Update a collection |
| DELETE | /collections/:id | products:write | Delete a collection |
| POST | /inventory/adjust | inventory:write | Adjust stock by delta or set an absolute value |
| GET | /inventory/movements | products:read | List inventory movement history |
| GET | /orders | orders:read | List orders (filters, pagination) |
| GET | /orders/track | null | Public order lookup by number + email |
| GET | /orders/:id | orders:read | Get full order (items, fulfillments, timeline, returns) |
| POST | /orders | orders:write | Create an order directly |
| PATCH | /orders/:id | orders:write | Update order fields / status |
| POST | /orders/:id/confirm-payment | orders:write | Mark payment as confirmed by merchant |
| POST | /orders/:id/mark-unpaid | orders:write | Revert payment to unpaid |
| POST | /payments/:token/mark-sent | checkout | Customer self-reports bank transfer sent |
| POST | /orders/:id/cancel | orders:write | Cancel an order (optionally restock) |
| POST | /orders/:id/notes | orders:write | Add an internal note/timeline event |
| POST | /orders/:id/notifications | orders:write | Resend a notification email |
| POST | /orders/:id/fulfillments | orders:write | Create a shipment (full or partial) |
| PATCH | /fulfillments/:id | orders:write | Update a shipment's status/tracking |
| DELETE | /fulfillments/:id | orders:write | Delete a shipment, reverting fulfilled quantities |
| POST | /orders/:id/refunds | orders:write | Issue a refund |
| POST | /orders/:id/returns | orders:write | Request a return |
| PATCH | /returns/:id | orders:write | Update return status (approve/receive/refund/reject) |
| GET | /invoices | invoices:read | List invoices |
| GET | /invoices/:id | invoices:read | Get an invoice |
| POST | /orders/:id/invoices | invoices:write | Issue an invoice or proforma for an order |
| POST | /invoices/:id/corrections | invoices:write | Issue a correction to an invoice |
| POST | /invoices/:id/credit-notes | invoices:write | Issue a credit note against an invoice |
| POST | /invoices/:id/cancel | invoices:write | Cancel an invoice |
| GET | /customers | customers:read | List customers |
| GET | /customers/:id | customers:read | Get a customer + addresses |
| POST | /customers | customers:write | Create a customer |
| PATCH | /customers/:id | customers:write | Update a customer |
| DELETE | /customers/:id | customers:write | Delete a customer |
| GET | /customers/:id/orders | orders:read | List a customer's order history |
| POST | /customers/:id/addresses | customers:write | Add an address to a customer |
| DELETE | /customers/:id/addresses/:addressId | customers:write | Delete a customer's address |
| POST | /customer-auth/register | customer_accounts | Storefront customer registration / claim account |
| POST | /customer-auth/login | customer_accounts | Storefront customer login |
| POST | /customer-auth/logout | customer_accounts | Invalidate the current customer session |
| POST | /customer-auth/password-reset | customer_accounts | Request a password reset email |
| POST | /customer-auth/password-reset/confirm | customer_accounts | Confirm password reset with token |
| GET | /customer-auth/me | customer_accounts | Get the logged-in customer's profile |
| PATCH | /customer-auth/me | customer_accounts | Update profile / change password |
| POST | /customer-auth/me/addresses | customer_accounts | Add an address as the logged-in customer |
| DELETE | /customer-auth/me/addresses/:addressId | customer_accounts | Delete own address |
| GET | /customer-auth/me/orders | customer_accounts | List own order history |
| GET | /customer-auth/me/orders/:id | customer_accounts | Get one of own orders |
| POST | /carts | checkout | Create a cart |
| GET | /carts/:token | checkout | Get a cart with live price quote |
| PATCH | /carts/:token | checkout | Update cart fields |
| POST | /carts/:token/items | checkout | Add/increment a line item |
| DELETE | /carts/:token/items/:variantId | checkout | Remove a line item |
| POST | /carts/:token/checkout | checkout | Convert cart into an order |
| POST | /checkout/quote | checkout | Price a set of lines without a cart |
| GET | /shipping/rates | shipping:read | Get available shipping options |
| GET | /shipping/zones | shipping:read | List shipping zones + their rates |
| POST | /shipping/zones | shipping:write | Create a shipping zone |
| POST | /shipping/zones/:id/rates | shipping:write | Add a rate to a zone |
| GET | /pickup-locations | shipping:read | List active pickup locations |
| GET | /carriers | shipping:read | List carriers |
| GET | /taxes/rates | taxes:read | List tax rates |
| PUT | /taxes/rates | taxes:write | Upsert a tax rate |
| POST | /taxes/calculate | taxes:read | Calculate tax for an amount |
| GET | /discounts | discounts:read | List discounts |
| GET | /discounts/:id | discounts:read | Get a discount |
| POST | /discounts | discounts:write | Create a discount |
| PATCH | /discounts/:id | discounts:write | Update a discount |
| DELETE | /discounts/:id | discounts:write | Delete a discount |
| POST | /discounts/validate | checkout | Validate a discount code against a cart |
| POST | /events | analytics:write | Ingest analytics event(s) |
| GET | /analytics/summary | analytics:read | Revenue/order summary for a date range |
| GET | /abandoned-carts | orders:read | List abandoned carts |
| GET | /api/public/media/:storeId/:productId/:file | — (separate route, no API key) | Serve a stored product image |