# Models

## The coupons object

```json
{"openapi":"3.0.0","info":{"title":"Coupon Service","version":"0.0.1"},"components":{"schemas":{"coupons":{"type":"array","items":{"$ref":"#/components/schemas/coupon-with-id-and-status"}},"coupon-with-id-and-status":{"allOf":[{"$ref":"#/components/schemas/coupon"},{"type":"object","properties":{"code":{"type":"string","description":"e.g.: WINTER-SALE, 10OFF (read-only)."},"referralCoupon":{"$ref":"#/components/schemas/referralCouponProperty"},"status":{"type":"string","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":["VALID","INACTIVE","EXPIRED","USED"]}}}]},"coupon":{"allOf":[{"$ref":"#/components/schemas/base-coupon"},{"type":"object","properties":{"legalEntityRedemptions":{"type":"array","items":{"type":"object","properties":{"legalEntityId":{"type":"string","description":"The id of the legal entity to which customer is assigned."},"count":{"type":"number","description":"The number of times a specific coupon has been redeemed in the context of the given legal entity."}}}},"redemptionCount":{"type":"number","description":"The number of times a specific coupon has been redeemed. Read-only, set through server. (seller-only)."},"referralCoupon":{"$ref":"#/components/schemas/referralCouponProperty"},"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"]}]},"base-coupon":{"title":"Coupon response/update payload","description":"Coupons describe voucher alike commerce capabilities, e.g. 10% off winter accessories.","type":"object","properties":{"name":{"type":"string","description":"Coupon name."},"description":{"type":"string","description":"Coupon description."},"discountType":{"enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"'PERCENT' for relative values, 'ABSOLUTE' for float values, referring to a specific currency, 'FREE_SHIPPING' for reducing the shipping cost to 0.","type":"string"},"discountPercentage":{"type":"number","description":"A discount percentage within the range [0.00, 100.00]. Must be specified only if type is 'PERCENT'.","minimum":0,"maximum":100},"discountAbsolute":{"type":"object","description":"Must be specified only if type is 'ABSOLUTE'. Defines the amount that should be substracted from the cart subtotal.","properties":{"amount":{"type":"number","description":"Total amount in the specified currency."},"currency":{"type":"string","description":"ISO 4217 currency code, e.g.: USD, EUR, CHF."}}},"allowAnonymous":{"type":"boolean","description":"Specifies if the coupon can be redeemed by anonymous user. If set to false, only logged-in customers can redeem it.","default":false},"maxRedemptions":{"type":"number","description":"Maximum number of redemptions; -1  designates 'unlimited' (seller-only).","default":-1},"maxRedemptionsPerCustomer":{"type":"number","description":"Maximum number of redemptions per customer; -1 designates 'unlimited'. Cannot be specified for coupons which can be redeemed by anonymous users.","default":-1},"discountCalculationType":{"type":"string","enum":["TOTAL","SUBTOTAL"],"description":"Determines whether the coupon is applied to the total or subtotal value of the order.","default":"SUBTOTAL"},"categoryRestricted":{"$ref":"#/components/schemas/categoryRestricted"},"segmentRestricted":{"$ref":"#/components/schemas/segmentRestricted"},"restrictions":{"$ref":"#/components/schemas/restrictions"},"issuedTo":{"type":"string","description":"The Id of the customer who originally received the coupon (seller-only)."},"mixins":{"type":"object","description":"The field contains mixins values.","additionalProperties":true},"metadata":{"type":"object","additionalProperties":false,"properties":{"version":{"description":"Version of the document. Set to 0 after creating a document. Increments by 1 after every update.","type":"number"},"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":{"type":"string"}}}}}},"categoryRestricted":{"type":"boolean","description":"Defines if the coupon has category restrictions.\n***\nInfo: Cannot be combined together with the segment restrictions.\n","default":false},"segmentRestricted":{"type":"boolean","description":"Defines if the coupon has segment restrictions. If the value is set to `true`, the `restrictions.segments` must be provided.\n***\nInfo: Cannot be combined neither with the category restrictions nor with customers restrictions.\n","default":false},"restrictions":{"type":"object","description":"Restrictions of the coupon.","properties":{"validFor":{"type":"array","description":"A list of customer identifiers for whom the coupon can be redeemed. Cannot be specified for coupons which can be redeemed by anonymous users.","items":{"type":"string"}},"validFrom":{"type":"string","format":"date-time","description":"Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'."},"validUntil":{"type":"string","format":"date-time","description":"Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'."},"minOrderValue":{"$ref":"#/components/schemas/currency-amount"},"includedCategories":{"type":"array","description":"The list of product's categories to which this coupon applies to. Must be defined only if the `categoryRestricted` flag is set to true. Must be disjoint with excludedCategories list.","items":{"type":"string"}},"excludedCategories":{"type":"array","description":"The list of product's categories to which this coupon does not apply to. Can be defined only if the `categoryRestricted` flag is set to true. Must be disjoint with includedCategories list.","items":{"type":"string"}},"segments":{"type":"array","description":"The list of segments to which this coupon applies to. Can be defined only if the `segmentRestricted` flag is set to true.","items":{"type":"string"}}}},"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."}}},"referralCouponProperty":{"type":"boolean","description":"Indicates if the coupon is type of referral coupon. This property is read only."}}}}
```

## The base-coupon object

```json
{"openapi":"3.0.0","info":{"title":"Coupon Service","version":"0.0.1"},"components":{"schemas":{"base-coupon":{"title":"Coupon response/update payload","description":"Coupons describe voucher alike commerce capabilities, e.g. 10% off winter accessories.","type":"object","properties":{"name":{"type":"string","description":"Coupon name."},"description":{"type":"string","description":"Coupon description."},"discountType":{"enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"'PERCENT' for relative values, 'ABSOLUTE' for float values, referring to a specific currency, 'FREE_SHIPPING' for reducing the shipping cost to 0.","type":"string"},"discountPercentage":{"type":"number","description":"A discount percentage within the range [0.00, 100.00]. Must be specified only if type is 'PERCENT'.","minimum":0,"maximum":100},"discountAbsolute":{"type":"object","description":"Must be specified only if type is 'ABSOLUTE'. Defines the amount that should be substracted from the cart subtotal.","properties":{"amount":{"type":"number","description":"Total amount in the specified currency."},"currency":{"type":"string","description":"ISO 4217 currency code, e.g.: USD, EUR, CHF."}}},"allowAnonymous":{"type":"boolean","description":"Specifies if the coupon can be redeemed by anonymous user. If set to false, only logged-in customers can redeem it.","default":false},"maxRedemptions":{"type":"number","description":"Maximum number of redemptions; -1  designates 'unlimited' (seller-only).","default":-1},"maxRedemptionsPerCustomer":{"type":"number","description":"Maximum number of redemptions per customer; -1 designates 'unlimited'. Cannot be specified for coupons which can be redeemed by anonymous users.","default":-1},"discountCalculationType":{"type":"string","enum":["TOTAL","SUBTOTAL"],"description":"Determines whether the coupon is applied to the total or subtotal value of the order.","default":"SUBTOTAL"},"categoryRestricted":{"$ref":"#/components/schemas/categoryRestricted"},"segmentRestricted":{"$ref":"#/components/schemas/segmentRestricted"},"restrictions":{"$ref":"#/components/schemas/restrictions"},"issuedTo":{"type":"string","description":"The Id of the customer who originally received the coupon (seller-only)."},"mixins":{"type":"object","description":"The field contains mixins values.","additionalProperties":true},"metadata":{"type":"object","additionalProperties":false,"properties":{"version":{"description":"Version of the document. Set to 0 after creating a document. Increments by 1 after every update.","type":"number"},"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":{"type":"string"}}}}}},"categoryRestricted":{"type":"boolean","description":"Defines if the coupon has category restrictions.\n***\nInfo: Cannot be combined together with the segment restrictions.\n","default":false},"segmentRestricted":{"type":"boolean","description":"Defines if the coupon has segment restrictions. If the value is set to `true`, the `restrictions.segments` must be provided.\n***\nInfo: Cannot be combined neither with the category restrictions nor with customers restrictions.\n","default":false},"restrictions":{"type":"object","description":"Restrictions of the coupon.","properties":{"validFor":{"type":"array","description":"A list of customer identifiers for whom the coupon can be redeemed. Cannot be specified for coupons which can be redeemed by anonymous users.","items":{"type":"string"}},"validFrom":{"type":"string","format":"date-time","description":"Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'."},"validUntil":{"type":"string","format":"date-time","description":"Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'."},"minOrderValue":{"$ref":"#/components/schemas/currency-amount"},"includedCategories":{"type":"array","description":"The list of product's categories to which this coupon applies to. Must be defined only if the `categoryRestricted` flag is set to true. Must be disjoint with excludedCategories list.","items":{"type":"string"}},"excludedCategories":{"type":"array","description":"The list of product's categories to which this coupon does not apply to. Can be defined only if the `categoryRestricted` flag is set to true. Must be disjoint with includedCategories list.","items":{"type":"string"}},"segments":{"type":"array","description":"The list of segments to which this coupon applies to. Can be defined only if the `segmentRestricted` flag is set to true.","items":{"type":"string"}}}},"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."}}}}}}
```

## The coupon object

```json
{"openapi":"3.0.0","info":{"title":"Coupon Service","version":"0.0.1"},"components":{"schemas":{"coupon":{"allOf":[{"$ref":"#/components/schemas/base-coupon"},{"type":"object","properties":{"legalEntityRedemptions":{"type":"array","items":{"type":"object","properties":{"legalEntityId":{"type":"string","description":"The id of the legal entity to which customer is assigned."},"count":{"type":"number","description":"The number of times a specific coupon has been redeemed in the context of the given legal entity."}}}},"redemptionCount":{"type":"number","description":"The number of times a specific coupon has been redeemed. Read-only, set through server. (seller-only)."},"referralCoupon":{"$ref":"#/components/schemas/referralCouponProperty"},"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"]}]},"base-coupon":{"title":"Coupon response/update payload","description":"Coupons describe voucher alike commerce capabilities, e.g. 10% off winter accessories.","type":"object","properties":{"name":{"type":"string","description":"Coupon name."},"description":{"type":"string","description":"Coupon description."},"discountType":{"enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"'PERCENT' for relative values, 'ABSOLUTE' for float values, referring to a specific currency, 'FREE_SHIPPING' for reducing the shipping cost to 0.","type":"string"},"discountPercentage":{"type":"number","description":"A discount percentage within the range [0.00, 100.00]. Must be specified only if type is 'PERCENT'.","minimum":0,"maximum":100},"discountAbsolute":{"type":"object","description":"Must be specified only if type is 'ABSOLUTE'. Defines the amount that should be substracted from the cart subtotal.","properties":{"amount":{"type":"number","description":"Total amount in the specified currency."},"currency":{"type":"string","description":"ISO 4217 currency code, e.g.: USD, EUR, CHF."}}},"allowAnonymous":{"type":"boolean","description":"Specifies if the coupon can be redeemed by anonymous user. If set to false, only logged-in customers can redeem it.","default":false},"maxRedemptions":{"type":"number","description":"Maximum number of redemptions; -1  designates 'unlimited' (seller-only).","default":-1},"maxRedemptionsPerCustomer":{"type":"number","description":"Maximum number of redemptions per customer; -1 designates 'unlimited'. Cannot be specified for coupons which can be redeemed by anonymous users.","default":-1},"discountCalculationType":{"type":"string","enum":["TOTAL","SUBTOTAL"],"description":"Determines whether the coupon is applied to the total or subtotal value of the order.","default":"SUBTOTAL"},"categoryRestricted":{"$ref":"#/components/schemas/categoryRestricted"},"segmentRestricted":{"$ref":"#/components/schemas/segmentRestricted"},"restrictions":{"$ref":"#/components/schemas/restrictions"},"issuedTo":{"type":"string","description":"The Id of the customer who originally received the coupon (seller-only)."},"mixins":{"type":"object","description":"The field contains mixins values.","additionalProperties":true},"metadata":{"type":"object","additionalProperties":false,"properties":{"version":{"description":"Version of the document. Set to 0 after creating a document. Increments by 1 after every update.","type":"number"},"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":{"type":"string"}}}}}},"categoryRestricted":{"type":"boolean","description":"Defines if the coupon has category restrictions.\n***\nInfo: Cannot be combined together with the segment restrictions.\n","default":false},"segmentRestricted":{"type":"boolean","description":"Defines if the coupon has segment restrictions. If the value is set to `true`, the `restrictions.segments` must be provided.\n***\nInfo: Cannot be combined neither with the category restrictions nor with customers restrictions.\n","default":false},"restrictions":{"type":"object","description":"Restrictions of the coupon.","properties":{"validFor":{"type":"array","description":"A list of customer identifiers for whom the coupon can be redeemed. Cannot be specified for coupons which can be redeemed by anonymous users.","items":{"type":"string"}},"validFrom":{"type":"string","format":"date-time","description":"Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'."},"validUntil":{"type":"string","format":"date-time","description":"Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'."},"minOrderValue":{"$ref":"#/components/schemas/currency-amount"},"includedCategories":{"type":"array","description":"The list of product's categories to which this coupon applies to. Must be defined only if the `categoryRestricted` flag is set to true. Must be disjoint with excludedCategories list.","items":{"type":"string"}},"excludedCategories":{"type":"array","description":"The list of product's categories to which this coupon does not apply to. Can be defined only if the `categoryRestricted` flag is set to true. Must be disjoint with includedCategories list.","items":{"type":"string"}},"segments":{"type":"array","description":"The list of segments to which this coupon applies to. Can be defined only if the `segmentRestricted` flag is set to true.","items":{"type":"string"}}}},"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."}}},"referralCouponProperty":{"type":"boolean","description":"Indicates if the coupon is type of referral coupon. This property is read only."}}}}
```

## The coupon-creation object

```json
{"openapi":"3.0.0","info":{"title":"Coupon Service","version":"0.0.1"},"components":{"schemas":{"coupon-creation":{"title":"Coupon creation payload","description":"Coupon creation schema.","type":"object","properties":{"code":{"type":"string","description":"e.g.: WINTER-SALE, 10OFF. If not provided, a code will be auto generated."},"name":{"type":"string","description":"Coupon name."},"description":{"type":"string","description":"Coupon description."},"discountType":{"enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"default":"ABSOLUTE","description":"'PERCENT' for relative values, 'ABSOLUTE' for float values, referring to a specific currency, 'FREE_SHIPPING' for reducing the shipping cost to 0.","type":"string"},"discountPercentage":{"type":"number","description":"A discount percentage within the range [0.00, 100.00]. Must be specified only if type is 'PERCENT'.","minimum":0,"maximum":100},"discountAbsolute":{"allOf":[{"$ref":"#/components/schemas/currency-amount"},{"description":"Must be specified only if type is 'ABSOLUTE'. Defines the amount that should be substracted from the cart subtotal."}]},"allowAnonymous":{"type":"boolean","description":"Specifies if the coupon can be redeemed by anonymous user. If set to false, only logged-in customers can redeem it.","default":false},"maxRedemptions":{"type":"number","description":"Maximum number of redemptions; -1 designates 'unlimited' (seller-only).","default":-1},"maxRedemptionsPerCustomer":{"type":"number","description":"Maximum number of redemptions per customer; -1 designates 'unlimited'. Cannot be specified for coupons which can be redeemed by anonymous users.","default":-1},"discountCalculationType":{"type":"string","enum":["TOTAL","SUBTOTAL"],"description":"Determines whether the coupon is applied to the total or subtotal value of the order.","default":"SUBTOTAL"},"categoryRestricted":{"$ref":"#/components/schemas/categoryRestricted"},"segmentRestricted":{"$ref":"#/components/schemas/segmentRestricted"},"restrictions":{"$ref":"#/components/schemas/restrictions"},"issuedTo":{"type":"string","description":"The Id of the customer who originally received the coupon (seller-only)."},"mixins":{"type":"object","description":"The field contains mixins values.","additionalProperties":true},"metadata":{"type":"object","additionalProperties":false,"properties":{"version":{"description":"Version of the document. Set to 0 after creating a document. Increments by 1 after every update.","type":"number"},"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":{"type":"string"}}}}},"required":["name"]},"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."}}},"categoryRestricted":{"type":"boolean","description":"Defines if the coupon has category restrictions.\n***\nInfo: Cannot be combined together with the segment restrictions.\n","default":false},"segmentRestricted":{"type":"boolean","description":"Defines if the coupon has segment restrictions. If the value is set to `true`, the `restrictions.segments` must be provided.\n***\nInfo: Cannot be combined neither with the category restrictions nor with customers restrictions.\n","default":false},"restrictions":{"type":"object","description":"Restrictions of the coupon.","properties":{"validFor":{"type":"array","description":"A list of customer identifiers for whom the coupon can be redeemed. Cannot be specified for coupons which can be redeemed by anonymous users.","items":{"type":"string"}},"validFrom":{"type":"string","format":"date-time","description":"Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'."},"validUntil":{"type":"string","format":"date-time","description":"Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'."},"minOrderValue":{"$ref":"#/components/schemas/currency-amount"},"includedCategories":{"type":"array","description":"The list of product's categories to which this coupon applies to. Must be defined only if the `categoryRestricted` flag is set to true. Must be disjoint with excludedCategories list.","items":{"type":"string"}},"excludedCategories":{"type":"array","description":"The list of product's categories to which this coupon does not apply to. Can be defined only if the `categoryRestricted` flag is set to true. Must be disjoint with includedCategories list.","items":{"type":"string"}},"segments":{"type":"array","description":"The list of segments to which this coupon applies to. Can be defined only if the `segmentRestricted` flag is set to true.","items":{"type":"string"}}}}}}}
```

## The segmentRestricted object

```json
{"openapi":"3.0.0","info":{"title":"Coupon Service","version":"0.0.1"},"components":{"schemas":{"segmentRestricted":{"type":"boolean","description":"Defines if the coupon has segment restrictions. If the value is set to `true`, the `restrictions.segments` must be provided.\n***\nInfo: Cannot be combined neither with the category restrictions nor with customers restrictions.\n","default":false}}}}
```

## The categoryRestricted object

```json
{"openapi":"3.0.0","info":{"title":"Coupon Service","version":"0.0.1"},"components":{"schemas":{"categoryRestricted":{"type":"boolean","description":"Defines if the coupon has category restrictions.\n***\nInfo: Cannot be combined together with the segment restrictions.\n","default":false}}}}
```

## The currency-amount object

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

## The redemptions object

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

## The redemption object

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

## The redemption-creation object

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

## The restrictions object

```json
{"openapi":"3.0.0","info":{"title":"Coupon Service","version":"0.0.1"},"components":{"schemas":{"restrictions":{"type":"object","description":"Restrictions of the coupon.","properties":{"validFor":{"type":"array","description":"A list of customer identifiers for whom the coupon can be redeemed. Cannot be specified for coupons which can be redeemed by anonymous users.","items":{"type":"string"}},"validFrom":{"type":"string","format":"date-time","description":"Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'."},"validUntil":{"type":"string","format":"date-time","description":"Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'."},"minOrderValue":{"$ref":"#/components/schemas/currency-amount"},"includedCategories":{"type":"array","description":"The list of product's categories to which this coupon applies to. Must be defined only if the `categoryRestricted` flag is set to true. Must be disjoint with excludedCategories list.","items":{"type":"string"}},"excludedCategories":{"type":"array","description":"The list of product's categories to which this coupon does not apply to. Can be defined only if the `categoryRestricted` flag is set to true. Must be disjoint with includedCategories list.","items":{"type":"string"}},"segments":{"type":"array","description":"The list of segments to which this coupon applies to. Can be defined only if the `segmentRestricted` flag is set to true.","items":{"type":"string"}}}},"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."}}}}}}
```

## The resource-location object

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

## The coupon-with-id-and-status object

```json
{"openapi":"3.0.0","info":{"title":"Coupon Service","version":"0.0.1"},"components":{"schemas":{"coupon-with-id-and-status":{"allOf":[{"$ref":"#/components/schemas/coupon"},{"type":"object","properties":{"code":{"type":"string","description":"e.g.: WINTER-SALE, 10OFF (read-only)."},"referralCoupon":{"$ref":"#/components/schemas/referralCouponProperty"},"status":{"type":"string","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":["VALID","INACTIVE","EXPIRED","USED"]}}}]},"coupon":{"allOf":[{"$ref":"#/components/schemas/base-coupon"},{"type":"object","properties":{"legalEntityRedemptions":{"type":"array","items":{"type":"object","properties":{"legalEntityId":{"type":"string","description":"The id of the legal entity to which customer is assigned."},"count":{"type":"number","description":"The number of times a specific coupon has been redeemed in the context of the given legal entity."}}}},"redemptionCount":{"type":"number","description":"The number of times a specific coupon has been redeemed. Read-only, set through server. (seller-only)."},"referralCoupon":{"$ref":"#/components/schemas/referralCouponProperty"},"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"]}]},"base-coupon":{"title":"Coupon response/update payload","description":"Coupons describe voucher alike commerce capabilities, e.g. 10% off winter accessories.","type":"object","properties":{"name":{"type":"string","description":"Coupon name."},"description":{"type":"string","description":"Coupon description."},"discountType":{"enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"'PERCENT' for relative values, 'ABSOLUTE' for float values, referring to a specific currency, 'FREE_SHIPPING' for reducing the shipping cost to 0.","type":"string"},"discountPercentage":{"type":"number","description":"A discount percentage within the range [0.00, 100.00]. Must be specified only if type is 'PERCENT'.","minimum":0,"maximum":100},"discountAbsolute":{"type":"object","description":"Must be specified only if type is 'ABSOLUTE'. Defines the amount that should be substracted from the cart subtotal.","properties":{"amount":{"type":"number","description":"Total amount in the specified currency."},"currency":{"type":"string","description":"ISO 4217 currency code, e.g.: USD, EUR, CHF."}}},"allowAnonymous":{"type":"boolean","description":"Specifies if the coupon can be redeemed by anonymous user. If set to false, only logged-in customers can redeem it.","default":false},"maxRedemptions":{"type":"number","description":"Maximum number of redemptions; -1  designates 'unlimited' (seller-only).","default":-1},"maxRedemptionsPerCustomer":{"type":"number","description":"Maximum number of redemptions per customer; -1 designates 'unlimited'. Cannot be specified for coupons which can be redeemed by anonymous users.","default":-1},"discountCalculationType":{"type":"string","enum":["TOTAL","SUBTOTAL"],"description":"Determines whether the coupon is applied to the total or subtotal value of the order.","default":"SUBTOTAL"},"categoryRestricted":{"$ref":"#/components/schemas/categoryRestricted"},"segmentRestricted":{"$ref":"#/components/schemas/segmentRestricted"},"restrictions":{"$ref":"#/components/schemas/restrictions"},"issuedTo":{"type":"string","description":"The Id of the customer who originally received the coupon (seller-only)."},"mixins":{"type":"object","description":"The field contains mixins values.","additionalProperties":true},"metadata":{"type":"object","additionalProperties":false,"properties":{"version":{"description":"Version of the document. Set to 0 after creating a document. Increments by 1 after every update.","type":"number"},"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":{"type":"string"}}}}}},"categoryRestricted":{"type":"boolean","description":"Defines if the coupon has category restrictions.\n***\nInfo: Cannot be combined together with the segment restrictions.\n","default":false},"segmentRestricted":{"type":"boolean","description":"Defines if the coupon has segment restrictions. If the value is set to `true`, the `restrictions.segments` must be provided.\n***\nInfo: Cannot be combined neither with the category restrictions nor with customers restrictions.\n","default":false},"restrictions":{"type":"object","description":"Restrictions of the coupon.","properties":{"validFor":{"type":"array","description":"A list of customer identifiers for whom the coupon can be redeemed. Cannot be specified for coupons which can be redeemed by anonymous users.","items":{"type":"string"}},"validFrom":{"type":"string","format":"date-time","description":"Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'."},"validUntil":{"type":"string","format":"date-time","description":"Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'."},"minOrderValue":{"$ref":"#/components/schemas/currency-amount"},"includedCategories":{"type":"array","description":"The list of product's categories to which this coupon applies to. Must be defined only if the `categoryRestricted` flag is set to true. Must be disjoint with excludedCategories list.","items":{"type":"string"}},"excludedCategories":{"type":"array","description":"The list of product's categories to which this coupon does not apply to. Can be defined only if the `categoryRestricted` flag is set to true. Must be disjoint with includedCategories list.","items":{"type":"string"}},"segments":{"type":"array","description":"The list of segments to which this coupon applies to. Can be defined only if the `segmentRestricted` flag is set to true.","items":{"type":"string"}}}},"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."}}},"referralCouponProperty":{"type":"boolean","description":"Indicates if the coupon is type of referral coupon. This property is read only."}}}}
```

## The referralCoupon object

```json
{"openapi":"3.0.0","info":{"title":"Coupon Service","version":"0.0.1"},"components":{"schemas":{"referralCoupon":{"title":"Coupon","description":"Coupons describe voucher alike commerce capabilities.","type":"object","properties":{"code":{"type":"string","description":"e.g.: WINTER-SALE, 10OFF (read-only)"},"name":{"type":"string","description":"Coupon name."},"description":{"type":"string","description":"Coupon description."},"discountType":{"enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"`PERCENT` for relative values, `ABSOLUTE` for float values, referring to a specific currency, `FREE_SHIPPING` for reducing the shipping cost to 0.\n","type":"string"},"discountPercentage":{"type":"number","description":"A discount percentage within the range [0.00, 100.00]. Must be specified only if type is `PERCENT`.","minimum":0,"maximum":100},"discountAbsolute":{"allOf":[{"$ref":"#/components/schemas/currency-amount"}]},"allowAnonymous":{"type":"boolean","description":"Specifies if the coupon can be redeemed by anonymous users.","default":false},"maxRedemptions":{"type":"number","description":"Maximum number of redemptions; -1 designates 'unlimited' (seller-only).","default":-1},"maxRedemptionsPerCustomer":{"type":"number","description":"Maximum number of redemptions per customer; -1 designates 'unlimited'. Cannot be specified for coupons which can be redeemed by anonymous users.","default":-1},"restrictions":{"type":"object","properties":{"validFor":{"type":"array","description":"A list of customer identifiers for whom the coupon can be redeemed. Cannot be specified for coupons which can be redeemed by anonymous users.","items":{"type":"string"}},"validFrom":{"type":"string","format":"date-time","description":"Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'"},"validUntil":{"type":"string","format":"date-time","description":"Must be provided in ISO 8601 format (http://www.iso.org/iso/home/standards/iso8601.htm), e.g. '2015-01-31T23:59:59.999Z'"},"minOrderValue":{"$ref":"#/components/schemas/currency-amount"}}},"issuedTo":{"type":"string","description":"The Id of the customer who originally received the coupon (seller-only)."},"referralCoupon":{"$ref":"#/components/schemas/referralCouponProperty"},"redemptionCount":{"type":"number","description":"The number of times a specific coupon has been redeemed. Read-only, set through server (seller-only)."},"status":{"enum":["INACTIVE","VALID","EXPIRED","USED"],"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.","type":"string"},"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":["discountType","issuedTo","status","name"]},"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."}}},"referralCouponProperty":{"type":"boolean","description":"Indicates if the coupon is type of referral coupon. This property is read only."}}}}
```

## The referralCouponProperty object

```json
{"openapi":"3.0.0","info":{"title":"Coupon Service","version":"0.0.1"},"components":{"schemas":{"referralCouponProperty":{"type":"boolean","description":"Indicates if the coupon is type of referral coupon. This property is read only."}}}}
```
