---
title: "Update a voucher"
method: PATCH
path: "/vouchers/{id}"
tags: ["Vouchers"]
---

# Update a voucher

`PATCH /vouchers/{id}`

Due to security restrictions only the sku and batch property can be updated on inactive vouchers

## Path parameters

- `id` string, required

## Request body

- object
  - `sku` string — Optional SKU
  - `batch` string — Optional campaign or grouping identifier

## Response `200`

OK

- object
  - `id` string — A unique custom identifier for this voucher (e.g. a sku). Also used for activation of this voucher. (optional, if not set for this voucher it will be auto generated based on the UI regex settings)
  - `client_id` string — id of the client that created this voucher
  - `sku` string — Optional SKU
  - `batch` string — Optional campaign or grouping identifier
  - `amount` string — Amount in the currency of this voucher. Must be send as string in the following pattern: * Up to five digits before the decimal point * The decimal point (.) * Exactly two digits after the decimal point
  - `currency` string — The three-character ISO-4217 currency code - https://en.wikipedia.org/wiki/ISO_4217#Active_codes
  - `valid_until` string, RFC3339 — Date until which this voucher is valid and can be redeemed. Calculated based on validity_value and validity_interval on activation. This property will be null if the voucher is inactive.
  - `validity_value` integer — Calculates together with validity_interval the date until which this voucher is valid after activation (if not set this property will be defined by the settings in the UI)
  - `validity_interval` 'days' | 'weeks' | 'months' | 'years' — Calculates together with validity_value the date until which this voucher is valid after activation (if not set this property will be defined by the settings in the UI)
  - `status` 'active' | 'inactive' — The status of this voucher. In general vouchers are inactive when created, and gets activated when payed. Only activated vouchers can be charged.
  - `type` 'print' | 'digital' — Defines if this voucher is printed or digital. Printed vouchers will have the status inactive by default.
  - `taxable` boolean — Defines if this voucher is a taxable multi purpose voucher
  - `tax_rate` string — The tax rate for this voucher (only required when taxable is true)
  - `order_number` string — An optional order number for this voucher
  - `data` string — Any additional custom data for this voucher as a JSON string
  - `created_at` string, RFC3339 — created_at - datetime in RFC3339 format, see https://tools.ietf.org/html/rfc3339
  - `updated_at` string, RFC3339 — updated_at - datetime in RFC3339 format, see https://tools.ietf.org/html/rfc3339

## Other responses

- `403` — The request contained valid data and was understood by the server, but the server is refusing action.
- `404` — The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible.
- `422` — The request was well-formed but was unable to be followed due to semantic errors.

---

[API](https://skmtc.net/jtl-software/apis/scx-authentication-api.md) · [All operations](https://skmtc.net/jtl-software/apis/scx-authentication-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/jtl-software/scx-authentication-api/revisions/f979b1ea6951/schema)
