Vehicle event

When a vehicle is created or updated, Papaya sends a POST request to your server endpoint with the details of the event.

{
  "id": "aa114dc7-7b30-4059-9a06-1230344e11c9",
  "action": "create",
  "resource": "vehicle",
  "created": "2024-02-16T11:11:14Z",
  "data": {
    "public_resource": false,
    "type": "vehicle",
    "id": "92f5db98-eb90-44ae-ab0f-cd5ad1142c8f",
    "name": "New bike",
    "legal_identifier": "87964-98juih-987",
    "model_id": "8ecf4478-e55b-41fd-a008-ea309527e90e",
    "hub_id": null,
    "state": "available",
    "partner_id": null,
    "maintainer_id": null,
    "ownership_type": "owned",
    "acquired_at": null,
    "acquired_until": null,
    "lease_start_date": null,
    "lease_end_date": null,
    "tag": "Red",
    "maintenance_included": true,
    "has_key": true,
    "branded": null,
    "box_size": 1.6,
    "iot_provider": null,
    "iot_id": null,
    "iot_installed": null,
    "battery_percentage": null,
    "insurance_type": "third_party",
    "insurance_provider_id": "dc66d09d-e145-4e96-a501-53a5e3e0ab74",
    "insurance_policy_number": "89JQYNB04",
    "insured_at": "2024-02-16 00:00:00 UTC",
    "insured_until": "2025-02-16 00:00:00 UTC",
    "ownership_cost": null,
    "insurance_monthly_cost": null,
    "maintenance_monthly_cost": null,
    "warranty": "1 year",
    "maintenance_package_name": "Green",
    "maintenance_package_details": null,
    "maintenance_package_price_per_month_in_cents": 1500,
    "maintenance_package_price_per_month_currency": "GBP",
    "engines": [
      {
        "id": "ff8faaac-2b31-42d8-bd63-d91efcfca7c3",
        "serial_number": "8765-986",
        "start_at": "2024-02-18 00:00:00 UTC",
        "end_at": "2025-04-23 23:00:00 UTC",
        "initial_mileage": 0,
        "mileage": 0,
        "puk": null
      }
    ],
    "is_deleted": null
  }
}

You should always respond with a 200-level status code to indicate that you received the notification. Papaya ignores the body of your response, so a 204 status with an empty body is ideal:

204 No Content