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 BusinessList workspace products.
POST
/productsPro or BusinessCreate a product and its default payment link.
GET
/products/:idPATCH
/products/:idDELETE
/products/:idArchives 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| Field | Purpose |
|---|---|
| active | Controls whether the product can continue selling. |
| maxBuyers | Maximum successful buyers; null means unlimited. |
| payoutAccountIds | Active workspace destinations selected for accepted providers. |
| deliveryUrl | Optional buyer destination returned after successful checkout. |