couponUpdate

Update a coupon. The couponUpdate mutation in Bunny's GraphQL API, with its input attributes, return type and an example request.

Scope required: product:write

For a complete list of input attributes see the CouponAttributes type

mutation couponUpdate ($id: ID!, $attributes: CouponAttributes!) {
  couponUpdate (id: $id, attributes: $attributes) {
      coupon {
        active
        couponCode
        createdAt
        currencyId
        description
        discountAmount
        discountPercentage
        duration
        id
        name
        planId
        redemptionEndDate
        redemptionsCount
        redemptionsMax
        remainingPeriods
        updatedAt
      }
      errors
  }
}

ArgumentsLink to Arguments section

{
  "id": "456123",
  "attributes": {
    "name": "",
    "couponCode": "",
    "description": "",
    "active": true,
    "discountKind": "CouponDiscountKind",
    "discountAmount": "1.00",
    "discountPercentage": "1.00",
    "currencyId": "456123",
    "redemptionsMax": 123,
    "redemptionEndDate": "2022-06-01",
    "duration": 123
  }
}
Name Type Description
id ID  
attributes CouponAttributes  

ResponseLink to Response section

Name Type Description
coupon Coupon  
errors List (String)