Skip to main content
POST
Plan Apply Preview

Endpoint Overview

POST https://api.unibee.dev/merchant/discount/plan_apply_preview Check discount can apply to plan, Only check rules about plan,the actual usage is subject to the subscription interface

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

Check discount can apply to plan, Only check rules about plan,the actual usage is subject to the subscription interface

code
string<string>
required

The discount's unique code, customize by merchant

addonParams
object[]

Addon list with quantity, align with subscription create preview

currency
string<string>

The currency of plan which code to apply

email
string<string>

Email

externalPlanId
string<string>

The externalId of plan which code to apply, either planId or externalPlanId is needed

isChangeToLongPlan
boolean<*bool>

IsChangeToLongPlan

isChangeToSameIntervalPlan
boolean<*bool>

IsChangeToSameIntervalPlan

isUpgrade
boolean<*bool>

IsUpgrade

planId
integer<int64>

The id of plan which code to apply, either planId or externalPlanId is needed

quantity
integer<int64>

Main plan quantity, default 1; align with subscription create preview

Response

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