create
POST
/api/v1/accounts/:account_id/rewards
Create a reward
Creates a new reward for a loyalty card. The card must belong to the same store. The card_id is required on create but cannot be changed afterwards.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
account_id
|
Must be a number. | Required |
Store (account) ID |
reward
|
Must be a Hash | Required |
Reward attributes |
reward[card_id]
|
Must be a number. | Required |
ID of the loyalty card this reward belongs to |
reward[name]
|
Must be a String | Required |
Display name of the reward (e.g. ‘Free Coffee’) |
reward[description]
|
Must be a String | Optional |
Detailed description of the reward |
reward[stamps_required]
|
Must be a number. | Required |
Number of stamps needed to unlock this reward (must be > 0) |
reward[position]
|
Must be a number. | Optional |
Display order position (lower numbers appear first) |
reward[active]
|
Must be one of: true, false, 1, 0.
|
Optional |
Whether the reward is active and redeemable (defaults to true) |
Error Codes
| Code | Description |
|---|---|
401
|
Unauthorized – invalid or missing API token |
404
|
Store or card not found |
422
|
Validation failed – check `errors` for details |