Pre-check for duplicate expense
curl --request POST \
--url https://api.contazen.ro/v1/expenses/check-duplicate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"supplier_id": "<string>",
"supplier_data": {
"name": "<string>",
"cui": "<string>"
},
"reference": "<string>",
"date": "2023-12-25",
"amount": 123,
"currency": "RON"
}
'import requests
url = "https://api.contazen.ro/v1/expenses/check-duplicate"
payload = {
"supplier_id": "<string>",
"supplier_data": {
"name": "<string>",
"cui": "<string>"
},
"reference": "<string>",
"date": "2023-12-25",
"amount": 123,
"currency": "RON"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
supplier_id: '<string>',
supplier_data: {name: '<string>', cui: '<string>'},
reference: '<string>',
date: '2023-12-25',
amount: 123,
currency: 'RON'
})
};
fetch('https://api.contazen.ro/v1/expenses/check-duplicate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.contazen.ro/v1/expenses/check-duplicate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'supplier_id' => '<string>',
'supplier_data' => [
'name' => '<string>',
'cui' => '<string>'
],
'reference' => '<string>',
'date' => '2023-12-25',
'amount' => 123,
'currency' => 'RON'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.contazen.ro/v1/expenses/check-duplicate"
payload := strings.NewReader("{\n \"supplier_id\": \"<string>\",\n \"supplier_data\": {\n \"name\": \"<string>\",\n \"cui\": \"<string>\"\n },\n \"reference\": \"<string>\",\n \"date\": \"2023-12-25\",\n \"amount\": 123,\n \"currency\": \"RON\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.contazen.ro/v1/expenses/check-duplicate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"supplier_id\": \"<string>\",\n \"supplier_data\": {\n \"name\": \"<string>\",\n \"cui\": \"<string>\"\n },\n \"reference\": \"<string>\",\n \"date\": \"2023-12-25\",\n \"amount\": 123,\n \"currency\": \"RON\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contazen.ro/v1/expenses/check-duplicate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"supplier_id\": \"<string>\",\n \"supplier_data\": {\n \"name\": \"<string>\",\n \"cui\": \"<string>\"\n },\n \"reference\": \"<string>\",\n \"date\": \"2023-12-25\",\n \"amount\": 123,\n \"currency\": \"RON\"\n}"
response = http.request(request)
puts response.read_body{
"duplicate": {
"id": "<string>",
"reference": "<string>",
"date": "2023-12-25",
"amount": 123,
"currency": "<string>",
"match_type": "exact"
}
}Expenses
Check for duplicate expense
Probe the firm’s books for an existing expense that would collide with a prospective payload. Useful before posting a scanned receipt.
POST
/
expenses
/
check-duplicate
Pre-check for duplicate expense
curl --request POST \
--url https://api.contazen.ro/v1/expenses/check-duplicate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"supplier_id": "<string>",
"supplier_data": {
"name": "<string>",
"cui": "<string>"
},
"reference": "<string>",
"date": "2023-12-25",
"amount": 123,
"currency": "RON"
}
'import requests
url = "https://api.contazen.ro/v1/expenses/check-duplicate"
payload = {
"supplier_id": "<string>",
"supplier_data": {
"name": "<string>",
"cui": "<string>"
},
"reference": "<string>",
"date": "2023-12-25",
"amount": 123,
"currency": "RON"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
supplier_id: '<string>',
supplier_data: {name: '<string>', cui: '<string>'},
reference: '<string>',
date: '2023-12-25',
amount: 123,
currency: 'RON'
})
};
fetch('https://api.contazen.ro/v1/expenses/check-duplicate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.contazen.ro/v1/expenses/check-duplicate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'supplier_id' => '<string>',
'supplier_data' => [
'name' => '<string>',
'cui' => '<string>'
],
'reference' => '<string>',
'date' => '2023-12-25',
'amount' => 123,
'currency' => 'RON'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.contazen.ro/v1/expenses/check-duplicate"
payload := strings.NewReader("{\n \"supplier_id\": \"<string>\",\n \"supplier_data\": {\n \"name\": \"<string>\",\n \"cui\": \"<string>\"\n },\n \"reference\": \"<string>\",\n \"date\": \"2023-12-25\",\n \"amount\": 123,\n \"currency\": \"RON\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.contazen.ro/v1/expenses/check-duplicate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"supplier_id\": \"<string>\",\n \"supplier_data\": {\n \"name\": \"<string>\",\n \"cui\": \"<string>\"\n },\n \"reference\": \"<string>\",\n \"date\": \"2023-12-25\",\n \"amount\": 123,\n \"currency\": \"RON\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contazen.ro/v1/expenses/check-duplicate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"supplier_id\": \"<string>\",\n \"supplier_data\": {\n \"name\": \"<string>\",\n \"cui\": \"<string>\"\n },\n \"reference\": \"<string>\",\n \"date\": \"2023-12-25\",\n \"amount\": 123,\n \"currency\": \"RON\"\n}"
response = http.request(request)
puts response.read_body{
"duplicate": {
"id": "<string>",
"reference": "<string>",
"date": "2023-12-25",
"amount": 123,
"currency": "<string>",
"match_type": "exact"
}
}When to use
Call this beforePOST /expenses when the source is unattended (OCR, recurring import, supplier sync). The response tells the UI whether to surface a confirmation dialog (“an expense from this supplier with this reference already exists — continue?”) instead of silently posting a duplicate.
The endpoint never modifies state. Match resolution mirrors the server-side detector used by the OCR + import flows.
Request
Send eithersupplier_id (preferred — Romanian companies often share name prefixes) or supplier_data with the resolved name/CUI from the receipt. The endpoint never auto-creates a supplier; if the supplier_data block doesn’t match an existing row, the supplier match is treated as missing and only reference-based matches are considered.
string
CzUid of the matched supplier. Preferred when known.
object
Fallback when
supplier_id is unknown. Resolved by CUI first (with RO prefix stripped), then by exact name match.name— supplier name as printed on the documentcui— supplier CUI / VAT number, with or withoutROprefix
string
Document number (factura, chitanță, bon fiscal). Used for both exact and
likely cross-supplier matches.string
Issue date in
YYYY-MM-DD. Combined with supplier + amount for strong matches.number
Net amount (subtotal). Compared with ±0.02 tolerance to forgive rounding.
string
default:"RON"
Three-letter ISO code. Defaults to
RON.Match types
match_type | Trigger |
|---|---|
exact | Same supplier + same reference |
strong | Same supplier + same date + amount within ±0.02 |
likely | Same reference under a different supplier (review before posting) |
exact and strong should usually block; likely deserves a confirmation but isn’t necessarily a true duplicate (e.g. invoice numbers reset per fiscal year across suppliers).
Response
duplicate is null when no candidate matches. When populated, the id is the CzUid of the existing expense — fetch it via GET /expenses/{id} for the full record.
{
"data": {
"duplicate": {
"id": "Q9hjAB",
"reference": "65776",
"date": "2026-04-25",
"amount": 147.53,
"currency": "RON",
"match_type": "exact"
}
}
}
Errors
- 400 — invalid JSON body or missing required fields when neither
supplier_idnorsupplier_data.nameis provided - 401 — missing / invalid bearer token
- 403 — API key lacks
readpermission on expenses
Authorizations
Use your API key (sk_live_xxx or sk_test_xxx)
Body
application/json
Response
200 - application/json
Duplicate check result
Show child attributes
Show child attributes
Was this page helpful?