---
title: tm.vouchercode
slug: db/tmvouchercode
createdAt: 2023-12-14T14:10:31.861Z
---

A vouchercode is a unique code that gives the holder of the code the rights of the linked voucher.

## Fields

| FIELD      | TYPE        | DESCRIPTION                                                                                                                                                                                                                                                                          |
| ---------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| id         | `int`       | ID                                                                                                                                                                                                                                                                                   |
| voucherid  | `int`       | Link to the voucher<br />**References:** [tm.voucher](docId\:SJ2fvDqRBiJez-8wUCiQb)                                                                                                                                                                                                  |
| code       | `string`    | Unique code for this voucher code                                                                                                                                                                                                                                                    |
| amount     | `decimal`   | Value of this voucher code (only used for vouchers of type Payment)                                                                                                                                                                                                                  |
| amountused | `decimal`   | Value of this voucher code that already has been used                                                                                                                                                                                                                                |
| createdts  | `timestamp` | Created timestamp                                                                                                                                                                                                                                                                    |
| expiryts   | `timestamp` | Timestamp when this code will expire                                                                                                                                                                                                                                                 |
| inactive   | `boolean`   | Indicates if this vouchercode is inactive which means that the vouchercode can no longer be used but that it might have been used before and can not be deleted. Vouchercodes will become inactive if the product that generated the vouchercode is removed from the original order. |

