> ## Documentation Index
> Fetch the complete documentation index at: https://docs.primepay.mw/llms.txt
> Use this file to discover all available pages before exploring further.

# Pay a bank account

> Sends money from the account that owns the API key to a bank account. Use a `bankCode` from [List banks](/api-reference/payouts/list-banks). A new payout returns `201`, whatever its status.

Guide: [how a payout works](/api-reference/payouts-overview#how-a-payout-works), [limits and fees](/api-reference/payouts-overview#limits-and-fees) and [payout errors](/api-reference/payouts-overview#payout-errors).




## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/payouts/bank
openapi: 3.1.0
info:
  title: PrimePay API
  version: '1.0'
  description: >-
    Collect mobile money payments, send transfers and make payouts with the
    PrimePay API.
servers:
  - url: https://api.primepay.mw
    description: Live API (live keys, `sk_live_…`)
  - url: https://sandbox-api.primepay.mw
    description: Sandbox API (test keys, `sk_test_…`)
security:
  - bearerAuth: []
tags:
  - name: Operators
  - name: Payments
  - name: Refunds
  - name: Transfers
  - name: Payouts
  - name: Payment links
  - name: Checkout sessions
paths:
  /v1/payouts/bank:
    post:
      tags:
        - Payouts
      summary: Pay a bank account
      description: >
        Sends money from the account that owns the API key to a bank account.
        Use a `bankCode` from [List banks](/api-reference/payouts/list-banks). A
        new payout returns `201`, whatever its status.


        Guide: [how a payout
        works](/api-reference/payouts-overview#how-a-payout-works), [limits and
        fees](/api-reference/payouts-overview#limits-and-fees) and [payout
        errors](/api-reference/payouts-overview#payout-errors).
      operationId: createBankPayout
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
                - currency
                - bankCode
                - accountNumber
                - accountName
              properties:
                amount:
                  type: number
                  description: MWK, at most 2 decimal places.
                  example: 25000
                currency:
                  type: string
                  enum:
                    - MWK
                bankCode:
                  type: string
                  description: A `code` from the bank list.
                  example: NBM
                accountNumber:
                  type: string
                  pattern: ^[0-9]{6,20}$
                  description: 6 to 20 digits.
                  example: '1001234567'
                accountName:
                  type: string
                  description: The name on the bank account.
                  example: Chikondi Banda
                reference:
                  type: string
                  maxLength: 100
                  description: >-
                    Your own reference. It can be paid once, unless the earlier
                    payout failed.
                description:
                  type: string
                  maxLength: 140
      responses:
        '200':
          description: >-
            A repeat of the same payout. The header `Idempotent-Replayed` is
            `true`. It is never paid twice.
          headers:
            Idempotent-Replayed:
              schema:
                type: string
                example: 'true'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payout'
        '201':
          description: The payout was accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payout'
        '400':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '409':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/Error'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      schema:
        type: string
        maxLength: 64
        example: 3c9a7e1f2b6d4a8e9f0c1b2a3d4e5f60
      description: >
        A new value for every new request (a UUID is ideal), up to 64
        characters. If your request times out, send it again with the same key.
        The same key for a different request returns `422
        idempotency_key_reused`.
  schemas:
    Payout:
      type: object
      properties:
        reference:
          type: string
          example: PO-8d3f0c1e6b2a4f7e9c5d1a3b7e2f4c6d
        type:
          type: string
          enum:
            - mobile_money
            - bank
        status:
          type: string
          enum:
            - processing
            - success
            - failed
            - reversed
        amount:
          type: number
        fee:
          type: number
        levy:
          type: number
        currency:
          type: string
          example: MWK
        merchantReference:
          type:
            - string
            - 'null'
          description: Your own `reference`.
        description:
          type: string
        recipient:
          type: object
          description: >-
            `{ provider, phone }` for mobile money, `{ bankName, accountLast4,
            accountName }` for a bank account.
          properties:
            provider:
              type: string
            phone:
              type: string
            bankName:
              type: string
            accountLast4:
              type: string
            accountName:
              type: string
        providerReference:
          type:
            - string
            - 'null'
        failureCode:
          type:
            - string
            - 'null'
          example: null
        createdAt:
          type: string
          format: date-time
        completedAt:
          type:
            - string
            - 'null'
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: insufficient_funds
            message:
              type: string
              example: Not enough available balance for MWK 25,000.00.
            field:
              type: string
              description: >-
                Payment links only. The field that is missing or wrong, for
                example `items[1].unitAmount`.
  responses:
    Error:
      description: An error. Use `code` in your code; show `message` to people.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Your API key: `sk_live_…` / `sk_test_…` (secret), `pk_live_…` /
        `pk_test_…` (publishable, read-only reference data) or `rk_live_…` /
        `rk_test_…` (payments only).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.