Request Custom Approval

The BindID custom approval request initiates a custom approval flow for a specific need, such as updating account details or consenting to age restrictions. Once the BindID SDK is initialized programmatically, you can invoke a custom approval programmatically by using the invokeApproval() SDK method (see the API reference). This will redirect if successful; otherwise, it will fail.

Here is an example of invoking the invokeApproval() SDK method, where the approval flow is updating account details and encryption is requested by default:

function invokeBindIdUpdateAccountApproval() {
window.XmBindId.invokeApproval({
redirectUri: 'https://your-rp.example.com',
verifications: [window.XmBindId.XmRequiredVerifications.Phone, window.XmBindId.XmRequiredVerifications.Email],
customMessage: 'Update Account',
approvalSigningData: {
displayData: {
mainAttribute: {
label: 'Account name',
value: 'Acme Suppliers'
},
attributes: [
{
label: 'Bank name',
value: 'Big Bank',
icon: window.XmBindId.XmBindIdApprovalIcons.Contract
},
{
label: 'Account number',
value: '123456',
icon: window.XmBindId.XmBindIdApprovalIcons.Id
}
]
},
essential: true
}
}).then(res => {
onSuccess(res);
}, err => {
onFailure(err);
})
}

The following image displays the location of the mainAttribute and attributes fields on the consent screen: