Eventos de Webhook

Após a ativação da assinatura, cada veículo é automaticamente inserido no contexto de monitoramento de débitos. O sistema acompanha continuamente as transações financeiras relacionadas aos veículos e gera eventos específicos conforme necessário, dentro da recorrência contratada.

Eventos Disponíveis

autoradar_vehicle_debt_found

Este evento é enviado quando um novo débito é encontrado para o veículo.

Exemplo de payload

{
	"id": "B1234",
	"event": "autoradar_vehicle_debt_found",
	"webhook": {
		"id": "B1234",
		"resource": "autoradar",
		"version": "v2"
	},
	"last_status": "sent",
	"data": {
		"debts": [
			{
				"id": "8J7SH08Q74Q0",
				"type": "licensing",
				"year": "2023",
				"amount": 160.23,
				"due_date": "2023-11-30",
				"expiration_date": null,
				"assessment_date": "2022-10-29",
				"description": "Licenciamento - 2022",
			},
			{
				"id": "8J7SH0XA74Q0",
				"type": "licensing",
				"year": "2023",
				"amount": 160.00,
				"due_date": "2023-11-30",
				"expiration_date": null,
				"assessment_date": "2023-10-29",
				"description": "Licenciamento - 2023",
			}
		],
		"subscription": {
			"id": "7ddcd676-cc3c-4b60-a369-93ca215ab270",
			"is_active": true,
			"external_id": "CODE09190",
			"created_at": "2023-10-24T15:44:04.506308"
		},
		"vehicle": {
			"license_plate": "ABC1234",
			"state": "SP",
			"renavam": "12345678910"
		}
	},
	"attempts": [
		{
			"attempt": 3,
			"created_at": "2023-12-06T13:55:02.301309",
			"status": "sent",
			"server_response": {
				"http_status_code": 200,
				"headers": {
					"Access-Control-Allow-Credentials": true,
					"Access-Control-Allow-Origin": "*",
					"Access-Control-Expose-Headers": "filename",
					"Content-Type": "application/json",
					"Date": "Fri, 06 Dec 2023 13:55:03 GMT",
					"Content-Length": "33",
					"Connection": "keep-alive"
				},
				"body": {
					"msg": "Ok"
				}
			}
		},
		{
			"attempt": 2,
			"created_at": "2023-10-24T15:44:04.506308",
			"status": "sent",
			"server_response": {
				"http_status_code": 200,
				"headers": {
					"Access-Control-Allow-Credentials": true,
					"Access-Control-Allow-Origin": "*",
					"Access-Control-Expose-Headers": "filename",
					"Content-Type": "application/json",
					"Date": "Fri, 24 Nov 2023 15:44:15 GMT",
					"Content-Length": "33",
					"Connection": "keep-alive"
				},
				"body": {
					"msg": "Ok"
				}
			}
		},
		{
			"attempt": 1,
			"created_at": "2023-10-24T15:44:04.506308",
			"status": "failed",
			"server_response": {
				"http_status_code": 500,
				"headers": {
					"Access-Control-Allow-Credentials": true,
					"Access-Control-Allow-Origin": "*",
					"Access-Control-Expose-Headers": "filename",
					"Content-Type": "application/json",
					"Date": "Fri, 24 Nov 2023 15:44:15 GMT",
					"Content-Length": "33",
					"Connection": "keep-alive"
				},
				"body": {
					"msg": "Error"
				}
			}
		}
	]
}

autoradar_vehicle_debt_not_found


Este evento é enviado quando nenhum débito novo é encontrado para o veículo.

Exemplo de payload

{
	"id": "B1234",
	"event": "autoradar_vehicle_debt_not_found",
	"webhook": {
		"id": "B1234",
		"resource": "autoradar",
		"version": "v2"
	},
	"data": {
		"detail": "A requisição foi concluída e o veículo não possui débitos.",
		"code": "vehicle_debt_bureau_debts_not_found",
		"subscription": {
			"id": "7ddcd676-cc3c-4b60-a369-93ca215ab270",
			"is_active": true,
			"external_id": "CODE09190",
			"created_at": "2023-10-24T15:44:04.506308"
		},
		"vehicle": {
			"license_plate": "ABC1234",
			"state": "SP",
			"renavam": "12345678910"
		},
	},
	"attempts": [
		{
			"attempt": 3,
			"created_at": "2023-12-06T13:55:02.301309",
			"status": "sent",
			"server_response": {
				"http_status_code": 200,
				"headers": {
					"Access-Control-Allow-Credentials": true,
					"Access-Control-Allow-Origin": "*",
					"Access-Control-Expose-Headers": "filename",
					"Content-Type": "application/json",
					"Date": "Fri, 06 Dec 2023 13:55:03 GMT",
					"Content-Length": "33",
					"Connection": "keep-alive"
				},
				"body": {
					"msg": "Ok"
				}
			}
		},
		{
			"attempt": 2,
			"created_at": "2023-10-24T15:44:04.506308",
			"status": "sent",
			"server_response": {
				"http_status_code": 200,
				"headers": {
					"Access-Control-Allow-Credentials": true,
					"Access-Control-Allow-Origin": "*",
					"Access-Control-Expose-Headers": "filename",
					"Content-Type": "application/json",
					"Date": "Fri, 24 Nov 2023 15:44:15 GMT",
					"Content-Length": "33",
					"Connection": "keep-alive"
				},
				"body": {
					"msg": "Ok"
				}
			}
		},
		{
			"attempt": 1,
			"created_at": "2023-10-24T15:44:04.506308",
			"status": "failed",
			"server_response": {
				"http_status_code": 500,
				"headers": {
					"Access-Control-Allow-Credentials": true,
					"Access-Control-Allow-Origin": "*",
					"Access-Control-Expose-Headers": "filename",
					"Content-Type": "application/json",
					"Date": "Fri, 24 Nov 2023 15:44:15 GMT",
					"Content-Length": "33",
					"Connection": "keep-alive"
				},
				"body": {
					"msg": "Error"
				}
			}
		}
	]
}

autoradar_vehicle_due_debts

Este evento é enviado para notificar o parceiro que foram encontrados débitos dos usuários dele que estão prestes a vencer. O número de dias restantes para o vencimento é acordado entre a Zapay e o parceiro durante o cadastro.

Exemplo de payload

{
	"id": "B1235",
	"event": "autoradar_vehicle_due_debts",
	"webhook": {
		"id": "B1234",
		"resource": "autoradar",
		"version": "v2"
	},
	"data": {
		"subscription": {
			"id": "df7ce744-2229-4e31-a799-3a04a94a7c03",
			"is_active": true,
			"created_at": "2024-05-10T14:57:20.429448Z",
			"external_id": null
		},
		"vehicle": {
			"license_plate": "ABC1234",
			"state": "RJ",
			"renavam": "12345678910"
		}
	},
	"attempts": [
		{
			"attempt": 3,
			"created_at": "2023-12-06T13:55:02.301309",
			"status": "sent",
			"server_response": {
				"http_status_code": 200,
				"headers": {
					"Access-Control-Allow-Credentials": true,
					"Access-Control-Allow-Origin": "*",
					"Access-Control-Expose-Headers": "filename",
					"Content-Type": "application/json",
					"Date": "Fri, 06 Dec 2023 13:55:03 GMT",
					"Content-Length": "33",
					"Connection": "keep-alive"
				},
				"body": {
					"msg": "Ok"
				}
			}
		},
		{
			"attempt": 2,
			"created_at": "2023-10-24T15:44:04.506308",
			"status": "sent",
			"server_response": {
				"http_status_code": 200,
				"headers": {
					"Access-Control-Allow-Credentials": true,
					"Access-Control-Allow-Origin": "*",
					"Access-Control-Expose-Headers": "filename",
					"Content-Type": "application/json",
					"Date": "Fri, 24 Nov 2023 15:44:15 GMT",
					"Content-Length": "33",
					"Connection": "keep-alive"
				},
				"body": {
					"msg": "Ok"
				}
			}
		},
		{
			"attempt": 1,
			"created_at": "2023-10-24T15:44:04.506308",
			"status": "failed",
			"server_response": {
				"http_status_code": 500,
				"headers": {
					"Access-Control-Allow-Credentials": true,
					"Access-Control-Allow-Origin": "*",
					"Access-Control-Expose-Headers": "filename",
					"Content-Type": "application/json",
					"Date": "Fri, 24 Nov 2023 15:44:15 GMT",
					"Content-Length": "33",
					"Connection": "keep-alive"
				},
				"body": {
					"msg": "Error"
				}
			}
		}
	]
}

autoradar_vehicle_debt_search_initiated_error

Este evento é enviado para notificar o parceiro que ocorreu algum problema no processamento da inscrição pela terceira vez (1 a cada dia) e não foi possível enviar a notificação de veículo com ou sem débitos.

Exemplo de payload

{
	"id": "320da77a-00d4-4e9c-87a0-28adf22ec25d",
	"event": "autoradar_vehicle_debt_search_initiated_error",
	"webhook": {
		"id": "a7c93451-e460-422e-8a2d-579a3490cbd9",
		"resource": "autoradar",
		"version": "v2"
	},
	"data": {
		"subscription_id": "b448dcc5-1920-4202-81a7-040f0a0ace2c",
		"detail": "Ouve algum problema ao buscar as dívidas do veículo."
	},
	"attempts": [
		{
			"attempt": 1,
			"created_at": "2023-10-24T15:44:04.506308",
			"status": "failed",
			"server_response": {
				"http_status_code": 500,
				"headers": {
					"Access-Control-Allow-Credentials": true,
					"Access-Control-Allow-Origin": "*",
					"Access-Control-Expose-Headers": "filename",
					"Content-Type": "application/json",
					"Date": "Fri, 24 Nov 2023 15:44:15 GMT",
					"Content-Length": "33",
					"Connection": "keep-alive"
				},
				"body": {
					"msg": "Error"
				}
			}
		}
	]
}

autoradar_vehicle_update_required

Este evento é enviado para notificar o parceiro que não estamos conseguindo encontrar o veículo, e é necessário a atualização desses dados.

Exemplo de payload

{
	"id": "B1235",
	"event": "autoradar_vehicle_update_required",
	"webhook": {
		"id": "B1234",
		"resource": "autoradar",
		"version": "v2"
	},
	"data": {
		"subscription": {
			"id": "df7ce744-2229-4e31-a799-3a04a94a7c03",
			"is_active": true,
			"created_at": "2024-05-10T14:57:20.429448Z",
			"external_id": null
		},
		"vehicle": {
			"license_plate": "ABC1234",
			"state": "RJ",
			"renavam": "12345678910"
		}
	},
	"attempts": [
		{
			"attempt": 1,
			"created_at": "2023-12-06T13:55:02.301309",
			"status": "sent",
			"server_response": {
				"http_status_code": 200,
				"headers": {
					"Access-Control-Allow-Credentials": true,
					"Access-Control-Allow-Origin": "*",
					"Access-Control-Expose-Headers": "filename",
					"Content-Type": "application/json",
					"Date": "Fri, 06 Dec 2023 13:55:03 GMT",
					"Content-Length": "33",
					"Connection": "keep-alive"
				},
				"body": {
					"msg": "Ok"
				}
			}
		}
	]
}