{
    "openapi": "3.1.0",
    "info": {
        "title": "Nabdh Ride (نبض رايد) — DPulse Enterprise API",
        "version": "1.0.0",
        "description": "Production REST API for DPulse Saudi Mobility Platform (SAR, VAT 15%, ZATCA, Wasl\/Nafath, White-Label Bootstrap)."
    },
    "servers": [
        {
            "url": "https:\/\/taxi.dpulse.sa",
            "description": "Active Environment"
        }
    ],
    "paths": {
        "\/api\/v1\/health": {
            "get": {
                "summary": "System Health & Currency Defaults",
                "tags": [
                    "System"
                ],
                "responses": {
                    "200": {
                        "description": "Healthy JSON payload with brand, version, db, currency, vat_rate"
                    }
                }
            }
        },
        "\/api\/v1\/bootstrap": {
            "get": {
                "summary": "App & Web Bootstrap (ETag + 304 Not Modified)",
                "tags": [
                    "System"
                ],
                "responses": {
                    "200": {
                        "description": "Active modules, White-Label theme tokens, force_update gate, Saudi defaults"
                    },
                    "304": {
                        "description": "Not Modified when ETag matches"
                    }
                }
            }
        },
        "\/api\/v1\/version": {
            "get": {
                "summary": "Version Manifest (version.json)",
                "tags": [
                    "System"
                ],
                "responses": {
                    "200": {
                        "description": "Version manifest JSON"
                    }
                }
            }
        },
        "\/api\/v1\/saudi\/national-address\/{code}": {
            "get": {
                "summary": "Resolve Saudi Short National Address (e.g. RRRD2929)",
                "tags": [
                    "Saudi Protocols"
                ],
                "parameters": [
                    {
                        "name": "code",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^[A-Za-z]{4}[0-9]{4}$"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Resolved coordinates, district, street, and city"
                    },
                    "422": {
                        "description": "Invalid short address format"
                    }
                }
            }
        },
        "\/api\/v1\/saudi\/fare-estimate": {
            "post": {
                "summary": "Estimate Ride Fare in SAR with 15% VAT & Peak Multiplier",
                "tags": [
                    "Saudi Protocols"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "distance_km",
                                    "duration_min"
                                ],
                                "properties": {
                                    "distance_km": {
                                        "type": "number",
                                        "example": 14.5
                                    },
                                    "duration_min": {
                                        "type": "number",
                                        "example": 22
                                    },
                                    "vehicle_tier": {
                                        "type": "string",
                                        "enum": [
                                            "economy",
                                            "nabdh_comfort",
                                            "nabdh_vip",
                                            "ladies_only",
                                            "airport"
                                        ]
                                    },
                                    "peak_multiplier": {
                                        "type": "number",
                                        "example": 1.2
                                    },
                                    "is_airport": {
                                        "type": "boolean",
                                        "example": false
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Detailed SAR fare breakdown including 15% VAT"
                    }
                }
            }
        },
        "\/api\/v1\/saudi\/zatca-verify\/{uuid}": {
            "get": {
                "summary": "Verify ZATCA Invoice & Decode QR TLV Tags 1-5",
                "tags": [
                    "Compliance"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Decoded ZATCA TLV tags and XML SHA-256 hash"
                    }
                }
            }
        },
        "\/api\/v1\/webhooks\/{provider}": {
            "post": {
                "summary": "HMAC-Signed Idempotent Webhook Endpoint",
                "tags": [
                    "Integrations"
                ],
                "parameters": [
                    {
                        "name": "provider",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Webhook accepted (idempotent)"
                    }
                }
            }
        }
    }
}