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

# Create Pay Run

Create a pay run to make pay available to your members.

Include a list of Member IDs, and the amount you would like to make available in the form of a `Money` object (please see [Money Object](/docs/schemas/money)).

We will either respond with a list of issues, or with a created `PayRun` object.

The `PayRun` will, by default, be executed after a 10 minute grace period. This can be seen in the `scheduledFor` field of the `PayRun` object.

<Card horizontal title="Avoiding Duplicates" icon="circle-exclamation" iconType="duotone" href="/api-reference/idempotency">
  We strongly reccomend using an `x-idempotency-key` to avoid duplicate pay run uploads, and therefore duplicate money
  being made available to your members.
</Card>


## OpenAPI

````yaml POST /v1/pay/run
openapi: 3.0.2
info:
  title: BMO Partner API
  version: v1
servers:
  - url: https://api.onsi.com
    description: Production
  - url: https://api.onsi.dev
    description: Sandbox
security:
  - apiKey: []
paths:
  /v1/pay/run:
    post:
      tags:
        - pay
      summary: Upload pay details to make pay available to your members
      operationId: uploadPayRun
      parameters:
        - name: x-idempotency-key
          in: header
          description: Unique key to ensure idempotency of the request
          schema:
            type: string
      requestBody:
        description: Body
        content:
          application/json:
            schema:
              type: object
              properties:
                payDetails:
                  type: array
                  items:
                    type: object
                    properties:
                      memberId:
                        example: mem_<id>
                        description: The unique identifier for a Member, prefixed with mem_
                        type: string
                      money:
                        title: Money
                        description: A monetary value with currency.
                        type: object
                        properties:
                          amount:
                            example: 1050
                            description: >-
                              Price in lowest denomination of currency (e.g.
                              cents)
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          currency:
                            example: GBP
                            description: ISO 4217 currency code
                            type: string
                            enum:
                              - AED
                              - AFN
                              - ALL
                              - AMD
                              - ANG
                              - AOA
                              - ARS
                              - AUD
                              - AWG
                              - AZN
                              - BAM
                              - BBD
                              - BDT
                              - BGN
                              - BHD
                              - BIF
                              - BMD
                              - BND
                              - BOB
                              - BOV
                              - BRL
                              - BSD
                              - BTN
                              - BWP
                              - BYN
                              - BZD
                              - CAD
                              - CDF
                              - CHE
                              - CHF
                              - CHW
                              - CLF
                              - CLP
                              - CNY
                              - COP
                              - COU
                              - CRC
                              - CUC
                              - CUP
                              - CVE
                              - CZK
                              - DJF
                              - DKK
                              - DOP
                              - DZD
                              - EGP
                              - ERN
                              - ETB
                              - EUR
                              - FJD
                              - FKP
                              - GBP
                              - GEL
                              - GHS
                              - GIP
                              - GMD
                              - GNF
                              - GTQ
                              - GYD
                              - HKD
                              - HNL
                              - HRK
                              - HTG
                              - HUF
                              - IDR
                              - ILS
                              - INR
                              - IQD
                              - IRR
                              - ISK
                              - JMD
                              - JOD
                              - JPY
                              - KES
                              - KGS
                              - KHR
                              - KMF
                              - KPW
                              - KRW
                              - KWD
                              - KYD
                              - KZT
                              - LAK
                              - LBP
                              - LKR
                              - LRD
                              - LSL
                              - LYD
                              - MAD
                              - MDL
                              - MGA
                              - MKD
                              - MMK
                              - MNT
                              - MOP
                              - MRU
                              - MUR
                              - MVR
                              - MWK
                              - MXN
                              - MXV
                              - MYR
                              - MZN
                              - NAD
                              - NGN
                              - NIO
                              - NOK
                              - NPR
                              - NZD
                              - OMR
                              - PAB
                              - PEN
                              - PGK
                              - PHP
                              - PKR
                              - PLN
                              - PYG
                              - QAR
                              - RON
                              - RSD
                              - RUB
                              - RWF
                              - SAR
                              - SBD
                              - SCR
                              - SDG
                              - SEK
                              - SGD
                              - SHP
                              - SLL
                              - SOS
                              - SRD
                              - SSP
                              - STN
                              - SVC
                              - SYP
                              - SZL
                              - THB
                              - TJS
                              - TMT
                              - TND
                              - TOP
                              - TRY
                              - TTD
                              - TWD
                              - TZS
                              - UAH
                              - UGX
                              - USD
                              - USN
                              - UYI
                              - UYU
                              - UYW
                              - UZS
                              - VES
                              - VND
                              - VUV
                              - WST
                              - XAF
                              - XAG
                              - XAU
                              - XBA
                              - XBB
                              - XBC
                              - XBD
                              - XCD
                              - XDR
                              - XOF
                              - XPD
                              - XPF
                              - XPT
                              - XSU
                              - XTS
                              - XUA
                              - XXX
                              - YER
                              - ZAR
                              - ZMW
                              - ZWL
                        required:
                          - amount
                          - currency
                        additionalProperties: false
                        x-instanceOf: Money
                    required:
                      - memberId
                      - money
                    additionalProperties: false
              required:
                - payDetails
              additionalProperties: false
      responses:
        '201':
          description: >-
            A pay run is a list of members and the amount of money they are able
            to withdraw
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayRun'
components:
  schemas:
    PayRun:
      title: PayRun
      description: >-
        A pay run is a list of members and the amount of money they are able to
        withdraw
      example:
        id: pr_<id>
        payCycleId: pc_<id>
        status: Scheduled
        scheduledFor: '2024-01-01T00:00:00Z'
      anyOf:
        - $ref: '#/components/schemas/PayRunDraft'
        - $ref: '#/components/schemas/PayRunReverted'
        - $ref: '#/components/schemas/PayRunAvailable'
        - $ref: '#/components/schemas/PayRunScheduled'
    PayRunDraft:
      title: PayRunDraft
      description: A pay run that is in draft status
      type: object
      properties:
        id:
          type: string
        payCycleId:
          example: pc_<id>
          description: The unique identifier for a PayCycle, prefixed with pc_
          type: string
        status:
          type: string
          enum:
            - Draft
      required:
        - id
        - payCycleId
        - status
      additionalProperties: false
    PayRunReverted:
      title: PayRunReverted
      description: A pay run that has been reverted
      type: object
      properties:
        id:
          type: string
        payCycleId:
          example: pc_<id>
          description: The unique identifier for a PayCycle, prefixed with pc_
          type: string
        status:
          type: string
          enum:
            - Reverted
      required:
        - id
        - payCycleId
        - status
      additionalProperties: false
    PayRunAvailable:
      title: PayRunAvailable
      description: A pay run that is available for withdrawal
      type: object
      properties:
        id:
          type: string
        payCycleId:
          example: pc_<id>
          description: The unique identifier for a PayCycle, prefixed with pc_
          type: string
        status:
          type: string
          enum:
            - Available
      required:
        - id
        - payCycleId
        - status
      additionalProperties: false
    PayRunScheduled:
      title: PayRunScheduled
      description: A pay run that is scheduled to run at a future date
      type: object
      properties:
        id:
          type: string
        payCycleId:
          example: pc_<id>
          description: The unique identifier for a PayCycle, prefixed with pc_
          type: string
        status:
          type: string
          enum:
            - Scheduled
        scheduledFor:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
      required:
        - id
        - payCycleId
        - status
        - scheduledFor
      additionalProperties: false
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````