> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stigg.io/llms.txt
> Use this file to discover all available pages before exploring further.

# updateOneCoupon



**mutation** `updateOneCoupon(input: UpdateCouponInput!): Coupon!`

## Arguments

**`input`**: `UpdateCouponInput!` (required)

## Returns

`Coupon!`

**`additionalMetaData`**: `JSON`

Metadata associated with the entity

---

**`amountsOff`**: `[Money!]`

Fixed amount discounts in different currencies. Provide exactly one of percentOff or amountsOff — not both, not neither.

---

**`billingId`**: `String`

The unique identifier for the entity in the billing provider

---

**`billingLinkUrl`**: `String`

The URL to the entity in the billing provider

---

**`createdAt`**: `DateTime!`

Timestamp of when the record was created

---

**`customers`**: `[Customer!]`

**Arguments:**

- `filter`: `CustomerFilter` = {} — Specify to filter the records returned.
- `sorting`: `[CustomerSort!]` = [{direction: DESC, field: createdAt}] — Specify to sort results.

---

**`description`**: `String`

Description of the coupon

---

**`discountValue`**: `Float!`

Discount value of the coupon (deprecated)

> Deprecated: Use percentOff or amountsOff fields instead

---

**`durationInMonths`**: `Float`

How many calendar months the discount applies for once redeemed, counted from when the coupon is applied (not tied to the subscription's billing period). Leave unset for a discount that lasts for the lifetime of the subscription.

---

**`environment`**: `Environment`

---

**`environmentId`**: `UUID!`

The unique identifier for the environment

---

**`id`**: `UUID!`

Unique identifier for the entity

---

**`name`**: `String!`

Name of the coupon

---

**`percentOff`**: `Float`

Percentage discount off the original price. Provide exactly one of percentOff or amountsOff — not both, not neither.

---

**`refId`**: `String!`

The unique identifier for the entity

---

**`source`**: `CouponSource!`

The source of the coupon

---

**`status`**: `CouponStatus!`

Current status of the coupon

---

**`syncStates`**: `[SyncState!]`

---

**`type`**: `CouponType!`

Type of the coupon (percentage or fixed amount)

---

**`updatedAt`**: `DateTime!`

Timestamp of when the record was last updated

## Examples

```graphql Mutation
mutation UpdateOneCoupon($input: UpdateCouponInput!) {
  updateOneCoupon(input: $input) {
    additionalMetaData
    amountsOff {
      amount
      currency
    }
    billingId
    billingLinkUrl
    createdAt
    customers {
      additionalMetaData
      awsMarketplaceCustomerId
      billingCurrency
      billingId
      billingLinkUrl
      coupon {
        __typename
      }
    }
  }
}
```

```json Variables
{
  "input": {
    "refId": "string"
  }
}
```

```json Response
{
  "data": {
    "updateOneCoupon": {
      "additionalMetaData": "value",
      "amountsOff": [
        {
          "amount": 1.5,
          "currency": "AED"
        }
      ],
      "billingId": "string",
      "billingLinkUrl": "string",
      "createdAt": "value",
      "customers": [
        {
          "additionalMetaData": "value",
          "awsMarketplaceCustomerId": "string",
          "billingCurrency": "AED",
          "billingId": "string",
          "billingLinkUrl": "string",
          "coupon": {
            "__typename": "Coupon"
          }
        }
      ]
    }
  }
}
```


## Related topics

- [Update a coupon](https://docs.stigg.io/api-reference/coupons/update-a-coupon.md)
- [UpdateCouponInput](https://docs.stigg.io/graphql-reference/types/UpdateCouponInput.md)
- [updateOneCustomer](https://docs.stigg.io/graphql-reference/mutations/updateOneCustomer.md)
- [updateOneExperiment](https://docs.stigg.io/graphql-reference/mutations/updateOneExperiment.md)
- [Coupon updated](https://docs.stigg.io/api-reference/coupons/coupon-updated.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.