Creating your first payment
Take a single payment from your customer's bank account, with the Open Finance screens or directly at the bank.
Take a single payment from your customer's bank account. Your backend creates the payment, the customer approves it at their bank, and Open Finance sends you the result in a webhook. All API calls below run on your backend; the customer only uses the browser.
Token → Create payment → Customer approves at the bank → Webhook → Confirm the status
At a glance
- What you'll do: create a payment, send the customer to approve it at their bank, then confirm the result.
- What you need: a token with
create:paymentsandread:payments, and webhooks turned on. - What you get back: a payment ID, a webhook when the status changes, and a final status such as
ACSCorRJCT.
Before you start
- Token. Follow Access Tokens to get a token for a stable
userId. Create and read the payment with that sameuserId. Your credentials needcreate:paymentsandread:payments. Keep yourclientSecretand tokens on your backend. - Webhooks. Turn on webhooks in the Dashboard, see Webhooks, or send
callbackInformation.webhookswith the payment. Webhooks are sent only when one of the two is enabled. - Sandbox. The examples use the
open-finance-sandboxbank withincludeFakeProviders: true. Sandbox banks must be enabled for your organization, see Testing with fake bank data.
The examples use API_BASE=https://api.open-finance.ai/v2 and ACCESS_TOKEN containing the user's token.
How the sandbox decides the result
The sandbox has no bank page. The debtor account (the customer's account) decides the result:
| Debtor account | BBAN | Result |
|---|---|---|
IL060311140000000436003 | 31-114-436003 | ACSC |
IL490311240000000272604 | 31-124-272604 | RJCT |
Testing with fake bank data lists an account for every other status.
Choose how to create the payment
| With Open Finance screens | Directly with init | |
|---|---|---|
| Use it when | You want Open Finance to ask the customer for their bank and account | You already know the customer's bank and ID number and want to send them straight to the bank |
| Endpoint | POST /v2/payments | POST /v2/pay/open-banking-init |
| You send | The amount, description and creditor. Optional: the banks to offer (providerIds), the customer's ID number and account | The bank (providerId), the customer's ID number (psuId), the amount, description and creditor. Optional: the customer's account |
| You get back | id and payUrl, a link to the Open Finance payment journey | paymentId, status and scaOAuth, the bank's approval link |
| First status | INIT | The bank's status, usually RCVD |
| The customer | Picks the bank, enters the account, approves at the bank | Approves at the bank |
| Link valid for | payUrl: 24 hours from creation | scaOAuth: a few minutes, and the time differs per bank |
Both create the same kind of payment, send the same payment webhook and end in the same statuses. Pick a tab to follow one of them. To compare every payment and mandate flow, see Open Finance screens or straight to the bank.
1. Get a token
curl --request POST "https://api.open-finance.ai/oauth/token" \
--header "Content-Type: application/json" \
--data "{\"userId\":\"customer-1001\",\"clientId\":\"$CLIENT_ID\",\"clientSecret\":\"$CLIENT_SECRET\"}"Save accessToken from the response as ACCESS_TOKEN. See the token endpoint for details.
2. Create the payment
curl --request POST "$API_BASE/payments" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"includeFakeProviders": true,
"providerIds": ["open-finance-sandbox"],
"redirectUrl": "https://your-app.example/payment-return",
"paymentInformation": {
"amount": 100,
"currency": "ILS",
"description": "Order 1001",
"creditorAccountType": "iban",
"creditorAccountNumber": "IL730200040000000552717",
"creditorName": "Example Store"
}
}'A successful response is HTTP 201 with id and payUrl. Save id as PAYMENT_ID. The payment is now INIT.
What each field does
| Field | Purpose |
|---|---|
includeFakeProviders | Shows sandbox banks. Remove it for real banks. |
providerIds | The banks the customer can choose from. With one bank, it is already selected for the customer. Leave it out to offer every bank. |
redirectUrl | Where the browser goes when the payment is done. Use an allowed domain if your organization restricts redirects. Without it, your organization's payment redirect URL is used; without either, the customer sees the Open Finance result screen. |
paymentInformation | The amount, currency, description and creditor (the account that receives the money). |
See Payment creation (Using open-finance UI) for every field.
3. Send the customer to payUrl
payUrlOpen payUrl in the customer's browser. The link is valid for 24 hours. The customer picks the bank, enters the account and ID number, and continues to the bank.

What your client sees after you open payUrl (sandbox data)
When the customer continues, Open Finance creates the payment at the bank and sends the customer there. That is the moment the customer goes to the bank: the status becomes the bank's status, usually RCVD, and you get a webhook.
In the sandbox, enter branch 114 and account 436003 with any ID number to get ACSC. To embed the journey in your app, see Connection/Payment Journey.
4. The customer comes back
After approving at the bank, the customer returns to Open Finance. Open Finance reads the result from the bank and redirects the browser to your redirectUrl:
https://your-app.example/payment-return?paymentId=01HWQ9WMP7NA57YEQ7DQWZHQ5G&paymentStatus=ACSC&userId=customer-1001
The redirect is not the confirmationThe customer can close the browser before the redirect, and anyone can edit a URL. Confirm the payment with the webhook and the API.
5. Confirm the final status
When the webhook arrives, or when the customer is back, read the payment:
curl "$API_BASE/payments/$PAYMENT_ID" \
--header "Authorization: Bearer $ACCESS_TOKEN"status | Meaning | What to do |
|---|---|---|
ACSC, ACCC, ACSP, ACTC, ACWC, ACFC | The bank accepted the payment | Final. Complete the order. |
RJCT | The customer or the bank refused it, or it expired | Final. Create a new payment to try again. |
PENDING, PATC | Waiting for a bank approval or more signers | Wait for the next webhook. |
ERROR | Something failed. See error | Not always final. Wait for the next webhook. |
INIT, RCVD | The customer has not finished | Wait. |
While the payment is not final, GET /v2/payments/{paymentId}/status asks the bank for its status right now. See Payment Statuses for every status and how it changes.
What happens, step by step
---
config:
sequence:
mirrorActors: false
actorMargin: 24
width: 110
---
sequenceDiagram
autonumber
participant YB as Your backend
participant OF as Open Finance
participant CB as Customer (browser)
participant BK as Bank
YB->>OF: POST /oauth/token
OF-->>YB: accessToken
YB->>OF: POST /v2/payments
OF-->>YB: 201 with id and payUrl
OF--)YB: Webhook INIT
YB->>CB: Open payUrl
CB->>OF: Pick the bank and account
OF->>BK: Create the payment
BK-->>OF: RCVD
OF--)YB: Webhook RCVD
OF->>CB: Redirect to the bank
CB->>BK: Log in and approve
BK->>CB: Back to Open Finance
CB->>OF: Return from the bank
OF->>BK: Read the status
BK-->>OF: For example ACSC
OF--)YB: Webhook ACSC
OF->>CB: To your redirectUrl
CB->>YB: paymentId, userId, paymentStatus
YB->>OF: GET /v2/payments/paymentId
OF-->>YB: status ACSC
opt Status is not final yet
OF->>BK: Hourly re-check
OF--)YB: Webhook with the new status
end
| Webhook | When it's sent | paymentStatus | What to do |
|---|---|---|---|
| 1 | Right after POST /payments | INIT | Save paymentId. Nothing to do yet. |
| 2 | The customer picked a bank and Open Finance created the payment there | RCVD | The customer is at the bank. Wait. |
| 3 | The customer is back from the bank, or a little earlier if Open Finance reads the result from the bank first | An accepted status, RJCT, PENDING, PATC or ERROR | Accepted or RJCT: read the payment and act. Otherwise wait. |
| 4 and later | About once an hour, while the payment is not final, when the bank reports a change | The new status | As for webhook 3. |
| Instead of 2 | The customer never picked a bank. About 24 hours after creation | RJCT | The payment expired. Create a new one if needed. |
The same status is never sent twice in a row. The webhook does not carry the payment details, so read the payment after each one. See Event Types.
Webhook timing in the sandbox
In the sandbox, webhook 2 is sent when the customer continues, and webhook 3 when the journey completes the payment.
1. Get a token
Get a token for the customer's userId as in the With Open Finance screens tab, and save it as ACCESS_TOKEN.
2. Create the payment at the bank
curl --request POST "$API_BASE/pay/open-banking-init" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"providerId": "open-finance-sandbox",
"includeFakeProviders": true,
"paymentService": "masav",
"redirectUrl": "https://your-app.example/payment-return",
"paymentInformation": {
"amount": 100,
"currency": "ILS",
"description": "Order 1002",
"debtorAccountType": "iban",
"debtorAccountNumber": "IL060311140000000436003",
"creditorAccountType": "iban",
"creditorAccountNumber": "IL730200040000000552717",
"creditorName": "Example Store"
}
}'A successful response is HTTP 201 with paymentId, status (RCVD in the sandbox) and scaOAuth. Save paymentId as PAYMENT_ID.
If the call fails, the response has status: "ERROR", and the paymentId when the payment was already saved. See Failure Details.
What each field does
| Field | Purpose |
|---|---|
providerId | The customer's bank. open-finance-sandbox for the sandbox. |
psuId | The customer's ID number. Required for a real bank; not needed in the sandbox. |
includeFakeProviders | Needed for sandbox banks. Remove it for real banks. |
paymentInformation.debtorAccountNumber | The customer's account. In the sandbox it decides the result; at a real bank it is optional. |
redirectUrl | Where the browser goes when the payment is done, as with the Open Finance screens. |
For every field, including foreign currency, see Payment Initialization.
3. Send the customer to scaOAuth
scaOAuthRedirect the customer's browser to scaOAuth right away. That is the moment the customer goes to the bank. The payment is already there with the bank's status, usually RCVD, and you got its webhook.
Redirect immediatelyThe bank link from init expires within minutes and the time differs per bank. If it expired, start a new payment.
The customer logs in to the bank and approves the payment. In the sandbox there is no bank page: the link goes straight back to Open Finance.
4. The customer comes back
Open Finance reads the result from the bank and redirects the browser to your redirectUrl with paymentId, paymentStatus and userId. As with the Open Finance screens, the redirect is not the confirmation.
5. Confirm the final status
Read GET /v2/payments/{paymentId} and act on status as in step 5 of the Open Finance screens tab.
What happens, step by step
---
config:
sequence:
mirrorActors: false
actorMargin: 24
width: 110
---
sequenceDiagram
autonumber
participant YB as Your backend
participant OF as Open Finance
participant CB as Customer (browser)
participant BK as Bank
YB->>OF: POST /oauth/token
OF-->>YB: accessToken
YB->>OF: POST /v2/pay/open-banking-init
OF->>BK: Create the payment
BK-->>OF: RCVD
OF-->>YB: 201: paymentId, RCVD, scaOAuth
OF--)YB: Webhook RCVD
YB->>CB: Send the customer to scaOAuth
CB->>BK: Log in and approve
BK->>CB: Back to Open Finance
CB->>OF: Return from the bank
OF->>BK: Read the status
BK-->>OF: For example ACSC
OF--)YB: Webhook ACSC
OF->>CB: To your redirectUrl
CB->>YB: paymentId, userId, paymentStatus
YB->>OF: GET /v2/payments/paymentId
OF-->>YB: status ACSC
opt Status is not final yet
OF->>BK: Hourly re-check
OF--)YB: Webhook with the new status
end
| Webhook | When it's sent | paymentStatus | What to do |
|---|---|---|---|
| 1 | Right after the bank created the payment, around the time open-banking-init answers | The bank's status, usually RCVD | Send the customer to scaOAuth if you have not yet. |
| 2 | The customer is back from the bank, or a little earlier if Open Finance reads the result from the bank first | An accepted status, RJCT, PENDING, PATC or ERROR | Accepted or RJCT: read the payment and act. Otherwise wait. |
| 3 and later | About once an hour, while the payment is not final, when the bank reports a change | The new status | As for webhook 2. |
There is no INIT webhook in this mode.
Webhook timing in the sandbox
In the sandbox, webhook 1 is sent right after the call, and webhook 2 when you open scaOAuth.
Create a payment from the Dashboard
You can also create a payment without writing code. In the Dashboard, open Payments and click Create New Payment. Choose a merchant, an amount and a description. The Dashboard creates the payment as in the With Open Finance screens tab, opens payUrl in a new tab, and shows the link so you can copy it.

Dashboard → Payments → Create New Payment (sample values)
- Future Payment adds a Payment Date, sent as
requestedExecutionDate. See Future-dated payment. - Standing Order creates a recurring payment. See Standing Orders.
Before using real banks
Confirm production access with Open Finance. Remove includeFakeProviders and the sandbox providerIds or providerId, and send the customer's psuId to open-banking-init.
Test refusal (RJCT), PENDING, PATC and ERROR as well as success. The sandbox has a debtor account for each.
Next steps
Updated about 3 hours ago
