Payment Initialization Documentation
Payments initiation process detailed
Prerequisites
To use this service, you will need API keys from the Open Finance dashboard: https://dashboard.open-finance.ai.
Create Token
URL: https://api.open-finance.ai/oauth/token
Method: POST
Request Body
Key | Type | Description | Example | Required | Default |
---|---|---|---|---|---|
userId | string | Unique user identifier | [email protected] | true | |
clientId | string | Provided in dashboard | 1234 | true | |
clientSecret | string | Provided in dashboard | 1234 | true |
Headers
Key | Value |
---|---|
Content-Type | application/json |
Example Request
{
"userId": "[email protected]",
"clientId": "{{CLIENT_ID}}",
"clientSecret": "{{CLIENT_SECRET}}"
}
Example Response (Status 200)
{
"tokenType": "Bearer",
"expiresIn": 86400,
"accessToken": "iJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InQ4"
}
Error Responses
- 401 Unauthorized
{ "type": "CLIENT_ERROR", "message": "{\"error\":\"access_denied\",\"error_description\":\"Unauthorized\"}" }
- 400 Bad Request
{ "type": "CLIENT_ERROR", "message": "[\"\\\"clientSecret\\\" is required\"]" }
- 500 Internal Server Error
{ "type": "INTERNAL_ERROR", "message": "SERVER_ERROR" }
-
{ "type": "INTERNAL_ERROR", "message": "SERVER_ERROR" }
Open Banking Payment Initialization
URL: /pay/open-banking-init
Method: POST
Summary
Initiate a payment with a provider.
Security
oAuth2ClientCredentials
:create:payments
Request Body
Key | Type | Description | Example | Required | Default |
---|---|---|---|---|---|
psuId | string | National ID or passport number of the user | 123456789 | false | |
psuCorporateId | string | Business ID of a customer | 987654321 | false | |
redirectUrl | string | The URL to which the user will be redirected after the payment is completed` | https://www.example.com | false | |
includeFakeProviders | boolean | Use fake providers for testing | true | false | false |
providerId | string | Unique provider identifier | leumi | true | |
paymentId | string | ID of a previously created payment | 01HWQ9WMP7NA57YEQ7DQWZHQ5G | false | |
paymentService | string | Type of payment service | masav | true | |
paymentInformation | object | Payment details | See below | true | |
merchantId | string | A unique identifier for the merchant | 01HWQ9WMP7NA57YEQ7DQWZHQ5G | false |
Payment Information
Key | Type | Description | Example | Required | Default |
---|---|---|---|---|---|
amount | number | Payment amount | 100 | true | |
currency | string | ISO-4217 currency code | ILS | true | |
description | string | Payment description | Transfer for goods | true | |
creditorAccountType | string | Account type of the creditor | iban | true | |
creditorAccountNumber | string | Account number of the creditor | IL730200040000000552717 | true | |
debtorAccountType | string | Account type of the debtor | bban | false | |
debtorAccountNumber | string | Account number of the debtor | 10-944-50151142 | false | |
creditorName | string | Name of the creditor | John Doe | true |
Example Request
{
"providerId": "leumi",
"paymentService": "masav",
"paymentInformation": {
"amount": 100,
"currency": "ILS",
"description": "Test Payment",
"creditorAccountType": "iban",
"creditorAccountNumber": "IL730200040000000552717",
"creditorName": "John Doe"
}
}
Example Response (Status 201)
{
"paymentId": "01HWQ9WMP7NA57YEQ7DQWZHQ5G",
"status": "PENDING",
"scaOAuth": "https://auth.provider.com/oauth2/authorize"
}
Error Responses
- 400 Bad Request
- Missing payment info or invalid provider.
{ "type": "CLIENT_ERROR", "message": "Needs to provide paymentId or new payment info" }
- 401 Unauthorized
- Invalid or missing token.
{ "message": "Unauthorized" }
- 404 Not Found
- Payment or provider not found.
{ "type": "CLIENT_ERROR", "message": "Payment not found with this id" }
- 500 Internal Server Error
- Unexpected error.
{ "type": "INTERNAL_ERROR", "message": "An unexpected server error has occurred" }
Payment Statuses
The payment status indicates the payment transfers status.
Please see the following Payment Status Page
Get Payment
URL: https://api.open-finance.ai/v2/payments/{{PAYMENT_ID}}
Method: GET
Headers
Key | Value |
---|---|
Authorization | Token created previously |
Example Response (Status 200)
{
"id": "01HA4AEFZS6WQSE46G2NH2FRR1",
"userId": "[email protected]",
"providerId": "mizrahi-sandbox",
"status": "RCVD",
"amount": "2",
"currency": "ILS",
"description": "sdfsdf"
}
Using Sandbox for Payment Initiation
Overview
The sandbox environment allows you to simulate payment initiation with predefined account numbers and statuses. Use the following steps to initiate a payment in the sandbox and interpret the resulting statuses.
Steps
- Use one of the predefined account numbers below when initiating a payment.
- Depending on the account number used, the payment will finalize with the corresponding status.
- When creating the payment you need to mark it as
includeFakeProviders: true
Sandbox Account Numbers and Statuses
Account Number Iban | Account Number bban | Status Code |
---|---|---|
IL060311140000000436003 | 31-114-436003 | ACSC |
IL500311140000000436666 | 31-114-436666 | ACSP |
IL060311140000000436682 | 31-114-436682 | CANC |
IL380311140000000436688 | 31-114-436688 | ACFC |
IL060311140000000436488 | 31-114-436488 | PATC |
IL410311140000000436440 | 31-114-436440 | PART |
IL120311140000000436283 | 31-114-436283 | PENDING |
IL190311140000000436254 | 31-114-436254 | ACCC |
IL070311140000000435694 | 31-114-435694 | ACTC |
IL610311140000000435789 | 31-114-435789 | ERROR |
IL630310640000000406821 | 31-064-406821 | ACWC |
IL490311240000000272604 | 31-112-272604 | RJCT |
Example Request
{
"providerId": "leumi",
"paymentService": "masav",
"includeFakeProviders": true,
"paymentInformation": {
"amount": 100,
"currency": "ILS",
"description": "Test Sandbox Payment",
"creditorAccountType": "bban",
"creditorAccountNumber": "31-114-436003",
"creditorName": "John Doe"
}
}
Example Response (Status 201)
{
"paymentId": "01HWQ9WMP7NA57YEQ7DQWZHQ5G",
"status": "RCVD",
"scaOAuth": "https://url-to-provider.com"
}
Updated 11 days ago