couponCreate

Create a coupon. The couponCreate 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 couponCreate ($attributes: CouponAttributes!, $accountId: ID, $planId: ID) {
  couponCreate (attributes: $attributes, accountId: $accountId, planId: $planId) {
      coupon {
        active
        couponCode
        createdAt
        currencyId
        description
        discountAmount
        discountPercentage
        duration
        id
        name
        planId
        redemptionEndDate
        redemptionsCount
        redemptionsMax
        remainingPeriods
        updatedAt
      }
      errors
  }
}

ArgumentsLink to Arguments section

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

ResponseLink to Response section

Name Type Description
coupon Coupon  
errors List (String)