openapi: 3.0.3 info: title: 'Documentação da API do Entregas Expressas' description: 'Esta documentação detalha os endpoints disponíveis na API do Entregas Expressas para integração do seu sistema com o Entregas Expressas da Dono do App.' version: 1.0.0 servers: - url: 'https://entregasexpressas.com.br' tags: - name: Pedidos description: "\nEndpoints para gerenciar pedidos de entrega." - name: 'Tipos de Veículos' description: "\nEndpoints para consultar os tipos de veículos e suas categorias disponíveis." - name: Usuários description: "\nEndpoints para gerenciar usuários (clientes) do sistema." - name: 'URLs de Webhook' description: "\nEndpoints para gerenciar as URLs de Webhook que receberão atualizações sobre os pedidos.\n\nAo cadastrar uma URL de Webhook, **todos os pedidos e todas as mudanças de status serão enviadas para a URL configurada**, enviando todos os detalhes do pedido no ato da alteração via requisição **POST**.\n\n### Cabeçalhos enviados\n\n| Cabeçalho | Valor |\n| --- | --- |\n| Content-Type | application/json |\n| Accept | application/json |\n| webhook-security | Código de segurança configurado (se definido) |\n\n### Status do Pedido (order_status)\n\n| Status | Descrição |\n| --- | --- |\n| `waiting` | Pedido com pagamento online aguardando pagamento (só acontece em pedidos com pagamento online) |\n| `scheduled` | Pedido agendado |\n| `preparing` | Pedido em preparo (só disponível se o status em preparo estiver ativo) |\n| `pending` | Pedido buscando entregador |\n| `accepted` | Pedido aceito por um entregador |\n| `arrived_pickup_location` | Entregador no local de coleta |\n| `collected` | Pedido coletado |\n| `delivered` | Pedido com todos os endereços entregues fazendo retorno ao local de coleta (só em pedidos com retorno) |\n| `completed` | Pedido finalizado com sucesso |\n| `cancelled` | Pedido cancelado |\n\n### Exemplo de payload recebido na sua URL\n\n```json\n{\n \"event\": \"ORDER_UPDATED\",\n \"order\": {\n \"id\": 1234,\n \"uuid\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"central_id\": null,\n \"external_id\": null,\n \"user_id\": 10,\n \"started_at\": \"2025-01-15 10:30:00\",\n \"pickup_location\": \"Rua Exemplo, 100 - Centro\",\n \"pickup_location_data\": {\n \"latitude\": -23.5505,\n \"longitude\": -46.6333,\n \"endereco\": \"Rua Exemplo, 100 - Centro\"\n },\n \"delivery_locations_data\": [\n {\n \"id\": \"abc123\",\n \"latitude\": -23.5605,\n \"longitude\": -46.6433,\n \"endereco\": \"Rua Destino, 200 - Bairro\",\n \"rua\": \"Rua Destino\",\n \"numero\": \"200\",\n \"bairro\": \"Bairro\",\n \"cidade\": \"Sao Paulo\",\n \"estado\": \"SP\",\n \"complemento\": \"Apto 101\",\n \"cep\": \"01001-000\",\n \"nome\": \"Joao Silva\",\n \"telefone\": \"(11) 99999-9999\",\n \"delivered\": false,\n \"delivered_date\": null,\n \"delivery_failed\": false,\n \"evidence\": {\n \"photo\": \"https://exemplo.com/foto.jpg\",\n \"signature\": null,\n \"document\": \"123.456.789-00\",\n \"name\": \"Joao Silva\"\n }\n }\n ],\n \"need_return_to_pickup_location\": false,\n \"need_delivery_proof\": false,\n \"distance\": 5.2,\n \"return_distance\": 0,\n \"total_value\": 15.50,\n \"pickup_delay_tax\": 0,\n \"repassado\": false,\n \"customer_observation\": \"Pedido via integração\",\n \"valor_pedidos\": 89.90,\n \"offline_payment_method_id\": null,\n \"pagamento_faturado\": false,\n \"payment_gateway\": \"carteira_digital\",\n \"gateway_method\": null,\n \"payment_code\": null,\n \"payment_base64\": null,\n \"payment_expiration_date\": null,\n \"payment_url\": null,\n \"payment_status\": \"paid\",\n \"order_status\": \"accepted\",\n \"type\": \"delivery\",\n \"status_observation\": null,\n \"category_id\": 1,\n \"vehicle_type_id\": 1,\n \"height\": null,\n \"length\": null,\n \"width\": null,\n \"weight\": null,\n \"created_at\": \"2025-01-15T10:30:00.000000Z\",\n \"updated_at\": \"2025-01-15T10:35:00.000000Z\",\n \"deleted_at\": null,\n \"accepted_at\": \"2025-01-15T10:35:00.000000Z\",\n \"arrived_pickup_location_at\": null,\n \"arrived_limit_date\": null,\n \"picked_up_at\": null,\n \"delivered_at_data\": null,\n \"finished_at\": null,\n \"collect_limit_date\": null,\n \"fatura_id\": null,\n \"status\": \"Aceito\",\n \"courier\": \"Carlos Entregador\",\n \"courier_data\": {\n \"id\": 5,\n \"name\": \"Carlos Entregador\",\n \"location\": {\n \"latitude\": -23.5510,\n \"longitude\": -46.6340\n }\n },\n \"category\": {\"id\": 1, \"name\": \"Alimentação\"},\n \"vehicle_type\": {\"id\": 1, \"name\": \"Moto\"},\n \"user\": {\n \"id\": 10,\n \"email\": \"restaurante@exemplo.com\",\n \"name\": \"Restaurante Exemplo\",\n \"external_id\": null\n },\n \"tracking_url\": \"https://entregasexpressas.com.br/tracking/a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n }\n}\n```" components: securitySchemes: default: type: http scheme: bearer description: 'Seu Bearer Token estará disponível no menu administrativo na aba Integrações.' security: - default: [] paths: /api/v1/orders/calcular: post: summary: 'Calcular Valor' operationId: calcularValor description: 'Antes de enviar o pedido, você pode verificar o valor enviando os dados do pedido e recebendo de volta a distância e valor final.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: preco: 9.09 distancia: 5.92 precoDescricao: 'R$ 9,09' distanciaDescricao: '5.92 km' properties: preco: type: number example: 9.09 distancia: type: number example: 5.92 precoDescricao: type: string example: 'R$ 9,09' distanciaDescricao: type: string example: '5.92 km' tags: - Pedidos requestBody: required: true content: application/json: schema: type: object properties: tipo_veiculo_id: type: integer description: 'ID do Tipo de Veículo.' example: 1 categoria_id: type: integer description: 'ID da Categoria.' example: 3 endereco_coleta: type: object description: 'O objeto endereço de coleta.' example: [] properties: endereco: type: string description: 'A descrição do endereço de coleta.' example: 'Rua teste, 123 - Teste, São Paulo - SP, 00000-000' latitude: type: number description: 'Latitude do endereço de coleta (obrigatório se não enviar endereço para geocodificação).' example: -23.570914 longitude: type: number description: 'Longitude do endereço de coleta (obrigatório se não enviar endereço para geocodificação).' example: -46.645079 nome: type: string description: 'Nome do responsável.' example: João telefone: type: string description: 'Telefone do responsável.' example: '(11) 99999-9923' required: - endereco enderecos_entrega: type: array description: 'Array de endereços de entrega, mínimo de 1.' example: - [] items: type: object properties: endereco: type: string description: 'A descrição do endereço de entrega.' example: 'Rua teste, 33 - Teste 2, São Paulo - SP, 00000-000' latitude: type: number description: 'Latitude do endereço de entrega.' example: -23.585292 longitude: type: number description: 'Longitude do endereço de entrega.' example: -46.655723 nome: type: string description: 'Nome do recebedor.' example: Maria telefone: type: string description: 'Telefone do recebedor.' example: '(11) 12131-9923' required: - endereco cliente_id: type: integer description: 'ID do Cliente (obrigatório se não for enviado o objeto do cliente).' example: 3 dimensoes_pacote: type: object description: 'Dimensões do Pacote (pode ser obrigatório em alguns tipos de veículo).' example: [] properties: peso: type: number description: 'Peso do Pacote.' example: 15.0 largura: type: number description: 'Largura do Pacote.' example: 15.0 altura: type: number description: 'Altura do Pacote.' example: 15.0 comprimento: type: number description: 'Comprimento do pacote.' example: 15.0 retorno_necessario: type: boolean description: 'Identifica se o entregador deverá retornar ao local de coleta após a última entrega.' example: true prova_entrega_necessaria: type: boolean description: 'Identifica se o entregador deverá coletar assinatura e documento em cada local de entrega.' example: false required: - tipo_veiculo_id - categoria_id - endereco_coleta - enderecos_entrega /api/v1/orders: get: summary: 'Listar Pedidos' operationId: listarPedidos description: 'Lista os pedidos paginados. Também é possível buscar pedidos específicos por `id` ou `external_id`.' parameters: - in: query name: page description: 'Número da página (padrão: 1).' example: 1 required: false schema: type: integer description: 'Número da página (padrão: 1).' example: 1 - in: query name: limit description: 'Itens por página (máx: 100, padrão: 50).' example: 50 required: false schema: type: integer description: 'Itens por página (máx: 100, padrão: 50).' example: 50 - in: query name: id description: 'Filtrar por ID do pedido.' example: null required: false schema: type: integer description: 'Filtrar por ID do pedido.' example: null - in: query name: external_id description: 'Filtrar por ID externo do pedido.' example: null required: false schema: type: string description: 'Filtrar por ID externo do pedido.' example: null responses: 200: description: '' content: application/json: schema: type: object example: current_page: 1 data: - id: 127 uuid: a1b2c3d4-e5f6-7890-abcd-ef1234567890 central_id: 1 external_id: AShb23 external_display_id: PED-127 user_id: 3 assigned_vehicle_types: null assigned_vehicle_types_date: null block_envio: false started_at: '2025-01-15 10:30:00' pickup_location: 'Rua teste, 123 - Teste, São Paulo - SP, 00000-000' pickup_location_data: endereco: 'Rua teste, 123 - Teste, São Paulo - SP, 00000-000' latitude: -23.570914 longitude: -46.645079 nome: João telefone: '(11) 99999-9923' external_id: '125' delivery_locations_data: - endereco: 'Rua teste, 33 - Teste 2, São Paulo - SP, 00000-000' latitude: -23.585292 longitude: -46.655723 nome: Maria telefone: '(11) 12131-9923' external_id: '1500' delivered: false evidence: null need_return_to_pickup_location: false need_delivery_proof: false distance: 5.92 return_distance: 0 total_value: 9.09 pickup_delay_tax: 0 repassado: 0 customer_observation: null valor_pedidos: null offline_payment_method_id: null pagamento_faturado: false origem_pedido: integracao payment_gateway: null gateway_method: null payment_code: null payment_base64: null payment_expiration_date: null payment_url: null payment_status: null order_status: accepted type: delivery status_observation: null category_id: 3 vehicle_type_id: 1 height: 15 length: 15 width: 15 weight: 15 created_at: '2025-01-15T10:30:00.000000Z' updated_at: '2025-01-15T10:35:00.000000Z' deleted_at: null integracao_ids: null integracao_referencia_id: null integracao_order_status: null integracao_order_data: null order_import_detail_id: null accepted_at: '2025-01-15T10:35:00.000000Z' arrived_pickup_location_at: null arrived_limit_date: null picked_up_at: null delivered_at_data: null finished_at: null collect_limit_date: null fatura_id: null status: Aceito courier: 'Entregador João' courier_data: id: 17 name: 'Entregador João' location: latitude: -23.565012824804 longitude: -46.652052565889 category: id: 3 name: Documentos vehicle_type: id: 1 name: Moto user: id: 3 name: cliente email: cliente@entregasexpressas.com external_id: null tracking_url: 'https://entregasexpressas.com.br/tracking/a1b2c3d4-e5f6-7890-abcd-ef1234567890' first_page_url: 'https://entregasexpressas.com.br/api/v1/orders?page=1' from: 1 last_page: 77 last_page_url: 'https://entregasexpressas.com.br/api/v1/orders?page=77' limit: 50 next_page_url: 'https://entregasexpressas.com.br/api/v1/orders?page=2' path: 'https://entregasexpressas.com.br/api/v1/orders' prev_page_url: null to: 50 total: 3814 properties: current_page: type: integer example: 1 data: type: array example: - id: 127 uuid: a1b2c3d4-e5f6-7890-abcd-ef1234567890 central_id: 1 external_id: AShb23 external_display_id: PED-127 user_id: 3 assigned_vehicle_types: null assigned_vehicle_types_date: null block_envio: false started_at: '2025-01-15 10:30:00' pickup_location: 'Rua teste, 123 - Teste, São Paulo - SP, 00000-000' pickup_location_data: endereco: 'Rua teste, 123 - Teste, São Paulo - SP, 00000-000' latitude: -23.570914 longitude: -46.645079 nome: João telefone: '(11) 99999-9923' external_id: '125' delivery_locations_data: - endereco: 'Rua teste, 33 - Teste 2, São Paulo - SP, 00000-000' latitude: -23.585292 longitude: -46.655723 nome: Maria telefone: '(11) 12131-9923' external_id: '1500' delivered: false evidence: null need_return_to_pickup_location: false need_delivery_proof: false distance: 5.92 return_distance: 0 total_value: 9.09 pickup_delay_tax: 0 repassado: 0 customer_observation: null valor_pedidos: null offline_payment_method_id: null pagamento_faturado: false origem_pedido: integracao payment_gateway: null gateway_method: null payment_code: null payment_base64: null payment_expiration_date: null payment_url: null payment_status: null order_status: accepted type: delivery status_observation: null category_id: 3 vehicle_type_id: 1 height: 15 length: 15 width: 15 weight: 15 created_at: '2025-01-15T10:30:00.000000Z' updated_at: '2025-01-15T10:35:00.000000Z' deleted_at: null integracao_ids: null integracao_referencia_id: null integracao_order_status: null integracao_order_data: null order_import_detail_id: null accepted_at: '2025-01-15T10:35:00.000000Z' arrived_pickup_location_at: null arrived_limit_date: null picked_up_at: null delivered_at_data: null finished_at: null collect_limit_date: null fatura_id: null status: Aceito courier: 'Entregador João' courier_data: id: 17 name: 'Entregador João' location: latitude: -23.565012824804 longitude: -46.652052565889 category: id: 3 name: Documentos vehicle_type: id: 1 name: Moto user: id: 3 name: cliente email: cliente@entregasexpressas.com external_id: null tracking_url: 'https://entregasexpressas.com.br/tracking/a1b2c3d4-e5f6-7890-abcd-ef1234567890' items: type: object properties: id: type: integer example: 127 uuid: type: string example: a1b2c3d4-e5f6-7890-abcd-ef1234567890 central_id: type: integer example: 1 external_id: type: string example: AShb23 external_display_id: type: string example: PED-127 user_id: type: integer example: 3 assigned_vehicle_types: type: string example: null nullable: true assigned_vehicle_types_date: type: string example: null nullable: true block_envio: type: boolean example: false started_at: type: string example: '2025-01-15 10:30:00' pickup_location: type: string example: 'Rua teste, 123 - Teste, São Paulo - SP, 00000-000' pickup_location_data: type: object properties: endereco: type: string example: 'Rua teste, 123 - Teste, São Paulo - SP, 00000-000' latitude: type: number example: -23.570914 longitude: type: number example: -46.645079 nome: type: string example: João telefone: type: string example: '(11) 99999-9923' external_id: type: string example: '125' delivery_locations_data: type: array example: - endereco: 'Rua teste, 33 - Teste 2, São Paulo - SP, 00000-000' latitude: -23.585292 longitude: -46.655723 nome: Maria telefone: '(11) 12131-9923' external_id: '1500' delivered: false evidence: null items: type: object properties: endereco: type: string example: 'Rua teste, 33 - Teste 2, São Paulo - SP, 00000-000' latitude: type: number example: -23.585292 longitude: type: number example: -46.655723 nome: type: string example: Maria telefone: type: string example: '(11) 12131-9923' external_id: type: string example: '1500' delivered: type: boolean example: false evidence: type: string example: null nullable: true need_return_to_pickup_location: type: boolean example: false need_delivery_proof: type: boolean example: false distance: type: number example: 5.92 return_distance: type: integer example: 0 total_value: type: number example: 9.09 pickup_delay_tax: type: integer example: 0 repassado: type: integer example: 0 customer_observation: type: string example: null nullable: true valor_pedidos: type: string example: null nullable: true offline_payment_method_id: type: string example: null nullable: true pagamento_faturado: type: boolean example: false origem_pedido: type: string example: integracao payment_gateway: type: string example: null nullable: true gateway_method: type: string example: null nullable: true payment_code: type: string example: null nullable: true payment_base64: type: string example: null nullable: true payment_expiration_date: type: string example: null nullable: true payment_url: type: string example: null nullable: true payment_status: type: string example: null nullable: true order_status: type: string example: accepted type: type: string example: delivery status_observation: type: string example: null nullable: true category_id: type: integer example: 3 vehicle_type_id: type: integer example: 1 height: type: integer example: 15 length: type: integer example: 15 width: type: integer example: 15 weight: type: integer example: 15 created_at: type: string example: '2025-01-15T10:30:00.000000Z' updated_at: type: string example: '2025-01-15T10:35:00.000000Z' deleted_at: type: string example: null nullable: true integracao_ids: type: string example: null nullable: true integracao_referencia_id: type: string example: null nullable: true integracao_order_status: type: string example: null nullable: true integracao_order_data: type: string example: null nullable: true order_import_detail_id: type: string example: null nullable: true accepted_at: type: string example: '2025-01-15T10:35:00.000000Z' arrived_pickup_location_at: type: string example: null nullable: true arrived_limit_date: type: string example: null nullable: true picked_up_at: type: string example: null nullable: true delivered_at_data: type: string example: null nullable: true finished_at: type: string example: null nullable: true collect_limit_date: type: string example: null nullable: true fatura_id: type: string example: null nullable: true status: type: string example: Aceito courier: type: string example: 'Entregador João' courier_data: type: object properties: id: type: integer example: 17 name: type: string example: 'Entregador João' location: type: object properties: latitude: type: number example: -23.565012824804 longitude: type: number example: -46.652052565889 category: type: object properties: id: type: integer example: 3 name: type: string example: Documentos vehicle_type: type: object properties: id: type: integer example: 1 name: type: string example: Moto user: type: object properties: id: type: integer example: 3 name: type: string example: cliente email: type: string example: cliente@entregasexpressas.com external_id: type: string example: null nullable: true tracking_url: type: string example: 'https://entregasexpressas.com.br/tracking/a1b2c3d4-e5f6-7890-abcd-ef1234567890' first_page_url: type: string example: 'https://entregasexpressas.com.br/api/v1/orders?page=1' from: type: integer example: 1 last_page: type: integer example: 77 last_page_url: type: string example: 'https://entregasexpressas.com.br/api/v1/orders?page=77' limit: type: integer example: 50 next_page_url: type: string example: 'https://entregasexpressas.com.br/api/v1/orders?page=2' path: type: string example: 'https://entregasexpressas.com.br/api/v1/orders' prev_page_url: type: string example: null nullable: true to: type: integer example: 50 total: type: integer example: 3814 tags: - Pedidos post: summary: 'Novo Pedido' operationId: novoPedido description: 'Cria um novo pedido de entrega. Os endereços de coleta e entrega devem conter latitude e longitude, ou o endereço textual para geocodificação automática.' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: id: 127 uuid: a1b2c3d4-e5f6-7890-abcd-ef1234567890 central_id: 1 external_id: AShb23 external_display_id: PED-127 user_id: 3 assigned_vehicle_types: null assigned_vehicle_types_date: null block_envio: false started_at: '2025-01-15 10:30:00' pickup_location: 'Rua teste, 123 - Teste, São Paulo - SP, 00000-000' pickup_location_data: endereco: 'Rua teste, 123 - Teste, São Paulo - SP, 00000-000' latitude: -23.570914 longitude: -46.645079 nome: João telefone: '(11) 99999-9923' external_id: '125' delivery_locations_data: - endereco: 'Rua teste, 33 - Teste 2, São Paulo - SP, 00000-000' latitude: -23.585292 longitude: -46.655723 nome: Maria telefone: '(11) 12131-9923' external_id: '1500' delivered: false evidence: null need_return_to_pickup_location: false need_delivery_proof: false distance: 5.92 return_distance: 0 total_value: 9.09 pickup_delay_tax: 0 repassado: 0 customer_observation: null valor_pedidos: null offline_payment_method_id: null pagamento_faturado: false origem_pedido: integracao payment_gateway: null gateway_method: null payment_code: null payment_base64: null payment_expiration_date: null payment_url: null payment_status: null order_status: accepted type: delivery status_observation: null category_id: 3 vehicle_type_id: 1 height: 15 length: 15 width: 15 weight: 15 created_at: '2025-01-15T10:30:00.000000Z' updated_at: '2025-01-15T10:35:00.000000Z' deleted_at: null integracao_ids: null integracao_referencia_id: null integracao_order_status: null integracao_order_data: null order_import_detail_id: null accepted_at: '2025-01-15T10:35:00.000000Z' arrived_pickup_location_at: null arrived_limit_date: null picked_up_at: null delivered_at_data: null finished_at: null collect_limit_date: null fatura_id: null status: Aceito courier: 'Entregador João' courier_data: id: 17 name: 'Entregador João' location: latitude: -23.565012824804 longitude: -46.652052565889 category: id: 3 name: Documentos vehicle_type: id: 1 name: Moto user: id: 3 name: cliente email: cliente@entregasexpressas.com external_id: null tracking_url: 'https://entregasexpressas.com.br/tracking/a1b2c3d4-e5f6-7890-abcd-ef1234567890' properties: id: type: integer example: 127 uuid: type: string example: a1b2c3d4-e5f6-7890-abcd-ef1234567890 central_id: type: integer example: 1 external_id: type: string example: AShb23 external_display_id: type: string example: PED-127 user_id: type: integer example: 3 assigned_vehicle_types: type: string example: null nullable: true assigned_vehicle_types_date: type: string example: null nullable: true block_envio: type: boolean example: false started_at: type: string example: '2025-01-15 10:30:00' pickup_location: type: string example: 'Rua teste, 123 - Teste, São Paulo - SP, 00000-000' pickup_location_data: type: object properties: endereco: type: string example: 'Rua teste, 123 - Teste, São Paulo - SP, 00000-000' latitude: type: number example: -23.570914 longitude: type: number example: -46.645079 nome: type: string example: João telefone: type: string example: '(11) 99999-9923' external_id: type: string example: '125' delivery_locations_data: type: array example: - endereco: 'Rua teste, 33 - Teste 2, São Paulo - SP, 00000-000' latitude: -23.585292 longitude: -46.655723 nome: Maria telefone: '(11) 12131-9923' external_id: '1500' delivered: false evidence: null items: type: object properties: endereco: type: string example: 'Rua teste, 33 - Teste 2, São Paulo - SP, 00000-000' latitude: type: number example: -23.585292 longitude: type: number example: -46.655723 nome: type: string example: Maria telefone: type: string example: '(11) 12131-9923' external_id: type: string example: '1500' delivered: type: boolean example: false evidence: type: string example: null nullable: true need_return_to_pickup_location: type: boolean example: false need_delivery_proof: type: boolean example: false distance: type: number example: 5.92 return_distance: type: integer example: 0 total_value: type: number example: 9.09 pickup_delay_tax: type: integer example: 0 repassado: type: integer example: 0 customer_observation: type: string example: null nullable: true valor_pedidos: type: string example: null nullable: true offline_payment_method_id: type: string example: null nullable: true pagamento_faturado: type: boolean example: false origem_pedido: type: string example: integracao payment_gateway: type: string example: null nullable: true gateway_method: type: string example: null nullable: true payment_code: type: string example: null nullable: true payment_base64: type: string example: null nullable: true payment_expiration_date: type: string example: null nullable: true payment_url: type: string example: null nullable: true payment_status: type: string example: null nullable: true order_status: type: string example: accepted type: type: string example: delivery status_observation: type: string example: null nullable: true category_id: type: integer example: 3 vehicle_type_id: type: integer example: 1 height: type: integer example: 15 length: type: integer example: 15 width: type: integer example: 15 weight: type: integer example: 15 created_at: type: string example: '2025-01-15T10:30:00.000000Z' updated_at: type: string example: '2025-01-15T10:35:00.000000Z' deleted_at: type: string example: null nullable: true integracao_ids: type: string example: null nullable: true integracao_referencia_id: type: string example: null nullable: true integracao_order_status: type: string example: null nullable: true integracao_order_data: type: string example: null nullable: true order_import_detail_id: type: string example: null nullable: true accepted_at: type: string example: '2025-01-15T10:35:00.000000Z' arrived_pickup_location_at: type: string example: null nullable: true arrived_limit_date: type: string example: null nullable: true picked_up_at: type: string example: null nullable: true delivered_at_data: type: string example: null nullable: true finished_at: type: string example: null nullable: true collect_limit_date: type: string example: null nullable: true fatura_id: type: string example: null nullable: true status: type: string example: Aceito courier: type: string example: 'Entregador João' courier_data: type: object properties: id: type: integer example: 17 name: type: string example: 'Entregador João' location: type: object properties: latitude: type: number example: -23.565012824804 longitude: type: number example: -46.652052565889 category: type: object properties: id: type: integer example: 3 name: type: string example: Documentos vehicle_type: type: object properties: id: type: integer example: 1 name: type: string example: Moto user: type: object properties: id: type: integer example: 3 name: type: string example: cliente email: type: string example: cliente@entregasexpressas.com external_id: type: string example: null nullable: true tracking_url: type: string example: 'https://entregasexpressas.com.br/tracking/a1b2c3d4-e5f6-7890-abcd-ef1234567890' tags: - Pedidos requestBody: required: true content: application/json: schema: type: object properties: tipo_veiculo_id: type: integer description: 'ID do Tipo de Veículo.' example: 1 categoria_id: type: integer description: 'ID da Categoria.' example: 3 endereco_coleta: type: object description: 'O objeto endereço de coleta.' example: [] properties: endereco: type: string description: 'A descrição do endereço de coleta.' example: 'Rua teste, 123 - Teste, São Paulo - SP, 00000-000' latitude: type: number description: 'Latitude do endereço de coleta.' example: -23.570914 longitude: type: number description: 'Longitude do endereço de coleta.' example: -46.645079 nome: type: string description: 'Nome do responsável.' example: João telefone: type: string description: 'Telefone do responsável.' example: '(11) 99999-9923' external_id: type: string description: 'ID Externo do endereço.' example: '1552' required: - endereco enderecos_entrega: type: array description: 'Array de endereços de entrega, mínimo de 1.' example: - [] items: type: object properties: endereco: type: string description: 'A descrição do endereço de entrega.' example: 'Rua teste, 33 - Teste 2, São Paulo - SP, 00000-000' latitude: type: number description: 'Latitude do endereço de entrega.' example: -23.585292 longitude: type: number description: 'Longitude do endereço de entrega.' example: -46.655723 nome: type: string description: 'Nome do recebedor.' example: Maria telefone: type: string description: 'Telefone do recebedor.' example: '(11) 12131-9923' external_id: type: string description: 'ID Externo do endereço de entrega.' example: '123' required: - endereco cliente_id: type: integer description: 'ID do Cliente (obrigatório se não for enviado o objeto do cliente).' example: 3 cliente: type: object description: 'Objeto do Cliente (obrigatório se não for enviado o cliente_id).' example: [] properties: nome: type: string description: 'Nome do cliente.' example: 'João Silva' email: type: string description: 'Email do cliente.' example: joao@exemplo.com telefone: type: string description: 'Telefone do cliente.' example: '(11) 99999-9923' senha: type: string description: 'Senha do cliente.' example: senha123 required: - nome - email - telefone - senha external_id: type: string description: 'ID Externo do pedido para referência no seu sistema.' example: 'AS@&ahb23' dimensoes_pacote: type: object description: 'Dimensões do Pacote (pode ser obrigatório em alguns tipos de veículo).' example: [] properties: peso: type: number description: 'Peso do Pacote.' example: 15.0 largura: type: number description: 'Largura do Pacote.' example: 15.0 altura: type: number description: 'Altura do Pacote.' example: 15.0 comprimento: type: number description: 'Comprimento do pacote.' example: 15.0 retorno_necessario: type: boolean description: 'Identifica se o entregador deverá retornar ao local de coleta após a última entrega.' example: true prova_entrega_necessaria: type: boolean description: 'Identifica se o entregador deverá coletar assinatura e documento em cada local de entrega.' example: false observacao: type: string description: 'Observação do Pedido.' example: null metodo_pagamento: type: string description: 'Método de Pagamento. Opções: `faturado`, `carteira`. Se não informado, será `faturado`.' example: faturado agendamento_segundos: type: integer description: 'Quantidade de segundos a partir de agora para agendar o pedido.' example: null required: - tipo_veiculo_id - categoria_id - endereco_coleta - enderecos_entrega '/api/v1/orders/{order}': get: summary: 'Obter Pedido' operationId: obterPedido description: 'Busque os dados de um pedido específico pelo seu ID.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: id: 127 uuid: a1b2c3d4-e5f6-7890-abcd-ef1234567890 central_id: 1 external_id: AShb23 external_display_id: PED-127 user_id: 3 assigned_vehicle_types: null assigned_vehicle_types_date: null block_envio: false started_at: '2025-01-15 10:30:00' pickup_location: 'Rua teste, 123 - Teste, São Paulo - SP, 00000-000' pickup_location_data: endereco: 'Rua teste, 123 - Teste, São Paulo - SP, 00000-000' latitude: -23.570914 longitude: -46.645079 nome: João telefone: '(11) 99999-9923' external_id: '125' delivery_locations_data: - endereco: 'Rua teste, 33 - Teste 2, São Paulo - SP, 00000-000' latitude: -23.585292 longitude: -46.655723 nome: Maria telefone: '(11) 12131-9923' external_id: '1500' delivered: false evidence: null need_return_to_pickup_location: false need_delivery_proof: false distance: 5.92 return_distance: 0 total_value: 9.09 pickup_delay_tax: 0 repassado: 0 customer_observation: null valor_pedidos: null offline_payment_method_id: null pagamento_faturado: false origem_pedido: integracao payment_gateway: null gateway_method: null payment_code: null payment_base64: null payment_expiration_date: null payment_url: null payment_status: null order_status: accepted type: delivery status_observation: null category_id: 3 vehicle_type_id: 1 height: 15 length: 15 width: 15 weight: 15 created_at: '2025-01-15T10:30:00.000000Z' updated_at: '2025-01-15T10:35:00.000000Z' deleted_at: null integracao_ids: null integracao_referencia_id: null integracao_order_status: null integracao_order_data: null order_import_detail_id: null accepted_at: '2025-01-15T10:35:00.000000Z' arrived_pickup_location_at: null arrived_limit_date: null picked_up_at: null delivered_at_data: null finished_at: null collect_limit_date: null fatura_id: null status: Aceito courier: 'Entregador João' courier_data: id: 17 name: 'Entregador João' location: latitude: -23.565012824804 longitude: -46.652052565889 category: id: 3 name: Documentos vehicle_type: id: 1 name: Moto user: id: 3 name: cliente email: cliente@entregasexpressas.com external_id: null tracking_url: 'https://entregasexpressas.com.br/tracking/a1b2c3d4-e5f6-7890-abcd-ef1234567890' properties: id: type: integer example: 127 uuid: type: string example: a1b2c3d4-e5f6-7890-abcd-ef1234567890 central_id: type: integer example: 1 external_id: type: string example: AShb23 external_display_id: type: string example: PED-127 user_id: type: integer example: 3 assigned_vehicle_types: type: string example: null nullable: true assigned_vehicle_types_date: type: string example: null nullable: true block_envio: type: boolean example: false started_at: type: string example: '2025-01-15 10:30:00' pickup_location: type: string example: 'Rua teste, 123 - Teste, São Paulo - SP, 00000-000' pickup_location_data: type: object properties: endereco: type: string example: 'Rua teste, 123 - Teste, São Paulo - SP, 00000-000' latitude: type: number example: -23.570914 longitude: type: number example: -46.645079 nome: type: string example: João telefone: type: string example: '(11) 99999-9923' external_id: type: string example: '125' delivery_locations_data: type: array example: - endereco: 'Rua teste, 33 - Teste 2, São Paulo - SP, 00000-000' latitude: -23.585292 longitude: -46.655723 nome: Maria telefone: '(11) 12131-9923' external_id: '1500' delivered: false evidence: null items: type: object properties: endereco: type: string example: 'Rua teste, 33 - Teste 2, São Paulo - SP, 00000-000' latitude: type: number example: -23.585292 longitude: type: number example: -46.655723 nome: type: string example: Maria telefone: type: string example: '(11) 12131-9923' external_id: type: string example: '1500' delivered: type: boolean example: false evidence: type: string example: null nullable: true need_return_to_pickup_location: type: boolean example: false need_delivery_proof: type: boolean example: false distance: type: number example: 5.92 return_distance: type: integer example: 0 total_value: type: number example: 9.09 pickup_delay_tax: type: integer example: 0 repassado: type: integer example: 0 customer_observation: type: string example: null nullable: true valor_pedidos: type: string example: null nullable: true offline_payment_method_id: type: string example: null nullable: true pagamento_faturado: type: boolean example: false origem_pedido: type: string example: integracao payment_gateway: type: string example: null nullable: true gateway_method: type: string example: null nullable: true payment_code: type: string example: null nullable: true payment_base64: type: string example: null nullable: true payment_expiration_date: type: string example: null nullable: true payment_url: type: string example: null nullable: true payment_status: type: string example: null nullable: true order_status: type: string example: accepted type: type: string example: delivery status_observation: type: string example: null nullable: true category_id: type: integer example: 3 vehicle_type_id: type: integer example: 1 height: type: integer example: 15 length: type: integer example: 15 width: type: integer example: 15 weight: type: integer example: 15 created_at: type: string example: '2025-01-15T10:30:00.000000Z' updated_at: type: string example: '2025-01-15T10:35:00.000000Z' deleted_at: type: string example: null nullable: true integracao_ids: type: string example: null nullable: true integracao_referencia_id: type: string example: null nullable: true integracao_order_status: type: string example: null nullable: true integracao_order_data: type: string example: null nullable: true order_import_detail_id: type: string example: null nullable: true accepted_at: type: string example: '2025-01-15T10:35:00.000000Z' arrived_pickup_location_at: type: string example: null nullable: true arrived_limit_date: type: string example: null nullable: true picked_up_at: type: string example: null nullable: true delivered_at_data: type: string example: null nullable: true finished_at: type: string example: null nullable: true collect_limit_date: type: string example: null nullable: true fatura_id: type: string example: null nullable: true status: type: string example: Aceito courier: type: string example: 'Entregador João' courier_data: type: object properties: id: type: integer example: 17 name: type: string example: 'Entregador João' location: type: object properties: latitude: type: number example: -23.565012824804 longitude: type: number example: -46.652052565889 category: type: object properties: id: type: integer example: 3 name: type: string example: Documentos vehicle_type: type: object properties: id: type: integer example: 1 name: type: string example: Moto user: type: object properties: id: type: integer example: 3 name: type: string example: cliente email: type: string example: cliente@entregasexpressas.com external_id: type: string example: null nullable: true tracking_url: type: string example: 'https://entregasexpressas.com.br/tracking/a1b2c3d4-e5f6-7890-abcd-ef1234567890' 404: description: '' content: application/json: schema: type: object example: mensagem: 'Pedido não encontrado' properties: mensagem: type: string example: 'Pedido não encontrado' tags: - Pedidos delete: summary: 'Cancelar Pedido' operationId: cancelarPedido description: 'Cancele um pedido. Disponível **apenas para pedidos que ainda não foram aceitos** (status: `pending`, `waiting`, `scheduled` ou `preparing`).' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: mensagem: 'Pedido cancelado' properties: mensagem: type: string example: 'Pedido cancelado' 400: description: '' content: application/json: schema: type: object example: mensagem: 'O pedido não pode ser cancelado pois já foi aceito' properties: mensagem: type: string example: 'O pedido não pode ser cancelado pois já foi aceito' 404: description: '' content: application/json: schema: type: object example: mensagem: 'Pedido não encontrado' properties: mensagem: type: string example: 'Pedido não encontrado' tags: - Pedidos parameters: - in: path name: order description: 'ID do Pedido.' example: 127 required: true schema: type: integer '/api/v1/tipos-veiculos/{id}/categorias': get: summary: 'Listar Categorias do Tipo de Veículo' operationId: listarCategoriasDoTipoDeVeculo description: 'Lista as categorias de um Tipo de Veículo, sendo possível filtrar pelo nome enviando o texto de busca no parâmetro `nome`.' parameters: - in: query name: nome description: 'Filtrar pelo nome da categoria.' example: null required: false schema: type: string description: 'Filtrar pelo nome da categoria.' example: null responses: 200: description: '' content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 nome: type: string example: Alimentos has_media: type: boolean example: false media: type: array example: [] example: - id: 1 nome: Alimentos has_media: false media: [] - id: 2 nome: Documentos has_media: false media: [] - id: 3 nome: Eletrônicos has_media: true media: [] 404: description: '' content: application/json: schema: type: object example: message: 'Tipo de veículo não encontrado' properties: message: type: string example: 'Tipo de veículo não encontrado' tags: - 'Tipos de Veículos' parameters: - in: path name: id description: 'ID do Tipo de Veículo.' example: 1 required: true schema: type: integer /api/v1/tipos-veiculos: get: summary: 'Listar Tipos de Veículos' operationId: listarTiposDeVeculos description: 'Lista os Tipos de Veículos disponíveis, sendo possível filtrar pelo nome enviando o texto de busca no parâmetro `nome`.' parameters: - in: query name: nome description: 'Filtrar pelo nome do tipo de veículo.' example: null required: false schema: type: string description: 'Filtrar pelo nome do tipo de veículo.' example: null responses: 200: description: '' content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 nome: type: string example: Moto peso_e_dimensoes: type: boolean example: true limitar_peso_e_dimensoes: type: boolean example: true altura_maxima: type: integer example: 50 largura_maxima: type: integer example: 50 comprimento_maximo: type: integer example: 50 peso_maximo: type: integer example: 30 has_media: type: boolean example: true media: type: array example: [] example: - id: 1 nome: Moto peso_e_dimensoes: true limitar_peso_e_dimensoes: true altura_maxima: 50 largura_maxima: 50 comprimento_maximo: 50 peso_maximo: 30 has_media: true media: [] - id: 2 nome: Carro peso_e_dimensoes: false limitar_peso_e_dimensoes: false altura_maxima: null largura_maxima: null comprimento_maximo: null peso_maximo: null has_media: true media: [] tags: - 'Tipos de Veículos' /api/v1/usuarios: get: summary: 'Buscar Usuários' operationId: buscarUsurios description: 'Busque cadastros de usuários através do email ou id externo. Se nenhum filtro for informado, retorna todos os usuários.' parameters: - in: query name: email description: 'Filtrar por e-mail do usuário.' example: cliente@entregasexpressas.com required: false schema: type: string description: 'Filtrar por e-mail do usuário.' example: cliente@entregasexpressas.com - in: query name: external_id description: 'Filtrar por ID externo do usuário.' example: null required: false schema: type: string description: 'Filtrar por ID externo do usuário.' example: null responses: 200: description: '' content: application/json: schema: type: object example: data: - id: 3 nome: cliente email: cliente@entregasexpressas.com telefone: '(11) 99999-9923' external_id: '12516' faturamento: true saldo: 0 has_media: false media: [] data_criacao: '2024-01-15 10:30:00' properties: data: type: array example: - id: 3 nome: cliente email: cliente@entregasexpressas.com telefone: '(11) 99999-9923' external_id: '12516' faturamento: true saldo: 0 has_media: false media: [] data_criacao: '2024-01-15 10:30:00' items: type: object properties: id: type: integer example: 3 nome: type: string example: cliente email: type: string example: cliente@entregasexpressas.com telefone: type: string example: '(11) 99999-9923' external_id: type: string example: '12516' faturamento: type: boolean example: true saldo: type: integer example: 0 has_media: type: boolean example: false media: type: array example: [] data_criacao: type: string example: '2024-01-15 10:30:00' tags: - Usuários requestBody: required: false content: application/json: schema: type: object properties: email: type: string description: 'O campo value deve ser um endereço de e-mail válido.' example: gbailey@example.net post: summary: 'Cadastrar Usuário' operationId: cadastrarUsurio description: 'Cadastra um novo usuário (cliente) no sistema.' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: data: id: 3 nome: cliente email: cliente@entregasexpressas.com telefone: '(11) 99999-9923' external_id: '12516' faturamento: true saldo: 0 has_media: false media: [] data_criacao: '2024-01-15 10:30:00' properties: data: type: object properties: id: type: integer example: 3 nome: type: string example: cliente email: type: string example: cliente@entregasexpressas.com telefone: type: string example: '(11) 99999-9923' external_id: type: string example: '12516' faturamento: type: boolean example: true saldo: type: integer example: 0 has_media: type: boolean example: false media: type: array example: [] data_criacao: type: string example: '2024-01-15 10:30:00' 400: description: '' content: application/json: schema: type: object example: mensagem: 'Erro de validação' errors: email: - 'O email informado está em uso' properties: mensagem: type: string example: 'Erro de validação' errors: type: object properties: email: type: array example: - 'O email informado está em uso' items: type: string tags: - Usuários requestBody: required: true content: application/json: schema: type: object properties: nome: type: string description: 'Nome do usuário.' example: 'Novo Usuário' email: type: string description: 'Email do usuário.' example: novousuario@entregasexpressas.com senha: type: string description: 'Senha do usuário (mínimo de 6 caracteres).' example: 0346nlkasd telefone: type: string description: 'Telefone do usuário.' example: '(11) 12532-1234' external_id: type: string description: 'ID Externo do usuário no seu sistema.' example: '12516' nullable: true required: - nome - email - senha - telefone '/api/v1/usuarios/{id}': put: summary: 'Editar Usuário' operationId: editarUsurio description: 'Atualiza os dados de um usuário existente. Apenas os campos enviados serão atualizados.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: data: id: 3 nome: cliente email: cliente@entregasexpressas.com telefone: '(11) 99999-9923' external_id: '12516' faturamento: true saldo: 0 has_media: false media: [] data_criacao: '2024-01-15 10:30:00' properties: data: type: object properties: id: type: integer example: 3 nome: type: string example: cliente email: type: string example: cliente@entregasexpressas.com telefone: type: string example: '(11) 99999-9923' external_id: type: string example: '12516' faturamento: type: boolean example: true saldo: type: integer example: 0 has_media: type: boolean example: false media: type: array example: [] data_criacao: type: string example: '2024-01-15 10:30:00' 404: description: '' content: application/json: schema: type: object example: mensagem: 'Usuário não encontrado' properties: mensagem: type: string example: 'Usuário não encontrado' tags: - Usuários requestBody: required: false content: application/json: schema: type: object properties: nome: type: string description: 'Nome do usuário.' example: 'Novo Nome' nullable: true telefone: type: string description: 'Telefone do usuário.' example: '(11) 99999-8888' nullable: true external_id: type: string description: 'ID Externo do usuário.' example: '11111' nullable: true senha: type: string description: 'Nova senha do usuário (mínimo de 6 caracteres).' example: NovaSenha123 nullable: true parameters: - in: path name: id description: 'The ID of the usuario.' example: architecto required: true schema: type: string - in: path name: usuario description: 'ID do Usuário.' example: 3 required: true schema: type: integer /api/v1/webhooks: get: summary: 'Listar Webhooks' operationId: listarWebhooks description: 'Lista todas as URLs de Webhook cadastradas.' parameters: [] responses: 200: description: '' content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 url: type: string example: 'https://meusite.com/webhook' codigo_seguranca: type: string example: 'Aas#asdg@fngasd' example: - id: 1 url: 'https://meusite.com/webhook' codigo_seguranca: 'Aas#asdg@fngasd' - id: 2 url: 'https://meusite.com/webhook2' codigo_seguranca: null tags: - 'URLs de Webhook' post: summary: 'Cadastrar Webhook' operationId: cadastrarWebhook description: 'Cadastra uma nova URL de Webhook para receber atualizações de pedidos.' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: id: 1 url: 'https://meusite.com/webhook' codigo_seguranca: 'Aas#asdg@fngasd' properties: id: type: integer example: 1 url: type: string example: 'https://meusite.com/webhook' codigo_seguranca: type: string example: 'Aas#asdg@fngasd' 400: description: '' content: application/json: schema: type: object example: mensagem: 'Erro de validação' errors: url: - 'Uma URL de webhook com este endereço já existe' properties: mensagem: type: string example: 'Erro de validação' errors: type: object properties: url: type: array example: - 'Uma URL de webhook com este endereço já existe' items: type: string tags: - 'URLs de Webhook' requestBody: required: true content: application/json: schema: type: object properties: url: type: string description: 'URL de Webhook.' example: 'https://entregas-expressas.teste' codigo_seguranca: type: string description: 'Código de Segurança que será enviado junto com as notificações para validação.' example: 'Aas#asdg@fngasd' nullable: true required: - url '/api/v1/webhooks/{id}': get: summary: 'Obter Webhook' operationId: obterWebhook description: 'Busque os dados de uma URL de Webhook específica.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: id: 1 url: 'https://meusite.com/webhook' codigo_seguranca: 'Aas#asdg@fngasd' properties: id: type: integer example: 1 url: type: string example: 'https://meusite.com/webhook' codigo_seguranca: type: string example: 'Aas#asdg@fngasd' 404: description: '' content: application/json: schema: type: object example: mensagem: 'Webhook não encontrado' properties: mensagem: type: string example: 'Webhook não encontrado' tags: - 'URLs de Webhook' delete: summary: 'Remover Webhook' operationId: removerWebhook description: 'Remove uma URL de Webhook.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: mensagem: 'Webhook removido com sucesso' properties: mensagem: type: string example: 'Webhook removido com sucesso' 404: description: '' content: application/json: schema: type: object example: mensagem: 'Webhook não encontrado' properties: mensagem: type: string example: 'Webhook não encontrado' tags: - 'URLs de Webhook' parameters: - in: path name: id description: 'The ID of the webhook.' example: architecto required: true schema: type: string - in: path name: webhook description: 'ID da URL de Webhook.' example: 1 required: true schema: type: integer