Skip to content

Create Plan

POST
/api/products/{productId}/plans
curl --request POST \
--url https://example.com/api/products/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/plans \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "productId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "merchantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "description": "example", "price": 1, "setupFee": 1, "frequency": "OneOff", "trialDays": 1, "minimumContractMonths": 1, "cancellationFee": 1, "isPublic": true }'

Creates a new plan under the given product. Each plan maps to a membership template at the payment gateway. The plan is synced to the gateway on creation.

POST /api/products/{productId}/plans
{
    "merchantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "Weekly Loaf",
    "description": "1 loaf delivered every Friday.",
    "price": 12.50,
    "frequency": "Weekly",
    "trialDays": 0
}
productId
required
string format: uuid

The parent product’s identifier.

Plan creation payload.

object
productId
string format: uuid
merchantId
required
string format: uuid
name
required
string
>= 1 characters <= 200 characters
description
string
nullable <= 1000 characters
price
required
number format: double
setupFee
number format: double
nullable
frequency
required
string
Allowed values: OneOff Daily Weekly Fortnightly Monthly Quarterly Yearly
trialDays
integer format: int32
<= 365
minimumContractMonths
integer format: int32
nullable <= 120
cancellationFee
number format: double
nullable
isPublic
boolean

Plan created successfully.

Media type application/json
object
id
string format: uuid
merchantId
string format: uuid
productId
string format: uuid
name
string
nullable
description
string
nullable
price
number format: double
setupFee
number format: double
nullable
frequency
string
Allowed values: OneOff Daily Weekly Fortnightly Monthly Quarterly Yearly
trialDays
integer format: int32
minimumContractMonths
integer format: int32
nullable
cancellationFee
number format: double
nullable
isActive
boolean
isPublic
boolean
createdAt
string format: date-time
updatedAt
string format: date-time
Example
{
"frequency": "OneOff"
}

Validation failed — check the errors object.

Media type application/json
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
key
additional properties
Example generated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}