Skip to main content
POST
/
merchant
/
discount
/
batch
/
template
/
edit
Edit Batch Discount Template
curl --request POST \
  --url https://api.unibee.dev/merchant/discount/batch/template/edit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "codePrefix": "<string>",
  "id": 123,
  "advance": true,
  "billingType": 123,
  "currency": "<string>",
  "cycleLimit": 123,
  "discountAmount": 123,
  "discountPercentage": 123,
  "discountType": 123,
  "endTime": 123,
  "metadata": {},
  "name": "<string>",
  "planApplyGroup": {
    "currency": [
      "<string>"
    ],
    "groupPlanIntervalSelector": [
      {
        "intervalCount": 123,
        "intervalUnit": "<string>"
      }
    ],
    "type": [
      123
    ]
  },
  "planApplyType": 123,
  "planIds": [
    123
  ],
  "quantity": 123,
  "startTime": 123,
  "subscriptionLimit": 123,
  "upgradeLongPlanOnly": true,
  "upgradeOnly": true,
  "userLimit": 123,
  "userScope": 123
}
'
{
  "code": 123,
  "data": {
    "template": {
      "advance": true,
      "billingType": 123,
      "childCodeCount": 123,
      "code": "<string>",
      "codePrefix": "<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,
      "type": 123,
      "upgradeLongerOnly": true,
      "upgradeOnly": true,
      "usedChildCodeCount": 123,
      "userLimit": 123,
      "userScope": 123
    }
  },
  "merchantId": 123,
  "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

Edit batch discount template. CodePrefix cannot be modified. Quantity can only be increased after activation.

codePrefix
string<string>
required

The code prefix, must match existing value, cannot be modified

id
integer<int64>
required

The template's Id

advance
boolean<*bool>

AdvanceConfig, enable advanced configurations

billingType
integer<int>

The billing type, 1-one-time, 2-recurring

currency
string<string>

The discount currency

cycleLimit
integer<int>

The count limitation of subscription cycle, 0-no limit

discountAmount
integer<int64>

The discount amount, available when discount_type is fixed_amount

discountPercentage
integer<int64>

The discount percentage, 100=1%

discountType
integer<int>

The discount type, 1-percentage, 2-fixed_amount

endTime
integer<*int64>

The end time, editable after activate, utc timestamp in seconds

metadata
object

Metadata, custom key-value pairs

name
string<*string>

The batch template's display name

planApplyGroup
object
planApplyType
integer<*int>

Plan apply type, 0-apply for all, 1-specified, 2-exclude, 3-by groups, 4-except groups

planIds
integer<int64>[]

Ids of plan which discount code can effect

quantity
integer<*int64>

Target number of child codes, can only increase after activation, max 10000

startTime
integer<*int64>

The start time, editable after activate, utc timestamp in seconds

subscriptionLimit
integer<int>

The limit of every subscription apply, 0-unlimited

upgradeLongPlanOnly
boolean<*bool>

AdvanceConfig, true-only for upgrade to longer plan

upgradeOnly
boolean<*bool>

AdvanceConfig, true-only for same interval upgrade

userLimit
integer<*int>

AdvanceConfig, Per customer limit, 0-unlimited

userScope
integer<*int>

AdvanceConfig, Apply user scope, 0-all, 1-new user, 2-renewals

Response

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