[POST] .../v1/promoprogram/add
Creates a new loyalty program (promotion). Use this method to create a loyalty promotion program before adding program settings, stock assignments, retail card links or migration rules. The method validates name, type_id, optional external sub_type for external programs, active days from 1 to 7, start/end time and start/end date, then creates default settings for the selected program type and returns new_id. The request requires the promotion add permission and both retail promotion tariff options for using and creating loyalty programs must be enabled. Business errors such as a missing body, required field violations, unsupported type or subtype, invalid date/time window, denied access, disabled tariff option or persistence failures are returned as HTTP 200 ErrorResult.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| active | Boolean | Optional | Indicates whether the promotion is active. |
| days | Array of Int32 | Optional | Weekdays when the promotion is active. |
| description | String | Optional | Additional description. |
| end_date | String | Required | Promotion end date: yyyy:MM:dd. |
| end_time | String | Required | Promotion end time: HH:mm:ss. |
| name | String | Required | Promotion application priority. |
| priority | Int32 | Optional | Promotion application order. |
| start_date | String | Required | Promotion start date: yyyy:MM:dd. |
| start_time | String | Required | Promotion start time: HH:mm:ss. |
| sub_type | Int64 | Optional | External loyalty system type. Required only when type_id identifies an external loyalty program. |
| type_id | Int64 | Required | Promotion type ID. |
Request Example
{
"active": true,
"days": [
1
],
"description": "string",
"end_date": "string",
"end_time": "string",
"name": "string",
"priority": 1,
"start_date": "string",
"start_time": "string",
"sub_type": 1,
"type_id": 1
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Insert | Created record result. |
Response Example
{
"ok": true,
"result": {
"new_id": 1
}
}