{ "openapi": "3.0.1", "info": { "title": "Mavapay API", "description": "API documentation for Mavapay", "license": { "name": "MIT" }, "version": "1.0.0", "contact": { "name": "Mavapay", "url": "https://mavapay.co", "email": "info@mavapay.co" } }, "servers": [ { "url": "https://staging.mavapay.co/api", "description": "Staging server" }, { "url": "https://api.mavapay.co/api", "description": "Live server" } ], "security": [ { "ApiKeyAuth": [], "bearerAuth": [] } ], "paths": { "/price": { "get": { "security": [], "tags": ["Price"], "operationId": "getPrice", "summary": "Get current market price", "description": "Returns the market price per dollar for a given currency", "parameters": [ { "name": "currency", "in": "query", "description": "The currency to get the price for", "schema": { "type": "string" }, "required": true } ], "responses": { "200": { "description": "Price response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Price" } } } }, "400": { "description": "Unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } } }, "components": { "schemas": { "Price": { "type": "object", "properties": { "status": { "type": "string", "format": "string", "example": "success" }, "data": { "type": "object", "properties": { "currency": { "type": "string", "enum": ["NGN", "KES"] }, "timeStamp": { "type": "string", "format": "date-time", "example": "2021-07-01T12:00:00Z" }, "btcPriceInUnitCurrency": { "type": "number", "format": "number", "example": 9000000.23 }, "unitPricePerSat": { "type": "object", "properties": { "amount": { "type": "number", "format": "number", "example": 0.334561234 }, "currencyUnit": { "type": "string", "enum": ["NGNSAT", "KESSAT"] } } }, "unitPricePerUsd": { "type": "object", "properties": { "amount": { "type": "number", "format": "number", "example": 1500.65 }, "currencyUnit": { "type": "string", "enum": ["NGNUSD", "KESUSD"] } } } } } } }, "Error": { "required": ["error", "message"], "type": "object", "properties": { "status": { "type": "string", "format": "string" }, "message": { "type": "string" } } } }, "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer" }, "ApiKeyAuth": { "type": "apiKey", "in": "header", "name": "X-API-KEY" } } }, "tags": [ { "name": "Price", "description": "Price related endpoints" } ] }