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

# Update Purchase Tags

> This endpoint updates an attribute tag for the given purchase. The tag associated with the key in the request will be created or updated with the values passed in.

<Note>
  Please review proper request headers [here](/consumer/usage/headers).
</Note>

### Parameters

<ParamField path="id" type="string" required>
  Purchase ID
</ParamField>

<ParamField body="key" type="string" required>
  Tag key
</ParamField>

<ParamField body="values" type="array(string)" required>
  Array of attributes tags
</ParamField>

### Response

<ResponseField name="id" type="string">
  Tag ID
</ResponseField>

<ResponseField name="purchase_id" type="string">
  Purchase ID
</ResponseField>

<ResponseField name="key" type="string">
  Tag key
</ResponseField>

<ResponseField name="values" type="array(string)">
  Array of attribute tags
</ResponseField>

<RequestExample>
  ```bash theme={null}
  curl https://api.thanxsandbox.com/purchases/wourhfiwer/tags \
    -X PUT \
    -H "Content-Type: application/json"  \
    -H "Accept-Version: v4.0" \
    -H "Accept: application/json" \
    -H "X-ClientId: ${client_id}"
    -d '{
      "tag": {
        "key": "server_satisfaction",
        "values": [
          "10"
        ]
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "tag": {
      "id": "werwerr",
      "purchase_id": "wourhfiwer",
      "key": "server_satisfaction",
      "values": [
        "10"
      ]
    }
  }
  ```
</ResponseExample>
