POST
/api/products/{productId}/plans
const url = 'https://example.com/api/products/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/plans';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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
}Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” productId
required
string format: uuid
The parent product’s identifier.
Request Body
Section titled “Request Body ”Plan creation payload.
object
productId
string format: uuid
merchantId
required
string format: uuid
name
required
string
description
string
price
required
number format: double
setupFee
number format: double
frequency
required
string
trialDays
integer format: int32
minimumContractMonths
integer format: int32
cancellationFee
number format: double
isPublic
boolean
object
productId
string format: uuid
merchantId
required
string format: uuid
name
required
string
description
string
price
required
number format: double
setupFee
number format: double
frequency
required
string
trialDays
integer format: int32
minimumContractMonths
integer format: int32
cancellationFee
number format: double
isPublic
boolean
object
productId
string format: uuid
merchantId
required
string format: uuid
name
required
string
description
string
price
required
number format: double
setupFee
number format: double
frequency
required
string
trialDays
integer format: int32
minimumContractMonths
integer format: int32
cancellationFee
number format: double
isPublic
boolean
Responses
Section titled “ Responses ”Plan created successfully.
Media type application/json
object
id
string format: uuid
merchantId
string format: uuid
productId
string format: uuid
name
string
description
string
price
number format: double
setupFee
number format: double
frequency
string
trialDays
integer format: int32
minimumContractMonths
integer format: int32
cancellationFee
number format: double
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
title
string
status
integer format: int32
detail
string
instance
string
key
additional properties
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}