Receive a won deal as a contract intake
Receive a won deal as a contract intake
Finance reviewers, and an API key. Records a deal and, when it carries a contract file, queues its extraction and a review task; the same deal sent again returns the same intake with created false.
Headers
X-Tenant-SlugstringThe workspace the request acts in.
X-Valtor-Advisor-Sessionstring
Request body
external_refstringrequiredsource_systemstringDefault
"api"company_namestringnullableowner_emailstringnullablestated_valueobjectnullableShow 2 child fields
amount_minorintegerrequiredcurrencystringrequired
deal_closed_ondatenullabledocumentobjectnullableShow 4 child fields
filenamestringrequiredmime_typestringrequiredcontent_base64stringrequiredkindstringDefault
"signed_contract"
Response 200
dataobjectrequiredThe intake for the deal, with whether this call created it.
Show 20 child fields
iduuidrequiredThe contract intake.
sourcestringrequiredHow it arrived: api, upload or crm.
source_systemstringrequiredThe sending system's key.
external_refstringrequiredThe deal's id in the sending system; unique per source system.
company_namestringrequirednullableThe company the deal is with, as the sender named it.
owner_emailstringrequirednullableThe deal owner's email, used only to find the member to assign.
stated_valueobjectrequirednullableThe value the sender stated; null when none.
Show 3 child fields
amount_minorintegerrequiredThe value the sender stated, in minor units.
currencystringrequiredISO 4217 currency of the stated value.
originstringrequiredThe source system that stated it. Nothing downstream reads it: a contract term is evidenced only by the contract.
deal_closed_onstringrequirednullableISO date the deal closed in the sender's system; kept on the contract, never a term.
statestringrequiredawaiting_document, plan_limit_reached (a CRM deal the plan had no room for, read once there is room), document_received, contract_created once a contract exists, or dismissed.
document_set_iduuidrequirednullableThe document set holding the contract file; null while awaiting a document.
contract_iduuidrequirednullableThe contract created from the document set; null until it exists.
extraction_statusstringrequirednullableStatus of the newest extraction run of the document set; null before one exists.
task_iduuidrequirednullableThe review task raised for the intake.
created_atstringrequiredISO timestamp the intake was received.
updated_atstringrequiredISO timestamp of its last change.
dismissal_reasonstringrequirednullableWhy it was dismissed; null otherwise.
known_partyobjectrequirednullableThe customer an earlier contract from the same CRM company was approved with.
Show 2 child fields
iduuidrequiredThe customer.
namestringrequiredThe customer's display name.
candidate_filesarray of objectrequiredFiles a CRM deal attached when more than one could be the contract; empty unless awaiting a document.
unreadable_filesarray of objectrequiredFiles the CRM would not hand over, each with its reason; empty unless awaiting a document.
createdbooleanrequiredTrue when this call created the intake, false when the deal was already known and the call was a replay.
Errors
Every error has the same shape: an error object with a stable code and a message for people. 403 is a missing role, 404 a row this workspace does not hold, 409 a state conflict, 422 a broken business rule. A missing or invalid token answers 401 on every signed-in route.
| Status | Code | Meaning |
|---|---|---|
| 409 | intake_conflict | The intake could not be recorded |
| 409 | production_not_enabled | |
| 422 | intake_document_not_contractual | Intake accepts the contract itself; invoices and evidence are added from the review screen |
| 422 | invalid_intake_document | content_base64 is not valid base64 |
| 422 | request_validation_failed | One or more request fields are invalid |