# Update Wallet

{% hint style="info" %}
**API Endpoint**

**POST** [**/client/wallets/save**](https://xpay.stream/client/wallets/save)
{% endhint %}

***

{% hint style="info" %}
**Request Headers:**

Authorization: Bearer [\<access\_token>](https://docs.xpay.stream/authentication-api)

Content-Type: application/json\
\
**Request Body:**

{% code lineNumbers="true" %}

```json
{
    "wallet":"<existing_wallet_uuid>",
    "tag" : "<your_new_tag>"
}
```

{% endcode %}
{% endhint %}

{% hint style="success" %}
**Success Response**

{% code lineNumbers="true" fullWidth="true" %}

```json
{
    "success": {
        "message": "Wallet Saved",
        "data": {
            "uuid": "<wallet_uuid>",
            "tag": "<your_new_tag>"
        }
    },
    "uuid": "597edb5b-9e6a-4cd2-a5c5-9cce5d0a2efb"
}
```

{% endcode %}
{% endhint %}

***

{% tabs %}
{% tab title="CURL Example" %}
{% code lineNumbers="true" fullWidth="true" %}

```bash
curl 'https://apis.xpay.stream/client/wallets/save'    \
  -H 'Content-Type: application/json'                  \
  -H 'Authorization: Bearer <access_token>'            \
  --data-raw '{"wallet":"<uuid>","tag":"<tag>"}'              
```

{% endcode %}
{% endtab %}

{% tab title="NodeJS Example" %}
{% code lineNumbers="true" %}

```javascript
// npm i cross-fetch
const fetch = require("cross-fetch");

const API_URL = "https://apis.xpay.stream/client/wallets/save";

const method = "POST";

const headers = { 
    "Content-Type": "application/json",
    "Authorization": "Bearer <access_token>"
};

const body = JSON.stringify({
    wallet: "<existing_wallet_uuid>", 
    tag: "<your_tag>"
});

fetch(API_URL, { headers, body, method })
.then(async res =>  await res.json())
.then(result => {
    if(result.error)
        console.log("Wallet Update Error", result);
    if(result.success)
        console.log("Wallet Updated", result);
})
.catch((err) => {
    console.error("Wallet Update API Exception", err);
});
```

{% endcode %}

{% endtab %}
{% endtabs %}
