Edit batch discount template. CodePrefix cannot be modified. Quantity can only be increased after activation.
https://api.unibee.dev/merchant/discount/batch/template/edit
Edit batch discount template. CodePrefix cannot be modified. Quantity can only be increased after activation.
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <your_api_key> |
Content-Type | Yes | application/json (for request body) |
| Name | Type | Required | Description |
|---|---|---|---|
advance | boolean | No | AdvanceConfig, enable advanced configurations |
billingType | integer | No | The billing type, 1-one-time, 2-recurring |
codePrefix | string | Yes | The code prefix, must match existing value, cannot be modified |
currency | string | No | The discount currency |
cycleLimit | integer | No | The count limitation of subscription cycle, 0-no limit |
discountAmount | integer | No | The discount amount, available when discount_type is fixed_amount |
discountPercentage | integer | No | The discount percentage, 100=1% |
discountType | integer | No | The discount type, 1-percentage, 2-fixed_amount |
endTime | integer | No | The end time, editable after activate, utc timestamp in seconds |
id | integer | Yes | The template’s Id |
metadata | object | No | Metadata, custom key-value pairs |
name | string | No | The batch template’s display name |
planApplyGroup | string | No | |
planApplyType | integer | No | Plan apply type, 0-apply for all, 1-specified, 2-exclude, 3-by groups, 4-except groups |
planIds | array | No | Ids of plan which discount code can effect |
quantity | integer | No | Target number of child codes, can only increase after activation, max 10000 |
startTime | integer | No | The start time, editable after activate, utc timestamp in seconds |
subscriptionLimit | integer | No | The limit of every subscription apply, 0-unlimited |
upgradeLongPlanOnly | boolean | No | AdvanceConfig, true-only for upgrade to longer plan |
upgradeOnly | boolean | No | AdvanceConfig, true-only for same interval upgrade |
userLimit | integer | No | AdvanceConfig, Per customer limit, 0-unlimited |
userScope | integer | No | AdvanceConfig, Apply user scope, 0-all, 1-new user, 2-renewals |
code, data, message, redirect, and requestId. code 0 indicates success.
| Field | Type | Description |
|---|---|---|
code | integer | Response code. 0 = success |
data | object | Response payload |
data.template | object | |
message | string | Human-readable message |
requestId | string | Request ID for support |
| HTTP status | Meaning |
|---|---|
| 400 | Bad request — invalid or missing parameters. Check message in the body. |
| 401 | Unauthorized — missing or invalid API key. |
| 404 | Not found — invalid path or resource. |
| 500 | Server error — retry with backoff. |
code in the response body is non-zero, check message for details. Use requestId when contacting support.Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Edit batch discount template. CodePrefix cannot be modified. Quantity can only be increased after activation.
The code prefix, must match existing value, cannot be modified
The template's Id
AdvanceConfig, enable advanced configurations
The billing type, 1-one-time, 2-recurring
The discount currency
The count limitation of subscription cycle, 0-no limit
The discount amount, available when discount_type is fixed_amount
The discount percentage, 100=1%
The discount type, 1-percentage, 2-fixed_amount
The end time, editable after activate, utc timestamp in seconds
Metadata, custom key-value pairs
The batch template's display name
Plan apply type, 0-apply for all, 1-specified, 2-exclude, 3-by groups, 4-except groups
Ids of plan which discount code can effect
Target number of child codes, can only increase after activation, max 10000
The start time, editable after activate, utc timestamp in seconds
The limit of every subscription apply, 0-unlimited
AdvanceConfig, true-only for upgrade to longer plan
AdvanceConfig, true-only for same interval upgrade
AdvanceConfig, Per customer limit, 0-unlimited
AdvanceConfig, Apply user scope, 0-all, 1-new user, 2-renewals