Payments with AIS Requirements
Create payments that require customers to complete AIS (Account Information Services) bank account verification before the payment can proceed. This enables bank account verification, affordability checks, source of wealth verification, and lending workflows.
- Bank account verification - Verify account ownership for refunds or payouts (accounts only)
- Affordability checks - Verify customer's account balance before lending (accounts + balances)
- Source of wealth - Analyse transaction history for compliance (accounts + balances + transactions)
- High-value transactions - Additional verification before processing large payments
Overview
When you create a payment with AIS requirements, the customer must have a valid Open Banking connection with the required scopes before the payment can proceed. If the customer hasn't completed AIS, or their token has expired, they will be automatically redirected to complete bank account linking before returning to the payment flow.
How It Works
Payment + AIS Flow
- Create Customer - Create a customer record via
POST /v1/customers - Create Payment - Create payment with
aisRequirementsspecifying required scopes - Redirect Customer - Send customer to the returned
payLink - AIS Check - PayerServices checks if customer has valid AIS token with required scopes
- Conditional AIS Flow - If AIS not satisfied:
- Customer redirected to bank selection
- Customer completes Open Banking authorization with their bank
- Token stored against customer record
- Customer returned to payment flow
- Payment Proceeds - Once AIS requirements satisfied, payment flow continues
- Complete Payment - Customer completes payment (bank transfer or card)
- Return to Merchant - Customer redirected to your
returnUrl
Creating a Payment with AIS Requirements
/v1/payments
Required Permissions: create_payment
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
amount |
decimal | Yes | Payment amount (must be > 0) |
reference |
string | Yes | Your unique reference for this payment |
customerId |
string | Yes* | ID of existing customer. Required when using aisRequirements |
aisRequirements |
object | No | AIS scopes required before payment can proceed (see below) |
returnUrl |
string | No | URL to redirect customer after payment |
cancelUrl |
string | No | URL to redirect if customer cancels |
AIS Requirements Structure
| Field | Type | Description |
|---|---|---|
accounts |
boolean | Require access to list bank accounts |
balances |
boolean | Require access to view account balances |
transactions |
boolean | Require access to view transaction history |
useVerifiedBankAccount |
boolean |
Require customer to use a previously verified bank account.
When true, customers must use a bank account they've already verified via AIS.
They cannot select a different bank during payment. This ensures they use accounts that have been
used for source of wealth verification. Merchants control this setting - set to false
to allow customers to use different bank accounts.
|
true for AIS requirements to take effect.
If all scopes are false, AIS requirements are ignored.
useVerifiedBankAccount flag is set by merchants at payment creation time.
Customers cannot override this restriction. If you want to allow customers flexibility to use different bank accounts,
set this flag to false or omit it entirely (defaults to false).
Examples
Payment Requiring Account Verification Only
For verifying bank account ownership without accessing balances or transactions. Common use cases include capturing a verified bank account for future refunds or payouts.
{
"amount": 150.00,
"reference": "ORDER-001",
"description": "Purchase with Refund Account Setup",
"customerId": "3kTp9j2mN5xR",
"returnUrl": "https://yoursite.com/payment/success",
"aisRequirements": {
"accounts": true,
"balances": false,
"transactions": false
}
}
Payment Requiring Balance Access
For affordability checks where you need to verify the customer's account balance:
{
"amount": 500.00,
"reference": "LOAN-2024-001",
"description": "Personal Loan Application",
"customerId": "3kTp9j2mN5xR",
"returnUrl": "https://yoursite.com/payment/success",
"cancelUrl": "https://yoursite.com/payment/cancel",
"aisRequirements": {
"accounts": true,
"balances": true,
"transactions": false
}
}
Payment Requiring Transaction History
For source of wealth verification where you need to analyse spending patterns:
{
"amount": 10000.00,
"reference": "HIGH-VALUE-001",
"description": "High Value Purchase",
"customerId": "3kTp9j2mN5xR",
"returnUrl": "https://yoursite.com/payment/success",
"aisRequirements": {
"accounts": true,
"balances": true,
"transactions": true
}
}
Payment Requiring Verified Bank Account
For payments where you need to ensure the customer uses a bank account they've previously verified. This prevents customers from switching to a different bank during payment and ensures they use accounts that have been used for source of wealth verification or compliance checks.
{
"amount": 5000.00,
"reference": "VERIFIED-001",
"description": "High Value Purchase (Verified Bank Required)",
"customerId": "3kTp9j2mN5xR",
"returnUrl": "https://yoursite.com/payment/success",
"aisRequirements": {
"accounts": true,
"balances": true,
"transactions": true,
"useVerifiedBankAccount": true
}
}
How it works:
- If customer has one verified bank account โ Payment proceeds automatically with that bank (no bank selection shown)
- If customer has multiple verified banks โ Filtered bank selector shows only their verified banks
- If customer has no verified accounts โ They're redirected to complete AIS first, then payment proceeds with that bank
- Customer cannot bypass this restriction - it's enforced server-side
Response
{
"id": "encryptedPaymentId",
"payLink": "https://pay.trustist.com/pay?p=encryptedPaymentId"
}
.NET SDK Example
using Trustist.Ecommerce.ClientSdk;
using Trustist.Ecommerce.ClientSdk.Model;
// Create customer first
var customerRequest = new TrustistEcommerceCustomerCreateRequest
{
FirstName = "John",
LastName = "Doe",
EmailAddress = "[email protected]"
};
var customer = await _teClient.Customers.CreateAsync(customerRequest);
// Create payment with AIS requirements
var paymentRequest = new TrustistEcommercePaymentCreateRequest
{
Amount = 500.00m,
Reference = "LOAN-2024-001",
Description = "Personal Loan Application",
CustomerId = customer.Id,
ReturnUrl = "https://yoursite.com/payment/success",
CancelUrl = "https://yoursite.com/payment/cancel",
AisRequirements = new TrustistEcommerceAisRequirements
{
Accounts = true,
Balances = true,
Transactions = false,
UseVerifiedBankAccount = true // Require customer to use previously verified bank account
}
};
var payment = await _teClient.Payments.CreateAsync(paymentRequest);
// Redirect customer to payment.PayLink
// They will complete AIS if needed, then the payment
// If UseVerifiedBankAccount is true and they have existing verified accounts,
// they'll be restricted to using those banks only
Token Expiry
AIS tokens granted via Open Banking have a 90-day validity period. When a customer returns to make another payment:
- Valid token: Payment proceeds immediately (no AIS redirect)
- Expired token: Customer is prompted to re-authorize bank access
- No token: Customer completes full AIS flow
The system automatically checks token expiry using the tokenExpiry field stored against each bank account.
This ensures customers are only prompted for re-authorization when necessary.
Accessing Bank Data After Payment
Once the customer has completed AIS as part of the payment flow, you can access their bank account data using the Customer Bank Accounts API:
GET /v1/customers/{customerId}/bank-accounts- List all linked accountsGET /v1/customers/{customerId}/bank-accounts/{accountId}/balance- Get account balanceGET /v1/customers/{customerId}/bank-accounts/{accountId}/transactions- Get transaction history
Combining with Onboard Sessions
AIS requirements on payments are independent of onboard sessions. You can use either or both:
| Approach | Use Case |
|---|---|
| Onboard Session Only | Standalone KYC/AIS verification without immediate payment |
| Payment + AIS Only | Payment with bank verification, no identity checks |
| Both | Full KYC via onboard session, then payment with AIS verification |
- Payment AIS: If a customer has valid bank access that satisfies the payment's
aisRequirements, they won't be prompted for AIS again. The payment proceeds immediately using their existing access. - Onboard Session AIS: When you create an onboard session with
options.ais, the customer must complete AIS for that session, even if they already have accessible bank accounts. This ensures fresh authorization and allows for token refresh or additional account linking.
Error Handling
Common Errors
| Status | Error | Description |
|---|---|---|
| 400 | customer_required_for_ais |
customerId is required when aisRequirements is specified |
| 400 | invalid_customer_id |
The provided customerId is not valid |
| 404 | customer_not_found |
No customer exists with the provided ID |
Related Documentation
- Customer Management - Creating and managing customers
- Customer Bank Accounts (AIS) - Accessing bank account data
- Onboard Sessions - Identity verification and standalone AIS
- Payment Statuses - Understanding payment status values