{
    "openapi": "3.1.0",
    "info": {
        "title": "EazyGo Agent Booking API",
        "version": "1.0.0",
        "description": "Cab fares, wallet-paid bookings, cancellations and trip tracking for EazyGo travel agents. Times are IST. Guides: https://eazygo.in/developers/agent-api"
    },
    "servers": [
        {
            "url": "https://eazygo.in/api/agent/v1"
        }
    ],
    "security": [
        {
            "apiKey": []
        }
    ],
    "tags": [
        {
            "name": "Catalog"
        },
        {
            "name": "Quotes"
        },
        {
            "name": "Bookings"
        },
        {
            "name": "Wallet"
        }
    ],
    "paths": {
        "/cities": {
            "get": {
                "tags": [
                    "Catalog"
                ],
                "summary": "Cities a kind of trip can be quoted for",
                "operationId": "listCities",
                "parameters": [
                    {
                        "name": "service_type",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "$ref": "#/components/schemas/ServiceType"
                        }
                    },
                    {
                        "name": "from_city_id",
                        "in": "query",
                        "description": "Outstation: list the cities reachable from this city",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "description": "Part of the city name",
                        "schema": {
                            "type": "string",
                            "maxLength": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Cities",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "const": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/City"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/airports": {
            "get": {
                "tags": [
                    "Catalog"
                ],
                "summary": "Airports for local airport transfers",
                "operationId": "listAirports",
                "parameters": [
                    {
                        "name": "city_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Airports",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "const": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Airport"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/quotes": {
            "post": {
                "tags": [
                    "Quotes"
                ],
                "summary": "Every vehicle's agency price for a trip, and a quote_token to book with",
                "operationId": "createQuote",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/QuoteRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Quote",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "const": true
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Quote"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/bookings": {
            "get": {
                "tags": [
                    "Bookings"
                ],
                "summary": "Bookings this key may see, newest first",
                "operationId": "listBookings",
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "trip_status",
                        "in": "query",
                        "schema": {
                            "$ref": "#/components/schemas/TripStatus"
                        }
                    },
                    {
                        "name": "pickup_from",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "pickup_to",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 25
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Bookings",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "const": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Booking"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Bookings"
                ],
                "summary": "Book a quoted vehicle, paid in full from the agency wallet",
                "operationId": "createBooking",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": true,
                        "description": "Unique per booking; a retry with the same key returns the original booking",
                        "schema": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_\\-:.]{8,100}$"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/BookingRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Booked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/BookingResponse"
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "Already booked with this Idempotency-Key (idempotent_replay: true)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/BookingResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error"
                    },
                    "409": {
                        "$ref": "#/components/responses/Error"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/bookings/{reference}": {
            "get": {
                "tags": [
                    "Bookings"
                ],
                "summary": "One booking",
                "operationId": "getBooking",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Reference"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Booking",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/BookingResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/bookings/{reference}/cancellation": {
            "get": {
                "tags": [
                    "Bookings"
                ],
                "summary": "What cancelling now would cost and refund",
                "operationId": "getCancellationTerms",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Reference"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Terms",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "const": true
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/CancellationTerms"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/bookings/{reference}/cancel": {
            "post": {
                "tags": [
                    "Bookings"
                ],
                "summary": "Cancel and refund to the wallet, less the cancellation charge",
                "operationId": "cancelBooking",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Reference"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Cancelled",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "const": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#/components/schemas/Booking"
                                                },
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "refunded_to_wallet": {
                                                            "type": "number"
                                                        }
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    },
                    "409": {
                        "$ref": "#/components/responses/Error"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/bookings/{reference}/invoice": {
            "get": {
                "tags": [
                    "Bookings"
                ],
                "summary": "EazyGo's GST tax invoice to the agency",
                "operationId": "getInvoice",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Reference"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice",
                        "content": {
                            "application/pdf": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    },
                    "409": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/wallet": {
            "get": {
                "tags": [
                    "Wallet"
                ],
                "summary": "Wallet balance",
                "operationId": "getWallet",
                "responses": {
                    "200": {
                        "description": "Wallet",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "const": true
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Wallet"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wallet/transactions": {
            "get": {
                "tags": [
                    "Wallet"
                ],
                "summary": "Wallet ledger, newest first",
                "operationId": "listWalletTransactions",
                "parameters": [
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 25
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Ledger",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "const": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/WalletTransaction"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "apiKey": {
                "type": "http",
                "scheme": "bearer",
                "description": "An agent API key from the agent panel's API Access page"
            }
        },
        "parameters": {
            "Reference": {
                "name": "reference",
                "in": "path",
                "required": true,
                "schema": {
                    "type": "string"
                },
                "example": "EZ7Q2K9P4XMA"
            }
        },
        "responses": {
            "Error": {
                "description": "Error",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            }
        },
        "schemas": {
            "ServiceType": {
                "type": "string",
                "enum": [
                    "local",
                    "hourly",
                    "outstation-oneway",
                    "outstation-roundtrip"
                ]
            },
            "TripStatus": {
                "type": "string",
                "enum": [
                    "pending",
                    "assigned_vendor",
                    "assigned_driver",
                    "accepted",
                    "started",
                    "completed",
                    "cancelled"
                ]
            },
            "IstDateTime": {
                "type": [
                    "string",
                    "null"
                ],
                "format": "date-time",
                "description": "ISO 8601 with +05:30",
                "example": "2026-11-20T05:30:00+05:30"
            },
            "Error": {
                "type": "object",
                "required": [
                    "success",
                    "message",
                    "error"
                ],
                "properties": {
                    "success": {
                        "const": false
                    },
                    "message": {
                        "type": "string"
                    },
                    "error": {
                        "type": "string",
                        "example": "QUOTE_EXPIRED"
                    },
                    "errors": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "PageMeta": {
                "type": "object",
                "properties": {
                    "current_page": {
                        "type": "integer"
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "total": {
                        "type": "integer"
                    },
                    "last_page": {
                        "type": "integer"
                    }
                }
            },
            "City": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "state": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "latitude": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "longitude": {
                        "type": [
                            "number",
                            "null"
                        ]
                    }
                }
            },
            "Airport": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "iata_code": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "city_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "latitude": {
                        "type": "number"
                    },
                    "longitude": {
                        "type": "number"
                    }
                }
            },
            "QuoteRequest": {
                "type": "object",
                "required": [
                    "service_type",
                    "from_city_id",
                    "pickup_date",
                    "pickup_time"
                ],
                "properties": {
                    "service_type": {
                        "$ref": "#/components/schemas/ServiceType"
                    },
                    "from_city_id": {
                        "type": "integer"
                    },
                    "to_city_id": {
                        "type": "integer",
                        "description": "Required for outstation"
                    },
                    "from_location": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "to_location": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "from_latitude": {
                        "type": "number",
                        "description": "Required for local and hourly unless the trip starts at an airport"
                    },
                    "from_longitude": {
                        "type": "number"
                    },
                    "to_latitude": {
                        "type": "number",
                        "description": "Required for local unless the trip ends at an airport"
                    },
                    "to_longitude": {
                        "type": "number"
                    },
                    "pickup_date": {
                        "type": "string",
                        "format": "date",
                        "description": "IST"
                    },
                    "pickup_time": {
                        "type": "string",
                        "pattern": "^\\d{2}:\\d{2}$",
                        "description": "24-hour, IST"
                    },
                    "return_date": {
                        "type": "string",
                        "format": "date",
                        "description": "Required for round trips"
                    },
                    "return_time": {
                        "type": "string",
                        "pattern": "^\\d{2}:\\d{2}$"
                    },
                    "hours": {
                        "type": "integer",
                        "minimum": 2,
                        "maximum": 12,
                        "description": "Required for hourly"
                    },
                    "airport_id": {
                        "type": "integer"
                    },
                    "airport_side": {
                        "type": "string",
                        "enum": [
                            "from",
                            "to"
                        ]
                    }
                }
            },
            "Price": {
                "type": "object",
                "properties": {
                    "public_fare": {
                        "type": "number"
                    },
                    "agency_commission": {
                        "type": "number"
                    },
                    "taxable": {
                        "type": "number"
                    },
                    "gst_rate": {
                        "type": "number"
                    },
                    "gst": {
                        "type": "number"
                    },
                    "total": {
                        "type": "number",
                        "description": "What the wallet is charged"
                    }
                }
            },
            "Quote": {
                "type": "object",
                "properties": {
                    "quote_token": {
                        "type": "string",
                        "description": "Valid 30 minutes, for this agency only"
                    },
                    "expires_at": {
                        "$ref": "#/components/schemas/IstDateTime"
                    },
                    "trip": {
                        "type": "object",
                        "properties": {
                            "service_type": {
                                "$ref": "#/components/schemas/ServiceType"
                            },
                            "from_city_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "to_city_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "from_location": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "to_location": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "pickup_at": {
                                "$ref": "#/components/schemas/IstDateTime"
                            },
                            "return_date": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date"
                            },
                            "hours": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "airport_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "airport_side": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "distance_km": {
                                "type": "number"
                            }
                        }
                    },
                    "wallet_available": {
                        "type": "number"
                    },
                    "options": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "vehicle_category": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "integer"
                                        },
                                        "name": {
                                            "type": "string"
                                        },
                                        "max_passengers": {
                                            "type": [
                                                "integer",
                                                "null"
                                            ]
                                        }
                                    }
                                },
                                "included_km": {
                                    "type": "number"
                                },
                                "extra_km_rate": {
                                    "type": "number",
                                    "description": "Charged by the driver per km beyond included_km; not charged to the wallet"
                                },
                                "public_total": {
                                    "type": "number"
                                },
                                "price": {
                                    "$ref": "#/components/schemas/Price"
                                }
                            }
                        }
                    }
                }
            },
            "Place": {
                "type": "object",
                "properties": {
                    "address": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 500
                    },
                    "latitude": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "longitude": {
                        "type": [
                            "number",
                            "null"
                        ]
                    }
                }
            },
            "BookingRequest": {
                "type": "object",
                "required": [
                    "quote_token",
                    "vehicle_category_id",
                    "passenger",
                    "pickup"
                ],
                "properties": {
                    "quote_token": {
                        "type": "string"
                    },
                    "vehicle_category_id": {
                        "type": "integer"
                    },
                    "passenger": {
                        "type": "object",
                        "required": [
                            "name",
                            "mobile"
                        ],
                        "properties": {
                            "name": {
                                "type": "string",
                                "maxLength": 255
                            },
                            "mobile": {
                                "type": "string",
                                "pattern": "^[6-9]\\d{9}$"
                            },
                            "email": {
                                "type": "string",
                                "format": "email"
                            }
                        }
                    },
                    "pickup": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/Place"
                            }
                        ],
                        "required": [
                            "address",
                            "latitude",
                            "longitude"
                        ]
                    },
                    "drop": {
                        "$ref": "#/components/schemas/Place"
                    },
                    "notes": {
                        "type": "string",
                        "maxLength": 1000
                    }
                }
            },
            "Booking": {
                "type": "object",
                "properties": {
                    "reference": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string",
                        "example": "confirmed"
                    },
                    "payment_status": {
                        "type": "string",
                        "example": "paid"
                    },
                    "trip_status": {
                        "$ref": "#/components/schemas/TripStatus"
                    },
                    "service_type": {
                        "$ref": "#/components/schemas/ServiceType"
                    },
                    "vehicle_category": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        }
                    },
                    "pickup_at": {
                        "$ref": "#/components/schemas/IstDateTime"
                    },
                    "return_at": {
                        "$ref": "#/components/schemas/IstDateTime"
                    },
                    "hours": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "from": {
                        "type": "object",
                        "properties": {
                            "city_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "location": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        }
                    },
                    "to": {
                        "type": "object",
                        "properties": {
                            "city_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "location": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        }
                    },
                    "pickup": {
                        "$ref": "#/components/schemas/Place"
                    },
                    "drop": {
                        "$ref": "#/components/schemas/Place"
                    },
                    "passenger": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "mobile": {
                                "type": "string"
                            },
                            "email": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        }
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "included_km": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "extra_km_rate": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "amounts": {
                        "type": "object",
                        "properties": {
                            "public_fare": {
                                "type": "number"
                            },
                            "discount": {
                                "type": "number"
                            },
                            "agency_commission": {
                                "type": "number"
                            },
                            "taxable": {
                                "type": "number"
                            },
                            "gst_rate": {
                                "type": "number"
                            },
                            "gst": {
                                "type": "number"
                            },
                            "total": {
                                "type": "number"
                            },
                            "paid": {
                                "type": "number"
                            },
                            "due": {
                                "type": "number"
                            }
                        }
                    },
                    "driver": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "mobile": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        }
                    },
                    "vehicle": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "model": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "registration_number": {
                                "type": "string"
                            },
                            "color": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        }
                    },
                    "trip_started_at": {
                        "$ref": "#/components/schemas/IstDateTime"
                    },
                    "trip_completed_at": {
                        "$ref": "#/components/schemas/IstDateTime"
                    },
                    "booked_by": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        }
                    },
                    "created_at": {
                        "$ref": "#/components/schemas/IstDateTime"
                    }
                }
            },
            "BookingResponse": {
                "type": "object",
                "properties": {
                    "success": {
                        "const": true
                    },
                    "message": {
                        "type": "string"
                    },
                    "data": {
                        "$ref": "#/components/schemas/Booking"
                    },
                    "idempotent_replay": {
                        "type": "boolean"
                    }
                }
            },
            "CancellationTerms": {
                "type": "object",
                "properties": {
                    "reference": {
                        "type": "string"
                    },
                    "cancellable": {
                        "type": "boolean"
                    },
                    "charge": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "refund_to_wallet": {
                        "type": [
                            "number",
                            "null"
                        ]
                    }
                }
            },
            "Wallet": {
                "type": "object",
                "properties": {
                    "currency": {
                        "const": "INR"
                    },
                    "balance": {
                        "type": "number"
                    },
                    "credit_limit": {
                        "type": "number"
                    },
                    "available": {
                        "type": "number"
                    }
                }
            },
            "WalletTransaction": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "credit",
                            "debit"
                        ]
                    },
                    "reason": {
                        "type": "string",
                        "enum": [
                            "topup",
                            "booking",
                            "refund",
                            "adjustment"
                        ]
                    },
                    "amount": {
                        "type": "number"
                    },
                    "balance_after": {
                        "type": "number"
                    },
                    "booking_reference": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "note": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "$ref": "#/components/schemas/IstDateTime"
                    }
                }
            }
        }
    }
}