Skip to main content

Ticketing Webhook

Riyadh Parking provides real-time ticketing and invoicing updates to operators when a ticket is generated via the mobile app or website. This allows operators to track transactions and automate processing without polling the API.
To receive ticket and invoice data, operators must provide a valid endpoint.

1️⃣ Ticket & Invoice Data Structure

Each time a parking transaction occurs, Riyadh Parking sends a POST request to the operator’s webhook endpoint with the following payload.

Invoice Schema

{
  "invoiceTime": "2025-03-09T12:00:00Z",
  "invoiceNumber": "INV-123456",
  "vatNumber": "300123456700003",
  "invoiceTotalAmount": 100.00,
  "invoiceTax": 15.00,
  "invoiceAmount": 85.00,
  "paymentMethod": "MADA",
  "transactionRef": "TXN-987654"
}

Ticket Schema

{
  "id": "ticket-uuid",
  "parkingZone": "zone-001",
  "transactionTime": "2025-03-09T12:05:00Z",
  "startTime": "2025-03-09T10:00:00Z",
  "endTime": "2025-03-09T12:00:00Z",
  "licensePlate": "ABC123",
  "amount": 85.00,
  "paymentType": "MADA",
  "serial": "TICKET-987654",
  "invoice": {
    "invoiceTime": "2025-03-09T12:00:00Z",
    "invoiceNumber": "INV-123456",
    "vatNumber": "300123456700003",
    "invoiceTotalAmount": 100.00,
    "invoiceTax": 15.00,
    "invoiceAmount": 85.00,
    "paymentMethod": "MADA",
    "transactionRef": "TXN-987654"
  },
  "ticketType": "NEW", // "NEW", "EXTENDED"
  "isSaudiPlate": true
}

2️⃣ How to Handle Incoming Requests

  • Expose an HTTPS endpoint that accepts POST requests.
  • Verify the request payload to ensure data integrity.
  • Acknowledge receipt by responding with a 200 OK status.

Example Endpoint Implementation (Node.js/Express)

const express = require("express");
const app = express();

app.use(express.json());

app.post("/parking/ticket", (req, res) => {
  console.log("Received Ticket Data:", req.body);
  res.status(200).send({ message: "Ticket received successfully" });
});

app.listen(3000, () => console.log("Server running on port 3000"));

3️⃣ Expected Responses

Your system must respond to each request with the appropriate HTTP status code.
Status CodeDescription
200 OKRequest received successfully.
400 Bad RequestInvalid payload structure.
500 Internal Server ErrorUnexpected processing error.
If your system fails to acknowledge the request, retries will be attempted before marking it as failed.