# X + Y discount update Endpoint: PATCH /api/xy-discounts/{id} Version: 1.0.0 Security: shoptetAccessToken, shoptetPrivateApiToken ## Path parameters: - `id` (number, required) discount ID Example: "1" ## Header parameters: - `Content-Type` (string, required) ## Request fields (application/json): - `data` (object, required) - `data.title` (string) discount title - `data.validFrom` (string,null) date of discount validity from - `data.validTo` (string,null) date of discount validity to - `data.customerGroupCodes` (array,null) customer groups connected to discount - `data.includeUnregisteredCustomers` (boolean) defines if discount is valid for unregistered customers, default value is . - `data.xAmount` (string) discount amount in X axis - `data.yAmount` (string) amount of products get by discount - `data.description` (string,null) discount description - `data.termsAndConditionsUrl` (string,null) URL to terms and conditions - `data.displayFlag` (boolean) whether or not to display flag. If not set, default value is . - `data.flagColor` (string,null) color of flag - `data.displayBanner` (boolean) whether or not to display banner. If not set, default value is . - `data.bannerColor` (string,null) color of banner - `data.usageCount` (integer,null) number of how many times can be discount used. - `data.sortBefore` (integer) id of xy discount before which you want to move the xy discount from the request. Not possible to use with . - `data.sortAfter` (integer) id of xy discount after which you want to move the xy discount from the request. Not possible to use with . - `data.xTargeting` (object) definition of products needed to get discount - `data.xTargeting.productGuids` (array) array of product guids - `data.xTargeting.categoryGuids` (array) array of page guids (categories) - `data.xTargeting.brandCodes` (array) array of brand codes - `data.yTargeting` (object) definition of products get by discount ## Response 200 fields (application/json): - `data` (object) - `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 - `errors` (array,null) - `errors.errorCode` (string, required) Short text error identification - `errors.message` (string, required) Descriptive error message - `errors.instance` (string, required) Identification of the entity referenced ## Response 404 fields (application/json): - `data` (object,null) - `errors` (array,null) - `errors.errorCode` (string, required) Short text error identification - `errors.message` (string, required) Descriptive error message - `errors.instance` (string, required) Identification of the entity referenced