Create a new one-time purchase product with multi-currency pricing.
POST /v1/actions/onetime-product/create-product
Authentication: API Key
Request Body
| Field | Type | Required | Description |
|---|
storeId | string | Yes | Store ID (Short ID format STO_xxx) |
name | string | Yes | Product name |
description | string | No | Product description (supports Markdown) |
prices | object | Yes | Multi-currency pricing map (see below) |
media | array | No | Product images/videos (see below) |
successUrl | string | No | Redirect URL after successful purchase |
metadata | object | No | Custom key-value data (max 50 keys) |
Prices are a map of ISO 4217 currency codes to price configuration objects. At least one currency is required.
{
"USD": {
"amount": 2900,
"taxIncluded": false,
"taxCategory": "saas"
},
"EUR": {
"amount": 2700,
"taxIncluded": true,
"taxCategory": "saas"
}
}
| Field | Type | Description |
|---|
amount | integer | Price in smallest currency unit (e.g., 2900 = $29.00) |
taxIncluded | boolean | Whether the amount already includes tax |
taxCategory | string | Tax category for tax calculation |
Supported taxCategory values:
| Value | Description |
|---|
digital_goods | General digital goods |
saas | Software as a Service |
software | Downloadable software |
ebook | Electronic books |
online_course | Online courses and education |
consulting | Consulting services |
professional_service | Professional services |
{
"type": "image",
"url": "https://example.com/product.png",
"alt": "Product screenshot",
"thumbnail": "https://example.com/product-thumb.png"
}
| Field | Type | Description |
|---|
type | string | image or video |
url | string | Media URL |
alt | string | Alt text for accessibility |
thumbnail | string | Thumbnail URL (optional for images, recommended for videos) |
Example Request
import { WaffoPancake, TaxCategory } from "@waffo/pancake-ts";
const client = new WaffoPancake({
merchantId: process.env.WAFFO_MERCHANT_ID!,
privateKey: process.env.WAFFO_PRIVATE_KEY!,
});
const { product } = await client.onetimeProducts.create({
storeId: "STO_2aUyqjCzEIiEcYMKj7TZtw",
name: "Premium Template Pack",
description: "50 premium design templates for your next project.",
prices: {
USD: { amount: 4900, taxIncluded: false, taxCategory: TaxCategory.DigitalGoods },
EUR: { amount: 4500, taxIncluded: true, taxCategory: TaxCategory.DigitalGoods },
},
media: [
{ type: "image", url: "https://example.com/templates-preview.png", alt: "Template preview" },
],
successUrl: "https://example.com/thank-you",
metadata: { category: "design", fileCount: "50" },
});
Success Response (200)
{
"data": {
"id": "PROD_3kF9mNpQrStUvWxYz1A2bC",
"storeId": "STO_2aUyqjCzEIiEcYMKj7TZtw",
"prodVersionId": null,
"testVersionId": "PROD_7dG4hJkLmNpQrStUvWxYz1",
"prodStatus": "inactive",
"testStatus": "active",
"createdAt": "2026-01-15T10:30:00.000Z",
"updatedAt": "2026-01-15T10:30:00.000Z",
"version": {
"id": "PROD_7dG4hJkLmNpQrStUvWxYz1",
"productId": "PROD_3kF9mNpQrStUvWxYz1A2bC",
"versionNumber": 1,
"name": "Premium Template Pack",
"description": "50 premium design templates for your next project.",
"prices": {
"USD": { "amount": 4900, "taxIncluded": false, "taxCategory": "digital_goods" },
"EUR": { "amount": 4500, "taxIncluded": true, "taxCategory": "digital_goods" }
},
"media": [
{ "type": "image", "url": "https://example.com/templates-preview.png", "alt": "Template preview" }
],
"successUrl": "https://example.com/thank-you",
"metadata": { "category": "design", "fileCount": "50" },
"createdAt": "2026-01-15T10:30:00.000Z"
}
}
}
Response Fields
| Field | Type | Description |
|---|
id | string | Product ID (PROD_xxx) |
storeId | string | Store ID (STO_xxx) |
prodVersionId | string | null | Active production version ID (PROD_xxx), null if not published |
testVersionId | string | null | Active test version ID (PROD_xxx), null if not in test |
prodStatus | string | Production status: active or inactive |
testStatus | string | Test status: active or inactive |
createdAt | string | Creation timestamp (ISO 8601) |
updatedAt | string | Last update timestamp (ISO 8601) |
version | object | The version created or active in the current environment |
Version object:
| Field | Type | Description |
|---|
id | string | Version ID (PROD_xxx) |
productId | string | Parent product ID (PROD_xxx) |
versionNumber | integer | Sequential version number (starts at 1) |
name | string | Product name at this version |
description | string | null | Product description at this version |
prices | object | Multi-currency pricing map |
media | array | Media items at this version |
successUrl | string | null | Success redirect URL at this version |
metadata | object | null | Custom metadata at this version |
createdAt | string | Version creation timestamp (ISO 8601) |
When created in the test environment (default), testStatus is active and prodStatus is inactive. When created in the production environment, the values are reversed.
Error Responses
| Status | Error | Description |
|---|
| 400 | Missing required field: storeId | storeId not provided |
| 400 | Missing required field: name | name not provided |
| 400 | Prices must not be empty | prices is missing or an empty object |
| 404 | Store not found | Store does not exist or is not accessible |