---
title: "Update a Voucher"
method: PUT
path: "/shop/vouchers/{voucherId}"
tags: ["Vouchers"]
---

# Update a Voucher

`PUT /shop/vouchers/{voucherId}`

Updates the redemption rules attached to an imported `Voucher`.
Currently three fields are mutable — `valid_offerings`,
`valid_weekdays`, and `invalid_date_set_ids`. Other catalogue
fields (name, price, currency, processor metadata) are sourced
from the upstream processor and refresh on the next
`importVouchers` run.

Requires the `update` ability on the `Voucher` — typically granted
by holding `SETTINGS_MANAGE` on the voucher's site.

## Request body

- object
  - `valid_offerings` UpdateVoucherValidOffering[] — Replacement allowlist of offerings the voucher may be redeemed against. Pass an empty array to clear the allowlist (making the voucher redeemable against any offering).
    - `offering_id` string, required — The ID of the offering. For most offering types this is the offering's MongoDB `_id`. For `offering_type=membership` the server resolves the composite ID from `offering_details` and ignores any value passed here.
    - `offering_type` 'appointment' | 'area_booking' | 'course' | 'hotel_room_reservation' | 'membership' | 'package' | 'product' | 'session' | 'table_reservation', required — Snake-case type of the offering. Mirrors the values accepted by the offering allowlist on a `VoucherType`.
    - `offering_details` UpdateVoucherValidOfferingMembershipDetails — Membership-specific configuration. **Required when `offering_type=membership`**, ignored otherwise. The server resolves the membership type and rate at request time and returns the looked-up display names in the response.
      - `membership_type_id` string, uuid, required — The granted `MembershipType`.
      - `membership_rate_id` string, uuid, required — The granted rate within `membership_type_id`.
      - `duration` string, required — Length of the granted membership as an ISO 8601 duration (e.g. `P1Y` for 1 year, `P6M` for 6 months).
  - `valid_weekdays` string[] — Lowercase weekday names the voucher may be redeemed on. Empty (or omitted) means "any weekday".
  - `invalid_date_set_ids` string[] — IDs of date sets on which the voucher may **not** be redeemed. Each ID must reference a date set on the caller's organisation.

## Response `200`

A single `Voucher`.

- object
  - `data` Voucher, required — A `Voucher` is the catalogue-level record for a third-party gift voucher (e.g. a GiftPro voucher) that has been imported into Trybe and made redeemable at a site. Each `Voucher` represents one product in the external system — its name, monetary value, currency, and the rules constraining where it may be redeemed (allowed offerings, permitted weekdays, blackout date sets). `Voucher`s are distinct from `VoucherType`s: a `VoucherType` is a Trybe-native voucher product that can be sold through the basket and issues `VoucherCode`s on purchase; a `Voucher` is an external, pre-issued product whose redemption is brokered through a `VoucherIntegration` (e.g. GiftPro). The two share a similar runtime redemption flow but are managed via separate endpoints.
    - `id` string, object-id, required — The Trybe ID of the voucher record.
    - `name` string, required — Customer- and cashier-facing name of the voucher, mirrored from the source system at import time.
    - `description` string, nullable, required — Long-form description of the voucher imported from the source system. Shown to cashiers when redeeming.
    - `processor_voucher_id` string, required — The voucher's primary key in the external processor's system (e.g. the GiftPro voucher ID). Used to reconcile the Trybe record with the source of truth.
    - `price` integer, required — The face value of the voucher in the smallest unit of `currency` (e.g. pence for `gbp`). Mirrored from the source system and used as the redemption amount when the voucher is presented as payment.
    - `currency` string, required — The ISO-4217 currency code (lowercase) the voucher's `price` is expressed in.
    - `processor` string, required — Identifier of the integration that owns this voucher. Drives which redemption flow Trybe routes the voucher through at checkout.
    - `processor_data` object, required — Processor-specific metadata captured at import time. Shape varies by `processor`; treat as opaque unless you specifically target a known integration.
    - `valid_offerings` VoucherValidOffering[], required — Offerings the voucher may be redeemed against. When the endpoint is called with offering summaries enabled (the default for `getVoucher` and the mutation endpoints), each entry is enriched with the offering's display name. When empty, the voucher is redeemable against any offering subject to the site's normal rules.
      - `offering_id` string, required — The ID of the offering. For most offering types this is the MongoDB `_id` of the offering. For `Membership` offerings, the ID is a synthetic composite of the form `{membership_type_id}_{membership_rate_id}_{duration}`.
      - `offering_type` string, required — Display-friendly type label of the offering, capitalised. Maps one-to-one to the underlying offering class (e.g. `Session`, `AppointmentType`, `Package`, `Membership`).
      - `offering_name` string — The customer-facing name of the offering.
      - `offering_details` VoucherMembershipOfferingDetails — Extra metadata attached to a `valid_offerings` entry when the offering is a membership. Captures which membership type and rate the voucher grants, plus the duration of the granted membership.
        - `membership_type_id` string, uuid, required — The ID of the granted `MembershipType`.
        - `membership_type_name` string, required — Display name of the granted membership type.
        - `membership_rate_id` string, uuid, required — The ID of the rate within `membership_type_id` to grant.
        - `membership_rate_name` string, required — Display name of the granted rate.
        - `duration` string, required — Length of the granted membership as an ISO 8601 duration.
        - `duration_friendly` string, required — Human-readable rendering of `duration` for UI display.
    - `valid_weekdays` string[], required — Lowercase weekday names the voucher may be redeemed on. Empty means "any weekday".
    - `invalid_date_set_ids` string[], required — IDs of date sets (e.g. bank holidays, peak-season blackouts) on which the voucher may **not** be redeemed. Each ID must reference a date set on the caller's organisation.
    - `site_id` string, uuid, required — The ID of the site this voucher record belongs to.
    - `organisation_id` string, uuid, required — The ID of the organisation that owns the voucher record.
    - `processor_created_at` string, date-time, nullable, required — When the voucher was created in the source processor's system.
    - `created_at` string, date-time, required — When the voucher record was imported into Trybe.
    - `updated_at` string, date-time, required — When the voucher record was last updated in Trybe.

## Other responses

- `401` — The user is unauthenticated
- `403` — The authenticated user does not have permission.
- `404` — The resource couldn't be found
- `422` — The request didn't pass validation

---

[API](https://skmtc.dev/try/apis/trybe-api.md) · [All operations](https://skmtc.dev/try/apis/trybe-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/try/trybe-api/revisions/f37f92702da5/schema)
