> 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/voucher-redemptions.md).

# Voucher Redemptions

Operations related to voucher redemptions.

## List Redemptions for a Voucher

> Retrieves a list of all redemptions for a specific voucher.

```json
{"openapi":"3.0.3","info":{"title":"Vauchar API","version":"1.0.0"},"tags":[{"name":"Voucher Redemptions","description":"Operations related to voucher redemptions."}],"servers":[{"url":"https://api.vauchar.com","description":"Production Server"}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"Basic Authentication using Merchant ID as username and API Key as password."}},"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."}}}}},"paths":{"/vouchers/{voucherId}/redemptions":{"get":{"summary":"List Redemptions for a Voucher","description":"Retrieves a list of all redemptions for a specific voucher.","tags":["Voucher Redemptions"],"operationId":"listVoucherRedemptions","parameters":[{"name":"voucherId","in":"path","required":true,"description":"The ID of the voucher to retrieve redemptions for.","schema":{"type":"string"}}],"responses":{"200":{"description":"A successful response returning a list of redemptions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedemptionList"}}}},"401":{"description":"Unauthorized. The API key or Merchant ID is invalid or missing."},"404":{"description":"Voucher not found."},"500":{"description":"Internal Server Error."}}}}}}
```

## Create a Redemption

> Redeems a voucher against a transaction.

```json
{"openapi":"3.0.3","info":{"title":"Vauchar API","version":"1.0.0"},"tags":[{"name":"Voucher Redemptions","description":"Operations related to voucher redemptions."}],"servers":[{"url":"https://api.vauchar.com","description":"Production Server"}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"Basic Authentication using Merchant ID as username and API Key as password."}},"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"]},"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."}}}}},"paths":{"/vouchers/{voucherId}/redemptions":{"post":{"summary":"Create a Redemption","description":"Redeems a voucher against a transaction.","tags":["Voucher Redemptions"],"operationId":"createVoucherRedemption","parameters":[{"name":"voucherId","in":"path","required":true,"description":"The ID of the voucher to redeem.","schema":{"type":"string"}}],"requestBody":{"description":"Redemption details. While only user_id is mandatory, providing more details is encouraged for better tracking.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRedemptionRequest"}}}},"responses":{"201":{"description":"Redemption successful. Returns the details of the redemption.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Redemption"}}}},"400":{"description":"Bad Request. The request body is invalid or the voucher is not valid for redemption."},"401":{"description":"Unauthorized. The API key or Merchant ID is invalid or missing."},"404":{"description":"Voucher not found."},"500":{"description":"Internal Server Error."}}}}}}
```

## Delete a Redemption

> Deletes a specific voucher redemption. This is useful for reversing a redemption.

```json
{"openapi":"3.0.3","info":{"title":"Vauchar API","version":"1.0.0"},"tags":[{"name":"Voucher Redemptions","description":"Operations related to voucher redemptions."}],"servers":[{"url":"https://api.vauchar.com","description":"Production Server"}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"Basic Authentication using Merchant ID as username and API Key as password."}}},"paths":{"/vouchers/{voucherId}/redemptions/{redemptionId}":{"delete":{"summary":"Delete a Redemption","description":"Deletes a specific voucher redemption. This is useful for reversing a redemption.","tags":["Voucher Redemptions"],"operationId":"deleteVoucherRedemption","parameters":[{"name":"voucherId","in":"path","required":true,"description":"The ID of the voucher associated with the redemption.","schema":{"type":"string"}},{"name":"redemptionId","in":"path","required":true,"description":"The ID of the redemption to delete.","schema":{"type":"string"}}],"responses":{"204":{"description":"Redemption deleted successfully. No content is returned."},"401":{"description":"Unauthorized. The API key or Merchant ID is invalid or missing."},"404":{"description":"Voucher or Redemption not found."},"500":{"description":"Internal Server Error."}}}}}}
```
