API Reference/Products
Products API
Create, retrieve, update, and delete products in your Sellvy store programmatically. All endpoints require authentication.
GET
/v1/productsList products
Returns a paginated list of all products in your store.
Query parameters
| Parameter | Type | Description |
|---|---|---|
| page | integer | Page number (default: 1) |
| limit | integer | Items per page, max 100 (default: 25) |
| type | string | Filter by type: download, serial, service, subscription |
| visibility | string | Filter: public, hidden, or private |
const res = await fetch("https://api.sellvy.io/v1/products?page=1&limit=10", {
headers: { "Authorization": "Bearer sk_live_..." }
});
const { data, meta } = await res.json();
console.log(data); // Array of products
console.log(meta); // { page: 1, limit: 10, total: 42 }Response
json
{
"data": [
{
"id": "prod_abc123",
"title": "Premium WordPress Theme",
"slug": "premium-wordpress-theme",
"price": 29.99,
"currency": "USD",
"type": "download",
"visibility": "public",
"stock": null,
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
}
],
"meta": {
"page": 1,
"limit": 10,
"total": 42
}
}GET
/v1/products/:idGet a product
Retrieve a single product by its ID.
const res = await fetch("https://api.sellvy.io/v1/products/prod_abc123", {
headers: { "Authorization": "Bearer sk_live_..." }
});
const product = await res.json();POST
/v1/productsCreate a product
Create a new product in your store.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| title | string | Yes | Product name |
| price | number | Yes | Price in USD |
| type | string | Yes | download, serial, service, or subscription |
| description | string | No | HTML description |
| visibility | string | No | public (default), hidden, or private |
| category_id | string | No | Category UUID |
const res = await fetch("https://api.sellvy.io/v1/products", {
method: "POST",
headers: {
"Authorization": "Bearer sk_live_...",
"Content-Type": "application/json"
},
body: JSON.stringify({
title: "Premium WordPress Theme",
price: 29.99,
type: "download",
description: "<p>A beautiful, responsive theme.</p>",
visibility: "public"
})
});
const product = await res.json();
console.log(product.id); // "prod_xyz789"PATCH
/v1/products/:idUpdate a product
Update one or more fields on an existing product. Only include the fields you want to change.
const res = await fetch("https://api.sellvy.io/v1/products/prod_abc123", {
method: "PATCH",
headers: {
"Authorization": "Bearer sk_live_...",
"Content-Type": "application/json"
},
body: JSON.stringify({
price: 39.99,
title: "Premium WordPress Theme v2"
})
});
const updated = await res.json();DELETE
/v1/products/:idDelete a product
Permanently deletes a product and all associated stock. This action cannot be undone.
const res = await fetch("https://api.sellvy.io/v1/products/prod_abc123", {
method: "DELETE",
headers: { "Authorization": "Bearer sk_live_..." }
});
// Returns 204 No Content on successWas this page helpful?