Examples

Here you can see some API requests examples.

Create Multiorder for Wirecard Checkout

If you want to use our checkout to perform your payments, you will be able to do this through this requisition:

{
  "ownId": "meu_multiorder_id",
  "orders": [
    {
      "ownId": "pedido_1_id",
      "amount": {
        "currency": "BRL",
        "subtotals": {
          "shipping": 2000
        }
      },
      "items": [
        {
          "product": "Camisa Verde e Amarelo - Brasil",
          "quantity": 1,
          "detail": "Seleção Brasileira",
          "price": 2000
        }
      ],
      "customer": {
        "ownId": "customer[1234]",
        "fullname": "Joao Sousa",
        "email": "[email protected]",
        "birthDate": "1988-12-30",
        "taxDocument": {
          "type": "CPF",
          "number": "22222222222"
        },
        "phone": {
          "countryCode": "55",
          "areaCode": "11",
          "number": "66778899"
        },
        "shippingAddress": 
          {
            "street": "Avenida Faria Lima",
            "streetNumber": 2927,
            "complement": 8,
            "district": "Itaim",
            "city": "Sao Paulo",
            "state": "SP",
            "country": "BRA",
            "zipCode": "01234000"
          }
      },
      "receivers": [
        {
          "moipAccount": {
            "id": "MPA-VB5OGTVPCI52"
          },
          "type": "PRIMARY"
        }
      ]
    },
    {
      "ownId": "pedido_2_id",
      "amount": {
        "currency": "BRL",
        "subtotals": {
          "shipping": 3000
        }
      },
      "items": [
        {
          "product": "Camisa Preta - Alemanha",
          "quantity": 1,
          "detail": "Camiseta da Copa 2014",
          "price": 1000
        }
      ],
      "customer": {
        "ownId": "customer[1234]",
        "fullname": "Joao Sousa",
        "email": "[email protected]",
        "birthDate": "1988-12-30",
        "taxDocument": {
          "type": "CPF",
          "number": "22222222222"
        },
        "phone": {
          "countryCode": "55",
          "areaCode": "11",
          "number": "66778899"
        },
        "shippingAddress": 
          {
            "street": "Avenida Faria Lima",
            "streetNumber": 2927,
            "complement": 8,
            "district": "Itaim",
            "city": "Sao Paulo",
            "state": "SP",
            "country": "BRA",
            "zipCode": "01234000"
          }
      },
      "receivers": [
        {
          "moipAccount": {
            "id": "MPA-IFYRB1HBL73Z"
          },
          "type": "PRIMARY"
        },
        {
          "moipAccount": {
            "id": "MPA-KQB1QFWS6QNM"
          },
          "type": "SECONDARY",
          "feePayor": false,
          "amount": {
            "fixed": 55
          }
        }
      ]
    }
  ]
}
#
# This example is based in our SDK developed in Ruby, available
# on: https://github.com/wirecardBrasil/moip-sdk-ruby
#

multi = api.multi_order.create(
  ownId: "meu_multiorder_id",
  orders: [
    {
      ownId: "pedido_1_id",
      amount: {
        currency: "BRL",
        subtotals: {
          shipping: 2000,
        }
      },
      items: [
        {
          product: "Camisa Verde e Amarelo - Brasil",
          quantity: 1,
          detail: "Seleção Brasileira",
          price: 2000,
        }
      ],
      customer: {
        ownId: "customer[1234]",
        fullname: "Joao Sousa",
        email: "[email protected]",
        birthDate: "1988-12-30",
        taxDocument: {
          type: "CPF",
          number: "22222222222",
        },
        phone: {
          countryCode: "55",
          areaCode: "11",
          number: "66778899",
        },
        shippingAddress:
    {
      street: "Avenida Faria Lima",
      streetNumber: 2927,
      complement: 8,
      district: "Itaim",
      city: "Sao Paulo",
      state: "SP",
      country: "BRA",
      zipCode: "01234000",
    }
      },
      receivers: [
        {
          moipAccount: {
            id: "MPA-VB5OGTVPCI52",
          },
          type: "PRIMARY",
        }
      ]
    },
    {
      ownId: "pedido_2_id",
      amount: {
        currency: "BRL",
        subtotals: {
          shipping: 3000,
        }
      },
      items: [
        {
          product: "Camisa Preta - Alemanha",
          quantity: 1,
          detail: "Camiseta da Copa 2014",
          price: 1000,
        }
      ],
      customer: {
        ownId: "customer[1234]",
        fullname: "Joao Sousa",
        email: "[email protected]",
        birthDate: "1988-12-30",
        taxDocument: {
          type: "CPF",
          number: "22222222222",
        },
        phone: {
          countryCode: "55",
          areaCode: "11",
          number: "66778899",
        },
        shippingAddress:
    {
      street: "Avenida Faria Lima",
      streetNumber: 2927,
      complement: 8,
      district: "Itaim",
      city: "Sao Paulo",
      state: "SP",
      country: "BRA",
      zipCode: "01234000",
    }
      },
      receivers: [
        {
          moipAccount: {
            id: "MPA-IFYRB1HBL73Z",
          },
          type: "PRIMARY",
        },
        {
          moipAccount: {
            id: "MPA-KQB1QFWS6QNM",
          },
          type: "SECONDARY",
          feePayor: false,
          amount: {
            fixed: 55,
          }
        }
      ]
    }
  ]
)
/**
* This example is based in our SDK developed in Java, available
* on: https://github.com/wirecardBrasil/moip-sdk-java
*/

Map<String, Object> subtotals = payloadFactory(
    value("shipping", 15000)
);

Map<String, Object> amount = payloadFactory(
    value("currency", "BRL"),
    value("subtotals", subtotals)
);

Map<String, Object> product1 = payloadFactory(
    value("product", "Product 1 Description"),
    value("category", "TOYS_AND_GAMES"),
    value("quantity", 2),
    value("detail", "Anakin's Light Saber"),
    value("price", 100000000)
);

Map<String, Object> product2 = payloadFactory(
    value("product", "Product 2 Description"),
    value("category", "SCIENCE_AND_LABORATORY"),
    value("quantity", 5),
    value("detail", "Pym particles"),
    value("price", 2450000000)
);

List items = new ArrayList();
items.add(product1);
items.add(product2);

Map<String, Object> moipAccount1 = payloadFactory(
    value("id", "MPA-VB5OGTVPCI52")
);

Map<String, Object> receiver1 = payloadFactory(
    value("moipAccount", moipAccount1),
    value("type", "PRIMARY")
);

List receivers = new ArrayList();
receivers.add(receiver1);

Map<String, Object> customer = payloadFactory(
    value("id", "CUS-XXOBPZ80QLYP")
);

Map<String, Object> order1 = payloadFactory(
    value("ownId", "order_own_id"),
    value("amount", amount),
    value("items", items),
    value("receivers", receivers),
    value("customer", customer)
);

List orders = new ArrayList();
orders.add(order1);
//orders.add(order2);
//orders.add(order3);

Map<String, Object> multiorder = payloadFactory(
    value("ownId", "multiorder_own_id")
    value("orders", orders)
);

Map<String, Object> responseCreation = Moip.API.multiorders().create(multiorder, setup);
<?php

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

$order = $moip->orders()->setOwnId("pedido_1_id")
    ->addItem("Camisa Verde e Amarelo - Brasil", 1, "Seleção Brasileira",2000)
  ->setShippingAmount(2000)->setAddition(0)->setDiscount(0)
  ->setCustomer($moip->customers()->setOwnId("customer[1234]")
    ->setFullname("Joao Sousa")
    ->setEmail("[email protected]")
    ->setBirthDate("1988-12-30")
    ->setTaxDocument("22222222222")
    ->setPhone(11, 66778899)
    ->addAddress("SHIPPING",
        "Avenida Faria Lima", 2927,
      "Itaim", "Sao Paulo", "SP",
      "01234000", 8))
  ->addReceiver("MPA-VB5OGTVPCI52", "PRIMARY")
  
$order2 = $moip->orders()->setOwnId("pedido_2_id")
    ->addItem("Camisa Preta - Alemanha", 1, "Camiseta da Copa 2014", 1000)
  ->setShippingAmount(3000)->setAddition(1000)->setDiscount(5000)
  ->setCustomer($moip->customers()->setOwnId("customer[1234]")
    ->setFullname("Joao Sousa")
    ->setEmail("[email protected]")
    ->setBirthDate("1988-12-30")
    ->setTaxDocument("22222222222")
    ->setPhone(11, 66778899)
    ->addAddress("SHIPPING",
        "Avenida Faria Lima", 2927,
      "Itaim", "Sao Paulo", "SP",
      "01234000", 8))
  ->addReceiver("MPA-IFYRB1HBL73Z", "PRIMARY");
  ->addReceiver("MPA-KQB1QFWS6QNM", "SECONDARY", 55, 0, false);

$multiorder = $this->moip->multiorders()
    ->setOwnId("meu_multiorder_id")
  ->addOrder($order)
  ->addOrder($order2)
  ->create();
/**
* 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.multiorder.create({
    ownId: 'meu_multiorder_id',
    orders: [
        {
            ownId: 'pedido_1_id',
            amount: {
                currency: 'BRL',
                subtotals: {
                    shipping: 4000
                }
            },
            items: [
                {
                    product: 'Camisa Verde e Amarelo - Brasil',
                    quantity: 1,
                    detail: 'Seleção Brasileira',
                    price: 2000
                }
            ],
            customer: {
                                ownId: '2018052913021234',
                fullname: 'Joao Sousa',
                email: '[email protected]',
                birthDate: '1988-12-30',
                taxDocument: {
                    type: 'CPF',
                    number: '22222222222'
                },
                phone: {
                    countryCode: '55',
                    areaCode: '11',
                    number: '66778899'
                },
                shippingAddress: {
                    street: 'Avenida Faria Lima',
                    streetNumber: 2927,
                    complement: 8,
                    district: 'Itaim',
                    city: 'Sao Paulo',
                    state: 'SP',
                    country: 'BRA',
                    zipCode: '01234000'
                }
            },
            receivers: [
                {
                    type: 'PRIMARY',
                    moipAccount: {
                        id: 'MPA-101C9F83FF3A'
                    }
                }
            ]
        },
        {
            ownId: 'teste12',
            amount: {
                currency: 'BRL',
                subtotals: {
                    shipping: 3000
                }
            },
            items: [
                {
                    product: 'Camisa Preta - Alemanha',
                    quantity: 1,
                    detail: 'Camiseta da Copa 2014',
                    price: 1000
                }
            ],
            customer: {
                    ownId: 'customer[1234]',
                fullname: 'Joao Sousa',
                email: '[email protected]',
                birthDate: '1988-12-30',
                taxDocument: {
                    type: 'CPF',
                    number: '22222222222'
                },
                phone: {
                    countryCode: '55',
                    areaCode: '11',
                    number: '66778899'
                },
                shippingAddress: {
                    street: 'Avenida Faria Lima',
                    streetNumber: 2927,
                    complement: 8,
                    district: 'Itaim',
                    city: 'Sao Paulo',
                    state: 'SP',
                    country: 'BRA',
                    zipCode: '01234000'
                }
            },
            receivers: [
                {
                    type: 'PRIMARY',
                    moipAccount: {
                        id: 'MPA-PNYDE2TGOHQ9'
                    }
                },
                {
                    type: 'SECONDARY',
                    feePayor: false,
                    moipAccount: {
                        id: 'MPA-KQB1QFWS6QNM'
                    },
                    amount: {
                        fixed: 55
                    }
                }
            ]
        }
    ]
})
.then((response) => {
    console.log(response)
}).catch((err) => {
    console.log(err)
})
var body = new MultiOrderRequest
{
    OwnId = "meu_multiorder_id",
    Orders = new List<Order>
    {
        new Order
        {
            OwnId = "pedido_1_id",
            Amount = new Amount
            {
                Currency = "BRL",
                Subtotals = new Subtotals
                {
                    Shipping = 2000
                }
            },
            Items = new List<Item>
            {
                new Item
                {
                    Product = "Camisa Verde e Amarelo - Brasil",
                    Quantity = 1,
                    Detail = "Seleção Brasileira",
                    Price = 2000
                }
            },
            Customer = new Customer
            {
                OwnId = "customer[1234]",
                FullName = "Joao Souza",
                Email = "[email protected]",
                BirthDate = "1988-12-30",
                TaxDocument = new Taxdocument
                {
                    Type = "CPF",
                    Number = "22222222222"
                },
                Phone = new Phone
                {
                    CountryCode = "55",
                    AreaCode = "11",
                    Number = "66778899"
                },
                ShippingAddress = new Shippingaddress
                {
                    City = "São Paulo",
                    Complement = "10",
                    District = "Itaim Bibi",
                    Street = "Avenida Faria Lima",
                    StreetNumber = "500",
                    ZipCode = "01234000",
                    State = "SP",
                    Country = "BRA"
                }
            },
            Receivers = new List<Receiver>
            {
                new Receiver
                {
                    MoipAccount = new Moipaccount
                    {
                        Id = "MPA-VB5OGTVPCI52"
                    },
                    Type = "PRIMARY"
                }
            }
        },
        new Order
        {
            OwnId = "pedido_2_id",
            Amount = new Amount
            {
                Currency = "BRL",
                Subtotals = new Subtotals
                {
                    Shipping = 2000
                }
            },
            Items = new List<Item>
            {
                new Item
                {
                    Product = "Camisa Preta e Vermelha - Alemanha",
                    Quantity = 1,
                    Detail = "Camiseta da Copa 2014",
                    Price = 2000
                }
            },
            Customer = new Customer
            {
                OwnId = "customer[1234]",
                FullName = "Joao Souza",
                Email = "[email protected]",
                BirthDate = "1988-12-30",
                TaxDocument = new Taxdocument
                {
                    Type = "CPF",
                    Number = "22222222222"
                },
                Phone = new Phone
                {
                    CountryCode = "55",
                    AreaCode = "11",
                    Number = "66778899"
                },
                ShippingAddress = new Shippingaddress
                {
                    City = "São Paulo",
                    Complement = "10",
                    District = "Itaim Bibi",
                    Street = "Avenida Faria Lima",
                    StreetNumber = "500",
                    ZipCode = "01234000",
                    State = "SP",
                    Country = "BRA"
                }
            },
            Receivers = new List<Receiver>
            {
                new Receiver
                {
                    MoipAccount = new Moipaccount
                    {
                        Id = "MPA-KQB1QFWS6QNM"
                    },
                    Type = "SECONDARY",
                    FeePayor = false,
                    Amount = new Amount
                    {
                        Fixed = 55
                    }
                }
            }
        }
    }
};            
var result = await WC.MultiOrder.Create(body);

Create Multiorder with a New Customer

Creating order and registering a new customer in the same request:

{
  "ownId": "meu_multiorder_id",
  "orders": [
    {
      "ownId": "pedido_1_id",
      "amount": {
        "currency": "BRL",
        "subtotals": {
          "shipping": 2000
        }
      },
      "items": [
        {
          "product": "Camisa Verde e Amarelo - Brasil",
          "quantity": 1,
          "detail": "Seleção Brasileira",
          "price": 2000
        }
      ],
      "customer": {
        "ownId": "customer[1234]",
        "fullname": "Joao Sousa",
        "email": "[email protected]",
        "birthDate": "1988-12-30",
        "taxDocument": {
          "type": "CPF",
          "number": "22222222222"
        },
        "phone": {
          "countryCode": "55",
          "areaCode": "11",
          "number": "66778899"
        },
        "shippingAddress": 
          {
            "street": "Avenida Faria Lima",
            "streetNumber": 2927,
            "complement": 8,
            "district": "Itaim",
            "city": "Sao Paulo",
            "state": "SP",
            "country": "BRA",
            "zipCode": "01234000"
          }
      },
      "receivers": [
        {
          "moipAccount": {
            "id": "MPA-VB5OGTVPCI52"
          },
          "type": "PRIMARY"
        }
      ]
    },
    {
      "ownId": "pedido_2_id",
      "amount": {
        "currency": "BRL",
        "subtotals": {
          "shipping": 3000
        }
      },
      "items": [
        {
          "product": "Camisa Preta - Alemanha",
          "quantity": 1,
          "detail": "Camiseta da Copa 2014",
          "price": 1000
        }
      ],
      "customer": {
        "ownId": "customer[1234]",
        "fullname": "Joao Sousa",
        "email": "[email protected]",
        "birthDate": "1988-12-30",
        "taxDocument": {
          "type": "CPF",
          "number": "22222222222"
        },
        "phone": {
          "countryCode": "55",
          "areaCode": "11",
          "number": "66778899"
        },
        "shippingAddress": 
          {
            "street": "Avenida Faria Lima",
            "streetNumber": 2927,
            "complement": 8,
            "district": "Itaim",
            "city": "Sao Paulo",
            "state": "SP",
            "country": "BRA",
            "zipCode": "01234000"
          }
      },
      "receivers": [
        {
          "moipAccount": {
            "id": "MPA-IFYRB1HBL73Z"
          },
          "type": "PRIMARY"
        },
        {
          "moipAccount": {
            "id": "MPA-KQB1QFWS6QNM"
          },
          "type": "SECONDARY",
          "feePayor": false,
          "amount": {
            "fixed": 55
          }
        }
      ]
    }
  ]
}
#
# This example is based in our SDK developed in Ruby, available
# on: https://github.com/wirecardBrasil/moip-sdk-ruby
#

multi = api.multi_order.create(
  ownId: "meu_multiorder_id",
  orders: [
    {
      ownId: "pedido_1_id",
      amount: {
        currency: "BRL",
        subtotals: {
          shipping: 2000,
        }
      },
      items: [
        {
          product: "Camisa Verde e Amarelo - Brasil",
          quantity: 1,
          detail: "Seleção Brasileira",
          price: 2000,
        }
      ],
      customer: {
        ownId: "customer[1234]",
        fullname: "Joao Sousa",
        email: "[email protected]",
        birthDate: "1988-12-30",
        taxDocument: {
          type: "CPF",
          number: "22222222222",
        },
        phone: {
          countryCode: "55",
          areaCode: "11",
          number: "66778899",
        },
        shippingAddress:
    {
      street: "Avenida Faria Lima",
      streetNumber: 2927,
      complement: 8,
      district: "Itaim",
      city: "Sao Paulo",
      state: "SP",
      country: "BRA",
      zipCode: "01234000",
    }
      },
      receivers: [
        {
          moipAccount: {
            id: "MPA-VB5OGTVPCI52",
          },
          type: "PRIMARY",
        }
      ]
    },
    {
      ownId: "pedido_2_id",
      amount: {
        currency: "BRL",
        subtotals: {
          shipping: 3000,
        }
      },
      items: [
        {
          product: "Camisa Preta - Alemanha",
          quantity: 1,
          detail: "Camiseta da Copa 2014",
          price: 1000,
        }
      ],
      customer: {
        ownId: "customer[1234]",
        fullname: "Joao Sousa",
        email: "[email protected]",
        birthDate: "1988-12-30",
        taxDocument: {
          type: "CPF",
          number: "22222222222",
        },
        phone: {
          countryCode: "55",
          areaCode: "11",
          number: "66778899",
        },
        shippingAddress:
    {
      street: "Avenida Faria Lima",
      streetNumber: 2927,
      complement: 8,
      district: "Itaim",
      city: "Sao Paulo",
      state: "SP",
      country: "BRA",
      zipCode: "01234000",
    }
      },
      receivers: [
        {
          moipAccount: {
            id: "MPA-IFYRB1HBL73Z",
          },
          type: "PRIMARY",
        },
        {
          moipAccount: {
            id: "MPA-KQB1QFWS6QNM",
          },
          type: "SECONDARY",
          feePayor: false,
          amount: {
            fixed: 55,
          }
        }
      ]
    }
  ]
)
/**
* This example is based in our SDK developed in Java, available
* on: https://github.com/wirecardBrasil/moip-sdk-java
*/

Map<String, Object> subtotals = payloadFactory(
    value("shipping", 15000)
);

Map<String, Object> amount = payloadFactory(
    value("currency", "BRL"),
    value("subtotals", subtotals)
);

Map<String, Object> product1 = payloadFactory(
    value("product", "Product 1 Description"),
    value("category", "TOYS_AND_GAMES"),
    value("quantity", 2),
    value("detail", "Anakin's Light Saber"),
    value("price", 100000000)
);

Map<String, Object> product2 = payloadFactory(
    value("product", "Product 2 Description"),
    value("category", "SCIENCE_AND_LABORATORY"),
    value("quantity", 5),
    value("detail", "Pym particles"),
    value("price", 2450000000)
);

List items = new ArrayList();
items.add(product1);
items.add(product2);

Map<String, Object> moipAccount1 = payloadFactory(
    value("id", "MPA-VB5OGTVPCI52")
);

Map<String, Object> receiver1 = payloadFactory(
    value("moipAccount", moipAccount1),
    value("type", "PRIMARY")
);

List receivers = new ArrayList();
receivers.add(receiver1);

Map<String, Object> customer = payloadFactory(
    value("id", "CUS-XXOBPZ80QLYP")
);

Map<String, Object> order1 = payloadFactory(
    value("ownId", "order_own_id"),
    value("amount", amount),
    value("items", items),
    value("receivers", receivers),
    value("customer", customer)
);

List orders = new ArrayList();
orders.add(order1);
//orders.add(order2);
//orders.add(order3);

Map<String, Object> multiorder = payloadFactory(
    value("ownId", "multiorder_own_id")
    value("orders", orders)
);

Map<String, Object> responseCreation = Moip.API.multiorders().create(multiorder, setup);
<?php

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

$order = $moip->orders()->setOwnId("pedido_1_id")
    ->addItem("Camisa Verde e Amarelo - Brasil", 1, "Seleção Brasileira",2000)
  ->setShippingAmount(2000)->setAddition(0)->setDiscount(0)
  ->setCustomer($moip->customers()->setOwnId("customer[1234]")
    ->setFullname("Joao Sousa")
    ->setEmail("[email protected]")
    ->setBirthDate("1988-12-30")
    ->setTaxDocument("22222222222")
    ->setPhone(11, 66778899)
    ->addAddress("SHIPPING",
        "Avenida Faria Lima", 2927,
      "Itaim", "Sao Paulo", "SP",
      "01234000", 8))
  ->addReceiver("MPA-VB5OGTVPCI52", "PRIMARY")
  
$order2 = $moip->orders()->setOwnId("pedido_2_id")
    ->addItem("Camisa Preta - Alemanha", 1, "Camiseta da Copa 2014", 1000)
  ->setShippingAmount(3000)->setAddition(1000)->setDiscount(5000)
  ->setCustomer($moip->customers()->setOwnId("customer[1234]")
    ->setFullname("Joao Sousa")
    ->setEmail("[email protected]")
    ->setBirthDate("1988-12-30")
    ->setTaxDocument("22222222222")
    ->setPhone(11, 66778899)
    ->addAddress("SHIPPING",
        "Avenida Faria Lima", 2927,
      "Itaim", "Sao Paulo", "SP",
      "01234000", 8))
  ->addReceiver("MPA-IFYRB1HBL73Z", "PRIMARY");
  ->addReceiver("MPA-KQB1QFWS6QNM", "SECONDARY", 55, 0, false);

$multiorder = $this->moip->multiorders()
    ->setOwnId("meu_multiorder_id")
  ->addOrder($order)
  ->addOrder($order2)
  ->create();
/**
* 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.multiorder.create({
    ownId: 'meu_multiorder_id',
    orders: [
        {
            ownId: 'pedido_1_id',
            amount: {
                currency: 'BRL',
                subtotals: {
                    shipping: 4000
                }
            },
            items: [
                {
                    product: 'Camisa Verde e Amarelo - Brasil',
                    quantity: 1,
                    detail: 'Seleção Brasileira',
                    price: 2000
                }
            ],
            customer: {
                                ownId: '2018052913021234',
                fullname: 'Joao Sousa',
                email: '[email protected]',
                birthDate: '1988-12-30',
                taxDocument: {
                    type: 'CPF',
                    number: '22222222222'
                },
                phone: {
                    countryCode: '55',
                    areaCode: '11',
                    number: '66778899'
                },
                shippingAddress: {
                    street: 'Avenida Faria Lima',
                    streetNumber: 2927,
                    complement: 8,
                    district: 'Itaim',
                    city: 'Sao Paulo',
                    state: 'SP',
                    country: 'BRA',
                    zipCode: '01234000'
                }
            },
            receivers: [
                {
                    type: 'PRIMARY',
                    moipAccount: {
                        id: 'MPA-101C9F83FF3A'
                    }
                }
            ]
        },
        {
            ownId: 'teste12',
            amount: {
                currency: 'BRL',
                subtotals: {
                    shipping: 3000
                }
            },
            items: [
                {
                    product: 'Camisa Preta - Alemanha',
                    quantity: 1,
                    detail: 'Camiseta da Copa 2014',
                    price: 1000
                }
            ],
            customer: {
                    ownId: 'customer[1234]',
                fullname: 'Joao Sousa',
                email: '[email protected]',
                birthDate: '1988-12-30',
                taxDocument: {
                    type: 'CPF',
                    number: '22222222222'
                },
                phone: {
                    countryCode: '55',
                    areaCode: '11',
                    number: '66778899'
                },
                shippingAddress: {
                    street: 'Avenida Faria Lima',
                    streetNumber: 2927,
                    complement: 8,
                    district: 'Itaim',
                    city: 'Sao Paulo',
                    state: 'SP',
                    country: 'BRA',
                    zipCode: '01234000'
                }
            },
            receivers: [
                {
                    type: 'PRIMARY',
                    moipAccount: {
                        id: 'MPA-PNYDE2TGOHQ9'
                    }
                },
                {
                    type: 'SECONDARY',
                    feePayor: false,
                    moipAccount: {
                        id: 'MPA-KQB1QFWS6QNM'
                    },
                    amount: {
                        fixed: 55
                    }
                }
            ]
        }
    ]
})
.then((response) => {
    console.log(response)
}).catch((err) => {
    console.log(err)
})
var body = new MultiOrderRequest
{
    OwnId = "meu_multiorder_id",
    Orders = new List<Order>
    {
        new Order
        {
            OwnId = "pedido_1_id",
            Amount = new Amount
            {
                Currency = "BRL",
                Subtotals = new Subtotals
                {
                    Shipping = 2000
                }
            },
            Items = new List<Item>
            {
                new Item
                {
                    Product = "Camisa Verde e Amarelo - Brasil",
                    Quantity = 1,
                    Detail = "Seleção Brasileira",
                    Price = 2000
                }
            },
            Customer = new Customer
            {
                OwnId = "customer[1234]",
                FullName = "Joao Souza",
                Email = "[email protected]",
                BirthDate = "1988-12-30",
                TaxDocument = new Taxdocument
                {
                    Type = "CPF",
                    Number = "22222222222"
                },
                Phone = new Phone
                {
                    CountryCode = "55",
                    AreaCode = "11",
                    Number = "66778899"
                },
                ShippingAddress = new Shippingaddress
                {
                    City = "São Paulo",
                    Complement = "10",
                    District = "Itaim Bibi",
                    Street = "Avenida Faria Lima",
                    StreetNumber = "500",
                    ZipCode = "01234000",
                    State = "SP",
                    Country = "BRA"
                }
            },
            Receivers = new List<Receiver>
            {
                new Receiver
                {
                    MoipAccount = new Moipaccount
                    {
                        Id = "MPA-VB5OGTVPCI52"
                    },
                    Type = "PRIMARY"
                }
            }
        },
        new Order
        {
            OwnId = "pedido_2_id",
            Amount = new Amount
            {
                Currency = "BRL",
                Subtotals = new Subtotals
                {
                    Shipping = 2000
                }
            },
            Items = new List<Item>
            {
                new Item
                {
                    Product = "Camisa Preta e Vermelha - Alemanha",
                    Quantity = 1,
                    Detail = "Camiseta da Copa 2014",
                    Price = 2000
                }
            },
            Customer = new Customer
            {
                OwnId = "customer[1234]",
                FullName = "Joao Souza",
                Email = "[email protected]",
                BirthDate = "1988-12-30",
                TaxDocument = new Taxdocument
                {
                    Type = "CPF",
                    Number = "22222222222"
                },
                Phone = new Phone
                {
                    CountryCode = "55",
                    AreaCode = "11",
                    Number = "66778899"
                },
                ShippingAddress = new Shippingaddress
                {
                    City = "São Paulo",
                    Complement = "10",
                    District = "Itaim Bibi",
                    Street = "Avenida Faria Lima",
                    StreetNumber = "500",
                    ZipCode = "01234000",
                    State = "SP",
                    Country = "BRA"
                }
            },
            Receivers = new List<Receiver>
            {
                new Receiver
                {
                    MoipAccount = new Moipaccount
                    {
                        Id = "MPA-KQB1QFWS6QNM"
                    },
                    Type = "SECONDARY",
                    FeePayor = false,
                    Amount = new Amount
                    {
                        Fixed = 55
                    }
                }
            }
        }
    }
};            
var result = await WC.MultiOrder.Create(body);

Create Multiorder with an Existing Customer

Creating an order by passing the ID of an existing customer:

{
  "ownId": "meu_multiorder_id",
  "orders": [
    {
      "ownId": "pedido_1_id",
      "amount": {
        "currency": "BRL",
        "subtotals": {
          "shipping": 2000
        }
      },
      "items": [
        {
          "product": "Camisa Verde e Amarelo - Brasil",
          "quantity": 1,
          "detail": "Seleção Brasileira",
          "price": 2000
        }
      ],
      "customer": {
       "id": "CUS-OQSQ7IWL229E"
      },
      "receivers": [
        {
          "moipAccount": {
            "id": "MPA-VB5OGTVPCI52"
          },
          "type": "PRIMARY"
        }
      ]
    },
    {
      "ownId": "pedido_2_id",
      "amount": {
        "currency": "BRL",
        "subtotals": {
          "shipping": 3000
        }
      },
      "items": [
        {
          "product": "Camisa Preta - Alemanha",
          "quantity": 1,
          "detail": "Camiseta da Copa 2014",
          "price": 1000
        }
      ],
      "customer": {
        "id": "CUS-OQSQ7IWL229E"
      },
      "receivers": [
        {
          "moipAccount": {
            "id": "MPA-IFYRB1HBL73Z"
          },
          "type": "PRIMARY"
        },
        {
          "moipAccount": {
            "id": "MPA-KQB1QFWS6QNM"
          },
          "type": "SECONDARY",
          "feePayor": false,
          "amount": {
            "fixed": 55
          }
        }
      ]
    }
  ]
}
#
# This example is based in our SDK developed in Ruby, available
# on: https://github.com/wirecardBrasil/moip-sdk-ruby
#

multi = api.multi_order.create(
  ownId: "meu_multiorder_id",
  orders: [
    {
      ownId: "pedido_1_id",
      amount: {
        currency: "BRL",
        subtotals: {
          shipping: 2000,
        },
      },
      items: [
        {
          product: "Camisa Verde e Amarelo - Brasil",
          quantity: 1,
          detail: "Seleção Brasileira",
          price: 2000,
        },
      ],
      customer: {
        id: "CUS-OQSQ7IWL229E"
      },
      receivers: [
        {
          moipAccount: {
            id: "MPA-VB5OGTVPCI52",
          },
          type: "PRIMARY",
        }
      ]
    },
    {
      ownId: "pedido_2_id",
      amount: {
        currency: "BRL",
        subtotals: {
          shipping: 3000,
        },
      },
      items: [
        {
          product: "Camisa Preta - Alemanha",
          quantity: 1,
          detail: "Camiseta da Copa 2014",
          price: 1000
        }
      ],
      customer: {
        id: "CUS-OQSQ7IWL229E"
    },
      receivers: [
        {
          moipAccount: {
            id: "MPA-IFYRB1HBL73Z",
          },
          type: "PRIMARY",
        },
        {
          moipAccount: {
            id: "MPA-KQB1QFWS6QNM",
          },
          type: "SECONDARY",
          feePayor: false,
          amount: {
            fixed: 55,
          }
        }
      ]
    }
  ]
)
/**
* This example is based in our SDK developed in Java, available
* on: https://github.com/wirecardBrasil/moip-sdk-java
*/

Map<String, Object> subtotals = payloadFactory(
    value("shipping", 15000)
);

Map<String, Object> amount = payloadFactory(
    value("currency", "BRL"),
    value("subtotals", subtotals)
);

Map<String, Object> product1 = payloadFactory(
    value("product", "Product 1 Description"),
    value("category", "TOYS_AND_GAMES"),
    value("quantity", 2),
    value("detail", "Anakin's Light Saber"),
    value("price", 100000000)
);

Map<String, Object> product2 = payloadFactory(
    value("product", "Product 2 Description"),
    value("category", "SCIENCE_AND_LABORATORY"),
    value("quantity", 5),
    value("detail", "Pym particles"),
    value("price", 2450000000)
);

List items = new ArrayList();
items.add(product1);
items.add(product2);

Map<String, Object> moipAccount1 = payloadFactory(
    value("id", "MPA-VB5OGTVPCI52")
);

Map<String, Object> receiver1 = payloadFactory(
    value("moipAccount", moipAccount1),
    value("type", "PRIMARY")
);

List receivers = new ArrayList();
receivers.add(receiver1);

Map<String, Object> customer = payloadFactory(
    value("id", "CUS-XXOBPZ80QLYP")
);

Map<String, Object> order1 = payloadFactory(
    value("ownId", "order_own_id"),
    value("amount", amount),
    value("items", items),
    value("receivers", receivers),
    value("customer", customer)
);

List orders = new ArrayList();
orders.add(order1);
//orders.add(order2);
//orders.add(order3);

Map<String, Object> multiorder = payloadFactory(
    value("ownId", "multiorder_own_id")
    value("orders", orders)
);

Map<String, Object> responseCreation = Moip.API.multiorders().create(multiorder, setup);
<?php

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

$order = $moip->orders()->setOwnId("pedido_1_id")
    ->addItem("Camisa Verde e Amarelo - Brasil", 1, "Seleção Brasileira",2000)
  ->setShippingAmount(2000)->setAddition(0)->setDiscount(0)
  ->setCustomerId("CUS-XXOBPZ80QLYP")
  ->addReceiver("MPA-VB5OGTVPCI52", "PRIMARY")
  
$order2 = $moip->orders()->setOwnId("pedido_2_id")
    ->addItem("Camisa Preta - Alemanha", 1, "Camiseta da Copa 2014", 1000)
  ->setShippingAmount(3000)->setAddition(1000)->setDiscount(5000)
  ->setCustomerId("CUS-XXOBPZ80QLYP")
  ->addReceiver("MPA-IFYRB1HBL73Z", "PRIMARY");
  ->addReceiver("MPA-KQB1QFWS6QNM", "SECONDARY", 55, 0, false);

$multiorder = $this->moip->multiorders()
    ->setOwnId("meu_multiorder_id")
  ->addOrder($order)
  ->addOrder($order2)
  ->create();
/**
* 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.multiorder.create({
    ownId: 'meu_multiorder_id',
    orders: [
        {
            ownId: 'pedido_1_id',
            amount: {
                currency: 'BRL',
                subtotals: {
                    shipping: 4000
                }
            },
            items: [
                {
                    product: 'Camisa Verde e Amarelo - Brasil',
                    quantity: 1,
                    detail: 'Seleção Brasileira',
                    price: 2000
                }
            ],
            customer: {
                                id: 'CUS-XXOBPZ80QLYP'
            },
            receivers: [
                {
                    type: 'PRIMARY',
                    moipAccount: {
                        id: 'MPA-101C9F83FF3A'
                    }
                }
            ]
        },
        {
            ownId: 'teste12',
            amount: {
                currency: 'BRL',
                subtotals: {
                    shipping: 3000
                }
            },
            items: [
                {
                    product: 'Camisa Preta - Alemanha',
                    quantity: 1,
                    detail: 'Camiseta da Copa 2014',
                    price: 1000
                }
            ],
            customer: {
                        id: 'CUS-XXOBPZ80QLYP'
            },
            receivers: [
                {
                    type: 'PRIMARY',
                    moipAccount: {
                        id: 'MPA-PNYDE2TGOHQ9'
                    }
                },
                {
                    type: 'SECONDARY',
                    feePayor: false,
                    moipAccount: {
                        id: 'MPA-KQB1QFWS6QNM'
                    },
                    amount: {
                        fixed: 55
                    }
                }
            ]
        }
    ]
})
.then((response) => {
    console.log(response)
}).catch((err) => {
    console.log(err)
})
var body = new MultiOrderRequest
{
    OwnId = "meu_multiorder_id",
    Orders = new List<Order>
    {
        new Order
        {
            OwnId = "pedido_1_id",
            Amount = new Amount
            {
                Currency = "BRL",
                Subtotals = new Subtotals
                {
                    Shipping = 2000
                }
            },
            Items = new List<Item>
            {
                new Item
                {
                    Product = "Camisa Verde e Amarelo - Brasil",
                    Quantity = 1,
                    Detail = "Seleção Brasileira",
                    Price = 2000
                }
            },
            Customer = new Customer
            {
                id = "CUS-XXOBPZ80QLYP"
            },
            Receivers = new List<Receiver>
            {
                new Receiver
                {
                    MoipAccount = new Moipaccount
                    {
                        Id = "MPA-VB5OGTVPCI52"
                    },
                    Type = "PRIMARY"
                }
            }
        },
        new Order
        {
            OwnId = "pedido_2_id",
            Amount = new Amount
            {
                Currency = "BRL",
                Subtotals = new Subtotals
                {
                    Shipping = 2000
                }
            },
            Items = new List<Item>
            {
                new Item
                {
                    Product = "Camisa Preta e Vermelha - Alemanha",
                    Quantity = 1,
                    Detail = "Camiseta da Copa 2014",
                    Price = 2000
                }
            },
            Customer = new Customer
            {
               id = "CUS-XXOBPZ80QLYP"
            },
            Receivers = new List<Receiver>
            {
                new Receiver
                {
                    MoipAccount = new Moipaccount
                    {
                        Id = "MPA-KQB1QFWS6QNM"
                    },
                    Type = "SECONDARY",
                    FeePayor = false,
                    Amount = new Amount
                    {
                        Fixed = 55
                    }
                }
            }
        }
    }
};            
var result = await WC.MultiOrder.Create(body);