fature.al eshte platforma e faturimit dhe fiskalizimit per bizneset ne Shqiperi. Hap nje llogari
Skip to content
fature.al API Menu

Perditeso klient

PUT /api/v1/clients/{id} Requires authentication Rate limited by the `api-global` limiter v1

Send a bearer token in the Authorization header.

Perditeson nje klient ekzistues. Trupi ka te njejtin format si POST /clients, prandaj vlejne te njejtat fusha te detyrueshme sipas client_type.

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

Path parameters

Name Type Required Description
id integer yes ID e klientit.

Body parameters

Name Type Required Description
nationality_code string, minLength 3, maxLength 3, nullable no Kodi ISO 3166-1 alpha-3 i kombesise. Pa te merret ALB.
nationality_id integer, nullable no ID e nacionalitetit ne fature.al. Plotesohet vete nga nationality_code.
telephone string, maxLength 255, nullable no Telefoni.
email string<email>, maxLength 255, nullable no Email.
customer_number string, maxLength 30, nullable no Numri unik i klientit ne sistemin tuaj.
gender string, maxLength 10, nullable no Gjinia, vetem per PERSON.
birthday string<date-time>, nullable no Data e lindjes (YYYY-MM-DD).

Responses

200 OK

Field Type Description
status boolean
data object
data.client object
data.client.id integer
data.client.name string
data.client.client_type string, nullable
data.client.company_name string, nullable
data.client.company_type string, nullable
data.client.nipt string, nullable
data.client.first_name string, nullable
data.client.surname string, nullable
data.client.birthday string, nullable
data.client.id_type string, nullable
data.client.id_num string, nullable
data.client.nationality_code string, nullable
data.client.nationality_id integer, nullable
data.client.telephone string, nullable
data.client.email string, nullable
data.client.address string, nullable
data.client.city string, nullable
data.client.customer_number string, nullable
data.client.created_at string, nullable

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`

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`

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`

422 Te dhenat nuk kaluan validimin. Kjo pergjigje perdor fushen `success`, jo `status`.

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`

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`

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`

Example request

cURL
curl -X PUT 'https://fature.al/api/v1/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 '{
    "nationality_code": "ALB",
    "nationality_id": 1,
    "telephone": "+355691234567",
    "email": "[email protected]",
    "customer_number": "CLI-001",
    "gender": "M",
    "birthday": "1990-01-15"
}'
PHP (Laravel)
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'Authorization' => 'Bearer YOUR_TOKEN',
    'X-Client-Id' => 'YOUR_CLIENT_ID',
    'X-Client-Secret' => 'YOUR_CLIENT_SECRET',
    'Accept' => 'application/json',
    'Content-Type' => 'application/json',
])->put('https://fature.al/api/v1/clients/42', [
    'nationality_code' => 'ALB',
    'nationality_id' => 1,
    'telephone' => '+355691234567',
    'email' => '[email protected]',
    'customer_number' => 'CLI-001',
    'gender' => 'M',
    'birthday' => '1990-01-15',
]);

$data = $response->json();
PHP (Guzzle)
use GuzzleHttp\Client;

$client = new Client();

$response = $client->request('PUT', 'https://fature.al/api/v1/clients/42', [
    'headers' => [
        'Authorization' => 'Bearer YOUR_TOKEN',
        'X-Client-Id' => 'YOUR_CLIENT_ID',
        'X-Client-Secret' => 'YOUR_CLIENT_SECRET',
        'Accept' => 'application/json',
        'Content-Type' => 'application/json',
    ],
    'json' => [
        'nationality_code' => 'ALB',
        'nationality_id' => 1,
        'telephone' => '+355691234567',
        'email' => '[email protected]',
        'customer_number' => 'CLI-001',
        'gender' => 'M',
        'birthday' => '1990-01-15',
    ],
]);

$data = json_decode((string) $response->getBody(), true);
JavaScript
const response = await fetch('https://fature.al/api/v1/clients/42', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'X-Client-Id': 'YOUR_CLIENT_ID',
    'X-Client-Secret': 'YOUR_CLIENT_SECRET',
    'Accept': 'application/json',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "nationality_code": "ALB",
      "nationality_id": 1,
      "telephone": "+355691234567",
      "email": "[email protected]",
      "customer_number": "CLI-001",
      "gender": "M",
      "birthday": "1990-01-15"
  })
});

const data = await response.json();

Example response

200
{
    "status": true,
    "data": {
        "client": {
            "id": 1,
            "name": "Jane Doe",
            "client_type": "client type",
            "company_name": "Jane Doe",
            "company_type": "company type",
            "nipt": "nipt",
            "first_name": "Jane",
            "surname": "Jane Doe",
            "birthday": "birthday",
            "id_type": "id type",
            "id_num": "id num",
            "nationality_code": "nationality code",
            "nationality_id": 1,
            "telephone": "+15551234567",
            "email": "[email protected]",
            "address": "1 Example Street",
            "city": "Berlin",
            "customer_number": "customer number",
            "created_at": "created at"
        }
    }
}
403
{
    "status": true,
    "message": "Hello there",
    "errors": [
        "errors"
    ]
}
404
{
    "status": true,
    "message": "Hello there",
    "errors": [
        "errors"
    ]
}
409
{
    "status": true,
    "message": "Hello there",
    "errors": [
        "errors"
    ]
}
422
{
    "success": true,
    "message": "Hello there",
    "errors": []
}
429
{
    "status": true,
    "message": "Hello there",
    "errors": [
        "errors"
    ]
}
500
{
    "status": true,
    "message": "Hello there",
    "errors": [
        "errors"
    ]
}

Regjistrimi eshte falas.

Regjistrohu ne fature.al

This page as Markdown, or the whole API as OpenAPI.