Periodic Payment Initialization


Initialize periodic payments (standing orders) directly with a specific bank, bypassing the Open Finance UI. Use this when you know which bank the user will authorize with.

When to Use This Method

Use Payment Initialization when:

  • You already know which bank the user will use
  • You're building a custom bank selection UI
  • You want to skip the Open Finance journey for a faster experience
  • You have the user's bank provider ID from a previous connection

For general payment flows where the bank is unknown, use Periodic Payment Creation instead.

Prerequisites

  • API credentials from the Open Finance dashboard
  • Valid clientId and clientSecret
  • Bank providerId for the user's bank

Step 1: Create Token

Create an access token to authenticate your API requests.

Endpoint: POST https://api.open-finance.ai/oauth/token

Request

{
  "userId": "your-user-id",
  "clientId": "your-client-id",
  "clientSecret": "your-client-secret"
}

Response

{
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expiresIn": 86400
}

Step 2: Initialize Periodic Payment

Initialize a periodic payment directly with the bank. Returns the bank's authorization URL.

Endpoint: POST https://api.open-finance.ai/v2/pay/open-banking-init

Security: Bearer token with create:payments scope

Request Example

{
  "providerId": "hapoalim",
  "psuId": "123456789",
  "redirectUrl": "https://yourapp.com/payment-complete",
  "periodicPaymentInformation": {
    "amount": 500,
    "currency": "ILS",
    "description": "Quarterly tax payment",
    "creditorAccountNumber": "IL620108000000099999999",
    "creditorAccountType": "iban",
    "creditorName": "Tax Authority",
    "debtorAccountNumber": "IL620108000000088888888",
    "debtorAccountType": "iban",
    "startDate": "2024-01-15",
    "endDate": "2024-12-15",
    "frequency": "Quarterly",
    "dayOfExecution": "15",
    "executionRule": "following"
  }
}

Request Parameters

KeyTypeDescriptionExampleRequired
providerIdstringBank provider identifier"hapoalim"Yes
psuIdstringPayment service user identifier (national ID)"123456789"Yes
redirectUrlstringURL to redirect after authorization"https://yourapp.com/callback"No
paymentIdstringExisting payment ID to resume"01HQ..."No
periodicPaymentInformationobjectPeriodic payment detailsSee belowYes

periodicPaymentInformation Object

KeyTypeDescriptionExampleRequired
amountnumberPayment amount per execution500Yes
currencystringISO 4217 currency code"ILS"Yes
descriptionstringPayment reference"Quarterly tax"Yes
startDatestringISO date when payments begin"2024-01-15"Yes
frequencystringPayment frequency"Quarterly"Yes
debtorAccountNumberstringSender account number"IL620108..."Yes
debtorAccountTypestringSender account type"iban" or "bban"Yes
creditorAccountNumberstringRecipient account number"IL620108..."Conditional
creditorAccountTypestringRecipient account type"iban" or "bban"Conditional
creditorNamestringRecipient name"Tax Authority"Conditional
endDatestringISO date when payments stop"2024-12-15"Conditional
executionRulestringHoliday handling"following" or "preceding"Conditional
dayOfExecutionstringDay of month for execution"1" to "31"No
monthsOfExecutionarraySpecific months for MonthlyVariable["3", "6", "9"]Conditional

Important: Unlike the Payment Creation endpoint, the Init endpoint requires debtorAccountNumber and debtorAccountType.

Supported Frequencies

FrequencyDescription
DailyEvery day
WeeklyOnce per week
EveryTwoWeeksEvery two weeks
MonthlyOnce per month
EveryTwoMonthsEvery two months
QuarterlyEvery three months
SemiAnnualEvery six months
AnnualOnce per year
MonthlyVariableSpecific months only (requires monthsOfExecution)

Response

{
  "paymentId": "01HQXYZ123456789ABCDEF",
  "status": "RCVD",
  "scaOAuth": "https://bank-provider.com/oauth/authorize?client_id=..."
}
KeyTypeDescription
paymentIdstringUnique payment identifier
statusstringInitial payment status
scaOAuthstringDirect URL to bank's authorization page

Step 3: Redirect User

Redirect the user directly to the scaOAuth URL. The user will:

  1. Authenticate with their bank
  2. Authorize the standing order
  3. Be redirected to your redirectUrl

Payment Flow

Your App                         Bank
   |                               |
   |-- POST /pay/open-banking-init |
   |   (with providerId)           |
   |                               |
   |<-- { paymentId, scaOAuth } ---|
   |                               |
   |-- Redirect to scaOAuth ------>|
   |                               |
   |   User authenticates & ------>|
   |   authorizes standing order   |
   |                               |
   |<-- Redirect to redirectUrl ---|
   |                               |

Provider-Specific Rules

Different banks have specific requirements:

Leumi

RuleDescription
endDateRequired - Must specify when payments end
executionRuleForbidden - Do not include this parameter

Hapoalim

RuleDescription
amountMust be greater than 9

Validation Rules

Date Validation

  • startDate must be today or a future date
  • endDate (if provided) must be after startDate

Frequency Rules

  • dayOfExecution must be between 1 and 31
  • monthsOfExecution is required only for MonthlyVariable frequency
  • monthsOfExecution values must be unique (1-12), maximum 11 months

Account Validation

  • Creditor and debtor accounts cannot be the same
  • Debtor account information is required for this endpoint

Error Responses

StatusErrorDescription
400startDate is required for periodic paymentsMissing start date
400frequency is required for periodic paymentsMissing frequency
400startDate must be today or in the futureStart date in the past
400endDate must be after startDateInvalid date range
400endDate is required for leumi providerLeumi requires end date
400executionRule is not allowed for leumi providerLeumi forbids execution rule
400amount must be greater than 9 for hapoalimHapoalim minimum amount
400Creditor and debtor accounts are the sameSame account error
401UnauthorizedInvalid or expired token
404Provider not foundInvalid provider ID

Examples

Quarterly Tax Payment (Hapoalim)

{
  "providerId": "hapoalim",
  "psuId": "987654321",
  "redirectUrl": "https://myapp.com/tax-complete",
  "periodicPaymentInformation": {
    "amount": 2500,
    "currency": "ILS",
    "description": "Quarterly VAT payment",
    "creditorAccountNumber": "IL620108000000055555555",
    "creditorAccountType": "iban",
    "creditorName": "Israel Tax Authority",
    "debtorAccountNumber": "IL620108000000066666666",
    "debtorAccountType": "iban",
    "startDate": "2024-01-15",
    "endDate": "2024-12-15",
    "frequency": "Quarterly",
    "dayOfExecution": "15",
    "executionRule": "following"
  }
}

Monthly Payment (Leumi)

{
  "providerId": "leumi",
  "psuId": "123456789",
  "redirectUrl": "https://myapp.com/payment-complete",
  "periodicPaymentInformation": {
    "amount": 1500,
    "currency": "ILS",
    "description": "Monthly service fee",
    "creditorAccountNumber": "IL620108000000011111111",
    "creditorAccountType": "iban",
    "creditorName": "Service Provider Ltd",
    "debtorAccountNumber": "IL620108000000022222222",
    "debtorAccountType": "iban",
    "startDate": "2024-02-01",
    "endDate": "2024-12-31",
    "frequency": "Monthly",
    "dayOfExecution": "1"
  }
}

Note: Leumi example does not include executionRule as it's forbidden for this provider.

Resume Existing Payment

If a payment was started but not completed, you can resume it:

{
  "providerId": "hapoalim",
  "psuId": "123456789",
  "paymentId": "01HQXYZ123456789ABCDEF",
  "redirectUrl": "https://myapp.com/payment-complete"
}

Get Payment Status

Check the status of a periodic payment.

Endpoint: GET https://api.open-finance.ai/v2/payments/{PAYMENT_ID}

Response

{
  "paymentId": "01HQXYZ123456789ABCDEF",
  "status": "ACCC",
  "paymentProduct": "periodic-payments"
}

For a complete list of payment statuses, see Payment Statuses.

Cancel Periodic Payment

Cancel an active standing order.

Endpoint: DELETE https://api.open-finance.ai/v2/payments/{PAYMENT_ID}

Note: Only authorized periodic payments can be cancelled.