const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
shipment: {
tracking_number: '1Z999AA1234567890',
origin: {postcode: '<string>', country: '<string>'},
destination: {
postcode: '<string>',
country: '<string>',
city: '<string>',
address: '<string>',
customer_name: '<string>',
customer_phone: '<string>'
},
line_items: [{description: '<string>', quantity: 2, unit_price: 2, currency: 'EUR'}],
provider: '<string>'
},
incidence: {claimed_amount: 2, description: '<string>', currency: 'EUR'}
})
};
fetch('https://api.opereit.ai/v1/claims', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"number": "<string>",
"status": "CREATED",
"status_reason": null,
"date": "2023-12-25",
"carrier_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"total_amount": 123,
"shipment": {
"id": "<string>",
"tracking_number": "<string>",
"carrier_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"origin": {
"postcode": "<string>",
"country": "<string>"
},
"destination": {
"postcode": "<string>",
"country": "<string>",
"city": "<string>",
"address": "<string>",
"customer_name": "<string>"
},
"line_items": [
{
"id": "<string>",
"description": "<string>",
"quantity": 123,
"unit_price": 123,
"total": 123
}
],
"service_type": "<string>",
"shipped_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z",
"number_of_items": 123
},
"incidence": {
"id": "<string>",
"type": "DAMAGED",
"claimed_amount": 123,
"currency": "<string>",
"line_items": [
{
"id": "<string>"
}
],
"description": "<string>",
"recovered_amount": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"provider_id": "<string>"
}{
"statusCode": 400,
"statusReasonCode": "INVALID_REQUEST_BODY",
"error": "Invalid request body",
"details": {
"formErrors": [],
"fieldErrors": {
"shipment": [
"Invalid option: expected one of \"BPOST\"|\"BRT\"|\"CHRONOPOST\"|...|\"UPS\""
],
"incidence": [
"Claimed amount must be a positive integer (smallest currency unit)"
]
}
}
}{
"statusCode": 401,
"statusReasonCode": "AUTHENTICATION_REQUIRED",
"error": "Authentication required"
}{
"statusCode": 409,
"statusReasonCode": "CLAIM_ALREADY_EXISTS",
"error": "An open claim already exists for shipment 1Z999AA1234567890. Please contact Opereit support if you want to fix the previous claim."
}{
"statusCode": 500,
"statusReasonCode": "INTERNAL_ERROR",
"error": "Internal server error"
}Create a claim
Submit a new claim and its associated shipment and incidence details. This kicks off Opereit’s review process and prepares the necessary documentation.
If a shipment with the same tracking_number already exists in your organization (e.g. from a previous claim) and it doesn’t have an open claim on it, the new claim is attached to that existing shipment record — the origin/destination you send in this request are only used the first time a shipment is created for that tracking number, and are ignored on later requests for the same tracking number.
const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
shipment: {
tracking_number: '1Z999AA1234567890',
origin: {postcode: '<string>', country: '<string>'},
destination: {
postcode: '<string>',
country: '<string>',
city: '<string>',
address: '<string>',
customer_name: '<string>',
customer_phone: '<string>'
},
line_items: [{description: '<string>', quantity: 2, unit_price: 2, currency: 'EUR'}],
provider: '<string>'
},
incidence: {claimed_amount: 2, description: '<string>', currency: 'EUR'}
})
};
fetch('https://api.opereit.ai/v1/claims', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"number": "<string>",
"status": "CREATED",
"status_reason": null,
"date": "2023-12-25",
"carrier_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"total_amount": 123,
"shipment": {
"id": "<string>",
"tracking_number": "<string>",
"carrier_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"origin": {
"postcode": "<string>",
"country": "<string>"
},
"destination": {
"postcode": "<string>",
"country": "<string>",
"city": "<string>",
"address": "<string>",
"customer_name": "<string>"
},
"line_items": [
{
"id": "<string>",
"description": "<string>",
"quantity": 123,
"unit_price": 123,
"total": 123
}
],
"service_type": "<string>",
"shipped_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z",
"number_of_items": 123
},
"incidence": {
"id": "<string>",
"type": "DAMAGED",
"claimed_amount": 123,
"currency": "<string>",
"line_items": [
{
"id": "<string>"
}
],
"description": "<string>",
"recovered_amount": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"provider_id": "<string>"
}{
"statusCode": 400,
"statusReasonCode": "INVALID_REQUEST_BODY",
"error": "Invalid request body",
"details": {
"formErrors": [],
"fieldErrors": {
"shipment": [
"Invalid option: expected one of \"BPOST\"|\"BRT\"|\"CHRONOPOST\"|...|\"UPS\""
],
"incidence": [
"Claimed amount must be a positive integer (smallest currency unit)"
]
}
}
}{
"statusCode": 401,
"statusReasonCode": "AUTHENTICATION_REQUIRED",
"error": "Authentication required"
}{
"statusCode": 409,
"statusReasonCode": "CLAIM_ALREADY_EXISTS",
"error": "An open claim already exists for shipment 1Z999AA1234567890. Please contact Opereit support if you want to fix the previous claim."
}{
"statusCode": 500,
"statusReasonCode": "INTERNAL_ERROR",
"error": "Internal server error"
}Authorizations
HTTP Basic Auth using your API key. Send Authorization: Basic base64(key_id:key_secret).
Body
Response
Claim created.
The claim just created, as returned by the create-claim endpoint.
Unique claim ID.
Human-readable claim reference. null until assigned by the Opereit team.
Always CREATED on this response.
CREATED, UNDER_REVIEW, PENDING_ACTION, PENDING_REFUND, PENDING_REFUND_AMOUNT_CONFIRMED, RESOLVED, CANCELED, REJECTED, CLOSED Always null on this response — a newly created claim starts at CREATED, which doesn't carry a status reason. See Status reasons.
Date the claim was filed.
Equal to incidence.claimed_amount, in the smallest currency unit.
Show child attributes
Show child attributes
Show child attributes
Show child attributes