Pay by Bank 每次點擊背後:六次 API 呼叫,以及一間由客戶選擇的銀行
Behind every Pay by Bank click: six API calls and a bank you didn't choose
英國 Open Banking 的 Pay by Bank 付款流程,每筆付款背後涉及約六次 API 呼叫;客戶選擇的銀行若服務不穩,結帳亦會受影響。2026 年 9 月,按流量加權的銀行 API 可用率為 99.79%,逐間銀行等權計算則為 99.49%;午夜至早上 6 時的等權可用率降至 98.96%。付款應以 webhook 或伺服器端狀態檢查確認,不應只憑客戶返回頁面判定款項已轉出。
When you add Pay by Bank to a checkout, you call one endpoint. Your provider gives you a link, the customer taps it, picks their bank, approves, and comes back. Done.
At the bank end, that one tap is about six API calls. And the bank isn't one you picked. Your customer picked it. If they bank with someone whose API has a rough night, that's your checkout having a rough night.
I run engineering at a payment initiation provider, so those six calls are what my team works on every day. Here's what they are, and what the latest public numbers say about the banks behind them.
The six calls
This is the UK Open Banking flow for a single domestic payment. Names are from v3.1 of the spec, which is what most banks still expose.
Before any of it, you register as a client with the bank (dynamic client registration, using your Open Banking certificates). Once per bank. Then again for the next bank. There are a lot of banks.
After that, per payment:
- Get a client-credentials token from the bank, over mutual TLS.
-
POST /domestic-payment-consentswith the amount, payee and reference. Signed, with an idempotency key. You get back aConsentIdinAwaitingAuthorisation. - Redirect the customer to their bank. They log in, do strong customer authentication, and approve.
- The bank redirects back with an auth code. Swap it for a token that's only good for that one consent.
-
POST /domestic-paymentswith theConsentId. This is the point where money actually goes out over Faster Payments. -
GET /domestic-payments/{id}until it saysAcceptedSettlementCompletedorRejected. It can sit inPendingorAcceptedSettlementInProcessfor a bit before that.
Step 2 on the wire looks roughly like this (fake account details, obviously):
POST /open-banking/v3.1/pisp/domestic-payment-consents
Authorization: Bearer <client-credentials token>
x-idempotency-key: 7f3c9a1e-ord-10492
x-jws-signature: <detached JWS over the body>
Content-Type: application/json
{
"Data": {
"Initiation": {
"InstructionIdentification": "ORD-10492",
"EndToEndIdentification": "ORD-10492",
"InstructedAmount": { "Amount": "42.50", "Currency": "GBP" },
"CreditorAccount": {
"SchemeName": "UK.OBIE.SortCodeAccountNumber",
"Identification": "04000412345678",
"Name": "Example Coffee Ltd"
},
"RemittanceInformation": { "Reference": "ORD-10492" }
}
},
"Risk": { "PaymentContextCode": "EcommerceGoods" }
}
Two signatures, an mTLS handshake, a redirect and two tokens. For a £42.50 order.
You also can't call any of this yourself unless you're FCA-authorised as a payment initiation provider. Most teams aren't and shouldn't want to be, which is the whole reason providers like us exist. With Atoa, the same payment from your server is:
// Server side only. The API key must never ship to a browser or app.
const res = await fetch('https://api.atoa.me/api/payments/process-payment', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.ATOA_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
customerId: 'cus_123',
orderId: 'ORD-10492',
amount: 42.5,
redirectUrl: 'https://shop.example.com/return',
}),
});
const { paymentRequestId, paymentUrl } = await res.json();
// send the customer to paymentUrl, keep paymentRequestId for the status check
So the six calls become our problem. Some of what goes on inside them still reaches you, though, and Open Banking Limited's monthly stats show where.
September 2026, by the numbers
| September 2026 | |
|---|---|
| Successful API calls | 2.92 billion |
| Payment initiation calls | 169 million |
| Account information calls | 2.30 billion |
| Availability, weighted by traffic | 99.79% |
| Availability, every bank counted equally | 99.49% |
| Midnight to 6am, every bank equally | 98.96% |
| Midnight to 6am, weighted by traffic | 99.86% |
| Average response time | 327 ms |
| Failed calls | 0.48% (0.41% business/4xx, 0.08% technical) |
For scale: UK open banking passed a billion payments in total this summer, and June alone was about 40 million. It's not a pilot any more.
The headline is fine. The rows underneath are more interesting.
The overnight rows
Weighted availability is 99.79%. The big banks carry most of the traffic, and they're solid.
Count every bank the same and it's 99.49%. Only look between midnight and 6am and it drops to 98.96%. But the traffic-weighted overnight number goes up, to 99.86%.
So the large banks are fine at 3am, and some of the smaller ones aren't. My guess is maintenance windows, but the stats don't say. In September, Coutts sat at 96.67% on most of its endpoints and Bank of Ireland UK at 97.33%.
If a good chunk of your customers bank with one of those, 99.79% is not your number.
The slow tail
327 ms is the average. AIB Group's VRP endpoint averaged 2.2 seconds that month, and HSBC's business statements endpoint 6.4 seconds.
A single 2-second timeout across every bank will kill requests that would have worked. If you're building direct, timeouts have to be per bank. If you're not, ask your provider how they handle it.
Most failures aren't outages
Business failures (4xx) outnumber technical failures roughly five to one. The bank is up and it's saying no: the consent expired, the auth code was already used, it didn't like the request.
Retrying a 4xx mostly gets you the same 4xx. Often the only real fix is a fresh consent, which means sending the customer back to their bank.
What I'd do with this
Don't build the bank side yourself unless you have a very good reason. Registration, certificate rotation, per-bank timeouts, per-bank quirks. Whether it's us, TrueLayer, Tink, Yapily or GoCardless, that's what you're paying a provider for.
Trust the payment status, not the redirect. The customer landing back on your return URL tells you their browser came back. It doesn't tell you the money moved. Fulfil on the webhook or a server-side status check. And give Pending its own screen, because it happens.
Be honest in the bank picker. Don't hide a bank because it's flaky, but if it isn't responding, say so. "Your bank isn't responding right now, try again in a few minutes" is better than a spinner.
Test the bad night before your customers find it. In sandbox, try a slow bank and an expired consent, and see what your checkout actually does.
Is it worth it?
Cards hide all of this. You integrate one network through one acquirer, and the scheme smooths over the differences between issuers. Open banking shows you every bank as it is.
In return you get payments at roughly half the cost of cards, settled in seconds, with no card number sitting in anyone's database. I think that's a good trade, obviously, or I'd be working on something else. Just go in having seen that table.
What's the strangest bank-specific behaviour you've run into? I want to know which ones other people have hit.
Sandbox and docs: docs.atoa.me
Stats are from Open Banking Limited's API performance page (September 2026) and their July release on the billion-payment milestone. I used an AI assistant to help draft this and checked every number against the source.
來源:DEV Community · dev.to