Skip to main content
POST /v1/actions/subscription-product/create-product
Authentication: API Key

Request Body

FieldTypeRequiredDescription
storeIdstringYesStore ID (STO_xxx format)
namestringYesProduct name
billingPeriodstringYesweekly, monthly, quarterly, or yearly
pricesobjectYesMulti-currency pricing (see Price Format)
descriptionstringNoProduct description (supports Markdown)
mediaarrayNoProduct images/videos (see Media Format)
successUrlstringNoRedirect URL after successful subscription
metadataobjectNoCustom key-value data. May include trialDays (integer, 1-365) to offer a free trial period

Example Request

import { WaffoPancake, BillingPeriod, 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.subscriptionProducts.create({
  storeId: "STO_2D5F8G3H1K4M6N9P",
  name: "Pro Plan",
  billingPeriod: BillingPeriod.Monthly,
  prices: {
    USD: { amount: 2900, taxIncluded: false, taxCategory: TaxCategory.SaaS },
    EUR: { amount: 2700, taxIncluded: false, taxCategory: TaxCategory.SaaS },
  },
  description: "Full access to all Pro features.",
  successUrl: "https://example.com/welcome",
  metadata: { trialDays: 14 },
});

Success Response

{
  "data": {
    "id": "PROD_3F7H2J5L8N1Q4S6U",
    "storeId": "STO_2D5F8G3H1K4M6N9P",
    "prodVersionId": null,
    "testVersionId": "PVER_9A2C5E8G1J4L7N0P",
    "prodStatus": "inactive",
    "testStatus": "active",
    "createdAt": "2026-03-30T10:30:00.000Z",
    "updatedAt": "2026-03-30T10:30:00.000Z",
    "version": {
      "id": "PVER_9A2C5E8G1J4L7N0P",
      "productId": "PROD_3F7H2J5L8N1Q4S6U",
      "versionNumber": 1,
      "name": "Pro Plan",
      "billingPeriod": "monthly",
      "description": "Full access to all Pro features.",
      "prices": {
        "USD": { "amount": 2900, "taxIncluded": false, "taxCategory": "saas" },
        "EUR": { "amount": 2700, "taxIncluded": false, "taxCategory": "saas" }
      },
      "media": [],
      "successUrl": "https://example.com/welcome",
      "metadata": { "trialDays": 14 },
      "createdAt": "2026-03-30T10:30:00.000Z"
    }
  }
}

Error Responses

StatusCondition
400Missing required fields (storeId, name, billingPeriod, prices)
400Invalid billingPeriod value
400trialDays is not an integer or is outside the 1-365 range
404Store not found