# Coupon Redemption

## Retrieving a list of redemptions by criteria

> Retrieves a list of redemptions by the specified criteria. Supports sorting and paging.<br>

```json
{"openapi":"3.0.0","info":{"title":"Coupon Service","version":"0.0.1"},"tags":[{"name":"Coupon Redemption"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["coupon.coupon_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"coupon.coupon_read":"Needed to read coupons.","coupon.coupon_manage":"Needed to manage coupons.","coupon.coupon_redeem":"Needed to redeem coupons.","coupon.coupon_redeem_on_behalf":"Needed to redeem coupons on behalf of another customer."}}}}},"headers":{"Total-Count":{"required":false,"description":"The total number of objects that fulfil the criteria.\n","schema":{"type":"integer"}}},"schemas":{"redemptions":{"type":"array","items":{"$ref":"#/components/schemas/redemption"}},"redemption":{"type":"object","title":"Coupon Redemption","description":"Defines a coupon redemption response.","allOf":[{"$ref":"#/components/schemas/redemption-creation"}],"properties":{"id":{"description":"Unique identifier of the redemption.","type":"string"},"redeemedAt":{"description":"Timestamp of the redemption.","type":"string","format":"date-time"}}},"redemption-creation":{"type":"object","title":"Coupon Redemption Request","description":"Defines a coupon redemption request payload that affects a coupon instance.","properties":{"orderCode":{"description":"Code of the associated order.","type":"string"},"customerNumber":{"type":"string","description":"The customer Id of the user, e.g. C0123456789. Can be specified only if coupon.coupon_redeem_on_behalf scope is present."},"legalEntityId":{"type":"string","description":"The id of the legal entity to which customer is assigned. When customer is assigned to many legal entities then he can redeem the same coupon separately for each legal entity."},"orderTotal":{"allOf":[{"$ref":"#/components/schemas/currency-amount"},{"description":"The amount of the purchase."}]},"discount":{"allOf":[{"$ref":"#/components/schemas/currency-amount"},{"description":"The absolute amount of the granted discount."}]}},"required":["orderTotal","discount"]},"currency-amount":{"type":"object","title":"Money amount","description":"Defines an amount in a specific currency.","properties":{"amount":{"type":"number","default":0,"minimum":0,"description":"Total amount in the specified currency."},"currency":{"type":"string","default":"USD","pattern":"^[A-Z]{3}$","description":"ISO 4217 currency code, e.g.: USD, EUR, CHF."}}}},"responses":{"trait_queryable_400":{"description":"Request syntactically incorrect. Details of the error are included in the response payload.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type, lower case with underscore eg validation_failure.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"},"details":{"description":"List of problems causing this error.","type":"array","items":{"title":"errorDetail","description":"Schema for specific error cause.","type":"object","properties":{"field":{"description":"A bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"Descriptive error detail message for debugging.","type":"string"},"moreInfo":{"type":"string","description":"Link to documentation to investigate further and finding support for error detail."}},"required":["type"]}}},"required":["status","type"]}}}},"trait_unauthorized_401":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"trait_restricted_403":{"description":"Access forbidden. The caller is not allowed to access this resource.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type, lower case with underscore eg validation_failure.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"}},"required":["status","type"]}}}},"trait_notFound_404":{"description":"The requested resource does not exist.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type, lower case with underscore eg validation_failure.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"}},"required":["status","type"]}}}},"trait_internal_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type, lower case with underscore eg validation_failure.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"},"details":{"description":"List of problems causing this error.","type":"array","items":{"title":"errorDetail","description":"Schema for specific error cause.","type":"object","properties":{"field":{"description":"A bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"Descriptive error detail message for debugging.","type":"string"},"moreInfo":{"type":"string","description":"Link to documentation to investigate further and finding support for error detail."}},"required":["type"]}}},"required":["status","type"]}}}}},"parameters":{"trait_sortable_sort":{"name":"sort","in":"query","description":"The list of comma-separated properties used to sort the results.\nBy default, the column values are sorted in ascending order.\nCan either be in the form of fieldName or fieldName:asc,fieldName:desc.\nIf you want to sort by localized attributes, you must use the following form:\nfieldName.language or fieldName.language:asc,fieldName.language:desc.\n","schema":{"type":"string"}},"trait_paged_pageNumber":{"name":"pageNumber","in":"query","description":"The page number to be retrieved where the size of the pages must be specified by the pageSize parameter.\nThe number of the first page is 1.\n","schema":{"default":1,"minimum":1,"type":"integer"}},"trait_paged_pageSize":{"name":"pageSize","in":"query","description":"The number of documents being retrieved on the page.\n","schema":{"default":16,"minimum":1,"type":"integer"}},"trait_countable_totalCount":{"name":"totalCount","in":"query","description":"This parameter requests to return the total number of object in the collection fulfilling\nthe criteria together with the response. This number will be returned in the 'items-count'\nheader.\n","schema":{"type":"boolean"}},"trait_queryable_q":{"name":"q","in":"query","description":"The simple query criteria based on available fields to limit returned results or a set of modified documents.\n","schema":{"type":"string"}}}},"paths":{"/coupon/{tenant}/coupons/{code}/redemptions":{"get":{"summary":"Retrieving a list of redemptions by criteria","tags":["Coupon Redemption"],"responses":{"200":{"description":"List of redemptions","headers":{"Items-Count":{"$ref":"#/components/headers/Total-Count"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/redemptions"}}}},"400":{"$ref":"#/components/responses/trait_queryable_400"},"401":{"$ref":"#/components/responses/trait_unauthorized_401"},"403":{"$ref":"#/components/responses/trait_restricted_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"500":{"$ref":"#/components/responses/trait_internal_500"}},"description":"Retrieves a list of redemptions by the specified criteria. Supports sorting and paging.\n","operationId":"GET-coupon-list-coupon-redemptions","parameters":[{"$ref":"#/components/parameters/trait_sortable_sort"},{"$ref":"#/components/parameters/trait_paged_pageNumber"},{"$ref":"#/components/parameters/trait_paged_pageSize"},{"$ref":"#/components/parameters/trait_countable_totalCount"},{"$ref":"#/components/parameters/trait_queryable_q"}]}}}}
```

## Redeeming the coupon by creating a redemption

> Invalidate the coupon based on its validity scope. Redemption is not possible when the coupon has exceeded its maximum\
> number allowed redemptions. To be redeemed a coupon needs to be already valid and not expired yet.\
> \*\*\*\
> \
> \### Additional scopes info\
> \* The \`coupon.coupon\_redeem\_on\_behalf\` scope is only required if the service should use the customer identification specified in the request body (\`customerNumber\` attribute) instead of the one associated with current authentication token.<br>

```json
{"openapi":"3.0.0","info":{"title":"Coupon Service","version":"0.0.1"},"tags":[{"name":"Coupon Redemption"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["coupon.coupon_redeem_on_behalf"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"coupon.coupon_read":"Needed to read coupons.","coupon.coupon_manage":"Needed to manage coupons.","coupon.coupon_redeem":"Needed to redeem coupons.","coupon.coupon_redeem_on_behalf":"Needed to redeem coupons on behalf of another customer."}}}}},"schemas":{"resource-location":{"type":"object","properties":{"id":{"type":"string","description":"Identifier of the link."},"yrn":{"type":"string","description":"Identifier of the link in the system's notation."}}},"redemption-creation":{"type":"object","title":"Coupon Redemption Request","description":"Defines a coupon redemption request payload that affects a coupon instance.","properties":{"orderCode":{"description":"Code of the associated order.","type":"string"},"customerNumber":{"type":"string","description":"The customer Id of the user, e.g. C0123456789. Can be specified only if coupon.coupon_redeem_on_behalf scope is present."},"legalEntityId":{"type":"string","description":"The id of the legal entity to which customer is assigned. When customer is assigned to many legal entities then he can redeem the same coupon separately for each legal entity."},"orderTotal":{"allOf":[{"$ref":"#/components/schemas/currency-amount"},{"description":"The amount of the purchase."}]},"discount":{"allOf":[{"$ref":"#/components/schemas/currency-amount"},{"description":"The absolute amount of the granted discount."}]}},"required":["orderTotal","discount"]},"currency-amount":{"type":"object","title":"Money amount","description":"Defines an amount in a specific currency.","properties":{"amount":{"type":"number","default":0,"minimum":0,"description":"Total amount in the specified currency."},"currency":{"type":"string","default":"USD","pattern":"^[A-Z]{3}$","description":"ISO 4217 currency code, e.g.: USD, EUR, CHF."}}}},"responses":{"trait_queryable_400":{"description":"Request syntactically incorrect. Details of the error are included in the response payload.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type, lower case with underscore eg validation_failure.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"},"details":{"description":"List of problems causing this error.","type":"array","items":{"title":"errorDetail","description":"Schema for specific error cause.","type":"object","properties":{"field":{"description":"A bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"Descriptive error detail message for debugging.","type":"string"},"moreInfo":{"type":"string","description":"Link to documentation to investigate further and finding support for error detail."}},"required":["type"]}}},"required":["status","type"]}}}},"trait_unauthorized_401":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"trait_restricted_403":{"description":"Access forbidden. The caller is not allowed to access this resource.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type, lower case with underscore eg validation_failure.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"}},"required":["status","type"]}}}},"trait_notFound_404":{"description":"The requested resource does not exist.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type, lower case with underscore eg validation_failure.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"}},"required":["status","type"]}}}},"trait_conflict_409":{"description":"Creation failed because there was a conflict with another resource. Details of the error are included in the response payload.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type, lower case with underscore eg validation_failure.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"}},"required":["status","type"]}}}},"trait_internal_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type, lower case with underscore eg validation_failure.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"},"details":{"description":"List of problems causing this error.","type":"array","items":{"title":"errorDetail","description":"Schema for specific error cause.","type":"object","properties":{"field":{"description":"A bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"Descriptive error detail message for debugging.","type":"string"},"moreInfo":{"type":"string","description":"Link to documentation to investigate further and finding support for error detail."}},"required":["type"]}}},"required":["status","type"]}}}}}},"paths":{"/coupon/{tenant}/coupons/{code}/redemptions":{"post":{"summary":"Redeeming the coupon by creating a redemption","tags":["Coupon Redemption"],"responses":{"201":{"description":"The coupon has been redeemed and the redemption has been successfully created.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/resource-location"}}}},"400":{"$ref":"#/components/responses/trait_queryable_400"},"401":{"$ref":"#/components/responses/trait_unauthorized_401"},"403":{"$ref":"#/components/responses/trait_restricted_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"409":{"$ref":"#/components/responses/trait_conflict_409"},"500":{"$ref":"#/components/responses/trait_internal_500"}},"description":"Invalidate the coupon based on its validity scope. Redemption is not possible when the coupon has exceeded its maximum\nnumber allowed redemptions. To be redeemed a coupon needs to be already valid and not expired yet.\n***\n\n### Additional scopes info\n* The `coupon.coupon_redeem_on_behalf` scope is only required if the service should use the customer identification specified in the request body (`customerNumber` attribute) instead of the one associated with current authentication token.\n","operationId":"POST-coupon-invalidate-coupon","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/redemption-creation"}}},"required":true}}}}}
```

## Retrieving a coupon redemption

> Retrieves a single redemption.\
> \*\*\*\
> \
> \### Additional scopes info\
> \* The \`coupon.coupon\_manage\` scope is required for accessing any redemption.\
> \* The \`coupon.coupon\_redeem\` scope is required for accessing only redemption created by current user.\
> \* The \`coupon.coupon\_redeem\_on\_behalf\` scope is only required if the service should use the customer identification specified in the request body (\`customerNumber\`attribute) instead of the one associated with current authentication token.<br>

```json
{"openapi":"3.0.0","info":{"title":"Coupon Service","version":"0.0.1"},"tags":[{"name":"Coupon Redemption"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["coupon.coupon_manage","coupon.coupon_redeem","coupon.coupon_redeem_on_behalf"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"coupon.coupon_read":"Needed to read coupons.","coupon.coupon_manage":"Needed to manage coupons.","coupon.coupon_redeem":"Needed to redeem coupons.","coupon.coupon_redeem_on_behalf":"Needed to redeem coupons on behalf of another customer."}}}}},"schemas":{"redemption":{"type":"object","title":"Coupon Redemption","description":"Defines a coupon redemption response.","allOf":[{"$ref":"#/components/schemas/redemption-creation"}],"properties":{"id":{"description":"Unique identifier of the redemption.","type":"string"},"redeemedAt":{"description":"Timestamp of the redemption.","type":"string","format":"date-time"}}},"redemption-creation":{"type":"object","title":"Coupon Redemption Request","description":"Defines a coupon redemption request payload that affects a coupon instance.","properties":{"orderCode":{"description":"Code of the associated order.","type":"string"},"customerNumber":{"type":"string","description":"The customer Id of the user, e.g. C0123456789. Can be specified only if coupon.coupon_redeem_on_behalf scope is present."},"legalEntityId":{"type":"string","description":"The id of the legal entity to which customer is assigned. When customer is assigned to many legal entities then he can redeem the same coupon separately for each legal entity."},"orderTotal":{"allOf":[{"$ref":"#/components/schemas/currency-amount"},{"description":"The amount of the purchase."}]},"discount":{"allOf":[{"$ref":"#/components/schemas/currency-amount"},{"description":"The absolute amount of the granted discount."}]}},"required":["orderTotal","discount"]},"currency-amount":{"type":"object","title":"Money amount","description":"Defines an amount in a specific currency.","properties":{"amount":{"type":"number","default":0,"minimum":0,"description":"Total amount in the specified currency."},"currency":{"type":"string","default":"USD","pattern":"^[A-Z]{3}$","description":"ISO 4217 currency code, e.g.: USD, EUR, CHF."}}}},"responses":{"trait_queryable_400":{"description":"Request syntactically incorrect. Details of the error are included in the response payload.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type, lower case with underscore eg validation_failure.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"},"details":{"description":"List of problems causing this error.","type":"array","items":{"title":"errorDetail","description":"Schema for specific error cause.","type":"object","properties":{"field":{"description":"A bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"Descriptive error detail message for debugging.","type":"string"},"moreInfo":{"type":"string","description":"Link to documentation to investigate further and finding support for error detail."}},"required":["type"]}}},"required":["status","type"]}}}},"trait_unauthorized_401":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"trait_restricted_403":{"description":"Access forbidden. The caller is not allowed to access this resource.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type, lower case with underscore eg validation_failure.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"}},"required":["status","type"]}}}},"trait_notFound_404":{"description":"The requested resource does not exist.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type, lower case with underscore eg validation_failure.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"}},"required":["status","type"]}}}},"trait_internal_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type, lower case with underscore eg validation_failure.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"},"details":{"description":"List of problems causing this error.","type":"array","items":{"title":"errorDetail","description":"Schema for specific error cause.","type":"object","properties":{"field":{"description":"A bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"Descriptive error detail message for debugging.","type":"string"},"moreInfo":{"type":"string","description":"Link to documentation to investigate further and finding support for error detail."}},"required":["type"]}}},"required":["status","type"]}}}}},"parameters":{"customer_number":{"name":"customerNumber","in":"query","required":false,"description":"Customer number (ID) of customer on behalf of which we request coupon information.\nNeeded only in case of retrieving coupon eligible for other customer than the caller.\n","schema":{"type":"string"}}}},"paths":{"/coupon/{tenant}/coupons/{code}/redemptions/{id}":{"get":{"summary":"Retrieving a coupon redemption","tags":["Coupon Redemption"],"responses":{"200":{"description":"The coupon redemption has been successfully retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/redemption"}}}},"400":{"$ref":"#/components/responses/trait_queryable_400"},"401":{"$ref":"#/components/responses/trait_unauthorized_401"},"403":{"$ref":"#/components/responses/trait_restricted_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"500":{"$ref":"#/components/responses/trait_internal_500"}},"description":"Retrieves a single redemption.\n***\n\n### Additional scopes info\n* The `coupon.coupon_manage` scope is required for accessing any redemption.\n* The `coupon.coupon_redeem` scope is required for accessing only redemption created by current user.\n* The `coupon.coupon_redeem_on_behalf` scope is only required if the service should use the customer identification specified in the request body (`customerNumber`attribute) instead of the one associated with current authentication token.\n","operationId":"GET-coupon-retrieve-coupon-redemption","parameters":[{"$ref":"#/components/parameters/customer_number"}]}}}}
```

## Deleting a coupon redemption

> Deletes a previously created redemption.<br>

```json
{"openapi":"3.0.0","info":{"title":"Coupon Service","version":"0.0.1"},"tags":[{"name":"Coupon Redemption"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["coupon.coupon_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"coupon.coupon_read":"Needed to read coupons.","coupon.coupon_manage":"Needed to manage coupons.","coupon.coupon_redeem":"Needed to redeem coupons.","coupon.coupon_redeem_on_behalf":"Needed to redeem coupons on behalf of another customer."}}}}},"responses":{"trait_queryable_400":{"description":"Request syntactically incorrect. Details of the error are included in the response payload.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type, lower case with underscore eg validation_failure.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"},"details":{"description":"List of problems causing this error.","type":"array","items":{"title":"errorDetail","description":"Schema for specific error cause.","type":"object","properties":{"field":{"description":"A bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"Descriptive error detail message for debugging.","type":"string"},"moreInfo":{"type":"string","description":"Link to documentation to investigate further and finding support for error detail."}},"required":["type"]}}},"required":["status","type"]}}}},"trait_unauthorized_401":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"trait_restricted_403":{"description":"Access forbidden. The caller is not allowed to access this resource.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type, lower case with underscore eg validation_failure.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"}},"required":["status","type"]}}}},"trait_notFound_404":{"description":"The requested resource does not exist.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type, lower case with underscore eg validation_failure.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"}},"required":["status","type"]}}}},"trait_internal_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type, lower case with underscore eg validation_failure.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"},"details":{"description":"List of problems causing this error.","type":"array","items":{"title":"errorDetail","description":"Schema for specific error cause.","type":"object","properties":{"field":{"description":"A bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"Descriptive error detail message for debugging.","type":"string"},"moreInfo":{"type":"string","description":"Link to documentation to investigate further and finding support for error detail."}},"required":["type"]}}},"required":["status","type"]}}}}}},"paths":{"/coupon/{tenant}/coupons/{code}/redemptions/{id}":{"delete":{"summary":"Deleting a coupon redemption","tags":["Coupon Redemption"],"responses":{"204":{"description":"A redemption with the provided code has been successfully deleted.\n"},"400":{"$ref":"#/components/responses/trait_queryable_400"},"401":{"$ref":"#/components/responses/trait_unauthorized_401"},"403":{"$ref":"#/components/responses/trait_restricted_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"500":{"$ref":"#/components/responses/trait_internal_500"}},"description":"Deletes a previously created redemption.\n","operationId":"DELETE-coupon-remove-coupon-redemption"}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.emporix.io/api-references-1/readme/api-reference-10/coupon-redemption.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
