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

# Create a payment request via the redirect (Pay by Bank) flow

> Create a payment request via the redirect (Pay by Bank) flow



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/payment-requests:redirect
openapi: 3.1.0
info:
  title: Quidkey API
  version: 1.0.0
  description: API documentation for Quidkey Core Services
servers:
  - url: https://core.quidkey.com
    description: Production
security: []
paths:
  /api/v1/payment-requests:redirect:
    post:
      tags:
        - Payments
      summary: Create a payment request via the redirect (Pay by Bank) flow
      description: Create a payment request via the redirect (Pay by Bank) flow
      requestBody:
        required: true
        description: Strict input parameters for the redirect (Pay by Bank) payment request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/redirectPaymentRequest_Input'
            example:
              merchant_id: 550e8400-e29b-41d4-a716-446655440000
              customer:
                name: John Doe
                email: john.doe@example.com
                phone_number: '+447123456789'
              billing_address:
                address_line1: 12 West Common Drive
                address_line2: Flat 1
                apartment: Apt 5B
                city: London
                state_province: Greater London
                country: GB
                postal_code: SE1 1AA
                company_name: Acme Ltd
              amount: 1999
              currency: GBP
              payment_reference: ORDER123
              order_id: '1140'
              locale: en_GB
              success_url_redirect: https://storename.com/success
              fail_url_redirect: https://storename.com/failure
              test_transaction: false
              selected_bank_id: 38c39d03-8df3-4980-b0a8-7e283c8c62dd
              simulation:
                straddle:
                  customer_outcome: standard
                  paykey_outcome: standard
                  charge_outcome: standard
                  balance_check: required
                flinks:
                  outcome: happy
                  mfa: skip
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/redirectPaymentRequest_Response'
              example:
                success: true
                data:
                  redirect_url: https://example.com/redirect
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/shared_Error400'
              example:
                success: false
                error:
                  message: Invalid input provided
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/shared_Error401'
              example:
                success: false
                error:
                  message: Invalid input provided
      security:
        - bearerAuth: []
components:
  schemas:
    redirectPaymentRequest_Input:
      title: Redirect Payment Request Input
      description: Strict input parameters for the redirect (Pay by Bank) payment request
      additionalProperties: false
      type: object
      required:
        - customer
        - billing_address
        - amount
        - currency
        - locale
      properties:
        merchant_id:
          format: uuid
          description: >-
            Merchant ID. Defaults to the logged-in merchant if not provided.
            Required for admin tokens.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        customer:
          title: Redirect Customer Input
          description: Customer information for the redirect payment request
          additionalProperties: false
          type: object
          required:
            - name
            - email
          properties:
            name:
              description: The name of the customer
              examples:
                - John Doe
              type: string
            email:
              format: email
              description: The email of the customer
              examples:
                - john.doe@example.com
              type: string
            phone_number:
              description: The phone number of the customer
              examples:
                - '+447123456789'
              type: string
        billing_address:
          title: Address
          description: A physical address
          additionalProperties: false
          type: object
          required:
            - address_line1
            - city
            - country
            - postal_code
          properties:
            address_line1:
              description: The first line of the address
              examples:
                - 12 West Common Drive
              type: string
            address_line2:
              description: The second line of the address
              examples:
                - Flat 1
              type: string
            apartment:
              description: The apartment, unit, or suite number
              examples:
                - Apt 5B
                - Unit 12
                - Suite 200
              type: string
            city:
              description: The city
              examples:
                - London
              type: string
            state_province:
              description: The state or province
              examples:
                - Greater London
              type: string
            country:
              pattern: ^[A-Za-z]{2}$
              minLength: 2
              maxLength: 2
              description: ISO 3166-1 alpha-2 country code
              examples:
                - GB
                - US
                - FR
                - DE
              type: string
            postal_code:
              description: The postal code
              examples:
                - SE1 1AA
              type: string
            company_name:
              description: The company name (if applicable)
              examples:
                - Acme Ltd
              type: string
        amount:
          minimum: 1
          maximum: 9999999
          description: Minor-unit amount (e.g. pence/cents). Decimals are rejected.
          examples:
            - 1999
          type: integer
        currency:
          pattern: ^[A-Za-z]{3}$
          minLength: 3
          maxLength: 3
          description: The currency of the payment request
          examples:
            - GBP
            - USD
            - EUR
            - JPY
          type: string
        payment_reference:
          description: >-
            Payment reference to appear on the payer’s bank statement (max 18
            alphanumeric characters)
          examples:
            - ORDER123
          maxLength: 18
          pattern: ^[A-Za-z0-9]{1,18}$
          type: string
        order_id:
          description: The unique identifier for the merchant's order
          examples:
            - '1140'
          type: string
        locale:
          description: The locale of the payment request
          examples:
            - en_GB
          type: string
        success_url_redirect:
          description: URL to redirect on successful payment
          examples:
            - https://storename.com/success
          type: string
        fail_url_redirect:
          description: URL to redirect on failed payment
          examples:
            - https://storename.com/failure
          type: string
        test_transaction:
          description: Flag for test transactions
          examples:
            - false
          type: boolean
        selected_bank_id:
          description: Selected bank reference
          examples:
            - 38c39d03-8df3-4980-b0a8-7e283c8c62dd
          type: string
        simulation:
          additionalProperties: false
          description: >-
            Sandbox simulation config. Honoured only when the upstream provider
            is a fake/sandbox backend; live providers ignore it.
          type: object
          properties:
            straddle:
              additionalProperties: false
              type: object
              properties:
                customer_outcome:
                  description: Simulated identity verification outcome
                  anyOf:
                    - const: standard
                      type: string
                    - const: verified
                      type: string
                    - const: rejected
                      type: string
                    - const: review
                      type: string
                paykey_outcome:
                  description: Simulated bank account link outcome
                  anyOf:
                    - const: standard
                      type: string
                    - const: active
                      type: string
                    - const: rejected
                      type: string
                charge_outcome:
                  description: Simulated charge outcome
                  anyOf:
                    - const: standard
                      type: string
                    - const: paid
                      type: string
                    - const: on_hold_daily_limit
                      type: string
                    - const: cancelled_for_fraud_risk
                      type: string
                    - const: cancelled_for_balance_check
                      type: string
                    - const: failed_insufficient_funds
                      type: string
                    - const: reversed_insufficient_funds
                      type: string
                    - const: failed_customer_dispute
                      type: string
                    - const: reversed_customer_dispute
                      type: string
                    - const: failed_closed_bank_account
                      type: string
                    - const: reversed_closed_bank_account
                      type: string
                balance_check:
                  description: Balance verification behaviour
                  anyOf:
                    - const: required
                      type: string
                    - const: enabled
                      type: string
                    - const: disabled
                      type: string
            flinks:
              additionalProperties: false
              type: object
              properties:
                outcome:
                  description: Simulated bank-linking lifecycle and data shape
                  anyOf:
                    - const: happy
                      type: string
                    - const: async
                      type: string
                    - const: no_us_account
                      type: string
                    - const: partial_data
                      type: string
                    - const: webhook_only
                      type: string
                    - const: rate_limit
                      type: string
                    - const: unreachable
                      type: string
                account:
                  additionalProperties: false
                  type: object
                  required:
                    - total
                  properties:
                    total:
                      minimum: 1
                      description: Total accounts to return
                      type: number
                    existing:
                      description: >-
                        Ids of existing accounts to include; (total -
                        existing.length) new ones are minted
                      type: array
                      items:
                        type: string
                mfa:
                  description: Whether an MFA challenge is presented and how it is answered
                  anyOf:
                    - const: skip
                      type: string
                    - const: correct
                      type: string
                    - const: wrong
                      type: string
    redirectPaymentRequest_Response:
      type: object
      required:
        - success
        - data
      properties:
        success:
          description: Indicates if the request was successful
          examples:
            - true
          type: boolean
        data:
          title: Redirect Payment Request Data
          description: Redirect payment request response data
          additionalProperties: false
          type: object
          required:
            - redirect_url
          properties:
            redirect_url:
              description: URL to redirect the customer to in order to complete payment
              examples:
                - https://example.com/redirect
              type: string
    shared_Error400:
      title: Bad Request Error
      description: 400 Bad Request Error Response
      type: object
      required:
        - success
        - error
      properties:
        success:
          description: Always false for error responses
          examples:
            - false
          const: false
          type: boolean
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              allOf:
                - description: Error code for the specific error type
                  examples:
                    - INVALID_INPUT
                  type: string
                - description: Error code for the specific error type
                  examples:
                    - VALIDATION_ERROR
                  type: string
            message:
              description: Human-readable error message
              examples:
                - Invalid input provided
              type: string
            metadata:
              additionalProperties: true
              description: >-
                Additional error context. For VALIDATION_ERROR, includes a
                per-field `errors` array.
              type: object
              properties:
                errors:
                  type: array
                  items:
                    type: object
                    required:
                      - field
                      - message
                    properties:
                      field:
                        type: string
                      message:
                        type: string
    shared_Error401:
      title: Unauthorized Error
      description: 401 Unauthorized Error Response
      type: object
      required:
        - success
        - error
      properties:
        success:
          description: Always false for error responses
          examples:
            - false
          const: false
          type: boolean
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              allOf:
                - description: Error code for the specific error type
                  examples:
                    - INVALID_INPUT
                  type: string
                - const: UNAUTHORIZED
                  type: string
            message:
              description: Human-readable error message
              examples:
                - Invalid input provided
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````