---
agentTools:
  projectIndex: https://docs.mundipagg.com/llms.txt
---

# Criar pedido com meio de pagamento Checkout

<br>

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Mundipagg API",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.mundipagg.com/core/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/orders": {
      "post": {
        "summary": "Criar pedido com meio de pagamento Checkout",
        "description": "",
        "operationId": "criar-pedido-checkout",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "items",
                  "payments"
                ],
                "properties": {
                  "items": {
                    "type": "array",
                    "description": "Itens do pedido. [Saiba mais sobre item do pedido](https://docs.mundipagg.com/v1/reference#item-do-pedido)"
                  },
                  "customer_id": {
                    "type": "string",
                    "description": "Código do cliente."
                  },
                  "customer": {
                    "type": "object",
                    "description": "Dados do cliente. Obrigatório caso o **customer_id** não seja informado. [Saiba mais sobre clientes](https://docs.mundipagg.com/v1/reference#clientes).",
                    "properties": {}
                  },
                  "shipping": {
                    "type": "object",
                    "description": "Dados para entrega. [Saiba mais sobre entregas](https://docs.mundipagg.com/v1/reference#entregas)",
                    "properties": {}
                  },
                  "payments": {
                    "type": "array",
                    "description": "Lista de dados de pagamento. [Saiba mais sobre pagamentos.](https://docs.mundipagg.com/v1/reference#pagamento-overview)"
                  },
                  "metadata": {
                    "type": "string",
                    "description": "Objeto chave/valor utilizado para armazenar informações adicionais sobre o pedido. [Saiba mais sobre metadata](https://docs.mundipagg.com/v1/reference#metadata)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"id\": \"or_ywXmL2LCQuYlZ5O3\",\n    \"code\": \"1V82IK0C81\",\n    \"amount\": 3000,\n    \"currency\": \"BRL\",\n    \"closed\": false,\n    \"items\": [\n        {\n            \"id\": \"oi_l0qy5l6FzBI6ONYQ\",\n            \"description\": \"Chaveiro do Teressact\",\n            \"amount\": 3000,\n            \"quantity\": 1,\n            \"status\": \"active\",\n            \"created_at\": \"2018-06-18T18:31:16Z\",\n            \"updated_at\": \"2018-06-18T18:31:16Z\"\n        }\n    ],\n    \"customer\": {\n        \"id\": \"cus_qa9WbRztpc7bKpyN\",\n        \"name\": \"Tony Stark\",\n        \"email\": \"\",\n        \"delinquent\": false,\n        \"created_at\": \"2018-06-18T18:31:09Z\",\n        \"updated_at\": \"2018-06-18T18:31:09Z\",\n        \"phones\": {}\n    },\n    \"status\": \"pending\",\n    \"created_at\": \"2018-06-18T18:31:14Z\",\n    \"updated_at\": \"2018-06-18T18:31:14Z\",\n    \"checkouts\": [\n        {\n            \"id\": \"chk_lJrO6LLcGQh46EqX\",\n            \"amount\": 3000,\n            \"status\": \"open\",\n            \"success_url\": \"https://www.mundipagg.com\",\n            \"payment_url\": \"https://api.mundipagg.com/checkout/v1/orders/chk_lJrO6LLcGQh46EqX\",\n            \"customer_editable\": true,\n            \"billing_address_editable\": true,\n            \"skip_checkout_success_page\": false,\n            \"created_at\": \"2018-06-18T18:31:18Z\",\n            \"updated_at\": \"2018-06-18T18:31:18Z\",\n            \"expires_at\": \"2018-06-18T20:31:18Z\",\n            \"accepted_payment_methods\": [\n                \"credit_card\", \"boleto\"\n            ],\n            \"customer\": {\n                \"id\": \"cus_qa9WbRztpc7bKpyN\",\n                \"name\": \"Tony Stark\",\n                \"email\": \"\",\n                \"delinquent\": false,\n                \"created_at\": \"2018-06-18T18:31:09Z\",\n                \"updated_at\": \"2018-06-18T18:31:09Z\",\n                \"phones\": {}\n            },\n            \"credit_card\": {\n                \"capture\": true,\n                \"installments\": [\n                    {\n                        \"number\": 1,\n                        \"total\": 3000\n                    },\n                    {\n                        \"number\": 2,\n                        \"total\": 3000\n                    }\n                ]\n            },\n          \"boleto\": {\n                \"due_at\": \"2020-07-25T00:00:00Z\",\n                \"instructions\": \"Pagar até o vencimento\"\n            },\n            \"billing_address\": {},\n            \"shippable\": false,\n            \"currency\": \"BRL\",\n            \"metadata\": {}\n        }\n    ]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "or_ywXmL2LCQuYlZ5O3"
                    },
                    "code": {
                      "type": "string",
                      "example": "1V82IK0C81"
                    },
                    "amount": {
                      "type": "integer",
                      "example": 3000,
                      "default": 0
                    },
                    "currency": {
                      "type": "string",
                      "example": "BRL"
                    },
                    "closed": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "oi_l0qy5l6FzBI6ONYQ"
                          },
                          "description": {
                            "type": "string",
                            "example": "Chaveiro do Teressact"
                          },
                          "amount": {
                            "type": "integer",
                            "example": 3000,
                            "default": 0
                          },
                          "quantity": {
                            "type": "integer",
                            "example": 1,
                            "default": 0
                          },
                          "status": {
                            "type": "string",
                            "example": "active"
                          },
                          "created_at": {
                            "type": "string",
                            "example": "2018-06-18T18:31:16Z"
                          },
                          "updated_at": {
                            "type": "string",
                            "example": "2018-06-18T18:31:16Z"
                          }
                        }
                      }
                    },
                    "customer": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "cus_qa9WbRztpc7bKpyN"
                        },
                        "name": {
                          "type": "string",
                          "example": "Tony Stark"
                        },
                        "email": {
                          "type": "string",
                          "example": ""
                        },
                        "delinquent": {
                          "type": "boolean",
                          "example": false,
                          "default": true
                        },
                        "created_at": {
                          "type": "string",
                          "example": "2018-06-18T18:31:09Z"
                        },
                        "updated_at": {
                          "type": "string",
                          "example": "2018-06-18T18:31:09Z"
                        },
                        "phones": {
                          "type": "object",
                          "properties": {}
                        }
                      }
                    },
                    "status": {
                      "type": "string",
                      "example": "pending"
                    },
                    "created_at": {
                      "type": "string",
                      "example": "2018-06-18T18:31:14Z"
                    },
                    "updated_at": {
                      "type": "string",
                      "example": "2018-06-18T18:31:14Z"
                    },
                    "checkouts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "chk_lJrO6LLcGQh46EqX"
                          },
                          "amount": {
                            "type": "integer",
                            "example": 3000,
                            "default": 0
                          },
                          "status": {
                            "type": "string",
                            "example": "open"
                          },
                          "success_url": {
                            "type": "string",
                            "example": "https://www.mundipagg.com"
                          },
                          "payment_url": {
                            "type": "string",
                            "example": "https://api.mundipagg.com/checkout/v1/orders/chk_lJrO6LLcGQh46EqX"
                          },
                          "customer_editable": {
                            "type": "boolean",
                            "example": true,
                            "default": true
                          },
                          "billing_address_editable": {
                            "type": "boolean",
                            "example": true,
                            "default": true
                          },
                          "skip_checkout_success_page": {
                            "type": "boolean",
                            "example": false,
                            "default": true
                          },
                          "created_at": {
                            "type": "string",
                            "example": "2018-06-18T18:31:18Z"
                          },
                          "updated_at": {
                            "type": "string",
                            "example": "2018-06-18T18:31:18Z"
                          },
                          "expires_at": {
                            "type": "string",
                            "example": "2018-06-18T20:31:18Z"
                          },
                          "accepted_payment_methods": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "example": "credit_card"
                            }
                          },
                          "customer": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "example": "cus_qa9WbRztpc7bKpyN"
                              },
                              "name": {
                                "type": "string",
                                "example": "Tony Stark"
                              },
                              "email": {
                                "type": "string",
                                "example": ""
                              },
                              "delinquent": {
                                "type": "boolean",
                                "example": false,
                                "default": true
                              },
                              "created_at": {
                                "type": "string",
                                "example": "2018-06-18T18:31:09Z"
                              },
                              "updated_at": {
                                "type": "string",
                                "example": "2018-06-18T18:31:09Z"
                              },
                              "phones": {
                                "type": "object",
                                "properties": {}
                              }
                            }
                          },
                          "credit_card": {
                            "type": "object",
                            "properties": {
                              "capture": {
                                "type": "boolean",
                                "example": true,
                                "default": true
                              },
                              "installments": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "number": {
                                      "type": "integer",
                                      "example": 1,
                                      "default": 0
                                    },
                                    "total": {
                                      "type": "integer",
                                      "example": 3000,
                                      "default": 0
                                    }
                                  }
                                }
                              }
                            }
                          },
                          "boleto": {
                            "type": "object",
                            "properties": {
                              "due_at": {
                                "type": "string",
                                "example": "2020-07-25T00:00:00Z"
                              },
                              "instructions": {
                                "type": "string",
                                "example": "Pagar até o vencimento"
                              }
                            }
                          },
                          "billing_address": {
                            "type": "object",
                            "properties": {}
                          },
                          "shippable": {
                            "type": "boolean",
                            "example": false,
                            "default": true
                          },
                          "currency": {
                            "type": "string",
                            "example": "BRL"
                          },
                          "metadata": {
                            "type": "object",
                            "properties": {}
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "csharp",
              "code": "    // Neste exemplo estamos utilizando A sdk C# MundiAPI.PCL\n    string basicAuthUserName = \"sk_test_4tdVXpseumRmqbo\";\n    // Senha em branco. Passando apenas a secret key\n    string basicAuthPassword = \"\";\n    var client = new MundiAPIClient(basicAuthUserName, basicAuthPassword);\n\n    var items = new List<CreateOrderItemRequest> {\n        new CreateOrderItemRequest{\n\n        Amount = 2990,\n        Description = \"Chaveiro do Tesseract\",\n        Quantity = 1\n        }\n        };\n\n    var customer = new CreateCustomerRequest\n    {\n        Name = \"Tony Stark\",\n        Email = \"tonystark@avengers.com\",\n    };\n\n    var payments = new List<CreatePaymentRequest> {\n        new CreatePaymentRequest {\n            Amount = 990,\n            PaymentMethod = \"credit_card\",\n            CreditCard = new CreateCreditCardPaymentRequest{\n            StatementDescriptor = \"AVENGERS\",\n                Card = new CreateCardRequest{\n                    Number = \"4024007131429325\",\n                    HolderName = \"Tony Stark2\",\n                    ExpMonth = 1,\n                    ExpYear = 18,\n                    Cvv = \"355\",\n                }\n         }\n         },new CreatePaymentRequest {\n            Amount = 2000,\n            PaymentMethod = \"credit_card\",\n            CreditCard = new CreateCreditCardPaymentRequest{\n            StatementDescriptor = \"AVENGERS\",\n                Card = new CreateCardRequest{\n                    Number = \"4024007131429325\",\n                    HolderName = \"Tony Stark3\",\n                    ExpMonth = 1,\n                    ExpYear = 18,\n                    Cvv = \"355\",\n           }\n        }\n      },\n    };\n    var request = new CreateOrderRequest\n    {\n        Items = items,\n        Customer = customer,\n        Payments = payments\n    };\n    var response = client.Orders.CreateOrder(request);",
              "name": "SDK C#"
            },
            {
              "language": "php",
              "code": "//This example was built using MundiAPI-PHP SDK.\n//For more information, please refer to https://github.com/mundipagg/MundiAPI-PHP\n\n$secretKey = 'sk_test_4tdVXpseumRmqbo'; //the secret key will be provided by MundiPagg.\n$basicAuthPassword = ''; //fill it with an empty string\n\n$apiClient = new \\MundiAPILib\\MundiAPIClient(\n    $secretKey,\n    $basicAuthPassword\n);\n\n$orderController = $apiClient->getOrders();\n\n$customer = new \\MundiAPILib\\Models\\CreateCustomerRequest();\n$customer->name = \"Tony Stark\";\n$customer->email = \"tonystark@avengers.com\";\n\n$checkout = new \\MundiAPILib\\Models\\CreateCheckoutPaymentRequest();\n$checkout->customerEditable = false;\n$checkout->skipCheckoutSuccessPage = true;\n$checkout->acceptedPaymentMethods = [\"credit_card\", \"boleto\", \"bank_transfer\", \"debit_card\"];\n$checkout->acceptedMultiPaymentMethods = [[\"credit_card\", \"credit_card\"], [\"credit_card\", \"boleto\"]];\n$checkout->successUrl = \"https://www.mundipagg.com\";\n\n//Bank transfer payment Setup;\n$checkout->bankTransfer = new \\MundiAPILib\\Models\\CreateCheckoutBankTransferRequest();\n$checkout->bankTransfer->bank = [\"237\", \"001\", \"341\"];\n\n//Boleto Payment Setup;\n$checkout->boleto = new \\MundiAPILib\\Models\\CreateCheckoutBoletoPaymentRequest();\n$checkout->boleto->bank = \"033\";\n$checkout->boleto->instructions =\"Pagar ate o vencimento\";\n$checkout->boleto->dueAt = new \\DateTime(\"2021-07-25T00:00:00Z\");\n\n//Credit Card Payment Setup;\n$checkout->creditCard = new \\MundiAPILib\\Models\\CreateCheckoutCreditCardPaymentRequest();\n$checkout->creditCard->capture = true;\n$checkout->creditCard->statement_descriptor = \"Descriptor example\";\n$checkout->creditCard->installments = [ //Credit card installments Setup\n    new \\MundiAPILib\\Models\\CreateCheckoutCardInstallmentOptionRequest(),\n    new \\MundiAPILib\\Models\\CreateCheckoutCardInstallmentOptionRequest()\n];\n// installment 1;\n$checkout->creditCard->installments[0]->number = 1;\n$checkout->creditCard->installments[0]->total = 2000;\n// installment 2 with extra tax of 500;\n$checkout->creditCard->installments[1]->number = 1;\n$checkout->creditCard->installments[1]->total = 2500;\n\n// Debit Card Payment Setup;\n$checkout->debitCard = new \\MundiAPILib\\Models\\CreateCheckoutDebitCardPaymentRequest();\n// Debit card Authentication Setup;\n$checkout->debitCard->authentication = new \\MundiAPILib\\Models\\CreatePaymentAuthenticationRequest();\n$checkout->debitCard->authentication->type = 'threed_secure';\n$checkout->debitCard->authentication->threedSecure = new \\MundiAPILib\\Models\\CreateThreeDSecureRequest();\n$checkout->debitCard->authentication->threedSecure->mpi = \"acquirer\";\n$checkout->debitCard->authentication->threedSecure->successUrl = \"https://www.mundipagg.com\";\n\n$request = new \\MundiAPILib\\Models\\CreateOrderRequest();\n\n$request->items = [new \\MundiAPILib\\Models\\CreateOrderItemRequest()];\n$request->items[0]->description = \"Tesseract Bracelet\";\n$request->items[0]->quantity = 1;\n$request->items[0]->amount = 2990; // this value should be in cents\n\n$request->payments = [new \\MundiAPILib\\Models\\CreatePaymentRequest()];\n$request->payments[0]->amount = 2000; // this value should be in cents\n$request->payments[0]->paymentMethod = \"checkout\";\n$request->payments[0]->checkout = $checkout;\n$request->customer = $customer;\n\n$result = new \\MundiAPILib\\Models\\GetOrderResponse();\n$result->checkouts = [new \\MundiAPILib\\Models\\GetCheckoutPaymentResponse()];\n$result = $orderController->createOrder($request);\n\necho json_encode($result, JSON_PRETTY_PRINT);",
              "name": "SDK PHP"
            }
          ],
          "samples-languages": [
            "csharp",
            "php"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": false
  },
  "x-readme-fauxas": true,
  "_id": "5aba89f6b169810058a71e9a:5b27fcb04799c70003f36ccf"
}
```