couponCreate

Graphql fields and variables for the couponCreate mutation

Create a coupon

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
        id
        name
        planId
        redemptionEndDate
        redemptionsCount
        redemptionsMax
        updatedAt
      }
      errors
  }
}

Arguments

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

accountId

ID

planId

ID

Response

Name
Type
Description

coupon

errors

List (String)

Last updated

Was this helpful?