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

KeyTypeDescriptionExampleRequiredDefault
userIdstringUnique user identifier[email protected]true
clientIdstringProvided in dashboard1234true
clientSecretstringProvided in dashboard1234true

Headers

KeyValue
Content-Typeapplication/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

KeyTypeDescriptionExampleRequiredDefault
psuIdstringNational ID or passport number of the user123456789false
psuCorporateIdstringBusiness ID of a customer987654321false
redirectUrlstringThe URL to which the user will be redirected after the payment is completed`https://www.example.comfalse
includeFakeProvidersbooleanUse fake providers for testingtruefalsefalse
providerIdstringUnique provider identifierleumitrue
paymentIdstringID of a previously created payment01HWQ9WMP7NA57YEQ7DQWZHQ5Gfalse
paymentServicestringType of payment servicemasavtrue
paymentInformationobjectPayment detailsSee belowtrue
merchantIdstringA unique identifier for the merchant01HWQ9WMP7NA57YEQ7DQWZHQ5Gfalse

Payment Information

KeyTypeDescriptionExampleRequiredDefault
amountnumberPayment amount100true
currencystringISO-4217 currency codeILStrue
descriptionstringPayment descriptionTransfer for goodstrue
creditorAccountTypestringAccount type of the creditoribantrue
creditorAccountNumberstringAccount number of the creditorIL730200040000000552717true
debtorAccountTypestringAccount type of the debtorbbanfalse
debtorAccountNumberstringAccount number of the debtor10-944-50151142false
creditorNamestringName of the creditorJohn Doetrue

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 StatusDescriptionPayment Service
ACCCSettlement on the creditor's account has been completed.zahav
ACSCSettlement 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 agreementfp, masav
ACSPAll preceding checks such as technical validation and customer profile were successful and therefore the payment initiation has been accepted for execution.fp, masav
ACTCAuthentication and syntactical and semantical validation are successfulmasav
ACWCInstruction is accepted but a change will be made, such as date or remittance not sent.masav
RCVDPayment initiation has been received by the receiving agent.all
RJCTPayment initiation or individual transaction included in the payment initiation has been rejected.all
CANCPayment initiation has been cancelled before executionall
ACFCPre-ceeding check of technical validation and customer profile was successful and an automatic funds check was positive.masav
PATCThe payment initiation needs multiple authentications, where some but not yet all have been performed. Syntactical and semantical validations are successful.all
PARTA number of transactions have been accepted, whereas another number of transactions have not yet achieved 'accepted' status.all
PENDINGWhen 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

KeyValue
AuthorizationToken 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

  1. Use one of the predefined account numbers below when initiating a payment.
  2. Depending on the account number used, the payment will finalize with the corresponding status.
  3. When creating the payment you need to mark it as includeFakeProviders: true

Sandbox Account Numbers and Statuses

Account Number IbanAccount Number bbanStatus Code
IL06031114000000043600331-114-436003ACSC
IL50031114000000043666631-114-436666ACSP
IL06031114000000043668231-114-436682CANC
IL38031114000000043668831-114-436688ACFC
IL06031114000000043648831-114-436488PATC
IL41031114000000043644031-114-436440PART
IL12031114000000043628331-114-436283PENDING
IL19031114000000043625431-114-436254ACCC
IL07031114000000043569431-114-435694ACTC
IL61031114000000043578931-114-435789ERROR
IL63031064000000040682131-064-406821ACWC
IL49031124000000027260431-112-272604RJCT

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"
}