{ "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" } } } } } } }, "/bankaccount": { "get": { "security": [ { "ApiKeyAuth": [] }, { "bearerAuth": [] } ], "tags": ["Bank Account"], "operationId": "getBankAccount", "summary": "Get bank account details", "description": "Returns the bank account details for a given currency", "parameters": [ { "name": "walletId", "in": "query", "description": "The wallet ID to get the bank account for (optional)", "schema": { "type": "string", "format": "uuid" }, "required": false }, { "name": "currency", "in": "query", "description": "The currency to get the bank account for (optional)", "schema": { "type": "string", "enum": ["NGN", "KES", "BTC", "USD"] }, "required": false } ], "responses": { "200": { "description": "Bank account response", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "format": "string", "example": "success" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/BankAccount" } } } } } } }, "400": { "description": "Unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "post": { "security": [ { "ApiKeyAuth": [] }, { "bearerAuth": [] } ], "tags": ["Bank Account"], "operationId": "createBankAccount", "summary": "Register a bank account", "description": "Register a bank account that can be used for withdrawal for a given currency", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BankAccount" } } }, "required": true }, "responses": { "200": { "description": "Bank account response", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "format": "string", "example": "success" }, "data": { "$ref": "#/components/schemas/BankAccount" } } } } } }, "400": { "description": "Unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/bank/bankcode": { "get": { "security": [ { "ApiKeyAuth": [] }, { "bearerAuth": [] } ], "tags": ["Bank Account"], "operationId": "getBankCode", "summary": "Get bank code", "description": "Returns all bank codes for a given currency. This endpoint is currently limited to Nigeria(NGN) only", "responses": { "200": { "description": "Bank code response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BankCode" } } } }, "400": { "description": "Unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/bank/name-enquiry": { "get": { "security": [ { "ApiKeyAuth": [] } ], "tags": ["Bank Account"], "operationId": "getBankNameEnquiry", "summary": "Verify bank account details if it is correct", "description": "Verify bank account details if it is correct. The response returned should match the account number and account name of the user. This endpoint is currently limited to Nigeria(NGN) only", "parameters": [ { "name": "accountNumber", "in": "query", "description": "The account number to verify", "schema": { "type": "string", "format": "string" }, "required": true }, { "name": "bankCode", "in": "query", "description": "The bank code to verify", "schema": { "type": "string", "format": "string" }, "required": true } ], "responses": { "200": { "description": "Bank name enquiry response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BankNameEnquiry" } } } }, "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"] } } } } } } }, "BankAccount": { "type": "object", "properties": { "bankName": { "type": "string", "format": "string", "example": "KUDA MICROFINANCE BANK" }, "bankCode": { "type": "string", "format": "string", "example": "090267" }, "bankAccountNumber": { "type": "string", "format": "string", "example": "0123456789" }, "bankAccountName": { "type": "string", "format": "string", "example": "Satoshi Nakamoto" }, "currency": { "type": "string", "format": "string", "enum": ["NGN", "KES"] }, "walletId": { "type": "string", "format": "string", "example": "d1614a76-9c7f-4111-98a7-43199f307e5b-123456789" } } }, "BankCode": { "type": "object", "properties": { "status": { "type": "string", "format": "string", "example": "ok" }, "message": { "type": "string", "format": "string", "example": "all bank codes retrieved successfully" }, "data": { "type": "array", "items": { "type": "object", "properties": { "bankName": { "type": "string", "format": "string", "example": "KUDA MICROFINANCE BANK" }, "nipBankCode": { "type": "string", "format": "string", "example": "090267" } } } } } }, "BankNameEnquiry": { "type": "object", "properties": { "status": { "type": "string", "format": "string", "example": "ok" }, "message": { "type": "string", "format": "string", "example": "Bank account name verified successfully" }, "data": { "type": "object", "properties": { "accountName": { "type": "string", "format": "string", "example": "Oladeji Olaolu" }, "accountNumber": { "type": "string", "format": "string", "example": "0123456789" }, "kycLevel": { "type": "string", "format": "string", "example": "3" }, "nameInquiryReference": { "type": "string", "format": "string", "example": "123456789" }, "channelCode": { "type": "string", "format": "string", "example": "123456789" } } } } }, "Error": { "required": ["error", "message"], "type": "object", "properties": { "status": { "type": "string", "format": "string", "example": "error" }, "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" } ] }