Skip to main content
Applies a coupon to a customer, affecting their subscription pricing.

Mutation

mutation SetCouponOnCustomer($input: SetCouponOnCustomerInput!) {
  setCouponOnCustomer(input: $input) {
    customerId
    coupon {
      code
      type
      discountValue
      duration
    }
  }
}
{
  "input": {
    "customerId": "customer-123",
    "couponRefId": "SAVE20"
  }
}
{
  "data": {
    "setCouponOnCustomer": {
      "customerId": "customer-123",
      "coupon": {
        "code": "SAVE20",
        "type": "PERCENTAGE",
        "discountValue": 20,
        "duration": "FOREVER"
      }
    }
  }
}

Parameters

input
SetCouponOnCustomerInput
required
Input for applying a coupon

Return Type

Returns the updated Customer with the applied coupon.