> For the complete documentation index, see [llms.txt](https://docs.suggestic.com/graphql/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.suggestic.com/graphql/query/mutations/appointments/update-appointment-credits.md).

# Update Appointment Credits

Use the `updateAppointmentCredits` mutation to increase, decrease, or send an exact number of credits to update the appointment credits information. Use this if the third party has access to the [*Coaching Portal*](https://docs.suggestic.com/coaching-portal/)

### Required Arguments

| **Argument Name** | **Type** |       **Description**       |
| :---------------: | :------: | :-------------------------: |
|     `profile`     |    ID    |     User Id Base-64 ID.     |
| `appointmentType` |    ID    | Appointment type Base-64 ID |

### Available Arguments

|   Argument Name   |   Type   |                            Description                           |
| :---------------: | :------: | :--------------------------------------------------------------: |
| **Argument Name** | **Type** |                          **Description**                         |
|     `increase`    |    Int   |              Value to increase the number of credits             |
|     `decrease`    |    Int   |              Value to decrease the number of credits             |
|      `value`      |    Int   | Use this to send the exact number of credits the user will have. |

### Available Fields

The following fields will be displayed in the response:

|   Field Name   |        Type       |                                                  Description                                                 |
| :------------: | :---------------: | :----------------------------------------------------------------------------------------------------------: |
| **Field Name** |      **Type**     |                                                **Description**                                               |
|    `credits`   | AppointmentCredit | A structured version of appointment credit information. It contains `appointmentType, value`, and `id`fields |
|    `message`   |      Boolean      |            **True** if the appointment credits has been updated successfully. Otherwise, **False**           |
|    `success`   |      Boolean      |                                           Description of the result                                          |

### Example

{% tabs %}
{% tab title="Request" %}

```graphql
mutation(
  $profile: ID!
  $type: ID!
  $increase: Int
  $decrease: Int
  $value: Int
) {
  updateAppointmentCredits(
    profile: $profile
    appointmentType: $type
    increase: $increase
    decrease: $decrease
    value: $value
  ) {
    success
    message
  }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "updateAppointmentCredits": {
      "success": true,
      "message": "Appointment Credits were updated"
    }
  }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Query Variables" %}

```graphql
{
"profile": "TWVtYmVyOjVlZDk5MjMyLWNhMTMtNGE2NS05MmIyLWZjMDk4ZjgyOWUwNA==",
  "type": "QXBwb2ludG1lbnRUeXBlOjI=",
  "increase": 1,
  "decrease": 2,
  "value": 5
}
```

{% endtab %}
{% endtabs %}
