curl --request POST \
--url https://api.unibee.dev/merchant/discount/plan_apply_preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"currency": "<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>",
"planApplyGroup": {
"currency": [
"<string>"
],
"groupPlanIntervalSelector": [
{
"intervalCount": 123,
"intervalUnit": "<string>"
}
],
"type": [
123
]
},
"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>"
}Check discount can apply to plan, Only check rules about plan,the actual usage is subject to the subscription interface
curl --request POST \
--url https://api.unibee.dev/merchant/discount/plan_apply_preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"currency": "<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>",
"planApplyGroup": {
"currency": [
"<string>"
],
"groupPlanIntervalSelector": [
{
"intervalCount": 123,
"intervalUnit": "<string>"
}
],
"type": [
123
]
},
"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>"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Check discount can apply to plan, Only check rules about plan,the actual usage is subject to the subscription interface
The discount's unique code, customize by merchant
The currency of plan which code to apply
The externalId of plan which code to apply, either planId or externalPlanId is needed
IsChangeToLongPlan
IsChangeToSameIntervalPlan
IsUpgrade
The id of plan which code to apply, either planId or externalPlanId is needed