Entregas e ligações de seguimento
As entregas (tarefas) da criação à entrega, com a hora de chegada em direto, a edição, os seus locais de recolha e clientes, e as ligações de seguimento que envia aos clientes.
Nesta página
- A prova de entrega da tarefa (fotografias, assinaturas) e a nota do estafeta
- A imagem de uma prova (JPEG, PNG ou WebP), guardada enquanto a sua tarefa for guardada
- Listar tarefas, das mais recentes para as mais antigas
- Criar uma entrega
- Obter uma tarefa com a sua ETA em direto
- Editar uma entrega
- Atribuir (ou reatribuir) um veículo — created|assigned → assigned; evento task.assigned
- Marcar como recolhida — assigned → picked_up
- Marcar como entregue — assigned|picked_up|arriving → completed; evento task.completed
- Marcar como falhada — qualquer estado em aberto → failed; evento task.failed
- Cancelar — qualquer estado em aberto → cancelled
- Enviar o PIN de entrega do cliente para o seu e-mail
- Se um PIN de entrega pode ir para um número no WhatsApp
- Definir ou limpar a área própria de uma entrega
- Listar os seus locais de recolha (o predefinido primeiro)
- Adicionar um local de recolha (até 200)
- Obter um local de recolha
- Editar um local de recolha
- Eliminar um local de recolha
- Listar os seus clientes, da entrega mais recente para a mais antiga
- Obter um cliente
- Esquecer um cliente e os seus endereços
- Listar os endereços de um cliente, do último usado para o mais antigo
- A ligação de seguimento do destinatário (uma nova se tiver expirado; nenhuma depois de a tarefa terminar)
Envie a sua chave com key=A_SUA_CHAVE_API no endereço, ou no cabeçalho X-NWays-Api-Key. Chaves de API
Endereço base: https://nways.ng/maps/v1/fleet
A prova de entrega da tarefa (fotografias, assinaturas) e a nota do estafeta
GET https://nways.ng/maps/v1/fleet/tasks/{id}/proofs
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
id | caminho | string | Obrigatório. |
curl "https://nways.ng/maps/v1/fleet/tasks/string/proofs" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API"const res = await fetch('https://nways.ng/maps/v1/fleet/tasks/string/proofs', {
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.get(
"https://nways.ng/maps/v1/fleet/tasks/string/proofs",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Resposta
Provas
| Campo | Tipo | Descrição |
|---|---|---|
taskId | string | Obrigatório. |
proofs | Proof[] | Obrigatório. |
proofs[].id | string | Obrigatório. |
proofs[].kind | string | Obrigatório. Um de: photo, signature. |
proofs[].contentType | string | Obrigatório. Um de: image/jpeg, image/png, image/webp. |
proofs[].bytes | integer | Obrigatório. |
proofs[].lat | number | null | Obrigatório. |
proofs[].lng | number | null | Obrigatório. |
proofs[].by | string | Obrigatório. O nome do estafeta. |
proofs[].createdAt | string (date-time) | Obrigatório. |
endNote | string | Obrigatório. O que o estafeta escreveu ao terminar. |
{
"taskId": "string",
"proofs": [
{
"id": "string",
"kind": "photo",
"contentType": "image/jpeg",
"bytes": 0,
"lat": 0,
"lng": 0,
"by": "string",
"createdAt": "2026-10-15T09:00:00+01:00"
}
],
"endNote": "string"
}Erros
defaultErro
A imagem de uma prova (JPEG, PNG ou WebP), guardada enquanto a sua tarefa for guardada
GET https://nways.ng/maps/v1/fleet/proofs/{proofId}
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
proofId | caminho | string | Obrigatório. |
curl "https://nways.ng/maps/v1/fleet/proofs/string" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API"const res = await fetch('https://nways.ng/maps/v1/fleet/proofs/string', {
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.get(
"https://nways.ng/maps/v1/fleet/proofs/string",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Resposta
A imagem
Erros
defaultErro
Listar tarefas, das mais recentes para as mais antigas
GET https://nways.ng/maps/v1/fleet/tasks
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
status | consulta | string | active = assigned, picked_up ou arriving. Um de: created, assigned, picked_up, arriving, completed, failed, cancelled, active. |
vehicleId | consulta | string | |
limit | consulta | integer | Predefinição: 100. ≥ 1, ≤ 500. |
pageToken | consulta | string | nextPageToken da página anterior. |
curl "https://nways.ng/maps/v1/fleet/tasks" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API"const res = await fetch('https://nways.ng/maps/v1/fleet/tasks', {
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.get(
"https://nways.ng/maps/v1/fleet/tasks",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Resposta
Tarefas
| Campo | Tipo | Descrição |
|---|---|---|
tasks | Task[] | Obrigatório. |
tasks[].id | string | Obrigatório. |
tasks[].ref | string | Obrigatório. O número curto da entrega no projeto, atribuído pela N-Ways ("1042", mostrado como #1042): para pessoas, em alertas e listas. |
tasks[].status | string | Obrigatório. Um de: created, assigned, picked_up, arriving, completed, failed, cancelled. |
tasks[].vehicleId | string | null | Obrigatório. |
tasks[].pickup | Stop | null | Obrigatório. |
tasks[].dropoff | Stop | Obrigatório. |
tasks[].dropoff.lat | number | Obrigatório. |
tasks[].dropoff.lng | number | Obrigatório. |
tasks[].dropoff.name | string | Até 120 caracteres. |
tasks[].dropoff.address | string | Até 300 caracteres. |
tasks[].recipientName | string | Obrigatório. |
tasks[].recipientPhone | string | |
tasks[].notes | string | Obrigatório. |
tasks[].lang | string | Obrigatório. Um de: en, fr, pt. |
tasks[].arrivingS | integer | Obrigatório. |
tasks[].eta | ETA | null | Obrigatório. Nulo até chegar uma posição recente, e depois de a tarefa terminar. |
tasks[].dueAt | string (date-time) | null | Obrigatório. |
tasks[].late | boolean | Obrigatório. Em aberto e com dueAt ultrapassado, ou prevista para depois dele. |
tasks[].trackingUrl | string (uri) | null | Obrigatório. Nulo depois de expirar. |
tasks[].trackingExpiresAt | string (date-time) | null | Obrigatório. |
tasks[].failureReason | string | |
tasks[].createdAt | string (date-time) | Obrigatório. |
tasks[].assignedAt | string (date-time) | null | Obrigatório. |
tasks[].pickedUpAt | string (date-time) | null | Obrigatório. |
tasks[].arrivingAt | string (date-time) | null | Obrigatório. |
tasks[].endedAt | string (date-time) | null | Obrigatório. |
tasks[].area | Area | null | A área própria da entrega: sair dela gera asset.geofence_exit. |
tasks[].proofs | Proof[] | Apenas em GET /tasks/{id}: as fotografias e assinaturas do estafeta (N-Ways Business). |
tasks[].proofs[].id | string | Obrigatório. |
tasks[].proofs[].kind | string | Obrigatório. Um de: photo, signature. |
tasks[].proofs[].contentType | string | Obrigatório. Um de: image/jpeg, image/png, image/webp. |
tasks[].proofs[].bytes | integer | Obrigatório. |
tasks[].proofs[].lat | number | null | Obrigatório. |
tasks[].proofs[].lng | number | null | Obrigatório. |
tasks[].proofs[].by | string | Obrigatório. O nome do estafeta. |
tasks[].proofs[].createdAt | string (date-time) | Obrigatório. |
tasks[].endNote | string | Apenas em GET /tasks/{id}: o que o estafeta escreveu ao terminar. |
tasks[].recipientEmail | string | |
tasks[].proofRequired | string[] | O da própria entrega, senão o das suas definições. |
tasks[].proofRequiredOverride | string[] | null | |
tasks[].packageSize | string | null | Um de: small, medium, large, null. |
tasks[].itemDescription | string | |
tasks[].reference | string | |
tasks[].scheduledAt | string (date-time) | null | |
tasks[].connectionId | string | null | A ligação do motorista N-Ways que a aceitou. |
tasks[].acceptedAt | string (date-time) | null | |
tasks[].startedAt | string (date-time) | null | |
tasks[].editable | string | O que PATCH /tasks/{id} pode alterar agora: tudo, apenas notes e dueAt (recolhida ou iniciada), ou nada (terminada). Um de: all, limited, none. |
tasks[].editedAt | string (date-time) | null | A última edição. |
tasks[].editedFields | string[] | O que a última edição alterou. |
tasks[].pinDelivery | PinDelivery | Como o PIN de entrega está a chegar ao cliente, quando a entrega pede um e os PIN vão por WhatsApp. Nunca o próprio PIN. |
tasks[].pinDelivery.channel | string | Obrigatório. Um de: whatsapp, email, none. |
tasks[].pinDelivery.state | string | Obrigatório. Um de: sending, sent, delivered, read, failed. |
tasks[].pinDelivery.whatsappErrorCode | integer | null | Obrigatório. A falha do WhatsApp (131026: não está no WhatsApp), guardada depois de o PIN ter ido por e-mail. |
tasks[].pinDelivery.needsEmail | boolean | Obrigatório. O cliente não recebeu o PIN: envie-o com POST /tasks/{id}/pin-email. |
tasks[].pinDelivery.updatedAt | string (date-time) | Obrigatório. |
nextPageToken | string |
{
"tasks": [
{
"id": "string",
"ref": "string",
"status": "created",
"vehicleId": "string",
"pickup": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"dropoff": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"recipientName": "string",
"recipientPhone": "string",
"notes": "string",
"lang": "en",
"arrivingS": 0,
"eta": {
"at": "2026-10-15T09:00:00+01:00",
"durationS": 0,
"distanceM": 0,
"trafficDelayS": 0,
"pickupAt": "2026-10-15T09:00:00+01:00",
"updatedAt": "2026-10-15T09:00:00+01:00"
},
"dueAt": "2026-10-15T09:00:00+01:00",
"late": true,
"trackingUrl": "string",
"trackingExpiresAt": "2026-10-15T09:00:00+01:00",
"failureReason": "string",
"createdAt": "2026-10-15T09:00:00+01:00",
"assignedAt": "2026-10-15T09:00:00+01:00",
"pickedUpAt": "2026-10-15T09:00:00+01:00",
"arrivingAt": "2026-10-15T09:00:00+01:00",
"endedAt": "2026-10-15T09:00:00+01:00",
"area": {
"type": "circle",
"lat": 6.48,
"lng": 3.43,
"radiusM": 2500
},
"proofs": [
{
"id": "string",
"kind": "photo",
"contentType": "image/jpeg",
"bytes": 0,
"lat": 0,
"lng": 0,
"by": "string",
"createdAt": "2026-10-15T09:00:00+01:00"
}
],
"endNote": "string",
"recipientEmail": "string",
"proofRequired": [
"photo"
],
"proofRequiredOverride": [
"string"
],
"packageSize": "small",
"itemDescription": "string",
"reference": "string",
"scheduledAt": "2026-10-15T09:00:00+01:00",
"connectionId": "string",
"acceptedAt": "2026-10-15T09:00:00+01:00",
"startedAt": "2026-10-15T09:00:00+01:00",
"editable": "all",
"editedAt": "2026-10-15T09:00:00+01:00",
"editedFields": [
"string"
],
"pinDelivery": {
"channel": "whatsapp",
"state": "sending",
"whatsappErrorCode": 0,
"needsEmail": true,
"updatedAt": "2026-10-15T09:00:00+01:00"
}
}
],
"nextPageToken": "string"
}Erros
defaultErro
Criar uma entrega
POST https://nways.ng/maps/v1/fleet/tasks
Uma tarefa tem uma recolha opcional e um local de entrega. Indique vehicleId para a atribuir de imediato. A resposta traz o trackingUrl do destinatário (válido 72 horas, ou até uma hora depois de a tarefa terminar). Eventos: task.created (e task.assigned).
Corpo do pedido
| Campo | Tipo | Descrição |
|---|---|---|
id | string | O seu id para ela; a N-Ways cria um (job_…) quando o omite. |
pickup | Stop | |
pickup.lat | number | Obrigatório. |
pickup.lng | number | Obrigatório. |
pickup.name | string | Até 120 caracteres. |
pickup.address | string | Até 300 caracteres. |
pickupPlaceId | string | Um dos seus locais de recolha como recolha (o nome, o endereço e a posição são copiados), em vez de pickup. |
dropoff | Stop | Obrigatório. |
dropoff.lat | number | Obrigatório. |
dropoff.lng | number | Obrigatório. |
dropoff.name | string | Até 120 caracteres. |
dropoff.address | string | Até 300 caracteres. |
recipientName | string | Para os seus registos; nunca é mostrado na página de seguimento. Até 100 caracteres. |
recipientPhone | string | Para que o estafeta possa ligar ao cliente a partir da N-Ways Business; nunca é mostrado na página de seguimento. Até 32 caracteres. |
notes | string | Até 500 caracteres. |
lang | string | O idioma da página de seguimento. Um de: en, fr, pt. Predefinição: en. |
arrivingS | integer | Segundos antes da chegada a partir dos quais a tarefa passa a arriving. Predefinição: 180. ≥ 30, ≤ 1800. |
vehicleId | string | |
dueAt | string (date-time) | O prazo: depois dele (ou se prevista para depois dele) a tarefa fica late. |
area | Area | Um círculo (lat, lng, radiusM 50–100000) ou um polígono (coordinates: 3–500 pontos [lng, lat]). |
area.type | string | Obrigatório. Um de: circle, polygon. |
area.lat | number | |
area.lng | number | |
area.radiusM | number | ≥ 50, ≤ 100000. |
area.coordinates | number[][] | |
recipientEmail | string (email) | A N-Ways envia ao cliente por e-mail as novidades (a caminho, a chegar, entregue) com a ligação de seguimento. |
proofRequired | string[] | O que o motorista tem de apresentar para entregar; omita para usar o proofRequired das suas definições. |
packageSize | string | Um de: small, medium, large. |
itemDescription | string | Até 200 caracteres. |
reference | string | A sua própria referência (um número de fatura ou de encomenda). Até 64 caracteres. |
scheduledAt | string (date-time) | Uma recolha mais tarde (até 60 dias à frente): o motorista recebe um lembrete antes. |
curl -X POST "https://nways.ng/maps/v1/fleet/tasks" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API" \
-H "Content-Type: application/json" \
-d '{"id":"order-88412","pickup":{"lat":6.5095,"lng":3.3711,"name":"Mama Put","Yaba":null,"address":"12 Herbert Macaulay Way"},"dropoff":{"lat":6.4969,"lng":3.3539,"name":"Home","address":"4 Adeniran Ogunsanya St"},"lang":"en","vehicleId":"bike-17"}'const res = await fetch('https://nways.ng/maps/v1/fleet/tasks', {
method: 'POST',
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"id": "order-88412",
"pickup": {
"lat": 6.5095,
"lng": 3.3711,
"name": "Mama Put",
"Yaba": null,
"address": "12 Herbert Macaulay Way"
},
"dropoff": {
"lat": 6.4969,
"lng": 3.3539,
"name": "Home",
"address": "4 Adeniran Ogunsanya St"
},
"lang": "en",
"vehicleId": "bike-17"
}),
})
const data = await res.json()import os
import requests
res = requests.post(
"https://nways.ng/maps/v1/fleet/tasks",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
json={"id": "order-88412", "pickup": {"lat": 6.5095, "lng": 3.3711, "name": "Mama Put", "Yaba": None, "address": "12 Herbert Macaulay Way"}, "dropoff": {"lat": 6.4969, "lng": 3.3539, "name": "Home", "address": "4 Adeniran Ogunsanya St"}, "lang": "en", "vehicleId": "bike-17"},
timeout=10,
)
data = res.json()Resposta
Criado
| Campo | Tipo | Descrição |
|---|---|---|
id | string | Obrigatório. |
ref | string | Obrigatório. O número curto da entrega no projeto, atribuído pela N-Ways ("1042", mostrado como #1042): para pessoas, em alertas e listas. |
status | string | Obrigatório. Um de: created, assigned, picked_up, arriving, completed, failed, cancelled. |
vehicleId | string | null | Obrigatório. |
pickup | Stop | null | Obrigatório. |
dropoff | Stop | Obrigatório. |
dropoff.lat | number | Obrigatório. |
dropoff.lng | number | Obrigatório. |
dropoff.name | string | Até 120 caracteres. |
dropoff.address | string | Até 300 caracteres. |
recipientName | string | Obrigatório. |
recipientPhone | string | |
notes | string | Obrigatório. |
lang | string | Obrigatório. Um de: en, fr, pt. |
arrivingS | integer | Obrigatório. |
eta | ETA | null | Obrigatório. Nulo até chegar uma posição recente, e depois de a tarefa terminar. |
dueAt | string (date-time) | null | Obrigatório. |
late | boolean | Obrigatório. Em aberto e com dueAt ultrapassado, ou prevista para depois dele. |
trackingUrl | string (uri) | null | Obrigatório. Nulo depois de expirar. |
trackingExpiresAt | string (date-time) | null | Obrigatório. |
failureReason | string | |
createdAt | string (date-time) | Obrigatório. |
assignedAt | string (date-time) | null | Obrigatório. |
pickedUpAt | string (date-time) | null | Obrigatório. |
arrivingAt | string (date-time) | null | Obrigatório. |
endedAt | string (date-time) | null | Obrigatório. |
area | Area | null | A área própria da entrega: sair dela gera asset.geofence_exit. |
proofs | Proof[] | Apenas em GET /tasks/{id}: as fotografias e assinaturas do estafeta (N-Ways Business). |
proofs[].id | string | Obrigatório. |
proofs[].kind | string | Obrigatório. Um de: photo, signature. |
proofs[].contentType | string | Obrigatório. Um de: image/jpeg, image/png, image/webp. |
proofs[].bytes | integer | Obrigatório. |
proofs[].lat | number | null | Obrigatório. |
proofs[].lng | number | null | Obrigatório. |
proofs[].by | string | Obrigatório. O nome do estafeta. |
proofs[].createdAt | string (date-time) | Obrigatório. |
endNote | string | Apenas em GET /tasks/{id}: o que o estafeta escreveu ao terminar. |
recipientEmail | string | |
proofRequired | string[] | O da própria entrega, senão o das suas definições. |
proofRequiredOverride | string[] | null | |
packageSize | string | null | Um de: small, medium, large, null. |
itemDescription | string | |
reference | string | |
scheduledAt | string (date-time) | null | |
connectionId | string | null | A ligação do motorista N-Ways que a aceitou. |
acceptedAt | string (date-time) | null | |
startedAt | string (date-time) | null | |
editable | string | O que PATCH /tasks/{id} pode alterar agora: tudo, apenas notes e dueAt (recolhida ou iniciada), ou nada (terminada). Um de: all, limited, none. |
editedAt | string (date-time) | null | A última edição. |
editedFields | string[] | O que a última edição alterou. |
pinDelivery | PinDelivery | Como o PIN de entrega está a chegar ao cliente, quando a entrega pede um e os PIN vão por WhatsApp. Nunca o próprio PIN. |
pinDelivery.channel | string | Obrigatório. Um de: whatsapp, email, none. |
pinDelivery.state | string | Obrigatório. Um de: sending, sent, delivered, read, failed. |
pinDelivery.whatsappErrorCode | integer | null | Obrigatório. A falha do WhatsApp (131026: não está no WhatsApp), guardada depois de o PIN ter ido por e-mail. |
pinDelivery.needsEmail | boolean | Obrigatório. O cliente não recebeu o PIN: envie-o com POST /tasks/{id}/pin-email. |
pinDelivery.updatedAt | string (date-time) | Obrigatório. |
{
"id": "string",
"ref": "string",
"status": "created",
"vehicleId": "string",
"pickup": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"dropoff": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"recipientName": "string",
"recipientPhone": "string",
"notes": "string",
"lang": "en",
"arrivingS": 0,
"eta": {
"at": "2026-10-15T09:00:00+01:00",
"durationS": 0,
"distanceM": 0,
"trafficDelayS": 0,
"pickupAt": "2026-10-15T09:00:00+01:00",
"updatedAt": "2026-10-15T09:00:00+01:00"
},
"dueAt": "2026-10-15T09:00:00+01:00",
"late": true,
"trackingUrl": "string",
"trackingExpiresAt": "2026-10-15T09:00:00+01:00",
"failureReason": "string",
"createdAt": "2026-10-15T09:00:00+01:00",
"assignedAt": "2026-10-15T09:00:00+01:00",
"pickedUpAt": "2026-10-15T09:00:00+01:00",
"arrivingAt": "2026-10-15T09:00:00+01:00",
"endedAt": "2026-10-15T09:00:00+01:00",
"area": {
"type": "circle",
"lat": 6.48,
"lng": 3.43,
"radiusM": 2500
},
"proofs": [
{
"id": "string",
"kind": "photo",
"contentType": "image/jpeg",
"bytes": 0,
"lat": 0,
"lng": 0,
"by": "string",
"createdAt": "2026-10-15T09:00:00+01:00"
}
],
"endNote": "string",
"recipientEmail": "string",
"proofRequired": [
"photo"
],
"proofRequiredOverride": [
"string"
],
"packageSize": "small",
"itemDescription": "string",
"reference": "string",
"scheduledAt": "2026-10-15T09:00:00+01:00",
"connectionId": "string",
"acceptedAt": "2026-10-15T09:00:00+01:00",
"startedAt": "2026-10-15T09:00:00+01:00",
"editable": "all",
"editedAt": "2026-10-15T09:00:00+01:00",
"editedFields": [
"string"
],
"pinDelivery": {
"channel": "whatsapp",
"state": "sending",
"whatsappErrorCode": 0,
"needsEmail": true,
"updatedAt": "2026-10-15T09:00:00+01:00"
}
}Erros
403DELIVERIES_OFF (a N-Ways desativou as novas entregas para a sua organização) ou ORGANISATION_SUSPENDED; a mensagem diz porquê.defaultErro
Obter uma tarefa com a sua ETA em direto
GET https://nways.ng/maps/v1/fleet/tasks/{id}
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
id | caminho | string | Obrigatório. |
curl "https://nways.ng/maps/v1/fleet/tasks/string" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API"const res = await fetch('https://nways.ng/maps/v1/fleet/tasks/string', {
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.get(
"https://nways.ng/maps/v1/fleet/tasks/string",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Resposta
Tarefa
| Campo | Tipo | Descrição |
|---|---|---|
id | string | Obrigatório. |
ref | string | Obrigatório. O número curto da entrega no projeto, atribuído pela N-Ways ("1042", mostrado como #1042): para pessoas, em alertas e listas. |
status | string | Obrigatório. Um de: created, assigned, picked_up, arriving, completed, failed, cancelled. |
vehicleId | string | null | Obrigatório. |
pickup | Stop | null | Obrigatório. |
dropoff | Stop | Obrigatório. |
dropoff.lat | number | Obrigatório. |
dropoff.lng | number | Obrigatório. |
dropoff.name | string | Até 120 caracteres. |
dropoff.address | string | Até 300 caracteres. |
recipientName | string | Obrigatório. |
recipientPhone | string | |
notes | string | Obrigatório. |
lang | string | Obrigatório. Um de: en, fr, pt. |
arrivingS | integer | Obrigatório. |
eta | ETA | null | Obrigatório. Nulo até chegar uma posição recente, e depois de a tarefa terminar. |
dueAt | string (date-time) | null | Obrigatório. |
late | boolean | Obrigatório. Em aberto e com dueAt ultrapassado, ou prevista para depois dele. |
trackingUrl | string (uri) | null | Obrigatório. Nulo depois de expirar. |
trackingExpiresAt | string (date-time) | null | Obrigatório. |
failureReason | string | |
createdAt | string (date-time) | Obrigatório. |
assignedAt | string (date-time) | null | Obrigatório. |
pickedUpAt | string (date-time) | null | Obrigatório. |
arrivingAt | string (date-time) | null | Obrigatório. |
endedAt | string (date-time) | null | Obrigatório. |
area | Area | null | A área própria da entrega: sair dela gera asset.geofence_exit. |
proofs | Proof[] | Apenas em GET /tasks/{id}: as fotografias e assinaturas do estafeta (N-Ways Business). |
proofs[].id | string | Obrigatório. |
proofs[].kind | string | Obrigatório. Um de: photo, signature. |
proofs[].contentType | string | Obrigatório. Um de: image/jpeg, image/png, image/webp. |
proofs[].bytes | integer | Obrigatório. |
proofs[].lat | number | null | Obrigatório. |
proofs[].lng | number | null | Obrigatório. |
proofs[].by | string | Obrigatório. O nome do estafeta. |
proofs[].createdAt | string (date-time) | Obrigatório. |
endNote | string | Apenas em GET /tasks/{id}: o que o estafeta escreveu ao terminar. |
recipientEmail | string | |
proofRequired | string[] | O da própria entrega, senão o das suas definições. |
proofRequiredOverride | string[] | null | |
packageSize | string | null | Um de: small, medium, large, null. |
itemDescription | string | |
reference | string | |
scheduledAt | string (date-time) | null | |
connectionId | string | null | A ligação do motorista N-Ways que a aceitou. |
acceptedAt | string (date-time) | null | |
startedAt | string (date-time) | null | |
editable | string | O que PATCH /tasks/{id} pode alterar agora: tudo, apenas notes e dueAt (recolhida ou iniciada), ou nada (terminada). Um de: all, limited, none. |
editedAt | string (date-time) | null | A última edição. |
editedFields | string[] | O que a última edição alterou. |
pinDelivery | PinDelivery | Como o PIN de entrega está a chegar ao cliente, quando a entrega pede um e os PIN vão por WhatsApp. Nunca o próprio PIN. |
pinDelivery.channel | string | Obrigatório. Um de: whatsapp, email, none. |
pinDelivery.state | string | Obrigatório. Um de: sending, sent, delivered, read, failed. |
pinDelivery.whatsappErrorCode | integer | null | Obrigatório. A falha do WhatsApp (131026: não está no WhatsApp), guardada depois de o PIN ter ido por e-mail. |
pinDelivery.needsEmail | boolean | Obrigatório. O cliente não recebeu o PIN: envie-o com POST /tasks/{id}/pin-email. |
pinDelivery.updatedAt | string (date-time) | Obrigatório. |
{
"id": "string",
"ref": "string",
"status": "created",
"vehicleId": "string",
"pickup": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"dropoff": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"recipientName": "string",
"recipientPhone": "string",
"notes": "string",
"lang": "en",
"arrivingS": 0,
"eta": {
"at": "2026-10-15T09:00:00+01:00",
"durationS": 0,
"distanceM": 0,
"trafficDelayS": 0,
"pickupAt": "2026-10-15T09:00:00+01:00",
"updatedAt": "2026-10-15T09:00:00+01:00"
},
"dueAt": "2026-10-15T09:00:00+01:00",
"late": true,
"trackingUrl": "string",
"trackingExpiresAt": "2026-10-15T09:00:00+01:00",
"failureReason": "string",
"createdAt": "2026-10-15T09:00:00+01:00",
"assignedAt": "2026-10-15T09:00:00+01:00",
"pickedUpAt": "2026-10-15T09:00:00+01:00",
"arrivingAt": "2026-10-15T09:00:00+01:00",
"endedAt": "2026-10-15T09:00:00+01:00",
"area": {
"type": "circle",
"lat": 6.48,
"lng": 3.43,
"radiusM": 2500
},
"proofs": [
{
"id": "string",
"kind": "photo",
"contentType": "image/jpeg",
"bytes": 0,
"lat": 0,
"lng": 0,
"by": "string",
"createdAt": "2026-10-15T09:00:00+01:00"
}
],
"endNote": "string",
"recipientEmail": "string",
"proofRequired": [
"photo"
],
"proofRequiredOverride": [
"string"
],
"packageSize": "small",
"itemDescription": "string",
"reference": "string",
"scheduledAt": "2026-10-15T09:00:00+01:00",
"connectionId": "string",
"acceptedAt": "2026-10-15T09:00:00+01:00",
"startedAt": "2026-10-15T09:00:00+01:00",
"editable": "all",
"editedAt": "2026-10-15T09:00:00+01:00",
"editedFields": [
"string"
],
"pinDelivery": {
"channel": "whatsapp",
"state": "sending",
"whatsappErrorCode": 0,
"needsEmail": true,
"updatedAt": "2026-10-15T09:00:00+01:00"
}
}Erros
defaultErro
Editar uma entrega
PATCH https://nways.ng/maps/v1/fleet/tasks/{id}
Altera qualquer um dos campos abaixo, verificados como na criação de uma tarefa; omita o que fica igual, envie null para limpar um campo opcional. Responde com a tarefa, com os campos alterados em editedFields e no cabeçalho X-NWays-Changed (nada alterado: nenhum evento).
Quando. Tudo pode mudar até a entrega ser recolhida (editable: all): está created, ou assigned sem pickedUpAt (e, para um motorista N-Ways, antes de a iniciar: o pedido pode estar à espera ou aceite). Depois, apenas notes e dueAt até ao fim (editable: limited); os outros campos respondem 409 TASK_UNDER_WAY, uma tarefa terminada 409 TASK_ENDED. Quem a tem muda com POST /tasks/{id}/assign ou /dispatch, nunca aqui.
Depois. A ETA é recalculada e a ligação de seguimento mantém-se. Evento task.updated (data.task, data.changed). Um pedido ainda à espera de um motorista N-Ways continua a ser o mesmo pedido com os novos detalhes (e pelo menos um minuto para responder); o motorista é avisado quando a recolha, a entrega ou os horários mudam. Um motorista que a aceitou (N-Ways ou N-Ways Business) é avisado do que mudou. Um cliente a quem a N-Ways já enviou e-mail recebe um e-mail de "atualização" quando o local de entrega ou um horário muda, no máximo um a cada 10 minutos.
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
id | caminho | string | Obrigatório. |
Corpo do pedido
| Campo | Tipo | Descrição |
|---|---|---|
pickup | Stop | null | null retira-o (não para uma entrega enviada a um motorista N-Ways). |
pickupPlaceId | string | Um dos seus locais de recolha como nova recolha, em vez de pickup. |
dropoff | Stop | |
dropoff.lat | number | Obrigatório. |
dropoff.lng | number | Obrigatório. |
dropoff.name | string | Até 120 caracteres. |
dropoff.address | string | Até 300 caracteres. |
recipientName | string | Até 100 caracteres. |
recipientPhone | string | Até 32 caracteres. |
recipientEmail | string | Um endereço de e-mail, ou "" para nenhum. |
notes | string | Até 500 caracteres. |
itemDescription | string | Até 200 caracteres. |
packageSize | string | null | Um de: small, medium, large, null. |
reference | string | Até 64 caracteres. |
dueAt | string (date-time) | null | |
scheduledAt | string (date-time) | null | De agora até 60 dias à frente. |
proofRequired | string[] | null | null: o proofRequired das suas definições. |
area | Area | null | |
lang | string | Um de: en, fr, pt. |
arrivingS | integer | ≥ 30, ≤ 1800. |
curl -X PATCH "https://nways.ng/maps/v1/fleet/tasks/string" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API" \
-H "Content-Type: application/json" \
-d '{"dropoff":{"lat":6.4549,"lng":3.4246,"name":"Office","address":"2 Kingsway Rd","Ikoyi":null},"dueAt":"2026-10-17T15:00:00Z","notes":"Call on arrival"}'const res = await fetch('https://nways.ng/maps/v1/fleet/tasks/string', {
method: 'PATCH',
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"dropoff": {
"lat": 6.4549,
"lng": 3.4246,
"name": "Office",
"address": "2 Kingsway Rd",
"Ikoyi": null
},
"dueAt": "2026-10-17T15:00:00Z",
"notes": "Call on arrival"
}),
})
const data = await res.json()import os
import requests
res = requests.patch(
"https://nways.ng/maps/v1/fleet/tasks/string",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
json={"dropoff": {"lat": 6.4549, "lng": 3.4246, "name": "Office", "address": "2 Kingsway Rd", "Ikoyi": None}, "dueAt": "2026-10-17T15:00:00Z", "notes": "Call on arrival"},
timeout=10,
)
data = res.json()Resposta
A tarefa tal como está agora
| Campo | Tipo | Descrição |
|---|---|---|
id | string | Obrigatório. |
ref | string | Obrigatório. O número curto da entrega no projeto, atribuído pela N-Ways ("1042", mostrado como #1042): para pessoas, em alertas e listas. |
status | string | Obrigatório. Um de: created, assigned, picked_up, arriving, completed, failed, cancelled. |
vehicleId | string | null | Obrigatório. |
pickup | Stop | null | Obrigatório. |
dropoff | Stop | Obrigatório. |
dropoff.lat | number | Obrigatório. |
dropoff.lng | number | Obrigatório. |
dropoff.name | string | Até 120 caracteres. |
dropoff.address | string | Até 300 caracteres. |
recipientName | string | Obrigatório. |
recipientPhone | string | |
notes | string | Obrigatório. |
lang | string | Obrigatório. Um de: en, fr, pt. |
arrivingS | integer | Obrigatório. |
eta | ETA | null | Obrigatório. Nulo até chegar uma posição recente, e depois de a tarefa terminar. |
dueAt | string (date-time) | null | Obrigatório. |
late | boolean | Obrigatório. Em aberto e com dueAt ultrapassado, ou prevista para depois dele. |
trackingUrl | string (uri) | null | Obrigatório. Nulo depois de expirar. |
trackingExpiresAt | string (date-time) | null | Obrigatório. |
failureReason | string | |
createdAt | string (date-time) | Obrigatório. |
assignedAt | string (date-time) | null | Obrigatório. |
pickedUpAt | string (date-time) | null | Obrigatório. |
arrivingAt | string (date-time) | null | Obrigatório. |
endedAt | string (date-time) | null | Obrigatório. |
area | Area | null | A área própria da entrega: sair dela gera asset.geofence_exit. |
proofs | Proof[] | Apenas em GET /tasks/{id}: as fotografias e assinaturas do estafeta (N-Ways Business). |
proofs[].id | string | Obrigatório. |
proofs[].kind | string | Obrigatório. Um de: photo, signature. |
proofs[].contentType | string | Obrigatório. Um de: image/jpeg, image/png, image/webp. |
proofs[].bytes | integer | Obrigatório. |
proofs[].lat | number | null | Obrigatório. |
proofs[].lng | number | null | Obrigatório. |
proofs[].by | string | Obrigatório. O nome do estafeta. |
proofs[].createdAt | string (date-time) | Obrigatório. |
endNote | string | Apenas em GET /tasks/{id}: o que o estafeta escreveu ao terminar. |
recipientEmail | string | |
proofRequired | string[] | O da própria entrega, senão o das suas definições. |
proofRequiredOverride | string[] | null | |
packageSize | string | null | Um de: small, medium, large, null. |
itemDescription | string | |
reference | string | |
scheduledAt | string (date-time) | null | |
connectionId | string | null | A ligação do motorista N-Ways que a aceitou. |
acceptedAt | string (date-time) | null | |
startedAt | string (date-time) | null | |
editable | string | O que PATCH /tasks/{id} pode alterar agora: tudo, apenas notes e dueAt (recolhida ou iniciada), ou nada (terminada). Um de: all, limited, none. |
editedAt | string (date-time) | null | A última edição. |
editedFields | string[] | O que a última edição alterou. |
pinDelivery | PinDelivery | Como o PIN de entrega está a chegar ao cliente, quando a entrega pede um e os PIN vão por WhatsApp. Nunca o próprio PIN. |
pinDelivery.channel | string | Obrigatório. Um de: whatsapp, email, none. |
pinDelivery.state | string | Obrigatório. Um de: sending, sent, delivered, read, failed. |
pinDelivery.whatsappErrorCode | integer | null | Obrigatório. A falha do WhatsApp (131026: não está no WhatsApp), guardada depois de o PIN ter ido por e-mail. |
pinDelivery.needsEmail | boolean | Obrigatório. O cliente não recebeu o PIN: envie-o com POST /tasks/{id}/pin-email. |
pinDelivery.updatedAt | string (date-time) | Obrigatório. |
{
"id": "string",
"ref": "string",
"status": "created",
"vehicleId": "string",
"pickup": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"dropoff": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"recipientName": "string",
"recipientPhone": "string",
"notes": "string",
"lang": "en",
"arrivingS": 0,
"eta": {
"at": "2026-10-15T09:00:00+01:00",
"durationS": 0,
"distanceM": 0,
"trafficDelayS": 0,
"pickupAt": "2026-10-15T09:00:00+01:00",
"updatedAt": "2026-10-15T09:00:00+01:00"
},
"dueAt": "2026-10-15T09:00:00+01:00",
"late": true,
"trackingUrl": "string",
"trackingExpiresAt": "2026-10-15T09:00:00+01:00",
"failureReason": "string",
"createdAt": "2026-10-15T09:00:00+01:00",
"assignedAt": "2026-10-15T09:00:00+01:00",
"pickedUpAt": "2026-10-15T09:00:00+01:00",
"arrivingAt": "2026-10-15T09:00:00+01:00",
"endedAt": "2026-10-15T09:00:00+01:00",
"area": {
"type": "circle",
"lat": 6.48,
"lng": 3.43,
"radiusM": 2500
},
"proofs": [
{
"id": "string",
"kind": "photo",
"contentType": "image/jpeg",
"bytes": 0,
"lat": 0,
"lng": 0,
"by": "string",
"createdAt": "2026-10-15T09:00:00+01:00"
}
],
"endNote": "string",
"recipientEmail": "string",
"proofRequired": [
"photo"
],
"proofRequiredOverride": [
"string"
],
"packageSize": "small",
"itemDescription": "string",
"reference": "string",
"scheduledAt": "2026-10-15T09:00:00+01:00",
"connectionId": "string",
"acceptedAt": "2026-10-15T09:00:00+01:00",
"startedAt": "2026-10-15T09:00:00+01:00",
"editable": "all",
"editedAt": "2026-10-15T09:00:00+01:00",
"editedFields": [
"string"
],
"pinDelivery": {
"channel": "whatsapp",
"state": "sending",
"whatsappErrorCode": 0,
"needsEmail": true,
"updatedAt": "2026-10-15T09:00:00+01:00"
}
}Erros
409TASK_UNDER_WAY (agora só notes e dueAt podem mudar) ou TASK_ENDED.defaultErro
Atribuir (ou reatribuir) um veículo — created|assigned → assigned; evento task.assigned
POST https://nways.ng/maps/v1/fleet/tasks/{id}/assign
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
id | caminho | string | Obrigatório. |
Corpo do pedido
| Campo | Tipo | Descrição |
|---|---|---|
vehicleId | string | Obrigatório. |
curl -X POST "https://nways.ng/maps/v1/fleet/tasks/string/assign" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API" \
-H "Content-Type: application/json" \
-d '{"vehicleId":"string"}'const res = await fetch('https://nways.ng/maps/v1/fleet/tasks/string/assign', {
method: 'POST',
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"vehicleId": "string"
}),
})
const data = await res.json()import os
import requests
res = requests.post(
"https://nways.ng/maps/v1/fleet/tasks/string/assign",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
json={"vehicleId": "string"},
timeout=10,
)
data = res.json()Resposta
Tarefa
| Campo | Tipo | Descrição |
|---|---|---|
id | string | Obrigatório. |
ref | string | Obrigatório. O número curto da entrega no projeto, atribuído pela N-Ways ("1042", mostrado como #1042): para pessoas, em alertas e listas. |
status | string | Obrigatório. Um de: created, assigned, picked_up, arriving, completed, failed, cancelled. |
vehicleId | string | null | Obrigatório. |
pickup | Stop | null | Obrigatório. |
dropoff | Stop | Obrigatório. |
dropoff.lat | number | Obrigatório. |
dropoff.lng | number | Obrigatório. |
dropoff.name | string | Até 120 caracteres. |
dropoff.address | string | Até 300 caracteres. |
recipientName | string | Obrigatório. |
recipientPhone | string | |
notes | string | Obrigatório. |
lang | string | Obrigatório. Um de: en, fr, pt. |
arrivingS | integer | Obrigatório. |
eta | ETA | null | Obrigatório. Nulo até chegar uma posição recente, e depois de a tarefa terminar. |
dueAt | string (date-time) | null | Obrigatório. |
late | boolean | Obrigatório. Em aberto e com dueAt ultrapassado, ou prevista para depois dele. |
trackingUrl | string (uri) | null | Obrigatório. Nulo depois de expirar. |
trackingExpiresAt | string (date-time) | null | Obrigatório. |
failureReason | string | |
createdAt | string (date-time) | Obrigatório. |
assignedAt | string (date-time) | null | Obrigatório. |
pickedUpAt | string (date-time) | null | Obrigatório. |
arrivingAt | string (date-time) | null | Obrigatório. |
endedAt | string (date-time) | null | Obrigatório. |
area | Area | null | A área própria da entrega: sair dela gera asset.geofence_exit. |
proofs | Proof[] | Apenas em GET /tasks/{id}: as fotografias e assinaturas do estafeta (N-Ways Business). |
proofs[].id | string | Obrigatório. |
proofs[].kind | string | Obrigatório. Um de: photo, signature. |
proofs[].contentType | string | Obrigatório. Um de: image/jpeg, image/png, image/webp. |
proofs[].bytes | integer | Obrigatório. |
proofs[].lat | number | null | Obrigatório. |
proofs[].lng | number | null | Obrigatório. |
proofs[].by | string | Obrigatório. O nome do estafeta. |
proofs[].createdAt | string (date-time) | Obrigatório. |
endNote | string | Apenas em GET /tasks/{id}: o que o estafeta escreveu ao terminar. |
recipientEmail | string | |
proofRequired | string[] | O da própria entrega, senão o das suas definições. |
proofRequiredOverride | string[] | null | |
packageSize | string | null | Um de: small, medium, large, null. |
itemDescription | string | |
reference | string | |
scheduledAt | string (date-time) | null | |
connectionId | string | null | A ligação do motorista N-Ways que a aceitou. |
acceptedAt | string (date-time) | null | |
startedAt | string (date-time) | null | |
editable | string | O que PATCH /tasks/{id} pode alterar agora: tudo, apenas notes e dueAt (recolhida ou iniciada), ou nada (terminada). Um de: all, limited, none. |
editedAt | string (date-time) | null | A última edição. |
editedFields | string[] | O que a última edição alterou. |
pinDelivery | PinDelivery | Como o PIN de entrega está a chegar ao cliente, quando a entrega pede um e os PIN vão por WhatsApp. Nunca o próprio PIN. |
pinDelivery.channel | string | Obrigatório. Um de: whatsapp, email, none. |
pinDelivery.state | string | Obrigatório. Um de: sending, sent, delivered, read, failed. |
pinDelivery.whatsappErrorCode | integer | null | Obrigatório. A falha do WhatsApp (131026: não está no WhatsApp), guardada depois de o PIN ter ido por e-mail. |
pinDelivery.needsEmail | boolean | Obrigatório. O cliente não recebeu o PIN: envie-o com POST /tasks/{id}/pin-email. |
pinDelivery.updatedAt | string (date-time) | Obrigatório. |
{
"id": "string",
"ref": "string",
"status": "created",
"vehicleId": "string",
"pickup": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"dropoff": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"recipientName": "string",
"recipientPhone": "string",
"notes": "string",
"lang": "en",
"arrivingS": 0,
"eta": {
"at": "2026-10-15T09:00:00+01:00",
"durationS": 0,
"distanceM": 0,
"trafficDelayS": 0,
"pickupAt": "2026-10-15T09:00:00+01:00",
"updatedAt": "2026-10-15T09:00:00+01:00"
},
"dueAt": "2026-10-15T09:00:00+01:00",
"late": true,
"trackingUrl": "string",
"trackingExpiresAt": "2026-10-15T09:00:00+01:00",
"failureReason": "string",
"createdAt": "2026-10-15T09:00:00+01:00",
"assignedAt": "2026-10-15T09:00:00+01:00",
"pickedUpAt": "2026-10-15T09:00:00+01:00",
"arrivingAt": "2026-10-15T09:00:00+01:00",
"endedAt": "2026-10-15T09:00:00+01:00",
"area": {
"type": "circle",
"lat": 6.48,
"lng": 3.43,
"radiusM": 2500
},
"proofs": [
{
"id": "string",
"kind": "photo",
"contentType": "image/jpeg",
"bytes": 0,
"lat": 0,
"lng": 0,
"by": "string",
"createdAt": "2026-10-15T09:00:00+01:00"
}
],
"endNote": "string",
"recipientEmail": "string",
"proofRequired": [
"photo"
],
"proofRequiredOverride": [
"string"
],
"packageSize": "small",
"itemDescription": "string",
"reference": "string",
"scheduledAt": "2026-10-15T09:00:00+01:00",
"connectionId": "string",
"acceptedAt": "2026-10-15T09:00:00+01:00",
"startedAt": "2026-10-15T09:00:00+01:00",
"editable": "all",
"editedAt": "2026-10-15T09:00:00+01:00",
"editedFields": [
"string"
],
"pinDelivery": {
"channel": "whatsapp",
"state": "sending",
"whatsappErrorCode": 0,
"needsEmail": true,
"updatedAt": "2026-10-15T09:00:00+01:00"
}
}Erros
defaultErro
Marcar como recolhida — assigned → picked_up
POST https://nways.ng/maps/v1/fleet/tasks/{id}/pickup
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
id | caminho | string | Obrigatório. |
curl -X POST "https://nways.ng/maps/v1/fleet/tasks/string/pickup" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API"const res = await fetch('https://nways.ng/maps/v1/fleet/tasks/string/pickup', {
method: 'POST',
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.post(
"https://nways.ng/maps/v1/fleet/tasks/string/pickup",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Resposta
Tarefa
| Campo | Tipo | Descrição |
|---|---|---|
id | string | Obrigatório. |
ref | string | Obrigatório. O número curto da entrega no projeto, atribuído pela N-Ways ("1042", mostrado como #1042): para pessoas, em alertas e listas. |
status | string | Obrigatório. Um de: created, assigned, picked_up, arriving, completed, failed, cancelled. |
vehicleId | string | null | Obrigatório. |
pickup | Stop | null | Obrigatório. |
dropoff | Stop | Obrigatório. |
dropoff.lat | number | Obrigatório. |
dropoff.lng | number | Obrigatório. |
dropoff.name | string | Até 120 caracteres. |
dropoff.address | string | Até 300 caracteres. |
recipientName | string | Obrigatório. |
recipientPhone | string | |
notes | string | Obrigatório. |
lang | string | Obrigatório. Um de: en, fr, pt. |
arrivingS | integer | Obrigatório. |
eta | ETA | null | Obrigatório. Nulo até chegar uma posição recente, e depois de a tarefa terminar. |
dueAt | string (date-time) | null | Obrigatório. |
late | boolean | Obrigatório. Em aberto e com dueAt ultrapassado, ou prevista para depois dele. |
trackingUrl | string (uri) | null | Obrigatório. Nulo depois de expirar. |
trackingExpiresAt | string (date-time) | null | Obrigatório. |
failureReason | string | |
createdAt | string (date-time) | Obrigatório. |
assignedAt | string (date-time) | null | Obrigatório. |
pickedUpAt | string (date-time) | null | Obrigatório. |
arrivingAt | string (date-time) | null | Obrigatório. |
endedAt | string (date-time) | null | Obrigatório. |
area | Area | null | A área própria da entrega: sair dela gera asset.geofence_exit. |
proofs | Proof[] | Apenas em GET /tasks/{id}: as fotografias e assinaturas do estafeta (N-Ways Business). |
proofs[].id | string | Obrigatório. |
proofs[].kind | string | Obrigatório. Um de: photo, signature. |
proofs[].contentType | string | Obrigatório. Um de: image/jpeg, image/png, image/webp. |
proofs[].bytes | integer | Obrigatório. |
proofs[].lat | number | null | Obrigatório. |
proofs[].lng | number | null | Obrigatório. |
proofs[].by | string | Obrigatório. O nome do estafeta. |
proofs[].createdAt | string (date-time) | Obrigatório. |
endNote | string | Apenas em GET /tasks/{id}: o que o estafeta escreveu ao terminar. |
recipientEmail | string | |
proofRequired | string[] | O da própria entrega, senão o das suas definições. |
proofRequiredOverride | string[] | null | |
packageSize | string | null | Um de: small, medium, large, null. |
itemDescription | string | |
reference | string | |
scheduledAt | string (date-time) | null | |
connectionId | string | null | A ligação do motorista N-Ways que a aceitou. |
acceptedAt | string (date-time) | null | |
startedAt | string (date-time) | null | |
editable | string | O que PATCH /tasks/{id} pode alterar agora: tudo, apenas notes e dueAt (recolhida ou iniciada), ou nada (terminada). Um de: all, limited, none. |
editedAt | string (date-time) | null | A última edição. |
editedFields | string[] | O que a última edição alterou. |
pinDelivery | PinDelivery | Como o PIN de entrega está a chegar ao cliente, quando a entrega pede um e os PIN vão por WhatsApp. Nunca o próprio PIN. |
pinDelivery.channel | string | Obrigatório. Um de: whatsapp, email, none. |
pinDelivery.state | string | Obrigatório. Um de: sending, sent, delivered, read, failed. |
pinDelivery.whatsappErrorCode | integer | null | Obrigatório. A falha do WhatsApp (131026: não está no WhatsApp), guardada depois de o PIN ter ido por e-mail. |
pinDelivery.needsEmail | boolean | Obrigatório. O cliente não recebeu o PIN: envie-o com POST /tasks/{id}/pin-email. |
pinDelivery.updatedAt | string (date-time) | Obrigatório. |
{
"id": "string",
"ref": "string",
"status": "created",
"vehicleId": "string",
"pickup": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"dropoff": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"recipientName": "string",
"recipientPhone": "string",
"notes": "string",
"lang": "en",
"arrivingS": 0,
"eta": {
"at": "2026-10-15T09:00:00+01:00",
"durationS": 0,
"distanceM": 0,
"trafficDelayS": 0,
"pickupAt": "2026-10-15T09:00:00+01:00",
"updatedAt": "2026-10-15T09:00:00+01:00"
},
"dueAt": "2026-10-15T09:00:00+01:00",
"late": true,
"trackingUrl": "string",
"trackingExpiresAt": "2026-10-15T09:00:00+01:00",
"failureReason": "string",
"createdAt": "2026-10-15T09:00:00+01:00",
"assignedAt": "2026-10-15T09:00:00+01:00",
"pickedUpAt": "2026-10-15T09:00:00+01:00",
"arrivingAt": "2026-10-15T09:00:00+01:00",
"endedAt": "2026-10-15T09:00:00+01:00",
"area": {
"type": "circle",
"lat": 6.48,
"lng": 3.43,
"radiusM": 2500
},
"proofs": [
{
"id": "string",
"kind": "photo",
"contentType": "image/jpeg",
"bytes": 0,
"lat": 0,
"lng": 0,
"by": "string",
"createdAt": "2026-10-15T09:00:00+01:00"
}
],
"endNote": "string",
"recipientEmail": "string",
"proofRequired": [
"photo"
],
"proofRequiredOverride": [
"string"
],
"packageSize": "small",
"itemDescription": "string",
"reference": "string",
"scheduledAt": "2026-10-15T09:00:00+01:00",
"connectionId": "string",
"acceptedAt": "2026-10-15T09:00:00+01:00",
"startedAt": "2026-10-15T09:00:00+01:00",
"editable": "all",
"editedAt": "2026-10-15T09:00:00+01:00",
"editedFields": [
"string"
],
"pinDelivery": {
"channel": "whatsapp",
"state": "sending",
"whatsappErrorCode": 0,
"needsEmail": true,
"updatedAt": "2026-10-15T09:00:00+01:00"
}
}Erros
defaultErro
Marcar como entregue — assigned|picked_up|arriving → completed; evento task.completed
POST https://nways.ng/maps/v1/fleet/tasks/{id}/complete
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
id | caminho | string | Obrigatório. |
curl -X POST "https://nways.ng/maps/v1/fleet/tasks/string/complete" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API"const res = await fetch('https://nways.ng/maps/v1/fleet/tasks/string/complete', {
method: 'POST',
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.post(
"https://nways.ng/maps/v1/fleet/tasks/string/complete",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Resposta
Tarefa
| Campo | Tipo | Descrição |
|---|---|---|
id | string | Obrigatório. |
ref | string | Obrigatório. O número curto da entrega no projeto, atribuído pela N-Ways ("1042", mostrado como #1042): para pessoas, em alertas e listas. |
status | string | Obrigatório. Um de: created, assigned, picked_up, arriving, completed, failed, cancelled. |
vehicleId | string | null | Obrigatório. |
pickup | Stop | null | Obrigatório. |
dropoff | Stop | Obrigatório. |
dropoff.lat | number | Obrigatório. |
dropoff.lng | number | Obrigatório. |
dropoff.name | string | Até 120 caracteres. |
dropoff.address | string | Até 300 caracteres. |
recipientName | string | Obrigatório. |
recipientPhone | string | |
notes | string | Obrigatório. |
lang | string | Obrigatório. Um de: en, fr, pt. |
arrivingS | integer | Obrigatório. |
eta | ETA | null | Obrigatório. Nulo até chegar uma posição recente, e depois de a tarefa terminar. |
dueAt | string (date-time) | null | Obrigatório. |
late | boolean | Obrigatório. Em aberto e com dueAt ultrapassado, ou prevista para depois dele. |
trackingUrl | string (uri) | null | Obrigatório. Nulo depois de expirar. |
trackingExpiresAt | string (date-time) | null | Obrigatório. |
failureReason | string | |
createdAt | string (date-time) | Obrigatório. |
assignedAt | string (date-time) | null | Obrigatório. |
pickedUpAt | string (date-time) | null | Obrigatório. |
arrivingAt | string (date-time) | null | Obrigatório. |
endedAt | string (date-time) | null | Obrigatório. |
area | Area | null | A área própria da entrega: sair dela gera asset.geofence_exit. |
proofs | Proof[] | Apenas em GET /tasks/{id}: as fotografias e assinaturas do estafeta (N-Ways Business). |
proofs[].id | string | Obrigatório. |
proofs[].kind | string | Obrigatório. Um de: photo, signature. |
proofs[].contentType | string | Obrigatório. Um de: image/jpeg, image/png, image/webp. |
proofs[].bytes | integer | Obrigatório. |
proofs[].lat | number | null | Obrigatório. |
proofs[].lng | number | null | Obrigatório. |
proofs[].by | string | Obrigatório. O nome do estafeta. |
proofs[].createdAt | string (date-time) | Obrigatório. |
endNote | string | Apenas em GET /tasks/{id}: o que o estafeta escreveu ao terminar. |
recipientEmail | string | |
proofRequired | string[] | O da própria entrega, senão o das suas definições. |
proofRequiredOverride | string[] | null | |
packageSize | string | null | Um de: small, medium, large, null. |
itemDescription | string | |
reference | string | |
scheduledAt | string (date-time) | null | |
connectionId | string | null | A ligação do motorista N-Ways que a aceitou. |
acceptedAt | string (date-time) | null | |
startedAt | string (date-time) | null | |
editable | string | O que PATCH /tasks/{id} pode alterar agora: tudo, apenas notes e dueAt (recolhida ou iniciada), ou nada (terminada). Um de: all, limited, none. |
editedAt | string (date-time) | null | A última edição. |
editedFields | string[] | O que a última edição alterou. |
pinDelivery | PinDelivery | Como o PIN de entrega está a chegar ao cliente, quando a entrega pede um e os PIN vão por WhatsApp. Nunca o próprio PIN. |
pinDelivery.channel | string | Obrigatório. Um de: whatsapp, email, none. |
pinDelivery.state | string | Obrigatório. Um de: sending, sent, delivered, read, failed. |
pinDelivery.whatsappErrorCode | integer | null | Obrigatório. A falha do WhatsApp (131026: não está no WhatsApp), guardada depois de o PIN ter ido por e-mail. |
pinDelivery.needsEmail | boolean | Obrigatório. O cliente não recebeu o PIN: envie-o com POST /tasks/{id}/pin-email. |
pinDelivery.updatedAt | string (date-time) | Obrigatório. |
{
"id": "string",
"ref": "string",
"status": "created",
"vehicleId": "string",
"pickup": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"dropoff": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"recipientName": "string",
"recipientPhone": "string",
"notes": "string",
"lang": "en",
"arrivingS": 0,
"eta": {
"at": "2026-10-15T09:00:00+01:00",
"durationS": 0,
"distanceM": 0,
"trafficDelayS": 0,
"pickupAt": "2026-10-15T09:00:00+01:00",
"updatedAt": "2026-10-15T09:00:00+01:00"
},
"dueAt": "2026-10-15T09:00:00+01:00",
"late": true,
"trackingUrl": "string",
"trackingExpiresAt": "2026-10-15T09:00:00+01:00",
"failureReason": "string",
"createdAt": "2026-10-15T09:00:00+01:00",
"assignedAt": "2026-10-15T09:00:00+01:00",
"pickedUpAt": "2026-10-15T09:00:00+01:00",
"arrivingAt": "2026-10-15T09:00:00+01:00",
"endedAt": "2026-10-15T09:00:00+01:00",
"area": {
"type": "circle",
"lat": 6.48,
"lng": 3.43,
"radiusM": 2500
},
"proofs": [
{
"id": "string",
"kind": "photo",
"contentType": "image/jpeg",
"bytes": 0,
"lat": 0,
"lng": 0,
"by": "string",
"createdAt": "2026-10-15T09:00:00+01:00"
}
],
"endNote": "string",
"recipientEmail": "string",
"proofRequired": [
"photo"
],
"proofRequiredOverride": [
"string"
],
"packageSize": "small",
"itemDescription": "string",
"reference": "string",
"scheduledAt": "2026-10-15T09:00:00+01:00",
"connectionId": "string",
"acceptedAt": "2026-10-15T09:00:00+01:00",
"startedAt": "2026-10-15T09:00:00+01:00",
"editable": "all",
"editedAt": "2026-10-15T09:00:00+01:00",
"editedFields": [
"string"
],
"pinDelivery": {
"channel": "whatsapp",
"state": "sending",
"whatsappErrorCode": 0,
"needsEmail": true,
"updatedAt": "2026-10-15T09:00:00+01:00"
}
}Erros
defaultErro
Marcar como falhada — qualquer estado em aberto → failed; evento task.failed
POST https://nways.ng/maps/v1/fleet/tasks/{id}/fail
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
id | caminho | string | Obrigatório. |
Corpo do pedido
| Campo | Tipo | Descrição |
|---|---|---|
reason | string | Até 200 caracteres. |
curl -X POST "https://nways.ng/maps/v1/fleet/tasks/string/fail" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API" \
-H "Content-Type: application/json" \
-d '{"reason":"string"}'const res = await fetch('https://nways.ng/maps/v1/fleet/tasks/string/fail', {
method: 'POST',
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"reason": "string"
}),
})
const data = await res.json()import os
import requests
res = requests.post(
"https://nways.ng/maps/v1/fleet/tasks/string/fail",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
json={"reason": "string"},
timeout=10,
)
data = res.json()Resposta
Tarefa
| Campo | Tipo | Descrição |
|---|---|---|
id | string | Obrigatório. |
ref | string | Obrigatório. O número curto da entrega no projeto, atribuído pela N-Ways ("1042", mostrado como #1042): para pessoas, em alertas e listas. |
status | string | Obrigatório. Um de: created, assigned, picked_up, arriving, completed, failed, cancelled. |
vehicleId | string | null | Obrigatório. |
pickup | Stop | null | Obrigatório. |
dropoff | Stop | Obrigatório. |
dropoff.lat | number | Obrigatório. |
dropoff.lng | number | Obrigatório. |
dropoff.name | string | Até 120 caracteres. |
dropoff.address | string | Até 300 caracteres. |
recipientName | string | Obrigatório. |
recipientPhone | string | |
notes | string | Obrigatório. |
lang | string | Obrigatório. Um de: en, fr, pt. |
arrivingS | integer | Obrigatório. |
eta | ETA | null | Obrigatório. Nulo até chegar uma posição recente, e depois de a tarefa terminar. |
dueAt | string (date-time) | null | Obrigatório. |
late | boolean | Obrigatório. Em aberto e com dueAt ultrapassado, ou prevista para depois dele. |
trackingUrl | string (uri) | null | Obrigatório. Nulo depois de expirar. |
trackingExpiresAt | string (date-time) | null | Obrigatório. |
failureReason | string | |
createdAt | string (date-time) | Obrigatório. |
assignedAt | string (date-time) | null | Obrigatório. |
pickedUpAt | string (date-time) | null | Obrigatório. |
arrivingAt | string (date-time) | null | Obrigatório. |
endedAt | string (date-time) | null | Obrigatório. |
area | Area | null | A área própria da entrega: sair dela gera asset.geofence_exit. |
proofs | Proof[] | Apenas em GET /tasks/{id}: as fotografias e assinaturas do estafeta (N-Ways Business). |
proofs[].id | string | Obrigatório. |
proofs[].kind | string | Obrigatório. Um de: photo, signature. |
proofs[].contentType | string | Obrigatório. Um de: image/jpeg, image/png, image/webp. |
proofs[].bytes | integer | Obrigatório. |
proofs[].lat | number | null | Obrigatório. |
proofs[].lng | number | null | Obrigatório. |
proofs[].by | string | Obrigatório. O nome do estafeta. |
proofs[].createdAt | string (date-time) | Obrigatório. |
endNote | string | Apenas em GET /tasks/{id}: o que o estafeta escreveu ao terminar. |
recipientEmail | string | |
proofRequired | string[] | O da própria entrega, senão o das suas definições. |
proofRequiredOverride | string[] | null | |
packageSize | string | null | Um de: small, medium, large, null. |
itemDescription | string | |
reference | string | |
scheduledAt | string (date-time) | null | |
connectionId | string | null | A ligação do motorista N-Ways que a aceitou. |
acceptedAt | string (date-time) | null | |
startedAt | string (date-time) | null | |
editable | string | O que PATCH /tasks/{id} pode alterar agora: tudo, apenas notes e dueAt (recolhida ou iniciada), ou nada (terminada). Um de: all, limited, none. |
editedAt | string (date-time) | null | A última edição. |
editedFields | string[] | O que a última edição alterou. |
pinDelivery | PinDelivery | Como o PIN de entrega está a chegar ao cliente, quando a entrega pede um e os PIN vão por WhatsApp. Nunca o próprio PIN. |
pinDelivery.channel | string | Obrigatório. Um de: whatsapp, email, none. |
pinDelivery.state | string | Obrigatório. Um de: sending, sent, delivered, read, failed. |
pinDelivery.whatsappErrorCode | integer | null | Obrigatório. A falha do WhatsApp (131026: não está no WhatsApp), guardada depois de o PIN ter ido por e-mail. |
pinDelivery.needsEmail | boolean | Obrigatório. O cliente não recebeu o PIN: envie-o com POST /tasks/{id}/pin-email. |
pinDelivery.updatedAt | string (date-time) | Obrigatório. |
{
"id": "string",
"ref": "string",
"status": "created",
"vehicleId": "string",
"pickup": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"dropoff": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"recipientName": "string",
"recipientPhone": "string",
"notes": "string",
"lang": "en",
"arrivingS": 0,
"eta": {
"at": "2026-10-15T09:00:00+01:00",
"durationS": 0,
"distanceM": 0,
"trafficDelayS": 0,
"pickupAt": "2026-10-15T09:00:00+01:00",
"updatedAt": "2026-10-15T09:00:00+01:00"
},
"dueAt": "2026-10-15T09:00:00+01:00",
"late": true,
"trackingUrl": "string",
"trackingExpiresAt": "2026-10-15T09:00:00+01:00",
"failureReason": "string",
"createdAt": "2026-10-15T09:00:00+01:00",
"assignedAt": "2026-10-15T09:00:00+01:00",
"pickedUpAt": "2026-10-15T09:00:00+01:00",
"arrivingAt": "2026-10-15T09:00:00+01:00",
"endedAt": "2026-10-15T09:00:00+01:00",
"area": {
"type": "circle",
"lat": 6.48,
"lng": 3.43,
"radiusM": 2500
},
"proofs": [
{
"id": "string",
"kind": "photo",
"contentType": "image/jpeg",
"bytes": 0,
"lat": 0,
"lng": 0,
"by": "string",
"createdAt": "2026-10-15T09:00:00+01:00"
}
],
"endNote": "string",
"recipientEmail": "string",
"proofRequired": [
"photo"
],
"proofRequiredOverride": [
"string"
],
"packageSize": "small",
"itemDescription": "string",
"reference": "string",
"scheduledAt": "2026-10-15T09:00:00+01:00",
"connectionId": "string",
"acceptedAt": "2026-10-15T09:00:00+01:00",
"startedAt": "2026-10-15T09:00:00+01:00",
"editable": "all",
"editedAt": "2026-10-15T09:00:00+01:00",
"editedFields": [
"string"
],
"pinDelivery": {
"channel": "whatsapp",
"state": "sending",
"whatsappErrorCode": 0,
"needsEmail": true,
"updatedAt": "2026-10-15T09:00:00+01:00"
}
}Erros
defaultErro
Cancelar — qualquer estado em aberto → cancelled
POST https://nways.ng/maps/v1/fleet/tasks/{id}/cancel
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
id | caminho | string | Obrigatório. |
curl -X POST "https://nways.ng/maps/v1/fleet/tasks/string/cancel" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API"const res = await fetch('https://nways.ng/maps/v1/fleet/tasks/string/cancel', {
method: 'POST',
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.post(
"https://nways.ng/maps/v1/fleet/tasks/string/cancel",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Resposta
Tarefa
| Campo | Tipo | Descrição |
|---|---|---|
id | string | Obrigatório. |
ref | string | Obrigatório. O número curto da entrega no projeto, atribuído pela N-Ways ("1042", mostrado como #1042): para pessoas, em alertas e listas. |
status | string | Obrigatório. Um de: created, assigned, picked_up, arriving, completed, failed, cancelled. |
vehicleId | string | null | Obrigatório. |
pickup | Stop | null | Obrigatório. |
dropoff | Stop | Obrigatório. |
dropoff.lat | number | Obrigatório. |
dropoff.lng | number | Obrigatório. |
dropoff.name | string | Até 120 caracteres. |
dropoff.address | string | Até 300 caracteres. |
recipientName | string | Obrigatório. |
recipientPhone | string | |
notes | string | Obrigatório. |
lang | string | Obrigatório. Um de: en, fr, pt. |
arrivingS | integer | Obrigatório. |
eta | ETA | null | Obrigatório. Nulo até chegar uma posição recente, e depois de a tarefa terminar. |
dueAt | string (date-time) | null | Obrigatório. |
late | boolean | Obrigatório. Em aberto e com dueAt ultrapassado, ou prevista para depois dele. |
trackingUrl | string (uri) | null | Obrigatório. Nulo depois de expirar. |
trackingExpiresAt | string (date-time) | null | Obrigatório. |
failureReason | string | |
createdAt | string (date-time) | Obrigatório. |
assignedAt | string (date-time) | null | Obrigatório. |
pickedUpAt | string (date-time) | null | Obrigatório. |
arrivingAt | string (date-time) | null | Obrigatório. |
endedAt | string (date-time) | null | Obrigatório. |
area | Area | null | A área própria da entrega: sair dela gera asset.geofence_exit. |
proofs | Proof[] | Apenas em GET /tasks/{id}: as fotografias e assinaturas do estafeta (N-Ways Business). |
proofs[].id | string | Obrigatório. |
proofs[].kind | string | Obrigatório. Um de: photo, signature. |
proofs[].contentType | string | Obrigatório. Um de: image/jpeg, image/png, image/webp. |
proofs[].bytes | integer | Obrigatório. |
proofs[].lat | number | null | Obrigatório. |
proofs[].lng | number | null | Obrigatório. |
proofs[].by | string | Obrigatório. O nome do estafeta. |
proofs[].createdAt | string (date-time) | Obrigatório. |
endNote | string | Apenas em GET /tasks/{id}: o que o estafeta escreveu ao terminar. |
recipientEmail | string | |
proofRequired | string[] | O da própria entrega, senão o das suas definições. |
proofRequiredOverride | string[] | null | |
packageSize | string | null | Um de: small, medium, large, null. |
itemDescription | string | |
reference | string | |
scheduledAt | string (date-time) | null | |
connectionId | string | null | A ligação do motorista N-Ways que a aceitou. |
acceptedAt | string (date-time) | null | |
startedAt | string (date-time) | null | |
editable | string | O que PATCH /tasks/{id} pode alterar agora: tudo, apenas notes e dueAt (recolhida ou iniciada), ou nada (terminada). Um de: all, limited, none. |
editedAt | string (date-time) | null | A última edição. |
editedFields | string[] | O que a última edição alterou. |
pinDelivery | PinDelivery | Como o PIN de entrega está a chegar ao cliente, quando a entrega pede um e os PIN vão por WhatsApp. Nunca o próprio PIN. |
pinDelivery.channel | string | Obrigatório. Um de: whatsapp, email, none. |
pinDelivery.state | string | Obrigatório. Um de: sending, sent, delivered, read, failed. |
pinDelivery.whatsappErrorCode | integer | null | Obrigatório. A falha do WhatsApp (131026: não está no WhatsApp), guardada depois de o PIN ter ido por e-mail. |
pinDelivery.needsEmail | boolean | Obrigatório. O cliente não recebeu o PIN: envie-o com POST /tasks/{id}/pin-email. |
pinDelivery.updatedAt | string (date-time) | Obrigatório. |
{
"id": "string",
"ref": "string",
"status": "created",
"vehicleId": "string",
"pickup": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"dropoff": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"recipientName": "string",
"recipientPhone": "string",
"notes": "string",
"lang": "en",
"arrivingS": 0,
"eta": {
"at": "2026-10-15T09:00:00+01:00",
"durationS": 0,
"distanceM": 0,
"trafficDelayS": 0,
"pickupAt": "2026-10-15T09:00:00+01:00",
"updatedAt": "2026-10-15T09:00:00+01:00"
},
"dueAt": "2026-10-15T09:00:00+01:00",
"late": true,
"trackingUrl": "string",
"trackingExpiresAt": "2026-10-15T09:00:00+01:00",
"failureReason": "string",
"createdAt": "2026-10-15T09:00:00+01:00",
"assignedAt": "2026-10-15T09:00:00+01:00",
"pickedUpAt": "2026-10-15T09:00:00+01:00",
"arrivingAt": "2026-10-15T09:00:00+01:00",
"endedAt": "2026-10-15T09:00:00+01:00",
"area": {
"type": "circle",
"lat": 6.48,
"lng": 3.43,
"radiusM": 2500
},
"proofs": [
{
"id": "string",
"kind": "photo",
"contentType": "image/jpeg",
"bytes": 0,
"lat": 0,
"lng": 0,
"by": "string",
"createdAt": "2026-10-15T09:00:00+01:00"
}
],
"endNote": "string",
"recipientEmail": "string",
"proofRequired": [
"photo"
],
"proofRequiredOverride": [
"string"
],
"packageSize": "small",
"itemDescription": "string",
"reference": "string",
"scheduledAt": "2026-10-15T09:00:00+01:00",
"connectionId": "string",
"acceptedAt": "2026-10-15T09:00:00+01:00",
"startedAt": "2026-10-15T09:00:00+01:00",
"editable": "all",
"editedAt": "2026-10-15T09:00:00+01:00",
"editedFields": [
"string"
],
"pinDelivery": {
"channel": "whatsapp",
"state": "sending",
"whatsappErrorCode": 0,
"needsEmail": true,
"updatedAt": "2026-10-15T09:00:00+01:00"
}
}Erros
defaultErro
Enviar o PIN de entrega do cliente para o seu e-mail
POST https://nways.ng/maps/v1/fleet/tasks/{id}/pin-email
Para uma entrega que pede um PIN, até terminar: guarda o e-mail na entrega e envia-lhe o PIN (a solução quando pinDelivery.needsEmail é true). Nunca vê o PIN.
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
id | caminho | string | Obrigatório. |
Corpo do pedido
| Campo | Tipo | Descrição |
|---|---|---|
email | string (email) | Obrigatório. |
curl -X POST "https://nways.ng/maps/v1/fleet/tasks/string/pin-email" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API" \
-H "Content-Type: application/json" \
-d '{"email":"ngozi@example.com"}'const res = await fetch('https://nways.ng/maps/v1/fleet/tasks/string/pin-email', {
method: 'POST',
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"email": "ngozi@example.com"
}),
})
const data = await res.json()import os
import requests
res = requests.post(
"https://nways.ng/maps/v1/fleet/tasks/string/pin-email",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
json={"email": "ngozi@example.com"},
timeout=10,
)
data = res.json()Resposta
A entrega
| Campo | Tipo | Descrição |
|---|---|---|
id | string | Obrigatório. |
ref | string | Obrigatório. O número curto da entrega no projeto, atribuído pela N-Ways ("1042", mostrado como #1042): para pessoas, em alertas e listas. |
status | string | Obrigatório. Um de: created, assigned, picked_up, arriving, completed, failed, cancelled. |
vehicleId | string | null | Obrigatório. |
pickup | Stop | null | Obrigatório. |
dropoff | Stop | Obrigatório. |
dropoff.lat | number | Obrigatório. |
dropoff.lng | number | Obrigatório. |
dropoff.name | string | Até 120 caracteres. |
dropoff.address | string | Até 300 caracteres. |
recipientName | string | Obrigatório. |
recipientPhone | string | |
notes | string | Obrigatório. |
lang | string | Obrigatório. Um de: en, fr, pt. |
arrivingS | integer | Obrigatório. |
eta | ETA | null | Obrigatório. Nulo até chegar uma posição recente, e depois de a tarefa terminar. |
dueAt | string (date-time) | null | Obrigatório. |
late | boolean | Obrigatório. Em aberto e com dueAt ultrapassado, ou prevista para depois dele. |
trackingUrl | string (uri) | null | Obrigatório. Nulo depois de expirar. |
trackingExpiresAt | string (date-time) | null | Obrigatório. |
failureReason | string | |
createdAt | string (date-time) | Obrigatório. |
assignedAt | string (date-time) | null | Obrigatório. |
pickedUpAt | string (date-time) | null | Obrigatório. |
arrivingAt | string (date-time) | null | Obrigatório. |
endedAt | string (date-time) | null | Obrigatório. |
area | Area | null | A área própria da entrega: sair dela gera asset.geofence_exit. |
proofs | Proof[] | Apenas em GET /tasks/{id}: as fotografias e assinaturas do estafeta (N-Ways Business). |
proofs[].id | string | Obrigatório. |
proofs[].kind | string | Obrigatório. Um de: photo, signature. |
proofs[].contentType | string | Obrigatório. Um de: image/jpeg, image/png, image/webp. |
proofs[].bytes | integer | Obrigatório. |
proofs[].lat | number | null | Obrigatório. |
proofs[].lng | number | null | Obrigatório. |
proofs[].by | string | Obrigatório. O nome do estafeta. |
proofs[].createdAt | string (date-time) | Obrigatório. |
endNote | string | Apenas em GET /tasks/{id}: o que o estafeta escreveu ao terminar. |
recipientEmail | string | |
proofRequired | string[] | O da própria entrega, senão o das suas definições. |
proofRequiredOverride | string[] | null | |
packageSize | string | null | Um de: small, medium, large, null. |
itemDescription | string | |
reference | string | |
scheduledAt | string (date-time) | null | |
connectionId | string | null | A ligação do motorista N-Ways que a aceitou. |
acceptedAt | string (date-time) | null | |
startedAt | string (date-time) | null | |
editable | string | O que PATCH /tasks/{id} pode alterar agora: tudo, apenas notes e dueAt (recolhida ou iniciada), ou nada (terminada). Um de: all, limited, none. |
editedAt | string (date-time) | null | A última edição. |
editedFields | string[] | O que a última edição alterou. |
pinDelivery | PinDelivery | Como o PIN de entrega está a chegar ao cliente, quando a entrega pede um e os PIN vão por WhatsApp. Nunca o próprio PIN. |
pinDelivery.channel | string | Obrigatório. Um de: whatsapp, email, none. |
pinDelivery.state | string | Obrigatório. Um de: sending, sent, delivered, read, failed. |
pinDelivery.whatsappErrorCode | integer | null | Obrigatório. A falha do WhatsApp (131026: não está no WhatsApp), guardada depois de o PIN ter ido por e-mail. |
pinDelivery.needsEmail | boolean | Obrigatório. O cliente não recebeu o PIN: envie-o com POST /tasks/{id}/pin-email. |
pinDelivery.updatedAt | string (date-time) | Obrigatório. |
{
"id": "string",
"ref": "string",
"status": "created",
"vehicleId": "string",
"pickup": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"dropoff": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"recipientName": "string",
"recipientPhone": "string",
"notes": "string",
"lang": "en",
"arrivingS": 0,
"eta": {
"at": "2026-10-15T09:00:00+01:00",
"durationS": 0,
"distanceM": 0,
"trafficDelayS": 0,
"pickupAt": "2026-10-15T09:00:00+01:00",
"updatedAt": "2026-10-15T09:00:00+01:00"
},
"dueAt": "2026-10-15T09:00:00+01:00",
"late": true,
"trackingUrl": "string",
"trackingExpiresAt": "2026-10-15T09:00:00+01:00",
"failureReason": "string",
"createdAt": "2026-10-15T09:00:00+01:00",
"assignedAt": "2026-10-15T09:00:00+01:00",
"pickedUpAt": "2026-10-15T09:00:00+01:00",
"arrivingAt": "2026-10-15T09:00:00+01:00",
"endedAt": "2026-10-15T09:00:00+01:00",
"area": {
"type": "circle",
"lat": 6.48,
"lng": 3.43,
"radiusM": 2500
},
"proofs": [
{
"id": "string",
"kind": "photo",
"contentType": "image/jpeg",
"bytes": 0,
"lat": 0,
"lng": 0,
"by": "string",
"createdAt": "2026-10-15T09:00:00+01:00"
}
],
"endNote": "string",
"recipientEmail": "string",
"proofRequired": [
"photo"
],
"proofRequiredOverride": [
"string"
],
"packageSize": "small",
"itemDescription": "string",
"reference": "string",
"scheduledAt": "2026-10-15T09:00:00+01:00",
"connectionId": "string",
"acceptedAt": "2026-10-15T09:00:00+01:00",
"startedAt": "2026-10-15T09:00:00+01:00",
"editable": "all",
"editedAt": "2026-10-15T09:00:00+01:00",
"editedFields": [
"string"
],
"pinDelivery": {
"channel": "whatsapp",
"state": "sending",
"whatsappErrorCode": 0,
"needsEmail": true,
"updatedAt": "2026-10-15T09:00:00+01:00"
}
}Erros
defaultErro
Se um PIN de entrega pode ir para um número no WhatsApp
GET https://nways.ng/maps/v1/fleet/whatsapp/number
O WhatsApp não consegue dizer antecipadamente se um número está no WhatsApp: known é um número para o qual o seu cliente já recebeu um PIN, unreachable um que o WhatsApp não conseguiu alcançar recentemente (uma entrega que pede um PIN precisa então de recipientEmail).
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
phone | consulta | string | Tal como foi escrito: +234…, ou à maneira local do seu país. Até 32 caracteres. |
curl "https://nways.ng/maps/v1/fleet/whatsapp/number" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API"const res = await fetch('https://nways.ng/maps/v1/fleet/whatsapp/number', {
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.get(
"https://nways.ng/maps/v1/fleet/whatsapp/number",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Resposta
O alcance do número
| Campo | Tipo | Descrição |
|---|---|---|
enabled | boolean | Obrigatório. Os PIN vão por WhatsApp. Quando é false, vão por e-mail e notificação push. |
phone | string | Obrigatório. O número em E.164 ("" quando não é um número). |
valid | boolean | Obrigatório. |
known | boolean | Obrigatório. |
unreachable | boolean | Obrigatório. |
{
"enabled": true,
"phone": "+2348031234567",
"valid": true,
"known": true,
"unreachable": true
}Erros
defaultErro
Definir ou limpar a área própria de uma entrega
POST https://nways.ng/maps/v1/fleet/tasks/{id}/area
Sair dela gera asset.geofence_exit (através das suas regras geofence_exit com a área dispatch, ou de uma regra por omissão).
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
id | caminho | string | Obrigatório. |
Corpo do pedido
| Campo | Tipo | Descrição |
|---|---|---|
area | Area | null | Obrigatório. |
curl -X POST "https://nways.ng/maps/v1/fleet/tasks/string/area" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API" \
-H "Content-Type: application/json" \
-d '{"area":{"type":"circle","lat":6.48,"lng":3.43,"radiusM":2500}}'const res = await fetch('https://nways.ng/maps/v1/fleet/tasks/string/area', {
method: 'POST',
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"area": {
"type": "circle",
"lat": 6.48,
"lng": 3.43,
"radiusM": 2500
}
}),
})
const data = await res.json()import os
import requests
res = requests.post(
"https://nways.ng/maps/v1/fleet/tasks/string/area",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
json={"area": {"type": "circle", "lat": 6.48, "lng": 3.43, "radiusM": 2500}},
timeout=10,
)
data = res.json()Resposta
A tarefa
| Campo | Tipo | Descrição |
|---|---|---|
id | string | Obrigatório. |
ref | string | Obrigatório. O número curto da entrega no projeto, atribuído pela N-Ways ("1042", mostrado como #1042): para pessoas, em alertas e listas. |
status | string | Obrigatório. Um de: created, assigned, picked_up, arriving, completed, failed, cancelled. |
vehicleId | string | null | Obrigatório. |
pickup | Stop | null | Obrigatório. |
dropoff | Stop | Obrigatório. |
dropoff.lat | number | Obrigatório. |
dropoff.lng | number | Obrigatório. |
dropoff.name | string | Até 120 caracteres. |
dropoff.address | string | Até 300 caracteres. |
recipientName | string | Obrigatório. |
recipientPhone | string | |
notes | string | Obrigatório. |
lang | string | Obrigatório. Um de: en, fr, pt. |
arrivingS | integer | Obrigatório. |
eta | ETA | null | Obrigatório. Nulo até chegar uma posição recente, e depois de a tarefa terminar. |
dueAt | string (date-time) | null | Obrigatório. |
late | boolean | Obrigatório. Em aberto e com dueAt ultrapassado, ou prevista para depois dele. |
trackingUrl | string (uri) | null | Obrigatório. Nulo depois de expirar. |
trackingExpiresAt | string (date-time) | null | Obrigatório. |
failureReason | string | |
createdAt | string (date-time) | Obrigatório. |
assignedAt | string (date-time) | null | Obrigatório. |
pickedUpAt | string (date-time) | null | Obrigatório. |
arrivingAt | string (date-time) | null | Obrigatório. |
endedAt | string (date-time) | null | Obrigatório. |
area | Area | null | A área própria da entrega: sair dela gera asset.geofence_exit. |
proofs | Proof[] | Apenas em GET /tasks/{id}: as fotografias e assinaturas do estafeta (N-Ways Business). |
proofs[].id | string | Obrigatório. |
proofs[].kind | string | Obrigatório. Um de: photo, signature. |
proofs[].contentType | string | Obrigatório. Um de: image/jpeg, image/png, image/webp. |
proofs[].bytes | integer | Obrigatório. |
proofs[].lat | number | null | Obrigatório. |
proofs[].lng | number | null | Obrigatório. |
proofs[].by | string | Obrigatório. O nome do estafeta. |
proofs[].createdAt | string (date-time) | Obrigatório. |
endNote | string | Apenas em GET /tasks/{id}: o que o estafeta escreveu ao terminar. |
recipientEmail | string | |
proofRequired | string[] | O da própria entrega, senão o das suas definições. |
proofRequiredOverride | string[] | null | |
packageSize | string | null | Um de: small, medium, large, null. |
itemDescription | string | |
reference | string | |
scheduledAt | string (date-time) | null | |
connectionId | string | null | A ligação do motorista N-Ways que a aceitou. |
acceptedAt | string (date-time) | null | |
startedAt | string (date-time) | null | |
editable | string | O que PATCH /tasks/{id} pode alterar agora: tudo, apenas notes e dueAt (recolhida ou iniciada), ou nada (terminada). Um de: all, limited, none. |
editedAt | string (date-time) | null | A última edição. |
editedFields | string[] | O que a última edição alterou. |
pinDelivery | PinDelivery | Como o PIN de entrega está a chegar ao cliente, quando a entrega pede um e os PIN vão por WhatsApp. Nunca o próprio PIN. |
pinDelivery.channel | string | Obrigatório. Um de: whatsapp, email, none. |
pinDelivery.state | string | Obrigatório. Um de: sending, sent, delivered, read, failed. |
pinDelivery.whatsappErrorCode | integer | null | Obrigatório. A falha do WhatsApp (131026: não está no WhatsApp), guardada depois de o PIN ter ido por e-mail. |
pinDelivery.needsEmail | boolean | Obrigatório. O cliente não recebeu o PIN: envie-o com POST /tasks/{id}/pin-email. |
pinDelivery.updatedAt | string (date-time) | Obrigatório. |
{
"id": "string",
"ref": "string",
"status": "created",
"vehicleId": "string",
"pickup": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"dropoff": {
"lat": 0,
"lng": 0,
"name": "string",
"address": "string"
},
"recipientName": "string",
"recipientPhone": "string",
"notes": "string",
"lang": "en",
"arrivingS": 0,
"eta": {
"at": "2026-10-15T09:00:00+01:00",
"durationS": 0,
"distanceM": 0,
"trafficDelayS": 0,
"pickupAt": "2026-10-15T09:00:00+01:00",
"updatedAt": "2026-10-15T09:00:00+01:00"
},
"dueAt": "2026-10-15T09:00:00+01:00",
"late": true,
"trackingUrl": "string",
"trackingExpiresAt": "2026-10-15T09:00:00+01:00",
"failureReason": "string",
"createdAt": "2026-10-15T09:00:00+01:00",
"assignedAt": "2026-10-15T09:00:00+01:00",
"pickedUpAt": "2026-10-15T09:00:00+01:00",
"arrivingAt": "2026-10-15T09:00:00+01:00",
"endedAt": "2026-10-15T09:00:00+01:00",
"area": {
"type": "circle",
"lat": 6.48,
"lng": 3.43,
"radiusM": 2500
},
"proofs": [
{
"id": "string",
"kind": "photo",
"contentType": "image/jpeg",
"bytes": 0,
"lat": 0,
"lng": 0,
"by": "string",
"createdAt": "2026-10-15T09:00:00+01:00"
}
],
"endNote": "string",
"recipientEmail": "string",
"proofRequired": [
"photo"
],
"proofRequiredOverride": [
"string"
],
"packageSize": "small",
"itemDescription": "string",
"reference": "string",
"scheduledAt": "2026-10-15T09:00:00+01:00",
"connectionId": "string",
"acceptedAt": "2026-10-15T09:00:00+01:00",
"startedAt": "2026-10-15T09:00:00+01:00",
"editable": "all",
"editedAt": "2026-10-15T09:00:00+01:00",
"editedFields": [
"string"
],
"pinDelivery": {
"channel": "whatsapp",
"state": "sending",
"whatsappErrorCode": 0,
"needsEmail": true,
"updatedAt": "2026-10-15T09:00:00+01:00"
}
}Erros
defaultErro
Listar os seus locais de recolha (o predefinido primeiro)
GET https://nways.ng/maps/v1/fleet/places
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
q | consulta | string | Encontra um nome, um endereço ou um código de porta. |
curl "https://nways.ng/maps/v1/fleet/places" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API"const res = await fetch('https://nways.ng/maps/v1/fleet/places', {
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.get(
"https://nways.ng/maps/v1/fleet/places",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Resposta
Locais
| Campo | Tipo | Descrição |
|---|---|---|
places | Place[] | Obrigatório. |
places[].id | string | Obrigatório. |
places[].name | string | Obrigatório. |
places[].doorCode | string | Obrigatório. O código de porta NIPOST ou GhanaPost pelo qual foi encontrado ("" para nenhum). |
places[].address | string | Obrigatório. |
places[].lat | number | Obrigatório. |
places[].lng | number | Obrigatório. |
places[].phone | string | Obrigatório. |
places[].hours | string | Obrigatório. |
places[].default | boolean | Obrigatório. As novas entregas na consola começam a partir dele. |
places[].createdAt | string (date-time) | Obrigatório. |
places[].updatedAt | string (date-time) | Obrigatório. |
{
"places": [
{
"id": "plc_4fQ9xLm2Za",
"name": "Yaba warehouse",
"doorCode": "string",
"address": "string",
"lat": 0,
"lng": 0,
"phone": "string",
"hours": "Mon–Sat 8:00–18:00",
"default": true,
"createdAt": "2026-10-15T09:00:00+01:00",
"updatedAt": "2026-10-15T09:00:00+01:00"
}
]
}Erros
defaultErro
Adicionar um local de recolha (até 200)
POST https://nways.ng/maps/v1/fleet/places
O seu primeiro local é o predefinido, salvo indicação em contrário; tornar um predefinido retira essa condição aos outros.
Corpo do pedido
name, lat e lng são obrigatórios para adicionar um.
| Campo | Tipo | Descrição |
|---|---|---|
name | string | Até 100 caracteres. |
doorCode | string | Até 32 caracteres. |
address | string | Até 300 caracteres. |
lat | number | |
lng | number | |
phone | string | Até 32 caracteres. |
hours | string | Até 200 caracteres. |
default | boolean |
curl -X POST "https://nways.ng/maps/v1/fleet/places" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API" \
-H "Content-Type: application/json" \
-d '{"name":"Yaba warehouse","doorCode":"LA14A18BE13","address":"12 Herbert Macaulay Way","lat":6.5095,"lng":3.3711,"phone":"+234 803 000 0000","hours":"Mon–Sat 8:00–18:00"}'const res = await fetch('https://nways.ng/maps/v1/fleet/places', {
method: 'POST',
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"name": "Yaba warehouse",
"doorCode": "LA14A18BE13",
"address": "12 Herbert Macaulay Way",
"lat": 6.5095,
"lng": 3.3711,
"phone": "+234 803 000 0000",
"hours": "Mon–Sat 8:00–18:00"
}),
})
const data = await res.json()import os
import requests
res = requests.post(
"https://nways.ng/maps/v1/fleet/places",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
json={"name": "Yaba warehouse", "doorCode": "LA14A18BE13", "address": "12 Herbert Macaulay Way", "lat": 6.5095, "lng": 3.3711, "phone": "+234 803 000 0000", "hours": "Mon–Sat 8:00–18:00"},
timeout=10,
)
data = res.json()Resposta
Criado
| Campo | Tipo | Descrição |
|---|---|---|
id | string | Obrigatório. |
name | string | Obrigatório. |
doorCode | string | Obrigatório. O código de porta NIPOST ou GhanaPost pelo qual foi encontrado ("" para nenhum). |
address | string | Obrigatório. |
lat | number | Obrigatório. |
lng | number | Obrigatório. |
phone | string | Obrigatório. |
hours | string | Obrigatório. |
default | boolean | Obrigatório. As novas entregas na consola começam a partir dele. |
createdAt | string (date-time) | Obrigatório. |
updatedAt | string (date-time) | Obrigatório. |
{
"id": "plc_4fQ9xLm2Za",
"name": "Yaba warehouse",
"doorCode": "string",
"address": "string",
"lat": 0,
"lng": 0,
"phone": "string",
"hours": "Mon–Sat 8:00–18:00",
"default": true,
"createdAt": "2026-10-15T09:00:00+01:00",
"updatedAt": "2026-10-15T09:00:00+01:00"
}Erros
defaultErro
Obter um local de recolha
GET https://nways.ng/maps/v1/fleet/places/{placeId}
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
placeId | caminho | string | Obrigatório. |
curl "https://nways.ng/maps/v1/fleet/places/plc_4fQ9xLm2Za" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API"const res = await fetch('https://nways.ng/maps/v1/fleet/places/plc_4fQ9xLm2Za', {
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.get(
"https://nways.ng/maps/v1/fleet/places/plc_4fQ9xLm2Za",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Resposta
Local
| Campo | Tipo | Descrição |
|---|---|---|
id | string | Obrigatório. |
name | string | Obrigatório. |
doorCode | string | Obrigatório. O código de porta NIPOST ou GhanaPost pelo qual foi encontrado ("" para nenhum). |
address | string | Obrigatório. |
lat | number | Obrigatório. |
lng | number | Obrigatório. |
phone | string | Obrigatório. |
hours | string | Obrigatório. |
default | boolean | Obrigatório. As novas entregas na consola começam a partir dele. |
createdAt | string (date-time) | Obrigatório. |
updatedAt | string (date-time) | Obrigatório. |
{
"id": "plc_4fQ9xLm2Za",
"name": "Yaba warehouse",
"doorCode": "string",
"address": "string",
"lat": 0,
"lng": 0,
"phone": "string",
"hours": "Mon–Sat 8:00–18:00",
"default": true,
"createdAt": "2026-10-15T09:00:00+01:00",
"updatedAt": "2026-10-15T09:00:00+01:00"
}Erros
defaultErro
Editar um local de recolha
PATCH https://nways.ng/maps/v1/fleet/places/{placeId}
As entregas já feitas a partir dele mantêm a recolha que lhes foi atribuída.
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
placeId | caminho | string | Obrigatório. |
Corpo do pedido
name, lat e lng são obrigatórios para adicionar um.
| Campo | Tipo | Descrição |
|---|---|---|
name | string | Até 100 caracteres. |
doorCode | string | Até 32 caracteres. |
address | string | Até 300 caracteres. |
lat | number | |
lng | number | |
phone | string | Até 32 caracteres. |
hours | string | Até 200 caracteres. |
default | boolean |
curl -X PATCH "https://nways.ng/maps/v1/fleet/places/plc_4fQ9xLm2Za" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API" \
-H "Content-Type: application/json" \
-d '{"name":"string","doorCode":"string","address":"string","lat":0,"lng":0,"phone":"string","hours":"string","default":true}'const res = await fetch('https://nways.ng/maps/v1/fleet/places/plc_4fQ9xLm2Za', {
method: 'PATCH',
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"name": "string",
"doorCode": "string",
"address": "string",
"lat": 0,
"lng": 0,
"phone": "string",
"hours": "string",
"default": true
}),
})
const data = await res.json()import os
import requests
res = requests.patch(
"https://nways.ng/maps/v1/fleet/places/plc_4fQ9xLm2Za",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
json={"name": "string", "doorCode": "string", "address": "string", "lat": 0, "lng": 0, "phone": "string", "hours": "string", "default": True},
timeout=10,
)
data = res.json()Resposta
Local
| Campo | Tipo | Descrição |
|---|---|---|
id | string | Obrigatório. |
name | string | Obrigatório. |
doorCode | string | Obrigatório. O código de porta NIPOST ou GhanaPost pelo qual foi encontrado ("" para nenhum). |
address | string | Obrigatório. |
lat | number | Obrigatório. |
lng | number | Obrigatório. |
phone | string | Obrigatório. |
hours | string | Obrigatório. |
default | boolean | Obrigatório. As novas entregas na consola começam a partir dele. |
createdAt | string (date-time) | Obrigatório. |
updatedAt | string (date-time) | Obrigatório. |
{
"id": "plc_4fQ9xLm2Za",
"name": "Yaba warehouse",
"doorCode": "string",
"address": "string",
"lat": 0,
"lng": 0,
"phone": "string",
"hours": "Mon–Sat 8:00–18:00",
"default": true,
"createdAt": "2026-10-15T09:00:00+01:00",
"updatedAt": "2026-10-15T09:00:00+01:00"
}Erros
defaultErro
Eliminar um local de recolha
DELETE https://nways.ng/maps/v1/fleet/places/{placeId}
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
placeId | caminho | string | Obrigatório. |
curl -X DELETE "https://nways.ng/maps/v1/fleet/places/plc_4fQ9xLm2Za" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API"const res = await fetch('https://nways.ng/maps/v1/fleet/places/plc_4fQ9xLm2Za', {
method: 'DELETE',
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.delete(
"https://nways.ng/maps/v1/fleet/places/plc_4fQ9xLm2Za",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Resposta
Eliminado
Sem conteúdo.
Erros
defaultErro
Listar os seus clientes, da entrega mais recente para a mais antiga
GET https://nways.ng/maps/v1/fleet/customers
Um cliente é todo aquele a quem as suas entregas foram feitas com o mesmo telefone (seja qual for a forma como foi escrito), senão o mesmo e-mail, senão o mesmo nome. Guardado a partir das suas entregas à medida que são criadas e editadas, durante um ano após a sua última entrega.
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
q | consulta | string | Encontra um nome, um e-mail ou qualquer parte de um número de telefone. |
limit | consulta | integer | Predefinição: 25. ≥ 1, ≤ 100. |
pageToken | consulta | string | nextPageToken (ou prevPageToken) de outra página. |
curl "https://nways.ng/maps/v1/fleet/customers" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API"const res = await fetch('https://nways.ng/maps/v1/fleet/customers', {
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.get(
"https://nways.ng/maps/v1/fleet/customers",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Resposta
Clientes
| Campo | Tipo | Descrição |
|---|---|---|
customers | Customer[] | Obrigatório. |
customers[].id | string | Obrigatório. |
customers[].name | string | Obrigatório. Tal como a entrega mais recente os designou. |
customers[].phone | string | Obrigatório. |
customers[].email | string | Obrigatório. |
customers[].deliveries | integer | Obrigatório. |
customers[].addresses | integer | Obrigatório. |
customers[].lastDeliveryAt | string (date-time) | Obrigatório. |
customers[].lastAddress | Address | null | Obrigatório. Para onde foi a entrega mais recente. |
nextPageToken | string | |
prevPageToken | string | |
offset | integer | Obrigatório. |
{
"customers": [
{
"id": "cus_4fQ9xLm2Za",
"name": "string",
"phone": "string",
"email": "string",
"deliveries": 0,
"addresses": 0,
"lastDeliveryAt": "2026-10-15T09:00:00+01:00",
"lastAddress": {
"id": "adr_8KwP2nVd5T",
"name": "string",
"address": "string",
"doorCode": "string",
"lat": 0,
"lng": 0,
"uses": 0,
"lastUsedAt": "2026-10-15T09:00:00+01:00"
}
}
],
"nextPageToken": "string",
"prevPageToken": "string",
"offset": 0
}Erros
defaultErro
Obter um cliente
GET https://nways.ng/maps/v1/fleet/customers/{customerId}
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
customerId | caminho | string | Obrigatório. |
curl "https://nways.ng/maps/v1/fleet/customers/cus_4fQ9xLm2Za" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API"const res = await fetch('https://nways.ng/maps/v1/fleet/customers/cus_4fQ9xLm2Za', {
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.get(
"https://nways.ng/maps/v1/fleet/customers/cus_4fQ9xLm2Za",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Resposta
Cliente
| Campo | Tipo | Descrição |
|---|---|---|
id | string | Obrigatório. |
name | string | Obrigatório. Tal como a entrega mais recente os designou. |
phone | string | Obrigatório. |
email | string | Obrigatório. |
deliveries | integer | Obrigatório. |
addresses | integer | Obrigatório. |
lastDeliveryAt | string (date-time) | Obrigatório. |
lastAddress | Address | null | Obrigatório. Para onde foi a entrega mais recente. |
{
"id": "cus_4fQ9xLm2Za",
"name": "string",
"phone": "string",
"email": "string",
"deliveries": 0,
"addresses": 0,
"lastDeliveryAt": "2026-10-15T09:00:00+01:00",
"lastAddress": {
"id": "adr_8KwP2nVd5T",
"name": "string",
"address": "string",
"doorCode": "string",
"lat": 0,
"lng": 0,
"uses": 0,
"lastUsedAt": "2026-10-15T09:00:00+01:00"
}
}Erros
defaultErro
Esquecer um cliente e os seus endereços
DELETE https://nways.ng/maps/v1/fleet/customers/{customerId}
Para um cliente que pede para ser esquecido. As suas entregas ficam, com a retenção da sua frota; uma nova entrega para ele dá origem a um novo cliente.
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
customerId | caminho | string | Obrigatório. |
curl -X DELETE "https://nways.ng/maps/v1/fleet/customers/cus_4fQ9xLm2Za" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API"const res = await fetch('https://nways.ng/maps/v1/fleet/customers/cus_4fQ9xLm2Za', {
method: 'DELETE',
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.delete(
"https://nways.ng/maps/v1/fleet/customers/cus_4fQ9xLm2Za",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Resposta
Esquecido
Sem conteúdo.
Erros
defaultErro
Listar os endereços de um cliente, do último usado para o mais antigo
GET https://nways.ng/maps/v1/fleet/customers/{customerId}/addresses
Cada local de entrega distinto (com cerca de 11 m de precisão) com o seu nome, endereço e código de porta mais recentes, quantas vezes foi usado e quando foi a última.
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
customerId | caminho | string | Obrigatório. |
q | consulta | string | Encontra um nome, um endereço ou um código de porta. |
limit | consulta | integer | Predefinição: 25. ≥ 1, ≤ 100. |
pageToken | consulta | string |
curl "https://nways.ng/maps/v1/fleet/customers/string/addresses" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API"const res = await fetch('https://nways.ng/maps/v1/fleet/customers/string/addresses', {
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.get(
"https://nways.ng/maps/v1/fleet/customers/string/addresses",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Resposta
Endereços
| Campo | Tipo | Descrição |
|---|---|---|
addresses | Address[] | Obrigatório. |
addresses[].id | string | Obrigatório. |
addresses[].name | string | Obrigatório. |
addresses[].address | string | Obrigatório. |
addresses[].doorCode | string | Obrigatório. O código NIPOST ou GhanaPost com que o endereço começa ("" para nenhum). |
addresses[].lat | number | Obrigatório. |
addresses[].lng | number | Obrigatório. |
addresses[].uses | integer | Obrigatório. Entregas que foram para lá. |
addresses[].lastUsedAt | string (date-time) | Obrigatório. |
total | integer | Obrigatório. Todos os endereços do cliente (não só os encontrados). |
nextPageToken | string | |
prevPageToken | string | |
offset | integer | Obrigatório. |
{
"addresses": [
{
"id": "adr_8KwP2nVd5T",
"name": "string",
"address": "string",
"doorCode": "string",
"lat": 0,
"lng": 0,
"uses": 0,
"lastUsedAt": "2026-10-15T09:00:00+01:00"
}
],
"total": 0,
"nextPageToken": "string",
"prevPageToken": "string",
"offset": 0
}Erros
defaultErro
A ligação de seguimento do destinatário (uma nova se tiver expirado; nenhuma depois de a tarefa terminar)
POST https://nways.ng/maps/v1/fleet/tasks/{id}/share
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
id | caminho | string | Obrigatório. |
curl -X POST "https://nways.ng/maps/v1/fleet/tasks/string/share" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_API"const res = await fetch('https://nways.ng/maps/v1/fleet/tasks/string/share', {
method: 'POST',
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.post(
"https://nways.ng/maps/v1/fleet/tasks/string/share",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Resposta
Ligação
| Campo | Tipo | Descrição |
|---|---|---|
url | string (uri) | Obrigatório. |
expiresAt | string (date-time) | Obrigatório. |
{
"url": "https://nways.ng/t/3fT9kQ2xVbN7LmP0aZc4RwYe",
"expiresAt": "2026-10-15T09:00:00+01:00"
}Erros
defaultErro