{ "openapi": "3.0.3", "info": { "title": "Airtel Africa API", "version": "1.0.0", "description": "Mobile money and telecom services API", "x-jentic-source-url": "https://developers.airtel.africa/", "contact": {} }, "servers": [ { "url": "https://api.airtel.africa", "description": "Production server" } ], "paths": { "/payments": { "post": { "summary": "Create payment", "description": "Initiate a payment transaction", "operationId": "createPayment", "tags": [ "Payments" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "amount": { "type": "number" }, "currency": { "type": "string" }, "reference": { "type": "string" } }, "required": [ "amount", "currency" ] } } } }, "responses": { "201": { "description": "Payment created", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "status": { "type": "string" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/payments/{id}": { "get": { "summary": "Get payment status", "description": "Retrieve payment transaction status", "operationId": "getPayment", "tags": [ "Payments" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Payment details", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "amount": { "type": "number" }, "status": { "type": "string" } } } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } } }, "components": { "securitySchemes": { "ApiKeyAuth": { "type": "apiKey", "in": "header", "name": "X-API-Key" } }, "schemas": { "ErrorResponse": { "type": "object", "properties": { "error": { "type": "string" }, "code": { "type": "string" } }, "required": [ "error" ] } } }, "security": [ { "ApiKeyAuth": [] } ], "tags": [ { "name": "Payments" } ] }