General API Features

Security

The API is secured with a key, which can be requested from your Aventus Account Manager. This must be provided as a header with every request .

There will be a different API key per environment.

Header NameHead value
avt-api-keyKey, as provided by Aventus

Response Envelope

{
    "data":{},
    "error":-1,
    "error_description":null,
    "successful":true,
    "validationErrors": []
}
{
    "data":{},
    "error":1006,
    "error_description":"Validation failed",
    "successful":false,
    "validationErrors": [{
            "message": "A previous address must be provided.",
            "propertyIdentifier": "NewBusinessRequestType.Applicant.Customer"
        }]
}

All API responses, including errors, shall be wrapped with the following response envelope unless otherwise stated.

KeyDataTypeDescription
dataobjectThe response data
errorintThe error code, if the request was unsuccessful.
For a successful response the error will always be -1
error_descriptionstringHuman-readable description of the error.
successfulbooleantrue if a successful request, otherwise false.
validationErrorsValidationError ArrayArray of validations (if any)

Errors

The API returns standard HTTP status codes.

Validation Errors

Where the error is a result of a validation exception, the response will provide additional breakdown information for each error, and a field reference where possible.

FieldDescription
messageHuman-readable description of the validation error.
propertyIdentifierWhere the input validation was the result of an error in a single field, this will be path to the input.

Additional Errors from BNP

Where BNP return additional errors in their envelope, these will be passed back to the caller, with the Aventus Error specifying that there has been an external system error.

{
    "data": {
        "newBusinessResponseType": {
            "brokerReference": null,
            "accountNumber": null,
            "decision": 5,
            "pdf": "",
            "responseStatus": 2
        },
        "errors": [
            {
                "code": 1079,
                "description": "duplicate combination of client code / shop code / broker reference. Provide different broker reference"
            }
        ]
    },
    "validationErrors": null,
    "error": 1033,
    "error_description": "External system error",
    "successful": false
}

Details on BNP error codes can be found in their integration documentation.