AddSingle

[POST] .../v1/promoprogramsetting/addsingle

Creates a new promotion setting. Enrollment period_type is 0 (day), 1 (week), 2 (month) or 3 (year); period_value is 1–9999. Bonus expiry_date_period_type uses the same units; expiry_date_period_value is 0–32767, where 0 means no expiry. Periodic enrollment accepts a percentage greater than 0 and at most 100. Invalid enrollment periods return error 1008. Add one JSON setting to an existing promotion; use Add for a batch. Requires promotion setting add permission and returns new_id. The value must match the program type and key; protected defaults and duplicate rules are rejected. Group rules default include_children to true. Business errors return HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
key String Required Setting name.
program_id Int64 Required Promotion ID.
value String Required Setting value.

Request Example

{
  "key": "string",
  "program_id": 1,
  "value": "string"
}

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
  }
}