# Models

## The customerSummaryBatchOut object

```json
{"openapi":"3.0.0","info":{"title":"Reward Points Service","version":"0.0.1"},"components":{"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"]}}}}
```

## The pointsSummaryOut object

```json
{"openapi":"3.0.0","info":{"title":"Reward Points Service","version":"0.0.1"},"components":{"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"]}}}}
```

## The addedPoints object

```json
{"openapi":"3.0.0","info":{"title":"Reward Points Service","version":"0.0.1"},"components":{"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"]}}}}
```

## The redeemedPoints object

```json
{"openapi":"3.0.0","info":{"title":"Reward Points Service","version":"0.0.1"},"components":{"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"]}}}}
```

## The customerSummary object

```json
{"openapi":"3.0.0","info":{"title":"Reward Points Service","version":"0.0.1"},"components":{"schemas":{"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"]}}}}
```

## The redeemOptions object

```json
{"openapi":"3.0.0","info":{"title":"Reward Points Service","version":"0.0.1"},"components":{"schemas":{"redeemOptions":{"title":"redeemOptions","type":"array","items":{"$ref":"#/components/schemas/redeemOption"}},"redeemOption":{"title":"redeemOption","type":"object","properties":{"id":{"type":"string","description":"ID of the redemption option to be used at reward points exchange"},"type":{"type":"string","description":"Option type, typically 'coupon'."},"name":{"type":"string","description":"Name of the redeem option that can be presented to customer"},"description":{"type":"string","description":"Description of the redeem option that can be presented to customer"},"points":{"type":"integer","description":"Points to deduct from customer's account at coupon creation"},"coupon":{"$ref":"#/components/schemas/coupon"},"pointsAfterCoupon":{"type":"integer"},"metadata":{"type":"object","properties":{"version":{"type":"integer","description":"Version of the redeem option"},"createdAt":{"type":"string","description":"Timestamp when the redeem option has been created."},"modifiedAt":{"type":"string","description":"Timestamp when the redeem option has been modified."}}}},"required":["type","name","points"]},"coupon":{"title":"Coupon API","description":"Coupons describe voucher-like commerce capabilities.","type":"object","properties":{"code":{"description":"Coupon code, for example: WINTER-SALE, 10OFF (read-only)","type":"string"},"name":{"description":"Localized coupon name","type":"string"},"description":{"description":"Localized coupon description","type":"string"},"discountType":{"description":"'PERCENT' for relative values, 'ABSOLUTE' for float values referring to a specific currency, 'FREE_SHIPPING' for reducing the shipping cost to 0.","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"type":"string"},"discountPercentage":{"minimum":0,"maximum":100,"description":"Discount percentage within a range [0.00, 100.00]. Must be specified only if type is 'PERCENT'.","type":"number"},"discountAbsolute":{"title":"Money Amount","description":"Must be specified only if type is 'ABSOLUTE'","type":"object","properties":{"amount":{"default":0,"minimum":0,"description":"Total amount in the specified currency.","type":"number"},"currency":{"default":"USD","pattern":"^[a-zA-Z]{3}$","description":"ISO 4217 currency code, e.g.: USD, EUR, CHF","type":"string"}}},"allowAnonymous":{"default":false,"description":"Defines if the coupon can be redeemed by anonymous users","type":"boolean"},"maxRedemptions":{"default":-1,"description":"Maximum number of redemptions; -1 designates 'unlimited' (seller-only)","type":"number"},"maxRedemptionsPerCustomer":{"default":-1,"description":"Maximum number of redemptions per customer; -1 designates 'unlimited'. Cannot be specified for coupons which can be redeemed by anonymous users.","type":"number"},"restrictions":{"$ref":"#/components/schemas/restrictions"},"issuedTo":{"description":"Id of the customer who originally received the coupon (seller-only).","type":"string"},"redemptionCount":{"description":"The number of times a specific coupon has been redeemed. Read-only, set through server. (seller-only)","type":"number"},"status":{"description":"Current status of the coupon (read-only). 'INACTIVE': the coupon is only valid in the future; 'VALID': can be used; 'EXPIRED': the coupon validity period has expired; 'USED': the maximum number of redemptions for the coupon has been reached.","enum":["INACTIVE","VALID","EXPIRED","USED"],"type":"string"},"links":{"description":"Hypermedia reference to coupon actions (read-only, customer-only)","type":"array","items":{"description":"Hypermedia reference to a resource","type":"object","properties":{"rel":{"description":"Link relation type","type":"string"},"title":{"description":"Link title","type":"string"},"href":{"description":"Target URI of the link","type":"string"},"type":{"description":"Content type of the referenced resource","type":"string"}},"required":["rel","title","href","type"]}},"deleted":{"description":"Flag to mark a coupon as deleted (a.k.a. Soft delete). It is a read-only and seller-only attribute","type":"boolean"}},"required":["name","discountType"]},"restrictions":{"title":"Restrictions","type":"object","properties":{"validFor":{"default":[],"description":"A list of identifiers of customers that can redeem the coupon. Cannot be specified for coupons which can be redeemed by anonymous users.","type":"array","items":{"type":"string"}},"validFrom":{"format":"date-time","type":"string","description":"Must be provided in the ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'"},"validUntil":{"format":"date-time","type":"string","description":"Must be provided in the ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'"},"minOrderValue":{"title":"Money Amount","description":"Minimum order value which entitles the customer to redeem the coupon","type":"object","properties":{"amount":{"default":0,"minimum":0,"description":"Total amount in the specified currency","type":"number"},"currency":{"default":"USD","pattern":"^[a-zA-Z]{3}$","description":"ISO 4217 currency code, e.g.: USD, EUR, CHF","type":"string"}}}}}}}}
```

## The redeemOption object

```json
{"openapi":"3.0.0","info":{"title":"Reward Points Service","version":"0.0.1"},"components":{"schemas":{"redeemOption":{"title":"redeemOption","type":"object","properties":{"id":{"type":"string","description":"ID of the redemption option to be used at reward points exchange"},"type":{"type":"string","description":"Option type, typically 'coupon'."},"name":{"type":"string","description":"Name of the redeem option that can be presented to customer"},"description":{"type":"string","description":"Description of the redeem option that can be presented to customer"},"points":{"type":"integer","description":"Points to deduct from customer's account at coupon creation"},"coupon":{"$ref":"#/components/schemas/coupon"},"pointsAfterCoupon":{"type":"integer"},"metadata":{"type":"object","properties":{"version":{"type":"integer","description":"Version of the redeem option"},"createdAt":{"type":"string","description":"Timestamp when the redeem option has been created."},"modifiedAt":{"type":"string","description":"Timestamp when the redeem option has been modified."}}}},"required":["type","name","points"]},"coupon":{"title":"Coupon API","description":"Coupons describe voucher-like commerce capabilities.","type":"object","properties":{"code":{"description":"Coupon code, for example: WINTER-SALE, 10OFF (read-only)","type":"string"},"name":{"description":"Localized coupon name","type":"string"},"description":{"description":"Localized coupon description","type":"string"},"discountType":{"description":"'PERCENT' for relative values, 'ABSOLUTE' for float values referring to a specific currency, 'FREE_SHIPPING' for reducing the shipping cost to 0.","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"type":"string"},"discountPercentage":{"minimum":0,"maximum":100,"description":"Discount percentage within a range [0.00, 100.00]. Must be specified only if type is 'PERCENT'.","type":"number"},"discountAbsolute":{"title":"Money Amount","description":"Must be specified only if type is 'ABSOLUTE'","type":"object","properties":{"amount":{"default":0,"minimum":0,"description":"Total amount in the specified currency.","type":"number"},"currency":{"default":"USD","pattern":"^[a-zA-Z]{3}$","description":"ISO 4217 currency code, e.g.: USD, EUR, CHF","type":"string"}}},"allowAnonymous":{"default":false,"description":"Defines if the coupon can be redeemed by anonymous users","type":"boolean"},"maxRedemptions":{"default":-1,"description":"Maximum number of redemptions; -1 designates 'unlimited' (seller-only)","type":"number"},"maxRedemptionsPerCustomer":{"default":-1,"description":"Maximum number of redemptions per customer; -1 designates 'unlimited'. Cannot be specified for coupons which can be redeemed by anonymous users.","type":"number"},"restrictions":{"$ref":"#/components/schemas/restrictions"},"issuedTo":{"description":"Id of the customer who originally received the coupon (seller-only).","type":"string"},"redemptionCount":{"description":"The number of times a specific coupon has been redeemed. Read-only, set through server. (seller-only)","type":"number"},"status":{"description":"Current status of the coupon (read-only). 'INACTIVE': the coupon is only valid in the future; 'VALID': can be used; 'EXPIRED': the coupon validity period has expired; 'USED': the maximum number of redemptions for the coupon has been reached.","enum":["INACTIVE","VALID","EXPIRED","USED"],"type":"string"},"links":{"description":"Hypermedia reference to coupon actions (read-only, customer-only)","type":"array","items":{"description":"Hypermedia reference to a resource","type":"object","properties":{"rel":{"description":"Link relation type","type":"string"},"title":{"description":"Link title","type":"string"},"href":{"description":"Target URI of the link","type":"string"},"type":{"description":"Content type of the referenced resource","type":"string"}},"required":["rel","title","href","type"]}},"deleted":{"description":"Flag to mark a coupon as deleted (a.k.a. Soft delete). It is a read-only and seller-only attribute","type":"boolean"}},"required":["name","discountType"]},"restrictions":{"title":"Restrictions","type":"object","properties":{"validFor":{"default":[],"description":"A list of identifiers of customers that can redeem the coupon. Cannot be specified for coupons which can be redeemed by anonymous users.","type":"array","items":{"type":"string"}},"validFrom":{"format":"date-time","type":"string","description":"Must be provided in the ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'"},"validUntil":{"format":"date-time","type":"string","description":"Must be provided in the ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'"},"minOrderValue":{"title":"Money Amount","description":"Minimum order value which entitles the customer to redeem the coupon","type":"object","properties":{"amount":{"default":0,"minimum":0,"description":"Total amount in the specified currency","type":"number"},"currency":{"default":"USD","pattern":"^[a-zA-Z]{3}$","description":"ISO 4217 currency code, e.g.: USD, EUR, CHF","type":"string"}}}}}}}}
```

## The redeemCouponOut object

```json
{"openapi":"3.0.0","info":{"title":"Reward Points Service","version":"0.0.1"},"components":{"schemas":{"redeemCouponOut":{"title":"CouponCode","type":"object","properties":{"code":{"type":"string","description":"Coupon code received after exchanging points"}}}}}}
```

## The coupon object

```json
{"openapi":"3.0.0","info":{"title":"Reward Points Service","version":"0.0.1"},"components":{"schemas":{"coupon":{"title":"Coupon API","description":"Coupons describe voucher-like commerce capabilities.","type":"object","properties":{"code":{"description":"Coupon code, for example: WINTER-SALE, 10OFF (read-only)","type":"string"},"name":{"description":"Localized coupon name","type":"string"},"description":{"description":"Localized coupon description","type":"string"},"discountType":{"description":"'PERCENT' for relative values, 'ABSOLUTE' for float values referring to a specific currency, 'FREE_SHIPPING' for reducing the shipping cost to 0.","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"type":"string"},"discountPercentage":{"minimum":0,"maximum":100,"description":"Discount percentage within a range [0.00, 100.00]. Must be specified only if type is 'PERCENT'.","type":"number"},"discountAbsolute":{"title":"Money Amount","description":"Must be specified only if type is 'ABSOLUTE'","type":"object","properties":{"amount":{"default":0,"minimum":0,"description":"Total amount in the specified currency.","type":"number"},"currency":{"default":"USD","pattern":"^[a-zA-Z]{3}$","description":"ISO 4217 currency code, e.g.: USD, EUR, CHF","type":"string"}}},"allowAnonymous":{"default":false,"description":"Defines if the coupon can be redeemed by anonymous users","type":"boolean"},"maxRedemptions":{"default":-1,"description":"Maximum number of redemptions; -1 designates 'unlimited' (seller-only)","type":"number"},"maxRedemptionsPerCustomer":{"default":-1,"description":"Maximum number of redemptions per customer; -1 designates 'unlimited'. Cannot be specified for coupons which can be redeemed by anonymous users.","type":"number"},"restrictions":{"$ref":"#/components/schemas/restrictions"},"issuedTo":{"description":"Id of the customer who originally received the coupon (seller-only).","type":"string"},"redemptionCount":{"description":"The number of times a specific coupon has been redeemed. Read-only, set through server. (seller-only)","type":"number"},"status":{"description":"Current status of the coupon (read-only). 'INACTIVE': the coupon is only valid in the future; 'VALID': can be used; 'EXPIRED': the coupon validity period has expired; 'USED': the maximum number of redemptions for the coupon has been reached.","enum":["INACTIVE","VALID","EXPIRED","USED"],"type":"string"},"links":{"description":"Hypermedia reference to coupon actions (read-only, customer-only)","type":"array","items":{"description":"Hypermedia reference to a resource","type":"object","properties":{"rel":{"description":"Link relation type","type":"string"},"title":{"description":"Link title","type":"string"},"href":{"description":"Target URI of the link","type":"string"},"type":{"description":"Content type of the referenced resource","type":"string"}},"required":["rel","title","href","type"]}},"deleted":{"description":"Flag to mark a coupon as deleted (a.k.a. Soft delete). It is a read-only and seller-only attribute","type":"boolean"}},"required":["name","discountType"]},"restrictions":{"title":"Restrictions","type":"object","properties":{"validFor":{"default":[],"description":"A list of identifiers of customers that can redeem the coupon. Cannot be specified for coupons which can be redeemed by anonymous users.","type":"array","items":{"type":"string"}},"validFrom":{"format":"date-time","type":"string","description":"Must be provided in the ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'"},"validUntil":{"format":"date-time","type":"string","description":"Must be provided in the ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'"},"minOrderValue":{"title":"Money Amount","description":"Minimum order value which entitles the customer to redeem the coupon","type":"object","properties":{"amount":{"default":0,"minimum":0,"description":"Total amount in the specified currency","type":"number"},"currency":{"default":"USD","pattern":"^[a-zA-Z]{3}$","description":"ISO 4217 currency code, e.g.: USD, EUR, CHF","type":"string"}}}}}}}}
```

## The newCustomerIn object

```json
{"openapi":"3.0.0","info":{"title":"Reward Points Service","version":"0.0.1"},"components":{"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"]}}}}
```

## The restrictions object

```json
{"openapi":"3.0.0","info":{"title":"Reward Points Service","version":"0.0.1"},"components":{"schemas":{"restrictions":{"title":"Restrictions","type":"object","properties":{"validFor":{"default":[],"description":"A list of identifiers of customers that can redeem the coupon. Cannot be specified for coupons which can be redeemed by anonymous users.","type":"array","items":{"type":"string"}},"validFrom":{"format":"date-time","type":"string","description":"Must be provided in the ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'"},"validUntil":{"format":"date-time","type":"string","description":"Must be provided in the ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'"},"minOrderValue":{"title":"Money Amount","description":"Minimum order value which entitles the customer to redeem the coupon","type":"object","properties":{"amount":{"default":0,"minimum":0,"description":"Total amount in the specified currency","type":"number"},"currency":{"default":"USD","pattern":"^[a-zA-Z]{3}$","description":"ISO 4217 currency code, e.g.: USD, EUR, CHF","type":"string"}}}}}}}}
```
