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}/resultslists them. Each has anid, akind(evisa,approval_letter,refusal_letterorother), thefilename,size_bytesandready_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
approvedorrefused, and only once they are ready.has_resultson the order turnstruewhen there is at least one, so you do not need to poll the list. A refusal may also carryrefusal_reason. - The
idof a result is stable. Ids of results that belong to another order, or that do not exist, returnresult_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}/messagesreturns the thread, oldest first. Each message has anid,author(youorplusvisa), thebodyandcreated_at. Passsince(ISO 8601) to get only newer messages.POST /api/v1/orders/{reference}/messageswith{"body": "..."}sends one. Text only, at most 4000 characters (message_too_longotherwise). Send anIdempotency-Keyso a retry does not post it twice. You can write in any status exceptexpired.
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.