Visa APIv1
Webhooks
Events, signatures, retries and duplicates.
We can notify an HTTPS endpoint of yours when something happens on one of your orders, so you do not have to poll.
Registering an endpoint. Ask your contact to register it: give us the URL (it must be https and reachable from the internet) and the events you want. We send you the endpoint's signing secret (whsec_...); keep it on your server only. You can have up to 5 endpoints, and we can send a ping test event at any time.
Events
| Event | Sent when |
|---|---|
order.status_changed | The order's status changes: submitted, action_required (also when a new request replaces an open one), in_review, filed, approved, refused, cancelled or expired. |
order.result_available | A result file, such as the e-visa, is ready to download. |
order.message_created | Plusvisa wrote in the order's message thread. Your own messages are not sent back. |
ping | A test event, sent on request. |
Every event is a POST with a JSON body of the same shape. data always names the order by reference and client_reference, and its action_required, result and message objects are exactly what the API returns for the order, its results and its messages. The payload schemas are under Webhook events in the API reference.
{
"id": "evt_4ae4445a52744753a0720cf323302403",
"type": "order.status_changed",
"created_at": "2026-11-04T10:31:58.210803Z",
"data": {
"reference": "PV-4Z8M2X64",
"client_reference": "booking-48213",
"status": "action_required",
"previous_status": "submitted",
"action_required": {
"message": "Please retake the photo and check the surname.",
"items": [
{"kind": "document", "key": "passport", "reason": "blurry", "note": "Face is cut off"},
{"kind": "answer", "key": "surname", "reason": "incorrect_answer", "note": null}
],
"requested_at": "2026-11-04T10:31:58.203903Z"
},
"refusal_reason": null
}
}{
"id": "evt_4b75b889db924196b4470954eeb53708",
"type": "order.result_available",
"created_at": "2026-11-04T12:02:11.530574Z",
"data": {
"reference": "PV-4Z8M2X64",
"client_reference": "booking-48213",
"result": {"id": "13c5c7e9-cafe-42a3-a308-5c7c31968bda", "kind": "evisa", "filename": "evisa.pdf", "size_bytes": 182344, "ready_at": "2026-11-04T12:02:11.528759Z"}
}
}{
"id": "evt_9e68acef4ddd45cfb2a1d638f171c513",
"type": "order.message_created",
"created_at": "2026-11-04T10:40:03.273356Z",
"data": {
"reference": "PV-4Z8M2X64",
"client_reference": "booking-48213",
"message": {"id": "4a402bd0-ad88-4c8d-8d01-086c8272df54", "author": "plusvisa", "body": "We need a clearer photo.", "created_at": "2026-11-04T10:40:03.270894Z"}
}
}{
"id": "evt_0f6e2d1c9b8a47f3a2e1d0c9b8a7f6e5",
"type": "ping",
"created_at": "2026-11-04T09:00:00Z",
"data": {"message": "Test event from Plusvisa"}
}Headers. Content-Type: application/json, PV-Event-Id (the event id), PV-Event-Type and PV-Signature: t=<unix seconds>,v1=<hex>.
Verify every request
Before you trust a request:
- Read the raw request body, before any JSON parsing.
- Split
PV-Signatureon,intotandv1. - Refuse the request if
tis more than 300 seconds from your clock. - Compute HMAC-SHA256 with your secret as the key over
t, a., and the raw body, as lowercase hex. - Compare it with
v1in constant time.
import hashlib, hmac, time
def verify(secret: str, header: str, body: bytes, tolerance: int = 300) -> bool:
try:
pairs = (item.strip().split("=", 1) for item in header.split(",") if "=" in item)
parts = {key: value for key, value in pairs}
timestamp, signature = parts.get("t", ""), parts.get("v1", "")
if not timestamp.isdigit() or abs(time.time() - int(timestamp)) > tolerance:
return False
signed = f"{timestamp}.".encode() + body
expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected.encode(), signature.encode())
except (TypeError, ValueError, UnicodeError):
return Falseconst crypto = require("crypto");
function verify(secret, header, rawBody, tolerance = 300) {
const parts = Object.fromEntries(header.split(",").map((p) => p.split("=", 2)));
const timestamp = Number(parts.t);
if (!Number.isInteger(timestamp) || Math.abs(Date.now() / 1000 - timestamp) > tolerance) return false;
const expected = crypto.createHmac("sha256", secret).update(`${parts.t}.`).update(rawBody).digest("hex");
const given = Buffer.from(parts.v1 || "", "utf8");
return given.length === expected.length && crypto.timingSafeEqual(Buffer.from(expected, "utf8"), given);
}If we rotate your secret, the old one stops working at once.
Answer quickly
Reply with any 2xx within 10 seconds, then do the work in the background. We do not follow redirects: a 3xx counts as a failure, like any other status, a timeout or a connection error.
Retries
A failed delivery is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, then every 12 hours, for up to 72 hours after the event. After that we stop trying.
Duplicates and order
You may receive an event more than once: every retry carries the same id (evt_...), so skip ids you have already processed. Events can arrive out of order. Use created_at, and fetch the order when you need its current state.