openapi: 3.0.3
info:
  title: BankiPay API
  description: BankiPay REST API for currency quotes, supplier payments, wallet balances and transaction history.
  version: "1.0.0"
servers:
  - url: https://bankipay.io/api/v1
    description: Production
security:
  - bearerAuth: []
paths:
  /ping:
    get:
      summary: Health check
      security: []
      responses:
        '200': { description: API is live }
  /me:
    get:
      summary: Authenticated account
      responses:
        '200': { description: Account info }
  /balance:
    get:
      summary: Wallet balances
      responses:
        '200': { description: List of balances }
  /transactions:
    get:
      summary: Transaction history
      parameters:
        - { name: per_page, in: query, schema: { type: integer, default: 20 } }
        - { name: status, in: query, schema: { type: string } }
        - { name: type, in: query, schema: { type: string } }
      responses:
        '200': { description: Transaction list }
  /quotes:
    post:
      summary: Create a quote
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [from_currency, to_currency, amount]
              properties:
                from_currency: { type: string, example: "EUR" }
                to_currency: { type: string, example: "NGN" }
                amount: { type: number, example: 1000 }
      responses:
        '200': { description: Quote }
  /payments:
    post:
      summary: Create a supplier payment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [from_currency, to_currency, amount, beneficiary_name]
              properties:
                from_currency: { type: string, example: "EUR" }
                to_currency: { type: string, example: "NGN" }
                amount: { type: number, example: 1000 }
                beneficiary_name: { type: string, example: "Supplier Ltd" }
                beneficiary_bank: { type: string }
                beneficiary_account: { type: string }
                beneficiary_country: { type: string }
                purpose: { type: string }
      responses:
        '201': { description: Payment created }
  /payments/{reference}:
    get:
      summary: Retrieve a payment
      parameters:
        - { name: reference, in: path, required: true, schema: { type: string } }
      responses:
        '200': { description: Payment }
        '404': { description: Not found }
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
