In our infrastructure, we implement targeted safeguards to ensure optimal performance and high availability of our systems and services. Consequently, we have designed an event-driven architecture to optimize API response times by offloading processes that require extended execution time.
When our API initiates a long-running process, it returns a specific message to your API client, indicating this status, along with a URL that can be integrated into your response retry function.
For any function that necessitates request offloading, the following response will be provided, enabling your application to request updates on the process status.
{
"error": {
"code": "request_processing",
"message": "The request is still processing, Use URL from api_request to continue to check for the response.",
"api_request": "https://api.vrio.app/api_requests/2ec91038-19a6-4159-afea-325dccf12345"
}
}
Executing a GET request on the api_request parameter will return the process results upon completion. If an invalid ID is returned, it indicates that the ID does not yet exist and the process is still ongoing.
{
"error": {
"code": "invalid_id",
"message": "Invalid request id"
}
}
Otherwise, the process response will be available.
{
"api_request_id": "2ec91038-19a6-4159-afea-325dccf12345",
"created_at": 1707940072278,
"response_at": 1707940103794,
"api_url": "POST /orders",
"api_resource": "POST /orders",
"api_request": "{full_api_request}",
"api_response": "{full_api_response}",
"api_response_code": 200,
"organization": "org.vrio",
"user_id": 1234,
"ip_address": "111.222.333.444, 999.888.777.666"
}
This example demonstrates our management of extended authorization and capture times from credit card gateways. Typically, these gateways respond rapidly. However, when additional time is required, we employ this process to ensure transactions are captured, thereby facilitating sales for your storefront.
How to test your integration
To ensure your process can properly handle these responses, you can trigger a response lookup event by creating a test order and setting the bill_lnameto “testlongrequest”.
"bill_lname": "testlongrequest"