Skip to main content

Create Subscription Product

Create a subscription product with a billing period and multi-currency pricing.
POST /v1/actions/subscription-product/create-product
Authentication: API Key

Request Body

FieldTypeRequiredDescription
storeIdstringYesUUID of the store
namestringYesProduct name
billingPeriodstringYesweekly, monthly, quarterly, or yearly
pricesobjectYesMulti-currency pricing (see Price Format)
descriptionstringNoProduct description
mediaarrayNoProduct images/videos
successUrlstringNoRedirect URL after subscription
metadataobjectNoCustom key-value data

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: "store-uuid",
  name: "Pro Plan",
  billingPeriod: BillingPeriod.Monthly,
  prices: {
    USD: { amount: 2900, taxIncluded: false, taxCategory: TaxCategory.SaaS },
    EUR: { amount: 2700, taxIncluded: false, taxCategory: TaxCategory.SaaS },
  },
});

Success Response

{
  "data": {
    "id": "product-uuid",
    "storeId": "store-uuid",
    "prodVersionId": null,
    "testVersionId": "version-uuid",
    "prodStatus": "inactive",
    "testStatus": "active",
    "createdAt": "2026-01-15T10:30:00.000Z",
    "updatedAt": "2026-01-15T10:30:00.000Z",
    "version": {
      "id": "version-uuid",
      "productId": "product-uuid",
      "versionNumber": 1,
      "name": "Pro Plan",
      "description": null,
      "prices": {
        "USD": { "amount": 2900, "taxIncluded": false, "taxCategory": "saas" },
        "EUR": { "amount": 2700, "taxIncluded": false, "taxCategory": "saas" }
      },
      "media": [],
      "successUrl": null,
      "metadata": null,
      "createdAt": "2026-01-15T10:30:00.000Z"
    }
  }
}

Billing Periods

PeriodFrequency
weeklyEvery 7 days
monthlyEvery calendar month
quarterlyEvery 3 months
yearlyEvery 12 months

Update Subscription Product

Update a subscription product’s content. Creates a new immutable version if content has changed.
POST /v1/actions/subscription-product/update-product
Authentication: API Key

Request Body

FieldTypeRequiredDescription
idstringYesProduct UUID
namestringYesUpdated product name
billingPeriodstringYesweekly, monthly, quarterly, or yearly
pricesobjectYesUpdated multi-currency pricing
descriptionstringNoUpdated description
mediaarrayNoUpdated media
successUrlstringNoUpdated redirect URL
metadataobjectNoUpdated metadata

Update Status

Activate or deactivate a subscription product.
POST /v1/actions/subscription-product/update-status
Authentication: API Key

Request Body

FieldTypeRequiredDescription
idstringYesProduct UUID
statusstringYesactive or inactive
Deactivating a subscription product prevents new signups but does not cancel existing active subscriptions.

Publish Product

Publish a subscription product from test to production environment. This is a one-way operation.
POST /v1/actions/subscription-product/publish-product
Authentication: API Key

Request Body

FieldTypeRequiredDescription
idstringYesProduct UUID
Publishing copies the current test version to production. This action is only available for the first publish. Subsequent version updates in test require re-publishing.

Subscription Product Groups

Product groups organize related subscription products (e.g., Free, Pro, Enterprise plans) and enable shared trial management.

Create Group

POST /v1/actions/subscription-product-group/create-group
Authentication: API Key

Request Body

FieldTypeRequiredDescription
storeIdstringYesUUID of the store
namestringYesGroup name (e.g., “Pricing Plans”)
descriptionstringNoGroup description
rulesobjectNoGroup rules (see below)
productIdsarrayNoArray of subscription product UUIDs to include

Rules

FieldTypeDefaultDescription
sharedTrialbooleanfalseWhen true, trial usage is shared across all products in the group

Example Request

const { group } = await client.subscriptionProductGroups.create({
  storeId: "store-uuid",
  name: "Pricing Plans",
  description: "Free, Pro, and Enterprise tiers",
  rules: { sharedTrial: true },
  productIds: ["product-uuid-1", "product-uuid-2", "product-uuid-3"],
});

Success Response

{
  "data": {
    "group": {
      "id": "group-uuid",
      "storeId": "store-uuid",
      "name": "Pricing Plans",
      "description": "Free, Pro, and Enterprise tiers",
      "rules": { "sharedTrial": true },
      "productIds": ["product-uuid-1", "product-uuid-2", "product-uuid-3"],
      "environment": "test",
      "createdAt": "2026-01-15T10:30:00.000Z",
      "updatedAt": "2026-01-15T10:30:00.000Z"
    }
  }
}

Update Group

POST /v1/actions/subscription-product-group/update-group
Authentication: API Key

Request Body

FieldTypeRequiredDescription
idstringYesGroup UUID
namestringNoUpdated group name
descriptionstringNoUpdated description
rulesobjectNoUpdated rules
productIdsarrayNoUpdated product list (replaces entire list)
The productIds field replaces the entire product list. To add a product, include all existing product IDs plus the new one.

Delete Group

POST /v1/actions/subscription-product-group/delete-group
Authentication: API Key

Request Body

FieldTypeRequiredDescription
idstringYesGroup UUID
This is a permanent deletion (not soft delete). The products within the group are not deleted — only the grouping is removed.

Publish Group

POST /v1/actions/subscription-product-group/publish-group
Authentication: API Key

Request Body

FieldTypeRequiredDescription
idstringYesGroup UUID
Unlike product publishing, group publishing supports repeated UPSERT operations. You can re-publish a group after making changes.