Cashout Creation Endpoint
Learn how to generate cashouts request by using our Cashout API v3 directly from your website
post
https://api-stg.directa24.com
/v3/cashout
Cashout Request

Request Fields Description

Field
Format
Description
Validations
login
string (max length: 32)
Your Directa24 CASHOUTS API Key, found on the Merchant Panel by going to: Settings -> API Access. Notice there are specific Cashout credentials
pass
string (max length: 32)
Your Directa24 CASHOUTS API Passphrase, found on the Merchant Panel by going to: Settings -> API Access. Notice there are specific Cashout credentials
external_id
string (max length: 100)
Unique cashout ID on the merchant end
country
string (length: 2)
Country code for the cashout in ISO 3166-1 alpha-2 code format
amount
Big Decimal (up to 2 decimals)
Cashout amount on the currency specified
Valid number
currency
string (length: 3)
Currency code of the amount in ISO 4217 format
document_id
string (max length: 40)
Beneficiary’s personal identification number
document_type
string (maxLength: 15)
Beneficiary’s personal identification number type
beneficiary_name
string (max length: 100)
Beneficiary's name
String of up to 100 characters
beneficiary_lastname
string (max length: 100)
Beneficiary's last name
String of up to 100 characters
email
string (maxLength: 100)
Beneficiary's valid email address
phone
string (maxLength: 20)
Beneficiary's phone number
bank_code
Integer (max length: 6)
Beneficiary's bank code
bank_account
string (max length: 30)
Beneficiary's bank account number
bank_branch
string (max length: 15)
Beneficiary's bank branch number
account_type
string (max length: 1)
Type of account
address
string (max length: 255)
Beneficiary's address
String of up to 200 characters
city
string (max length: 100)
Beneficiary's city
String of up to 100 characters
postal_code
string (max length: 20)
Beneficiary's postal code

Fields required

Each country has different requirements and therefore we ask for different fields you need to send on the requests.
Go to the Countries Validations page to check each country requirements and validations.

Cashouts to debit cards

In Mexico, we accept cashouts sent directly to debit cards.
When that happens, you need to send the request through a different endpoint, otherwise your request will be declined with Invalid bank account, it shouldn't be a credit card.
PROD endpoint for Debit Cards: Email [email protected] with your cashout API Key
STG endpoint for Debit Cards: https://cc-api-stg.directa24.com/v3/cashout
The bank accounts in Mexico are in CLABE format (numeric) and have 18 digits (without dashes). Therefore one way to detect that a bank account specified by the customer is a debit card is by checking with the luhn algorithm if it is a valid card number and/or with a regex for each brand, like the example below.
1
public static final String SENSIBLE_DATA_PATTERN = new StringBuilder("(?:(?<visa>4[0-9]{12}(?:[0-9]{3})?)")
2
.append("|(?<mastercard>5[1-5][0-9]{14})")
3
.append("|(?<discover>6(?:011|5[0-9]{2})[0-9]{12})")
4
.append("|(?<amex>3[47][0-9]{13})")
5
.append("|(?<diners>3(?:0[0-5]|[68][0-9])?[0-9]{11})")
6
.append("|(?<jcb>(?:2131|1800|35[0-9]{3})[0-9]{11}))")
7
.toString();
8
9
private boolean validateCreditCard(CashoutRequestDto request) {
10
final String bankAccount = request.getBank_account();
11
if (StringUtils.isEmpty(bankAccount) || !LuhnCheckDigit.LUHN_CHECK_DIGIT.isValid(bankAccount) ||
12
bankAccount.matches(Constants.SENSIBLE_DATA_PATTERN)) {
13
return false;
14
}
15
return true;
16
}
Copied!
If true, send the request through the cc-api endpoint, if false send it through the normal endpoint. The integration and requirements remains exactly the same, only changing the error message returned in case of invalid bank account and that we validate the bank_account sent to be a valid credit card number using the Luhn Algorithm.
Sending a debit card number through the non-cc endpoint will make the request to fail with the following error:
1
{
2
"code": 300,
3
"message": "bank_account: Invalid bank account, it shouldn't be a credit card"
4
}
Copied!
Invalid bank_account error on the cc-api endpoint:
1
{
2
"code": 300,
3
"message": "bankAccount: invalid credit card number"
4
}
Copied!