Add

[POST] .../v1/retailcardmigration/tasks/add

Creates a retail card migration task. Create the task header for a loyalty card migration workflow before adding settings and additional conditions. The request requires promo_from_id and promo_to_id, requires them to be different and accepts start_date, end_date, run_period_type, run_period and order; missing start_date uses the current date, missing end_date creates an open-ended task and missing run_period or order defaults to 1. The method checks the current request user and requires retail card migration add permission; missing body, missing promo IDs, identical programs, missing or incompatible promo programs, permission failures and storage errors are returned as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
end_date Int64 Optional Task end date. If the value is 0, the task has no end date.
order Int32 Optional Execution order.
promo_from_id Int64 Required Source loyalty program ID.
promo_to_id Int64 Required Target loyalty program ID.
run_period Int64 Optional Task execution period value.
run_period_type String Optional Task execution period type. Allowed values: Default, Day, Week, Month, Quarter, Year.
start_date Int64 Optional Task start date as Unix time.

Request Example

{
  "end_date": 1,
  "order": 1,
  "promo_from_id": 1,
  "promo_to_id": 1,
  "run_period": 1,
  "run_period_type": "Day",
  "start_date": 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
  }
}