> For the complete documentation index, see [llms.txt](https://vauchar.gitbook.io/vauchar/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vauchar.gitbook.io/vauchar/api-references/vouchers/models.md).

# Models

## The Voucher object

```json
{"openapi":"3.0.3","info":{"title":"Vauchar API","version":"1.0.0"},"components":{"schemas":{"Voucher":{"type":"object","properties":{"href":{"type":"string","format":"uri","description":"The unique URI for the voucher resource."},"type":{"type":"string","description":"The type of the object."},"id":{"type":"string","description":"The unique identifier for the voucher."},"voucher_code":{"type":"string","description":"The code for the voucher."},"tag":{"type":"string","description":"A tag associated with the voucher."},"created":{"type":"integer","format":"int64","description":"The timestamp when the voucher was created."},"start_time":{"type":"integer","format":"int64","description":"The timestamp when the voucher becomes valid."},"expiry_time":{"type":"integer","format":"int64","description":"The timestamp when the voucher expires."},"value":{"type":"string","description":"The value of the voucher."},"value_unit":{"type":"string","description":"The unit of the voucher's value.","enum":["percentage","fixed"]},"currency":{"type":"string","description":"The currency of the voucher's value."},"redeemed":{"type":"integer","description":"Indicates if the voucher has been redeemed (1 for true, 0 for false)."},"redeemed_date":{"type":"integer","format":"int64","nullable":true,"description":"The timestamp when the voucher was redeemed."},"teams":{"type":"array","items":{"type":"string"},"description":"A list of teams associated with the voucher."},"brands":{"type":"array","items":{"type":"string"},"description":"A list of brands associated with the voucher."}}}}}}
```

## The VoucherList object

```json
{"openapi":"3.0.3","info":{"title":"Vauchar API","version":"1.0.0"},"components":{"schemas":{"VoucherList":{"type":"object","properties":{"href":{"type":"string","format":"uri","description":"The URI for the collection of vouchers."},"count":{"type":"integer","description":"The total number of vouchers in the data array."},"data":{"type":"array","items":{"$ref":"#/components/schemas/Voucher"}}}},"Voucher":{"type":"object","properties":{"href":{"type":"string","format":"uri","description":"The unique URI for the voucher resource."},"type":{"type":"string","description":"The type of the object."},"id":{"type":"string","description":"The unique identifier for the voucher."},"voucher_code":{"type":"string","description":"The code for the voucher."},"tag":{"type":"string","description":"A tag associated with the voucher."},"created":{"type":"integer","format":"int64","description":"The timestamp when the voucher was created."},"start_time":{"type":"integer","format":"int64","description":"The timestamp when the voucher becomes valid."},"expiry_time":{"type":"integer","format":"int64","description":"The timestamp when the voucher expires."},"value":{"type":"string","description":"The value of the voucher."},"value_unit":{"type":"string","description":"The unit of the voucher's value.","enum":["percentage","fixed"]},"currency":{"type":"string","description":"The currency of the voucher's value."},"redeemed":{"type":"integer","description":"Indicates if the voucher has been redeemed (1 for true, 0 for false)."},"redeemed_date":{"type":"integer","format":"int64","nullable":true,"description":"The timestamp when the voucher was redeemed."},"teams":{"type":"array","items":{"type":"string"},"description":"A list of teams associated with the voucher."},"brands":{"type":"array","items":{"type":"string"},"description":"A list of brands associated with the voucher."}}}}}}
```

## The VoucherResponse object

```json
{"openapi":"3.0.3","info":{"title":"Vauchar API","version":"1.0.0"},"components":{"schemas":{"VoucherResponse":{"type":"object","properties":{"href":{"type":"string","format":"uri","description":"The unique URI for the voucher resource."},"data":{"$ref":"#/components/schemas/Voucher"}}},"Voucher":{"type":"object","properties":{"href":{"type":"string","format":"uri","description":"The unique URI for the voucher resource."},"type":{"type":"string","description":"The type of the object."},"id":{"type":"string","description":"The unique identifier for the voucher."},"voucher_code":{"type":"string","description":"The code for the voucher."},"tag":{"type":"string","description":"A tag associated with the voucher."},"created":{"type":"integer","format":"int64","description":"The timestamp when the voucher was created."},"start_time":{"type":"integer","format":"int64","description":"The timestamp when the voucher becomes valid."},"expiry_time":{"type":"integer","format":"int64","description":"The timestamp when the voucher expires."},"value":{"type":"string","description":"The value of the voucher."},"value_unit":{"type":"string","description":"The unit of the voucher's value.","enum":["percentage","fixed"]},"currency":{"type":"string","description":"The currency of the voucher's value."},"redeemed":{"type":"integer","description":"Indicates if the voucher has been redeemed (1 for true, 0 for false)."},"redeemed_date":{"type":"integer","format":"int64","nullable":true,"description":"The timestamp when the voucher was redeemed."},"teams":{"type":"array","items":{"type":"string"},"description":"A list of teams associated with the voucher."},"brands":{"type":"array","items":{"type":"string"},"description":"A list of brands associated with the voucher."}}}}}}
```

## The CreateVouchersRequest object

```json
{"openapi":"3.0.3","info":{"title":"Vauchar API","version":"1.0.0"},"components":{"schemas":{"CreateVouchersRequest":{"type":"object","properties":{"count":{"type":"integer","description":"The number of vouchers to create."},"start_time":{"type":"integer","format":"int64","description":"The timestamp when the vouchers become valid. Use 0 for immediate validity."},"expiry_time":{"type":"integer","format":"int64","description":"The timestamp when the vouchers expire. Use 0 for no expiry."},"value":{"type":"string","description":"The value of each voucher."},"value_unit":{"type":"string","description":"The unit of the voucher's value.","enum":["percentage","fixed"]},"currency":{"type":"string","description":"The currency of the voucher's value."},"tag":{"type":"string","description":"A tag to associate with the created vouchers."}},"required":["count","value","value_unit","currency"]}}}}
```

## The ValidationStatus object

```json
{"openapi":"3.0.3","info":{"title":"Vauchar API","version":"1.0.0"},"components":{"schemas":{"ValidationStatus":{"type":"object","properties":{"status":{"type":"integer","description":"A status code indicating the validation result."},"message":{"type":"string","description":"A descriptive message about the validation status."}}}}}}
```

## The VoucherValidationResponse object

```json
{"openapi":"3.0.3","info":{"title":"Vauchar API","version":"1.0.0"},"components":{"schemas":{"VoucherValidationResponse":{"type":"object","properties":{"validation_status":{"$ref":"#/components/schemas/ValidationStatus"},"data":{"$ref":"#/components/schemas/Voucher"}}},"ValidationStatus":{"type":"object","properties":{"status":{"type":"integer","description":"A status code indicating the validation result."},"message":{"type":"string","description":"A descriptive message about the validation status."}}},"Voucher":{"type":"object","properties":{"href":{"type":"string","format":"uri","description":"The unique URI for the voucher resource."},"type":{"type":"string","description":"The type of the object."},"id":{"type":"string","description":"The unique identifier for the voucher."},"voucher_code":{"type":"string","description":"The code for the voucher."},"tag":{"type":"string","description":"A tag associated with the voucher."},"created":{"type":"integer","format":"int64","description":"The timestamp when the voucher was created."},"start_time":{"type":"integer","format":"int64","description":"The timestamp when the voucher becomes valid."},"expiry_time":{"type":"integer","format":"int64","description":"The timestamp when the voucher expires."},"value":{"type":"string","description":"The value of the voucher."},"value_unit":{"type":"string","description":"The unit of the voucher's value.","enum":["percentage","fixed"]},"currency":{"type":"string","description":"The currency of the voucher's value."},"redeemed":{"type":"integer","description":"Indicates if the voucher has been redeemed (1 for true, 0 for false)."},"redeemed_date":{"type":"integer","format":"int64","nullable":true,"description":"The timestamp when the voucher was redeemed."},"teams":{"type":"array","items":{"type":"string"},"description":"A list of teams associated with the voucher."},"brands":{"type":"array","items":{"type":"string"},"description":"A list of brands associated with the voucher."}}}}}}
```

## The Redemption object

```json
{"openapi":"3.0.3","info":{"title":"Vauchar API","version":"1.0.0"},"components":{"schemas":{"Redemption":{"type":"object","properties":{"href":{"type":"string","format":"uri","description":"The unique URI for the redemption resource."},"type":{"type":"string","description":"The type of the object."},"id":{"type":"string","description":"The unique identifier for the redemption."},"voucher_id":{"type":"string","description":"The ID of the voucher that was redeemed."},"user_id":{"type":"string","description":"The ID of the user who made the redemption."},"customer_id":{"type":"string","description":"The ID of the customer associated with the redemption."},"user_email":{"type":"string","description":"The email of the user."},"user_phone":{"type":"string","description":"The phone number of the user."},"transaction_id":{"type":"string","description":"The ID of the associated transaction."},"value_used":{"type":"string","description":"The value used in this redemption."},"team_id":{"type":"string","description":"The ID of the team associated with the redemption."},"created":{"type":"integer","format":"int64","description":"The timestamp when the redemption occurred."}}}}}}
```

## The RedemptionList object

```json
{"openapi":"3.0.3","info":{"title":"Vauchar API","version":"1.0.0"},"components":{"schemas":{"RedemptionList":{"type":"object","properties":{"href":{"type":"string","format":"uri","description":"The URI for the collection of redemptions."},"data":{"type":"array","items":{"$ref":"#/components/schemas/Redemption"}}}},"Redemption":{"type":"object","properties":{"href":{"type":"string","format":"uri","description":"The unique URI for the redemption resource."},"type":{"type":"string","description":"The type of the object."},"id":{"type":"string","description":"The unique identifier for the redemption."},"voucher_id":{"type":"string","description":"The ID of the voucher that was redeemed."},"user_id":{"type":"string","description":"The ID of the user who made the redemption."},"customer_id":{"type":"string","description":"The ID of the customer associated with the redemption."},"user_email":{"type":"string","description":"The email of the user."},"user_phone":{"type":"string","description":"The phone number of the user."},"transaction_id":{"type":"string","description":"The ID of the associated transaction."},"value_used":{"type":"string","description":"The value used in this redemption."},"team_id":{"type":"string","description":"The ID of the team associated with the redemption."},"created":{"type":"integer","format":"int64","description":"The timestamp when the redemption occurred."}}}}}}
```

## The CreateRedemptionRequest object

```json
{"openapi":"3.0.3","info":{"title":"Vauchar API","version":"1.0.0"},"components":{"schemas":{"CreateRedemptionRequest":{"type":"object","properties":{"user_id":{"type":"string","description":"The ID of the user making the redemption."},"user_email":{"type":"string","format":"email","description":"The email address of the user."},"user_phone":{"type":"string","description":"The phone number of the user."},"transaction_id":{"type":"string","description":"An external transaction ID for tracking."},"value_used":{"type":"number","description":"The value of the voucher being used in this transaction."}},"required":["user_id"]}}}}
```
