{"openapi":"3.1.0","info":{"title":"LaRampa API","version":"1.0.0","description":"API-ul public LaRampa (planurile Pro și Enterprise): transporturi din documente, verificări, declarații e-Transport trimise la ANAF, coduri UIT, parteneri, produse, calculatorul și webhookurile. Autentificare cu `Authorization: Bearer rk_live_…` (sau `rk_test_…` pentru mediul TEST ANAF). Ghidul în română: https://larampa.ro/dezvoltatori.","contact":{"name":"LaRampa","email":"api@larampa.ro","url":"https://larampa.ro/dezvoltatori"}},"servers":[{"url":"https://api.larampa.ro"}],"tags":[{"name":"Transporturi"},{"name":"Verificări"},{"name":"Declarații"},{"name":"Coduri UIT"},{"name":"Parteneri și produse"},{"name":"Calculator"},{"name":"Webhookuri"},{"name":"Chei API"}],"paths":{"/v1/calculator":{"post":{"summary":"Trebuie cod UIT? Același motor ca în aplicație","tags":["Calculator"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"operation":{"anyOf":[{"anyOf":[{"type":"string","enum":["import","export","aic","lic","intern"]},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"string","pattern":"^\\d{2}$"}]},{"type":"null"}]},"vehicleOver2500":{"anyOf":[{"anyOf":[{"type":"boolean"},{"type":"string","enum":["da","nu","nustiu"]}]},{"type":"null"}]},"grossKg":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000000000},{"type":"null"}]},"valueRon":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000000000},{"type":"null"}]},"highRisk":{"anyOf":[{"anyOf":[{"type":"boolean"},{"type":"string","enum":["da","nu","nustiu"]}]},{"type":"null"}]},"ncCodes":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":14}},"exemptions":{"maxItems":10,"type":"array","items":{"type":"string","enum":["diplomatic","nato","emcs","postal","carnet","law_108_2014","cash_carry"]}},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}}}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"outcome":{"type":"string","description":"yes | no | check"},"title_ro":{"type":"string"}},"required":["outcome","title_ro"],"additionalProperties":{}}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/declarations/{id}":{"get":{"summary":"O declarație: starea, erorile de validare","tags":["Declarații"],"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dossierId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string"},"environment":{"type":"string","enum":["test","prod"]},"schema":{"type":"string"},"refDeclarant":{"type":["string","null"]},"operationType":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vehiclePlate":{"type":["string","null"]},"transportDate":{"type":["string","null"]},"items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errors":{"type":"array","items":{}},"warnings":{"type":"array","items":{}}},"required":["id","dossierId","seq","status","environment","schema","refDeclarant","operationType","vehiclePlate","transportDate","items","errors","warnings"],"additionalProperties":{}}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/declarations/{id}/submit":{"post":{"summary":"Trimite declarația la ANAF","tags":["Declarații"],"description":"Cere `Idempotency-Key`: aceeași cheie nu trimite de două ori. Răspunsul 202 are trimiterea în `pending`; codul UIT vine prin webhookul `declaration.accepted` sau cu GET /v1/submissions/{id}. 409 `UIT_EXISTS` cât timp declarația are un cod valabil. 402 `FREE_LIMIT_REACHED` când un cont gratuit și-a folosit transporturile lunii (cheia e eliberată: după alegerea unui plan, aceeași cerere cu aceeași cheie trece). 409 `FREE_TIER_CUI_TAKEN` când firma folosește gratuitul în alt cont; 409 `FREE_TIER_OVER_CAPS` când contul gratuit are mai multe firme sau persoane decât include gratuitul.","requestBody":{"required":true,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"forceNewUit":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":60}}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":false,"description":"Cheie unică per operație (de exemplu un UUID). Aceeași cheie și același corp întorc același răspuns, 24 de ore."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"submission":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"declarationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string"},"status":{"type":"string"},"phase":{"type":"string","enum":["pending","submitted","completed","failed"]},"environment":{"type":"string","enum":["test","prod"]},"indexIncarcare":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"index_incarcare de la ANAF"},"readableError":{"type":["string","null"]},"errors":{"type":"array","items":{}},"createdAt":{"type":"string","description":"ISO 8601, UTC"},"sentAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]},"finalizedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]},"uit":{"description":"doar după ce ANAF răspunde `ok`","type":["string","null"]}},"required":["id","declarationId","kind","status","phase","environment","indexIncarcare","readableError","errors","createdAt","sentAt","finalizedAt","uit"],"additionalProperties":{}},"created":{"type":"boolean"}},"required":["submission","created"],"additionalProperties":false}}}},"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"submission":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"declarationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string"},"status":{"type":"string"},"phase":{"type":"string","enum":["pending","submitted","completed","failed"]},"environment":{"type":"string","enum":["test","prod"]},"indexIncarcare":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"index_incarcare de la ANAF"},"readableError":{"type":["string","null"]},"errors":{"type":"array","items":{}},"createdAt":{"type":"string","description":"ISO 8601, UTC"},"sentAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]},"finalizedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]},"uit":{"description":"doar după ce ANAF răspunde `ok`","type":["string","null"]}},"required":["id","declarationId","kind","status","phase","environment","indexIncarcare","readableError","errors","createdAt","sentAt","finalizedAt","uit"],"additionalProperties":{}},"created":{"type":"boolean"}},"required":["submission","created"],"additionalProperties":false}}}},"402":{"description":"Transporturile gratuite ale lunii s-au terminat","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["FREE_LIMIT_REACHED"]},"message_ro":{"type":"string"},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"transporturile gratuite pe lună"},"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"transporturi numărate luna aceasta"},"inFlight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"declarații în lucru la ANAF"},"resetsOn":{"type":"string","description":"prima zi a lunii următoare (YYYY-MM-DD)"},"upgradeUrl":{"type":"string"}},"required":["code","message_ro","limit","used","inFlight","resetsOn","upgradeUrl"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Transporturile gratuite ale lunii s-au terminat"}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/dossiers":{"post":{"summary":"Creează un transport din documente","tags":["Transporturi"],"description":"multipart/form-data: `files` (1 – 20 fișiere PDF, JPG, PNG, HEIC, XML; 20 MB fiecare), `firmId` (opțional: firma; implicit prima firmă a cheii), `externalRef` (opțional: numărul din programul tău, unic în cont). Documentele se citesc în fundal; urmărește transportul cu GET sau cu webhookul `dossier.needs_review`. Cere `Idempotency-Key`.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":false,"description":"Cheie unică per operație (de exemplu un UUID). Aceeași cheie și același corp întorc același răspuns, 24 de ore."}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"dossier":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["draft","reading","needs_review","ready","submitting","waiting_anaf","unknown","accepted","rejected","expired","cancelled","failed"]},"statusLabel":{"type":"string"},"blocking":{"type":"boolean"},"openChecks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"statusDetail":{"type":["string","null"]},"nextAction":{"type":["string","null"]},"externalRef":{"type":["string","null"]},"source":{"type":"string"},"environment":{"type":"string","enum":["live","test"],"description":"test: creat cu o cheie rk_test_; doar cheile de test lucrează cu el, iar declarația merge la mediul TEST ANAF"},"firmId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"plate":{"type":["string","null"]},"route":{"type":["string","null"]},"transportDate":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601, UTC"},"updatedAt":{"type":"string","description":"ISO 8601, UTC"}},"required":["id","number","status","statusLabel","blocking","openChecks","statusDetail","nextAction","externalRef","source","environment","firmId","plate","route","transportDate","createdAt","updatedAt"],"additionalProperties":{}},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"filename":{"type":["string","null"]},"status":{"type":["string","null"]}},"required":["id","filename","status"],"additionalProperties":{}}},"rejected":{"type":"array","items":{"type":"object","properties":{"filename":{"type":"string"},"code":{"type":"string"},"message_ro":{"type":"string"}},"required":["filename","code","message_ro"],"additionalProperties":{}}}},"required":["dossier","documents","rejected"],"additionalProperties":false}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}},"get":{"summary":"Lista transporturilor, cele mai noi primele","tags":["Transporturi"],"parameters":[{"schema":{"type":"string","maxLength":20},"in":"query","name":"status","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"externalRef","required":false},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false},{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["draft","reading","needs_review","ready","submitting","waiting_anaf","unknown","accepted","rejected","expired","cancelled","failed"]},"statusLabel":{"type":"string"},"blocking":{"type":"boolean"},"openChecks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"statusDetail":{"type":["string","null"]},"nextAction":{"type":["string","null"]},"externalRef":{"type":["string","null"]},"source":{"type":"string"},"environment":{"type":"string","enum":["live","test"],"description":"test: creat cu o cheie rk_test_; doar cheile de test lucrează cu el, iar declarația merge la mediul TEST ANAF"},"firmId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"plate":{"type":["string","null"]},"route":{"type":["string","null"]},"transportDate":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601, UTC"},"updatedAt":{"type":"string","description":"ISO 8601, UTC"}},"required":["id","number","status","statusLabel","blocking","openChecks","statusDetail","nextAction","externalRef","source","environment","firmId","plate","route","transportDate","createdAt","updatedAt"],"additionalProperties":{}}},"nextCursor":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["data","nextCursor"],"additionalProperties":false}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/dossiers/{id}":{"get":{"summary":"Un transport, cu documentele și verificările deschise","tags":["Transporturi"],"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["draft","reading","needs_review","ready","submitting","waiting_anaf","unknown","accepted","rejected","expired","cancelled","failed"]},"statusLabel":{"type":"string"},"blocking":{"type":"boolean"},"openChecks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"statusDetail":{"type":["string","null"]},"nextAction":{"type":["string","null"]},"externalRef":{"type":["string","null"]},"source":{"type":"string"},"environment":{"type":"string","enum":["live","test"],"description":"test: creat cu o cheie rk_test_; doar cheile de test lucrează cu el, iar declarația merge la mediul TEST ANAF"},"firmId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"plate":{"type":["string","null"]},"route":{"type":["string","null"]},"transportDate":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601, UTC"},"updatedAt":{"type":"string","description":"ISO 8601, UTC"},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"letter":{"type":["string","null"]},"kind":{"type":"string"},"kindLabel":{"type":"string"},"filename":{"type":["string","null"]},"status":{"type":"string"},"pageCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"docNumber":{"type":["string","null"]},"docDate":{"type":["string","null"]}},"required":["id","letter","kind","kindLabel","filename","status","pageCount","docNumber","docDate"],"additionalProperties":{}}},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"code":{"type":"string"},"category":{"type":"string"},"severity":{"type":"string","enum":["blocking","question","warning","info"]},"status":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":["string","null"]},"why":{"type":["string","null"]},"fieldKey":{"type":["string","null"]},"lineNo":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":{}}},"resolution":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"resolvedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]}},"required":["id","code","category","severity","status","title","subtitle","why","fieldKey","lineNo","options","resolution","resolvedAt"],"additionalProperties":{}}}},"required":["id","number","status","statusLabel","blocking","openChecks","statusDetail","nextAction","externalRef","source","environment","firmId","plate","route","transportDate","createdAt","updatedAt","documents","checks"],"additionalProperties":{}}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/dossiers/{id}/checks":{"get":{"summary":"Verificările unui transport (deschise; toate cu all=true)","tags":["Verificări"],"parameters":[{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"all","required":false},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"code":{"type":"string"},"category":{"type":"string"},"severity":{"type":"string","enum":["blocking","question","warning","info"]},"status":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":["string","null"]},"why":{"type":["string","null"]},"fieldKey":{"type":["string","null"]},"lineNo":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":{}}},"resolution":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"resolvedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]}},"required":["id","code","category","severity","status","title","subtitle","why","fieldKey","lineNo","options","resolution","resolvedAt"],"additionalProperties":{}}}},"required":["data"],"additionalProperties":false}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/dossiers/{id}/checks/{checkId}/resolve":{"post":{"summary":"Răspunde la o verificare","tags":["Verificări"],"description":"Alege una din `options` (câmpul `id`); pentru „Alt număr / Alt cod” trimite și `value`. Verificările rulează din nou; transportul devine `ready` când nu mai are întrebări.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"optionId":{"type":"string","minLength":1,"maxLength":40},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":200},{"type":"number"}]},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["optionId"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"checkId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"check":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"code":{"type":"string"},"category":{"type":"string"},"severity":{"type":"string","enum":["blocking","question","warning","info"]},"status":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":["string","null"]},"why":{"type":["string","null"]},"fieldKey":{"type":["string","null"]},"lineNo":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":{}}},"resolution":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"resolvedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]}},"required":["id","code","category","severity","status","title","subtitle","why","fieldKey","lineNo","options","resolution","resolvedAt"],"additionalProperties":{}},"dossier":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["draft","reading","needs_review","ready","submitting","waiting_anaf","unknown","accepted","rejected","expired","cancelled","failed"]},"statusLabel":{"type":"string"},"blocking":{"type":"boolean"},"openChecks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"statusDetail":{"type":["string","null"]},"nextAction":{"type":["string","null"]},"externalRef":{"type":["string","null"]},"source":{"type":"string"},"environment":{"type":"string","enum":["live","test"],"description":"test: creat cu o cheie rk_test_; doar cheile de test lucrează cu el, iar declarația merge la mediul TEST ANAF"},"firmId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"plate":{"type":["string","null"]},"route":{"type":["string","null"]},"transportDate":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601, UTC"},"updatedAt":{"type":"string","description":"ISO 8601, UTC"}},"required":["id","number","status","statusLabel","blocking","openChecks","statusDetail","nextAction","externalRef","source","environment","firmId","plate","route","transportDate","createdAt","updatedAt"],"additionalProperties":{}}},"required":["check","dossier"],"additionalProperties":false}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/dossiers/{id}/declarations":{"post":{"summary":"Pregătește și validează declarația unui transport gata","tags":["Declarații"],"description":"Construiește declarația e-Transport (XML v2 implicit, v1 dacă firma o cere) și o validează. Cu o cheie `rk_test_` declarația merge la mediul TEST ANAF, doar pentru transporturile create cu o cheie de test (altfel 409 `ENVIRONMENT_MISMATCH`). Se poate repeta: o declarație trimisă nu se mai schimbă.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dossierId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string"},"environment":{"type":"string","enum":["test","prod"]},"schema":{"type":"string"},"refDeclarant":{"type":["string","null"]},"operationType":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vehiclePlate":{"type":["string","null"]},"transportDate":{"type":["string","null"]},"items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errors":{"type":"array","items":{}},"warnings":{"type":"array","items":{}}},"required":["id","dossierId","seq","status","environment","schema","refDeclarant","operationType","vehiclePlate","transportDate","items","errors","warnings"],"additionalProperties":{}}}},"required":["data"],"additionalProperties":false}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/dossiers/{id}/fields/{key}":{"patch":{"summary":"Corectează un câmp al transportului","tags":["Verificări"],"description":"Cheile câmpurilor sunt cele din catalogul de câmpuri (de exemplu `transport.date` în formatul ZZ.LL.AAAA, `transport.plate`). Modificarea intră în jurnal ca făcută de cheia API.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":200},{"type":"number"}]},{"type":"null"}]},"lineNo":{"default":0,"type":"integer","minimum":0,"maximum":999}},"required":["value"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","maxLength":60},"in":"path","name":"key","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"field":{"type":"object","properties":{"key":{"type":"string"},"lineNo":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"value":{}},"required":["key","lineNo","value"],"additionalProperties":{}},"dossier":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["draft","reading","needs_review","ready","submitting","waiting_anaf","unknown","accepted","rejected","expired","cancelled","failed"]},"statusLabel":{"type":"string"},"blocking":{"type":"boolean"},"openChecks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"statusDetail":{"type":["string","null"]},"nextAction":{"type":["string","null"]},"externalRef":{"type":["string","null"]},"source":{"type":"string"},"environment":{"type":"string","enum":["live","test"],"description":"test: creat cu o cheie rk_test_; doar cheile de test lucrează cu el, iar declarația merge la mediul TEST ANAF"},"firmId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"plate":{"type":["string","null"]},"route":{"type":["string","null"]},"transportDate":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601, UTC"},"updatedAt":{"type":"string","description":"ISO 8601, UTC"}},"required":["id","number","status","statusLabel","blocking","openChecks","statusDetail","nextAction","externalRef","source","environment","firmId","plate","route","transportDate","createdAt","updatedAt"],"additionalProperties":{}}},"required":["field","dossier"],"additionalProperties":false}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/partners":{"get":{"summary":"Partenerii, cu starea ANAF și VIES","tags":["Parteneri și produse"],"parameters":[{"schema":{"type":"string","maxLength":100},"in":"query","name":"q","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"country":{"type":"string"},"taxId":{"type":["string","null"]},"roles":{"type":"array","items":{"type":"string"}},"anafStatus":{"type":["string","null"]},"vatPayer":{"type":["boolean","null"]},"inactiveSince":{"type":["string","null"]},"viesValid":{"type":["boolean","null"]},"lastCheckedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]},"monitored":{"type":"boolean"}},"required":["id","name","country","taxId","roles","anafStatus","vatPayer","inactiveSince","viesValid","lastCheckedAt","monitored"],"additionalProperties":{}}}},"required":["data"],"additionalProperties":false}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}},"post":{"summary":"Adaugă un partener (verificat la ANAF / VIES)","tags":["Parteneri și produse"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":200},"country":{"type":"string","pattern":"^[A-Za-z]{2}$"},"taxId":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}]},"roles":{"minItems":1,"maxItems":6,"type":"array","items":{"type":"string","enum":["supplier","customer","carrier","warehouse","group_firm","own_location"]}}},"required":["name","country","roles"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":false,"description":"Cheie unică per operație (de exemplu un UUID). Aceeași cheie și același corp întorc același răspuns, 24 de ore."}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"country":{"type":"string"},"taxId":{"type":["string","null"]},"roles":{"type":"array","items":{"type":"string"}},"anafStatus":{"type":["string","null"]},"vatPayer":{"type":["boolean","null"]},"inactiveSince":{"type":["string","null"]},"viesValid":{"type":["boolean","null"]},"lastCheckedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]},"monitored":{"type":"boolean"}},"required":["id","name","country","taxId","roles","anafStatus","vatPayer","inactiveSince","viesValid","lastCheckedAt","monitored"],"additionalProperties":{}}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/partners/{id}":{"get":{"summary":"Un partener","tags":["Parteneri și produse"],"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"country":{"type":"string"},"taxId":{"type":["string","null"]},"roles":{"type":"array","items":{"type":"string"}},"anafStatus":{"type":["string","null"]},"vatPayer":{"type":["boolean","null"]},"inactiveSince":{"type":["string","null"]},"viesValid":{"type":["boolean","null"]},"lastCheckedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]},"monitored":{"type":"boolean"}},"required":["id","name","country","taxId","roles","anafStatus","vatPayer","inactiveSince","viesValid","lastCheckedAt","monitored"],"additionalProperties":{}}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}},"patch":{"summary":"Modifică un partener","tags":["Parteneri și produse"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":200},"roles":{"minItems":1,"maxItems":6,"type":"array","items":{"type":"string","enum":["supplier","customer","carrier","warehouse","group_firm","own_location"]}},"monitored":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"country":{"type":"string"},"taxId":{"type":["string","null"]},"roles":{"type":"array","items":{"type":"string"}},"anafStatus":{"type":["string","null"]},"vatPayer":{"type":["boolean","null"]},"inactiveSince":{"type":["string","null"]},"viesValid":{"type":["boolean","null"]},"lastCheckedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]},"monitored":{"type":"boolean"}},"required":["id","name","country","taxId","roles","anafStatus","vatPayer","inactiveSince","viesValid","lastCheckedAt","monitored"],"additionalProperties":{}}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/products":{"get":{"summary":"Produsele cu codurile NC","tags":["Parteneri și produse"],"parameters":[{"schema":{"type":"string","maxLength":100},"in":"query","name":"q","required":false},{"schema":{"type":"string","enum":["proposed","confirmed","rejected"]},"in":"query","name":"status","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"ncCode":{"type":["string","null"]},"status":{"type":"string"},"supplierPartnerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"confirmedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]}},"required":["id","name","ncCode","status","supplierPartnerId","confirmedAt"],"additionalProperties":{}}}},"required":["data"],"additionalProperties":false}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}},"post":{"summary":"Adaugă un produs cu codul NC confirmat","tags":["Parteneri și produse"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":200},"ncCode":{"type":"string","maxLength":14},"supplierPartnerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"aliases":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}}},"required":["name","ncCode"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":false,"description":"Cheie unică per operație (de exemplu un UUID). Aceeași cheie și același corp întorc același răspuns, 24 de ore."}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"ncCode":{"type":["string","null"]},"status":{"type":"string"},"supplierPartnerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"confirmedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]}},"required":["id","name","ncCode","status","supplierPartnerId","confirmedAt"],"additionalProperties":{}}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/products/{id}":{"patch":{"summary":"Modifică un produs","tags":["Parteneri și produse"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":200},"ncCode":{"type":"string","maxLength":14},"supplierPartnerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"ncCode":{"type":["string","null"]},"status":{"type":"string"},"supplierPartnerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"confirmedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]}},"required":["id","name","ncCode","status","supplierPartnerId","confirmedAt"],"additionalProperties":{}}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/scopes":{"get":{"summary":"Drepturile pe care le poate avea o cheie","tags":["Chei API"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"string"}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/submissions/{id}":{"get":{"summary":"Starea unei trimiteri (codul UIT doar după `ok`)","tags":["Declarații"],"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"declarationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string"},"status":{"type":"string"},"phase":{"type":"string","enum":["pending","submitted","completed","failed"]},"environment":{"type":"string","enum":["test","prod"]},"indexIncarcare":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"index_incarcare de la ANAF"},"readableError":{"type":["string","null"]},"errors":{"type":"array","items":{}},"createdAt":{"type":"string","description":"ISO 8601, UTC"},"sentAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]},"finalizedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]},"uit":{"description":"doar după ce ANAF răspunde `ok`","type":["string","null"]}},"required":["id","declarationId","kind","status","phase","environment","indexIncarcare","readableError","errors","createdAt","sentAt","finalizedAt","uit"],"additionalProperties":{}}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/uit":{"get":{"summary":"Codurile UIT, cele mai noi primele (mediul cheii)","tags":["Coduri UIT"],"parameters":[{"schema":{"type":"string","maxLength":20},"in":"query","name":"status","required":false},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false},{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"uit":{"type":["string","null"]},"status":{"type":"string"},"environment":{"type":"string","enum":["test","prod"]},"source":{"type":"string","enum":["larampa","external"],"description":"`larampa`: emis prin LaRampa; `external`: emis din afara LaRampa"},"validFrom":{"type":"string"},"expiresAt":{"type":"string","description":"ISO 8601, UTC"},"vehiclePlate":{"type":"string"},"trailer1":{"type":["string","null"]},"refDeclarant":{"type":["string","null"]},"dossierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"declarationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"issuedAt":{"type":"string","description":"ISO 8601, UTC"},"sentToDriverAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]}},"required":["id","uit","status","environment","source","validFrom","expiresAt","vehiclePlate","trailer1","refDeclarant","dossierId","declarationId","issuedAt","sentToDriverAt"],"additionalProperties":{}}},"nextCursor":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["data","nextCursor"],"additionalProperties":false}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/uit/{uit}":{"get":{"summary":"Un cod UIT: valabilitatea, vehiculul, transportul","tags":["Coduri UIT"],"parameters":[{"schema":{"type":"string","pattern":"^[A-Za-z0-9]{8,20}$"},"in":"path","name":"uit","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"uit":{"type":["string","null"]},"status":{"type":"string"},"environment":{"type":"string","enum":["test","prod"]},"source":{"type":"string","enum":["larampa","external"],"description":"`larampa`: emis prin LaRampa; `external`: emis din afara LaRampa"},"validFrom":{"type":"string"},"expiresAt":{"type":"string","description":"ISO 8601, UTC"},"vehiclePlate":{"type":"string"},"trailer1":{"type":["string","null"]},"refDeclarant":{"type":["string","null"]},"dossierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"declarationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"issuedAt":{"type":"string","description":"ISO 8601, UTC"},"sentToDriverAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]}},"required":["id","uit","status","environment","source","validFrom","expiresAt","vehiclePlate","trailer1","refDeclarant","dossierId","declarationId","issuedAt","sentToDriverAt"],"additionalProperties":{}}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/uit/{uit}/driver-sms":{"post":{"summary":"Trimite codul șoferului prin SMS","tags":["Coduri UIT"],"description":"Un SMS cu codul și linkul paginii șoferului (fără cont). Cere `Idempotency-Key`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string","minLength":6,"maxLength":20}},"required":["phone"]}}}},"parameters":[{"schema":{"type":"string","pattern":"^[A-Za-z0-9]{8,20}$"},"in":"path","name":"uit","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":false,"description":"Cheie unică per operație (de exemplu un UUID). Aceeași cheie și același corp întorc același răspuns, 24 de ore."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"sentAt":{"type":"string","description":"ISO 8601, UTC"},"phone":{"type":"string"}},"required":["sentAt","phone"],"additionalProperties":false}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/webhook-deliveries/{id}/redeliver":{"post":{"summary":"Retrimite o livrare (același id de eveniment)","tags":["Webhookuri"],"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"webhookId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"eventType":{"type":"string"},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["pending","delivered","failed","canceled"]},"responseStatus":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"responseMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"responseExcerpt":{"type":["string","null"]},"error":{"type":["string","null"]},"nextAttemptAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]},"replayOfId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"test":{"type":"boolean"},"createdAt":{"type":"string","description":"ISO 8601, UTC"},"deliveredAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]}},"required":["id","webhookId","eventId","eventType","attempt","status","responseStatus","responseMs","responseExcerpt","error","nextAttemptAt","replayOfId","test","createdAt","deliveredAt"],"additionalProperties":{}}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/webhooks":{"get":{"summary":"Webhookurile contului","tags":["Webhookuri"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"url":{"type":"string"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"secretHint":{"type":"string"},"consecutiveFailures":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"disabledReason":{"type":["string","null"]},"disabledAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]},"lastDeliveryAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]},"lastDeliveryOk":{"type":["boolean","null"]},"createdAt":{"type":"string","description":"ISO 8601, UTC"}},"required":["id","url","description","events","status","secretHint","consecutiveFailures","disabledReason","disabledAt","lastDeliveryAt","lastDeliveryOk","createdAt"],"additionalProperties":{}}}},"required":["data"],"additionalProperties":false}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}},"post":{"summary":"Adaugă un webhook","tags":["Webhookuri"],"description":"Adresa trebuie să fie https și publică (nu acceptăm localhost sau rețele interne). Secretul de semnare apare o singură dată, în răspuns.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2000},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"events":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["dossier.needs_review","dossier.ready","declaration.submitted","declaration.accepted","declaration.rejected","uit.expired","partner.inactive"]}}},"required":["url","events"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":false,"description":"Cheie unică per operație (de exemplu un UUID). Aceeași cheie și același corp întorc același răspuns, 24 de ore."}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"url":{"type":"string"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"secretHint":{"type":"string"},"consecutiveFailures":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"disabledReason":{"type":["string","null"]},"disabledAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]},"lastDeliveryAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]},"lastDeliveryOk":{"type":["boolean","null"]},"createdAt":{"type":"string","description":"ISO 8601, UTC"}},"required":["id","url","description","events","status","secretHint","consecutiveFailures","disabledReason","disabledAt","lastDeliveryAt","lastDeliveryOk","createdAt"],"additionalProperties":{}},"secret":{"type":"string","description":"apare o singură dată"}},"required":["webhook","secret"],"additionalProperties":false}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/webhooks/{id}":{"patch":{"summary":"Modifică un webhook (status `active` îl pornește din nou)","tags":["Webhookuri"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2000},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"events":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["dossier.needs_review","dossier.ready","declaration.submitted","declaration.accepted","declaration.rejected","uit.expired","partner.inactive"]}},"status":{"type":"string","enum":["active","disabled"]}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"url":{"type":"string"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"secretHint":{"type":"string"},"consecutiveFailures":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"disabledReason":{"type":["string","null"]},"disabledAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]},"lastDeliveryAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]},"lastDeliveryOk":{"type":["boolean","null"]},"createdAt":{"type":"string","description":"ISO 8601, UTC"}},"required":["id","url","description","events","status","secretHint","consecutiveFailures","disabledReason","disabledAt","lastDeliveryAt","lastDeliveryOk","createdAt"],"additionalProperties":{}}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}},"delete":{"summary":"Șterge un webhook","tags":["Webhookuri"],"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/webhooks/{id}/deliveries":{"get":{"summary":"Jurnalul livrărilor unui webhook (ultimele 50)","tags":["Webhookuri"],"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"webhookId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"eventType":{"type":"string"},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["pending","delivered","failed","canceled"]},"responseStatus":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"responseMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"responseExcerpt":{"type":["string","null"]},"error":{"type":["string","null"]},"nextAttemptAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]},"replayOfId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"test":{"type":"boolean"},"createdAt":{"type":"string","description":"ISO 8601, UTC"},"deliveredAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]}},"required":["id","webhookId","eventId","eventType","attempt","status","responseStatus","responseMs","responseExcerpt","error","nextAttemptAt","replayOfId","test","createdAt","deliveredAt"],"additionalProperties":{}}}},"required":["data"],"additionalProperties":false}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}},"/v1/webhooks/{id}/test":{"post":{"summary":"Trimite un eveniment de test (`webhook.test`)","tags":["Webhookuri"],"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"webhookId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"eventType":{"type":"string"},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["pending","delivered","failed","canceled"]},"responseStatus":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"responseMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"responseExcerpt":{"type":["string","null"]},"error":{"type":["string","null"]},"nextAttemptAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]},"replayOfId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"test":{"type":"boolean"},"createdAt":{"type":"string","description":"ISO 8601, UTC"},"deliveredAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC"},{"type":"null"}]}},"required":["id","webhookId","eventId","eventType","attempt","status","responseStatus","responseMs","responseExcerpt","error","nextAttemptAt","replayOfId","test","createdAt","deliveredAt"],"additionalProperties":{}}}}},"4XX":{"description":"Eroare","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"cod stabil, de exemplu INVALID_API_KEY"},"message_ro":{"type":"string","description":"mesajul, în română"},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message_ro":{"type":"string"}},"required":["path","message_ro"],"additionalProperties":false}}},"required":["code","message_ro"],"additionalProperties":{}},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":{},"description":"Eroare"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"rk_live_… / rk_test_…"}}}}