POST
/
merchant
/
discount
/
plan_apply_preview
curl --request POST \
  --url https://api.unibee.top/merchant/discount/plan_apply_preview \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "code": "<string>",
  "email": "<string>",
  "externalPlanId": "<string>",
  "isChangeToLongPlan": true,
  "isChangeToSameIntervalPlan": true,
  "isUpgrade": true,
  "planId": 123
}'
{
  "code": 123,
  "data": {
    "discountAmount": 123,
    "discountCode": {
      "advance": true,
      "billingType": 123,
      "code": "<string>",
      "createTime": 123,
      "currency": "<string>",
      "cycleLimit": 123,
      "discountAmount": 123,
      "discountPercentage": 123,
      "discountType": 123,
      "endTime": 123,
      "id": 123,
      "isDeleted": 123,
      "merchantId": 123,
      "metadata": {},
      "name": "<string>",
      "planApplyType": 123,
      "planIds": [
        123
      ],
      "quantity": 123,
      "startTime": 123,
      "status": 123,
      "upgradeLongerOnly": true,
      "upgradeOnly": true,
      "userLimit": 123,
      "userScope": 123
    },
    "failureReason": "<string>",
    "valid": true
  },
  "message": "<string>",
  "redirect": "<string>",
  "requestId": "<string>"
}

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
required

The discount's unique code, customize by merchant

email
string

Email

externalPlanId
string

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

isChangeToLongPlan
boolean

IsChangeToLongPlan

isChangeToSameIntervalPlan
boolean

IsChangeToSameIntervalPlan

isUpgrade
boolean

IsUpgrade

planId
integer

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

Response

200 - application/json
code
integer
data
object
message
string
redirect
string
requestId
string