Documentation menu

Commerce

Define products and their delivery behavior.

Products group pricing, buyer limits, payout destinations, and post-payment delivery into a reusable hosted-selling unit.

Routes

GET/productsPro or Business
List workspace products.
POST/productsPro or Business
Create a product and its default payment link.
GET/products/:id
PATCH/products/:id
DELETE/products/:id
Archives the product rather than removing order history.

Create

json
{
  "name": "Payment Integration Workshop",
  "description": "Live workshop and implementation notes",
  "imageUrl": "https://example.com/workshop.jpg",
  "price": 850,
  "payoutAccountIds": ["payout_id"],
  "acceptedProviders": ["telebirr", "cbe"],
  "maxBuyers": null,
  "successMessage": "Your seat is confirmed.",
  "deliveryUrl": "https://example.com/workshop/access"
}

Use maxBuyers: null for unlimited buyers. Product ownership and every related query are scoped to the API key’s workspace.

typescript
import { veritas } from "@/lib/veritas";

const created = await veritas<{ product: { id: string } }>("/products", {
  method: "POST",
  body: JSON.stringify({
    name: "Payment Integration Workshop",
    description: "Live workshop and implementation notes",
    imageUrl: "https://example.com/workshop.jpg",
    price: 850,
    payoutAccountIds: ["payout_id"],
    acceptedProviders: ["telebirr", "cbe"],
    maxBuyers: null,
    successMessage: "Your seat is confirmed.",
    deliveryUrl: "https://example.com/workshop/access",
  }),
});

const productId = created.product.id;

const list = await veritas("/products?status=all");
const product = await veritas(`/products/${productId}`);
const orders = await veritas(`/products/${productId}/orders`);

await veritas(`/products/${productId}`, {
  method: "PATCH",
  body: JSON.stringify({ price: 950, maxBuyers: 150 }),
});

await veritas(`/products/${productId}`, { method: "DELETE" });

Product orders

GET/products/:id/ordersPro or Business
FieldPurpose
activeControls whether the product can continue selling.
maxBuyersMaximum successful buyers; null means unlimited.
payoutAccountIdsActive workspace destinations selected for accepted providers.
deliveryUrlOptional buyer destination returned after successful checkout.