# Facility discounts endpoints

## The FacilityDiscount object

```json
{"openapi":"3.0.1","info":{"title":"fulfillmenttools","version":"VERSIONLESS"},"components":{"schemas":{"FacilityDiscount":{"additionalProperties":false,"allOf":[{"$ref":"#/components/schemas/FacilityDiscountForCreation"},{"$ref":"#/components/schemas/VersionedResource"}],"properties":{"discount":{"oneOf":[{"$ref":"#/components/schemas/FacilityDiscountRelative"},{"$ref":"#/components/schemas/FacilityDiscountAbsolute"}]},"facilityRef":{"description":"The id of the facility the discount belongs to. It is generated during creation automatically and suits as the primary identifier of the described entity.","type":"string"},"id":{"description":"The id of the supplier discount. It is generated during creation automatically and suits as the primary identifier of the described entity.","type":"string"}},"required":["facilityRef","discount","priority","type","id"],"title":"FacilityDiscount","description":"FacilityDiscount"},"FacilityDiscountForCreation":{"additionalProperties":false,"properties":{"context":{"description":"The context of the discount. This is used to determine the conditions  under which the discount can be applied.","items":{"$ref":"#/components/schemas/FacilityDiscountContext","maxLength":2000,"minItems":0},"type":"array"},"discount":{"oneOf":[{"$ref":"#/components/schemas/FacilityDiscountRelative"},{"$ref":"#/components/schemas/FacilityDiscountAbsoluteForCreation"}]},"priority":{"description":"The priority of the discount. Discounts with the lowest priority value are applied first. Value must be greater than 0 and smaller than 1000.","type":"integer"},"type":{"$ref":"#/components/schemas/FacilityDiscountPriceType"}},"required":["discount","priority","type"],"title":"FacilityDiscountForCreation","description":"FacilityDiscountForCreation"},"FacilityDiscountContext":{"additionalProperties":false,"description":"The context of the discount. This is used to determine the conditions  under which the discount can be applied.","properties":{"operator":{"$ref":"#/components/schemas/ContextOperator"},"type":{"$ref":"#/components/schemas/FacilityDiscountContextTypes"},"values":{"description":"The values of the context. This is used to determine the conditions  under which the discount can be applied.","items":{"maxItems":100,"minItems":0,"type":"string"},"type":"array"}},"required":["type","values"],"type":"object","title":"FacilityDiscountContext"},"ContextOperator":{"description":"The operator used to define how the context values are evaluated or compared.","enum":["NOT"],"type":"string","title":"ContextOperator"},"FacilityDiscountContextTypes":{"description":"The context type of the discount. This is used to determine the conditions  under which the discount can be applied.","enum":["FACILITY","FACILITY_GROUP","CATEGORY"],"type":"string","title":"FacilityDiscountContextTypes"},"FacilityDiscountRelative":{"additionalProperties":false,"properties":{"type":{"enum":["RELATIVE"],"type":"string"},"value":{"description":"Provided discount in percent.","minimum":0.1,"type":"number"}},"required":["type","value"],"type":"object","title":"FacilityDiscountRelative","description":"FacilityDiscountRelative"},"FacilityDiscountAbsoluteForCreation":{"additionalProperties":false,"properties":{"type":{"enum":["ABSOLUTE"],"type":"string"},"values":{"items":{"$ref":"#/components/schemas/FacilityDiscountAbsoluteElement"},"minItems":1,"type":"array"}},"required":["type","values"],"type":"object","title":"FacilityDiscountAbsoluteForCreation","description":"FacilityDiscountAbsoluteForCreation"},"FacilityDiscountAbsoluteElement":{"additionalProperties":false,"properties":{"currency":{"allOf":[{"$ref":"#/components/schemas/CurrencyCode"}],"description":"The currency of the price as an ISO 4217 code."},"decimalPlaces":{"description":"Number of decimal places for the given currency","minimum":0,"type":"integer"},"value":{"description":"Total value that should be shipped. Value is configured in the smallest subunit, e.g. cents.","minimum":1,"type":"integer"}},"required":["value","currency","decimalPlaces"],"type":"object","title":"FacilityDiscountAbsoluteElement","description":"FacilityDiscountAbsoluteElement"},"CurrencyCode":{"description":"The currency code is a three-letter code that represents a currency in the ISO 4217 standard.","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VED","VES","VND","VUV","WST","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XDR","XOF","XPD","XPF","XPT","XSU","XTS","XUA","XXX","YER","ZAR","ZMW","ZWL"],"type":"string","title":"CurrencyCode"},"FacilityDiscountPriceType":{"description":"Determines the price type this discount can be applied to.","enum":["SALES_PRICE"],"type":"string","title":"FacilityDiscountPriceType"},"VersionedResource":{"properties":{"created":{"description":"The date this entity was created at the platform. This value is generated by the service.","format":"date-time","type":"string"},"lastModified":{"description":"The date this entity was modified last. This value is generated by the service.","format":"date-time","type":"string"},"version":{"description":"The version of the document to be used in optimistic locking mechanisms.","format":"int64","type":"integer"}},"required":["version"],"type":"object","title":"VersionedResource","description":"VersionedResource"},"FacilityDiscountAbsolute":{"additionalProperties":false,"properties":{"type":{"enum":["ABSOLUTE"],"type":"string"},"values":{"items":{"$ref":"#/components/schemas/FacilityDiscountAbsoluteElement"},"minItems":1,"type":"array"}},"required":["type","values"],"type":"object","title":"FacilityDiscountAbsolute","description":"FacilityDiscountAbsolute"}}}}
```

## POST /api/facilities/{facilityRef}/discounts

> Create facility discount

```json
{"openapi":"3.0.1","info":{"title":"fulfillmenttools","version":"VERSIONLESS"},"tags":[{"description":"Facilities represent various locations that form part of the fulfillment network.","name":"Facilities (Core)"}],"servers":[{"url":"https://{tenant}.api.fulfillmenttools.com","variables":{"tenant":{"default":"your-tenant-name"}}}],"security":[{"BearerToken":[]}],"components":{"securitySchemes":{"BearerToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"FacilityDiscountForCreation":{"additionalProperties":false,"properties":{"context":{"description":"The context of the discount. This is used to determine the conditions  under which the discount can be applied.","items":{"$ref":"#/components/schemas/FacilityDiscountContext","maxLength":2000,"minItems":0},"type":"array"},"discount":{"oneOf":[{"$ref":"#/components/schemas/FacilityDiscountRelative"},{"$ref":"#/components/schemas/FacilityDiscountAbsoluteForCreation"}]},"priority":{"description":"The priority of the discount. Discounts with the lowest priority value are applied first. Value must be greater than 0 and smaller than 1000.","type":"integer"},"type":{"$ref":"#/components/schemas/FacilityDiscountPriceType"}},"required":["discount","priority","type"],"title":"FacilityDiscountForCreation","description":"FacilityDiscountForCreation"},"FacilityDiscountContext":{"additionalProperties":false,"description":"The context of the discount. This is used to determine the conditions  under which the discount can be applied.","properties":{"operator":{"$ref":"#/components/schemas/ContextOperator"},"type":{"$ref":"#/components/schemas/FacilityDiscountContextTypes"},"values":{"description":"The values of the context. This is used to determine the conditions  under which the discount can be applied.","items":{"maxItems":100,"minItems":0,"type":"string"},"type":"array"}},"required":["type","values"],"type":"object","title":"FacilityDiscountContext"},"ContextOperator":{"description":"The operator used to define how the context values are evaluated or compared.","enum":["NOT"],"type":"string","title":"ContextOperator"},"FacilityDiscountContextTypes":{"description":"The context type of the discount. This is used to determine the conditions  under which the discount can be applied.","enum":["FACILITY","FACILITY_GROUP","CATEGORY"],"type":"string","title":"FacilityDiscountContextTypes"},"FacilityDiscountRelative":{"additionalProperties":false,"properties":{"type":{"enum":["RELATIVE"],"type":"string"},"value":{"description":"Provided discount in percent.","minimum":0.1,"type":"number"}},"required":["type","value"],"type":"object","title":"FacilityDiscountRelative","description":"FacilityDiscountRelative"},"FacilityDiscountAbsoluteForCreation":{"additionalProperties":false,"properties":{"type":{"enum":["ABSOLUTE"],"type":"string"},"values":{"items":{"$ref":"#/components/schemas/FacilityDiscountAbsoluteElement"},"minItems":1,"type":"array"}},"required":["type","values"],"type":"object","title":"FacilityDiscountAbsoluteForCreation","description":"FacilityDiscountAbsoluteForCreation"},"FacilityDiscountAbsoluteElement":{"additionalProperties":false,"properties":{"currency":{"allOf":[{"$ref":"#/components/schemas/CurrencyCode"}],"description":"The currency of the price as an ISO 4217 code."},"decimalPlaces":{"description":"Number of decimal places for the given currency","minimum":0,"type":"integer"},"value":{"description":"Total value that should be shipped. Value is configured in the smallest subunit, e.g. cents.","minimum":1,"type":"integer"}},"required":["value","currency","decimalPlaces"],"type":"object","title":"FacilityDiscountAbsoluteElement","description":"FacilityDiscountAbsoluteElement"},"CurrencyCode":{"description":"The currency code is a three-letter code that represents a currency in the ISO 4217 standard.","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VED","VES","VND","VUV","WST","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XDR","XOF","XPD","XPF","XPT","XSU","XTS","XUA","XXX","YER","ZAR","ZMW","ZWL"],"type":"string","title":"CurrencyCode"},"FacilityDiscountPriceType":{"description":"Determines the price type this discount can be applied to.","enum":["SALES_PRICE"],"type":"string","title":"FacilityDiscountPriceType"},"FacilityDiscount":{"additionalProperties":false,"allOf":[{"$ref":"#/components/schemas/FacilityDiscountForCreation"},{"$ref":"#/components/schemas/VersionedResource"}],"properties":{"discount":{"oneOf":[{"$ref":"#/components/schemas/FacilityDiscountRelative"},{"$ref":"#/components/schemas/FacilityDiscountAbsolute"}]},"facilityRef":{"description":"The id of the facility the discount belongs to. It is generated during creation automatically and suits as the primary identifier of the described entity.","type":"string"},"id":{"description":"The id of the supplier discount. It is generated during creation automatically and suits as the primary identifier of the described entity.","type":"string"}},"required":["facilityRef","discount","priority","type","id"],"title":"FacilityDiscount","description":"FacilityDiscount"},"VersionedResource":{"properties":{"created":{"description":"The date this entity was created at the platform. This value is generated by the service.","format":"date-time","type":"string"},"lastModified":{"description":"The date this entity was modified last. This value is generated by the service.","format":"date-time","type":"string"},"version":{"description":"The version of the document to be used in optimistic locking mechanisms.","format":"int64","type":"integer"}},"required":["version"],"type":"object","title":"VersionedResource","description":"VersionedResource"},"FacilityDiscountAbsolute":{"additionalProperties":false,"properties":{"type":{"enum":["ABSOLUTE"],"type":"string"},"values":{"items":{"$ref":"#/components/schemas/FacilityDiscountAbsoluteElement"},"minItems":1,"type":"array"}},"required":["type","values"],"type":"object","title":"FacilityDiscountAbsolute","description":"FacilityDiscountAbsolute"},"ApiError":{"items":{"$ref":"#/components/schemas/ErrorInner"},"type":"array","xml":{"name":"ApiError"},"title":"ApiError","description":"ApiError"},"ErrorInner":{"properties":{"description":{"type":"string"},"requestVersion":{"description":"The version provided within an invalid request.","format":"int64","type":"integer"},"summary":{"type":"string"},"version":{"format":"int64","type":"integer"}},"required":["summary"],"type":"object","title":"ErrorInner","description":"ErrorInner"}}},"paths":{"/api/facilities/{facilityRef}/discounts":{"post":{"description":"","operationId":"addDiscountToFacility","parameters":[{"description":"ID of the facility you want to add the discount to. Also accepts tenantFacilityId in urn format (e.g. urn:fft:facility:tenantFacilityId:{your-tenant-facility-id}).","in":"path","name":"facilityRef","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacilityDiscountForCreation"}}},"description":"Representation that describes the discount","required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacilityDiscount"}}},"description":"The discount was successfully created. The Location header contains the URL of the discount."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Invalid input. See response for details"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user is not allowed to operate against this API instance"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user, although recognized, is not authorized to use this endpoint"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Facility not found"}},"summary":"Create facility discount","tags":["Facilities (Core)"]}}}}
```

## GET /api/facilities/{facilityRef}/discounts

> List facility discounts

```json
{"openapi":"3.0.1","info":{"title":"fulfillmenttools","version":"VERSIONLESS"},"tags":[{"description":"Facilities represent various locations that form part of the fulfillment network.","name":"Facilities (Core)"}],"servers":[{"url":"https://{tenant}.api.fulfillmenttools.com","variables":{"tenant":{"default":"your-tenant-name"}}}],"security":[{"BearerToken":[]}],"components":{"securitySchemes":{"BearerToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"FacilityDiscountPaginatedResult":{"additionalProperties":false,"properties":{"items":{"description":"The list of discounts that match the search criteria. The list might be empty if no discounts match the search criteria.","items":{"$ref":"#/components/schemas/FacilityDiscount"},"type":"array"},"total":{"description":"The total number of discounts that match the search criteria. This number is not limited by the page size.","format":"int64","type":"integer"}},"required":["items","total"],"title":"FacilityDiscountPaginatedResult","description":"FacilityDiscountPaginatedResult"},"FacilityDiscount":{"additionalProperties":false,"allOf":[{"$ref":"#/components/schemas/FacilityDiscountForCreation"},{"$ref":"#/components/schemas/VersionedResource"}],"properties":{"discount":{"oneOf":[{"$ref":"#/components/schemas/FacilityDiscountRelative"},{"$ref":"#/components/schemas/FacilityDiscountAbsolute"}]},"facilityRef":{"description":"The id of the facility the discount belongs to. It is generated during creation automatically and suits as the primary identifier of the described entity.","type":"string"},"id":{"description":"The id of the supplier discount. It is generated during creation automatically and suits as the primary identifier of the described entity.","type":"string"}},"required":["facilityRef","discount","priority","type","id"],"title":"FacilityDiscount","description":"FacilityDiscount"},"FacilityDiscountForCreation":{"additionalProperties":false,"properties":{"context":{"description":"The context of the discount. This is used to determine the conditions  under which the discount can be applied.","items":{"$ref":"#/components/schemas/FacilityDiscountContext","maxLength":2000,"minItems":0},"type":"array"},"discount":{"oneOf":[{"$ref":"#/components/schemas/FacilityDiscountRelative"},{"$ref":"#/components/schemas/FacilityDiscountAbsoluteForCreation"}]},"priority":{"description":"The priority of the discount. Discounts with the lowest priority value are applied first. Value must be greater than 0 and smaller than 1000.","type":"integer"},"type":{"$ref":"#/components/schemas/FacilityDiscountPriceType"}},"required":["discount","priority","type"],"title":"FacilityDiscountForCreation","description":"FacilityDiscountForCreation"},"FacilityDiscountContext":{"additionalProperties":false,"description":"The context of the discount. This is used to determine the conditions  under which the discount can be applied.","properties":{"operator":{"$ref":"#/components/schemas/ContextOperator"},"type":{"$ref":"#/components/schemas/FacilityDiscountContextTypes"},"values":{"description":"The values of the context. This is used to determine the conditions  under which the discount can be applied.","items":{"maxItems":100,"minItems":0,"type":"string"},"type":"array"}},"required":["type","values"],"type":"object","title":"FacilityDiscountContext"},"ContextOperator":{"description":"The operator used to define how the context values are evaluated or compared.","enum":["NOT"],"type":"string","title":"ContextOperator"},"FacilityDiscountContextTypes":{"description":"The context type of the discount. This is used to determine the conditions  under which the discount can be applied.","enum":["FACILITY","FACILITY_GROUP","CATEGORY"],"type":"string","title":"FacilityDiscountContextTypes"},"FacilityDiscountRelative":{"additionalProperties":false,"properties":{"type":{"enum":["RELATIVE"],"type":"string"},"value":{"description":"Provided discount in percent.","minimum":0.1,"type":"number"}},"required":["type","value"],"type":"object","title":"FacilityDiscountRelative","description":"FacilityDiscountRelative"},"FacilityDiscountAbsoluteForCreation":{"additionalProperties":false,"properties":{"type":{"enum":["ABSOLUTE"],"type":"string"},"values":{"items":{"$ref":"#/components/schemas/FacilityDiscountAbsoluteElement"},"minItems":1,"type":"array"}},"required":["type","values"],"type":"object","title":"FacilityDiscountAbsoluteForCreation","description":"FacilityDiscountAbsoluteForCreation"},"FacilityDiscountAbsoluteElement":{"additionalProperties":false,"properties":{"currency":{"allOf":[{"$ref":"#/components/schemas/CurrencyCode"}],"description":"The currency of the price as an ISO 4217 code."},"decimalPlaces":{"description":"Number of decimal places for the given currency","minimum":0,"type":"integer"},"value":{"description":"Total value that should be shipped. Value is configured in the smallest subunit, e.g. cents.","minimum":1,"type":"integer"}},"required":["value","currency","decimalPlaces"],"type":"object","title":"FacilityDiscountAbsoluteElement","description":"FacilityDiscountAbsoluteElement"},"CurrencyCode":{"description":"The currency code is a three-letter code that represents a currency in the ISO 4217 standard.","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VED","VES","VND","VUV","WST","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XDR","XOF","XPD","XPF","XPT","XSU","XTS","XUA","XXX","YER","ZAR","ZMW","ZWL"],"type":"string","title":"CurrencyCode"},"FacilityDiscountPriceType":{"description":"Determines the price type this discount can be applied to.","enum":["SALES_PRICE"],"type":"string","title":"FacilityDiscountPriceType"},"VersionedResource":{"properties":{"created":{"description":"The date this entity was created at the platform. This value is generated by the service.","format":"date-time","type":"string"},"lastModified":{"description":"The date this entity was modified last. This value is generated by the service.","format":"date-time","type":"string"},"version":{"description":"The version of the document to be used in optimistic locking mechanisms.","format":"int64","type":"integer"}},"required":["version"],"type":"object","title":"VersionedResource","description":"VersionedResource"},"FacilityDiscountAbsolute":{"additionalProperties":false,"properties":{"type":{"enum":["ABSOLUTE"],"type":"string"},"values":{"items":{"$ref":"#/components/schemas/FacilityDiscountAbsoluteElement"},"minItems":1,"type":"array"}},"required":["type","values"],"type":"object","title":"FacilityDiscountAbsolute","description":"FacilityDiscountAbsolute"},"ApiError":{"items":{"$ref":"#/components/schemas/ErrorInner"},"type":"array","xml":{"name":"ApiError"},"title":"ApiError","description":"ApiError"},"ErrorInner":{"properties":{"description":{"type":"string"},"requestVersion":{"description":"The version provided within an invalid request.","format":"int64","type":"integer"},"summary":{"type":"string"},"version":{"format":"int64","type":"integer"}},"required":["summary"],"type":"object","title":"ErrorInner","description":"ErrorInner"}}},"paths":{"/api/facilities/{facilityRef}/discounts":{"get":{"description":"","operationId":"getDiscountsForFacility","parameters":[{"description":"ID of the facility you want to get the discounts for. Also accepts tenantFacilityId in urn format (e.g. urn:fft:facility:tenantFacilityId:{your-tenant-facility-id}).","in":"path","name":"facilityRef","required":true,"schema":{"type":"string"}},{"description":"all entities after given Id","in":"query","name":"startAfterId","required":false,"schema":{"type":"string"}},{"description":"number of facilities to show","in":"query","name":"size","required":false,"schema":{"default":25,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FacilityDiscountPaginatedResult"}}}},"description":"The discounts were successfully retrieved. The result is in the body."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user is not allowed to operate against this API instance"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user, although recognized, is not authorized to use this endpoint"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Facility not found"}},"summary":"List facility discounts","tags":["Facilities (Core)"]}}}}
```

## GET /api/facilities/{facilityRef}/discounts/{facilityDiscountRef}

> Get facility discount

```json
{"openapi":"3.0.1","info":{"title":"fulfillmenttools","version":"VERSIONLESS"},"tags":[{"description":"Facilities represent various locations that form part of the fulfillment network.","name":"Facilities (Core)"}],"servers":[{"url":"https://{tenant}.api.fulfillmenttools.com","variables":{"tenant":{"default":"your-tenant-name"}}}],"security":[{"BearerToken":[]}],"components":{"securitySchemes":{"BearerToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"FacilityDiscount":{"additionalProperties":false,"allOf":[{"$ref":"#/components/schemas/FacilityDiscountForCreation"},{"$ref":"#/components/schemas/VersionedResource"}],"properties":{"discount":{"oneOf":[{"$ref":"#/components/schemas/FacilityDiscountRelative"},{"$ref":"#/components/schemas/FacilityDiscountAbsolute"}]},"facilityRef":{"description":"The id of the facility the discount belongs to. It is generated during creation automatically and suits as the primary identifier of the described entity.","type":"string"},"id":{"description":"The id of the supplier discount. It is generated during creation automatically and suits as the primary identifier of the described entity.","type":"string"}},"required":["facilityRef","discount","priority","type","id"],"title":"FacilityDiscount","description":"FacilityDiscount"},"FacilityDiscountForCreation":{"additionalProperties":false,"properties":{"context":{"description":"The context of the discount. This is used to determine the conditions  under which the discount can be applied.","items":{"$ref":"#/components/schemas/FacilityDiscountContext","maxLength":2000,"minItems":0},"type":"array"},"discount":{"oneOf":[{"$ref":"#/components/schemas/FacilityDiscountRelative"},{"$ref":"#/components/schemas/FacilityDiscountAbsoluteForCreation"}]},"priority":{"description":"The priority of the discount. Discounts with the lowest priority value are applied first. Value must be greater than 0 and smaller than 1000.","type":"integer"},"type":{"$ref":"#/components/schemas/FacilityDiscountPriceType"}},"required":["discount","priority","type"],"title":"FacilityDiscountForCreation","description":"FacilityDiscountForCreation"},"FacilityDiscountContext":{"additionalProperties":false,"description":"The context of the discount. This is used to determine the conditions  under which the discount can be applied.","properties":{"operator":{"$ref":"#/components/schemas/ContextOperator"},"type":{"$ref":"#/components/schemas/FacilityDiscountContextTypes"},"values":{"description":"The values of the context. This is used to determine the conditions  under which the discount can be applied.","items":{"maxItems":100,"minItems":0,"type":"string"},"type":"array"}},"required":["type","values"],"type":"object","title":"FacilityDiscountContext"},"ContextOperator":{"description":"The operator used to define how the context values are evaluated or compared.","enum":["NOT"],"type":"string","title":"ContextOperator"},"FacilityDiscountContextTypes":{"description":"The context type of the discount. This is used to determine the conditions  under which the discount can be applied.","enum":["FACILITY","FACILITY_GROUP","CATEGORY"],"type":"string","title":"FacilityDiscountContextTypes"},"FacilityDiscountRelative":{"additionalProperties":false,"properties":{"type":{"enum":["RELATIVE"],"type":"string"},"value":{"description":"Provided discount in percent.","minimum":0.1,"type":"number"}},"required":["type","value"],"type":"object","title":"FacilityDiscountRelative","description":"FacilityDiscountRelative"},"FacilityDiscountAbsoluteForCreation":{"additionalProperties":false,"properties":{"type":{"enum":["ABSOLUTE"],"type":"string"},"values":{"items":{"$ref":"#/components/schemas/FacilityDiscountAbsoluteElement"},"minItems":1,"type":"array"}},"required":["type","values"],"type":"object","title":"FacilityDiscountAbsoluteForCreation","description":"FacilityDiscountAbsoluteForCreation"},"FacilityDiscountAbsoluteElement":{"additionalProperties":false,"properties":{"currency":{"allOf":[{"$ref":"#/components/schemas/CurrencyCode"}],"description":"The currency of the price as an ISO 4217 code."},"decimalPlaces":{"description":"Number of decimal places for the given currency","minimum":0,"type":"integer"},"value":{"description":"Total value that should be shipped. Value is configured in the smallest subunit, e.g. cents.","minimum":1,"type":"integer"}},"required":["value","currency","decimalPlaces"],"type":"object","title":"FacilityDiscountAbsoluteElement","description":"FacilityDiscountAbsoluteElement"},"CurrencyCode":{"description":"The currency code is a three-letter code that represents a currency in the ISO 4217 standard.","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VED","VES","VND","VUV","WST","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XDR","XOF","XPD","XPF","XPT","XSU","XTS","XUA","XXX","YER","ZAR","ZMW","ZWL"],"type":"string","title":"CurrencyCode"},"FacilityDiscountPriceType":{"description":"Determines the price type this discount can be applied to.","enum":["SALES_PRICE"],"type":"string","title":"FacilityDiscountPriceType"},"VersionedResource":{"properties":{"created":{"description":"The date this entity was created at the platform. This value is generated by the service.","format":"date-time","type":"string"},"lastModified":{"description":"The date this entity was modified last. This value is generated by the service.","format":"date-time","type":"string"},"version":{"description":"The version of the document to be used in optimistic locking mechanisms.","format":"int64","type":"integer"}},"required":["version"],"type":"object","title":"VersionedResource","description":"VersionedResource"},"FacilityDiscountAbsolute":{"additionalProperties":false,"properties":{"type":{"enum":["ABSOLUTE"],"type":"string"},"values":{"items":{"$ref":"#/components/schemas/FacilityDiscountAbsoluteElement"},"minItems":1,"type":"array"}},"required":["type","values"],"type":"object","title":"FacilityDiscountAbsolute","description":"FacilityDiscountAbsolute"},"ApiError":{"items":{"$ref":"#/components/schemas/ErrorInner"},"type":"array","xml":{"name":"ApiError"},"title":"ApiError","description":"ApiError"},"ErrorInner":{"properties":{"description":{"type":"string"},"requestVersion":{"description":"The version provided within an invalid request.","format":"int64","type":"integer"},"summary":{"type":"string"},"version":{"format":"int64","type":"integer"}},"required":["summary"],"type":"object","title":"ErrorInner","description":"ErrorInner"}}},"paths":{"/api/facilities/{facilityRef}/discounts/{facilityDiscountRef}":{"get":{"description":"","operationId":"getDiscountForFacility","parameters":[{"description":"ID of the facility you want to get the discount for. Also accepts tenantFacilityId in urn format (e.g. urn:fft:facility:tenantFacilityId:{your-tenant-facility-id}).","in":"path","name":"facilityRef","required":true,"schema":{"type":"string"}},{"description":"ID of the discount you want to get","in":"path","name":"facilityDiscountRef","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacilityDiscount"}}},"description":"The discount was successfully retrieved. The result is in the body."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user is not allowed to operate against this API instance"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user, although recognized, is not authorized to use this endpoint"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Facility or discount not found"}},"summary":"Get facility discount","tags":["Facilities (Core)"]}}}}
```

## DELETE /api/facilities/{facilityRef}/discounts/{facilityDiscountRef}

> Delete facility discount

```json
{"openapi":"3.0.1","info":{"title":"fulfillmenttools","version":"VERSIONLESS"},"tags":[{"description":"Facilities represent various locations that form part of the fulfillment network.","name":"Facilities (Core)"}],"servers":[{"url":"https://{tenant}.api.fulfillmenttools.com","variables":{"tenant":{"default":"your-tenant-name"}}}],"security":[{"BearerToken":[]}],"components":{"securitySchemes":{"BearerToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"ApiError":{"items":{"$ref":"#/components/schemas/ErrorInner"},"type":"array","xml":{"name":"ApiError"},"title":"ApiError","description":"ApiError"},"ErrorInner":{"properties":{"description":{"type":"string"},"requestVersion":{"description":"The version provided within an invalid request.","format":"int64","type":"integer"},"summary":{"type":"string"},"version":{"format":"int64","type":"integer"}},"required":["summary"],"type":"object","title":"ErrorInner","description":"ErrorInner"}}},"paths":{"/api/facilities/{facilityRef}/discounts/{facilityDiscountRef}":{"delete":{"description":"","operationId":"deleteDiscountForFacility","parameters":[{"description":"ID of the facility you want to delete the discount from. Also accepts tenantFacilityId in urn format (e.g. urn:fft:facility:tenantFacilityId:{your-tenant-facility-id}).","in":"path","name":"facilityRef","required":true,"schema":{"type":"string"}},{"description":"ID of the discount you want to delete","in":"path","name":"facilityDiscountRef","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The discount was successfully deleted. The result is in the body."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user is not allowed to operate against this API instance"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user, although recognized, is not authorized to use this endpoint"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Facility or discount not found"}},"summary":"Delete facility discount","tags":["Facilities (Core)"]}}}}
```

## PATCH /api/facilities/{facilityRef}/discounts/{facilityDiscountRef}

> Update facility discount

```json
{"openapi":"3.0.1","info":{"title":"fulfillmenttools","version":"VERSIONLESS"},"tags":[{"description":"Facilities represent various locations that form part of the fulfillment network.","name":"Facilities (Core)"}],"servers":[{"url":"https://{tenant}.api.fulfillmenttools.com","variables":{"tenant":{"default":"your-tenant-name"}}}],"security":[{"BearerToken":[]}],"components":{"securitySchemes":{"BearerToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"FacilityDiscountForUpdate":{"additionalProperties":false,"properties":{"context":{"description":"The context of the discount. This is used to determine the conditions  under which the discount can be applied.","items":{"$ref":"#/components/schemas/FacilityDiscountContext","maxLength":2000,"minItems":0},"type":"array"},"discount":{"oneOf":[{"$ref":"#/components/schemas/FacilityDiscountRelative"},{"$ref":"#/components/schemas/FacilityDiscountAbsoluteForCreation"}]},"priority":{"description":"The priority of the discount. Discounts with the lowest priority value are applied first. Must be greater than 0 and smaller than 1000.","type":"integer"},"type":{"$ref":"#/components/schemas/FacilityDiscountPriceType"},"version":{"description":"The version of the document to be used in optimistic locking mechanisms.","format":"int64","type":"integer"}},"required":["version"],"title":"FacilityDiscountForUpdate","description":"FacilityDiscountForUpdate"},"FacilityDiscountContext":{"additionalProperties":false,"description":"The context of the discount. This is used to determine the conditions  under which the discount can be applied.","properties":{"operator":{"$ref":"#/components/schemas/ContextOperator"},"type":{"$ref":"#/components/schemas/FacilityDiscountContextTypes"},"values":{"description":"The values of the context. This is used to determine the conditions  under which the discount can be applied.","items":{"maxItems":100,"minItems":0,"type":"string"},"type":"array"}},"required":["type","values"],"type":"object","title":"FacilityDiscountContext"},"ContextOperator":{"description":"The operator used to define how the context values are evaluated or compared.","enum":["NOT"],"type":"string","title":"ContextOperator"},"FacilityDiscountContextTypes":{"description":"The context type of the discount. This is used to determine the conditions  under which the discount can be applied.","enum":["FACILITY","FACILITY_GROUP","CATEGORY"],"type":"string","title":"FacilityDiscountContextTypes"},"FacilityDiscountRelative":{"additionalProperties":false,"properties":{"type":{"enum":["RELATIVE"],"type":"string"},"value":{"description":"Provided discount in percent.","minimum":0.1,"type":"number"}},"required":["type","value"],"type":"object","title":"FacilityDiscountRelative","description":"FacilityDiscountRelative"},"FacilityDiscountAbsoluteForCreation":{"additionalProperties":false,"properties":{"type":{"enum":["ABSOLUTE"],"type":"string"},"values":{"items":{"$ref":"#/components/schemas/FacilityDiscountAbsoluteElement"},"minItems":1,"type":"array"}},"required":["type","values"],"type":"object","title":"FacilityDiscountAbsoluteForCreation","description":"FacilityDiscountAbsoluteForCreation"},"FacilityDiscountAbsoluteElement":{"additionalProperties":false,"properties":{"currency":{"allOf":[{"$ref":"#/components/schemas/CurrencyCode"}],"description":"The currency of the price as an ISO 4217 code."},"decimalPlaces":{"description":"Number of decimal places for the given currency","minimum":0,"type":"integer"},"value":{"description":"Total value that should be shipped. Value is configured in the smallest subunit, e.g. cents.","minimum":1,"type":"integer"}},"required":["value","currency","decimalPlaces"],"type":"object","title":"FacilityDiscountAbsoluteElement","description":"FacilityDiscountAbsoluteElement"},"CurrencyCode":{"description":"The currency code is a three-letter code that represents a currency in the ISO 4217 standard.","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VED","VES","VND","VUV","WST","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XDR","XOF","XPD","XPF","XPT","XSU","XTS","XUA","XXX","YER","ZAR","ZMW","ZWL"],"type":"string","title":"CurrencyCode"},"FacilityDiscountPriceType":{"description":"Determines the price type this discount can be applied to.","enum":["SALES_PRICE"],"type":"string","title":"FacilityDiscountPriceType"},"FacilityDiscount":{"additionalProperties":false,"allOf":[{"$ref":"#/components/schemas/FacilityDiscountForCreation"},{"$ref":"#/components/schemas/VersionedResource"}],"properties":{"discount":{"oneOf":[{"$ref":"#/components/schemas/FacilityDiscountRelative"},{"$ref":"#/components/schemas/FacilityDiscountAbsolute"}]},"facilityRef":{"description":"The id of the facility the discount belongs to. It is generated during creation automatically and suits as the primary identifier of the described entity.","type":"string"},"id":{"description":"The id of the supplier discount. It is generated during creation automatically and suits as the primary identifier of the described entity.","type":"string"}},"required":["facilityRef","discount","priority","type","id"],"title":"FacilityDiscount","description":"FacilityDiscount"},"FacilityDiscountForCreation":{"additionalProperties":false,"properties":{"context":{"description":"The context of the discount. This is used to determine the conditions  under which the discount can be applied.","items":{"$ref":"#/components/schemas/FacilityDiscountContext","maxLength":2000,"minItems":0},"type":"array"},"discount":{"oneOf":[{"$ref":"#/components/schemas/FacilityDiscountRelative"},{"$ref":"#/components/schemas/FacilityDiscountAbsoluteForCreation"}]},"priority":{"description":"The priority of the discount. Discounts with the lowest priority value are applied first. Value must be greater than 0 and smaller than 1000.","type":"integer"},"type":{"$ref":"#/components/schemas/FacilityDiscountPriceType"}},"required":["discount","priority","type"],"title":"FacilityDiscountForCreation","description":"FacilityDiscountForCreation"},"VersionedResource":{"properties":{"created":{"description":"The date this entity was created at the platform. This value is generated by the service.","format":"date-time","type":"string"},"lastModified":{"description":"The date this entity was modified last. This value is generated by the service.","format":"date-time","type":"string"},"version":{"description":"The version of the document to be used in optimistic locking mechanisms.","format":"int64","type":"integer"}},"required":["version"],"type":"object","title":"VersionedResource","description":"VersionedResource"},"FacilityDiscountAbsolute":{"additionalProperties":false,"properties":{"type":{"enum":["ABSOLUTE"],"type":"string"},"values":{"items":{"$ref":"#/components/schemas/FacilityDiscountAbsoluteElement"},"minItems":1,"type":"array"}},"required":["type","values"],"type":"object","title":"FacilityDiscountAbsolute","description":"FacilityDiscountAbsolute"},"ApiError":{"items":{"$ref":"#/components/schemas/ErrorInner"},"type":"array","xml":{"name":"ApiError"},"title":"ApiError","description":"ApiError"},"ErrorInner":{"properties":{"description":{"type":"string"},"requestVersion":{"description":"The version provided within an invalid request.","format":"int64","type":"integer"},"summary":{"type":"string"},"version":{"format":"int64","type":"integer"}},"required":["summary"],"type":"object","title":"ErrorInner","description":"ErrorInner"}}},"paths":{"/api/facilities/{facilityRef}/discounts/{facilityDiscountRef}":{"patch":{"description":"","operationId":"updateDiscountForFacility","parameters":[{"description":"ID of the facility you want to update the discount for. Also accepts tenantFacilityId in urn format (e.g. urn:fft:facility:tenantFacilityId:{your-tenant-facility-id}).","in":"path","name":"facilityRef","required":true,"schema":{"type":"string"}},{"description":"ID of the discount you want to update","in":"path","name":"facilityDiscountRef","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacilityDiscountForUpdate"}}},"description":"Representation that describes the discount","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacilityDiscount"}}},"description":"The discount was successfully updated. The result is in the body."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Invalid input. See response for details"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user is not allowed to operate against this API instance"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user, although recognized, is not authorized to use this endpoint"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Facility or discount not found"}},"summary":"Update facility discount","tags":["Facilities (Core)"]}}}}
```
