> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.erp.olist.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Criar pedido



## OpenAPI

````yaml https://erp.olist.com/public-api/v3/swagger/swagger-mintlify.json post /pedidos
openapi: 3.0.0
info:
  title: Olist ERP API v3
  description: >-
    Documentação completa: <a href="https://api-docs.erp.olist.com"
    target="_blank">https://api-docs.erp.olist.com</a>
  version: '3.1'
servers:
  - url: https://api.tiny.com.br/public-api/v3
security: []
paths:
  /pedidos:
    post:
      tags:
        - Pedidos
      summary: Criar pedido
      operationId: CriarPedidoAction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CriarPedidoModelRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CriarPedidoModelResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDTO'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
        '503':
          description: Service Unavailable
      security:
        - bearerAuth: []
components:
  schemas:
    CriarPedidoModelRequest:
      title: ' '
      description: ' '
      type: object
      allOf:
        - $ref: '#/components/schemas/PedidoModel'
        - properties:
            idContato:
              type: integer
              nullable: true
            listaPreco:
              $ref: '#/components/schemas/ListaPrecoRequestModel'
            naturezaOperacao:
              $ref: '#/components/schemas/NaturezaOperacaoRequestModel'
            vendedor:
              $ref: '#/components/schemas/VendedorRequestModel'
            enderecoEntrega:
              $ref: '#/components/schemas/EnderecoEntregaPedidoModelRequest'
            consumidorFinal:
              $ref: '#/components/schemas/ConsumidorFinalRequestModel'
            ecommerce:
              $ref: '#/components/schemas/EcommerceRequestModel'
            transportador:
              $ref: '#/components/schemas/TransportadorRequestModel'
            intermediador:
              $ref: '#/components/schemas/IntermediadorRequestModel'
            deposito:
              $ref: '#/components/schemas/DepositoRequestModel'
            pagamento:
              $ref: '#/components/schemas/PagamentoRequestModel'
            itens:
              type: array
              items:
                $ref: '#/components/schemas/ItemPedidoRequestModel'
            pagamentosIntegrados:
              type: array
              items:
                $ref: '#/components/schemas/PagamentoIntegradoModelRequest'
          type: object
    CriarPedidoModelResponse:
      title: ' '
      description: ' '
      properties:
        id:
          type: integer
        numeroPedido:
          type: string
      type: object
    ErrorDTO:
      title: ' '
      description: ' '
      properties:
        mensagem:
          description: Mensagem de erro geral
          type: string
          example: Ocorreram erros de validação
        detalhes:
          description: Detalhes específicos do erro
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetailDTO'
          example:
            - campo: codigo
              mensagem: O campo código é obrigatório
          nullable: true
      type: object
    PedidoModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - $ref: '#/components/schemas/BasePedidoModel'
        - properties:
            situacao:
              description: |-

                - 8 - Dados Incompletos
                - 0 - Aberta
                - 3 - Aprovada
                - 4 - Preparando Envio
                - 1 - Faturada
                - 7 - Pronto Envio
                - 5 - Enviada
                - 6 - Entregue
                - 2 - Cancelada
                - 9 - Nao Entregue
              type: integer
              enum:
                - 8
                - 0
                - 3
                - 4
                - 1
                - 7
                - 5
                - 6
                - 2
                - 9
              nullable: true
              x-enumDescriptions:
                - 8 - Dados Incompletos
                - 0 - Aberta
                - 3 - Aprovada
                - 4 - Preparando Envio
                - 1 - Faturada
                - 7 - Pronto Envio
                - 5 - Enviada
                - 6 - Entregue
                - 2 - Cancelada
                - 9 - Nao Entregue
            data:
              type: string
              example: '2024-01-01'
              nullable: true
            dataEntrega:
              type: string
              example: '2024-01-01'
              nullable: true
            numeroOrdemCompra:
              type: string
              nullable: true
            valorDesconto:
              type: number
              format: float
              nullable: true
            valorFrete:
              type: number
              format: float
              nullable: true
            valorOutrasDespesas:
              type: number
              format: float
              nullable: true
          type: object
    ListaPrecoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
              nullable: true
          type: object
    NaturezaOperacaoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
              nullable: true
          type: object
    VendedorRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
          type: object
    EnderecoEntregaPedidoModelRequest:
      title: ' '
      description: ' '
      allOf:
        - $ref: '#/components/schemas/EnderecoEntregaPedidoModel'
        - properties: {}
          type: object
    ConsumidorFinalRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            cpfCnpj:
              type: string
              nullable: true
            clienteConsumidorFinal:
              type: boolean
          type: object
    EcommerceRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
              nullable: true
            numeroPedidoEcommerce:
              type: string
              nullable: true
          type: object
    TransportadorRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
              nullable: true
            fretePorConta:
              description: |-

                - R - Remetente
                - D - Destinatario
                - T - Terceiros
                - 3 - Proprio Remetente
                - 4 - Proprio Destinatario
                - S - Sem Transporte
              type: string
              enum:
                - R
                - D
                - T
                - '3'
                - '4'
                - S
              nullable: true
              x-enumDescriptions:
                - R - Remetente
                - D - Destinatario
                - T - Terceiros
                - 3 - Proprio Remetente
                - 4 - Proprio Destinatario
                - S - Sem Transporte
            formaEnvio:
              $ref: '#/components/schemas/FormaEnvioRequestModel'
            formaFrete:
              $ref: '#/components/schemas/FormaFreteRequestModel'
            codigoRastreamento:
              type: string
              nullable: true
            urlRastreamento:
              type: string
              nullable: true
          type: object
    IntermediadorRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
              nullable: true
          type: object
    DepositoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
          type: object
    PagamentoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            formaRecebimento:
              $ref: '#/components/schemas/FormaRecebimentoRequestModel'
            meioPagamento:
              $ref: '#/components/schemas/MeioPagamentoRequestModel'
            parcelas:
              type: array
              items:
                $ref: '#/components/schemas/ParcelaModelRequest'
              nullable: true
          type: object
    ItemPedidoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            produto:
              $ref: '#/components/schemas/ProdutoRequestModel'
            quantidade:
              type: number
              format: float
              nullable: true
            valorUnitario:
              type: number
              format: float
              nullable: true
            infoAdicional:
              type: string
              nullable: true
          type: object
    PagamentoIntegradoModelRequest:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            valor:
              description: Valor do pagamento
              type: number
              format: float
              example: 10.5
              nullable: true
            tipoPagamento:
              description: Tipo de pagamento (código)
              type: integer
              example: 1
              nullable: true
            cnpjIntermediador:
              description: CNPJ do intermediador
              type: string
              example: '00000000000191'
              nullable: true
            codigoAutorizacao:
              description: Código de autorização da transação
              type: string
              example: '123456'
              nullable: true
            codigoBandeira:
              description: Código da bandeira da operadora de cartão
              type: integer
              example: 1
              nullable: true
          type: object
    ErrorDetailDTO:
      title: ' '
      description: ' '
      properties:
        campo:
          description: Campo que gerou o erro
          type: string
          example: codigo
        mensagem:
          description: Mensagem de erro específica do campo
          type: string
          example: O campo código é obrigatório
      type: object
    BasePedidoModel:
      title: ' '
      description: ' '
      properties:
        dataPrevista:
          type: string
          example: '2024-01-01'
          nullable: true
        dataEnvio:
          type: string
          example: '2024-01-01 00:00:00'
          nullable: true
        observacoes:
          type: string
          nullable: true
        observacoesInternas:
          type: string
          nullable: true
      type: object
    EnderecoEntregaPedidoModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            endereco:
              type: string
              nullable: true
            enderecoNro:
              type: string
              nullable: true
            complemento:
              type: string
              nullable: true
            bairro:
              type: string
              nullable: true
            municipio:
              type: string
              nullable: true
            cep:
              type: string
              nullable: true
            uf:
              type: string
              nullable: true
            fone:
              type: string
              nullable: true
            nomeDestinatario:
              type: string
              nullable: true
            cpfCnpj:
              type: string
              nullable: true
            tipoPessoa:
              description: |-

                - J - Juridica
                - F - Fisica
                - E - Estrangeiro
                - X - Estrangeiro No Brasil
              type: string
              enum:
                - J
                - F
                - E
                - X
              nullable: true
              x-enumDescriptions:
                - J - Juridica
                - F - Fisica
                - E - Estrangeiro
                - X - Estrangeiro No Brasil
            ie:
              type: string
              nullable: true
          type: object
    FormaEnvioRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
          type: object
    FormaFreteRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
          type: object
    FormaRecebimentoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
              nullable: true
          type: object
    MeioPagamentoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
              nullable: true
          type: object
    ParcelaModelRequest:
      title: ' '
      description: ' '
      type: object
      allOf:
        - $ref: '#/components/schemas/ParcelaModel'
        - properties:
            formaRecebimento:
              $ref: '#/components/schemas/FormaRecebimentoRequestModel'
            meioPagamento:
              $ref: '#/components/schemas/MeioPagamentoRequestModel'
          type: object
    ProdutoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
              nullable: false
            tipo:
              description: |-

                - P - Produto
                - S - Servico
              type: string
              enum:
                - P
                - S
              nullable: true
              x-enumDescriptions:
                - P - Produto
                - S - Servico
          type: object
    ParcelaModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            dias:
              type: integer
              nullable: true
            data:
              type: string
              example: '2024-01-01'
              nullable: true
            valor:
              type: number
              format: float
              nullable: true
            observacoes:
              type: string
              nullable: true
          type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: Bearer

````