# Edit Transaction Note

## Editing a Transaction Note

Initiate a mutation to edit an existing transaction note according to a Transaction ID.

Existing notes that are empty/`null` can also be edited and changed.

```graphql
mutation UpdateTransaction($data: TransactionUpdateInput!, $where: TransactionWhereUniqueInput!) {
  updateTransaction(data: $data, where: $where) {
    id
  }
}
```

### **Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

### Body (<mark style="color:orange;">TransactionUpdateInput</mark>) object + (<mark style="color:orange;">TransactionWhereUniqueInput</mark>) object

| Name                                   | Type   | Description          |
| -------------------------------------- | ------ | -------------------- |
| note<mark style="color:red;">\*</mark> | String | New transaction note |
| Id<mark style="color:red;">\*</mark>   | String | Transaction ID       |

Example body:

```graphql
{
  "data": {
    "note": "made by api Admin"
  },
  "where": {
    "id": "clpgvrjb700136g01lr3o0tgv"
  }
}
```

### Response

Return values:

| Name | Type   | Description            |
| ---- | ------ | ---------------------- |
| id   | String | Updated Transaction ID |

{% tabs %}
{% tab title="🟢 Success" %}

```javascript
{
  "data": {
    "updateTransaction": {
      "id": "clpgvrjb700136g01lr3o0tgv",
    }
  }
}
```

{% endtab %}

{% tab title="🔴 Failure" %}

{% endtab %}
{% endtabs %}

### Try it out!

{% embed url="<https://studio.apollographql.com/sandbox/explorer?endpoint=https%3A%2F%2Fapi.inabit.app%2Fgraphql&explorerURLState=N4IgJg9gxgrgtgUwHYBcQC4RxighigSwiQAIBVABzHwQBUAnXJAZ1ykOIAoASavdEgyat2RJJT4IAkkgo4AhABoS3AO4ALBPQQChLNhyQB1TdrJICARxjTZCgJQlgAHVIkYVGnpGHOfXAK8%2BLjKGlo6KmHaji5uJCQEYK7xAL6uKSApQA>" %}
