Add
[POST] .../v1/retailcard/add
Creates a new customer card. Create a loyalty card for an existing customer. Requires customer_id, barcode_value, barcode_type_id and card add permission. Omitted group_id and promo_id use server defaults. Optional fields stores card additional values; all required card fields must be provided. Additional fields require tariff support (7501). Returns new_id. Invalid references or field values, duplicate barcode or customer/promo pair and a promo type that disallows cards return HTTP 200 ErrorResult. Lookup failures prevent card creation.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| barcode_type_id | Int64 | Required | Barcode type ID. |
| barcode_value | String | Required | Barcode. |
| customer_id | Int64 | Required | 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 FieldValueAdd | Optional | Additional field values of the card. |
| group_id | Int64 | Optional | Customer card group 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": [
{
"key": "string",
"value": "string"
}
],
"group_id": 1,
"promo_id": 1,
"unlimited": true
}
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
}
}