Edit

[POST] .../v1/retailcard/edit

Edits customer card. Requires id, at least one change and card edit permission; barcode changes also require barcode edit permission. Returns row_affected. Supports fields-only updates. Omitted card fields and promo_id stay unchanged; deleted removes an optional field value. Required fields cannot be cleared or deleted. Additional fields require tariff support (7501). Invalid references or field values, duplicate barcode and a promo type that disallows cards return HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
barcode_type_id Int64 Optional Barcode type ID.
barcode_value String Optional Barcode.
customer_id Int64 Optional Customer ID.
enabled Boolean Optional Indicates whether the customer card is active: true - active, false - inactive.
expiry_date String Optional Card expiration date.
fields Array of FieldValueEdit Optional Card field changes; omitted fields stay unchanged. Use deleted to remove an optional value.
group_id Int64 Optional Customer card group ID.
id Int64 Required Customer card ID.
promo_id Int64 Optional Promotion ID.
unlimited Boolean Optional Indicates whether the card validity period is unlimited: true - unlimited, false - limited.

Request Example

{
  "barcode_type_id": 1,
  "barcode_value": "string",
  "customer_id": 1,
  "enabled": true,
  "expiry_date": "string",
  "fields": [
    {
      "deleted": true,
      "key": "string",
      "value": "string"
    }
  ],
  "group_id": 1,
  "id": 1,
  "promo_id": 1,
  "unlimited": true
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Update Update operation result.

Response Example

{
  "ok": true,
  "result": {
    "ids": [
      null
    ],
    "row_affected": 1
  }
}