# Bulk discount coupon update

Bulk partial update of existing discount coupons. Each coupon in the request
must include code as the identifier. All remaining fields are optional and
applied as a partial update — only provided fields are changed.

When discountType is percentual, amount must not be provided. When
discountType is fixed, ratio must not be provided.

The currency field  is required when discountType is fixed or minPrice
is not null.

Invalid coupons or coupons not found by code are skipped and reported in errors[].

Endpoint: PATCH /api/discount-coupons
Version: 5cf7b26
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, required)
    Code of the discount coupon to update. Used as the identifier.

  - `data.coupons.discountType` (string)
    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 discountType is set to percentual

  - `data.coupons.ratio` (string,null)
    Amount of percentual discount. This items needs to be omitted when discountType is set to fixed. 4 decimal places accuracy, from 0.0000 (0% discount) to 1.0000 (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 discountType is set to percentual and minPrice is set to null

  - `data.coupons.template` (string)
    GUID of discount coupon template

  - `data.coupons.shippingPrice` (string)
    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)
    Is the discount coupon reusable?

  - `data.coupons.remark` (string,null)
    Discount coupon note

## Response 200 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 (percentual) or absolute discount (fixed)
    Enum: same as `data.coupons.discountType` (2 values)

  - `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

  - `metadata` (object, required)

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

## Response 403 fields (application/json):

  - `data` (null, required)

  - `errors` (array,null, required)

  - `metadata` (object, required)

## Response 422 fields (application/json):

  - `data` (object, required)

  - `errors` (array,null, required)

  - `metadata` (object, required)


