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
Payment Status | Description | Payment Service |
---|---|---|
ACCC | Settlement on the creditor's account has been completed. | zahav |
ACSC | Settlement on the debtor’s account has been completed. Usage: this can be used by the first agent to report to the debtor that the transaction has been completed. Warning: this status is provided for transaction status reasons, not for financial information. It can only be used after bilateral agreement | fp, masav |
ACSP | All preceding checks such as technical validation and customer profile were successful and therefore the payment initiation has been accepted for execution. | fp, masav |
ACTC | Authentication and syntactical and semantical validation are successful | masav |
ACWC | Instruction is accepted but a change will be made, such as date or remittance not sent. | masav |
RCVD | Payment initiation has been received by the receiving agent. | all |
RJCT | Payment initiation or individual transaction included in the payment initiation has been rejected. | all |
CANC | Payment initiation has been cancelled before execution | all |
ACFC | Pre-ceeding check of technical validation and customer profile was successful and an automatic funds check was positive. | masav |
PATC | The payment initiation needs multiple authentications, where some but not yet all have been performed. Syntactical and semantical validations are successful. | all |
PART | A number of transactions have been accepted, whereas another number of transactions have not yet achieved 'accepted' status. | all |
PENDING | When the payment status is still RCVD after the payment has been finalized, the status will be pending. This might happen if the payment needs to be authorized by a banker or in need for spacial authorzation. | all |
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