# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.suggestic.com/graphql/query/mutations/appointments/update-appointment-credits.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
