{"openapi":"3.1.0","info":{"title":"DocAccord Partner API","description":"LC Clear checks over HTTP. Authenticate with an API key as a Bearer token. Breaking changes ship as /api/v2, never in place; retiring a v1 endpoint requires at least 90 days' notice via a Sunset header and direct notice.","version":"1.8.0"},"servers":[{"url":"https://api.docaccord.com"}],"paths":{"/api/v1/ping":{"get":{"tags":["v1"],"summary":"Ping","description":"Resolves the caller's API key and confirms it works. Spends no credit,\nruns no check - this exists purely so an integration's first call has\nsomething cheap and certain to test against. The plan is the billing\nowner's (a key created by a team admin reports the team's plan, like\n/usage does).","operationId":"ping_api_v1_ping_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PingResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/usage":{"get":{"tags":["v1"],"summary":"Usage","description":"The one thing a partner could not previously answer without logging\ninto the web dashboard: how much of this account's shared check_credits\npool is left. Spends no credit, runs no check - same cost profile as\n/ping. Mirrors GET /api/billing/status's numbers exactly (same\nbilling_owner resolution, same fields where they overlap) rather than\ninventing a second usage model - a v1 shape of its own only where the\nfields actually differ (no Paddle/discount-note detail here; a partner\nintegration has no use for those, and they are not this module's to\nexpose - see the docstring's stance on v1's response types being\nseparate from internal/browser-facing ones).","operationId":"usage_api_v1_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/lc-checks":{"post":{"tags":["v1"],"summary":"Create Lc Check","description":"Runs a full LC Clear check: extracts every document supplied (each as\na PDF file or pasted text, never both), runs the deterministic rule\nengine, persists the result exactly as /api/analyze does (report\nnumber, LCCase grouping), and returns it.\n\nlc and invoice are required. Since PR-22 (1.2.0) every transport\ndocument type has its own optional slot, and at least one transport\ndocument is required unless the credit's field 46A asks for none. Up to\nthree further transport sets go in additional_transport_files, each with\nits type in additional_transport_types (same order); one check credit\ncovers them. The other documents are optional, matching AnalysisRequest.\n\nIdempotency-Key is honoured exactly as on /api/analyze - see\napp/idempotency.py. Strongly recommended for a machine caller: unlike a\nbrowser, a partner integration's retry policy has no human deciding\nwhether to click submit twice.","operationId":"create_lc_check_api_v1_lc_checks_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_lc_check_api_v1_lc_checks_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1CheckResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/lc-checks/{run_id}":{"get":{"tags":["v1"],"summary":"Get Lc Check","description":"Re-fetches a past check. Scoped strictly to this key's own account -\nsee this module's docstring for why that is simpler than the browser\nsession's team-wide visibility, and deliberately so.","operationId":"get_lc_check_api_v1_lc_checks__run_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1CheckResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/lc-cases/{case_id}/document-checks":{"post":{"tags":["v1"],"summary":"Create Document Check","description":"The ERP pre-check: checks the commercial invoice (and, when sent, the\nbill of lading) against the credit saved with one of your cases, before\nthe whole set exists. An ERP calls it when it creates the invoice.\n\nThe credit is not sent: it is the latest saved terms of the case\n(models.LCCreditVersion, saved from the DocAccord app after a person\nconfirmed the reading, WP14.2). A case that is not the key's own account's\nis a 404, exactly like a case that does not exist; a case without saved\nterms is a 409 that says how to save them, before anything is read or\nbilled. Nothing else about the credit needs to be uploaded, and the\ntransport document is not required: the documents the credit's field 46A\nstill asks for are documents to come (RulesetOptions.partial_presentation)\nand no missing-document finding is raised. Every other rule runs on what\nwas sent, with the document readings surfaced as findings (nobody reviews\na reading in the partner API, like POST /lc-checks).\n\nThe invoice is required, as a file or as text, never both: a PDF, a scan,\nor an EN 16931 e-invoice (XRechnung, ZUGFeRD, Factur-X, UBL, CII) as an\nXML file or a PDF with the XML attached, which is read without a model.\nThe bill of lading is optional, also as a DCSA eBL 3.0 JSON. The order is\noptional: it is compared with the same saved credit (`order_check`, a\nWARNING for each difference, never part of overall_status). Documents are\nread in parallel.\n\nBilling, scopes, rate limit and Idempotency-Key are those of POST\n/lc-checks: one check credit per request once every document is read (a\nreading failure costs none, and a failure after the charge refunds it),\nlc:write scope, 60 requests an hour per key, the same per-check reading\nbudget, AI spend limits and 402 while a top-up is in progress. The run is\nstored as a check of its own kind (models.PRECHECK_MODULE): it counts in\nthe period allowance and the credits used, but is not shown as a check of\na whole presentation and has no certificate. No webhook is sent: the\nresponse is the result.","operationId":"create_document_check_api_v1_lc_cases__case_id__document_checks_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"integer","title":"Case Id"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_document_check_api_v1_lc_cases__case_id__document_checks_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1DocumentCheckResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/lc-cases":{"get":{"tags":["v1"],"summary":"List Lc Cases","description":"The key's own account's cases, newest first, each with whether a credit\nis saved to it: what an ERP needs to find the case_id of a credit for\nPOST /lc-cases/{case_id}/document-checks. `lc_reference` narrows the list\nto cases with exactly that credit number. Reads no document and spends no\ncredit; carries no credit term.","operationId":"list_lc_cases_api_v1_lc_cases_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lc_reference","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lc Reference"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1LcCaseList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/lc-reviews":{"post":{"tags":["v1"],"summary":"Create Lc Review","description":"Reviews the credit itself, before any document exists: soft clauses,\nimpossible dates, a presentation period no one can meet, missing\ndocuments, sanctions on its parties, a cost reading. The LC Workability\nReview (side=exporter) and the LC Pre-Issuance Review (side=importer) are\nthis one endpoint. It runs the same engine as the web app's credit review\n(credit_review_flow.run_credit_review) and nothing else.\n\nlc_file or lc_text is required, never both: a PDF, a scan, a photo or the\nSWIFT MT700 text pasted (with its MT701 continuations). The reading is a\nmodel call even for MT700 text: the model reads the credit and a\ndeterministic SWIFT parser then reads the same text a second time and\nsettles every field the two disagree on (mt700_reconcile.py), so the text\nis no shortcut around the reading gate below. The review itself, the\ncomparison with an order and the suggested wording make no model call.\n\nBILLING. No check credit is consumed, as in the web app: this runs the\nmoment a credit arrives, when a bad clause is still cheap to fix, and\ncharging for the warning would keep the accident. The reading goes through\nthe extraction gate of POST /api/extract (billing.begin_extraction): an\naccount with a credit or a subscription reads credits freely, one without\nhas EXTRACT_LC_READINGS_PER_30_DAYS readings of a credit or an order in a\nrolling 30 days (429 with Retry-After once they are used). An order sent as\na file or text is one more such reading; order_json is not read at all.\nThe suggested wording of a finding follows billing.apply_clause_fix_gate:\na non-subscriber has one free reveal per account, then the finding still\ncomes back but suggested_clause.wording is null and locked is true.\n\nScopes (lc:write), the 60/hour limit, the AI spend levels, the\nIdempotency-Key (its own scope v1_lc_reviews) and the error format are\nthose of POST /lc-checks. Stateless unless the save is asked for: nothing\nis stored, so there is no id and no re-fetch route; a replay with the same\nIdempotency-Key returns the stored answer without reading again. No\nwebhook is sent: the response is the result.","operationId":"create_lc_review_api_v1_lc_reviews_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_lc_review_api_v1_lc_reviews_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1ReviewResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/finding-codes":{"get":{"tags":["v1"],"summary":"Finding Codes","description":"Every explanation_code an LC Clear check can return, with the params it\nsends and the severities it can carry, so a partner can build its own\ntexts or mapping. Generated from the rule engine's source (see\napp/finding_codes.py). Spends no credit.","operationId":"finding_codes_api_v1_finding_codes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1FindingCodeCatalogue"}}}}},"security":[{"HTTPBearer":[]}]}}},"components":{"schemas":{"AmendmentBenchmark":{"properties":{"status":{"type":"string","enum":["PENDING","ACCEPTED","REJECTED"],"title":"Status"},"status_stated":{"type":"boolean","title":"Status Stated","default":true},"verdict":{"anyOf":[{"type":"string","enum":["BOTH","ORIGINAL_ONLY","AMENDED_ONLY","MIXED","NEITHER"]},{"type":"null"}],"title":"Verdict"},"benchmark":{"type":"string","enum":["ORIGINAL","AMENDED"],"title":"Benchmark","default":"ORIGINAL"},"deemed_accepted":{"type":"boolean","title":"Deemed Accepted","default":false},"original_critical_codes":{"items":{"type":"string"},"type":"array","title":"Original Critical Codes"},"amended_critical_codes":{"items":{"type":"string"},"type":"array","title":"Amended Critical Codes"},"cured_codes":{"items":{"type":"string"},"type":"array","title":"Cured Codes"},"introduced_codes":{"items":{"type":"string"},"type":"array","title":"Introduced Codes"},"changed_fields":{"items":{"type":"string"},"type":"array","title":"Changed Fields"},"uncertain_fields":{"items":{"type":"string"},"type":"array","title":"Uncertain Fields"},"operative":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Operative"},"confirmation_extended":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Confirmation Extended"},"amendment_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amendment Number"},"amendment_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Amendment Date"}},"type":"object","required":["status"],"title":"AmendmentBenchmark","description":"The pending-amendment reading of one check (accuracy plan round 2,\nPR-37, UCP 600 Art. 10). The findings in the result are the ones\nmeasured against `benchmark`; this says what the other credit showed.\n\nstatus: the answer the engine applied; PENDING when none was sent\n  (status_stated False).\nverdict: None when the two credits were not compared: the amendment\n  changes no term the engine applies, or it asks to cancel the credit.\nbenchmark: ORIGINAL (the credit as issued) or AMENDED.\ndeemed_accepted: True when the presentation itself counts as the\n  beneficiary's acceptance (Art. 10(c): complies with the amended credit\n  only, status PENDING, the amendment operative and read with certainty).\noriginal_critical_codes / amended_critical_codes: the CRITICAL codes\n  against each credit. cured_codes: CRITICAL against the credit as issued\n  and cleared by the amendment. introduced_codes: CRITICAL against the\n  amended credit only.\nchanged_fields / uncertain_fields: the credit fields the amendment sets,\n  and those the engine could not set with confidence.\noperative: False when the amendment says its details follow (Art. 11(a)).\nconfirmation_extended: True, False or None (unknown), as the amendment\n  page reads it (Art. 10(b), TA Briefing 13)."},"Body_create_document_check_api_v1_lc_cases__case_id__document_checks_post":{"properties":{"invoice_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Invoice File"},"invoice_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Text"},"bill_of_lading_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Bill Of Lading File"},"bill_of_lading_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Of Lading Text"},"order_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Order File"},"order_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Text"},"order_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Json","description":"The order as a JSON object instead of a file or text, so an ERP can send its own data with no reading. Every key is optional and a key left out is not compared: document_kind (PROFORMA_INVOICE, SALES_CONTRACT, PURCHASE_ORDER, OTHER), order_number, order_date (YYYY-MM-DD), buyer and seller (objects with name, address, country, tax_id), goods_description, quantity, quantity_unit, unit_price, unit_price_unit, currency, amount, stated_incoterm, incoterm_place, port_of_loading, port_of_discharge, delivery_date (YYYY-MM-DD), partial_shipments_allowed, payment_terms_text, payment_days, payment_reference (BL_DATE, INVOICE_DATE, SIGHT, OTHER). At most 50,000 characters. Not together with order_file or order_text."},"strictness":{"type":"string","enum":["STRICT","STANDARD"],"title":"Strictness","default":"STANDARD"},"amount_to_be_drawn":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Amount To Be Drawn"},"presentation_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Presentation Date"}},"type":"object","title":"Body_create_document_check_api_v1_lc_cases__case_id__document_checks_post"},"Body_create_lc_check_api_v1_lc_checks_post":{"properties":{"lc_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Lc File"},"lc_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lc Text"},"invoice_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Invoice File"},"invoice_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Text"},"bill_of_lading_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Bill Of Lading File"},"bill_of_lading_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Of Lading Text"},"multimodal_transport_doc_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Multimodal Transport Doc File"},"multimodal_transport_doc_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Multimodal Transport Doc Text"},"air_transport_doc_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Air Transport Doc File"},"air_transport_doc_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Air Transport Doc Text"},"road_rail_inland_waterway_doc_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Road Rail Inland Waterway Doc File"},"road_rail_inland_waterway_doc_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Road Rail Inland Waterway Doc Text"},"charter_party_bill_of_lading_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Charter Party Bill Of Lading File"},"charter_party_bill_of_lading_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Charter Party Bill Of Lading Text"},"sea_waybill_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Sea Waybill File"},"sea_waybill_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sea Waybill Text"},"courier_receipt_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Courier Receipt File"},"courier_receipt_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Courier Receipt Text"},"additional_transport_files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Additional Transport Files","default":[]},"additional_transport_types":{"items":{"type":"string"},"type":"array","title":"Additional Transport Types","default":[]},"packing_list_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Packing List File"},"packing_list_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Packing List Text"},"weight_list_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Weight List File"},"weight_list_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Weight List Text"},"certificate_of_origin_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Certificate Of Origin File"},"certificate_of_origin_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Certificate Of Origin Text"},"insurance_certificate_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Insurance Certificate File"},"insurance_certificate_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Insurance Certificate Text"},"bill_of_exchange_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Bill Of Exchange File"},"bill_of_exchange_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Of Exchange Text"},"beneficiary_certificate_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Beneficiary Certificate File"},"beneficiary_certificate_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Beneficiary Certificate Text"},"inspection_certificate_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Inspection Certificate File"},"inspection_certificate_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inspection Certificate Text"},"shipment_advice_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shipment Advice Text"},"strictness":{"type":"string","enum":["STRICT","STANDARD"],"title":"Strictness","default":"STANDARD"},"amount_to_be_drawn":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Amount To Be Drawn"},"presented_counts":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Presented Counts"},"earlier_drawn_amount":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Earlier Drawn Amount"},"earlier_drawn_quantity":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Earlier Drawn Quantity"},"earlier_containers_shipped":{"anyOf":[{"type":"integer","maximum":9999.0,"minimum":0.0},{"type":"null"}],"title":"Earlier Containers Shipped"},"presentation_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Presentation Date"},"instalment_number":{"anyOf":[{"type":"integer","maximum":99.0,"minimum":1.0},{"type":"null"}],"title":"Instalment Number"},"earlier_instalments_on_time":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Earlier Instalments On Time"},"presentation_medium":{"anyOf":[{"type":"string","enum":["PAPER","ELECTRONIC","MIXED"]},{"type":"null"}],"title":"Presentation Medium"},"electronic_doc_types":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Electronic Doc Types"},"amendment_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Amendment File"},"amendment_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amendment Text"},"amendment_status":{"anyOf":[{"type":"string","enum":["PENDING","ACCEPTED","REJECTED"]},{"type":"null"}],"title":"Amendment Status"}},"type":"object","title":"Body_create_lc_check_api_v1_lc_checks_post"},"Body_create_lc_review_api_v1_lc_reviews_post":{"properties":{"lc_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Lc File"},"lc_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lc Text"},"side":{"type":"string","enum":["exporter","importer"],"title":"Side","description":"Whose view the review takes. exporter (the beneficiary, the LC Workability Review): is the credit one you can fulfil and be paid under. importer (the applicant, the LC Pre-Issuance Review): is this the credit you want your bank to issue.","default":"exporter"},"is_draft":{"type":"boolean","title":"Is Draft","description":"True for text the parties are still negotiating. The same checks run; a finding is then a negotiating position rather than an amendment. A draft is never saved to a case.","default":false},"order_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Order File"},"order_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Text"},"order_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Json","description":"The order as a JSON object instead of a file or text: the same keys as order_json of POST /lc-cases/{case_id}/document-checks. At most 50,000 characters. Not together with order_file or order_text."},"save_to_case":{"type":"boolean","title":"Save To Case","description":"Save the credit's terms as a version of a case (source credit_review). Without case_id the case is found or opened by the credit's reference number. Saving happens only when every field the reading doubted was confirmed by a person, which the partner API cannot do, so a reading with a doubt is answered with credit_saved.status unconfirmed. Needs CREDIT_TERMS_STORAGE_ENABLED on the server.","default":false},"case_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Case Id","description":"One of your own cases (GET /lc-cases) to save the terms to. Giving it asks for the save, save_to_case or not."}},"type":"object","title":"Body_create_lc_review_api_v1_lc_reviews_post"},"CheckProvenance":{"properties":{"ruleset_version":{"type":"string","title":"Ruleset Version"},"documents":{"items":{"$ref":"#/components/schemas/DocumentProvenance"},"type":"array","title":"Documents"},"credit_fingerprint":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Credit Fingerprint"},"shipment_fingerprint":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Shipment Fingerprint"},"shipment_invoice_digests":{"items":{"type":"string"},"type":"array","maxItems":10,"title":"Shipment Invoice Digests"}},"type":"object","required":["ruleset_version"],"title":"CheckProvenance","description":"What a stored check ran on, so a past report can be explained after a\nrule, model or prompt change (G-1): the rule set version\n(rules.RULESET_VERSION; customs_rules.CUSTOMS_RULESET_VERSION on a\nCustoms check) and, per document, the model, prompt version and reading\nroute. Never a document value.\n\ncredit_fingerprint (value plan VS-2): on an LC check, a one-way digest of\nthe credit's currency, amount and beneficiary name\n(credit_identity.credit_fingerprint), kept so a later free re-check can be\nshown to be the same credit even when its reference was corrected. A\ndigest, not a value; None when the reading lacked one of the three, and on\nresults stored before it. Left out of the partner API's copy\n(provenance.public_provenance).\n\nshipment_fingerprint and shipment_invoice_digests (value plan VC-2): the\nsame idea for a Customs check, one-way digests of its route, seller and\nbuyer and of each invoice number (customs_shipment.shipment_identity), kept\nso a later free re-check can be shown to be the same shipment. Digests,\nnever values; empty on an LC check and on results stored before them."},"DocumentProvenance":{"properties":{"slot":{"type":"string","title":"Slot"},"doc_type":{"type":"string","title":"Doc Type"},"extraction_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extraction Model"},"verify_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verify Model"},"prompt_sha":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Sha"},"extraction_route":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extraction Route"},"doubts_removed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Doubts Removed"},"source_sha256":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Source Sha256"}},"type":"object","required":["slot","doc_type"],"title":"DocumentProvenance","description":"How one document of a check was read (security audit 2026-09, G-1),\ncopied from the reading's own ExtractionQuality fields. On a web check\nthose fields are first overwritten from the server's own record of the\nreading (extraction_events.bind_readings), so the browser cannot name a\nmodel or prompt that never read the document. `slot` names the request\nfield it came from (lc, invoice, bill_of_lading, ...;\nadditional_transport_documents[1] for a further set). The model values\nare None when the document was typed or pasted into the request rather\nthan read by /api/extract (the model, prompt and route are then\nunknown)."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"PingResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true},"account_email":{"type":"string","title":"Account Email"},"plan":{"type":"string","title":"Plan"}},"type":"object","required":["account_email","plan"],"title":"PingResponse"},"UsageResponse":{"properties":{"plan":{"type":"string","title":"Plan"},"included_checks_per_period":{"type":"integer","title":"Included Checks Per Period"},"checks_used_this_period":{"type":"integer","title":"Checks Used This Period"},"check_credits":{"type":"integer","title":"Check Credits"},"current_period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Period End"},"auto_topup_enabled":{"type":"boolean","title":"Auto Topup Enabled","default":false},"topup_pending":{"type":"boolean","title":"Topup Pending","default":false}},"type":"object","required":["plan","included_checks_per_period","checks_used_this_period","check_credits","current_period_end"],"title":"UsageResponse"},"V1CaseCredit":{"properties":{"saved":{"type":"boolean","title":"Saved"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"saved_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Saved At"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"terms_available":{"type":"boolean","title":"Terms Available","default":false}},"type":"object","required":["saved"],"title":"V1CaseCredit"},"V1CheckResult":{"properties":{"id":{"type":"integer","title":"Id"},"report_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Number"},"lc_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lc Reference"},"overall_status":{"type":"string","title":"Overall Status"},"compliance_score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Compliance Score","description":"Our own 0 to 100 heuristic, not an ICC rating: 100 minus 15 per CRITICAL_ERROR and 5 per WARNING. INFO findings weigh 0 since 2026-09-24 (earlier checks counted 1 each). The score is stored as issued and never recomputed."},"findings":{"items":{"$ref":"#/components/schemas/V1Finding"},"type":"array","title":"Findings"},"created_at":{"type":"string","title":"Created At"},"amendment_benchmark":{"anyOf":[{"$ref":"#/components/schemas/AmendmentBenchmark"},{"type":"null"}]},"provenance":{"anyOf":[{"$ref":"#/components/schemas/CheckProvenance"},{"type":"null"}]}},"type":"object","required":["id","report_number","lc_reference","overall_status","compliance_score","findings","created_at"],"title":"V1CheckResult"},"V1CreditBasis":{"properties":{"case_id":{"type":"integer","title":"Case Id"},"case_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Case Reference"},"version":{"type":"integer","title":"Version"},"saved_at":{"type":"string","title":"Saved At"},"source":{"type":"string","title":"Source"}},"type":"object","required":["case_id","version","saved_at","source"],"title":"V1CreditBasis","description":"The credit a pre-check measured the document against: the case and the\nsaved version of its terms. A later version does not change a result that\nwas already given."},"V1CreditSaved":{"properties":{"status":{"type":"string","title":"Status"},"case_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Case Id"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"unreviewed_fields":{"items":{"type":"string"},"type":"array","title":"Unreviewed Fields","default":[]}},"type":"object","required":["status"],"title":"V1CreditSaved","description":"What became of the request to save the credit's terms to a case.\nstatus: saved, unchanged, unconfirmed (a field the reading doubted was not\nconfirmed by a person, which nobody can do in the partner API, so the terms\nare not saved), no_case (no case_id and the credit has no reference),\ntoo_large, storage_disabled or not_in_force. Names fields, never values."},"V1DocumentCheckResult":{"properties":{"id":{"type":"integer","title":"Id"},"report_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Number"},"case_id":{"type":"integer","title":"Case Id"},"lc_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lc Reference"},"overall_status":{"type":"string","title":"Overall Status"},"documents_checked":{"items":{"type":"string"},"type":"array","title":"Documents Checked"},"credit":{"$ref":"#/components/schemas/V1CreditBasis"},"findings":{"items":{"$ref":"#/components/schemas/V1Finding"},"type":"array","title":"Findings"},"order_check":{"anyOf":[{"$ref":"#/components/schemas/V1OrderCheck"},{"type":"null"}]},"created_at":{"type":"string","title":"Created At"},"provenance":{"anyOf":[{"$ref":"#/components/schemas/CheckProvenance"},{"type":"null"}]}},"type":"object","required":["id","report_number","case_id","lc_reference","overall_status","documents_checked","credit","findings","created_at"],"title":"V1DocumentCheckResult"},"V1Finding":{"properties":{"rule_reference":{"type":"string","title":"Rule Reference"},"severity":{"type":"string","enum":["CRITICAL_ERROR","WARNING","INFO"],"title":"Severity"},"affected_document":{"type":"string","title":"Affected Document"},"field_name":{"type":"string","title":"Field Name"},"found_value":{"type":"string","title":"Found Value"},"expected_value":{"type":"string","title":"Expected Value"},"explanation_code":{"type":"string","title":"Explanation Code"},"explanation_params":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]},"type":"object","title":"Explanation Params"},"requires_acknowledgment":{"type":"boolean","title":"Requires Acknowledgment","default":false},"suggested_fix_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Fix Code"},"suggested_fix_params":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]},"type":"object","title":"Suggested Fix Params","default":{}},"affected_doc_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Affected Doc Type"}},"type":"object","required":["rule_reference","severity","affected_document","field_name","found_value","expected_value","explanation_code","explanation_params"],"title":"V1Finding"},"V1FindingCode":{"properties":{"code":{"type":"string","title":"Code"},"fix_codes":{"items":{"type":"string"},"type":"array","title":"Fix Codes"},"params":{"items":{"type":"string"},"type":"array","title":"Params"},"severities":{"items":{"type":"string","enum":["CRITICAL_ERROR","WARNING","INFO"]},"type":"array","title":"Severities"},"since":{"type":"string","title":"Since"},"retired_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Retired At"}},"type":"object","required":["code","fix_codes","params","severities","since"],"title":"V1FindingCode"},"V1FindingCodeCatalogue":{"properties":{"ruleset_version":{"type":"string","title":"Ruleset Version"},"codes":{"items":{"$ref":"#/components/schemas/V1FindingCode"},"type":"array","title":"Codes"}},"type":"object","required":["ruleset_version","codes"],"title":"V1FindingCodeCatalogue"},"V1LcCase":{"properties":{"id":{"type":"integer","title":"Id"},"lc_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lc Reference"},"lc_expiry_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lc Expiry Date"},"latest_shipment_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Latest Shipment Date"},"credit":{"$ref":"#/components/schemas/V1CaseCredit"}},"type":"object","required":["id","lc_reference","credit"],"title":"V1LcCase"},"V1LcCaseList":{"properties":{"storage_enabled":{"type":"boolean","title":"Storage Enabled"},"cases":{"items":{"$ref":"#/components/schemas/V1LcCase"},"type":"array","title":"Cases"}},"type":"object","required":["storage_enabled","cases"],"title":"V1LcCaseList"},"V1OrderCheck":{"properties":{"findings":{"items":{"$ref":"#/components/schemas/V1OrderFinding"},"type":"array","title":"Findings"},"compared":{"items":{"type":"string"},"type":"array","title":"Compared"},"not_compared":{"items":{"$ref":"#/components/schemas/V1OrderNotCompared"},"type":"array","title":"Not Compared"},"order_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Kind"}},"type":"object","required":["findings","compared","not_compared"],"title":"V1OrderCheck","description":"The sales order, proforma invoice, contract or purchase order against the\ncredit (WP14.6, order_crosscheck.py). Every difference is a WARNING: which\nof the two the parties meant is theirs to settle. It is not part of\noverall_status."},"V1OrderFinding":{"properties":{"finding":{"$ref":"#/components/schemas/V1Finding"},"suggested_clause_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Clause Id"},"suggested_wording":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Wording"},"suggested_wording_locked":{"type":"boolean","title":"Suggested Wording Locked","default":false}},"type":"object","required":["finding"],"title":"V1OrderFinding"},"V1OrderNotCompared":{"properties":{"key":{"type":"string","title":"Key"},"reason":{"type":"string","title":"Reason"}},"type":"object","required":["key","reason"],"title":"V1OrderNotCompared"},"V1ReviewAdvice":{"properties":{"code":{"type":"string","title":"Code"},"tone":{"type":"string","enum":["RISK","COST","OK","INFO"],"title":"Tone"},"params":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"object","title":"Params"},"cost":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost"},"cost_currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost Currency"}},"type":"object","required":["code","tone","params"],"title":"V1ReviewAdvice","description":"One sentence of the commercial reading, as a code and its params."},"V1ReviewCommercial":{"properties":{"days_to_ship":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days To Ship"},"days_to_present_after_shipment":{"type":"integer","title":"Days To Present After Shipment"},"days_to_expiry":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days To Expiry"},"payment_days":{"type":"integer","title":"Payment Days"},"financing_cost":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Financing Cost"},"documents_count":{"type":"integer","title":"Documents Count"},"third_party_documents":{"items":{"type":"string"},"type":"array","title":"Third Party Documents"},"total_cost":{"type":"number","title":"Total Cost"},"cost_currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost Currency"},"mixed_currencies":{"type":"boolean","title":"Mixed Currencies","default":false},"totals":{"items":{"$ref":"#/components/schemas/V1ReviewMoney"},"type":"array","title":"Totals"}},"type":"object","required":["days_to_present_after_shipment","payment_days","documents_count","third_party_documents","total_cost","totals"],"title":"V1ReviewCommercial"},"V1ReviewFinding":{"properties":{"id":{"type":"string","title":"Id"},"rule_reference":{"type":"string","title":"Rule Reference"},"severity":{"type":"string","enum":["CRITICAL_ERROR","WARNING","INFO"],"title":"Severity"},"field_name":{"type":"string","title":"Field Name"},"explanation_code":{"type":"string","title":"Explanation Code"},"explanation_params":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"integer"}]},"type":"object","title":"Explanation Params"},"requires_acknowledgment":{"type":"boolean","title":"Requires Acknowledgment","default":false},"counterparty_severity":{"anyOf":[{"type":"string","enum":["CRITICAL_ERROR","WARNING","INFO"]},{"type":"null"}],"title":"Counterparty Severity"},"text_variant":{"anyOf":[{"type":"string","const":"APPLICANT"},{"type":"null"}],"title":"Text Variant"},"suggested_clause":{"anyOf":[{"$ref":"#/components/schemas/V1SuggestedClause"},{"type":"null"}]}},"type":"object","required":["id","rule_reference","severity","field_name","explanation_code","explanation_params"],"title":"V1ReviewFinding"},"V1ReviewMoney":{"properties":{"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"amount":{"type":"number","title":"Amount"}},"type":"object","required":["amount"],"title":"V1ReviewMoney"},"V1ReviewResult":{"properties":{"lc_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lc Reference"},"side":{"type":"string","enum":["exporter","importer"],"title":"Side"},"is_draft":{"type":"boolean","title":"Is Draft"},"overall_status":{"type":"string","title":"Overall Status"},"error_count":{"type":"integer","title":"Error Count"},"warning_count":{"type":"integer","title":"Warning Count"},"risk_band":{"type":"string","enum":["CLEAN","LOW","MEDIUM","HIGH"],"title":"Risk Band"},"risk_score":{"type":"integer","title":"Risk Score","description":"A weighted count of the findings, 0 to 100. Our own heuristic: not a probability of refusal and not a rating by any bank. It ranks several drafts of the same credit against each other."},"findings":{"items":{"$ref":"#/components/schemas/V1ReviewFinding"},"type":"array","title":"Findings"},"advice":{"items":{"$ref":"#/components/schemas/V1ReviewAdvice"},"type":"array","title":"Advice"},"commercial":{"anyOf":[{"$ref":"#/components/schemas/V1ReviewCommercial"},{"type":"null"}]},"order_check":{"anyOf":[{"$ref":"#/components/schemas/V1OrderCheck"},{"type":"null"}]},"credit_saved":{"anyOf":[{"$ref":"#/components/schemas/V1CreditSaved"},{"type":"null"}]},"ruleset_version":{"type":"string","title":"Ruleset Version"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["side","is_draft","overall_status","error_count","warning_count","risk_band","risk_score","findings","advice","ruleset_version","created_at"],"title":"V1ReviewResult"},"V1SuggestedClause":{"properties":{"clause_id":{"type":"string","title":"Clause Id"},"wording":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wording"},"locked":{"type":"boolean","title":"Locked","default":false},"rule_reference":{"type":"string","title":"Rule Reference"},"guidance_code":{"type":"string","title":"Guidance Code"}},"type":"object","required":["clause_id","rule_reference","guidance_code"],"title":"V1SuggestedClause","description":"Vetted wording to ask the issuing bank for. English on purpose, because\nit goes into a credit. A starting position for a negotiation, never advice\nand never a promise that a bank will accept it."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}