create_invoice
Issue a Serbia B2B electronic invoice (elektronska faktura) into the national SEF eFaktura system (Ministry of Finance). Builds UBL 2.1 XML in the SRB-CIUS customization (Serbia's CIUS of EN 16931) and uploads it under your own SEF API key. Bring your own credential as a header: x-sef-api-key (the API key you self-generate in the SEF portal under Settings -> API management / Podesavanja -> Upravljanje API). Header x-sef-mode: prod switches to the live rail (default = demo, no fiscal effect). You must supply your own seller identity in the arguments (supplier_pib + supplier_name), because SEF validates that the seller in the XML matches your account. Returns sales_invoice_id (SEF's invoice id) — poll query_invoice with it to learn the status (New/Sent/Approved/Rejected/Cancelled...). Serbian VAT rates: 20 (standard), 10 (reduced), 0 (zero-rated). Amounts are in RSD (Serbian dinar). Set send_to_cir=true when the buyer is a budget / public-sector user (registration in the Central Invoice Register / CRF is then mandatory).
Parameters17
| supplier_pib | string | required | Your (seller) PIB / tax number (poreski identifikacioni broj), exactly 9 digits. Required — SEF validates it against your API-key account. |
| supplier_name | string | required | Your (seller) legal name (BT-27). Required for a valid invoice. |
| supplier_registration_number | string | optional | Your (seller) company registration number (maticni broj), 8 digits (BT-30). Recommended. |
| supplier_address | string | optional | Your (seller) street address (BT-35). Recommended. |
| supplier_city | string | optional | Your (seller) city (BT-37). Default Beograd. |
| customer_name | string | required | Buyer legal name (naziv) as registered. |
| customer_pib | string | required | Buyer PIB / tax number, exactly 9 digits. |
| customer_registration_number | string | optional | Buyer company registration number (maticni broj), 8 digits (BT-47). Recommended. |
| customer_address | string | required | Buyer street address (BT-50 address line 1). |
| customer_city | string | optional | Buyer city (BT-52). Default Beograd. |
| customer_country | string | optional | Buyer country code (BT-55). Default RS. |
| invoice_number | string | optional | Your invoice number (BT-1). Auto-generated if omitted. |
| issue_date | string | optional | Invoice issue date (BT-2), YYYY-MM-DD. Default: today (UTC). |
| due_date | string | optional | Optional payment due date (BT-9), YYYY-MM-DD. |
| currency | string | optional | Document currency (BT-5). Default RSD. |
| send_to_cir | boolean | optional | Send to the Central Invoice Register (CRF). Set true when the buyer is a budget / public-sector user; default false for private B2B. |
| lines | array | required | Invoice lines. Each: name, unit_price (net, VAT-exclusive, RSD), vat_rate (20|10|0), optional quantity (default 1) and unit_code (UN/ECE Rec 20, default C62 = piece). |
Raw schema
{
"type": "object",
"properties": {
"supplier_pib": {
"type": "string",
"description": "Your (seller) PIB / tax number (poreski identifikacioni broj), exactly 9 digits. Required — SEF validates it against your API-key account."
},
"supplier_name": {
"type": "string",
"description": "Your (seller) legal name (BT-27). Required for a valid invoice."
},
"supplier_registration_number": {
"type": "string",
"description": "Your (seller) company registration number (maticni broj), 8 digits (BT-30). Recommended."
},
"supplier_address": {
"type": "string",
"description": "Your (seller) street address (BT-35). Recommended."
},
"supplier_city": {
"type": "string",
"description": "Your (seller) city (BT-37). Default Beograd."
},
"customer_name": {
"type": "string",
"description": "Buyer legal name (naziv) as registered."
},
"customer_pib": {
"type": "string",
"description": "Buyer PIB / tax number, exactly 9 digits."
},
"customer_registration_number": {
"type": "string",
"description": "Buyer company registration number (maticni broj), 8 digits (BT-47). Recommended."
},
"customer_address": {
"type": "string",
"description": "Buyer street address (BT-50 address line 1)."
},
"customer_city": {
"type": "string",
"description": "Buyer city (BT-52). Default Beograd."
},
"customer_country": {
"type": "string",
"description": "Buyer country code (BT-55). Default RS."
},
"invoice_number": {
"type": "string",
"description": "Your invoice number (BT-1). Auto-generated if omitted."
},
"issue_date": {
"type": "string",
"description": "Invoice issue date (BT-2), YYYY-MM-DD. Default: today (UTC)."
},
"due_date": {
"type": "string",
"description": "Optional payment due date (BT-9), YYYY-MM-DD."
},
"currency": {
"type": "string",
"description": "Document currency (BT-5). Default RSD."
},
"send_to_cir": {
"type": "boolean",
"description": "Send to the Central Invoice Register (CRF). Set true when the buyer is a budget / public-sector user; default false for private B2B."
},
"lines": {
"type": "array",
"minItems": 1,
"description": "Invoice lines. Each: name, unit_price (net, VAT-exclusive, RSD), vat_rate (20|10|0), optional quantity (default 1) and unit_code (UN/ECE Rec 20, default C62 = piece).",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Item name/description (BT-153)."
},
"unit_price": {
"type": "number",
"description": "Net unit price in RSD, VAT-exclusive (BT-146)."
},
"vat_rate": {
"type": "number",
"description": "VAT rate percent: 20 standard, 10 reduced, 0 zero-rated (BT-152)."
},
"quantity": {
"type": "number",
"description": "Quantity (BT-129). Default 1."
},
"unit_code": {
"type": "string",
"description": "Unit of measure UN/ECE Rec 20 code (BT-130). Default C62 (piece)."
}
},
"required": [
"name",
"unit_price",
"vat_rate"
]
}
}
},
"required": [
"supplier_pib",
"supplier_name",
"customer_name",
"customer_pib",
"customer_address",
"lines"
]
}