Okra Transactions API

Transaction history and spending patterns.

OpenAPI Specification

okra-ng-transactions-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Okra Accounts Transactions API
  description: 'Specification of the Okra open-finance API. Okra connected applications to Nigerian bank accounts to retrieve authentication details, balances, transactions, identity, and income, and to initiate bank-to-bank payments. All product and query endpoints are POST requests authenticated with a Bearer secret key. NOTE: Okra wound down operations in May 2025; endpoints are documented as they were publicly published and may no longer be live.'
  termsOfService: https://okra.ng/terms
  contact:
    name: Okra Support
    email: support@okra.ng
  version: '2.0'
servers:
- url: https://api.okra.ng/v2
  description: Production
- url: https://api.okra.ng/v2/sandbox
  description: Sandbox
security:
- bearerAuth: []
tags:
- name: Transactions
  description: Transaction history and spending patterns.
paths:
  /products/transactions:
    post:
      operationId: getTransactions
      tags:
      - Transactions
      summary: Retrieve all transaction records
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PdfFlagRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /transaction/getByCustomer:
    post:
      operationId: getTransactionsByCustomer
      tags:
      - Transactions
      summary: Retrieve transactions by customer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /transaction/getByAccount:
    post:
      operationId: getTransactionsByAccount
      tags:
      - Transactions
      summary: Retrieve transactions by account
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /transaction/getByDate:
    post:
      operationId: getTransactionsByDate
      tags:
      - Transactions
      summary: Retrieve transactions by date range
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DateRangeRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /transaction/getByBank:
    post:
      operationId: getTransactionsByBank
      tags:
      - Transactions
      summary: Retrieve transactions by bank
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BankRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /products/transactions/spending-pattern:
    post:
      operationId: getSpendingPattern
      tags:
      - Transactions
      summary: Retrieve a customer's spending pattern
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - customer_id
              properties:
                customer_id:
                  type: string
                  description: The Okra customer id.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    BankRequest:
      type: object
      required:
      - bank
      properties:
        bank:
          type: string
          description: The Okra bank id.
        page:
          type: integer
          default: 1
        limit:
          type: integer
          default: 20
    Transaction:
      type: object
      properties:
        id:
          type: string
        account:
          type: string
        customer:
          type: string
        amount:
          type: number
        type:
          type: string
        notes:
          type: string
        trans_date:
          type: string
          format: date-time
    PdfFlagRequest:
      type: object
      properties:
        pdf:
          type: boolean
          default: false
          description: When true, return the records rendered as a PDF.
    AccountRequest:
      type: object
      required:
      - account
      properties:
        account:
          type: string
          description: The Okra account id.
        page:
          type: integer
          default: 1
        limit:
          type: integer
          default: 20
    Error:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
    DateRangeRequest:
      type: object
      required:
      - from
      - to
      properties:
        from:
          type: string
          format: date
          description: Start date (YYYY-MM-DD).
        to:
          type: string
          format: date
          description: End date (YYYY-MM-DD).
        page:
          type: integer
          default: 1
        limit:
          type: integer
          default: 20
    TransactionListResponse:
      type: object
      properties:
        status:
          type: string
        data:
          type: object
          properties:
            transaction:
              type: array
              items:
                $ref: '#/components/schemas/Transaction'
            pagination:
              $ref: '#/components/schemas/Pagination'
    CustomerRequest:
      type: object
      required:
      - customer
      properties:
        customer:
          type: string
          description: The Okra customer id.
        page:
          type: integer
          default: 1
        limit:
          type: integer
          default: 20
    GenericResponse:
      type: object
      properties:
        status:
          type: string
        message:
          type: string
        data:
          type: object
          additionalProperties: true
    Pagination:
      type: object
      properties:
        totalPages:
          type: integer
        currentPage:
          type: integer
        nextPage:
          type: integer
        previousPage:
          type: integer
        total:
          type: integer
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Okra secret API key supplied as a Bearer token.