DriveB

05. Notas Fiscais

O módulo de Notas Fiscais permite a integração com os documentos fiscais gerados durante os processos de manutenção. Aqui você pode consultar, registrar e acompanhar notas fiscais eletrônicas associadas aos serviços realizados.


Funcionalidades Principais

Abaixo estão os atalhos para as operações mais utilizadas neste módulo:


Listagem de Notas Fiscais

Recupere uma lista de notas fiscais emitidas.

Endpoint: api/billings/invoice-parts-services-queue?isInvoiceRecorded=

Método: GET

Filters parameter:

{
"requestId": "string",
"clientId": 0,
"carWorkshopId": 0,
"vehicleLicensePlate": "string",
"partsNfNumber": 0,
"servicesNfNumber": 0,
"nfIssueInitialDate": "2025-09-03",
"nfIssueFinalDate": "2025-09-03",
"blockCode": "string",
"invoiceStatus": "INVOICE_WAITING_UPLOAD",
"isInvoiceRecorded": true,
"isPartsInvoiceAvailable": "AVAILABLE",
"isServiceInvoiceAvailable": "AVAILABLE",
"clientPriceNfParts": 0.1,
"billingId": 0,
"franchiseIds": [
0
],
"partsNfIssueInitialDate": "2025-09-03",
"partsNfIssueFinalDate": "2025-09-03"
}

Response body:

[
{
"billingId": 0,
"serviceRequestId": 0,
"requestId": "string",
"clientId": 0,
"clientName": "string",
"clientType": "string",
"clientCountryId": 0,
"vehicleLicensePlate": "string",
"invoiceStatus": "string",
"partsNfStatus": "string",
"serviceNfStatus": "string",
"partsNfNumber": 0,
"partsNfIssueDate": "2025-09-03T13:29:18.318Z",
"serviceNfNumber": 0,
"serviceNfIssueDate": "2025-09-03T13:29:18.318Z",
"budgetId": 0,
"carWorkshopId": 0,
"carWorkshopName": "string",
"blockCode": "string",
"isInvoiceRecorded": true,
"isInvoicePartPdfReplaced": true,
"isInvoicePartXmlReplaced": true,
"isInvoiceServicePdfReplaced": true,
"status": "string",
"wasInvoiceRecorded": true,
"isServiceInvoiceAvailable": "AVAILABLE",
"isPartsInvoiceAvailable": "AVAILABLE",
"approvalCode": "string",
"provider": "string",
"clientPriceNfService": 0.1,
"serviceNfExpirationDate": "2025-09-03T13:29:18.318Z",
"partsNfExpirationDate": "2025-09-03T13:29:18.318Z",
"serviceNfPdfFilename": "string",
"partsNfPdfFilename": "string",
"partsNfXmlFilename": "string",
"serviceNfPdfFilepath": "string",
"partsNfPdfFilepath": "string",
"partsNfXmlFilepath": "string",
"partsNfSendFileDate": "2025-09-03T13:29:18.318Z",
"serviceNfSendFileDate": "2025-09-03T13:29:18.318Z",
"osServiceValue": 0.1,
"osPartsValue": 0.1,
"serviceInvoiceForCustomer": true
}
]

Obter Arquivos da Nota Fiscal

Obtenha o arquivo da nota fiscal vinculado a uma manutenção específica.

Arquivo PDF NF Peças

Endpoint: partsNfPdfFilepath

Método: GET

Arquivo XML NF Peças

Endpoint: partsNfXmlFilepath

Método: GET

Arquivo PDF NF Serviço

Endpoint: serviceNfPdfFilename

Método: GET



Caso de Uso - Automação criação Pedido de Compras e export de Nota Fiscal

Neste caso de uso apresentado é possível integrar informando um número do pedido - gerado pelo sistema do cliente, para posterior consulta de orçamento e notas fiscais.

images/confluence/download/attachments/6208611563/NumeroPedido-NF-version-1-modificationdate-1758210955000-api-v2.png

Listar solicitações a aprovar

Liste todas as solicitações que necessitam de aprovação de orçamento.

Endpoint: api/service-requests/client-approval-queue

Método: GET

Filters - query string parameter:

{
"page": 0,
"size": 1,
"sort": [
"string"
]
}

Response body:

{
"totalElements": 0,
"totalPages": 0,
"size": 0,
"content": [
{
"id": 0,
"requestId": "string",
"blockName": "string",
"carWorkshopName": "string",
"budgetId": 0,
"totalBudgetClient": 0.1,
"workflowClientApprovalsCount": 0,
"workflowClientApprovalsTotal": 0,
"workflowClientIsLastApprover": true,
"date": "2025-09-18T16:04:11.784Z",
"clientApproverProfile": "DRIVER",
"budgetStatus": "string"
}
],
"number": 0,
"sort": {
"empty": true,
"sorted": true,
"unsorted": true
},
"pageable": {
"offset": 0,
"sort": {
"empty": true,
"sorted": true,
"unsorted": true
},
"pageNumber": 0,
"unpaged": true,
"paged": true,
"pageSize": 0
},
"numberOfElements": 0,
"first": true,
"last": true,
"empty": true
}


Verificar o orçamento

Verifique os itens do orçamento da solicitação.

Endpoint: api/budgets/{ budgetId }


Método: GET

Response body:

{
"id": 0,
"serviceRequestId": 0,
"billingId": 0,
"status": "string",
"displayStatus": "string",
"approvalCode": 0,
"creatorUser": "string",
"perfil": "string",
"createdAt": "2025-09-18T17:49:21.665Z",
"modifiedAt": "2025-09-18T17:49:21.665Z",
"clientApprovalAvailableAt": "2025-09-18T17:49:21.665Z",
"modifiedBy": "string",
"observationApproveOrCancel": "string",
"observationRemoveVehicle": "string",
"observationBackoffice": "string",
"observationCarWorkshop": "string",
"generatedCarWorkshop": true,
"approvedDate": "2025-09-18T17:49:21.665Z",
"budgetServiceItems": [
{
"id": 0,
"budgetId": 0,
"serviceId": 0,
"clientPrice": 0.1,
"carWorkshopPrice": 0.1,
"intermediationFee": 0.1,
"admFee": 0.1,
"driveBMargin": 0.1,
"serviceName": "string",
"serviceCode": "string",
"amountOfHours": 0.1,
"modifiedBy": "string",
"isPreventiveVerification": true,
"isPreventiveVerificationConfirmed": true
}
],
"budgetPartItems": [
{
"id": 0,
"budgetId": 0,
"partId": 0,
"clientPrice": 0.1,
"carWorkshopPrice": 0.1,
"partAmount": 0.1,
"intermediationFee": 0.1,
"admFee": 0.1,
"driveBMargin": 0.1,
"partManufacturerName": "string",
"partCode": "string",
"partName": "string",
"measurementUnit": "string",
"budgetServiceItem": {
"id": 0,
"budgetId": 0,
"serviceId": 0,
"clientPrice": 0.1,
"carWorkshopPrice": 0.1,
"intermediationFee": 0.1,
"admFee": 0.1,
"driveBMargin": 0.1,
"serviceName": "string",
"serviceCode": "string",
"amountOfHours": 0.1,
"modifiedBy": "string",
"isPreventiveVerification": true,
"isPreventiveVerificationConfirmed": true
},
"modifiedBy": "string",
"isPreventiveVerification": true,
"isPreventiveVerificationConfirmed": true,
"pnErpCode": "string",
"tire": true,
"isInternalReferenceBase": true
}
],
"budgetValidations": [
{
"id": 0,
"budgetId": 0,
"status": "string",
"observation": "string",
"creatorUser": "string",
"createdAt": "2025-09-18T17:49:21.665Z"
}
],
"carWorkshopPdfFilename": "string",
"carWorkshopPdfFilepath": "string",
"clientApproverProfile": "DRIVER",
"clientApproverUsername": "string",
"approvalLimitId": 0,
"workflowClientApprovalsCount": 0,
"workflowClientApprovalsTotal": 0,
"workflowClientIsLastApprover": true,
"workflowClientNextApprovalUserType": "APPROVAL_USER_1",
"inRenegotiation": true,
"version": 0,
"hasChangedValue": true,
"empty": true
}


Aprovar a solicitação

Aprovar a solicitação de manutenção. Ao aproovar a solicitação, envie como dado o número do pedido em approvalCode.

Endpoint: api/budgets/7525/events/client-approval

Método: PATCH

Request payload:

{
"approvalCode": 0,
"observations": "string"
}


A partir da listagem de solicitações, seguir passos conforme seção 04. Solicitações de Serviço.