AddSingle

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

Creates a new promotion setting. Use this method to create one additional setting for an existing loyalty promotion program when the client cannot or should not send a batch. The request requires program_id, key and value; value must be a JSON string that matches the setting model allowed for the program type and key. The method rejects protected default settings that are created by PromoProgram/Add, validates duplicate item, group, type-3 setting and condition cases, checks related item/group references, requires the promotion setting add permission and returns new_id. Business errors such as a missing body, invalid program_id, missing program, unsupported or duplicate key, invalid JSON, invalid numeric/date/reference values, denied access, disabled retail promotion tariff or persistence failures are returned as 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
  }
}