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.
Java
Peru CCI validation algorithm in Java
1
public final class Validations {
2
static Integer CCI_LENGTH_ST = 18;
3
static Integer CCI_LENGTH_FST = 20;
4
static String EMPTY_CHECK_DIGITS = "00";
5
6
public static boolean validateBankAccount(String bankAccount) {
7
if (!ValidationsUtils.validateOnlyNumbers(bankAccount)) {
8
return false;
9
} else {
10
int accountLength = bankAccount.length();
11
String lastDigits = bankAccount.substring(bankAccount.length() - 2);
12
13
if (accountLength == CCI_LENGTH_ST && lastDigits.equals(EMPTY_CHECK_DIGITS)) {
14
return true;
15
}
16
return validateCCI(bankAccount);
17
}
18
}
19
20
//Validate CCI bank account
21
public static boolean validateCCI(String cci) {
22
if (validateCCILength(cci)) {
23
String cciWithoutCheck = cci.substring(0, cci.length() - 2);
24
String checkDigits = cci.substring(cci.length() - 2);
25
String calculatedCheckDigits = getCciCheckDigits(cciWithoutCheck);
26
27
return checkDigits.equals(calculatedCheckDigits);
28
}
29
return false;
30
}
31
32
public static boolean validateCCILength(String cci) {
33
return cci.length() == CCI_LENGTH_FST;
34
}
35
36
public static String getCciCheckDigits(String cci) {
37
int firstControlNumber = calculateCheckDigit(cci.substring(0, 6));
38
int secondControlNumber = calculateCheckDigit(cci.substring(6, 18));
39
40
return String.valueOf(firstControlNumber) + String.valueOf(secondControlNumber);
41
}
42
43
private static int calculateCheckDigit(String cci) {
44
int total = 0;
45
int factor = 1;
46
47
for (int i = 0; i < cci.length(); i++) {
48
String[] cciArray = cci.split("");
49
int num = Integer.parseInt(cciArray[i]);
50
51
if (num * factor < 10) {
52
total += (num * factor);
53
} else {
54
int product = (num * factor);
55
String product_str = Integer.toString(product);
56
int firstDigit = Integer.parseInt(product_str.substring(0, 1));
57
int lastDigit = product % 10;
58
total += firstDigit + lastDigit;
59
}
60
61
factor = factor == 1 ? 2 : 1;
62
}
63
return (total % 10) > 0 ? 10 - (total % 10) : 0;
64
}
65
66
}
67
68
Copied!

Account Types

The account_type is specified with only one character as described below.
account_type
Description
C
Checkings account
S
Savings account
M
Master account

Document Validations

Click here to check document types and validations.

Example Request

1
{
2
"login": "xxxxxxx",
3
"pass": "xxxxxxx",
4
"external_id": "30000000001",
5
"country": "PE",
6
"currency": "PEN",
7
"amount": 100,
8
"document_id": "848392783",
9
"document_type": "CE",
10
"bank_account": "00219300153895206813",
11
"account_type": "C",
12
"beneficiary_name": "User",
13
"beneficiary_lastname": "Test",
14
"notification_url": "https://webhook.site/url",
15
"type": "json"
16
}
Copied!

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
For the full and most up-to-date list of banks and its codes, please check the Cashout Bank Code endpoint.
Last modified 11mo ago