const form = new FormData();
form.append('file', '<string>');
form.append('carrier_name', '<string>');
form.append('signing_date', '2023-12-25');
form.append('contract_number', '<string>');
form.append('account_number', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Basic <encoded-value>'}};
options.body = form;
fetch('https://api.opereit.ai/v1/contracts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"contract": {
"id": "<string>",
"carrier_name": "DHL Express",
"signing_date": "2023-12-25",
"status": "PROCESSING",
"rate_count": 123,
"surcharge_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"contract_number": "<string>",
"account_number": "<string>",
"effective_date": "2023-12-25",
"expiration_date": "2023-12-25",
"status_reason": "<string>",
"file_url": "<string>"
}
}{
"statusCode": 400,
"statusReasonCode": "INVALID_REQUEST_BODY",
"error": "Invalid request body",
"details": {
"formErrors": [],
"fieldErrors": {}
}
}{
"statusCode": 401,
"statusReasonCode": "AUTHENTICATION_REQUIRED",
"error": "Authentication required"
}Upload contract
Upload a carrier contract document. Opereit asynchronously extracts rate cards and surcharges from the file. The contract is created with status=PROCESSING; it transitions to ACTIVE once extraction completes (or FAILED if extraction errors out).
Accepted file formats: PDF, PNG, JPEG, CSV, XLS, XLSX.
const form = new FormData();
form.append('file', '<string>');
form.append('carrier_name', '<string>');
form.append('signing_date', '2023-12-25');
form.append('contract_number', '<string>');
form.append('account_number', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Basic <encoded-value>'}};
options.body = form;
fetch('https://api.opereit.ai/v1/contracts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"contract": {
"id": "<string>",
"carrier_name": "DHL Express",
"signing_date": "2023-12-25",
"status": "PROCESSING",
"rate_count": 123,
"surcharge_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"contract_number": "<string>",
"account_number": "<string>",
"effective_date": "2023-12-25",
"expiration_date": "2023-12-25",
"status_reason": "<string>",
"file_url": "<string>"
}
}{
"statusCode": 400,
"statusReasonCode": "INVALID_REQUEST_BODY",
"error": "Invalid request body",
"details": {
"formErrors": [],
"fieldErrors": {}
}
}{
"statusCode": 401,
"statusReasonCode": "AUTHENTICATION_REQUIRED",
"error": "Authentication required"
}Authorizations
HTTP Basic Auth using your API key. Send Authorization: Basic base64(key_id:key_secret).
Body
The contract document. Accepted MIME types: application/pdf, image/png, image/jpeg, text/csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.
The carrier this contract belongs to (e.g. UPS, FedEx, DHL Express).
Date the contract was signed, in YYYY-MM-DD format.
Optional carrier-issued contract number.
Optional carrier account number this contract applies to.
Response
Contract created. Extraction runs asynchronously.
A carrier contract uploaded to Opereit. Rates and surcharges are extracted asynchronously.
Show child attributes
Show child attributes