/api/v2/clients/{id}
Requires authentication
Rate limited by the `api-global` limiter
v2
Send a bearer token in the Authorization header.
Kthen klientin ne formatin e ri, me objekte te ndara: company ose person sipas type, plus
address dhe contact.
Eshte i njejti klient qe kthen edhe v1, vetem i strukturuar ndryshe. Nje klient i krijuar me
v1 lexohet ketu pa asnje hap tjeter.
Full URL: https://fature.al/api/v2/clients/{id}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | integer | yes | ID e klientit. |
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 |
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` |
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 -X GET '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'
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',
])->get('https://fature.al/api/v2/clients/42');
$data = $response->json();
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('GET', 'https://fature.al/api/v2/clients/42', [
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
'X-Client-Id' => 'YOUR_CLIENT_ID',
'X-Client-Secret' => 'YOUR_CLIENT_SECRET',
'Accept' => 'application/json',
],
]);
$data = json_decode((string) $response->getBody(), true);
const response = await fetch('https://fature.al/api/v2/clients/42', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'X-Client-Id': 'YOUR_CLIENT_ID',
'X-Client-Secret': 'YOUR_CLIENT_SECRET',
'Accept': 'application/json'
}
});
const data = await response.json();
Example response
{
"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": "[email protected]"
},
"customer_number": "customer number",
"verified": true,
"created_at": "created at",
"updated_at": "updated at"
}
}
}
{
"status": true,
"message": "Hello there",
"errors": [
"errors"
]
}
{
"status": true,
"message": "Hello there",
"errors": [
"errors"
]
}