Impact the future of visa services.

General Flow
Get a list of visa offers
Get Application Form
Save Order
Submit the Order
Upload Documents
Check Order Status
General Flow

1. Get a list of visa offers Visa application form is not permanent and could be changed by a consulate or embassy. As soon as embassy changes the application, we reflect the change in our system and create a new version of the same application. End-point is required to get a latest and up to date id of application for chosen destination.

2. Get Application Form Function supposed to be used for retrieving a list of questions of particular application by its ID

3. Save Order You have to create an order and send user data to VisaHQ. Can be called several times in a row for updating user information.

4. Submit the Order Completes the order and submits it to VisaHQ

5. Upload documents In most of the cases, embassies and consulates require scan copies of documents and booking confirmations to be attached. You can upload user scans using a current function.

6. Check order status After order submission, it’s possible to check for its current status

Note: Get a list of visa offers and Get Application form functions are optional and could be replaced on hard-code. We should consider it to simplify initial development and reduce the amount of tests. But we should not stick to hard code on a long run.

Get a list of visa offers
//insert code here
POST https://bvhq12p.visahq.org/v0/services/5/search
{
    "residency": "CN",  //customer’s residency
    "citizenship": "CN", //customer’s citizenship
    "destination": enum ("TR","LK","IN","KH","VN","MM","TJ","GE","KG","AM","AZ","…"), //destinations alpha2 code
    "visa_group": 68, //visa type (tourist, business, etc.)
}

//response example
{
    "id":,
    "service_id":,
    "residency":"",
    "citizenship":"",
    "destination":"",
    "visa_group":,
    "Prices":[
    // bold selection below is iterative and shows all available combinations of visa processing times
    // and visa types. Cost information should be ignored
/strong        {
/strong            "keys":{
/strong                "proc_time":{
/strong                    "id":4,
/strong                    "name":"2-3 business days",
/strong                    "days_count":3
/strong                },
/strong                "visa_type":{
/strong                    "id":3,
/strong                    "name":"90 days Multiple Entry"
/strong                }
/strong            },
/strong            "fields":[
/strong                {
/strong                    "id":"0",
/strong                    "label":"Embassy fee",
/strong                    "Value":88
/strong                },
/strong                {
/strong                    "id":"1",
/strong                    "label":"Service fee",
/strong                    "value":35.7
/strong                }]
/strong        }/end_strong]
}
//end code

Returns 404 if no application available

Get Application Form
//insert code here   (/strong  - bold line.  End  /end_strong)
// service_item_id is a value received from previous (Get a list of visa offers) request
GET https://bvhq12p.visahq.org/v0/services/5/items//application

//Simplified response example. Full responses can be found in archive
{
    "service_id":,
    "service_item_id":,
    "items":[ # Questions section
        {
            "label":"Traveler contacts",
            "items":[ # Questions group
                {
                    "is_iterated":false,
                    "conditions":[
                        {
                            "question_id": "refused"
                            "value": "true",
                            "operator":"="
                        }
                    ],
                    "items":[ # Questions
                        {
                            "id":"homeaddress",
                            "is_required":false,
                            "label":"Home address",
                            "help":"Please provide address where you currently reside.",
                            "view":"text"
                        }
                    ]
                }
            ]
        }
    ]
}
//end code
Save Order
//insert code here   (/strong  - bold line)
//Simplified request example. Full request can be found in archive
//price object need to be an exact copy of the proper element from the prices array received from Get Application 
// ID function
POST https://bvhq12p.visahq.org/v0/basket/add-service
{
    "price":{
        "keys":{
            "proc_time":{
                "id":4,
                "name":"2-3 business days",
                "Days_count":3
            },
            "visa_type":{
                "id":3,
                "name":"90 days Multiple Entry"
            }
        },
        "fields":[
            {
                "id":"0",
                "label":"Embassy fee",
                "value":88
            },
            {
                "id":"1",
                "label":"Service fee",
                "value":35.7
            }
        ]
    },
    "service":,
    "service_item":,
    "application":{
        "first-name":["John"],
        "last-name":["Doe"]
    }
}

// Simplified response example. Full responses can be found in archive
{
    "":{
        
    }
}
//end code
Submit the Order
//insert code here   (/strong  - bold line)
POST https://bvhq12p.visahq.org/v0/basket/finish
{
    "Invoice":{}
}

//Full Response can be found in archive

{
    "id": 1503,
    "invoice": "DE1385",
    "user_id": "13041",
    "status": "unpaid",
    "created": "2017-12-28T11:38:50.786+00:00",
    "updated": "2017-12-28T11:38:50.897+00:00",
    "total": 219,
    "service_list": [..]
}

//Make sure you save order_id. It will be used in further calls
//end code
Upload Documents
//insert code here   (/strong  - bold line)
POST https://bvhq12p.visahq.org//v0/orders/{orderId}/files

// Request body contains a file that needs to be uploaded
// Note: only one file per request

{
    "id":123,
    "date": "2017-12-28T11:29:25.657+00:00",
    "author":"John Smith",
    "url":"https://bvhq12p.visahq.org/v0/orders/{orderId}/downloads/123"
}
//end code
Check Order Status
//insert code here   (/strong  - bold line)
GET  https://bvhq12p.visahq.org//v0/external-orders/{orderId}

//The response is the same as in Submit Order call

{
    "id": 1503,
    "invoice": "DE1385",
    "user_id": "13041",
    "status": "unpaid",
    "created": "2017-12-28T11:38:50.786+00:00",
    "updated": "2017-12-28T11:38:50.897+00:00",
    "total": 219,
    "service_list": [
        {
            "id": 1480,
            "order_id": 1503,
            "currency": {
                "code": "EUR",
                "numeric": "978",
                "label": "Euro"
            },
            "total": 219,
            "created": "2017-12-28T11:38:50.790+00:00",
            "updated": "2017-12-28T11:38:50.790+00:00",
            "status": "pending",
            //……..
        }
    ]
}

//Application status located at service_list[0].status
//end code