basePath: / definitions: domain.Address: properties: bairro: type: string cep: type: string cidade: type: string complemento: type: string created_at: type: string entity_id: type: string id: type: string latitude: type: number logradouro: type: string longitude: type: number numero: type: string titulo: type: string uf: type: string updated_at: type: string type: object domain.CartItem: properties: batch: type: string buyer_id: type: string created_at: type: string expires_at: type: string id: type: string product_id: type: string product_name: type: string quantity: type: integer unit_cents: type: integer updated_at: type: string type: object domain.CartSummary: properties: discount_cents: type: integer discount_reason: type: string id: description: Virtual Cart ID (equals BuyerID) type: string items: items: $ref: '#/definitions/domain.CartItem' type: array subtotal_cents: type: integer total_cents: type: integer type: object domain.Company: properties: category: description: farmacia, distribuidora type: string city: type: string cnpj: type: string corporate_name: type: string created_at: description: Timestamps type: string credit_limit_cents: description: Credit Lines (Boleto a Prazo) type: integer credit_used_cents: description: currently in use type: integer id: type: string is_24_hours: type: boolean is_verified: type: boolean latitude: description: Location type: number license_number: type: string longitude: type: number operating_hours: description: 'e.g. "Seg-Sex: 08:00-18:00, Sab: 08:00-12:00"' type: string phone: description: Contact & Hours type: string state: type: string updated_at: type: string type: object domain.CompanyRating: properties: average_score: type: number company_id: type: string total_reviews: type: integer type: object domain.InventoryItem: properties: batch: type: string created_at: type: string expires_at: description: data_validade type: string id: type: string nome: description: Added for frontend display type: string observations: type: string product_id: description: catalogo_id type: string sale_price_cents: description: preco_venda type: integer seller_id: description: empresa_id type: string stock_quantity: description: qtdade_estoque type: integer updated_at: type: string type: object domain.Order: properties: buyer_id: type: string created_at: type: string distance_km: description: Adicionado type: number id: type: string items: items: $ref: '#/definitions/domain.OrderItem' type: array payment_method: $ref: '#/definitions/domain.PaymentMethod' seller_id: type: string shipping: $ref: '#/definitions/domain.ShippingAddress' shipping_fee_cents: description: Adicionado type: integer status: $ref: '#/definitions/domain.OrderStatus' total_cents: type: integer updated_at: type: string type: object domain.OrderItem: properties: batch: type: string expires_at: type: string id: type: string order_id: type: string product_id: type: string quantity: type: integer unit_cents: type: integer type: object domain.OrderStatus: enum: - Pendente - Pago - Faturado - Enviado - Entregue - Concluído - Cancelado type: string x-enum-varnames: - OrderStatusPending - OrderStatusPaid - OrderStatusInvoiced - OrderStatusShipped - OrderStatusDelivered - OrderStatusCompleted - OrderStatusCancelled domain.PaymentMethod: enum: - pix - credit_card - debit_card type: string x-enum-varnames: - PaymentMethodPix - PaymentMethodCredit - PaymentMethodDebit domain.PaymentPreference: properties: commission_pct: type: number gateway: type: string marketplace_fee: type: integer order_id: type: string payment_id: type: string payment_url: type: string seller_receivable: type: integer type: object domain.PaymentSplitResult: properties: marketplace_fee: type: integer order_id: type: string payment_id: type: string seller_receivable: type: integer status: type: string total_paid_amount: type: integer type: object domain.PaymentWebhookEvent: properties: marketplace_fee: type: integer order_id: type: string payment_id: type: string seller_amount: type: integer status: type: string total_paid_amount: type: integer type: object domain.Product: properties: batch: description: Inventory/Batch Fields type: string category: type: string commercial_discount_cents: type: integer created_at: type: string description: type: string ean_code: type: string expires_at: type: string factory_price_cents: type: integer id: type: string internal_code: description: New Fields (Reference Data) type: string invoice_price_cents: type: integer manufacturer: type: string name: type: string observations: type: string pmc_cents: type: integer price_cents: description: Base/List Price type: integer seller_id: description: Who created this catalog entry (usually Admin/Master) type: string stock: type: integer subcategory: type: string tax_substitution_cents: type: integer updated_at: type: string type: object domain.ProductPaginationResponse: properties: current_page: type: integer items: items: $ref: '#/definitions/domain.Product' type: array total_count: type: integer total_pages: type: integer type: object domain.ProductSearchPage: properties: page: type: integer page_size: type: integer products: items: $ref: '#/definitions/domain.ProductWithDistance' type: array total: type: integer type: object domain.ProductWithDistance: properties: batch: description: Inventory/Batch Fields type: string category: type: string commercial_discount_cents: type: integer created_at: type: string description: type: string distance_km: type: number ean_code: type: string expires_at: type: string factory_price_cents: type: integer id: type: string internal_code: description: New Fields (Reference Data) type: string invoice_price_cents: type: integer manufacturer: type: string name: type: string observations: type: string pmc_cents: type: integer price_cents: description: Base/List Price type: integer seller_id: description: Who created this catalog entry (usually Admin/Master) type: string stock: type: integer subcategory: type: string tax_substitution_cents: type: integer tenant_city: type: string tenant_state: type: string updated_at: type: string type: object domain.Review: properties: buyer_id: type: string comment: type: string created_at: type: string id: type: string order_id: type: string rating: type: integer seller_id: type: string type: object domain.ReviewPage: properties: page: type: integer page_size: type: integer reviews: items: $ref: '#/definitions/domain.Review' type: array total: type: integer type: object domain.Shipment: properties: carrier: type: string created_at: type: string external_tracking: type: string id: type: string order_id: type: string status: type: string tracking_code: type: string updated_at: type: string type: object domain.ShipmentPage: properties: page: type: integer page_size: type: integer shipments: items: $ref: '#/definitions/domain.Shipment' type: array total: type: integer type: object domain.ShippingAddress: properties: city: type: string complement: type: string country: type: string district: type: string latitude: type: number longitude: type: number number: type: string recipient_name: type: string state: type: string street: type: string zip_code: type: string type: object domain.ShippingOption: properties: description: type: string distance_km: type: number estimated_minutes: type: integer type: type: string value_cents: type: integer type: object domain.ShippingSettings: properties: active: type: boolean created_at: type: string free_shipping_threshold_cents: type: integer latitude: type: number longitude: type: number max_radius_km: type: number min_fee_cents: type: integer pickup_active: type: boolean pickup_address: type: string pickup_hours: type: string price_per_km_cents: type: integer updated_at: type: string vendor_id: type: string type: object domain.User: properties: company_id: type: string cpf: type: string created_at: type: string email: type: string email_verified: type: boolean id: type: string name: type: string nome_social: type: string role: type: string superadmin: type: boolean updated_at: type: string username: type: string type: object domain.UserPage: properties: page: type: integer page_size: type: integer total: type: integer users: items: $ref: '#/definitions/domain.User' type: array type: object handler.addCartItemRequest: properties: product_id: type: string quantity: type: integer type: object handler.authResponse: properties: access_token: type: string expires_at: type: string type: object handler.createAddressRequest: properties: bairro: type: string cep: type: string cidade: type: string complemento: type: string estado: description: JSON from frontend sends "estado" type: string logradouro: type: string numero: type: string pais: description: JSON includes "pais" type: string titulo: type: string type: object handler.createOrderRequest: properties: buyer_id: type: string items: items: $ref: '#/definitions/domain.OrderItem' type: array payment_method: $ref: '#/definitions/handler.orderPaymentMethod' seller_id: type: string shipping: $ref: '#/definitions/domain.ShippingAddress' type: object handler.createReviewRequest: properties: comment: type: string order_id: type: string rating: type: integer type: object handler.createShipmentRequest: properties: carrier: type: string external_tracking: type: string order_id: type: string tracking_code: type: string type: object handler.createUserRequest: properties: company_id: type: string cpf: type: string email: type: string name: type: string nome-social: type: string password: type: string role: type: string superadmin: type: boolean username: type: string type: object handler.forgotPasswordRequest: properties: email: type: string type: object handler.inventoryAdjustRequest: properties: delta: type: integer product_id: type: string reason: type: string type: object handler.loginRequest: properties: email: type: string password: type: string username: type: string type: object handler.messageResponse: properties: message: type: string type: object handler.orderPaymentMethod: properties: installments: type: integer type: type: string type: object handler.registerAuthRequest: properties: company: $ref: '#/definitions/handler.registerCompanyTarget' company_id: type: string email: type: string name: type: string password: type: string role: type: string username: type: string type: object handler.registerCompanyRequest: properties: atividade-principal: description: Frontend might send this type: string atividade-principal-codigo: description: Frontend sends this type: string atividade-principal-desc: description: Frontend sends this type: string capital-social: description: Frontend sends this (number) type: number category: type: string city: type: string cnpj: type: string codigo_atividade: type: string corporate_name: type: string data-abertura: description: 'Fixed: frontend sends hyphen' type: string descricao_atividade: type: string email: description: Frontend sends this type: string enderecoID: description: Frontend sends this type: string latitude: type: number license_number: type: string longitude: type: number natureza-juridica: description: Ignored for now type: string nome-fantasia: type: string porte: description: Ignored for now type: string raioEntregaKm: description: Frontend sends this type: number razao-social: description: Portuguese Frontend Compatibility type: string situacao: description: Ignored for now type: string state: type: string taxaEntrega: description: Frontend sends this type: number telefone: type: string tipoFrete: description: Frontend sends this type: string valorFreteKm: description: Frontend sends this type: number type: object handler.registerCompanyTarget: properties: category: type: string city: type: string cnpj: type: string corporate_name: type: string id: type: string latitude: type: number license_number: type: string longitude: type: number state: type: string type: object handler.registerInventoryRequest: properties: expires_at: description: ISO8601 type: string observations: type: string product_id: type: string sale_price_cents: type: integer seller_id: type: string stock_quantity: type: integer type: object handler.registerProductRequest: properties: category: type: string commercial_discount_cents: type: integer description: type: string ean_code: type: string factory_price_cents: type: integer internal_code: description: New Fields type: string invoice_price_cents: type: integer manufacturer: type: string name: type: string pmc_cents: type: integer price_cents: type: integer seller_id: type: string subcategory: type: string tax_substitution_cents: type: integer type: object handler.resetPasswordRequest: properties: password: type: string token: type: string type: object handler.resetTokenResponse: properties: expires_at: type: string message: type: string reset_token: type: string type: object handler.shippingCalculateRequest: properties: address_id: type: string buyer_latitude: type: number buyer_longitude: type: number cart_total_cents: type: integer postal_code: type: string vendor_id: type: string type: object handler.shippingSettingsRequest: properties: active: type: boolean free_shipping_threshold_cents: type: integer latitude: description: Store location for radius calc type: number longitude: type: number max_radius_km: type: number min_fee_cents: type: integer pickup_active: type: boolean pickup_address: type: string pickup_hours: type: string price_per_km_cents: type: integer type: object handler.updateCompanyRequest: properties: category: type: string city: type: string cnpj: type: string corporate_name: type: string is_verified: type: boolean latitude: type: number license_number: type: string longitude: type: number state: type: string type: object handler.updateStatusRequest: properties: status: type: string type: object handler.updateUserRequest: properties: ativo: {} company_id: type: string cpf: {} created_at: {} email: type: string email_verified: {} empresasDados: description: Frontend sends array of strings items: type: string type: array enderecos: description: Frontend sends array of strings items: type: string type: array id: description: Ignored fields sent by frontend to prevent "unknown field" errors name: type: string nivel: {} nome: {} nome-social: {} password: type: string registro-completo: {} role: type: string updated_at: {} username: type: string type: object handler.verifyEmailRequest: properties: token: type: string type: object info: contact: email: devops@saveinmed.com name: Engenharia SaveInMed description: API REST B2B para marketplace farmacêutico com split de pagamento e rastreabilidade. title: SaveInMed Performance Core API version: "1.0" paths: /api/v1/auth/login: post: consumes: - application/json description: |- Realiza login e retorna token JWT. **Credenciais Padrão (Master):** Email: `andre.fr93@gmail.com` Senha: `teste1234` parameters: - description: Credenciais in: body name: login required: true schema: $ref: '#/definitions/handler.loginRequest' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/handler.authResponse' "401": description: Unauthorized schema: additionalProperties: type: string type: object summary: Autenticação de usuário tags: - Autenticação /api/v1/auth/logout: post: description: Endpoint para logout (invalidação client-side). responses: "204": description: No Content schema: type: string summary: Logout tags: - Autenticação /api/v1/auth/me: get: produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.User' "401": description: Unauthorized schema: additionalProperties: type: string type: object security: - BearerAuth: [] summary: Obter dados do usuário logado tags: - Autenticação /api/v1/auth/password/forgot: post: consumes: - application/json description: Gera um token de redefinição de senha. parameters: - description: Email do usuário in: body name: payload required: true schema: $ref: '#/definitions/handler.forgotPasswordRequest' produces: - application/json responses: "202": description: Accepted schema: $ref: '#/definitions/handler.resetTokenResponse' "400": description: Bad Request schema: additionalProperties: type: string type: object summary: Solicitar redefinição de senha tags: - Autenticação /api/v1/auth/password/reset: post: consumes: - application/json description: Atualiza a senha usando o token de redefinição. parameters: - description: Token e nova senha in: body name: payload required: true schema: $ref: '#/definitions/handler.resetPasswordRequest' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/handler.messageResponse' "400": description: Bad Request schema: additionalProperties: type: string type: object "401": description: Unauthorized schema: additionalProperties: type: string type: object summary: Redefinir senha tags: - Autenticação /api/v1/auth/refresh-token: post: consumes: - application/json description: Gera um novo JWT a partir de um token válido. parameters: - description: Bearer token in: header name: Authorization required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/handler.authResponse' "401": description: Unauthorized schema: additionalProperties: type: string type: object summary: Atualizar token tags: - Autenticação /api/v1/auth/register: post: consumes: - application/json description: Cria um usuário e opcionalmente uma empresa, retornando token JWT. parameters: - description: Dados do usuário e empresa in: body name: payload required: true schema: $ref: '#/definitions/handler.registerAuthRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/handler.authResponse' "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: Cadastro de usuário tags: - Autenticação /api/v1/auth/register/customer: post: consumes: - application/json description: Cria um usuário do tipo cliente e opcionalmente uma empresa, retornando token JWT. parameters: - description: Dados do usuário e empresa in: body name: payload required: true schema: $ref: '#/definitions/handler.registerAuthRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/handler.authResponse' "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: Cadastro de cliente tags: - Autenticação /api/v1/auth/register/tenant: post: consumes: - application/json description: Cria um usuário do tipo tenant e opcionalmente uma empresa, retornando token JWT. parameters: - description: Dados do usuário e empresa in: body name: payload required: true schema: $ref: '#/definitions/handler.registerAuthRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/handler.authResponse' "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: Cadastro de tenant tags: - Autenticação /api/v1/auth/verify-email: post: consumes: - application/json description: Marca o email como verificado usando um token JWT. parameters: - description: Token de verificação in: body name: payload required: true schema: $ref: '#/definitions/handler.verifyEmailRequest' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/handler.messageResponse' "400": description: Bad Request schema: additionalProperties: type: string type: object "401": description: Unauthorized schema: additionalProperties: type: string type: object summary: Verificar email tags: - Autenticação /api/v1/cart: get: produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.CartSummary' security: - BearerAuth: [] summary: Obter carrinho tags: - Carrinho post: consumes: - application/json parameters: - description: Item do carrinho in: body name: payload required: true schema: $ref: '#/definitions/handler.addCartItemRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/domain.CartSummary' "400": description: Bad Request schema: additionalProperties: type: string type: object security: - BearerAuth: [] summary: Adicionar item ao carrinho tags: - Carrinho put: consumes: - application/json parameters: - description: Itens do carrinho in: body name: payload required: true schema: items: $ref: '#/definitions/handler.addCartItemRequest' type: array produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.CartSummary' security: - BearerAuth: [] summary: Atualizar carrinho completo tags: - Carrinho /api/v1/cart/{id}: delete: parameters: - description: Cart item ID in: path name: id required: true type: string responses: "200": description: OK schema: $ref: '#/definitions/domain.CartSummary' "400": description: Bad Request schema: additionalProperties: type: string type: object security: - BearerAuth: [] summary: Remover item do carrinho tags: - Carrinho /api/v1/categorias: get: produces: - application/json responses: "200": description: OK schema: items: type: string type: array summary: Listar categorias tags: - Produtos /api/v1/companies: get: produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/domain.Company' type: array summary: Lista empresas tags: - Empresas post: consumes: - application/json description: Cadastra farmácia, distribuidora ou administrador com CNPJ e licença sanitária. parameters: - description: Dados da empresa in: body name: company required: true schema: $ref: '#/definitions/handler.registerCompanyRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/domain.Company' summary: Registro de empresas tags: - Empresas /api/v1/companies/{id}: delete: parameters: - description: Company ID in: path name: id required: true type: string responses: "204": description: "" "400": description: Bad Request schema: additionalProperties: type: string type: object "404": description: Not Found schema: additionalProperties: type: string type: object summary: Remover empresa tags: - Empresas get: parameters: - description: Company ID in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.Company' "404": description: Not Found schema: additionalProperties: type: string type: object summary: Obter empresa tags: - Empresas patch: consumes: - application/json parameters: - description: Company ID in: path name: id required: true type: string - description: Campos para atualização in: body name: payload required: true schema: $ref: '#/definitions/handler.updateCompanyRequest' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.Company' "400": description: Bad Request schema: additionalProperties: type: string type: object "404": description: Not Found schema: additionalProperties: type: string type: object summary: Atualizar empresa tags: - Empresas /api/v1/companies/{id}/rating: get: parameters: - description: Company ID in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.CompanyRating' summary: Obter avaliação da empresa tags: - Empresas /api/v1/companies/{id}/verify: patch: parameters: - description: Company ID in: path name: id required: true type: string responses: "200": description: OK schema: $ref: '#/definitions/domain.Company' security: - BearerAuth: [] summary: Verificar empresa tags: - Empresas /api/v1/companies/me: get: produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.Company' security: - BearerAuth: [] summary: Obter minha empresa tags: - Empresas /api/v1/dashboard: get: description: Get dashboard data for the authenticated user (Admin or Seller) produces: - application/json responses: "200": description: OK schema: additionalProperties: true type: object "401": description: Unauthorized schema: additionalProperties: type: string type: object "403": description: Forbidden schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object security: - BearerAuth: [] summary: Get dashboard data tags: - Dashboard /api/v1/enderecos: get: produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/domain.Address' type: array "500": description: Internal Server Error schema: additionalProperties: type: string type: object security: - BearerAuth: [] summary: Listar endereços do usuário tags: - Endereços post: consumes: - application/json parameters: - description: Dados do endereço in: body name: address required: true schema: $ref: '#/definitions/handler.createAddressRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/domain.Address' "400": description: Bad Request schema: additionalProperties: type: string type: object security: - BearerAuth: [] summary: Criar novo endereço tags: - Endereços /api/v1/inventory: get: parameters: - description: Dias para expiração in: query name: expires_in_days type: integer produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/domain.InventoryItem' type: array security: - BearerAuth: [] summary: Listar estoque tags: - Estoque post: consumes: - application/json parameters: - description: Inventory Data in: body name: payload required: true schema: $ref: '#/definitions/handler.registerInventoryRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/domain.InventoryItem' summary: Adicionar item ao estoque (venda) tags: - Estoque /api/v1/inventory/adjust: post: consumes: - application/json parameters: - description: Ajuste de estoque in: body name: payload required: true schema: $ref: '#/definitions/handler.inventoryAdjustRequest' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.InventoryItem' "400": description: Bad Request schema: additionalProperties: type: string type: object security: - BearerAuth: [] summary: Ajustar estoque tags: - Estoque /api/v1/laboratorios: get: produces: - application/json responses: "200": description: OK schema: items: type: string type: array summary: Listar fabricantes (laboratórios) tags: - Produtos /api/v1/marketplace/records: get: parameters: - description: Busca textual in: query name: query type: string - description: Campo de ordenação (created_at|updated_at) in: query name: sort_by type: string - description: Direção (asc|desc) in: query name: sort_order type: string - description: Data mínima (RFC3339) in: query name: created_after type: string - description: Data máxima (RFC3339) in: query name: created_before type: string - description: Página in: query name: page type: integer - description: Itens por página in: query name: page_size type: integer produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.ProductPaginationResponse' summary: Busca avançada no marketplace tags: - Marketplace /api/v1/orders: get: produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/domain.Order' type: array security: - BearerAuth: [] summary: Listar pedidos tags: - Pedidos post: consumes: - application/json parameters: - description: Pedido in: body name: order required: true schema: $ref: '#/definitions/handler.createOrderRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/domain.Order' summary: Criação de pedido com split tags: - Pedidos /api/v1/orders/{id}: delete: parameters: - description: Order ID in: path name: id required: true type: string responses: "204": description: "" "400": description: Bad Request schema: additionalProperties: type: string type: object "404": description: Not Found schema: additionalProperties: type: string type: object security: - BearerAuth: [] summary: Remover pedido tags: - Pedidos get: parameters: - description: Order ID in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.Order' security: - BearerAuth: [] summary: Consulta pedido tags: - Pedidos put: consumes: - application/json parameters: - description: Order ID in: path name: id required: true type: string - description: Novos dados (itens) in: body name: order required: true schema: $ref: '#/definitions/handler.createOrderRequest' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.Order' security: - BearerAuth: [] summary: Atualizar itens do pedido tags: - Pedidos /api/v1/orders/{id}/payment: post: parameters: - description: Order ID in: path name: id required: true type: string produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/domain.PaymentPreference' security: - BearerAuth: [] summary: Cria preferência de pagamento Mercado Pago com split nativo tags: - Pagamentos /api/v1/orders/{id}/reorder: post: parameters: - description: Order ID in: path name: id required: true type: string responses: "200": description: OK schema: additionalProperties: true type: object security: - BearerAuth: [] summary: Comprar novamente tags: - Carrinho /api/v1/orders/{id}/status: patch: consumes: - application/json parameters: - description: Order ID in: path name: id required: true type: string - description: Novo status in: body name: status required: true schema: $ref: '#/definitions/handler.updateStatusRequest' produces: - application/json responses: "204": description: "" security: - BearerAuth: [] summary: Atualiza status do pedido tags: - Pedidos /api/v1/payments/webhook: post: consumes: - application/json parameters: - description: Evento do gateway in: body name: notification required: true schema: $ref: '#/definitions/domain.PaymentWebhookEvent' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.PaymentSplitResult' summary: Recebe notificações do Mercado Pago tags: - Pagamentos /api/v1/payments/webhook/asaas: post: consumes: - application/json produces: - application/json responses: "200": description: OK schema: additionalProperties: type: string type: object summary: Recebe notificações do Asaas tags: - Pagamentos /api/v1/payments/webhook/stripe: post: consumes: - application/json produces: - application/json responses: "200": description: OK schema: additionalProperties: type: string type: object summary: Recebe notificações do Stripe tags: - Pagamentos /api/v1/products: get: produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/domain.Product' type: array summary: Lista catálogo com lote e validade tags: - Produtos post: consumes: - application/json parameters: - description: Produto in: body name: product required: true schema: $ref: '#/definitions/handler.registerProductRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/domain.Product' summary: Cadastro de produto com rastreabilidade de lote tags: - Produtos /api/v1/products/{id}: delete: parameters: - description: Product ID in: path name: id required: true type: string responses: "204": description: "" "400": description: Bad Request schema: additionalProperties: type: string type: object "404": description: Not Found schema: additionalProperties: type: string type: object summary: Remover produto tags: - Produtos get: parameters: - description: Product ID in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.Product' "404": description: Not Found schema: additionalProperties: type: string type: object summary: Obter produto tags: - Produtos /api/v1/products/search: get: description: Retorna produtos ordenados por validade, com distância aproximada. Vendedor anônimo até checkout. parameters: - description: Termo de busca in: query name: search type: string - description: Preço mínimo em centavos in: query name: min_price type: integer - description: Preço máximo em centavos in: query name: max_price type: integer - description: Distância máxima em km in: query name: max_distance type: number - description: Latitude do comprador in: query name: lat required: true type: number - description: Longitude do comprador in: query name: lng required: true type: number - description: Página in: query name: page type: integer - description: Itens por página in: query name: page_size type: integer produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.ProductSearchPage' summary: Busca avançada de produtos com filtros e distância tags: - Produtos /api/v1/produtos-catalogo/codigo-ean/{ean}: get: parameters: - description: EAN Code in: path name: ean required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.Product' "404": description: Not Found schema: additionalProperties: type: string type: object summary: Buscar produto por EAN tags: - Produtos /api/v1/reviews: get: description: Returns reviews. Admins see all, Tenants see only their own. parameters: - description: Página in: query name: page type: integer - description: Tamanho da página in: query name: page_size type: integer produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.ReviewPage' "401": description: Unauthorized schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object security: - BearerAuth: [] summary: List reviews tags: - Reviews post: consumes: - application/json parameters: - description: Dados da avaliação in: body name: payload required: true schema: $ref: '#/definitions/handler.createReviewRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/domain.Review' "400": description: Bad Request schema: additionalProperties: type: string type: object security: - BearerAuth: [] summary: Criar avaliação tags: - Avaliações /api/v1/shipments: get: description: Returns shipments. Admins see all, Tenants see only their own. parameters: - description: Página in: query name: page type: integer - description: Tamanho da página in: query name: page_size type: integer produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.ShipmentPage' "401": description: Unauthorized schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object security: - BearerAuth: [] summary: List shipments tags: - Shipments post: consumes: - application/json parameters: - description: Dados de envio in: body name: shipment required: true schema: $ref: '#/definitions/handler.createShipmentRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/domain.Shipment' security: - BearerAuth: [] summary: Gera guia de postagem/transporte tags: - Logistica /api/v1/shipments/{order_id}: get: parameters: - description: Order ID in: path name: order_id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.Shipment' security: - BearerAuth: [] summary: Rastreia entrega tags: - Logistica /api/v1/shipping/calculate: post: consumes: - application/json description: Calculates shipping or pickup options based on vendor config and buyer location. parameters: - description: Calculation inputs in: body name: payload required: true schema: $ref: '#/definitions/handler.shippingCalculateRequest' produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/domain.ShippingOption' type: array "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: Calculate shipping options tags: - Shipping /api/v1/shipping/settings/{vendor_id}: get: description: Returns pickup and delivery settings for a vendor. parameters: - description: Vendor ID in: path name: vendor_id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.ShippingSettings' "400": description: Bad Request schema: additionalProperties: type: string type: object "403": description: Forbidden schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: Get vendor shipping settings tags: - Shipping put: consumes: - application/json description: Stores pickup and delivery settings for a vendor. parameters: - description: Vendor ID in: path name: vendor_id required: true type: string - description: Shipping settings in: body name: payload required: true schema: $ref: '#/definitions/handler.shippingSettingsRequest' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.ShippingSettings' "400": description: Bad Request schema: additionalProperties: type: string type: object "403": description: Forbidden schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object summary: Update vendor shipping settings tags: - Shipping /api/v1/team: get: produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.UserPage' security: - BearerAuth: [] summary: Listar membros da equipe tags: - Equipe post: consumes: - application/json parameters: - description: Dados do usuário (email, name, role) in: body name: payload required: true schema: $ref: '#/definitions/domain.User' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/domain.User' security: - BearerAuth: [] summary: Adicionar membro à equipe tags: - Equipe /api/v1/users: get: parameters: - description: Página in: query name: page type: integer - description: Tamanho da página in: query name: page_size type: integer - description: Filtro por empresa in: query name: company_id type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.UserPage' "400": description: Bad Request schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object security: - BearerAuth: [] summary: Listar usuários tags: - Usuários post: consumes: - application/json parameters: - description: Novo usuário in: body name: payload required: true schema: $ref: '#/definitions/handler.createUserRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/domain.User' "400": description: Bad Request schema: additionalProperties: type: string type: object "403": description: Forbidden schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object security: - BearerAuth: [] summary: Criar usuário tags: - Usuários /api/v1/users/{id}: delete: parameters: - description: User ID in: path name: id required: true type: string responses: "204": description: No Content schema: type: string "400": description: Bad Request schema: additionalProperties: type: string type: object "403": description: Forbidden schema: additionalProperties: type: string type: object "404": description: Not Found schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object security: - BearerAuth: [] summary: Excluir usuário tags: - Usuários get: parameters: - description: User ID in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.User' "400": description: Bad Request schema: additionalProperties: type: string type: object "403": description: Forbidden schema: additionalProperties: type: string type: object "404": description: Not Found schema: additionalProperties: type: string type: object security: - BearerAuth: [] summary: Obter usuário tags: - Usuários put: consumes: - application/json parameters: - description: User ID in: path name: id required: true type: string - description: Campos para atualização in: body name: payload required: true schema: $ref: '#/definitions/handler.updateUserRequest' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.User' "400": description: Bad Request schema: additionalProperties: type: string type: object "403": description: Forbidden schema: additionalProperties: type: string type: object "404": description: Not Found schema: additionalProperties: type: string type: object "500": description: Internal Server Error schema: additionalProperties: type: string type: object security: - BearerAuth: [] summary: Atualizar usuário tags: - Usuários schemes: - http securityDefinitions: BearerAuth: in: header name: Authorization type: apiKey swagger: "2.0"