> ## 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 Withdrawal Intent

Create a withdrawal intent given an intended withdrawal amount, and the member who will receive the funds.

We will process the request, calculate the fee (dependant on the member's tier) and return:

* `netAmount` - a [Money object](/docs/schemas/money) representing the amount that will be transferred to the member
* `fee` - a [Money object](/docs/schemas/money) representing the fee that will be charged
* `accountDetails` - An object containing the bank account details the `netAmount` will be transferred to

Please see the [On Demand Pay](/docs/pay/embedded-pay) documentation for more information on the lifecycle of a withdrawal intent.

#### Relevant Error Codes

The endpoint-specific error codes to pay attention to are:

* [MemberInsufficientFunds](/api-reference/error-handling#memberinsufficientfunds)
* [BankAccountInvalid](/api-reference/error-handling/#bankaccountinvalid)
* [AmountBelowLowerLimit](/api-reference/error-handling/#amountbelowlowerlimit)
* [AmountAboveUpperLimit](/api-reference/error-handling/#amountaboveupperlimit).

In rare cases, you may receive a [Unprocessable Entity Error](snippets/generated-errors#UnprocessableEntity) which indicates that On Demand Pay is temporarily unavailable.


## OpenAPI

````yaml POST /v1/pay/withdrawals/intent
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/withdrawals/intent:
    post:
      tags:
        - pay
      summary: Create a withdrawal intent
      operationId: createWithdrawalIntent
      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:
                memberId:
                  example: mem_<id>
                  description: The unique identifier for a Member, prefixed with mem_
                  type: string
                amount:
                  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
                    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
                - amount
              additionalProperties: false
      responses:
        '201':
          description: '201'
          content:
            application/json:
              schema:
                type: object
                properties:
                  withdrawalIntentId:
                    example: wi_<id>
                    description: >-
                      The unique identifier for a PayWithdrawalIntent, prefixed
                      with wi_
                    type: string
                  netAmount:
                    $ref: '#/components/schemas/NetAmount'
                  fee:
                    $ref: '#/components/schemas/Fee'
                  accountDetails:
                    anyOf:
                      - $ref: '#/components/schemas/BankAccountUK'
                      - $ref: '#/components/schemas/BankAccountEU'
                  bankAccount:
                    deprecated: true
                    description: Deprecated in favour of `accountDetails`
                    type: object
                    properties:
                      lastFour:
                        example: '5678'
                        type: string
                    required:
                      - lastFour
                    additionalProperties: false
                required:
                  - withdrawalIntentId
                  - netAmount
                  - fee
                  - accountDetails
                  - bankAccount
                additionalProperties: false
components:
  schemas:
    NetAmount:
      title: NetAmount
      description: A monetary value with currency.
      example:
        currency: GBP
        amount: 950
      type: object
      properties:
        amount:
          example: 1050
          description: Price in lowest denomination of currency (e.g. cents)
          type: integer
        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
    Fee:
      title: Fee
      description: A monetary value with currency.
      example:
        currency: GBP
        amount: 50
      type: object
      properties:
        amount:
          example: 1050
          description: Price in lowest denomination of currency (e.g. cents)
          type: integer
        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
    BankAccountUK:
      title: BankAccountUK
      example:
        accountHolder: John Smith
        sortCode: '123456'
        accountNumber: '12345678'
      description: A UK bank account
      type: object
      properties:
        accountHolder:
          type: string
        sortCode:
          type: string
        accountNumber:
          type: string
      required:
        - accountHolder
        - sortCode
        - accountNumber
      additionalProperties: false
    BankAccountEU:
      title: BankAccountEU
      example:
        accountHolder: John Smith
        iban: GB29NWBK60161331926819
      description: A EU bank account
      type: object
      properties:
        accountHolder:
          type: string
        iban:
          type: string
      required:
        - accountHolder
        - iban
      additionalProperties: false
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````