# Discount coupons insertion This endpoint allows you to insert specific discount coupons into Shoptet. Request is sent in JSON format in its body. It is good to compare count of requested coupons with count of cooupons in response as it can be different. It is because of request validation, where it ignores invalid coupons. Endpoint: POST /api/discount-coupons Version: 1.0.0 Security: shoptetAccessToken, shoptetPrivateApiToken ## Header parameters: - `Content-Type` (string, required) ## Request fields (application/json): - `data` (object, required) - `data.coupons` (array, required) Discount coupons. Minimal 1 item, maximal 999 items. - `data.coupons.code` (string,null) Code of discount coupon. - `data.coupons.discountType` (string, required) Type of discount. Percentual (percentual) or fixed discount (fixed) Enum: "percentual", "fixed" - `data.coupons.amount` (string,null) Amount of fixed discount (default eshop VAT rate is used). This items needs to be omitted when is set to - `data.coupons.ratio` (string,null) Amount of percentual discount. This items needs to be omitted when is set to . 4 decimal places accuracy, from (0% discount) to (100% discount). - `data.coupons.minPrice` (string,null) Minimum price of order (default eshop VAT rate is used) - `data.coupons.currency` (string,null) Currency of fixed discount. It can be null only when is set to and is set to null - `data.coupons.template` (string, required) GUID of discount coupon template - `data.coupons.shippingPrice` (string, required) How the transport prices are calculated: according to the cart before discounts (beforeDiscount), according to the displayed value of the cart (cart), or free (free) Enum: "cart", "free", "beforeDiscount" - `data.coupons.validFrom` (string,null) Starting date of coupon validity - `data.coupons.validTo` (string,null) Ending date of coupon validity - `data.coupons.reusable` (boolean, required) Is the discount coupon reusable? - `data.coupons.remark` (string,null) Discount coupon note ## Response 201 fields (application/json): - `data` (object, required) - `data.coupons` (array, required) - `data.coupons.code` (string, required) code of discount coupon - `data.coupons.creationTime` (string,null, required) date and time, when the discount coupon was created - `data.coupons.discountType` (string, required) type of discount. Percentual () or absolute discount () Enum: "percentual", "fixed" - `data.coupons.amount` (string,null, required) amount of absolute discount (default eshop VAT rate is used) - `data.coupons.ratio` (any, required) amount of percentual discount - `data.coupons.minPrice` (string,null, required) minimum price of order (default eshop VAT rate is used) - `data.coupons.currency` (string,null, required) currency of fixed discount. - `data.coupons.template` (string, required) template used for the discount coupon creation. - `data.coupons.shippingPrice` (string,null, required) how the transport prices are calculated: according to the cart before discounts (beforeDiscount), according to the displayed value of the cart (cart), or free (free) Enum: "cart", "free", "beforeDiscount", null - `data.coupons.validFrom` (string,null, required) starting date of coupon validity - `data.coupons.validTo` (string,null, required) ending date of coupon validity - `data.coupons.reusable` (boolean, required) Is the discount coupon reusable? - `data.coupons.usedCount` (integer, required) number of times the discount coupon has been used - `data.coupons.remark` (string,null, required) remark for the discount coupon. - `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