Skip to main content
POST
Edit Plan

Endpoint Overview

POST https://api.unibee.dev/merchant/plan/edit Edit exist plan, amount|currency|intervalUnit|intervalCount is not editable when plan is active

Authorization

All UniBee Merchant API requests require authentication via API key.

Parameters

Parameters for this endpoint are listed below. The schema is also shown in the Try it panel.

Request body


Request examples

cURL

Sandbox


Response

Success responses return a JSON envelope with code, data, message, redirect, and requestId. code 0 indicates success.

Error handling

When code in the response body is non-zero, check message for details. Use requestId when contacting support.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Edit exist plan, amount|currency|intervalUnit|intervalCount is not editable when plan is active

planId
integer<int64>
required

Id of plan

addonIds
integer<int64>[]

Plan Ids Of Recurring Addon Type

amount
integer<*int64>

CaptureAmount of plan, not editable when plan is active

autoChargeConfig
object
autoUpgradePlanId
integer<*int64>

omit = no change; 0 clears stored value, >0 sets target plan id; independent of disableAutoCharge

cancelAtTrialEnd
integer<*int>

whether cancel at subscription first trial end,0-false | 1-true, will pass to cancelAtPeriodEnd of subscription

checkoutTemplateId
integer<*int64>

Checkout template id, used to build checkoutUrl; stored in plan additional settings

compareAtAmount
integer<*int64>

omit = no change; set to 0 to clear; >0 sets strikethrough price for regular amount (UI only)

currency
string<*string>

Currency of plan, not editable when plan is active

description
string<*string>

Description of plan

disableAutoCharge
integer<*int>

Same as create; omit = leave stored value unchanged. Responses still return 1 when amount=0 or plan is not main.

externalPlanId
string<*string>

ExternalPlanId

gasPayer
string<*string>

who pay the gas for crypto payment, merchant|user

homeUrl
string<*string>

HomeUrl,Start With: http

imageUrl
string<*string>

ImageUrl,Start With: http

internalName
string<*string>
intervalCount
integer<*int>

Number,intervalUnit of plan, not editable when plan is active

intervalUnit
string<*string>

Interval unit of plan,em: day|month|year|week, not editable when plan is active

metadata
object

Metadata,Map

metricLimits
object[][]

Plan's MetricLimit List, nil means no change, empty array means delete all, array with data means full replace

metricMeteredCharge
object[][]

Plan's MetricMeteredCharge

metricRecurringCharge
object[][]

Plan's MetricRecurringCharge

multiCurrencies
object[][]

Plan's MultiCurrencies

multiTrials
object[][]

multi-step trials for this plan; when set, the first item will override trialAmount & trialDurationTime

onetimeAddonIds
integer<int64>[]

Plan Ids Of Onetime Addon Type

planName
string<*string>

Name of plan

productDescription
string<*string>

ProductDescription of plan, Default copy description

productName
string<*string>

ProductName of plan, Default copy planName

tagIds
integer<int64>[]

Plan tag ids. Omit = no tag change; [] = clear all tags; non-empty = full replace. Binding is best-effort.

trialAmount
integer<*int64>

price of trial period, not available for addon; overridden by multiTrials[0].trialPrice when multiTrials is set

trialDemand
string<*string>

demand of trial, not available for addon, example, paymentMethod, payment method will ask for subscription trial start

trialDurationTime
integer<*int64>

duration of trial,seconds, not available for addon; overridden by multiTrials[0].trialDuration when multiTrials is set

usVATConfig
object

Response

200 - application/json
code
integer<int>
data
object
merchantId
integer<int64>
message
string<string>
redirect
string<string>
requestId
string<string>