# Reward Points Management

## Retrieving reward points of all customers

> Retrieves a detailed summary of added and redeemed reward points for all customers of a given tenant. The tenant name is selected based on the access token. \
> \
> \*\*Note:\*\* Only employees are authorized to perform this action.<br>

```json
{"openapi":"3.0.0","info":{"title":"Reward Points Service","version":"0.0.1"},"tags":[{"name":"Reward Points Management"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["rewardspoints.rewardpoints_view"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"rewardspoints.rewardpoints_view":"Nedeed to view reward points information","rewardspoints.rewardpoints_manage":"Needed to manage reward points"}}}}},"schemas":{"customerSummaryBatchOut":{"title":"Collection of Summaries","type":"array","items":{"$ref":"#/components/schemas/pointsSummaryOut"}},"pointsSummaryOut":{"title":"pointsSummaryOut","type":"object","properties":{"customerId":{"type":"string","description":"Id of the customer to whom the points are assigned"},"activePoints":{"type":"integer","description":"Active points that can be redeemed"},"summary":{"$ref":"#/components/schemas/customerSummary"}}},"customerSummary":{"title":"customerSummary","type":"object","properties":{"addedPointsList":{"type":"array","items":{"$ref":"#/components/schemas/addedPoints"}},"redeemedPointsList":{"type":"array","items":{"$ref":"#/components/schemas/redeemedPoints"}}},"required":["addedPointsList"]},"addedPoints":{"title":"addedPoints","type":"object","properties":{"id":{"type":"string"},"reference-id":{"type":"string","description":"Order Id for which the points were created","nullable":true},"description":{"type":"string","description":"Auto-generated description"},"points":{"type":"integer","description":"Number of points added in the operation"},"createdAt":{"type":"string","format":"date-time"},"validUntil":{"format":"date-time","type":"string","description":"The date until when the points can be redeemed"},"allPointsAfterCreation":{"type":"integer","description":"Number of points after creation"},"usedPoints":{"type":"integer","description":"Number of points already used"},"usedWith":{"type":"array","items":{"type":"string"}}},"required":["points"]},"redeemedPoints":{"title":"redeemedPoints","type":"object","properties":{"id":{"type":"string","description":"Identifier of the redeemed points"},"description":{"type":"string","description":"A comment for the redeem operation"},"points":{"type":"integer","description":"The amount of the redeemed points"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the points were redeemed"},"allPointsAfterCreation":{"type":"integer","description":"Number of points after creation"}},"required":["points"]}},"responses":{"trait_unauthorized_401":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"trait_forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match required scopes.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"code":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"status":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type in the lower case with underscore format, for example: `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 a specific error cause","type":"string"}}},"required":["code","status"]}}}},"trait_internal_500":{"description":"Internal error","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"timestamp":{"description":"Timestamp when the error occurred.","type":"string"},"status":{"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"error":{"description":"Descriptive error message for debugging","type":"string"},"path":{"description":"Path of a resource that caused the error.","type":"string"}}}}}}}},"paths":{"/reward-points/summaryBatch":{"get":{"description":"Retrieves a detailed summary of added and redeemed reward points for all customers of a given tenant. The tenant name is selected based on the access token. \n\n**Note:** Only employees are authorized to perform this action.\n","operationId":"GET-reward-points-retrieve-rewards-summary","tags":["Reward Points Management"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/customerSummaryBatchOut"}}}},"401":{"$ref":"#/components/responses/trait_unauthorized_401"},"403":{"$ref":"#/components/responses/trait_forbidden_403"},"500":{"$ref":"#/components/responses/trait_internal_500"}},"parameters":[],"summary":"Retrieving reward points of all customers"}}}}
```

## Retrieving reward points of a customer

> Fetches the number of reward points for a particular customer of a given tenant. The tenant name is retrieved from the access token. \
> \
> \*\*Note:\*\* Only employees are authorized to perform this action.<br>

```json
{"openapi":"3.0.0","info":{"title":"Reward Points Service","version":"0.0.1"},"tags":[{"name":"Reward Points Management"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["rewardspoints.rewardpoints_view"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"rewardspoints.rewardpoints_view":"Nedeed to view reward points information","rewardspoints.rewardpoints_manage":"Needed to manage reward points"}}}}},"responses":{"trait_badRequest_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"},"title":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type in the lower case with underscore format, for example: `validation_failure`","type":"string"},"type":{"description":"Type of the error.","type":"string"},"instance":{"type":"string","description":"Resource link"},"detail":{"description":"Detailed information about the error.","type":"string"}}}}}},"trait_forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match required scopes.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"code":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"status":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type in the lower case with underscore format, for example: `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 a specific error cause","type":"string"}}},"required":["code","status"]}}}},"trait_internal_500":{"description":"Internal error","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"timestamp":{"description":"Timestamp when the error occurred.","type":"string"},"status":{"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"error":{"description":"Descriptive error message for debugging","type":"string"},"path":{"description":"Path of a resource that caused the error.","type":"string"}}}}}}}},"paths":{"/reward-points/customer/{customerId}":{"get":{"description":"Fetches the number of reward points for a particular customer of a given tenant. The tenant name is retrieved from the access token. \n\n**Note:** Only employees are authorized to perform this action.\n","operationId":"GET-reward-points-fetch-customer-reward-points","tags":["Reward Points Management"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"title":"pointsOut","type":"integer"}}}},"400":{"$ref":"#/components/responses/trait_badRequest_400"},"403":{"$ref":"#/components/responses/trait_forbidden_403"},"500":{"$ref":"#/components/responses/trait_internal_500"}},"parameters":[],"summary":"Retrieving reward points of a customer"}}}}
```

## Creating a new reward points entry for a customer

> Creates a new reward points entry for a particular customer of a given tenant. The tenant name is retrieved from the access token. <br>

```json
{"openapi":"3.0.0","info":{"title":"Reward Points Service","version":"0.0.1"},"tags":[{"name":"Reward Points Management"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["rewardspoints.rewardpoints_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"rewardspoints.rewardpoints_view":"Nedeed to view reward points information","rewardspoints.rewardpoints_manage":"Needed to manage reward points"}}}}},"responses":{"trait_badRequest_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"},"title":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type in the lower case with underscore format, for example: `validation_failure`","type":"string"},"type":{"description":"Type of the error.","type":"string"},"instance":{"type":"string","description":"Resource link"},"detail":{"description":"Detailed information about the error.","type":"string"}}}}}},"trait_unauthorized_401":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"trait_forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match required scopes.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"code":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"status":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type in the lower case with underscore format, for example: `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 a specific error cause","type":"string"}}},"required":["code","status"]}}}},"trait_conflict_409":{"description":"","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 in the lower case with underscore format, for example: `validation_failure`","type":"string"},"message":{"description":"Descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"Documentation link"},"details":{"description":"List of problems causing this error","type":"array","items":{"title":"errorDetail","description":"Schema for a specific error cause","type":"object","properties":{"field":{"description":"A bean notation expression specifying the element in request data that causes the error, for example: `product.variants[3].name`. This field can be empty if the violation was not field-specific","type":"string","nullable":true},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type with details, provided in the lower case with underscore format, for example: `missing_value`. This value must be always interpreted in context of the general error type.","type":"string","nullable":true},"message":{"description":"Detailed descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"Documentation link"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_internal_500":{"description":"Internal error","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"timestamp":{"description":"Timestamp when the error occurred.","type":"string"},"status":{"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"error":{"description":"Descriptive error message for debugging","type":"string"},"path":{"description":"Path of a resource that caused the error.","type":"string"}}}}}}},"parameters":{"siteCode":{"name":"siteCode","in":"query","required":false,"schema":{"type":"string","default":"main"},"description":"Site code, defined when a site is created."}},"schemas":{"newCustomerIn":{"type":"object","properties":{"customerId":{"type":"string"},"startPoints":{"$ref":"#/components/schemas/addedPoints"}},"description":""},"addedPoints":{"title":"addedPoints","type":"object","properties":{"id":{"type":"string"},"reference-id":{"type":"string","description":"Order Id for which the points were created","nullable":true},"description":{"type":"string","description":"Auto-generated description"},"points":{"type":"integer","description":"Number of points added in the operation"},"createdAt":{"type":"string","format":"date-time"},"validUntil":{"format":"date-time","type":"string","description":"The date until when the points can be redeemed"},"allPointsAfterCreation":{"type":"integer","description":"Number of points after creation"},"usedPoints":{"type":"integer","description":"Number of points already used"},"usedWith":{"type":"array","items":{"type":"string"}}},"required":["points"]}}},"paths":{"/reward-points/customer/{customerId}":{"post":{"description":"Creates a new reward points entry for a particular customer of a given tenant. The tenant name is retrieved from the access token. \n","operationId":"POST-reward-points-create-customer-reward-entry","tags":["Reward Points Management"],"responses":{"200":{"description":""},"400":{"$ref":"#/components/responses/trait_badRequest_400"},"401":{"$ref":"#/components/responses/trait_unauthorized_401"},"403":{"$ref":"#/components/responses/trait_forbidden_403"},"409":{"$ref":"#/components/responses/trait_conflict_409"},"500":{"$ref":"#/components/responses/trait_internal_500"}},"parameters":[{"$ref":"#/components/parameters/siteCode"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/newCustomerIn"}}},"description":""},"summary":"Creating a new reward points entry for a customer"}}}}
```

## Deleting reward points of a customer

> Deletes a reward points entry of a specified customer for a given tenant. The tenant name is retrieved from the access token.&#x20;

```json
{"openapi":"3.0.0","info":{"title":"Reward Points Service","version":"0.0.1"},"tags":[{"name":"Reward Points Management"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["rewardspoints.rewardpoints_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"rewardspoints.rewardpoints_view":"Nedeed to view reward points information","rewardspoints.rewardpoints_manage":"Needed to manage reward points"}}}}},"responses":{"trait_unauthorized_401":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"trait_forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match required scopes.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"code":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"status":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type in the lower case with underscore format, for example: `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 a specific error cause","type":"string"}}},"required":["code","status"]}}}},"trait_internal_500":{"description":"Internal error","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"timestamp":{"description":"Timestamp when the error occurred.","type":"string"},"status":{"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"error":{"description":"Descriptive error message for debugging","type":"string"},"path":{"description":"Path of a resource that caused the error.","type":"string"}}}}}}}},"paths":{"/reward-points/customer/{customerId}":{"delete":{"description":"Deletes a reward points entry of a specified customer for a given tenant. The tenant name is retrieved from the access token. ","operationId":"DELETE-reward-points-remove-customer-reward-entry","tags":["Reward Points Management"],"responses":{"200":{"description":""},"401":{"$ref":"#/components/responses/trait_unauthorized_401"},"403":{"$ref":"#/components/responses/trait_forbidden_403"},"500":{"$ref":"#/components/responses/trait_internal_500"}},"parameters":[],"summary":"Deleting reward points of a customer"}}}}
```

## Retrieving a reward points summary for a single customer

> Retrieves a detailed summary of added and redeemed reward points of a single specified customer for a given tenant. The tenant name is retrieved from the access token. \
> \
> \*\*Note:\*\* Only employees are authorized to perform this action.<br>

```json
{"openapi":"3.0.0","info":{"title":"Reward Points Service","version":"0.0.1"},"tags":[{"name":"Reward Points Management"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["rewardspoints.rewardpoints_view"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"rewardspoints.rewardpoints_view":"Nedeed to view reward points information","rewardspoints.rewardpoints_manage":"Needed to manage reward points"}}}}},"schemas":{"pointsSummaryOut":{"title":"pointsSummaryOut","type":"object","properties":{"customerId":{"type":"string","description":"Id of the customer to whom the points are assigned"},"activePoints":{"type":"integer","description":"Active points that can be redeemed"},"summary":{"$ref":"#/components/schemas/customerSummary"}}},"customerSummary":{"title":"customerSummary","type":"object","properties":{"addedPointsList":{"type":"array","items":{"$ref":"#/components/schemas/addedPoints"}},"redeemedPointsList":{"type":"array","items":{"$ref":"#/components/schemas/redeemedPoints"}}},"required":["addedPointsList"]},"addedPoints":{"title":"addedPoints","type":"object","properties":{"id":{"type":"string"},"reference-id":{"type":"string","description":"Order Id for which the points were created","nullable":true},"description":{"type":"string","description":"Auto-generated description"},"points":{"type":"integer","description":"Number of points added in the operation"},"createdAt":{"type":"string","format":"date-time"},"validUntil":{"format":"date-time","type":"string","description":"The date until when the points can be redeemed"},"allPointsAfterCreation":{"type":"integer","description":"Number of points after creation"},"usedPoints":{"type":"integer","description":"Number of points already used"},"usedWith":{"type":"array","items":{"type":"string"}}},"required":["points"]},"redeemedPoints":{"title":"redeemedPoints","type":"object","properties":{"id":{"type":"string","description":"Identifier of the redeemed points"},"description":{"type":"string","description":"A comment for the redeem operation"},"points":{"type":"integer","description":"The amount of the redeemed points"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the points were redeemed"},"allPointsAfterCreation":{"type":"integer","description":"Number of points after creation"}},"required":["points"]}},"responses":{"trait_unauthorized_401":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"trait_forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match required scopes.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"code":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"status":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type in the lower case with underscore format, for example: `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 a specific error cause","type":"string"}}},"required":["code","status"]}}}},"trait_notFound_404":{"description":"Entity not found.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"type":{"description":"Classification of the error type in the lower case with underscore format, for example: `validation_failure`","type":"string"},"status":{"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"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 a specific error cause","type":"string"}}}}}}},"trait_internal_500":{"description":"Internal error","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"timestamp":{"description":"Timestamp when the error occurred.","type":"string"},"status":{"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"error":{"description":"Descriptive error message for debugging","type":"string"},"path":{"description":"Path of a resource that caused the error.","type":"string"}}}}}}}},"paths":{"/reward-points/customer/{customerId}/summary":{"get":{"description":"Retrieves a detailed summary of added and redeemed reward points of a single specified customer for a given tenant. The tenant name is retrieved from the access token. \n\n**Note:** Only employees are authorized to perform this action.\n","operationId":"GET-reward-points-retrieve-customer-reward-summary","tags":["Reward Points Management"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/pointsSummaryOut"}}}},"401":{"$ref":"#/components/responses/trait_unauthorized_401"},"403":{"$ref":"#/components/responses/trait_forbidden_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"500":{"$ref":"#/components/responses/trait_internal_500"}},"parameters":[],"summary":"Retrieving a reward points summary for a single customer"}}}}
```

## Adding reward points for a customer

> Adds reward points to a specific customer's account for a given tenant. The tenant name is retrieved from the access token. \
> \
> \*\*Note:\*\* Only employees are authorized to perform this action.<br>

```json
{"openapi":"3.0.0","info":{"title":"Reward Points Service","version":"0.0.1"},"tags":[{"name":"Reward Points Management"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["rewardspoints.rewardpoints_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"rewardspoints.rewardpoints_view":"Nedeed to view reward points information","rewardspoints.rewardpoints_manage":"Needed to manage reward points"}}}}},"responses":{"trait_badRequest_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"},"title":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type in the lower case with underscore format, for example: `validation_failure`","type":"string"},"type":{"description":"Type of the error.","type":"string"},"instance":{"type":"string","description":"Resource link"},"detail":{"description":"Detailed information about the error.","type":"string"}}}}}},"trait_unauthorized_401":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"trait_forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match required scopes.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"code":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"status":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type in the lower case with underscore format, for example: `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 a specific error cause","type":"string"}}},"required":["code","status"]}}}},"trait_internal_500":{"description":"Internal error","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"timestamp":{"description":"Timestamp when the error occurred.","type":"string"},"status":{"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"error":{"description":"Descriptive error message for debugging","type":"string"},"path":{"description":"Path of a resource that caused the error.","type":"string"}}}}}}},"parameters":{"siteCode":{"name":"siteCode","in":"query","required":false,"schema":{"type":"string","default":"main"},"description":"Site code, defined when a site is created."}},"schemas":{"addedPoints":{"title":"addedPoints","type":"object","properties":{"id":{"type":"string"},"reference-id":{"type":"string","description":"Order Id for which the points were created","nullable":true},"description":{"type":"string","description":"Auto-generated description"},"points":{"type":"integer","description":"Number of points added in the operation"},"createdAt":{"type":"string","format":"date-time"},"validUntil":{"format":"date-time","type":"string","description":"The date until when the points can be redeemed"},"allPointsAfterCreation":{"type":"integer","description":"Number of points after creation"},"usedPoints":{"type":"integer","description":"Number of points already used"},"usedWith":{"type":"array","items":{"type":"string"}}},"required":["points"]}}},"paths":{"/reward-points/customer/{customerId}/addPoints":{"post":{"description":"Adds reward points to a specific customer's account for a given tenant. The tenant name is retrieved from the access token. \n\n**Note:** Only employees are authorized to perform this action.\n","operationId":"POST-reward-points-add-customer-reward-points","tags":["Reward Points Management"],"responses":{"201":{"description":""},"400":{"$ref":"#/components/responses/trait_badRequest_400"},"401":{"$ref":"#/components/responses/trait_unauthorized_401"},"403":{"$ref":"#/components/responses/trait_forbidden_403"},"500":{"$ref":"#/components/responses/trait_internal_500"}},"parameters":[{"$ref":"#/components/parameters/siteCode"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/addedPoints"}}}},"summary":"Adding reward points for a customer"}}}}
```

## Redeeming reward points of a customer

> Redeems reward points for a specified customer for a given tenant without generating a coupon. The tenant name is retrieved from the access token. \
> \
> \*\*Note:\*\* Only employees are authorized to perform this action.<br>

```json
{"openapi":"3.0.0","info":{"title":"Reward Points Service","version":"0.0.1"},"tags":[{"name":"Reward Points Management"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["rewardspoints.rewardpoints_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"rewardspoints.rewardpoints_view":"Nedeed to view reward points information","rewardspoints.rewardpoints_manage":"Needed to manage reward points"}}}}},"responses":{"trait_badRequest_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"},"title":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type in the lower case with underscore format, for example: `validation_failure`","type":"string"},"type":{"description":"Type of the error.","type":"string"},"instance":{"type":"string","description":"Resource link"},"detail":{"description":"Detailed information about the error.","type":"string"}}}}}},"trait_unauthorized_401":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"trait_forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match required scopes.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"code":{"minimum":100,"maximum":599,"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"status":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type in the lower case with underscore format, for example: `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 a specific error cause","type":"string"}}},"required":["code","status"]}}}},"trait_internal_500":{"description":"Internal error","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"timestamp":{"description":"Timestamp when the error occurred.","type":"string"},"status":{"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"error":{"description":"Descriptive error message for debugging","type":"string"},"path":{"description":"Path of a resource that caused the error.","type":"string"}}}}}}},"schemas":{"redeemedPoints":{"title":"redeemedPoints","type":"object","properties":{"id":{"type":"string","description":"Identifier of the redeemed points"},"description":{"type":"string","description":"A comment for the redeem operation"},"points":{"type":"integer","description":"The amount of the redeemed points"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the points were redeemed"},"allPointsAfterCreation":{"type":"integer","description":"Number of points after creation"}},"required":["points"]}}},"paths":{"/reward-points/customer/{customerId}/redeemPoints":{"post":{"description":"Redeems reward points for a specified customer for a given tenant without generating a coupon. The tenant name is retrieved from the access token. \n\n**Note:** Only employees are authorized to perform this action.\n","operationId":"POST-reward-points-redeem-customer-points","tags":["Reward Points Management"],"responses":{"201":{"description":""},"400":{"$ref":"#/components/responses/trait_badRequest_400"},"401":{"$ref":"#/components/responses/trait_unauthorized_401"},"403":{"$ref":"#/components/responses/trait_forbidden_403"},"500":{"$ref":"#/components/responses/trait_internal_500"}},"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/redeemedPoints"}}},"description":""},"summary":"Redeeming reward points of a customer"}}}}
```
