https://api.unibee.dev/merchant/plan/new
Create Plan
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <your_api_key> |
Content-Type | Yes | application/json (for request body) |
| Name | Type | Required | Description |
|---|---|---|---|
addonIds | array | No | Plan Ids Of Recurring Addon Type |
amount | integer | Yes | Plan Amount |
cancelAtTrialEnd | integer | No | whether cancel at subscription first trial end,0-false | 1-true, will pass to cancelAtPeriodEnd of subscription |
currency | string | Yes | Plan Currency |
description | string | No | Description |
externalPlanId | string | No | ExternalPlanId |
gasPayer | string | No | who pay the gas for crypto payment, merchant|user |
homeUrl | string | No | HomeUrl,Start With: http |
imageUrl | string | No | ImageUrl,Start With: http |
internalName | string | No | |
intervalCount | integer | No | Number Of IntervalUnit,em: day|month|year|week |
intervalUnit | string | No | Plan Interval Unit,em: day|month|year|week |
metadata | object | No | Metadata,Map |
metricLimits | array | No | Plan’s MetricLimit List |
metricMeteredCharge | array | No | Plan’s MetricMeteredCharge |
metricRecurringCharge | array | No | Plan’s MetricRecurringCharge |
multiCurrencies | array | No | Plan’s MultiCurrencies |
onetimeAddonIds | array | No | Plan Ids Of Onetime Addon Type |
planName | string | Yes | Plan Name |
productDescription | string | No | Default Copy Description |
productId | integer | No | Id of product which plan to linked |
productName | string | No | Default Copy PlanName |
trialAmount | integer | No | price of trial period, not available for addon |
trialDemand | string | No | demand of trial, not available for addon, example, paymentMethod, payment method will ask for subscription trial start |
trialDurationTime | integer | No | duration of trial, not available for addon |
type | integer | No | The type of plan, 1-main plan,2-addon plan, 3-onetime plan, default main plan |
usVATConfig | string | No |
code, data, message, redirect, and requestId. code 0 indicates success.
| Field | Type | Description |
|---|---|---|
code | integer | Response code. 0 = success |
data | object | Response payload |
data.plan | object | |
message | string | Human-readable message |
requestId | string | Request ID for support |
| HTTP status | Meaning |
|---|---|
| 400 | Bad request — invalid or missing parameters. Check message in the body. |
| 401 | Unauthorized — missing or invalid API key. |
| 404 | Not found — invalid path or resource. |
| 500 | Server error — retry with backoff. |
code in the response body is non-zero, check message for details. Use requestId when contacting support.Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Plan Amount
Plan Currency
Plan Name
Plan Ids Of Recurring Addon Type
whether cancel at subscription first trial end,0-false | 1-true, will pass to cancelAtPeriodEnd of subscription
Description
ExternalPlanId
who pay the gas for crypto payment, merchant|user
HomeUrl,Start With: http
ImageUrl,Start With: http
Number Of IntervalUnit,em: day|month|year|week
Plan Interval Unit,em: day|month|year|week
Metadata,Map
Plan's MetricLimit List
Plan's MetricMeteredCharge
Plan's MetricRecurringCharge
Plan's MultiCurrencies
Plan Ids Of Onetime Addon Type
Default Copy Description
Id of product which plan to linked
Default Copy PlanName
price of trial period, not available for addon
demand of trial, not available for addon, example, paymentMethod, payment method will ask for subscription trial start
duration of trial, not available for addon
The type of plan, 1-main plan,2-addon plan, 3-onetime plan, default main plan