API reference
Integration examples
Copy-paste verification flows for returns platforms, shipping protection, rental companies, warranty providers, marketplaces and custom stores, in Node.js and Python.
Each example is a complete flow you can adapt. They share one shape: create a Verification (or, for damage, a Claim), give the person the Verification Link, and act on verification.result_ready (or claim.result_ready). The damage claim examples come first, then other templates.
Returns platform: verify before approving a damaged return
When a shopper picks "Arrived damaged" in your return portal, create a Claim and show the link on the confirmation screen. Approve, refund without a return, or route to review when the Result arrives.
// Node.js 18+. VERILO_API_KEY is a vrl_live_ or vrl_test_ key.
const VERILO = 'https://api.verilo.app/v1';
const headers = { Authorization: `Bearer ${process.env.VERILO_API_KEY}`, 'Content-Type': 'application/json' };
export async function onDamagedReturn(rma, order) {
const res = await fetch(`${VERILO}/claims`, {
method: 'POST',
headers: { ...headers, 'Idempotency-Key': `rma-${rma.id}` },
body: JSON.stringify({
reference: `RMA-${rma.id}`,
lineId: rma.lineId,
quantity: rma.quantity,
description: rma.customerNote,
metadata: { merchant: order.merchantId, rma: String(rma.id) },
order: {
id: order.id, name: order.number, placedAt: order.createdAt, total: order.total, currency: order.currency,
customer: { id: order.customer.id, email: order.customer.email, name: order.customer.name },
lines: order.lines.map(l => ({ id: l.id, title: l.title, variant: l.variant, sku: l.sku, quantity: l.quantity, total: l.total, imageUrl: l.imageUrl })),
shipments: order.fulfillments.map(f => ({ id: f.id, carrier: f.carrier, trackingNumber: f.trackingNumber, shippedAt: f.shippedAt, deliveredAt: f.deliveredAt }))
}
})
});
const claim = await res.json();
if (!res.ok) throw new Error(`${claim.error.code}: ${claim.error.message}`);
return claim.verificationLink.url; // show it, or email it yourself
}
// Your webhook handler, after verifying the signature (see Webhooks).
export async function onVeriloEvent(event) {
if (event.type !== 'claim.result_ready') return;
const claim = event.data.object;
const rmaId = claim.metadata.rma;
if (claim.result.state === 'Verified') await approveReturnlessRefund(rmaId);
else await sendToReviewQueue(rmaId, claim.result.explanation.weak, claim.dashboardUrl);
}Record the decision when it is made, so the Claim closes and your audit trail is complete:
await fetch(`${VERILO}/claims/${claimId}/outcome`, { method: 'POST', headers, body: JSON.stringify({ decision: 'Refund Issued' }) });Shipping protection: verify transit damage and file with the carrier
Protection claims need evidence that this parcel arrived damaged. Send the order when the policy is bought, create the Claim when the claim is filed, and download the carrier claim pack on a Verified Result.
import os, requests
VERILO = "https://api.verilo.app/v1"
H = {"Authorization": f"Bearer {os.environ['VERILO_API_KEY']}"}
def on_policy_purchased(order):
requests.post(f"{VERILO}/orders", headers=H, json=order).raise_for_status()
def on_protection_claim(claim_id, order_id, line_id, note):
r = requests.post(f"{VERILO}/claims", headers={**H, "Idempotency-Key": f"pc-{claim_id}"},
json={"orderId": order_id, "lineId": line_id, "reference": claim_id,
"description": note, "sendEmail": True})
r.raise_for_status()
return r.json()["id"]
def on_result(event):
claim = event["data"]["object"]
if claim["result"]["state"] != "Verified":
return route_to_adjuster(claim["reference"], claim["result"]["explanation"])
pack = requests.get(f"{VERILO}/claims/{claim['id']}/carrier_pack", headers=H)
if pack.status_code == 200:
store_document(claim["reference"], "carrier-claim.pdf", pack.content)
approve_payout(claim["reference"])The evidence (GET /v1/claims/{id}/evidence) also gives the carrier's filing deadline and every picture with its SHA-256.
Marketplace: one API account, many sellers
Create Claims from your buyer-protection flow and put the seller in metadata. Every webhook carries it back, so one endpoint routes Results to the right seller.
const claim = await createClaim({ ...body, metadata: { seller: seller.id, dispute: dispute.id } });
// later, in the webhook handler:
const { seller, dispute } = event.data.object.metadata;Custom store or helpdesk: send the link yourself
Leave sendEmail off and put verificationLink.url in your own email, SMS or chat message. Links work for 72 hours. When one expires, claim.link_expired arrives; make a new one and send it again:
curl -X POST https://api.verilo.app/v1/claims/clm_.../verification_links \
-H "Authorization: Bearer $VERILO_API_KEY"Rental company: check the condition of every return
When a renter books a return, create a rental_return Verification with the unit's asset tag and your catalogue image, and put the booking in metadata. Release the deposit on Verified; route anything else to your returns team with the close-ups and photos.
const VERILO = 'https://api.verilo.app/v1';
const verilo = (method, path, body) => fetch(`${VERILO}${path}`, {
method,
headers: { Authorization: `Bearer ${process.env.VERILO_API_KEY}`, 'Content-Type': 'application/json' },
body: body && JSON.stringify(body),
}).then(r => r.json());
const v = await verilo('POST', '/verifications', {
template: 'rental_return',
reference: booking.id, // the same booking never makes a second Verification
subject: { name: unit.model },
references: { asset_tag: [unit.assetTag], item: unit.catalogueImageUrl },
metadata: { booking: booking.id },
});
await sms(booking.phone, `Before you hand it back, show us the ${unit.model}: ${v.verificationLink.url}`);
// in the webhook handler
if (event.type === 'verification.result_ready') {
const { result, metadata } = event.data.object;
if (result.state === 'Verified') await releaseDeposit(metadata.booking);
else await queueForInspection(metadata.booking, result.explanation.weak);
}Warranty provider: tie the claim to the registered unit
A warranty claim is only as good as its link to the unit you cover. Send the serial you registered: the serial step reads the product's serial barcode and matches it, and the Result says so step by step.
import os, requests
def verilo(method, path, body=None):
r = requests.request(method, f"https://api.verilo.app/v1{path}", json=body,
headers={"Authorization": f"Bearer {os.environ['VERILO_API_KEY']}"})
return r.json()
v = verilo("POST", "/verifications", {
"template": "warranty_serial",
"reference": claim["id"],
"subject": {"name": policy["product_name"]},
"references": {"serial": [policy["serial"]], "item": policy["product_image_url"]},
})
# in the webhook handler
serial = next(s for s in event["data"]["object"]["result"]["steps"] if s["key"] == "serial")
if serial["result"] != "passed":
flag_for_review(claim["id"], serial["measured"]) # e.g. {"outcome": "mismatch", "codes": ["SN-..."]}Marketplace listings: show buyers the item is real
Ask sellers of higher-value items to verify before the listing goes live. resale_listing matches the item to the listing's main photo, reads its serial or model code when it has one, measures depth as the phone moves around it and photographs its condition. Show a badge on Verified and attach the evidence pack to disputes. With the verilo helper from the rental example:
const v = await verilo('POST', '/verifications', {
template: 'resale_listing',
reference: `listing-${listing.id}`,
subject: { name: listing.title },
references: { item: listing.photos[0] },
metadata: { listing: listing.id, seller: listing.sellerId },
});Your own steps
A flow none of the built-in templates fits, such as bikes with a frame number under the bottom bracket, gets its own template once, then one call per Verification. See Custom templates.
Reading a Result
- Verified: independent checks agree. For a damage claim, the label matches this order's tracking number, the item matches the product image, the scene responds to the phone's light, and every step was done; most teams refund or replace without asking for more. For other templates, every check the template makes passed: read
result.stepsfor each. - Needs Review: some checks did not agree.
explanation.weaknames which, in plain words. A person looks at the evidence:dashboardUrlfor a Claim, the evidence pack for any Verification. - Unable to Verify: the evidence could not be checked, for example an unreadable label. Ask the customer to try again with a new link, or review it.
Verilo never decides the claim or moves money. The decision, and for Claims the Outcome you record, are yours.