Examples

Multipayment with encrypted credit card

This API allows you to create payments for all orders in a Multiple Order.

{
  "installmentCount": 1,
  "fundingInstrument": {
    "method": "CREDIT_CARD",
    "creditCard": {
      "hash": "HhL0kbhfid+jwgj5l6Kt9EPdetDxQN8s7uKUHDYxDC/XoULjzik44rSda3EcWuOcL17Eb8JjWc1JI7gsuwg9P0rJv1mJQx+d3Dv1puQYz1iRjEWWhnB1bw0gTvnnC/05KbWN5M8oTiugmhVK02Rt2gpbcTtpS7VWyacfgesBJFavYYMljYg8p2YGHXkXrMuQiOCeemKLk420d0OTMBba27jDVVJ663HZDrObnjFXJH/4B5irkj+HO5genV+V4PYoLcOESG4nrI3oFAsMGsLLcdJo0NNvkEmJpn0e9GzureKKFYisYU+BEd9EMr/odS0VMvOYRV65HbPTspIkjl2+3Q==",
      "holder": {
        "fullname": "Jose Portador da Silva",
        "birthdate": "1988-12-30",
        "taxDocument": {
          "type": "CPF",
          "number": "33333333333"
        },
        "phone": {
          "countryCode": "55",
          "areaCode": "11",
          "number": "66778899"
        }
      }
    }
  }
}
#
# This example is based in our SDK developed in Ruby, available
# on: https://github.com/wirecardBrasil/moip-sdk-ruby
#
  
multi_pag = api.multipayment.create(multiorder.id,
    {
        installment_count: 1,
        funding_instrument: {
            method: "CREDIT_CARD",
            credit_card: {
                hash:
"i1naupwpTLrCSXDnigLLTlOgtm+xBWo6iX54V/hSyfBeFv3rvqa1VyQ8/pqWB2JRQX2GhzfGppXFPCmd/zcmMyDSpdnf1GxHQHmVemxu4AZeNxs+TUAbFWsqEWBa6s95N+O4CsErzemYZHDhsjEgJDe17EX9MqgbN3RFzRmZpJqRvqKXw9abze8hZfEuUJjC6ysnKOYkzDBEyQibvGJjCv3T/0Lz9zFruSrWBw+NxWXNZjXSY0KF8MKmW2Gx1XX1znt7K9bYNfhA/QO+oD+v42hxIeyzneeRcOJ/EXLEmWUsHDokevOkBeyeN4nfnET/BatcDmv8dpGXrTPEoxmmGQ==",
                holder: {
                  fullname: "Credit card holder name",
                    birthdate: "1988-10-10",
                    tax_document: {
                        type: "CPF",
                        number: "22222222222"
                    }
                }
            }
        }
    }
)
/**
* This example is based in our SDK developed in Java, available
* on: https://github.com/wirecardBrasil/moip-sdk-java
*/

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

Map<String, Object> phone = payloadFactory(
    value("countryCode", "55"),
    value("areaCode", "11"),
    value("number", "66778899")
);

Map<String, Object> holder = payloadFactory(
    value("fullname", "Portador Teste Moip"),
    value("birthdate", "1988-12-30"),
    value("taxDocument", taxDocument),
    value("phone", phone)
);

Map<String, Object> creditCard = payloadFactory(
    value("hash", "HhL0kbhfid+jwgj5l6Kt9EPdetDxQN8s7uKUHDYxDC/XoULjzik44rSda3EcWuOcL17Eb8JjWc1JI7gsuwg9P0rJv1mJQx+d3Dv1puQYz1iRjEWWhnB1bw0gTvnnC/05KbWN5M8oTiugmhVK02Rt2gpbcTtpS7VWyacfgesBJFavYYMljYg8p2YGHXkXrMuQiOCeemKLk420d0OTMBba27jDVVJ663HZDrObnjFXJH/4B5irkj+HO5genV+V4PYoLcOESG4nrI3oFAsMGsLLcdJo0NNvkEmJpn0e9GzureKKFYisYU+BEd9EMr/odS0VMvOYRV65HbPTspIkjl2+3Q=="),
    value("holder", holder)
);

Map<String, Object> fundingInstrument = payloadFactory(
    value("method", "CREDIT_CARD"),
    value("creditCard", creditCard)
);

Map<String, Object> multipayment = payloadFactory(
    value("installmentCount", 1),
    value("statementDescriptor", "minhaLoja.com"),
    value("fundingInstrument", fundingInstrument)
);

Map<String, Object> newMultipay = Moip.API.multiorders().pay(multipayment, "multiorder_id", setup);
<?php

/**
* This example is based in our SDK developed in PHP, available
* on: https://github.com/wirecardBrasil/moip-sdk-php
*/

try {
  $hash = 'i1naupwpTLrCSXDnigLLTlOgtm+xBWo6iX54V/hSyfBeFv3rvqa1VyQ8/pqWB2JRQX2GhzfGppXFPCmd/zcmMyDSpdnf1GxHQHmVemxu4AZeNxs+TUAbFWsqEWBa6s95N+O4CsErzemYZHDhsjEgJDe17EX9MqgbN3RFzRmZpJqRvqKXw9abze8hZfEuUJjC6ysnKOYkzDBEyQibvGJjCv3T/0Lz9zFruSrWBw+NxWXNZjXSY0KF8MKmW2Gx1XX1znt7K9bYNfhA/QO+oD+v42hxIeyzneeRcOJ/EXLEmWUsHDokevOkBeyeN4nfnET/BatcDmv8dpGXrTPEoxmmGQ==';
  $payment = $multiorder->multipayments()
    ->setCreditCardHash($hash, $customer)
      ->setInstallmentCount(3)
      ->setStatementDescriptor('teste de pag')
      ->setDelayCapture(false)
      ->execute();
} catch (Exception $e) {
  printf($e->__toString());
}
/**
* This example is based in our SDK developed in Node js, available
* on: https://github.com/wirecardBrasil/moip-sdk-node
*/

const moip = require('moip-sdk-node').default({
accessToken: 'your-access-token',
  production: false
})

moip.multipayment.create('MOR-DT554VQVBYCY', {
    installmentCount: 1,
    fundingInstrument: {
        method: 'CREDIT_CARD',
        creditCard: {        
            hash: 'gYPjYp+qCuRcBuNo4arqkWPrpsPpuUIuQSEBTuqQQYhhFUGX/k0ffDrppRMlH/DAo/Q7iPHiQggCGzqloziFlqG0C15JXFEeZiQtQ7mOlbIDuuipgKZfEYx9mCbwWunqWkviddoHmcZrf0CZA85/JVm7+Ppc+tIib4cErVKe3dYJCRTmWrVagcblpT8N8F5hZj6iWj4gdKNNIeOyNx4vQND3c1lSeK+emzR9ZP/x+FNBitzFkYA6OYv9rENmB1zCp1qsJi0peTsTPxxLFopN4I+Thwciii86r20+ZwLay+b++/QTaeZqCVmP68cIiQaORf6kknmd6rQtqIas/ghYVw==',
            holder: {
                fullname: 'Jose Portador da Silva',
                birthdate: '1988-12-30',
                taxDocument: {
                    type: 'CPF',
                    number: '33333333333'
                },
                phone: {
                    countryCode: '55',
                    areaCode: '11',
                    number: '25112511'
                }
            }
        }
    }
}).then((response) => {
    console.log(response.body)
}).catch((err) => {
    console.log(err)
})
var body = new MultiPaymentRequest
{
    InstallmentCount = 1,
    FundingInstrument = new Fundinginstrument
    {
        Method = "CREDIT_CARD",
        CreditCard = new Creditcard
        {
            Hash = "HhL0...pIkjl2+3Q==",
            Holder = new Holder
            {
                FullName = "",
                BirthDate = "1988-12-30",
                TaxDocument = new Taxdocument
                {
                    Type = "CPF",
                    Number = "33333333333"
                },
                Phone = new Phone
                {
                    CountryCode  = "55",
                    AreaCode = "11",
                    Number = "66778899"
                }
            }
        }
    }
};            
var result = await WC.MultiPayment.Create(body, "MOR-XXXXXXXXXXXX");

Multipayment by bank slip

This API allows you to automatically create payments for all orders in a Multiple Order.

{
  "fundingInstrument": {
    "method": "BOLETO",
    "boleto": {
      "expirationDate": "2020-09-30",
      "instructionLines": {
        "first": "Primeira linha se instrução",
        "second": "Segunda linha se instrução",
        "third": "Terceira linha se instrução"
      },
      "logoUri": "http://"
    }
  }
}
#
# This example is based in our SDK developed in Ruby, available
# on: https://github.com/wirecardBrasil/moip-sdk-ruby
#

multi_payment = api.multi_payment.create(
  "MOR-1231231231",
  fundingInstrument: {
    method: 'BOLETO',
    boleto: {
      expirationDate: '2020-12-30',
      instructionLines: {
        first: 'Primeira linha se instrução',
        second: 'Segunda linha se instrução',
        third: 'Terceira linha se instrução'
      },
      logoUri: 'http://'
    }
  }
)
/**
* This example is based in our SDK developed in Java, available
* on: https://github.com/wirecardBrasil/moip-sdk-java
*/

Map<String, Object> instructionLines = payloadFactory(
    value("first", "First instruction line!"),
    value("second", "Second instruction line!"),
    value("third", "Third instruction line!")
)

Map<String, Object> boleto = payloadFactory(
    value("expirationDate", "2020-06-20"),
    value("instructionLines", instructionLines),
    value("logoUri", "http://www.lojaexemplo.com.br/logo.jpg")
);

Map<String, Object> fundingInstrument = payloadFactory(
    value("method", "BOLETO");
    value("boleto", boleto);
);

Map<String, Object> multipayment = payloadFactory(
    value("installmentCount", 1),
    value("statementDescriptor", "minhaLoja.com"),
    value("fundingInstrument", fundingInstrument)
);

Map<String, Object> newMultipay = Moip.API.multiorders().pay(multipayment, "multiorder_id", setup);
<?php

/**
* This example is based in our SDK developed in PHP, available
* on: https://github.com/wirecardBrasil/moip-sdk-php
*/

$logo_uri = 'https://cdn.moip.com.br/wp-content/uploads/2016/05/02163352/logo-moip.png';
$expiration_date = "2020-09-30";
$instruction_lines = ["Primeira linha de instrução",
                      "Segunda linha de instrução",
                      "Terceira linha de instrução"];

$payment = $multiorder->multipayments()  
    ->setBoleto($expiration_date, $logo_uri, $instruction_lines)
  ->execute();
/**
* This example is based in our SDK developed in Node js, available
* on: https://github.com/wirecardBrasil/moip-sdk-node
*/

const moip = require('moip-sdk-node').default({
accessToken: 'your-access-token',
  production: false
})

moip.multipayment.create('MOR-DT554VQVBYCY', {
     installmentCount: 1,
    fundingInstrument: {
        method: "BOLETO",
        boleto: {
            expirationDate: "2020-09-30",
            instructionLines: {
                first: "Primeira linha do boleto",
                second: "Segunda linha do boleto",
                third: "Terceira linha do boleto"
            },
            logoUri: "https://sualoja.com.br/logo.jpg"
        }
    }
}).then((response) => {
    console.log(response.body)
}).catch((err) => {
    console.log(err)
})
var body = new MultiPaymentRequest
{
    InstallmentCount = 1,
    FundingInstrument = new Fundinginstrument
    {
        Method = "BOLETO",
        Boleto = new Boleto
        {
       ExpirationDate: '2020-12-30',
       InstructionLines = new InstructionLines
       {
        First = 'Primeira linha se instrução',
        Second = 'Segunda linha se instrução',
        Third =  'Terceira linha se instrução'
      },
      LogoUri =  'http://'
    }
  }
};            
var result = await WC.MultiPayment.Create(body, "MOR-XXXXXXXXXXXX");

Online debit multipayment

This API allows you to automatically create payments for all orders in a Multiple Order.

{
  "fundingInstrument": {
    "method": "ONLINE_BANK_DEBIT",
    "onlineBankDebit": {
      "bankNumber": "341",
      "expirationDate": "2020-12-30",
      "returnUri": "http://"
    }
  }
}
#
# This example is based in our SDK developed in Ruby, available
# on: https://github.com/wirecardBrasil/moip-sdk-ruby
#

multi_payment = api.multi_payment.create(
  "MOR-2SEQRXM27MV1",
  fundingInstrument: {
    method: 'ONLINE_BANK_DEBIT',
    onlineBankDebit: {
      bankNumber: '341',
      expirationDate: '2020-12-30',
      returnUri: 'http://'
    }
  }
)
/**
* This example is based in our SDK developed in Java, available
* on: https://github.com/wirecardBrasil/moip-sdk-java
*/

Map<String, Object> onlineBankDebit = payloadFactory(
    value("bankNumber", 341),
    value("expirationDate", "2020-11-22")
);

Map<String, Object> fundingInstrument = payloadFactory(
    value("method", "ONLINE_BANK_DEBIT"),
    value("onlineBankDebit", onlineBankDebit)
);

Map<String, Object> multipayment = payloadFactory(
    value("installmentCount", 1),
    value("statementDescriptor", "minhaLoja.com"),
    value("fundingInstrument", fundingInstrument)
);

Map<String, Object> newMultpay = Moip.API.multiorders().pay(multipayment, "multiorder_id", setup);
<?php

/**
* This example is based in our SDK developed in PHP, available
* on: https://github.com/wirecardBrasil/moip-sdk-php
*/

$payment = $order->payments()
    ->setOnlineBankDebit("341", "2020-12-30", "https://returnuri.com.br")
  ->setInstallmentCount(1)
  ->setStatementDescriptor("Teste")
  ->execute();
    
print_r($payment);
/**
* This example is based in our SDK developed in Node js, available
* on: https://github.com/wirecardBrasil/moip-sdk-node
*/

const moip = require('moip-sdk-node').default({
accessToken: 'your-access-token',
  production: false
})

moip.multipayment.create('MOR-DT554VQVBYCY', {
  fundingInstrument: {
    method: "ONLINE_BANK_DEBIT",
    onlineBankDebit: {
      bankNumber: "341",
      expirationDate: "2020-12-30",
      returnUri: "http://"
    }
  }
}
).then((response) => {
    console.log(response.body)
}).catch((err) => {
    console.log(err)
})
var body = new MultiPaymentRequest
{
    InstallmentCount = 1,
    FundingInstrument = new Fundinginstrument
    {
        Method = "ONLINE_BANK_DEBIT",
        Onlinebankdebit = new Onlinebankdebit
        {
            bankNumber = '341',
            expirationDate = '2020-12-30',
            returnUri = 'http://'
    }
  }
};            
var result = await WC.MultiPayment.Create(body, "MOR-XXXXXXXXXXXX");

Pre-authorized multipayment

To create a pre-authorized multipayment you must enter the attribute delayCapture: true.

{
  "installmentCount": 1,
  "delayCapture":true,
  "fundingInstrument": {
    "method": "CREDIT_CARD",
    "creditCard": {
      "hash": "HhL0kbhfid+jwgj5l6Kt9EPdetDxQN8s7uKUHDYxDC/XoULjzik44rSda3EcWuOcL17Eb8JjWc1JI7gsuwg9P0rJv1mJQx+d3Dv1puQYz1iRjEWWhnB1bw0gTvnnC/05KbWN5M8oTiugmhVK02Rt2gpbcTtpS7VWyacfgesBJFavYYMljYg8p2YGHXkXrMuQiOCeemKLk420d0OTMBba27jDVVJ663HZDrObnjFXJH/4B5irkj+HO5genV+V4PYoLcOESG4nrI3oFAsMGsLLcdJo0NNvkEmJpn0e9GzureKKFYisYU+BEd9EMr/odS0VMvOYRV65HbPTspIkjl2+3Q==",
      "holder": {
        "fullname": "Jose Portador da Silva",
        "birthdate": "1988-12-30",
        "taxDocument": {
          "type": "CPF",
          "number": "33333333333"
        },
        "phone": {
          "countryCode": "55",
          "areaCode": "11",
          "number": "66778899"
        }
      }
    }
  }
}
/**
* This example is based in our SDK developed in Java, available
* on: https://github.com/wirecardBrasil/moip-sdk-java
*/

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

Map<String, Object> phone = payloadFactory(
    value("countryCode", "55"),
    value("areaCode", "11"),
    value("number", "66778899")
);

Map<String, Object> holder = payloadFactory(
    value("fullname", "Portador Teste Moip"),
    value("birthdate", "1988-12-30"),
    value("taxDocument", taxDocument),
    value("phone", phone)
);

Map<String, Object> creditCard = payloadFactory(
    value("hash", "CREDIT_CARD_HASH"),
    value("holder", holder)
);

Map<String, Object> fundingInstrument = payloadFactory(
    value("method", "CREDIT_CARD"),
    value("creditCard", creditCard)
);

Map<String, Object> multipayment = payloadFactory(
    value("installmentCount", 1),
    value("statementDescriptor", "minhaLoja.com"),
    value("delayCapture", true),
    value("fundingInstrument", fundingInstrument)
);

Map<String, Object> newMultipay = Moip.API.multiorders().pay(multipayment, "multiorder_id", setup);
<?php

/**
* This example is based in our SDK developed in PHP, available
* on: https://github.com/wirecardBrasil/moip-sdk-php
*/

$hash = 'i1naupwpTLrCSXDnigLLTlOgtm+xBWo6iX54V/hSyfBeFv3rvqa1VyQ8/pqWB2JRQX2GhzfGppXFPCmd/zcmMyDSpdnf1GxHQHmVemxu4AZeNxs+TUAbFWsqEWBa6s95N+O4CsErzemYZHDhsjEgJDe17EX9MqgbN3RFzRmZpJqRvqKXw9abze8hZfEuUJjC6ysnKOYkzDBEyQibvGJjCv3T/0Lz9zFruSrWBw+NxWXNZjXSY0KF8MKmW2Gx1XX1znt7K9bYNfhA/QO+oD+v42hxIeyzneeRcOJ/EXLEmWUsHDokevOkBeyeN4nfnET/BatcDmv8dpGXrTPEoxmmGQ==';
$payment = $order->payments()
    ->setCreditCardHash($hash, $holder)
    ->setInstallmentCount(3)
    ->setStatementDescriptor('teste de pag')
        ->setDelayCapture(true)
    ->execute();
print_r($payment);
#
# This example is based in our SDK developed in Ruby, available
# on: https://github.com/wirecardBrasil/moip-sdk-ruby
#

multi_pag = api.multipayment.create(multiorder.id,
    {
        installment_count: 1,
       delayCapture: true,
        funding_instrument: {
            method: "CREDIT_CARD",
            credit_card: {
                hash:
"i1naupwpTLrCSXDnigLLTlOgtm+xBWo6iX54V/hSyfBeFv3rvqa1VyQ8/pqWB2JRQX2GhzfGppXFPCmd/zcmMyDSpdnf1GxHQHmVemxu4AZeNxs+TUAbFWsqEWBa6s95N+O4CsErzemYZHDhsjEgJDe17EX9MqgbN3RFzRmZpJqRvqKXw9abze8hZfEuUJjC6ysnKOYkzDBEyQibvGJjCv3T/0Lz9zFruSrWBw+NxWXNZjXSY0KF8MKmW2Gx1XX1znt7K9bYNfhA/QO+oD+v42hxIeyzneeRcOJ/EXLEmWUsHDokevOkBeyeN4nfnET/BatcDmv8dpGXrTPEoxmmGQ==",
                holder: {
                  fullname: "Credit card holder name",
                    birthdate: "1988-10-10",
                    tax_document: {
                        type: "CPF",
                        number: "22222222222"
                    }
                }
            }
        }
    }
)
/**
* This example is based in our SDK developed in Node js, available
* on: https://github.com/wirecardBrasil/moip-sdk-node
*/

const moip = require('moip-sdk-node').default({
accessToken: 'your-access-token',
  production: false
})

moip.multipayment.create('MOR-DT554VQVBYCY', {
    installmentCount: 1,
    delayCapture: true,
    fundingInstrument: {
        method: 'CREDIT_CARD',
        creditCard: {        
            hash: 'gYPjYp+qCuRcBuNo4arqkWPrpsPpuUIuQSEBTuqQQYhhFUGX/k0ffDrppRMlH/DAo/Q7iPHiQggCGzqloziFlqG0C15JXFEeZiQtQ7mOlbIDuuipgKZfEYx9mCbwWunqWkviddoHmcZrf0CZA85/JVm7+Ppc+tIib4cErVKe3dYJCRTmWrVagcblpT8N8F5hZj6iWj4gdKNNIeOyNx4vQND3c1lSeK+emzR9ZP/x+FNBitzFkYA6OYv9rENmB1zCp1qsJi0peTsTPxxLFopN4I+Thwciii86r20+ZwLay+b++/QTaeZqCVmP68cIiQaORf6kknmd6rQtqIas/ghYVw==',
            holder: {
                fullname: 'Jose Portador da Silva',
                birthdate: '1988-12-30',
                taxDocument: {
                    type: 'CPF',
                    number: '33333333333'
                },
                phone: {
                    countryCode: '55',
                    areaCode: '11',
                    number: '25112511'
                }
            }
        }
    }
}).then((response) => {
    console.log(response.body)
}).catch((err) => {
    console.log(err)
})
var body = new MultiPaymentRequest
{
    InstallmentCount = 1,
    DelayCapture = true,
    FundingInstrument = new Fundinginstrument
    {
        Method = "CREDIT_CARD",
        CreditCard = new Creditcard
        {
            Hash = "HhL0...pIkjl2+3Q==",
            Holder = new Holder
            {
                FullName = "",
                BirthDate = "1988-12-30",
                TaxDocument = new Taxdocument
                {
                    Type = "CPF",
                    Number = "33333333333"
                },
                Phone = new Phone
                {
                    CountryCode  = "55",
                    AreaCode = "11",
                    Number = "66778899"
                }
            }
        }
    }
};            
var result = await WC.MultiPayment.Create(body, "MOR-XXXXXXXXXXXX");

Multipayment with Escrow

The use of custody (Escrow), implies blocking and unblocking transactions through APIs.

{
  "installmentCount": 1,
  "escrow":{
    "description": "Custódia de pagamento"
  },
  "fundingInstrument": {
    "method": "CREDIT_CARD",
    "creditCard": {
        "hash": "HhL0kbhfid+jwgj5l6Kt9EPdetDxQN8s7uKUHDYxDC/XoULjzik44rSda3EcWuOcL17Eb8JjWc1JI7gsuwg9P0rJv1mJQx+d3Dv1puQYz1iRjEWWhnB1bw0gTvnnC/05KbWN5M8oTiugmhVK02Rt2gpbcTtpS7VWyacfgesBJFavYYMljYg8p2YGHXkXrMuQiOCeemKLk420d0OTMBba27jDVVJ663HZDrObnjFXJH/4B5irkj+HO5genV+V4PYoLcOESG4nrI3oFAsMGsLLcdJo0NNvkEmJpn0e9GzureKKFYisYU+BEd9EMr/odS0VMvOYRV65HbPTspIkjl2+3Q==",
      "store": true,
      "holder": {
        "fullname": "Jose da Silva",
        "birthdate": "1988-12-30",
        "taxDocument": {
          "type": "CPF",
          "number": "33333333333"
        },
        "phone": {
          "countryCode": "55",
          "areaCode": "11",
          "number": "66778899"
        }
      }
    }
  }
}
#
# This example is based in our SDK developed in Ruby, available
# on: https://github.com/wirecardBrasil/moip-sdk-ruby
#

multi_pay = api.multipayment.create(
  multiorder.id,
  installment_count: 1,
  statementDescriptor: 'mystore.com',
  escrow: {
    description: 'Custódia de pagamento'
  },
  fundingInstrument: {
    method: 'CREDIT_CARD',
    creditCard: {
      hash: 'HhL0kbhfid+jwgj5l6Kt9EPdetDxQN8s7uKUHDYxDC/XoULjzik44rSda3EcWuOcL17Eb8JjWc1JI7gsuwg9P0rJv1mJQx+d3Dv1puQYz1iRjEWWhnB1bw0gTvnnC/05KbWN5M8oTiugmhVK02Rt2gpbcTtpS7VWyacfgesBJFavYYMljYg8p2YGHXkXrMuQiOCeemKLk420d0OTMBba27jDVVJ663HZDrObnjFXJH/4B5irkj+HO5genV+V4PYoLcOESG4nrI3oFAsMGsLLcdJo0NNvkEmJpn0e9GzureKKFYisYU+BEd9EMr/odS0VMvOYRV65HbPTspIkjl2+3Q==',
      store: true,
      holder: {
        fullname: 'Jose da Silva',
        birthdate: '1988-12-30',
        taxDocument: {
          type: 'CPF',
          number: '33333333333'
        },
        phone: {
          countryCode: '55',
          areaCode: '11',
          number: '66778899'
        }
      }
    }
  }
)
/**
* This example is based in our SDK developed in Java, available
* on: https://github.com/wirecardBrasil/moip-sdk-java
*/

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

Map<String, Object> phone = payloadFactory(
    value("countryCode", "55"),
    value("areaCode", "11"),
    value("number", "66778899")
);

Map<String, Object> holder = payloadFactory(
    value("fullname", "Portador Teste Moip"),
    value("birthdate", "1988-12-30"),
    value("taxDocument", taxDocument),
    value("phone", phone)
);

Map<String, Object> creditCard = payloadFactory(
    value("hash", "CREDIT_CARD_HASH"),
    value("holder", holder)
);

Map<String, Object> fundingInstrument = payloadFactory(
    value("method", "CREDIT_CARD"),
    value("creditCard", creditCard)
);

Map<String, Object> escrowDescription = payloadFactory(
    value("description", "Escrow description")
);

Map<String, Object> escrow = payloadFactory(
    value("escrow", escrowDescription)
);

Map<String, Object> payment = payloadFactory(
    value("installmentCount", 1),
    value("escrow", escrow),
    value("statementDescriptor", "minhaLoja.com"),
    value("fundingInstrument", fundingInstrument)
);

Map<String, Object> newMultipay = Moip.API.multiorders().pay(multipayment, "multiorder_id", setup);
<?php

/**
* This example is based in our SDK developed in PHP, available
* on: https://github.com/wirecardBrasil/moip-sdk-php
*/

 $hash = 'i1naupwpTLrCSXDnigLLTlOgtm+xBWo6iX54V/hSyfBeFv3rvqa1VyQ8/pqWB2JRQX2GhzfGppXFPCmd/zcmMyDSpdnf1GxHQHmVemxu4AZeNxs+TUAbFWsqEWBa6s95N+O4CsErzemYZHDhsjEgJDe17EX9MqgbN3RFzRmZpJqRvqKXw9abze8hZfEuUJjC6ysnKOYkzDBEyQibvGJjCv3T/0Lz9zFruSrWBw+NxWXNZjXSY0KF8MKmW2Gx1XX1znt7K9bYNfhA/QO+oD+v42hxIeyzneeRcOJ/EXLEmWUsHDokevOkBeyeN4nfnET/BatcDmv8dpGXrTPEoxmmGQ==';
try {
  $payment = $multiorder->multipayments()
    ->setCreditCardHash($hash, $holder)
    ->setEscrow('Custódia de pagamento')
    ->execute();
} catch (Exception $e) {
  printf($e->__toString());
}
/**
* This example is based in our SDK developed in Node js, available
* on: https://github.com/wirecardBrasil/moip-sdk-node
*/

const moip = require('moip-sdk-node').default({
accessToken: 'your-access-token',
  production: false
})


moip.multipayment.create('MOR-ZNE4645ME5I3', {
    installmentCount: 1,
    escrow: {
        description: 'Teste escrow'
    },
    fundingInstrument: {
        method: 'CREDIT_CARD',
        creditCard: {
            hash: 'gYPjYp+qCuRcBuNo4arqkWPrpsPpuUIuQSEBTuqQQYhhFUGX/k0ffDrppRMlH/DAo/Q7iPHiQggCGzqloziFlqG0C15JXFEeZiQtQ7mOlbIDuuipgKZfEYx9mCbwWunqWkviddoHmcZrf0CZA85/JVm7+Ppc+tIib4cErVKe3dYJCRTmWrVagcblpT8N8F5hZj6iWj4gdKNNIeOyNx4vQND3c1lSeK+emzR9ZP/x+FNBitzFkYA6OYv9rENmB1zCp1qsJi0peTsTPxxLFopN4I+Thwciii86r20+ZwLay+b++/QTaeZqCVmP68cIiQaORf6kknmd6rQtqIas/ghYVw==',
            holder: {
                fullname: 'Jose Silva',
                birthdate: '1988-12-30',
                taxDocument: {
                    type: 'CPF',
                    number: '12345679891'
                },
                phone: {
                    countryCode: '55',
                    areaCode: '11',
                    number: '25112511'
                }
            }
        }
    } 
}).then((response) => {
    console.log(response.body)
}).catch((err) => {
    console.log(err)
})
var body = new MultiPaymentRequest
{
    InstallmentCount = 1,
    Escrow = new Escrow
    {
      Description = "my escrow"
    }
    FundingInstrument = new Fundinginstrument
    {
        Method = "CREDIT_CARD",
        CreditCard = new Creditcard
        {
            Hash = "HhL0...pIkjl2+3Q==",
            Holder = new Holder
            {
                FullName = "",
                BirthDate = "1988-12-30",
                TaxDocument = new Taxdocument
                {
                    Type = "CPF",
                    Number = "33333333333"
                },
                Phone = new Phone
                {
                    CountryCode  = "55",
                    AreaCode = "11",
                    Number = "66778899"
                }
            }
        }
    }
};            
var result = await WC.MultiPayment.Create(body, "MOR-XXXXXXXXXXXX");

❗️

ATTENTION

For security reasons, the escrow release can only be done using the Marketplace APP's accessToken as an authenticator.

What is Escrow?

Escrow is the temporary blocking of the launches of an Order.
The resource is used in Marketplace implementation.

🚧

IMPORTANT

A payment can remain in escrow for up to 180 days.
After this period, Wirecard will release the amount in custody automatically.

Escrow Statuses

Escrow, as well as order and payment, has its own status. This indicates whether the value of this escrow is pending HOLD_PENDING, blocked HELD or released RELEASED.

Below is a more detailed description of each of these statuses:

Status

Description

HOLD_PENDING

This status occurs when a payment is AUTHORIZEDand has a custody record. In this scenario, the payment amount is not yet blocked and remains in the future balance.

HELD

After the settlement of a transaction with custody in HOLD_PENDING status, this status is changed to HELD and the amount is no longer part of the future balance to be sent to the blocked balance.

RELEASED

This status occurs when payment has its value unlocked, regardless of whether it is settled or not. For escrow to be released, the marketplace must release the escrow via API. If the release is made before the settlement of the transaction, the amount of the transaction will remain in the future balance and will no longer be blocked on a settlement.