---
title: "Perditeso klient (v2)"
operation_id: "api.v2.clients.update"
method: PATCH
path: "/api/v2/clients/{id}"
group: "Klienti"
api_version: "v2"
authenticated: true
canonical: "https://fature.al/api-reference/endpoints/api-v2-clients-update.html"
---

# Perditeso klient (v2)

Part of the [fature.al API](/api-reference/index.html) documentation.

## PATCH /api/v2/clients/{id}

I njejti trup si `POST`, me nje kufizim:

- **`type` eshte i pandryshueshem.** Nje kompani nuk behet person dhe as e kunderta. Nese
  dergoni nje `type` te ndryshem nga ai ekzistues, kerkesa refuzohet me `422`.

Full URL: `https://fature.al/api/v2/clients/{id}`

API version: `v2`.

Authentication: required (bearer token).

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer | yes | ID e klientit. |

### Body parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | string | yes | Lloji i klientit, i cili vendos se cili objekt plotesohet: `company` ose `person`. Ne editim eshte i pandryshueshem, prandaj nje `type` i ndryshem nga ai ekzistues refuzohet me `422`. |
| `company` | object | yes | Required depending on type. |
| `company.name` | string, maxLength 255, nullable | yes | Required depending on type. |
| `company.category` | string, nullable | no |  |
| `company.id` | object | yes | Required depending on type. |
| `company.id.type` | string | yes | Required when company.id is present. |
| `company.id.value` | string, maxLength 20 | yes | Required when company.id is present. |
| `person` | object | yes | Required depending on type. |
| `person.first_name` | string, maxLength 255, nullable | yes | Required depending on type. |
| `person.last_name` | string, maxLength 255, nullable | yes | Required depending on type. |
| `person.birthday` | string<date-time>, nullable | no |  |
| `person.id` | object | yes | Required depending on type. |
| `person.id.type` | string | yes | Required when person.id is present. |
| `person.id.value` | string, maxLength 255 | yes | Required when person.id is present. |
| `address` | object, nullable | no | Adresa e klientit. Opsionale, dhe e njejta per te dy llojet. |
| `address.line` | string, maxLength 255, nullable | no |  |
| `address.city` | string, maxLength 50, nullable | no |  |
| `address.country` | string, minLength 3, maxLength 3, nullable | no |  |
| `contact` | object, nullable | no | Kontaktet e klientit: telefoni dhe email-i. Opsionale. |
| `contact.phone` | string, maxLength 255, nullable | no |  |
| `contact.email` | string<email>, maxLength 255, nullable | no |  |
| `customer_number` | string, maxLength 30, nullable | no | Numri juaj i klientit, nese e mbani nje te tille ne sistemin tuaj. |

### Example request

```bash
curl -X PATCH 'https://fature.al/api/v2/clients/42' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'X-Client-Id: YOUR_CLIENT_ID' \
  -H 'X-Client-Secret: YOUR_CLIENT_SECRET' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "company",
    "company": {
        "name": "Jane Doe",
        "category": "category",
        "id": {
            "type": "type",
            "value": "value"
        }
    },
    "person": {
        "first_name": "Jane",
        "last_name": "Doe",
        "birthday": "2026-01-15T09:30:00Z",
        "id": {
            "type": "type",
            "value": "value"
        }
    },
    "address": {
        "line": "line",
        "city": "Berlin",
        "country": "USx"
    },
    "contact": {
        "phone": "+15551234567",
        "email": "jane@example.com"
    },
    "customer_number": "CL-00412"
}'
```

### Responses

**200** — OK

| Field | Type | Description |
| --- | --- | --- |
| `status` | boolean |  |
| `data` | object |  |
| `data.client` | object |  |
| `data.client.id` | integer |  |
| `data.client.type` | string | `company` or `person` |
| `data.client.company` | object, nullable | Filled when `type` is `company`, null otherwise |
| `data.client.company.name` | string, nullable |  |
| `data.client.company.category` | string, nullable | `business`, `bank` or `exchange`, or null when unclassified |
| `data.client.company.id` | object |  |
| `data.client.company.id.type` | any | `nuis`, `vat` or `tax` on a company; `id`, `passport` or `social` on a person |
| `data.client.company.id.value` | any | The identifier itself, null when the client has none recorded |
| `data.client.person` | object, nullable | Filled when `type` is `person`, null otherwise |
| `data.client.person.first_name` | string, nullable |  |
| `data.client.person.last_name` | string, nullable |  |
| `data.client.person.birthday` | string, nullable | Date of birth (YYYY-MM-DD) |
| `data.client.person.id` | object |  |
| `data.client.person.id.type` | any | `nuis`, `vat` or `tax` on a company; `id`, `passport` or `social` on a person |
| `data.client.person.id.value` | any | The identifier itself, null when the client has none recorded |
| `data.client.address` | object |  |
| `data.client.address.line` | string, nullable | Street address |
| `data.client.address.city` | string, nullable |  |
| `data.client.address.country` | string, nullable | ISO 3166-1 alpha-3 country code |
| `data.client.contact` | object |  |
| `data.client.contact.phone` | string, nullable |  |
| `data.client.contact.email` | string, nullable |  |
| `data.client.customer_number` | string, nullable | Your own reference for this client, when one was given |
| `data.client.verified` | boolean | Whether the identifier was confirmed against the fiscal register |
| `data.client.created_at` | string, nullable | Creation timestamp, ISO 8601 |
| `data.client.updated_at` | string, nullable | Last update timestamp, ISO 8601 |

```json
{
    "status": true,
    "data": {
        "client": {
            "id": 1,
            "type": "type",
            "company": {
                "name": "Jane Doe",
                "category": "category",
                "id": {
                    "type": "type",
                    "value": "value"
                }
            },
            "person": {
                "first_name": "Jane",
                "last_name": "Doe",
                "birthday": "birthday",
                "id": {
                    "type": "type",
                    "value": "value"
                }
            },
            "address": {
                "line": "line",
                "city": "Berlin",
                "country": "US"
            },
            "contact": {
                "phone": "+15551234567",
                "email": "jane@example.com"
            },
            "customer_number": "customer number",
            "verified": true,
            "created_at": "created at",
            "updated_at": "updated at"
        }
    }
}
```

**403** — Abonimi ka mbaruar, ose veprimi nuk lejohet per kete llogari.

| Field | Type | Description |
| --- | --- | --- |
| `status` | boolean | Always false. A successful response carries `status: true` and a `data` object instead |
| `message` | string | The exception message. Empty when the failure carries no exception of its own |
| `errors` | array | Messages to show the operator or to log. Absent when the failure has nothing to add beyond `message` |

```json
{
    "status": true,
    "message": "Hello there",
    "errors": [
        "errors"
    ]
}
```

**404** — Klienti nuk u gjet, ose nuk i perket kompanise suaj.

| Field | Type | Description |
| --- | --- | --- |
| `status` | boolean | Always false. A successful response carries `status: true` and a `data` object instead |
| `message` | string | The exception message. Empty when the failure carries no exception of its own |
| `errors` | array | Messages to show the operator or to log. Absent when the failure has nothing to add beyond `message` |

```json
{
    "status": true,
    "message": "Hello there",
    "errors": [
        "errors"
    ]
}
```

**409** — Ekziston tashme nje klient me te njejtat te dhena.

| Field | Type | Description |
| --- | --- | --- |
| `status` | boolean | Always false. A successful response carries `status: true` and a `data` object instead |
| `message` | string | The exception message. Empty when the failure carries no exception of its own |
| `errors` | array | Messages to show the operator or to log. Absent when the failure has nothing to add beyond `message` |

```json
{
    "status": true,
    "message": "Hello there",
    "errors": [
        "errors"
    ]
}
```

**422** — Te dhenat nuk kaluan validimin. Kjo pergjigje perdor fushen `success`, jo `status`. Perfshin edhe rastin kur `type` ndryshon nga ai ekzistues.

| Field | Type | Description |
| --- | --- | --- |
| `success` | boolean | Always false |
| `message` | string | A single summary line, the same for every validation failure |
| `errors` | object | The failing fields, each with the messages for it. Dotted keys point into nested objects and array items, e.g. `lines.0.quantity` |

```json
{
    "success": true,
    "message": "Hello there",
    "errors": []
}
```

**429** — Kufiri i kerkesave u arrit. Kufiri per endpoint kthen zarfin standard te gabimit; kufiri i pergjithshem kthen vetem `message` bashke me header-in `Retry-After`.

| Field | Type | Description |
| --- | --- | --- |
| `status` | boolean | Always false. A successful response carries `status: true` and a `data` object instead |
| `message` | string | The exception message. Empty when the failure carries no exception of its own |
| `errors` | array | Messages to show the operator or to log. Absent when the failure has nothing to add beyond `message` |

```json
{
    "status": true,
    "message": "Hello there",
    "errors": [
        "errors"
    ]
}
```

**500** — Gabim i papritur ne server.

| Field | Type | Description |
| --- | --- | --- |
| `status` | boolean | Always false. A successful response carries `status: true` and a `data` object instead |
| `message` | string | The exception message. Empty when the failure carries no exception of its own |
| `errors` | array | Messages to show the operator or to log. Absent when the failure has nothing to add beyond `message` |

```json
{
    "status": true,
    "message": "Hello there",
    "errors": [
        "errors"
    ]
}
```
