Exemplos

#Transferência para Conta Bancária

{
    "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

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());
}
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);

#Transferência para Conta Bancária Cadastrada

{  
   "amount":"20000",
   "transferInstrument":{  
      "method":"BANK_ACCOUNT",
      "bankAccount":{  
         "id":"BKA-I268OYV8PBF"
      }
   }
}
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);

#Transferência para Conta Moip

{  
   "amount":"500",
   "transferInstrument":{  
      "method":"MOIP_ACCOUNT",
      "moipAccount":{  
         "id":"MPA-37FTGB1R5D7"
      }
   }
}
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);