Skip to main content
POST
Create reward

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required

Body

application/json

Request body schema for POST /v2/loyalties/rewards.

name
string
required

Display name of the reward.

Required string length: 1 - 200
type
enum<string>
required

Reward type:

  • MATERIAL rewards deliver a product or SKU;
  • DIGITAL rewards deliver discount coupons, gift vouchers or loyalty v2 card points.

When type is MATERIAL, material is required and digital must be null. When type is DIGITAL, digital is required and material must be null.

Available options:
MATERIAL,
DIGITAL
costs
object[]
required

Point costs of the reward. Each cost defines the points to spend on a specific card definition, optionally guarded by rules.

Required array length: 1 - 10 elements
status
enum<string>

Initial status of the reward. Defaults to DRAFT when omitted.

Available options:
DRAFT,
ACTIVE
validity_hours
object | null

Hours during which the reward can be purchased. Defaults to {"type": "ANY_TIME"} when omitted or null.

start_date
string<date-time> | null

Date from which the reward is available. Must be an ISO-8601 compliant date.

end_date
string<date-time> | null

Date until which the reward is available. Must be an ISO-8601 compliant date.

material
object | null
required if type = MATERIAL

Material reward definition. Required when type is MATERIAL. Must be null when type is DIGITAL.

digital
object | null
required if type = DIGITAL

Digital reward definition. Required when type is DIGITAL. Must be null when type is MATERIAL.

purchase_limits
object | null

Optional purchase limits. When omitted, defaults to no cooldown and no frequency limit.

refunds
object | null

Refund policy for the reward. Defaults to { "type": "NONE" } when omitted.

metadata
object | null

Arbitrary key-value metadata attached to the reward, as a free-form object.

Response

The created reward.

Response body schema for POST /v2/loyalties/rewards.

id
string
required

Unique reward identifier, prefixed with lrew_.

Pattern: ^lrew_[a-f0-9]+$
name
string
required

Display name of the reward.

type
enum<string>
required

Reward type.

Available options:
MATERIAL,
DIGITAL
status
enum<string>
required

Current lifecycle status of the reward.

Available options:
ACTIVE,
DRAFT,
INACTIVE,
DELETED
start_date
string<date-time> | null
required

Date from which the reward is available, or null when not set.

end_date
string<date-time> | null
required

Date until which the reward is available, or null when not set.

validity_hours
object
required

Hours during which the reward can be purchased. Always present. Defaults to {"type": "ANY_TIME"}.

refunds
object
required

Refund policy. Always present. Defaults to { "type": "NONE" }.

costs
object[]
required

Point costs of the reward. Empty array when no costs are defined.

purchase_limits
object
required

Purchase limits. Always present. Defaults to {"cooldown": { "type": "NO_COOLDOWN"}, "frequency": {"type": "NO_LIMIT", "limits": []}}.

metadata
object
required

Arbitrary key-value metadata attached to the reward. Empty object when not set.

created_at
string<date-time>
required

Timestamp when the reward was created (ISO-8601).

updated_at
string<date-time> | null
required

Timestamp when the reward was last updated (ISO-8601), or null when never updated.

object
string
required

Object type marker; always reward.

Allowed value: "reward"
material
object

Material reward definition. Present only when type is MATERIAL. Omitted otherwise.

digital
object

Digital reward definition. Present only when type is DIGITAL. Omitted otherwise.