Documentation
Overview
Getting Started
API Reference
Examples
SDKs
JavaScript
WordPress
Guides
Products
Subscriptions
Webhooks

Products Guide

Create and manage products for one-time payments

What is a Product?

A product represents a one-time purchasable item or service in CasPay. Each product has a unique ID, name, description, and price in CSPR.

Creating a Product

const product = await caspay.products.create({ name: 'Premium Course', description: 'Full access to all course materials', price: 100000000000, // 100 CSPR in motes currency: 'CSPR', metadata: { sku: 'COURSE-001', category: 'education' } });

Prices are stored in motes (1 CSPR = 1,000,000,000 motes)

Product Properties

name

Product display name (required)

description

Detailed product description (optional)

price

Price in smallest currency unit - motes (required)

metadata

Custom key-value pairs for additional data (optional)

Managing Products

Update Product

await caspay.products.update('prod_123', { price: 150000000000, // 150 CSPR description: 'Updated description' });

Delete Product

await caspay.products.delete('prod_123');

Deleting a product is permanent and cannot be undone