LogoLogo
Document ValidationsPayment Methods
Latest
Latest
  • D24 APIs
  • Getting Started with D24
  • API Documentation
    • Deposits API
      • Technical and Security Aspects
        • Calculating the Signature
      • Endpoints
        • Deposit Creation Endpoint
          • Notifications
        • PCI Deposit Creation Endpoint
        • Deposit Status Endpoint
        • Payment Methods Endpoint
        • Currency Exchange Endpoint
        • Crypto Exchange Endpoint
        • Country States Codes Endpoint
        • Refund Creation Endpoint
          • Notifications
        • Refund Status Endpoint
      • Payment Methods
        • 🌎America
          • 🇦🇷Argentina
          • 🇧🇴Bolivia
          • 🇧🇷Brazil
          • 🇨🇱Chile
          • 🇨🇦Canada
          • 🇨🇴Colombia
          • 🇪🇨Ecuador
          • 🇬🇹Guatemala
          • 🇲🇽Mexico
          • 🇵🇾Paraguay
          • 🇵🇪Peru
        • 🌍Africa
          • 🇧🇼Botswana
          • 🇨🇲Cameroon
          • 🇨🇬Congo Brazzaville
          • 🇨🇩Congo DRC
          • 🇪🇬Egypt
          • 🇬🇦Gabon
          • 🇬🇭Ghana
          • 🇨🇮Ivory Coast
          • 🇰🇪Kenya
          • 🇳🇬Nigeria
          • 🇲🇼Malawi
          • 🇷🇼Rwanda
          • 🇿🇦South Africa
          • 🇺🇬Uganda
          • 🇿🇲Zambia
          • 🇹🇿Tanzania
        • 🌏Asia
          • 🇧🇩Bangladesh
          • 🇨🇳China
          • 🇭🇰Hong Kong
          • 🇮🇳India
          • 🇮🇩Indonesia
          • 🇯🇵Japan
          • 🇲🇾Malaysia
          • 🇵🇰Pakistan
          • 🇹🇭Thailand
          • 🇹🇷Turkey
          • 🇻🇳Vietnam
      • API Codes
    • Cashouts API
      • Technical and Security Aspects
        • Calculating the Payload-Signature
      • Endpoints
        • Cashout Creation Endpoint
          • Notifications
        • Cashout Status Endpoint
        • Cashout Update Status Endpoint
        • Cashout Cancellation Endpoint
        • Cashout Bank Codes
      • Countries Validations
        • American Countries
          • 🇧🇴Bolivia
          • 🇧🇷Brazil
          • 🇨🇦Canada
          • 🇨🇱Chile
          • 🇨🇴Colombia
          • 🇪🇨Ecuador
          • 🇲🇽Mexico
          • 🇵🇪Peru
          • 🇦🇷Argentina
          • 🇵🇾Paraguay
        • African Countries
          • 🇧🇼Botwsana
          • 🇨🇲Cameroon
          • 🇨🇬Congo Brazzaville
          • 🇨🇩Congo DRC
          • 🇪🇬Egypt
          • 🇬🇦Gabon
          • 🇬🇭Ghana
          • 🇰🇪Kenya
          • 🇲🇼Malawi
          • 🇳🇬Nigeria
          • 🇷🇼Rwanda
          • 🇿🇦SOUTH AFRICA
          • 🇿🇲Zambia
        • Asian Countries
          • 🇧🇩Bangladesh
          • 🇨🇳China
          • 🇮🇳India
          • 🇮🇩Indonesia
          • 🇯🇵Japan
          • 🇲🇾Malaysia
          • 🇹🇭Thailand
          • 🇹🇷Turkey
          • 🇵🇰Pakistan
          • 🇻🇳Vietnam
        • Oceania Countries
          • 🇦🇺Australia
      • API Codes
    • Subscriptions API
      • Technical and Security Aspects
        • Calculating the Signature
      • Subscription Creation Endpoints
        • OneShot Subscription Creation
        • PCI Subscription Creation Endpoint
        • Notifications
      • Subscription Cancellation Endpoint
      • Subscription Status Endpoint
    • Bank Accounts Validation API
      • Technical and Security Aspects
        • Calculating the Signature
      • Endpoints
        • Bank Account Validation Endpoint
        • Pix Key Validation Endpoint
      • API Codes
    • KYC API
      • Technical and Security Aspects
        • Calculating the Signature
      • KYC Endpoint
      • API Codes
    • Reconciliation API
      • Technical and Security Aspects
      • Endpoints
      • API Codes
    • Quickpay
      • Endpoints
        • Deposit creation endpoint
          • Notifications
        • Deposit Status Endpoint
    • Tools for Platforms
      • Technical and Security Aspects
        • Calculating the Signature
      • SubMerchant Creation
        • Notifications
      • SubMerchant Status Endpoint
      • Commission Update Endpoint
  • PLUGINS
    • Shopify
      • Installation
      • Onboarding
      • Customer flow
      • Admin Flow
      • Tutorials
      • FAQ
    • WooCommerce
      • Installation
      • Configuration
  • Deposits Tools
    • Cards SDK
      • With User Interface
        • 🚀Color Customization
      • Without User Interface
    • Java SDK
    • PHP SDK
  • Knowledge Base
    • Countries Specifications
    • Deposits with Cards SDK
      • With User Interface
      • Without User Interface
    • Deposits with 3DS Authentication
    • Deposits with Installments
  • v1 Developers Guide
  • Status Page
Powered by GitBook
On this page
  • Required fields
  • Bank Account Validations
  • CCI validation algorithm
  • Account Types
  • Document Validations
  • Example Request
  • Bank Codes

Was this helpful?

  1. API Documentation
  2. Cashouts API
  3. Countries Validations
  4. American Countries

Peru

Check the requirements and validations made over the cashouts on Peru

Required fields

Field

Format

Description

login

String

Cashouts login

pass

String

Cashouts pass

external_id

String (max length: 100)

Transaction's ID on your end

document_id

Beneficiary's document ID

document_type

Beneficiary's document type

country

PE

currency

PEN / USD

amount

Number with up to 2 decimals

Cashout amount

bank_account

Beneficiary's bank account

account_type

Beneficiary's bank account type

beneficiary_name

String (max length: 100)

Beneficiary's name

beneficiary_lastname

String (max length: 100)

Beneficiary's last name

Bank Account Validations

Bank name

Bank code

Description

Format

Example

All

-

CCI - Código de Cuenta Interbancaria

Length 20 (with verifying digits - a validation algorithm is ran over these)

00219300153895206813

CCI validation algorithm

Since the first three digits of the CCI are the bank code, it is not mandatory to send the bank_code field. However, we validate those 3 first digits to be a valid bank_code.

Peru CCI validation algorithm in Java
public final class Validations {
   static Integer CCI_LENGTH_ST = 18;
   static Integer CCI_LENGTH_FST = 20;
   static String EMPTY_CHECK_DIGITS = "00";
    
   public static boolean validateBankAccount(String bankAccount) {
      if (!ValidationsUtils.validateOnlyNumbers(bankAccount)) {
         return false;
      } else {
         int accountLength = bankAccount.length();
         String lastDigits = bankAccount.substring(bankAccount.length() - 2);

         if (accountLength == CCI_LENGTH_ST && lastDigits.equals(EMPTY_CHECK_DIGITS)) {
            return true;
         }
         return validateCCI(bankAccount);
      }
   }

   //Validate CCI bank account
   public static boolean validateCCI(String cci) {
      if (validateCCILength(cci)) {
         String cciWithoutCheck = cci.substring(0, cci.length() - 2);
         String checkDigits = cci.substring(cci.length() - 2);
         String calculatedCheckDigits = getCciCheckDigits(cciWithoutCheck);

         return checkDigits.equals(calculatedCheckDigits);
      }
      return false;
   }

   public static boolean validateCCILength(String cci) {
      return cci.length() == CCI_LENGTH_FST;
   }

   public static String getCciCheckDigits(String cci) {
      int firstControlNumber = calculateCheckDigit(cci.substring(0, 6));
      int secondControlNumber = calculateCheckDigit(cci.substring(6, 18));

      return String.valueOf(firstControlNumber) + String.valueOf(secondControlNumber);
   }

   private static int calculateCheckDigit(String cci) {
      int total = 0;
      int factor = 1;

      for (int i = 0; i < cci.length(); i++) {
         String[] cciArray = cci.split("");
         int num = Integer.parseInt(cciArray[i]);

         if (num * factor < 10) {
            total += (num * factor);
         } else {
            int product = (num * factor);
            String product_str = Integer.toString(product);
            int firstDigit = Integer.parseInt(product_str.substring(0, 1));
            int lastDigit = product % 10;
            total += firstDigit + lastDigit;
         }

         factor = factor == 1 ? 2 : 1;
      }
      return (total % 10) > 0 ? 10 - (total % 10) : 0;
   }

}

Account Types

The account_type is specified with only one character as described below.

account_type

Description

C

Checkings account

S

Savings account

Document Validations

Example Request

{
    "login": "xxxxxxx",
    "pass": "xxxxxxx",
    "external_id": "30000000001",
    "country": "PE",
    "currency": "PEN",
    "amount": 100,
    "document_id": "848392783",
    "document_type": "CE",
    "bank_account": "00219300153895206813",
    "account_type": "C",
    "beneficiary_name": "User",
    "beneficiary_lastname": "Test",
    "notification_url": "https://webhook.site/url",
    "type": "json"
}

Bank Codes

Bank

Code

Banco de Crédito del Peru

002

Interbank

003

Citibank

007

Scotiabank

009

BBVA Continental

011

Banco de la Nación

018

Banco de Comercio

023

Banco Financiero

035

Banco Interamericano de Finanzas (BIF)

038

Crediscotia Financiera

043

Mi Banco

049

Banco GNB Peru S.A

053

Banco Falabella

054

Santander

056

Caja Metropolitana de Lima

800

Caja Municipal de Ahorro y Credito Piura SAC

801

Caja Municipal de Ahorro y Crédito Trujillo

802

Caja Municipal de Ahorro y Crédito Arequipa

803

Caja Municipal de Ahorro y Crédito Sullana

805

Caja Municipal de Ahorro y Crédito Cuzco

806

Caja Municipal de Ahorro y Crédito Huancayo

808

PreviousMexicoNextArgentina

Last updated 11 months ago

Was this helpful?

See

See

See

See

See

See

to check document types and validations.

For the full and most up-to-date list of banks and its codes, please check the

🇵🇪
Cashout Bank Code endpoint.
validations below
account types
Click here
document validations
document validations
country codes
currency codes