{
  "openapi": "3.0.3",
  "info": {
    "title": "Myhappr Public Banking API",
    "version": "1.0.0",
    "description": "The documented public bank-list and account-resolution endpoints. Account resolution requires an issued Myhappr API key. Internal account, payment, and admin APIs are not part of this specification."
  },
  "servers": [
    {
      "url": "https://api.myhappr.com/api/v1"
    }
  ],
  "externalDocs": {
    "description": "Myhappr developer documentation",
    "url": "https://myhappr.com/developers"
  },
  "paths": {
    "/public/banks": {
      "get": {
        "operationId": "getBanks",
        "summary": "List banks by country",
        "description": "No authentication required. Bank lists are cached for 24 hours. Rate limited to 120 requests per minute.",
        "security": [],
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "NG",
                "GH",
                "KE",
                "ZA",
                "TZ",
                "UG",
                "CM",
                "CI",
                "SN",
                "RW"
              ]
            },
            "example": "NG"
          }
        ],
        "responses": {
          "200": {
            "description": "Bank list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "data"
                  ],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "code"
                        ],
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "name": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or unsupported country code"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "503": {
            "description": "Bank provider temporarily unavailable"
          }
        }
      }
    },
    "/public/account/resolve": {
      "post": {
        "operationId": "resolveAccount",
        "summary": "Resolve an account number to its registered name",
        "description": "Requires an API key. Limited to 20 requests per IP per 24 hours, plus the per-minute request limit. Providing x-device-fingerprint also applies a daily device limit.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-device-fingerprint",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "accountNumber",
                  "bankCode"
                ],
                "properties": {
                  "accountNumber": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 20,
                    "pattern": "^[0-9]{8,20}$",
                    "example": "0123456789"
                  },
                  "bankCode": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 10,
                    "pattern": "^[a-zA-Z0-9]+$",
                    "example": "044"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account resolved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "data"
                  ],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "required": [
                        "bankCode",
                        "accountNumber",
                        "accountName"
                      ],
                      "properties": {
                        "bankCode": {
                          "type": "string"
                        },
                        "accountNumber": {
                          "type": "string"
                        },
                        "accountName": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or account could not be resolved"
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "422": {
            "description": "Request validation failed"
          },
          "429": {
            "description": "Daily or per-minute rate limit exceeded"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  }
}
