CreateEnrollment
[POST] .../v1/promobonus/createenrollment
Creates a deposit operation for a customer card Use this method to create a pending bonus accrual operation for a retail sale document before posting it with PromoBonus/PerformEnrollment. The request requires card_id, promo_id, positive amount, document_uuid and is_return; normal enrollments create income operations and return enrollments create the reverse outcome operation. The method requires the promo bonus add permission, locks the card_id, calculates bonus value and expiry from the one_time_enrollment promotion setting, applies the configured maximum value and returns new_uuid. Business errors such as a missing body, invalid required fields, denied access, missing promotion settings, invalid setting JSON, database errors, missing active row or persistence failures are returned as HTTP 200 ErrorResult.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| amount | Decimal | Optional | Amount to accrue. |
| card_id | Int64 | Required | Customer card ID. |
| document_uuid | String | Optional | UUID of the retail sale document (cheque) used to create the payment. |
| is_return | Boolean | Optional | Indicates that the accrual operation is a return (withdrawal). |
| promo_id | Int64 | Required | Promotion ID. |
Request Example
{
"amount": 1.0,
"card_id": 1,
"document_uuid": "00000000-0000-0000-0000-000000000000",
"is_return": true,
"promo_id": 1
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Insert_uuid | Created UUID record result. |
Response Example
{
"ok": true,
"result": {
"new_uuid": "00000000-0000-0000-0000-000000000000"
}
}