Withdrawal

Allows to make withdrawals from a wallet to a bank account

Use case

Consider the client wishes to withdraw their money from the e-commerce to their personal bank account. For this, Vita Business provides the withdrawal service, which discounts money from the client's wallet and sends it to the bank account.

Keep in mind that the fields required by the endpoint to make a withdrawal to a country are now dynamic, you can see more information in the forms section.

Create Withdrawal Transaction

POST api.vitawallet.io/api/businesses/transactions

This method allows you to create a withdrawal type transaction from a wallet, the amount will be reflected negatively in the wallet's balance.

Request Body

NameTypeDescription

url_notify*

string

HTTPS url for IPN sending

beneficiary_document_type

string

Recipient document tyoe Note: visit the forms to get the available document types depending on the withdrawal country.

beneficiary_document_number

string

Recipient document number Chile You can send this field in one of these formats: 11.111.111-1 11.111.111-K 11111111K Othe countries Only numbers

account_type_bank

string

Bank account type Supported types: Other than Mexico CA Savings account CC Checking account CLABE only for Mexico

Note: visit the forms to get the bank account types depending on the withdrawal country.

account_bank

string

Bank account number, only NUMBERS, the digits count is verified according to the bank.

bank_code

string

Destination bank code.

Note: visit the forms to get the available bank codes depending on the withdrawal country.

beneficiary_email

string

Recipient email address

beneficiary_address

string

Recipient residence address

beneficiary_last_name

string

Recipient Last Name

beneficiary_first_name

string

Recipient First Name

purpose_comentary*

string

Transaction description

purpose*

string

Transaction purpose code

country*

string

Withdrawal country ISO code Supported countries: CL Chile CO Colombia MX Mexico VE Venezuela

currency*

string

[clp, usd]

order*

string

Unique payment order id

amount*

number

Transaction amount Min amount: 1000 CLP

transactions_type*

string

withdrawal

wallet*

string

Sender wallet UUID

city

string

Recipient city Note: visit the forms to get the available bank codes depending on the withdrawal country.

phone

string

Recipient phone number

Note: visit the forms to get the required fields depending on the withdrawal country.

{
    "transaction": {
        "id": "27",
        "type": "business_transaction",
        "attributes": {
            "recipient_wallet": null,
            "sender_wallet": {
                "token": "1234567890",
                "uuid": "5cb344ae-7479-4c96-b17c-f469b12a7e8b",
                "balances": {
                    "clp": 884500.0
                },
                "is_master": false,
                "created_at": "2020-01-15T20:37:17.926Z"
            },
            "status": "pending",
            "order": "12345678978945612s3181a014234",
            "currency": "clp",
            "category": "withdrawal",
            "amount": "15000.0",
            "total": "15000.0",
            "fee_value": "0.0",
            "total_fee": "0.0",
            "created_at": "2020-05-01T15:45:56.197Z"
        }
    }
}

Note:

For security issues, is not possible to create more than one transaction every 5 seconds. You must consider this validation for your integration.

Forms

Non required fields must be obtained from /withdrawal_rules method on the forms section, since can be changed anytime.

pageForms

SDK

To make a withdrawal, the wallets module receives the uuid of the wallet with which you want to withdraw the money using the withdrawal method.

import Business from 'vita-business-code';

try {
    // You must update prices,
    // remember prices must be updated every certain time,
    // depending on the valid_until value
    // so you can know the final amount on the recipient country
    
    await Business.wallets(uuid).updatePrices();
} catch {}

try {
    const response = await Business.wallets(uuid).withdrawal({
        url_notify: "https://example.com/notify",
        beneficiary_document_type: "CC",
        beneficiary_document_number: "1487498569",
        account_type_bank: "CA",
        account_bank: "874895988",
        bank_code: "000050",
        beneficiary_email: "example@example.com",
        beneficiary_address: "example address #33-37",
        beneficiary_last_name: "Toledo Parra",
        beneficiary_first_name: "Juan Victor",
        purpose_comentary: "send for friend",
        purpose: "EPTOUR",
        country: "CO",
        currency: "clp",
        order: "order",
        amount: 1000,
    });
} catch {}

Minimum withdraw amount

The minimum amount allowed for a withdrawal is 1000 CLP

Última actualización