Examples

Transfer to bank account

{
    "amount": "500",
    "transferInstrument": {
        "method": "BANK_ACCOUNT",
        "bankAccount": {
            "type": "CHECKING",
            "bankNumber": "001",
            "agencyNumber": "1111",
            "agencyCheckNumber": "2",
            "accountNumber": "9999",
            "accountCheckNumber": "8",
            "holder": {
                "fullname": "Nome do Portador",
                "taxDocument": {
                    "type": "CPF",
                    "number": "22222222222"
                }
            }
        }
    }
}
<?php

/**
* This example uses our PHP SDK, available
* at https://github.com/moip/moip-sdk-php
*/

try {
  $amount = 500;
  $bank_number = '001';
  $agency_number = '1111';
  $agency_check_number = '2';
  $account_number = '9999';
  $account_check_number = '8';
  $holder_name = 'Nome do Portador';
  $tax_document = '22222222222';
  $transfer = $moip->transfers()
    ->setTransfers($amount, $bank_number, $agency_number, $agency_check_number, $account_number, $account_check_number)
    ->setHolder($holder_name, $tax_document)
    ->execute();
} catch (Exception $e) {
  printf($e->__toString());
}
/**
* This example uses our Java SDK, available
* at https://github.com/moip/moip-sdk-java
*/

Map<String, Object> taxDocument = payloadFactory(
    value("type", "CPF"),
    value("number", "33333333333")
);

Map<String, Object> holder = payloadFactory(
    value("fullname", "Portador Teste Moip"),
    value("taxDocument", taxDocument)
);

Map<String, Object> bankAccount = payloadFactory(
    value("bankNumber", "237"),
    value("agencyNumber", "12345"),
    value("agencyCheckNumber", "8"),
    value("accountNumber", "12345678"),
    value("accountCheckNumber", "8"),
    value("type", "CHECKING"),
    value("holder", holder)
);

Map<String, Object> transferInstrument = payloadFactory(
    value("bankAccount", bankAccount),
    value("method", "BANK_ACCOUNT")
);

Map<String, Object> transferObject = payloadFactory(
    value("transferInstrument", transferInstrument),
    value("amount", "5000")
);

Map<String, Object> newTransfer = Moip.API.transfers().create(transferObject, setup);
#
# This example is based in our SDK developed in Ruby, available
# on: https://github.com/wirecardBrasil/moip-sdk-ruby
#

transfer = api.transfer.create(
  amount: 500,
  transferInstrument: {
    method: "BANK_ACCOUNT",
    bankAccount: {
      type: "CHECKING",
      bankNumber: "001",
      agencyNumber: "1111",
      agencyCheckNumber: "2",
      accountNumber: "9999",
      accountCheckNumber: "8",
      holder: {
        fullname: "Wirecard Devs",
        taxDocument: {
          type: "CPF",
          number: "22222222222"
        }
      }
    }
  }
)
/**
* This example is based in our SDK developed in Node js, available
* on: https://github.com/wirecardBrasil/moip-sdk-node
*/

moip.transfer.create({
    amount: 500,
    transferInstrument: {
        method: "BANK_ACCOUNT",
        bankAccount: {
            type: "CHECKING",
            bankNumber: 1,
            agencyNumber: 1111,
            agencyCheckNumber: 2,
            accountNumber: 9999,
            accountCheckNumber: 8,
            holder: {
                fullname: "Wirecard Devs",
                taxDocument: {
                    type: "CPF",
                    number: "22222222222"
                }
            }
        }
    }
}).then((response) => {
    console.log(response.body)
}).catch((response) => {
    console.log(response.body)
})
var body = new TransferRequest
{
    Amount = 500,
    TransferInstrument = new Transferinstrument
    {
        Method = "",
        BankAccount = new Bankaccount
        {
            Type = "CHECKING",
            BankNumber = "001",
            AgencyNumber = "1111",
            AgencyCheckNumber = "2",
            AccountNumber = "9999",
            AccountCheckNumber = "8",
            Holder = new Holder
            {
                FullName = "Wirecard Devs",
                TaxDocument = new Taxdocument
                {
                    Type = "CPF",
                    Number = "22222222222"
                }
            }
        }
    }
};
string accessToken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx_v2";
var result = await WC.Transfer.Create(body, accessToken);

Transfer to existing bank account

{  
   "amount":"20000",
   "transferInstrument":{  
      "method":"BANK_ACCOUNT",
      "bankAccount":{  
         "id":"BKA-I268OYV8PBF"
      }
   }
}
/**
* This example uses our Java SDK, available
* at https://github.com/moip/moip-sdk-java
*/

Map<String, Object> bankAccount = payloadFactory(
    value("id", "BKA-I268OYV8PBF")
);

Map<String, Object> transferInstrument = payloadFactory(
    value("bankAccount", bankAccount),
    value("method", "BANK_ACCOUNT")
);

Map<String, Object> transferObject = payloadFactory(
    value("transferInstrument", transferInstrument),
    value("amount", "5000")
);

Map<String, Object> newTransfer = Moip.API.transfers().create(transferObject, setup);
<?php

/**
* This example uses our PHP SDK, available
* at https://github.com/moip/moip-sdk-php
*/

$transfer = $moip->transfers()
    ->setTransfersToBankAccount($amount, $bank_account_id)
    ->execute();
#
# This example is based in our SDK developed in Ruby, available
# on: https://github.com/wirecardBrasil/moip-sdk-ruby
#

transfer = api.transfer.create(
  amount: 500,
  transferInstrument: {
    method: "BANK_ACCOUNT",
    bankAccount: {
      id: "BKA-JDHENFGTUJHD"
    }
  }
)
/**
* This example is based in our SDK developed in Node js, available
* on: https://github.com/wirecardBrasil/moip-sdk-node
*/

moip.transfer.create({
    amount: 500,
    transferInstrument: {
        method: "BANK_ACCOUNT",
        bankAccount: {
            id: "BKA-JDHENFGTUJHD"
        }
    }
}).then((response) => {
    console.log(response.body)
}).catch((response) => {
    console.log(response.body)
})
var body = new TransferRequest
{
    Amount = 500,
    TransferInstrument = new Transferinstrument
    {
        Method = "",
        BankAccount = new Bankaccount
        {
            Id = "BKA-JDHENFGTUJHD"
        }
    }
};

string accessToken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx_v2";
var result = await WC.Transfer.Create(body, accessToken);

Transfer to Wirecard account

{  
   "amount":"500",
   "transferInstrument":{  
      "method":"MOIP_ACCOUNT",
      "moipAccount":{  
         "id":"MPA-37FTGB1R5D7"
      }
   }
}
/**
* This example uses our Java SDK, available
* at https://github.com/moip/moip-sdk-java
*/

Map<String, Object> moipAccount = payloadFactory(
    value("id", "MPA-37FTGB1R5D7")
);

Map<String, Object> transferInstrument = payloadFactory(
    value("moipAccount", moipAccount),
    value("method", "MOIP_ACCOUNT")
);

Map<String, Object> transferObject = payloadFactory(
    value("transferInstrument", transferInstrument),
    value("amount", "5000")
);

Map<String, Object> newTransfer = Moip.API.transfers().create(transferObject, setup);
#
# This example is based in our SDK developed in Ruby, available
# on: https://github.com/wirecardBrasil/moip-sdk-ruby
#

transfer = api.transfer.create(
  amount: 500,
  transferInstrument: {
    method: "MOIP_ACCOUNT",
    moipAccount: {
      id: "MPA-37FTGB1R5D7"
    }
  }
)
/**
* This example is based in our SDK developed in Node js, available
* on: https://github.com/wirecardBrasil/moip-sdk-node
*/

moip.transfer.create({
    amount: 500,
    transferInstrument: {
        method: "MOIP_ACCOUNT",
        moipAccount: {
            id: "MPA-37FTGB1R5D7"
        }
    }
}).then((response) => {
    console.log(response.body)
}).catch((response) => {
    console.log(response.body)
})
var body = new TransferRequest
{
    Amount = 500,
    TransferInstrument = new Transferinstrument
    {
        Method = "",
        Moipaccount = new Moipaccount
        {
            id = "MPA-37FTGB1R5D7"
        }
    }
};

string accessToken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx_v2";
var result = await WC.Transfer.Create(body, accessToken);