# Vouchers

## GET /v1/gift-cards/vouchers/by-customer/{customerUid}

> Lists all vouchers associated with a specific customer

```json
{"openapi":"3.0.0","info":{"title":"Gormic Gift Cards API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"ListCustomerVouchersApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/ListCustomerVouchers_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"ListCustomerVouchers_Data":{"type":"object","properties":{"vouchers":{"type":"array","items":{"$ref":"#/components/schemas/VoucherM"}},"next":{"type":"string"}},"required":["vouchers"]},"VoucherM":{"type":"object","properties":{"amount":{"type":"number"},"activatedAt":{"type":"string"},"sharedAt":{"type":"string"},"activationEndDate":{"type":"string"},"validity":{"type":"number"},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"uid":{"type":"string"},"productId":{"type":"string"},"customerId":{"type":"string"},"holderId":{"type":"string"},"sharedTo":{"$ref":"#/components/schemas/UserMap_1_45e463b4"},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"balance":{"type":"number"},"accountUid":{"type":"string"}},"required":["amount","uid","balance"]},"UserMap_1_45e463b4":{"type":"object","properties":{}}}},"paths":{"/v1/gift-cards/vouchers/by-customer/{customerUid}":{"get":{"operationId":"Vouchers_list","parameters":[{"name":"customerUid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCustomerVouchersApiResponse"}}}}},"summary":"Lists all vouchers associated with a specific customer","tags":["Vouchers"]}}}}
```

## GET /v1/gift-cards/vouchers/{uid}

> Returns a specific voucher

```json
{"openapi":"3.0.0","info":{"title":"Gormic Gift Cards API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"GetVoucherApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/GetVoucher_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"GetVoucher_Data":{"type":"object","properties":{"voucher":{"$ref":"#/components/schemas/GetVoucher_Data_Voucher"}},"required":["voucher"]},"GetVoucher_Data_Voucher":{"type":"object","properties":{"amount":{"type":"number"},"activatedAt":{"type":"string"},"sharedAt":{"type":"string"},"activationEndDate":{"type":"string"},"validity":{"type":"number"},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"uid":{"type":"string"},"productId":{"type":"string"},"customerId":{"type":"string"},"holderId":{"type":"string"},"sharedTo":{"$ref":"#/components/schemas/UserMap_1_45e463b4"},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"balance":{"type":"number"},"accountUid":{"type":"string"}},"required":["amount","uid","balance"]},"UserMap_1_45e463b4":{"type":"object","properties":{}},"GetVoucherApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/GetVoucher_Error"}},"required":["error"]},"GetVoucher_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/GetVoucher_ErrorCodes_enum"}]}},"required":["code"]},"GetVoucher_ErrorCodes_enum":{"type":"string","enum":["COMPACT_INACTIVE","MISSING_ID","NO_CREATE_ACTION","NotFound"]}}},"paths":{"/v1/gift-cards/vouchers/{uid}":{"get":{"operationId":"Vouchers_get","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetVoucherApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetVoucherApiError"}}}}},"summary":"Returns a specific voucher","tags":["Vouchers"]}}}}
```

## PATCH /v1/gift-cards/vouchers/{uid}/activate

> Activates a specific voucher

```json
{"openapi":"3.0.0","info":{"title":"Gormic Gift Cards API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"ActivateVoucherApiRequest":{"type":"object","properties":{"params":{"$ref":"#/components/schemas/ActivateVoucher_Params"}},"required":["params"]},"ActivateVoucher_Params":{"type":"object","properties":{"customerId":{"type":"string"},"orderId":{"type":"string"},"message":{"type":"string"}}},"ActivateVoucherApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/ActivateVoucher_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"ActivateVoucher_Data":{"type":"object","properties":{"succeed":{"type":"boolean"}},"required":["succeed"]},"ActivateVoucherApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ActivateVoucher_Error"}},"required":["error"]},"ActivateVoucher_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/ActivateVoucher_ErrorCodes_enum"}]}},"required":["code"]},"ActivateVoucher_ErrorCodes_enum":{"type":"string","enum":["ALREADY_ACTIVE","VOUCHER_EXPIRED"]}}},"paths":{"/v1/gift-cards/vouchers/{uid}/activate":{"patch":{"operationId":"Vouchers_activate","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateVoucherApiRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateVoucherApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateVoucherApiError"}}}}},"summary":"Activates a specific voucher","tags":["Vouchers"]}}}}
```

## POST /v1/gift-cards/vouchers/{uid}/redeem

> Initiates a redemption transaction using a specific voucher.

```json
{"openapi":"3.0.0","info":{"title":"Gormic Gift Cards API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"PayWithVoucherApiRequest":{"type":"object","properties":{"params":{"$ref":"#/components/schemas/PayWithVoucher_Params"}},"required":["params"]},"PayWithVoucher_Params":{"type":"object","properties":{"amount":{"type":"number"},"reference":{"type":"string"}},"required":["amount"]},"PayWithVoucherApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/PayWithVoucher_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"PayWithVoucher_Data":{"type":"object","properties":{"transaction":{"$ref":"#/components/schemas/PayWithVoucher_Data_Transaction"}},"required":["transaction"]},"PayWithVoucher_Data_Transaction":{"type":"object","properties":{"type":{"type":"string","enum":["payment","refund","topup","transfer"]},"status":{"type":"string","enum":["applied","pending","reversed"]},"time":{"type":"string"},"amount":{"type":"number"},"description":{"type":"string"},"reversed":{"type":"boolean"},"reference":{"type":"string"},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"uid":{"type":"string"},"accountUid":{"type":"string"},"transferToAccountUid":{"type":"string"}},"required":["type","status","time","amount","uid","accountUid"]},"PayWithVoucherApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/PayWithVoucher_Error"}},"required":["error"]},"PayWithVoucher_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/PayWithVoucher_ErrorCodes_enum"}]}},"required":["code"]},"PayWithVoucher_ErrorCodes_enum":{"type":"string","enum":["ALREADY_REDEAMED_TO_WALLET","LOW_BALANCE","NON_HOLDER","NotFound","PAY_COUNT_LIMIT_EXCEEDED","VOUCHER_EXPIRED","VOUCHER_INACTIVE"]}}},"paths":{"/v1/gift-cards/vouchers/{uid}/redeem":{"post":{"operationId":"Vouchers_redeem","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayWithVoucherApiRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayWithVoucherApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayWithVoucherApiError"}}}}},"summary":"Initiates a redemption transaction using a specific voucher.","tags":["Vouchers"]}}}}
```

## POST /v1/gift-cards/vouchers/redeem-with-code

> Redeem a specific voucher using its voucher code

```json
{"openapi":"3.0.0","info":{"title":"Gormic Gift Cards API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"PayWithVoucherCodeApiRequest":{"type":"object","properties":{"params":{"$ref":"#/components/schemas/PayWithVoucherCode_Params"}},"required":["params"]},"PayWithVoucherCode_Params":{"type":"object","properties":{"code":{"type":"string"},"amount":{"type":"number"},"reference":{"type":"string"}},"required":["code","amount"]},"PayWithVoucherCodeApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/PayWithVoucherCode_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"PayWithVoucherCode_Data":{"type":"object","properties":{"transaction":{"$ref":"#/components/schemas/PayWithVoucherCode_Data_Transaction"}},"required":["transaction"]},"PayWithVoucherCode_Data_Transaction":{"type":"object","properties":{"type":{"type":"string","enum":["payment","refund","topup","transfer"]},"status":{"type":"string","enum":["applied","pending","reversed"]},"time":{"type":"string"},"amount":{"type":"number"},"description":{"type":"string"},"reversed":{"type":"boolean"},"reference":{"type":"string"},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"uid":{"type":"string"},"accountUid":{"type":"string"},"transferToAccountUid":{"type":"string"}},"required":["type","status","time","amount","uid","accountUid"]},"PayWithVoucherCodeApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/PayWithVoucherCode_Error"}},"required":["error"]},"PayWithVoucherCode_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/PayWithVoucherCode_ErrorCodes_enum"}]}},"required":["code"]},"PayWithVoucherCode_ErrorCodes_enum":{"type":"string","enum":["ALREADY_REDEAMED","ALREADY_REDEAMED_TO_WALLET","LOW_BALANCE","NON_HOLDER","NotFound","PAY_COUNT_LIMIT_EXCEEDED","VOUCHER_EXPIRED","VOUCHER_INACTIVE"]}}},"paths":{"/v1/gift-cards/vouchers/redeem-with-code":{"post":{"operationId":"Vouchers_redeemWithCode","parameters":[{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayWithVoucherCodeApiRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayWithVoucherCodeApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayWithVoucherCodeApiError"}}}}},"summary":"Redeem a specific voucher using its voucher code","tags":["Vouchers"]}}}}
```
