v2.2-rc2 is not ratified and MUST NOT be used for production. Current: v2.1. Changelog
This is v2.2-rc2 — a release candidate for the v2.2 standards, published for review and not yet ratified. It MUST NOT be used as the basis for a production implementation. For the current standards, switch to v2.1 using the version selector. See the v2.1 → v2.2-rc2 changelog for every change in this version.
Bulk and Batch Payments — API Guide 7 min read
A Bulk/Batch Payment pays many creditors under a single consent — a payroll run, for example. The User authorizes the batch once, by its reason, the number of payments and their total. The TPP then sends every payment in one signed request, as a JSON array, and the API Hub checks the array against what the User authorized. Each payment carries its own Debtor Account, so the payments in one batch may be made from different accounts.
What you need before initiating a Bulk/Batch Payment
Before initiating a Bulk/Batch Payment, ensure the following requirements are met:
- Registered Application — the application must be created within the Trust Framework and assigned the BSIP role as defined in Roles.
- Valid Transport Certificate — an active transport certificate must be issued and registered in the Trust Framework to establish secure mTLS communication.
- Valid Signing Certificate — an active signing certificate must be issued and registered in the Trust Framework. This certificate is used to sign request objects, client assertions and the
POST /bulk-paymentsrequest. - Registration with the relevant API Hub (Authorisation Server) — the application must be registered with the API Hub (Server) of the LFI with which you intend to initiate payments.
- Understanding of the FAPI Security Profile and Tokens & Assertions — you should understand how request object signing, client authentication, and access token validation underpin secure API interactions.
- Understanding of Message Encryption — PII must be encrypted as a JWE: once for the consent, once for the batch's
Riskblock, and once for each payment in the batch. You will need the LFI's public encryption key from their JWKS.
End-to-end Bulk/Batch Payment
The consent and authorization steps are the same as for a Single Instant Payment. What differs is what the consent fixes, and how the payments are sent and tracked:
| Stage | Bulk/Batch Payment |
|---|---|
Consent (POST /par) | ConsentSchedule.BulkBatchPayment fixes the reason (Description), the number of payments (NumberOfTransactions) and their total, amount and currency (TotalValueOfPayments). The individual payments are not on the consent. |
| Authorization (at the LFI) | The User authenticates at the LFI and authorizes the batch. The LFI shows Description as the reason for the payment. |
Payment (POST /bulk-payments) | One signed request carries every payment in Data.Instructions, each with its own amount, purpose code, encrypted Debtor Account and creditor, and references, and the batch's Risk block once. The API Hub rejects the request unless the count matches NumberOfTransactions, every currency matches TotalValueOfPayments.Currency, and the amounts sum to TotalValueOfPayments.Amount. |
Outcome (GET /bulk-payments/{BulkPaymentId}) | The batch carries no status of its own. Each payment within it has its own PaymentId and status, reported on its element of Instructions and read as for a single payment. |
A TPP may still collect the payments as a file — a spreadsheet of salaries, for example. The TPP converts it to the Instructions array itself. Nothing is uploaded to the API Hub or the LFI.
Sign and encrypt the consent PII
/parconsent.PersonalIdentifiableInformation is required on every payment consent. For a Bulk/Batch Payment consent it is the Bulk/Batch Payment PII (AEBulkBatchPaymentPII), which carries only the Risk block. The Debtor Account and creditor of each payment are not held on the consent; they are sent with each payment in Step 9. Sign the object as a JWS and encrypt the JWS as a JWE using the LFI's public encryption key. The resulting compact JWE string is the encryptedConsentPII used in Step 2.
The Bulk and Batch Risk block
A Bulk/Batch Payment can debit more than one Debtor Account and pay many creditors, so its Risk block (AEBulkBatchPaymentRisk) describes only what holds for the whole submission: the User who submits it, and the batch itself. Nothing in it describes a single Debtor Account or creditor. The same block is sent on the consent and, once for the batch, on POST /bulk-payments (Step 9a). Populate every field that is known or derivable from your system. No field is required, and no additional properties are permitted.
| Field | Description |
|---|---|
UserIndicators.UserName | The name of the User submitting the batch (en and/or ar) |
UserIndicators.EmiratesId | The User's Emirates ID number |
UserIndicators.GeoLocation | Latitude and Longitude of the User's device, both required when the object is sent |
UserIndicators.Authentication | How the User authenticated at the TPP: AuthenticationChannel (App, Web), the PossessionFactor, KnowledgeFactor and InherenceFactor used, ChallengeOutcome (Pass, Fail, NotPerformed), AuthenticationFlow, AuthenticationValue and ChallengeDateTime |
UserIndicators.DeviceInformation | The device the batch is submitted from: DeviceId, DeviceOperatingSystem, DeviceOperatingSystemVersion, DeviceType |
UserIndicators.AccountRiskIndicators | The User's account with the TPP: UserOnboardingDateTime, LastAccountChangeDate, LastPasswordChangeDate, SuspiciousActivity |
BatchIndicators.Channel | Where the batch was submitted from: Web or Mobile |
BatchIndicators.BatchSource | How the TPP assembled the payments: ManualEntry, FileUpload, AccountingSystem (an accounting, payroll or ERP system connected to the TPP) or Other |
BatchIndicators.NumberOfNewCreditorAccounts | The number of distinct Creditor Accounts in the batch the User has not paid before through the TPP, from any Debtor Account. A creditor whose account has changed since the User last paid them counts as new |
SupplementaryData | Additional information that cannot be captured in the structured fields |
See Message Encryption for the JWS-inside-JWE pattern, fetching the LFI's JWKS and selecting the correct encryption key. The same helper is used again in Step 9, for the batch and for each payment.
Bind PKCE and authorization details into a signed JWT
With your authorization_details ready, generate a PKCE code pair then use the buildRequestJWT() helper, passing payments openid as the scope.
If your consent includes ReadAccountsBasic, ReadAccountsDetail, ReadBalances, or ReadPartyIdentity, you must change the scope to accounts payments openid. Without the accounts scope the issued token will not grant access to the account endpoints. You will also need the BDSP role. See Account Permissions in a Payment Consent.
import crypto from 'node:crypto'
import { generateCodeVerifier, deriveCodeChallenge } from './pkce'
import { buildRequestJWT } from './request-jwt'
const codeVerifier = generateCodeVerifier()
const codeChallenge = deriveCodeChallenge(codeVerifier)
// The batch the User is paying. NumberOfTransactions and TotalValueOfPayments
// are derived from it here, so they cannot drift from what POST /bulk-payments sends.
const payments = loadBatch() // [{ amount: '1500.00', debtorIban: 'AE07...', creditor: {...}, creditorReference: 'EMP-001' }, ...]
const totalFils = payments
.reduce((total, p) => total + Math.round(Number(p.amount) * 100), 0)
const authorizationDetails = [
{
type: 'urn:openfinanceuae:service-initiation-consent:v2.2',
consent: {
ConsentId: crypto.randomUUID(),
IsSingleAuthorization: true,
ExpirationDateTime: new Date(Date.now() + 60 * 60 * 1000).toISOString(), // 1 hour
ControlParameters: {
ConsentSchedule: {
BulkBatchPayment: {
Description: 'Payroll June 2026',
NumberOfTransactions: payments.length,
TotalValueOfPayments: {
Amount: (totalFils / 100).toFixed(2), // integer fils avoids float drift
Currency: 'AED', // every instruction must use this currency
},
},
},
},
PersonalIdentifiableInformation: encryptedConsentPII, // from Step 1
},
},
]
const requestJWT = await buildRequestJWT({
scope: 'payments openid',
codeChallenge,
authorizationDetails,
})
Save codeVerifier in your server-side session or an httpOnly cookie — you will need it in Step 8 to exchange the authorization code for tokens.
See Preparing the Request JWT for the full JWT claim reference and PKCE helpers.
Prove the application's identity to the API Hub
Use the signJWT() helper to build a client assertion proving your application's identity:
import crypto from 'node:crypto'
import { signJWT } from './sign-jwt'
const CLIENT_ID = process.env.CLIENT_ID!
const ISSUER = process.env.AUTHORIZATION_SERVER_ISSUER!
async function buildClientAssertion(): Promise<string> {
return signJWT({
iss: CLIENT_ID,
sub: CLIENT_ID,
aud: ISSUER,
jti: crypto.randomUUID(),
})
}
See Client Assertion for the full claims reference.
Push the request to the API Hub
Include x-fapi-interaction-id on the request — the API Hub echoes it in the response for end-to-end traceability. See Request Headers.
import crypto from 'node:crypto'
// PAR endpoint is read from .well-known/openid-configuration —
// not constructed from the issuer URL (it lives on a different host).
const PAR_ENDPOINT = discoveryDoc.pushed_authorization_request_endpoint
const parResponse = await fetch(PAR_ENDPOINT, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'x-fapi-interaction-id': crypto.randomUUID(),
},
body: new URLSearchParams({
request: requestJWT,
client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',
client_assertion: await buildClientAssertion(),
}),
// agent: new https.Agent({ cert: transportCert, key: transportKey }),
})
const { request_uri, expires_in } = await parResponse.json()
You must present your transport certificate on every connection to the API Hub and resource APIs. See Certificates.
| Field | Description | Example |
|---|---|---|
request_uri | Single-use reference to your pushed authorization request | urn:ietf:params:oauth:request-uri:bwc4JDpSd7 |
expires_in | Seconds until the request_uri expires — redirect the user before this window closes | 90 |
Validate state and issuer on the redirect
After the user approves, the bank redirects to your redirect_uri:
https://yourapp.com/callback?code=fbe03604-baf2-4220-b7dd-05b14de19e5c&state=d2fe5e2c-77cd-4788-b0ef-7cf0fc8a3e54&iss=https://auth1.altareq1.sandbox.apihub.openfinance.aeconst params = new URLSearchParams(window.location.search)
const code = params.get('code')!
const state = params.get('state')!
const iss = params.get('iss')!
if (state !== storedState) throw new Error('State mismatch — possible CSRF attack')
if (iss !== ISSUER) throw new Error(`Unexpected issuer: ${iss}`)
See Handling Authorization Callbacks for a full guide on state validation, issuer verification, and replay prevention.
Build the batch Risk PII and one instruction per payment
The PII of a Bulk/Batch Payment is split in two. The Risk block is carried once, for the whole batch, in Data.PersonalIdentifiableInformation (File Payment Risk PII Schema Object, AEFilePaymentRiskPIIProperties). The Debtor Account and creditor of each payment are carried in that payment's own PersonalIdentifiableInformation (File Payment PII Schema Object, AEFilePaymentPIIProperties), which has no Risk block.
| Instruction PII field | Required | Description |
|---|---|---|
Initiation.DebtorAccount | Yes | The account this payment is made from. SchemeName must be IBAN; Identification is required; Name may be omitted if not held by the TPP |
Initiation.CreditorAccount | Yes | The domestic Creditor Account of this payment |
Initiation.Creditor | No | The creditor's name and postal address |
Initiation.CreditorAgent | No | The Financial Institution that holds the Creditor Account |
Encrypt each instruction's PII separately, with the same JWS-inside-JWE helper used in Step 1. Each element of Instructions carries exactly one Debtor Account and one creditor, and the payments in a batch may be made from different accounts. Confirmation of Payee is not carried for a Bulk/Batch Payment.
// encryptPII is the same JWS-inside-JWE helper used in Step 1.
// 9a — the Risk block, once for the whole batch (File Payment Risk PII Schema Object)
const batchPII = await encryptPII(
{ Risk: buildRisk(payments) },
LFI_JWKS_URI, signingKey, SIGNING_KEY_ID,
)
// 9b — one PII token per payment (File Payment PII Schema Object):
// that payment's Debtor Account and creditor, and no Risk block
const instructions = await Promise.all(payments.map(async (p) => ({
Amount: { Amount: p.amount, Currency: 'AED' }, // must equal TotalValueOfPayments.Currency
PaymentPurposeCode: 'SAL', // set on each payment
PersonalIdentifiableInformation: await encryptPII(
{
Initiation: {
DebtorAccount: {
SchemeName: 'IBAN',
Identification: p.debtorIban, // payments may come from different accounts
},
Creditor: { Name: p.creditor.name },
CreditorAccount: {
SchemeName: 'IBAN',
Identification: p.creditor.iban,
Name: { en: p.creditor.accountName },
},
},
},
LFI_JWKS_URI, signingKey, SIGNING_KEY_ID,
),
DebtorReference: 'Payroll Jun26',
CreditorReference: p.creditorReference,
})))
See Creditor for the creditor field reference and validation rules, and the Bulk and Batch Risk block for the batch's Risk.
POST /bulk-payments — signed JWT submission
/bulk-payments The POST /bulk-payments body is sent as Content-Type: application/jwt — the payload is wrapped in a signed JWT (AEFilePaymentRequestSigned) using your private signing key, exactly as for POST /payments. Only ConsentId and PersonalIdentifiableInformation (the Risk block) are set once for the whole batch. Everything else, including the PaymentPurposeCode, is set on each payment, and a Bulk/Batch Payment carries no OpenFinanceBilling.
Include x-fapi-interaction-id and x-idempotency-key. If the customer is present, also send x-fapi-customer-ip-address, x-customer-user-agent and, if the customer has been authenticated, x-fapi-auth-date. See Request Headers. Generate a new x-idempotency-key for each batch and store it with the request before you send it. If you receive no response or an error, look the batch up by key with GET /bulk-payments before you retry, and retry only with the same key and the same body.
Data
| Field | Type | Description |
|---|---|---|
ConsentId* | string (uuid) | The authorized consent |
PersonalIdentifiableInformation | string (JWE) | The batch's Risk block, from Step 9a. It applies to every payment in Instructions |
Instructions* | array (1–500) | The payments in the batch, one element per payment. Described below. |
Data.Instructions[]
| Field | Type | Description |
|---|---|---|
Amount.Amount* | string | Payment amount, with exactly two decimal places |
Amount.Currency* | string | Must be AED, equal to TotalValueOfPayments.Currency on the consent |
PaymentPurposeCode* | string (3 chars) | AANI payment purpose code of this payment |
PersonalIdentifiableInformation* | string (JWE) | This payment's encrypted Debtor Account and creditor, from Step 9b |
DebtorReference | string | Reference shown on the debtor's statement for this payment |
CreditorReference | string | Reference passed to the creditor for this payment |
import { SignJWT } from 'jose'
const LFI_API_BASE = process.env.LFI_API_BASE_URL!
// Wrapped in `message` per AEFilePaymentRequestSigned
const bulkPaymentPayload = {
message: {
Data: {
ConsentId: consentId, // the authorized consent
PersonalIdentifiableInformation: batchPII, // from Step 9a — the batch's Risk block
Instructions: instructions, // from Step 9b — length MUST equal NumberOfTransactions
},
},
}
const signedBulkPayment = await new SignJWT(bulkPaymentPayload)
.setProtectedHeader({ alg: 'PS256', kid: SIGNING_KEY_ID, typ: 'JWT' })
.setIssuedAt()
.setIssuer(CLIENT_ID)
.setAudience(AUTHORIZATION_SERVER_ISSUER)
.setExpirationTime('5m')
.sign(signingKey)
const response = await fetch(`${LFI_API_BASE}/open-finance/payment/v2.2/bulk-payments`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${access_token}`,
'Content-Type': 'application/jwt',
'x-idempotency-key': idempotencyKey, // one key per batch; reuse it on every retry
'x-fapi-interaction-id': crypto.randomUUID(),
'x-fapi-auth-date': lastCustomerAuthDate,
'x-fapi-customer-ip-address': customerIpAddress,
},
body: signedBulkPayment,
// agent: new https.Agent({ cert: transportCert, key: transportKey }),
})
const { Data: { BulkPaymentId, Instructions } } = await response.json()
// Store BulkPaymentId for the batch, and each Instructions[i].PaymentId for its payment
The API Hub validates the request against the BulkBatchPayment control parameters of the authorized consent. The number of elements in Instructions MUST equal NumberOfTransactions, the Amount.Currency of every element MUST equal TotalValueOfPayments.Currency, and the sum of their Amount.Amount values MUST equal TotalValueOfPayments.Amount. A request that fails any of these checks is rejected. The LFI then decrypts the batch PII and the PII of each instruction.
A successful POST /bulk-payments
A 201 Created response is returned as a signed JWT (application/jwt). The verified JWT body is a message envelope wrapping Data and Links per AEFilePaymentIdResponseSigned.
Response body — Data
| Field | Required | Description |
|---|---|---|
BulkPaymentId | Yes | Identifier of the Bulk/Batch Payment as a whole — use it to read the status of its payments |
ConsentId | Yes | The consent this Bulk/Batch Payment is bound to |
CreationDateTime | Yes | ISO 8601 datetime when the resource was created |
Instructions | Yes | One element per payment, in the order of the request. Each carries its own PaymentId, Status, StatusUpdateDateTime, Amount and PaymentPurposeCode, and where available PaymentTransactionId, PaymentRail, RejectReasonCode, DebtorReference and CreditorReference |
{
"message": {
"Data": {
"BulkPaymentId": "4f1c2a9e-7b3d-4e8a-9c61-2d5f0b7a8e13",
"ConsentId": "b8f42378-10ac-46a1-8d20-4e020484216d",
"CreationDateTime": "2026-06-24T15:47:02+00:00",
"Instructions": [
{
"PaymentId": "83b47199-90c2-4c05-9ef1-aeae68b0fc7c",
"Status": "Pending",
"StatusUpdateDateTime": "2026-06-24T15:47:02+00:00",
"Amount": { "Amount": "1500.00", "Currency": "AED" },
"PaymentPurposeCode": "SAL",
"CreditorReference": "EMP-001"
},
{
"PaymentId": "1d2e9a40-5c7b-4f18-8e36-0b9a2c4d7e51",
"Status": "Pending",
"StatusUpdateDateTime": "2026-06-24T15:47:02+00:00",
"Amount": { "Amount": "1500.00", "Currency": "AED" },
"PaymentPurposeCode": "SAL",
"CreditorReference": "EMP-002"
},
{
"PaymentId": "a7c3f5e2-9b14-4d6a-b08e-3e5f1c2d9a74",
"Status": "Pending",
"StatusUpdateDateTime": "2026-06-24T15:47:02+00:00",
"Amount": { "Amount": "1250.00", "Currency": "AED" },
"PaymentPurposeCode": "SAL",
"CreditorReference": "EMP-003"
}
]
},
"Links": {
"Self": "https://api.lfi.example/open-finance/payment/v2.2/bulk-payments/4f1c2a9e-7b3d-4e8a-9c61-2d5f0b7a8e13"
}
}
}
See the POST /bulk-payments API reference for the full request and response schema.
Read the status of each payment
/bulk-payments/{BulkPaymentId} Read the Bulk/Batch Payment with GET /bulk-payments/{BulkPaymentId}. It takes a client-credentials access token (scope openid payments) rather than the consent's access token — see Tokens & Assertions.
The Bulk/Batch Payment carries no status of its own. Each element of Instructions carries the same status fields as a single payment on GET /payments/{PaymentId} — Pending through to AcceptedWithoutPosting, AcceptedCreditSettlementCompleted or Rejected — and the LFI updates them in the same way. Each payment settles over its own rail, reported in its PaymentRail. See Payment Rails and Status.
// GET /bulk-payments/{BulkPaymentId} takes a client-credentials token
// (scope openid payments), not the consent's access token.
const statusResponse = await fetch(
`${LFI_API_BASE}/open-finance/payment/v2.2/bulk-payments/${BulkPaymentId}`,
{
headers: {
'Authorization': `Bearer ${clientCredentialsToken}`,
'x-fapi-interaction-id': crypto.randomUUID(),
},
},
)
const { Data } = await statusResponse.json()
// The batch carries no status of its own. Data.Instructions has one element per
// payment, in request order — read each as you would a single payment.
for (const p of Data.Instructions) {
// p.PaymentId, p.Status ('Pending' | 'AcceptedSettlementCompleted' | ... | 'Rejected'),
// p.PaymentRail, p.RejectReasonCode
}
Check the status of an individual PaymentId
/bulk-payments/{BulkPaymentId}/payments/{PaymentId} Each payment in a Bulk/Batch Payment has its own PaymentId, returned on its element of Instructions in the 201 response to POST /bulk-payments. To check one payment without reading the whole batch, call GET /bulk-payments/{BulkPaymentId}/payments/{PaymentId}. It takes a client-credentials access token (scope openid payments), not the consent's access token.
Data is that payment's element of Instructions, exactly as GET /bulk-payments/{BulkPaymentId} returns it for every payment (AEFilePaymentInstructionResponse), with Links. Read Status and StatusUpdateDateTime, and where present PaymentRail, PaymentTransactionId and RejectReasonCode. A PaymentId that is not a payment within the Bulk/Batch Payment identified by BulkPaymentId returns 404. See Payment Rails and Status.
// One payment from the batch, by its BulkPaymentId and the PaymentId on its
// element of Instructions. Takes a client-credentials token (scope openid payments).
const paymentId = Instructions[0].PaymentId // from the POST /bulk-payments response
const paymentResponse = await fetch(
`${LFI_API_BASE}/open-finance/payment/v2.2/bulk-payments/${BulkPaymentId}/payments/${paymentId}`,
{
headers: {
'Authorization': `Bearer ${clientCredentialsToken}`,
'x-fapi-interaction-id': crypto.randomUUID(),
},
},
)
// Data is that payment's element of Instructions on GET /bulk-payments/{BulkPaymentId}.
// 404 if the PaymentId is not a payment within this Bulk/Batch Payment.
const { Data: { Status, StatusUpdateDateTime, PaymentRail, RejectReasonCode } } = await paymentResponse.json()
In the single-payment shape
The same PaymentId can also be read with GET /payments/{PaymentId}, exactly as for a single payment. It is returned in the single-payment shape (AEPaymentIdResponse), with these differences for a payment within a batch:
| Field | For a payment within a Bulk/Batch Payment |
|---|---|
ConsentId | The Bulk/Batch Payment's consent |
Instruction.Amount, PaymentPurposeCode, DebtorReference | Those of that payment |
OpenFinanceBilling | Absent — a Bulk/Batch Payment carries none |
Use GET /bulk-payments/{BulkPaymentId} (Step 11) to follow the whole batch, and GET /bulk-payments/{BulkPaymentId}/payments/{PaymentId} to follow a single payment within it — for example, one the User asks about, or one still at Pending.
