---
title: "Batch assign/unassign rewards"
method: POST
path: "/v2/loyalties/programs/{programId}/rewards/batch"
tags: ["Programs"]
---

# Batch assign/unassign rewards

`POST /v2/loyalties/programs/{programId}/rewards/batch`

<Warning>

<Badge color="yellow">BETA endpoint</Badge>

This is a work-in-progress documentation of a BETA endpoint. The parameters, fields, request and response bodies, and other data may subject to change. If you want to share feedback or improvements, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.

</Warning>

Assigns and/or unassigns rewards to/from a program in a single batch.
Unassign operations are processed before assign operations. Each reward to assign
must include its `stock` configuration. In strict mode (default) missing rewards
or missing assignments cause the whole batch to fail (`404 Not Found`).

## Path parameters

- `programId` string, required

## Request body

- ProgramRewardBatchRequest — Batch of reward assignment operations. `unassign` operations are processed before `assign` operations. Duplicate ids within a batch are rejected.
  - `assign` ProgramRewardAssignItem[], nullable — Rewards to assign, each with its stock configuration.
    - `id` string, required — Unique reward identifier.
    - `stock` ProgramRewardAssignmentStock, required — Reward stock configuration. When `type` is `UNLIMITED`, `limited` must not be provided. When `type` is `LIMITED`, `limited` is required.
      - `type` 'UNLIMITED' | 'LIMITED', required — Stock type.
      - `limited` ProgramRewardAssignmentStockLimited — Limited stock configuration.
        - `quantity` integer, required — Available stock quantity.
  - `unassign` ProgramRewardUnassignItem[], nullable — Rewards to unassign.
    - `id` string, required — Unique reward identifier.

## Response `200`

Batch processing result.

- ProgramRewardBatchResponse — Result of a reward assignment batch. Keys are null when the corresponding operation list was not provided.
  - `assigned` ProgramRewardAssignment[], nullable — Assignments created by the batch, or null when no assign operations were requested.
    - `reward_id` string — Unique reward identifier.
    - `stock` ProgramRewardAssignmentStock — Reward stock configuration. When `type` is `UNLIMITED`, `limited` must not be provided. When `type` is `LIMITED`, `limited` is required.
      - `type` 'UNLIMITED' | 'LIMITED', required — Stock type.
      - `limited` ProgramRewardAssignmentStockLimited — Limited stock configuration.
        - `quantity` integer, required — Available stock quantity.
    - `redeemed` number — Number of times the reward has been redeemed within the program. Defaults to 0.
    - `created_at` string, date-time — Assignment creation timestamp (ISO 8601).
    - `updated_at` string, date-time, nullable — Last update timestamp (ISO 8601), or null when never updated.
    - `object` 'program_reward' — Object type marker.
  - `unassigned` ProgramRewardAssignment[], nullable — Assignments removed by the batch, or null when no unassign operations were requested.
    - `reward_id` string — Unique reward identifier.
    - `stock` ProgramRewardAssignmentStock — Reward stock configuration. When `type` is `UNLIMITED`, `limited` must not be provided. When `type` is `LIMITED`, `limited` is required.
      - `type` 'UNLIMITED' | 'LIMITED', required — Stock type.
      - `limited` ProgramRewardAssignmentStockLimited — Limited stock configuration.
        - `quantity` integer, required — Available stock quantity.
    - `redeemed` number — Number of times the reward has been redeemed within the program. Defaults to 0.
    - `created_at` string, date-time — Assignment creation timestamp (ISO 8601).
    - `updated_at` string, date-time, nullable — Last update timestamp (ISO 8601), or null when never updated.
    - `object` 'program_reward' — Object type marker.

## Other responses

- `400` — Validation error - request body or query parameters failed validation, or the operation is not allowed in the current resource state.
- `404` — Resource not found.
- `409` — Conflict - e.g. duplicate resource or invalid state transition.
- `500` — Internal server error.

---

[API](https://skmtc.net/voucherifyio/apis/voucherify-loyalty-v2-api.md) · [All operations](https://skmtc.net/voucherifyio/apis/voucherify-loyalty-v2-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/voucherifyio/voucherify-loyalty-v2-api/versions/f6f2f3388362/schema)
