Forms

This is the way to know the fields needed to make a withdrawal to a certain country (keep in mind that these fields may change at any time)

Get Withdrawal Rules

GET api.vitawallet.io/api/businesses/withdrawal_rules

This method allows obtaining the form with the necessary fields to make a withdrawal to a certain country.

{
     "rules": {
         "cl": {
             "fields": [
                {
                    "type": "select",
                    "name": "Tipo de beneficiario",
                    "key": "beneficiary_type",
                    "options": [
                        {
                           "label": "Individual",
                           "value": "Individual"
                        },
                        {
                           "label": "Corporativo",
                           "value": "Corporate"
                        }
                    ]
                },
                {
                    "type": "text",
                    "name": "Nombres",
                    "key": "beneficiary_first_name",
                    "max": 50,
                    "when": {
                         "key": "beneficiary_type",
                         "value": "Individual"
                    }
                },
                {
                    "type": "text",
                    "name": "Apellidos",
                    "key": "beneficiary_last_name",
                    "max": 50,
                    "when": {
                         "key": "beneficiary_type",
                         "value": "Individual"
                    }
                },
                {
                    "type": "email",
                    "name": "Correo",
                    "key": "beneficiary_email",
                    "max": 50
                },
                {
                    "type": "text",
                    "name": "Número de cuenta",
                    "key": "account_bank",
                    "min": 5,
                    "max": 18
                },
             ],
             "name": "Chile",
             "currency_iso_code": "CLP",
             "currency_name": "Peso chileno",
             "flag_url": "https://api.vitawallet.io/mailers/flags/CL.png"
         }
     }
}

Description

A form is composed of some keys with its meaning

KeyDescription

type

Defines the type of field, allowed values are: text, select, email

name

Field name

key

Field key, musst be sent on the withdrawal request body

options

Field options if type is select, some of these options are subject to other fields values. On this example, "Banco Sofitasa" is available if transfer_type has the value "Pago movil" or "Transferencia bancaria"

{ "label": "Banco Sofitasa",
  "value": 32,
  "visible": {
    "key":"transfer_type",
    "value":["Pago movil","Transferencia bancaria"]
  }  
}

min

Minimum number of characters the field must contain

max

Maximum number of characters the field must contain

when

Field presence validation on the form { "key": "beneficiarytype", "value": "Individual" } This field is required only when the field "beneficiary_type" has the value "Individual"

Warning Keep in mind that the fields of a form can change, we recommend creating your application taking this in consideration

SDK

To know the withdrawal forms for a specific country, you can use the method getWithdrawalRules from rules provider.

import Business from 'vita-business-node';

try {
    await Business.rulesProvider.getWithdrawalRules();
} catch {}

Última actualización