Freedom Pay
  1. Settlement
Freedom Pay
  • Overview
  • Gateway API
    • Overview
    • Sync API
      • Overview
      • Purchase
        • Overview
        • Create payment
        • Any amount
        • Card
        • 3DSecure
        • Recurrent
        • Cancel
        • Clearing
        • Refund
        • Status
      • Payout
        • Overview
        • Card
        • IBAN
        • Balance
        • Status
      • Transfer
        • Overview
        • Card
        • 3DSecure
        • Rates
        • Status
      • Card
        • Overview
        • Add
        • 3DSecure
        • List
        • Remove
        • Status
      • Token
        • Overview
        • Token Pay
        • Apple Pay
        • Google Pay
        • Token Payout
        • Status
    • Async API
      • Overview
      • create
        • create payment
      • read
        • read payment
        • read request
      • edit
        • edit payment.refund
        • edit payment.reverse
        • edit payment.clearing
  • Merchant API
    • Overview
    • Purchase
      • Overview
      • Checkout
      • Card token
        • Overview
        • Tokenize card
        • Delete token
        • Card token list
        • Create payment (with CVC)
        • Confirm payment (with CVC)
        • Create payment
        • Confirm payment
      • Create payment
      • Any amount
      • Reccuring payment
      • Cancel payment
      • Clearing
      • Refund payment
      • Status
    • Payout
      • Overview
      • Card token
        • Tokenize card
        • Delete token
        • Card token list
        • Create payment
      • Create payment
      • IBAN
      • Balance status
      • Status by order_id
      • Status by Payment ID
      • Status
    • Mobile balance
      • Overview
      • Init
      • Pay
      • Approve
      • Resend code
      • Status
    • Invoice
      • Overview
      • Init
      • Info
      • Pay
      • Status
    • SDK
      • JS SDK
      • Google Pay
      • Freedom QR
        • Reader SDK (Android)
        • Provider SDK (Android)
      • Payment SDK
        • iOS
        • Android
      • Merchant SDK
        • Android
    • CMS
      • Overview
      • Get Merchant ID and key
      • WordPress
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
        • Update
      • Tilda
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • InSales
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • Ecwid
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • Bitrix
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • PrestaShop
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • OpenCart
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
    • Redirect back
      POST
    • Result notify
      POST
    • Payout notify
      POST
    • Check request
      POST
  • Card API
    • Overview
    • Client
      • Create client
      • Edit client
      • Update client
      • Verify client
      • Client info
    • Transactions
      • Create transaction
      • Clearing transaction
      • Refund transaction
      • Transaction info
      • Transaction status
    • Activate card
    • Block card
    • Balance
    • Bulk issue
    • Card info
    • Сards' list
    • Card tokenization
    • Cardholder validation
    • Close card
    • Issue card
    • Issue plastic card
    • Limits list
    • Operations' list
    • Reset PIN counter
    • Request' status
    • Secret data
    • Set limits
    • Set PIN
    • Statement extended
    • Unblock card
  • Partner API
    • Rates
      • Overview
      • Rates
    • Products
      • Overview
      • Dictionaries
      • Add client with product
      • Request status
      • Create terminal
    • E-Money
      • Overview
      • Add
      • Owner identification
      • Info
      • Close
      • Block
      • Balance
      • Statement
      • Request Status
    • Device ID
      • Android SDK
      • iOS SDK
    • Implement SuperApp
      • Overview
      • Pay
      • Refund
    • Account
      • Settlement
        • Overview
        • Create payment
          POST
        • Payment status
          GET
        • Batch statuses
          GET
    • Invoice
      GET
  1. Settlement

Overview

INFO

This document describes the required API changes in accordance with the ISO 20022 standard.
The request and response bodies are transmitted in JSON format, where the main ISO 20022 message in XML format is placed in the document_body field.
The type of the transmitted document is specified in the document_type field.


The following versions of ISO 20022 messages are supported:

  • pain.001.001.12 — CustomerCreditTransferInitiationV12 (payment initiation)
  • pain.002.001.14 — CustomerPaymentStatusReportV14 (payment status report)

Error Codes

CodeDescription
1001More than 500 payment instructions uploaded in a single request.
9403ISO 20022 document validation error (does not conform to XSD schema).
9999Internal server error related to document processing.

ISO 20022 Validation Error Codes:

Error CodeDescription
BE04MsgId is missing or exceeds 35 characters. Must be non-empty and unique.
BE04CreDtTm is missing or has an invalid format. Expected format: YYYY-MM-DDThh:mm:ssZ.
AM04NbOfTxs is missing, non-integer, or ≤ 0. Must be a positive integer.
AM04CtrlSum is missing, < 0, or has more than 2 decimal places.
BE04InitgPty/Nm is missing or contains invalid characters.
BE04PmtInfId is missing or exceeds 35 characters.
RC01PmtMtd value is missing or not equal to “TRF”.
AM04NbOfTxs is missing, non-integer, or ≤ 0.
AM04CtrlSum < 0 or has more than 2 decimal places.
BE04InstrPrty is missing or not valid.
BE04Invalid date format. Required ISO format: YYYY-MM-DD.
BE04Dbtr/Nm is missing or contains invalid characters.
AC01Invalid IBAN: length or format does not match the country standard (e.g., KZ...).
BE04EndToEndId is missing, not unique, or exceeds 35 characters.
AM04InstdAmt is missing, ≤ 0, or has more than 2 decimal places.
RC01BIC is missing or does not match the format (A–Z/0–9 only, length 8 or 11).
BE04Cdtr/Nm is missing or contains invalid characters.
AC01Recipient IBAN is invalid — length or checksum does not match format.
BE04Payment purpose is missing or contains invalid characters.
BE04KBE code is missing or does not match the directory.
BE04IIN/BIN is missing or not 12 digits long.

Statuses

Possible ISO 20022 settlement section statuses:

ISO CodeInternal StatusDescription
ACSCsuccessSuccessfully sent to the bank
ACSPprocessIn queue for processing
RJCTerrorSending error, possibly rejected by the bank
PDNGdownloadedUploaded but not yet processed

Restrictions

  • The maximum number of payment instructions in one ISO document is 500.
  • An unsupported document_type will result in a processing error.
  • An unsupported document_body will result in a processing error.

Request authorization

  • A JWS token generated using HS256 is used for authorization.

  • The token is transmitted in the request header: X-JWS-Signature: <generated_jws_token>

  • Signature algorithm: HS256 (HMAC SHA256)

  • Secret key: secret_key (Partner API key, issued by the manager)

  • Auth_id: represents the User ID of the merchant/partner in the system

Example of a JWS signature:

const crypto = require('crypto');

function base64url(v) {
    return v.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
}

function makeSignature({ rawBody, urlPath, method, secret, auth_id }) {
    const uri = "/" + urlPath.join(',');
    const header = {
        alg: "HS256",
        auth_id: auth_id,
        uri: uri,
        method: method,
        params: ""
    };

    const headerStr = JSON.stringify(header);
    const encodedHeader = base64url(Buffer.from(headerStr, 'utf8').toString('base64'));
    const encodedPayload = base64url(Buffer.from(rawBody, 'utf8').toString('base64'));
    const toSign = encodedHeader + "." + encodedPayload;
    const signature = crypto
        .createHmac("sha256", secret)
        .update(toSign)
        .digest("base64");

    return encodedHeader + ".." + base64url(signature);
};

Example usage

const requestObj = {
    "document_type": "iso20022",
    "document_body": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>..."
};

// Body должен быть строкой, не JSON-объектом
const rawBody = JSON.stringify(requestObj);

const token = makeSignature({
    rawBody: rawBody,
    urlPath: ['api', 'v5', 'partner', 'settlement-partitions'],
    method: "POST",
    secret: "your_partner_api_secret_key",
    auth_id: "user_id"
});

console.log("Generated JWS Token:", token);
Previous
Refund
Next
Create payment