# redeemCreditCoupon

```graphql
mutation RedeemCreditCoupon($input: CreditCouponInput!) {
  redeemCreditCoupon(input: $input) {
    status
    creditsGranted
    balance {
      tier
      purchased
      total
    }
    transactionId
  }
}
```

Redeem a coupon code for credits on an account; returns the credits granted and the new balance, or already\_redeemed for a code the account used before. Requires account.billing.manage.

## Arguments

| Name         | Type               | Required | Description |
| ------------ | ------------------ | -------- | ----------- |
| `input`      | CreditCouponInput! | Yes      |             |
| `input.code` | String!            | Yes      |             |

## Variables

```json
{
  "input": {
    "code": "FREE100"
  }
}
```

## Responses

| Status | Description                                             |
| ------ | ------------------------------------------------------- |
| 200    | The CreditCouponRedemption! in data.redeemCreditCoupon. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation RedeemCreditCoupon($input: CreditCouponInput!) {\n  redeemCreditCoupon(input: $input) {\n    status\n    creditsGranted\n    balance {\n      tier\n      purchased\n      total\n    }\n    transactionId\n  }\n}",
  "variables": {
    "input": {
      "code": "FREE100"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "redeemCreditCoupon": {
      "status": "string",
      "creditsGranted": 0,
      "balance": {
        "tier": 0,
        "purchased": 0,
        "total": 0
      },
      "transactionId": "string"
    }
  }
}
```
