CreatePayment

[POST] .../v1/promobonus/createpayment

Creates a pending bonus payment for a retail sale or return. Create a pending bonus payment operation for a retail sale document before posting it with PromoBonus/PerformPayment. The request requires card_id, promo_id, positive value, document_uuid and is_return; non-return payments withdraw bonuses and return payments create the reverse bonus movement. The method requires the promo bonus add permission, locks the card_id while processing, checks the one_time_withdrawal setting, verifies the card bonus balance for write-offs and returns new_uuid. Errors such as a missing body, invalid required fields, denied access, missing promotion settings or card balance, insufficient balance, exceeded withdrawal limit, deleted state, storage errors are returned as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
card_id Int64 Required Customer card ID.
document_uuid String Required UUID of the retail sale document (cheque) linked to the bonus payment operation.
is_return Boolean Required Indicates that the payment operation is a return; true creates the reverse income movement, false withdraws bonuses.
promo_id Int64 Required Promotion ID.
value Decimal Required Bonus value to withdraw from the customer card or return to it. Must be greater than zero.

Request Example

{
  "card_id": 1,
  "document_uuid": "00000000-0000-0000-0000-000000000000",
  "is_return": true,
  "promo_id": 1,
  "value": 1.0
}

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