curl -X GET "https://api.contazen.ro/v1/expenses/exp_abc123?expand=supplier,category,user" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
const expenseId = 'exp_abc123';
const expand = ['supplier', 'category', 'user'].join(',');
const response = await fetch(`https://api.contazen.ro/v1/expenses/${expenseId}?expand=${expand}`, {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log('Expense details:', data.expense);
$expenseId = 'exp_abc123';
$expand = 'supplier,category,user';
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.contazen.ro/v1/expenses/{$expenseId}?expand={$expand}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json'
]
]);
$response = curl_exec($curl);
$data = json_decode($response, true);
curl_close($curl);
print_r($data['expense']);
{
"success": true,
"expense": {
"id": "exp_abc123",
"reference": "INV-2024-001",
"description": "Office supplies purchase including paper, pens, and folders",
"amount": {
"total": "238.00",
"without_vat": "200.00",
"vat": "38.00",
"currency": "RON"
},
"account_amount": {
"total": "238.00",
"without_vat": "200.00",
"vat": "38.00",
"currency": "RON"
},
"vat_percent": 19,
"with_vat": true,
"date": "2024-01-15",
"due_date": "2024-02-15",
"paid_date": null,
"is_paid": false,
"payment_type": null,
"status": "unpaid",
"supplier": {
"id": "sup_xyz789",
"name": "Office Depot SRL",
"cui": "RO12345678",
"rc": "J40/1234/2020",
"address": "Str. Exemplu 123, Sector 1",
"city": "Bucharest",
"county": "Bucharest",
"country": "Romania"
},
"category": {
"id": 1,
"name": "Office Expenses",
"parent_id": null
},
"user": {
"id": 1,
"name": "John Doe"
},
"attachment": {
"url": "https://api.contazen.ro/v1/files/download/att_def456",
"type": "pdf"
},
"items": [
{
"id": 4201,
"line_index": 0,
"name": "Office supplies",
"description": null,
"quantity": 1,
"unit_code": null,
"unit_price": 200.00,
"vat_rate": 19,
"amount_wvat": 200.00,
"amount_vat": 38.00,
"amount": 238.00,
"category_id": null,
"product_id": null
}
],
"vat_breakdown": null,
"category_source": "manual",
"category_confidence": null,
"efactura": {
"supplier_invoice_id": "si_abc123",
"invoice_number": "119079",
"anaf_message_id": "4891234567",
"xml_available": true,
"pdf_available": true,
"pdf_url": "https://app.contazen.ro/api/v1/expenses/exp_abc123/efactura-pdf"
},
"created_at": "2024-01-15 10:30:00",
"updated_at": "2024-01-15 10:30:00"
}
}
{
"success": false,
"error": {
"message": "Expense not found",
"type": "invalid_request_error",
"code": "resource_missing",
"param": "id"
}
}
Expenses
Retrieve Expense
Get detailed information about a specific expense by its CzUid
GET
/
expenses
/
{id}
curl -X GET "https://api.contazen.ro/v1/expenses/exp_abc123?expand=supplier,category,user" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
const expenseId = 'exp_abc123';
const expand = ['supplier', 'category', 'user'].join(',');
const response = await fetch(`https://api.contazen.ro/v1/expenses/${expenseId}?expand=${expand}`, {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log('Expense details:', data.expense);
$expenseId = 'exp_abc123';
$expand = 'supplier,category,user';
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.contazen.ro/v1/expenses/{$expenseId}?expand={$expand}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json'
]
]);
$response = curl_exec($curl);
$data = json_decode($response, true);
curl_close($curl);
print_r($data['expense']);
{
"success": true,
"expense": {
"id": "exp_abc123",
"reference": "INV-2024-001",
"description": "Office supplies purchase including paper, pens, and folders",
"amount": {
"total": "238.00",
"without_vat": "200.00",
"vat": "38.00",
"currency": "RON"
},
"account_amount": {
"total": "238.00",
"without_vat": "200.00",
"vat": "38.00",
"currency": "RON"
},
"vat_percent": 19,
"with_vat": true,
"date": "2024-01-15",
"due_date": "2024-02-15",
"paid_date": null,
"is_paid": false,
"payment_type": null,
"status": "unpaid",
"supplier": {
"id": "sup_xyz789",
"name": "Office Depot SRL",
"cui": "RO12345678",
"rc": "J40/1234/2020",
"address": "Str. Exemplu 123, Sector 1",
"city": "Bucharest",
"county": "Bucharest",
"country": "Romania"
},
"category": {
"id": 1,
"name": "Office Expenses",
"parent_id": null
},
"user": {
"id": 1,
"name": "John Doe"
},
"attachment": {
"url": "https://api.contazen.ro/v1/files/download/att_def456",
"type": "pdf"
},
"items": [
{
"id": 4201,
"line_index": 0,
"name": "Office supplies",
"description": null,
"quantity": 1,
"unit_code": null,
"unit_price": 200.00,
"vat_rate": 19,
"amount_wvat": 200.00,
"amount_vat": 38.00,
"amount": 238.00,
"category_id": null,
"product_id": null
}
],
"vat_breakdown": null,
"category_source": "manual",
"category_confidence": null,
"efactura": {
"supplier_invoice_id": "si_abc123",
"invoice_number": "119079",
"anaf_message_id": "4891234567",
"xml_available": true,
"pdf_available": true,
"pdf_url": "https://app.contazen.ro/api/v1/expenses/exp_abc123/efactura-pdf"
},
"created_at": "2024-01-15 10:30:00",
"updated_at": "2024-01-15 10:30:00"
}
}
{
"success": false,
"error": {
"message": "Expense not found",
"type": "invalid_request_error",
"code": "resource_missing",
"param": "id"
}
}
Overview
The Retrieve Expense endpoint allows you to get complete details about a specific expense record. You can optionally expand related data such as supplier information, category details, and user information.Path Parameters
string
required
The CzUid of the expense to retrieve
Query Parameters
string
Comma-separated list of related data to include in the response:
supplier- Include full supplier details instead of just the IDcategory- Include full category details instead of just the IDuser- Include user information for who created the expense
Response
object
Complete expense object with all details
Show Expense Object Properties
Show Expense Object Properties
string
Unique CzUid identifier for the expense
string
Reference number or invoice number
string
Detailed description of the expense
object
object
integer
VAT percentage applied to the expense
boolean
Whether the original amount includes VAT
string
Expense date (YYYY-MM-DD)
string
Payment due date (YYYY-MM-DD)
string
Payment date (null if not paid)
boolean
Whether the expense has been paid
object
string
Current expense status:
paid, unpaid, overdue, or registeredstring
Supplier CzUid (when not expanded)
object
integer
Category ID (when not expanded)
object
integer
User ID (when not expanded)
object
object
array
Line rows for the expense. Always at least one entry — legacy flat
expenses get a single synthesized line built from the header totals
so API consumers can render a uniform table.See Expense Lines & VAT Breakdown for the
full model.
Show Line Object
Show Line Object
integer
Line row ID (0 for synthesized legacy lines)
integer
Zero-based position
string
Display name
string
Optional detail
number
Line quantity
string
UN/ECE unit (e.g.
H87)number
Net unit price
integer
VAT percent for this line
number
Line net (2dp,
quantity × unit_price rounded)number
Line VAT (2dp)
number
Line gross (2dp)
string
Per-line category override
string
Linked product CzUid
array
string
How the category was assigned:
ai (auto-classified), supplier
(inherited from the supplier’s default), or manual. null on
expenses without a category or legacy rows where provenance wasn’t
recorded.number
Auto-classifier confidence in the 0–1 range when
category_source === 'ai'. null otherwise.object
Populated when the expense was imported from the ANAF e-Factura SPV
inbox.
null for manually created expenses.Show Efactura Object
Show Efactura Object
string
CzUid of the linked supplier invoice
string
Supplier’s invoice number
string
ANAF e-Factura message identifier
boolean
Whether the e-Factura XML is stored on disk
boolean
Whether the PDF has already been generated
string
Bearer-authenticated URL that streams the e-Factura PDF (see Download e-Factura PDF)
string
When the expense was created
string
When the expense was last modified
Error Responses
The expense with the specified ID does not exist or you don’t have access to it
curl -X GET "https://api.contazen.ro/v1/expenses/exp_abc123?expand=supplier,category,user" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
const expenseId = 'exp_abc123';
const expand = ['supplier', 'category', 'user'].join(',');
const response = await fetch(`https://api.contazen.ro/v1/expenses/${expenseId}?expand=${expand}`, {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log('Expense details:', data.expense);
$expenseId = 'exp_abc123';
$expand = 'supplier,category,user';
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.contazen.ro/v1/expenses/{$expenseId}?expand={$expand}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json'
]
]);
$response = curl_exec($curl);
$data = json_decode($response, true);
curl_close($curl);
print_r($data['expense']);
{
"success": true,
"expense": {
"id": "exp_abc123",
"reference": "INV-2024-001",
"description": "Office supplies purchase including paper, pens, and folders",
"amount": {
"total": "238.00",
"without_vat": "200.00",
"vat": "38.00",
"currency": "RON"
},
"account_amount": {
"total": "238.00",
"without_vat": "200.00",
"vat": "38.00",
"currency": "RON"
},
"vat_percent": 19,
"with_vat": true,
"date": "2024-01-15",
"due_date": "2024-02-15",
"paid_date": null,
"is_paid": false,
"payment_type": null,
"status": "unpaid",
"supplier": {
"id": "sup_xyz789",
"name": "Office Depot SRL",
"cui": "RO12345678",
"rc": "J40/1234/2020",
"address": "Str. Exemplu 123, Sector 1",
"city": "Bucharest",
"county": "Bucharest",
"country": "Romania"
},
"category": {
"id": 1,
"name": "Office Expenses",
"parent_id": null
},
"user": {
"id": 1,
"name": "John Doe"
},
"attachment": {
"url": "https://api.contazen.ro/v1/files/download/att_def456",
"type": "pdf"
},
"items": [
{
"id": 4201,
"line_index": 0,
"name": "Office supplies",
"description": null,
"quantity": 1,
"unit_code": null,
"unit_price": 200.00,
"vat_rate": 19,
"amount_wvat": 200.00,
"amount_vat": 38.00,
"amount": 238.00,
"category_id": null,
"product_id": null
}
],
"vat_breakdown": null,
"category_source": "manual",
"category_confidence": null,
"efactura": {
"supplier_invoice_id": "si_abc123",
"invoice_number": "119079",
"anaf_message_id": "4891234567",
"xml_available": true,
"pdf_available": true,
"pdf_url": "https://app.contazen.ro/api/v1/expenses/exp_abc123/efactura-pdf"
},
"created_at": "2024-01-15 10:30:00",
"updated_at": "2024-01-15 10:30:00"
}
}
{
"success": false,
"error": {
"message": "Expense not found",
"type": "invalid_request_error",
"code": "resource_missing",
"param": "id"
}
}
Authorizations
Use your API key (sk_live_xxx or sk_test_xxx)
Path Parameters
Expense CzUid
Query Parameters
Comma-separated list of relations to expand. Supported: supplier, category, user.
Was this page helpful?
⌘I