# Detail of X + Y discounts

Endpoint: GET /api/xy-discounts/{id}
Version: 1.0.0
Security: shoptetAccessToken, shoptetPrivateApiToken

## Path parameters:

  - `id` (integer, required)
    discount ID
    Example: 1

## Header parameters:

  - `Content-Type` (string, required)

## Response 200 fields (application/json):

  - `data` (object, required)

  - `data.discount` (object, required)

  - `data.discount.id` (integer, required)
    discount ID

  - `data.discount.title` (string, required)
    discount title

  - `data.discount.validFrom` (string,null, required)
    date of discount validity from

  - `data.discount.validTo` (string,null, required)
    date of discount validity to

  - `data.discount.customerGroups` (array,null, required)
    customer groups connected to discount

  - `data.discount.customerGroups.code` (string, required)
    customer group code

  - `data.discount.customerGroups.name` (string, required)
    customer group name

  - `data.discount.xAmount` (string, required)
    amount of products needed to get discount

  - `data.discount.yAmount` (string, required)
    amount of products get by discount

  - `data.discount.description` (string,null, required)
    discount description

  - `data.discount.termsAndConditionsUrl` (string,null, required)
    url address lead to terms of discount

  - `data.discount.displayFlag` (boolean, required)
    whether the flag is displayed

  - `data.discount.flagColor` (string,null, required)
    color of the flag

  - `data.discount.displayBanner` (boolean, required)
    flag whether the banner is displayed

  - `data.discount.bannerColor` (string,null, required)
    color of the banner

  - `data.discount.priority` (integer,null, required)
    priority of the discount

  - `data.discount.usageCount` (integer,null, required)
    number of how many times can be discount used

  - `data.discount.xTargeting` (object,null, required)
    definition of products needed to get discount

  - `data.discount.xTargeting.productGuids` (array,null, required)
    array of product guids

  - `data.discount.xTargeting.categoryGuids` (array,null, required)
    array of page guids (categories)

  - `data.discount.xTargeting.brandCodes` (array,null, required)
    array of brand codes

  - `data.discount.yTargeting` (object,null, required)
    definition of products get by discount

  - `data.discount.includeUnregisteredCustomers` (boolean, required)
    defines if discount is valid for unregistered customers, default value is false

  - `errors` (array,null, required)

  - `errors.errorCode` (string, required)
    Short text error identification

  - `errors.message` (string, required)
    Descriptive error message

  - `errors.instance` (string, required)
    Identification of the entity referenced

  - `metadata` (object, required)

  - `metadata.requestId` (string, required)
    Request identifier. Useful for logging/reporting purposes.


