Edit

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

Edits customer card. Use this method to update an existing retail customer card, including group, customer, barcode, barcode type, promo program, expiry and enabled state. The request requires id and at least one editable field, validates barcode length when barcode_value is provided and returns row_affected after the update. The method checks the current request user and requires customer card edit permission; changing barcode_value additionally requires barcode edit permission and validation failures such as unknown group, customer or promo, duplicate barcode, promo type not allowing retail cards, no editable fields, denied permission and storage errors are returned as HTTP 200 ErrorResult business errors.

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.
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",
  "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
  }
}