Visa APIv1

Results and messages

Download the e-visa or letter, and talk to Plusvisa about an order.

Results

When a decision is made we may attach files to the order, such as the e-visa, an approval letter or a refusal letter.

  • GET /api/v1/orders/{reference}/results lists them. Each has an id, a kind (evisa, approval_letter, refusal_letter or other), the filename, size_bytes and ready_at.
  • GET /api/v1/orders/{reference}/results/{result_id} downloads one file as an attachment. The file is streamed through to you, so read it as a stream rather than loading it into memory.
  • Files appear only after the order is approved or refused, and only once they are ready. has_results on the order turns true when there is at least one, so you do not need to poll the list. A refusal may also carry refusal_reason.
  • The id of a result is stable. Ids of results that belong to another order, or that do not exist, return result_not_found.
curl -OJ "$PLUSVISA_API_URL/api/v1/orders/PV-4Z8M2X64/results/13c5c7e9-cafe-42a3-a308-5c7c31968bda" \
  -H "X-API-Key: $PLUSVISA_API_KEY"

Subscribe to order.result_available to hear about a file as soon as it is ready (see Webhooks).

Messages

Each order has a message thread between you and Plusvisa, for questions about that application.

  • GET /api/v1/orders/{reference}/messages returns the thread, oldest first. Each message has an id, author (you or plusvisa), the body and created_at. Pass since (ISO 8601) to get only newer messages.
  • POST /api/v1/orders/{reference}/messages with {"body": "..."} sends one. Text only, at most 4000 characters (message_too_long otherwise). Send an Idempotency-Key so a retry does not post it twice. You can write in any status except expired.
curl -X POST "$PLUSVISA_API_URL/api/v1/orders/PV-4Z8M2X64/messages" \
  -H "X-API-Key: $PLUSVISA_API_KEY" -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"body": "The traveller has a new passport. Should we upload it?"}'

Following along. A new message moves the order's updated_at, so polling GET /api/v1/orders?updated_since=... shows which orders have news. Fetch the order's messages with since to read them, or subscribe to order.message_created.