Back to Home

easyPos - Integration Guide

API & File Integration

Fiscalization Software

Version 2.3.0 | Updated: 01/2026

Overview

This document provides comprehensive guidance for integrating with the easyPos system. Two main methods are supported:

  • Local API Integration: Using HTTP endpoints with JSON payloads
  • File Integration: Using JSON or TXT files in the watched directory

1. Introduction

easyPos is fiscalization software for normal and simple invoices in Albania. This guide demonstrates how to integrate with easyPos using either file-based integration or RESTful API calls.

1.1 Integration Methods

  1. Local API Integration: HTTP requests with JSON payloads
  2. File Integration: Drop JSON or TXT files into a watched directory

1.2 Prerequisites

  • Windows or MacOS operating system (required for easyPos installation)
  • Valid easyPos installation and configuration
  • API authorization string configured (for API integration)
  • Local API service enabled in easyPos settings (for API integration)
  • Network connectivity to easyPos local service (for API integration)
  • File watcher configured (for file integration)

2. Local API Integration

2.1 Base URL

http://[server-ip]:port/v1/...

2.2 Headers

Content-Type: application/json Authorization: [your-authorization-string]

2.3 API Endpoints

Method Endpoint Description
GET/v1Test connection
POST/v1/invoices/newCreate invoice(s)
GET/v1/invoicesGet all invoices
GET/v1/invoices/:idGet single invoice
GET/v1/operatorsGet operators
GET/v1/entitiesGet entities
GET/v1/balanceGet cash balance
POST/v1/balance/initiateReport initial balance
POST/v1/balance/depositDeposit
POST/v1/balance/withdrawWithdraw

2.4 Response Format

{
  "status": 0,
  "response": {
    "nslf": "C352A1442630779BD016323CB4765331",
    "nivf": "19d7cf18-9f2f-4501-b0d1-48830dfc0750",
    "link": "https://efiskalizimi-app.tatime.gov.al/...",
    "text": "Sukses"
  }
}
  • status: 0 = Success, 1 = Error, 2 = Pending
  • nslf: NSLF - Internal Invoice Counter (IIC)
  • nivf: NIVF - Fiscal Invoice Number (FIC)
  • link: Invoice verification URL

3. File Integration

3.1 JSON Format

Place JSON files in the watched directory. easyPos will process them automatically.

Important: The "app" Field

When using JSON file integration, the "app" field is RECOMMENDED to identify the application/integration source.

Basic Invoice

{
  "app": "",
  "articles": [
    {
      "articleId": "ART001",
      "vatCode": "B",
      "name": "Product",
      "soldIn": "cope",
      "price": 500,
      "units": 2
    }
  ]
}

Invoice with Buyer

{
  "app": "",
  "buyer": {
    "buyerIDType": "NUIS",
    "buyerIDNum": "L12345678A",
    "buyerName": "Test Company",
    "buyerAddress": "Test Street 123",
    "buyerTown": "Tirana",
    "buyerCountry": "ALB"
  },
  "articles": [
    {
      "articleId": "ART001",
      "vatCode": "B",
      "name": "Service",
      "soldIn": "cope",
      "price": 1000,
      "units": 1
    }
  ]
}

3.2 TXT Formats

easyPos supports two TXT file formats for legacy fiscal device integration:

3.2.1 AED Format

CLEAR
KEY REG
SALE DPT=1,QTY=1,PRICE=500,DES='Product'
SALE DPT=1,QTY=2,PRICE=300,DES='Service'
SUBTOT
CLOSE TENDER=1

3.2.2 IVA Format

The IVA format uses a structured line-based syntax with specific prefixes:

Basic Invoice:

H,1,______,_,__;
S,1,______,_,__;"Artikull";500.00;2.00;1;1;1;
T,1,______,_,__;
F,1,______,_,__;

Invoice with Buyer (NUIS):

H,1,______,_,__;
B,1,______,_,__;"NUIS";"L00000000B";"Buyer Name";"Address";"Tirane";"ALB";
S,1,______,_,__;"Artikull";500.00;2.00;1;1;1;
T,1,______,_,__;
F,1,______,_,__;

Card Payment:

H,1,______,_,__;
$ISWITHCARD=1
S,1,______,_,__;"Artikull";500.00;2.00;1;1;1;
T,1,______,_,__;
F,1,______,_,__;

With Discount:

H,1,______,_,__;
S,1,______,_,__;"Product";150.00;2.00;1;1;2;
C,1,______,_,__;2;15.0;
T,1,______,_,__;
F,1,______,_,__;

IVA Line Prefixes

  • H - Header (start of invoice)
  • B - Buyer information
  • S - Sale line (article)
  • C - Discount/rebate for previous line
  • P - Invoice notes
  • OP - Operator code
  • T - Total
  • F - Footer (end of invoice)

4. Payment Methods

ValueCategoryDescription
BANKNOTECASHCash
CARDCASHCard
CHECKCASHCheck
SVOUCHERCASHVoucher
COMPANYCASHCompany
ACCOUNTNONCASHBank transfer
FACTORINGNONCASHFactoring
COMPENSATIONNONCASHCompensation
KINDNONCASHPayment in kind (clearing)
OTHERNONCASHOther, non-cash

Simplified Payment Types for JSON

For JSON file integration, use these simplified payment types:

  • CASH - Cash payment
  • CARD - Card payment
  • ACCOUNT - Bank transfer (requires bankDetails)
  • CHECK - Check payment
  • OTHER - Other non-cash payment

Example with OTHER Payment

{
  "app": "",
  "articles": [
    {
      "articleId": "ART001",
      "vatCode": "B",
      "name": "Product",
      "soldIn": "cope",
      "price": 500,
      "units": 2
    }
  ],
  "payment": {
    "type": "OTHER"
  }
}

5. Field Reference

5.1 VAT Codes

CodeRateDescription
A0%Tax free (TAX_FREE)
B20%Standard rate
C0%Exemption Type 2
D10%Reduced rate
E6%Reduced rate
J0%Export of goods

5.2 ID Types

ValueDescription
NUISNIPT (Tax ID)
IDPersonal ID number
PASSPassport number
VATVAT number
TAXTax number
SOCSocial security number

5.4 Invoice Types

TypeDescription
(default)Standard sales invoice
ORDEROrder
CANCELInvoice cancellation
CORRECTIVECorrective invoice
SUMMARYSummary invoice
EXCHANGECurrency exchange

6. Examples

6.1 Invoice with Multiple Payments

{
  "app": "",
  "articles": [
    {
      "articleId": "ART001",
      "vatCode": "B",
      "name": "Product",
      "soldIn": "cope",
      "price": 1000,
      "units": 1
    }
  ],
  "payment": [
    { "type": "CASH", "amount": 600 },
    { "type": "CARD", "amount": 400 }
  ]
}

6.2 Invoice with Foreign Currency

{
  "app": "",
  "currency": {
    "code": "EUR",
    "exRate": 100.5
  },
  "articles": [
    {
      "articleId": "ART001",
      "vatCode": "B",
      "name": "Product",
      "soldIn": "cope",
      "price": 50,
      "units": 2
    }
  ],
  "payment": { "type": "CASH" }
}

6.3 Invoice Cancellation

{
  "app": "",
  "invoiceType": "CANCEL",
  "iicRef": "3CA552F6475201847CF63E3499E74727"
}

6.4 Invoice with Bank Transfer

{
  "app": "",
  "buyer": {
    "buyerIDType": "NUIS",
    "buyerIDNum": "L12345678A",
    "buyerName": "Company",
    "buyerTown": "Tirana",
    "buyerCountry": "ALB"
  },
  "articles": [
    {
      "articleId": "ART001",
      "vatCode": "B",
      "name": "Service",
      "soldIn": "cope",
      "price": 5000,
      "units": 1
    }
  ],
  "payment": {
    "type": "ACCOUNT",
    "bankDetails": {
      "country": "Albania",
      "countryCode": "AL",
      "currency": "ALL",
      "idNumber": "AL123456789012345678"
    }
  }
}

6.5 Invoice with Article Rebate

{
  "app": "",
  "articles": [
    {
      "articleId": "PROD001",
      "vatCode": "B",
      "name": "Product with % Discount",
      "soldIn": "cope",
      "price": 1000,
      "units": 5,
      "rebate": {
        "inPercentage": 10
      }
    }
  ],
  "payment": { "type": "CASH" }
}

7. Best Practices

7.1 General Guidelines

  • Validate Data: Always validate JSON structure before sending
  • Handle Errors: Implement proper error handling for failed transactions
  • Store IIC: Save the returned IIC (nslf) for future reference and cancellations
  • Network Reliability: For API integration, implement retry logic
  • Demo Account: Request a demo account from support staff to test your integration
  • Document ID: Use UUIDv4 format for custom docId fields to ensure uniqueness

7.2 File Integration Best Practices

  • Use unique filenames to avoid conflicts
  • Monitor the response files for processing results
  • Implement file locking mechanisms to prevent partial reads
  • Clean up processed files regularly
  • Always include the app field to identify your application

7.3 Local API Integration Best Practices

  • Use connection pooling for better performance
  • Implement exponential backoff for retries
  • Log all requests and responses for debugging
  • Configure proper network timeouts
  • Ensure local network connectivity to easyPos service

8. Troubleshooting

8.1 File Not Processing

  • Check file permissions
  • Verify JSON syntax validity
  • Ensure file is completely written before easyPos reads it
  • Check easyPos service status
  • Verify the app field is present

8.2 API Connection Errors

  • Verify network connectivity to easyPos server
  • Check firewall settings
  • Confirm correct endpoint URL and port
  • Validate authorization string configuration
  • Ensure local API service is enabled in easyPos settings

8.3 Invalid Data Errors

  • Validate all required fields are present
  • Check data types match specifications
  • Verify VAT codes are valid
  • Ensure amounts are properly formatted

9. Integration Checklist

9.1 Setup

  • ☐ Software installed and configured
  • ☐ Demo account available
  • ☐ Authorization string configured
  • ☐ Integration method selected (File or API)

9.2 Development

  • ☐ JSON structure implemented
  • ☐ Error handling implemented
  • ☐ Response processing implemented

9.3 Testing

  • ☐ Basic invoice tested
  • ☐ Invoice with buyer tested
  • ☐ Cancellation tested
  • ☐ Error scenarios tested

Important Note

To test the integration, request a demo account from support staff.


© ESDP - easyPos Integration Guide v2.3.0