# Edit Client

This endpoint is used to edit a client details for invoice plugin

#### Method

<pre><code><strong>PUT https://api.ninjapay.me/webextension/api/v1/fiat/invoice/client/{id}
</strong></code></pre>

#### Parameters

* **name** : `(string)` -  The name of the person.
* **phone\_code** : `(string)` - The country code for the phone number.
* **phone:** `(string, required)` - The phone number of the person.
* **email:** `(string, required)`  - The email address of the person.
* **website:** `(string)` - The website of the person or business.
* **street\_address**  : `(string)` - The street address of the person.
* **state** : `(string)` - The state where the person resides.
* **city** : `(string)` - The city where the person resides.
* **country** :`(string)`  - The country where the person resides.
* **zip\_code** : `(string)` -  The postal code of the area where the person resides.
* **details** (array of objects) : An array containing additional details.
  * **PAN** : `(string)` - The PAN (Permanent Account Number) of the person.
  * **GST** : `(string)` -  The GST (Goods and Services Tax) number of the person or business.

#### Request Body

```javascript
Body (application/json)
{
  "name": "Aman A",  // The name of the person
  "phone_code": "91",  // The country code for the phone number
  "phone": "9876543211",  // The phone number of the person
  "email": "aman2@gmail.com",  // The email address of the person
  "website": "https://amanwebsite.com",  // The website of the person or business
  "street_address": "1234 Elm Street",  // The street address of the person
  "state": "Maharashtra",  // The state where the person resides
  "city": "Mumbai",  // The city where the person resides
  "country": "India",  // The country where the person resides
  "zip_code": "400001",  // The postal code of the area where the person resides
  "details": [
    {
      "PAN": "ABCDE1234F"  // The PAN (Permanent Account Number) of the person
    },
    {
      "GST": "27ABCDE1234F1Z5"  // The GST (Goods and Services Tax) number of the person or business
    }
  ]
}

```

#### Response

```jsx
{
    "status": true,
    "data": {},
    "message": "Client details updated successfully"
}
```

#### Code Example

```jsx

const options = {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'API_KEY' //Invoice key required
  },
  body: {
  "name": "Aman A",  // The name of the person
  "phone_code": "91",  // The country code for the phone number
  "phone": "9876543211",  // The phone number of the person
  "email": "aman2@gmail.com",  // The email address of the person
  "website": "https://amanwebsite.com",  // The website of the person or business
  "street_address": "1234 Elm Street",  // The street address of the person
  "state": "Maharashtra",  // The state where the person resides
  "city": "Mumbai",  // The city where the person resides
  "country": "India",  // The country where the person resides
  "zip_code": "400001",  // The postal code of the area where the person resides
  "details": [
    {
      "PAN": "ABCDE1234F"  // The PAN (Permanent Account Number) of the person
    },
    {
      "GST": "27ABCDE1234F1Z5"  // The GST (Goods and Services Tax) number of the person or business
    }
  ]
}
};

fetch('https://api.ninjapay.me/webextension/api/v1/fiat/invoice/client/{id}', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
  
```


---

# 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://ninjapay.gitbook.io/ninjapay-api-docs/how-to/api-reference-upi/plugins/invoice/edit-client.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.
