---
title: "POST /api/vouchers"
method: POST
path: "/api/vouchers"
tags: ["api", "vouchers"]
---

# POST /api/vouchers

`POST /api/vouchers`

Create a Voucher

## Request body

- POSTVouchersCreateAVoucher
  - `code` string, nullable — The code used to redeem the voucher
  - `amount` number, float, required — The amount of the voucher in seller's currency. eg. 50.0 -> 50 EUR
  - `validUntil` string, date-time, nullable — The date until the voucher can be redeemed.

## Response `201`

Created

- VoucherResource
  - `code` string, required — Code used to redeem the voucher
  - `amount` number, float, required — The amount of the voucher in seller's currency. eg. 50.0 -> 50 EUR
  - `validUntil` string, date-time — The date until this voucher can be redeemed.
  - `sellerId` string — The ID of the seller of the voucher
  - `transactionId` string — The ID of the transaction if the voucher was a result of a transaction
  - `productId` string — The ID of the product if the voucher was a result of a product
  - `refundId` string — The ID of the refund if the voucher was a result of a refund
  - `customerId` string — The ID of the customer if the voucher was created for a specific customer
  - `origin` 'default' | 'shop' | 'import' | 'upgrade' | 'refund' — The origin of the voucher
  - `createdAt` string, date-time, required — An ISO Timestamp indicating when the voucher was created.
  - `updatedAt` string, date-time, required — An ISO Timestamp indicating when the voucher was last updated.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized

---

[API](https://skmtc.net/vivenu/apis/vivenu-api.md) · [All operations](https://skmtc.net/vivenu/apis/vivenu-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vivenu/vivenu-api/revisions/36be0dca14e7/schema)
