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

Ngarko certifikaten elektronike

POST /api/v1/on-boarding/certificate Requires authentication Rate limited by the `api-global` limiter v1

Send a bearer token in the Authorization header.

Ngarkoni certifikaten elektronike (.p12 ose .pfx) per kompanine. Fjalekalimi duhet te jete i sakte dhe NIPT-i ne certifikate duhet te perputhet me NIPT-in e kompanise.

Sandbox (DEMO): ne instancen DEMO ky endpoint kthen success per cdo certifikate dhe cdo fjalekalim. expiresAt qe kthehet eshte +1 vit nga sot.

Full URL: https://fature.al/api/v1/on-boarding/certificate

Body parameters

Name Type Required Description
certificate_file string<binary>, nullable no Certifikata elektronike si skedar, ne formatin PFX. Me te nenshkruhen faturat qe dergohen ne fiskalizim, prandaj pa nje certifikate te vlefshme nuk leshohet dot fature.
password string, nullable no Fjalekalimi i skedarit PFX. Pa te certifikata nuk hapet dot dhe nenshkrimi deshton.

Responses

200 Kur fjalekalimi eshte i gabuar ose NIPT-i i certifikates nuk perputhet me kompanine, pergjigja kthehet me HTTP 200 dhe `status: false`.

201 Created

Field Type Description
status boolean
data object
data.cert object
data.cert.expiresAt string

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`

Example request

cURL
curl -X POST 'https://fature.al/api/v1/on-boarding/certificate' \
  -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 '{
    "certificate_file": "certificate file",
    "password": "correct-horse-battery"
}'
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',
])->post('https://fature.al/api/v1/on-boarding/certificate', [
    'certificate_file' => 'certificate file',
    'password' => 'correct-horse-battery',
]);

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

$client = new Client();

$response = $client->request('POST', 'https://fature.al/api/v1/on-boarding/certificate', [
    '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' => [
        'certificate_file' => 'certificate file',
        'password' => 'correct-horse-battery',
    ],
]);

$data = json_decode((string) $response->getBody(), true);
JavaScript
const response = await fetch('https://fature.al/api/v1/on-boarding/certificate', {
  method: 'POST',
  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({
      "certificate_file": "certificate file",
      "password": "correct-horse-battery"
  })
});

const data = await response.json();

Example response

201
{
    "status": true,
    "data": {
        "cert": {
            "expiresAt": "expiresAt"
        }
    }
}
422
{
    "success": true,
    "message": "Hello there",
    "errors": []
}

Regjistrimi eshte falas.

Regjistrohu ne fature.al

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