Skip to main content
API Reference/Products

Products API

Create, retrieve, update, and delete products in your Sellvy store programmatically. All endpoints require authentication.

GET/v1/products

List products

Returns a paginated list of all products in your store.

Query parameters

ParameterTypeDescription
pageintegerPage number (default: 1)
limitintegerItems per page, max 100 (default: 25)
typestringFilter by type: download, serial, service, subscription
visibilitystringFilter: 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/:id

Get 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/products

Create a product

Create a new product in your store.

Request body

FieldTypeRequiredDescription
titlestringYesProduct name
pricenumberYesPrice in USD
typestringYesdownload, serial, service, or subscription
descriptionstringNoHTML description
visibilitystringNopublic (default), hidden, or private
category_idstringNoCategory 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/:id

Update 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/:id

Delete 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 success
Was this page helpful?