/api/client/claimbonus

Claim a bonus reward. Deducts the required points from the customer's balance.

Parameters

(int) the bonus campaign id to claim from
(int) the reward id to claim; without it, the campaign's reward valid today with the lowest points (the only one, for a single reward)
(String) optionally define the response-format for this call. One of: compact (default) | compacts | full | fulls | json | md | html | js | openapi | yaml
(int) optionally force the API to check against the role (instead of silently not returning data). For guests or public access, the default is -1. 0 (regular customer) and above define the role for which the current session is expected to be authorized.

Error Responses

HTTP StatusError CodeDescription
403security_errorUser is not authenticated
400PARAMETER_ERRORMissing or invalid bonus_id parameter
403not_eligibleThe customer's bonus group (customers.groupid) may not take part in this campaign (bonus.included_customertype / excluded_customertype)
400not_enough_pointsCustomer does not have enough points for the reward
400wrong_rewardThe specified reward does not exist for this campaign, or (without reward_id) the campaign has no reward valid today
400not_currentThe reward's period (start_date / end_date) does not cover today
400pendingThe specified reward was already requested and must first be processed by the backend, before it can be applied for again.

Response Types

BonusResult

BonusResult (v1) docs

Result of a bonus action (apply, claim or admin set)

Fields (2)
#FieldTypeDescription
0actionstringthe action that was performed
1resultstringthe exit/result code of the action

Data (1 record)

actionresult
Bonussecurity_error