Complete API Documentation for E-SDC Integration
This document describes the API exposed by E-SDC devices to POS and invoicing systems for fiscal invoice creation and Secure Element management.
E-SDC provides interactive API documentation via Swagger UI:
Swagger UI: http://localhost:8888/swagger/index.html
POS systems must integrate the following endpoints for full SDC compliance:
| Category | Endpoint | Method | Purpose |
|---|---|---|---|
| Invoice | /api/v3/invoices |
POST | Create and fiscalize invoices |
| Invoice | /api/v3/invoices/{requestId} |
GET | Retrieve signed invoice by request ID |
| Secure Element | /api/v3/pin |
POST | Verify PIN to unlock Secure Element |
| Secure Element | /api/v3/status |
GET | Get SDC and Secure Element status |
| Secure Element | /api/v3/environment-parameters |
GET | Get environment configuration |
| Connectivity | /api/v3/attention |
GET | Verify E-SDC availability |
Creates a fiscal invoice and processes it through the Secure Element. Returns a digitally signed invoice with verification URL and QR code.
http://{ESDC_IP}:{PORT}/api/v3/invoices
Example: http://localhost:8888/api/v3/invoices
No authentication required
Accept: application/jsonContent-Type: application/jsonRequestId (optional): Unique identifier for request tracking (max 32 chars)Accept-Language (optional): Language preference for invoice journal| Field | Required | Description |
|---|---|---|
invoiceType |
Yes | 0=Normal, 1=Proforma, 2=Copy, 3=Training, 4=Advance |
transactionType |
Yes | 0=Sale, 1=Refund |
payment[] |
Yes | Array of payment methods with amounts |
items[] |
Yes | Array of invoice items (min 1, supports 250-500) |
cashier |
Optional* | Cashier ID (mandatory in some jurisdictions) |
buyerId |
Optional* | Buyer identification (max 20 chars) |
name (required): Product/service name (max 2048 chars)quantity (required): Quantity with max 3 decimals (min 0.001)unitPrice (required): Unit pricetotalAmount (required): Gross price (unitPrice × quantity)labels[] (required): Tax rate labels (min 1)gtin (optional): Global Trade Item Number (8-14 chars)invoiceNumber: SDC invoice number (requestedBy-signedBy-totalCounter)invoiceCounter: Counter in format transactionTypeCounter/totalCountersdcDateTime: Local date/time from E-SDC (ISO 8601)verificationUrl: URL for invoice verificationverificationQRCode: Base64 encoded QR code image (GIF)journal: Textual representation for printingsignature: Base64 encoded digital signaturetaxItems[]: Calculated tax breakdown per categoryRetrieves a previously signed invoice using its request identifier. Used when POS didn't receive the initial response.
http://{ESDC_IP}:{PORT}/api/v3/invoices/{requestId}
Example: http://localhost:8888/api/v3/invoices/4c5730b50eb7b50e7a0292600a67ce16
Returns the same structure as Create Invoice, or null if not found.
Verifies the PIN entered by cashier to unlock the Secure Element. PIN is stored in RAM until card is removed or device is powered off.
http://{ESDC_IP}:{PORT}/api/v3/pin
Example: http://localhost:8888/api/v3/pin
Plain text string containing 4 ASCII digits (0-9). Example: "1234"
"0100": PIN correct, Secure Element unlocked"2100": Wrong PIN"2110": Card locked (too many attempts)"1300": Smart card not inserted"2400": SDC not fully configuredRetrieves current status of SDC and Secure Element, including tax rates, PIN requirements, and device information.
http://{ESDC_IP}:{PORT}/api/v3/status
Example: http://localhost:8888/api/v3/status
isPinRequired: true if PIN needs to be enteredauditRequired: true if audit threshold reached (75% of limit)sdcDateTime: Current local date/time (ISO 8601)lastInvoiceNumber: Last invoice signeddeviceSerialNumber: MRC format serial numbersupportedLanguages[]: Supported language codescurrentTaxRates: Active tax rate configurationgsc[]: General status codesmssc[]: Manufacturer-specific codesReturns environment configuration including tax authority information, endpoints, and supported languages.
http://{ESDC_IP}:{PORT}/api/v3/environment-parameters
Example: http://localhost:8888/api/v3/environment-parameters
organizationName: Tax authority nameenvironmentName: Environment identifier (e.g., SANDBOX, PRODUCTION)endpoints: Available API endpoints (taxpayerAdminPortal, taxCoreApi, root)supportedLanguages[]: Language codesserverTimeZone: Server timezonentpServer: NTP server for time syncUsed by POS to verify E-SDC availability before sending invoice or PIN requests. Reduces communication errors and timeouts.
http://{ESDC_IP}:{PORT}/api/v3/attention
Example: http://localhost:8888/api/v3/attention
HTTP 200 OK if SDC is available.
0000: All OK0100: PIN OK0210: Internet Available0220: Internet Unavailable1100: Storage 90% Full1300: Smart Card Not Present1400: Audit Required1500: PIN Code Required2100: PIN Not OK2110: Card Locked2210: Secure Element Locked2220: SE Communication Failed2310: Invalid Tax Labels2400: SDC Not Configured2800-2809: Field validation errors2809: Secure Element ExpiredSDC returns structured error messages in the following format:
{
"message": "The request is invalid.",
"modelState": [
{
"property": "invoiceType",
"errors": ["2805"]
},
{
"property": "items[0].labels[0]",
"errors": ["2310"]
}
]
}
/api/v3/attention to check SDC availability/api/v3/status to check PIN requirements and audit status/api/v3/pin for PIN verification (E-SDC)/api/v3/invoices (POST) for invoice fiscalization/api/v3/invoices/{requestId} (GET) for retry scenarios/api/v3/environment-parameters for environment configpayment[] arrayKey Points for POS Developers:
/api/v3/ prefixComplete integration of all these endpoints ensures full fiscal compliance and optimal POS-to-SDC communication.