# Create payout

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/payouts:
    post:
      summary: Create payout
      deprecated: false
      description: >
        Move funds from a business operational account to one or more wallets
        inside the closed-loop ecosystem.

        This API enables businesses to distribute money internally, such as
        customer rewards, wallet top-ups, or supplier payments, without using
        any external payment rails.

        The source will always be the business’s operational account.


        ### Transaction Flow

        | Step |
        Description                                                               
        | Account Type | Direction      |

        | ---- |
        --------------------------------------------------------------------------
        | ------------ | -------------- |

        | 1    | Debit the **business operational account** to reflect the
        outgoing payment | Business     | **DEBIT (−)**  |

        | 2    | Credit the **wallet account** of the
        recipient                             | Wallet       | **CREDIT (+)** |
      operationId: create-payout
      tags:
        - Vrtx Closed loop/Money Movement
        - Money Movement
      parameters:
        - name: Idempotency-Key
          in: header
          description: Optional key to deduplicate payout submissions.
          required: false
          example: payout-req-123
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayoutCreatePayload'
            examples:
              PayoutCreatePayload:
                value:
                  source_account_number: '950100010020'
                  destination_account_number: '850100010048'
                  amount: '10.00'
                  currency: SAR
                  external_reference: PO-001357911441
                  purpose: Vendor settlement
                  notes: Process before noon
                summary: PayoutCreatePayload
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                x-apidog-orders: []
                properties: {}
                x-apidog-ignore-properties: []
              examples:
                PayoutResponse:
                  summary: PayoutResponse
                  value:
                    id: b6327558-741e-411c-866b-0eec8ea26005
                    sender_account_number: '054200001011'
                    receiver_account_number: '054200002027'
                    amount: '10.00'
                    currency: SAR
                    external_reference: PO-0013579
                    purpose: Vendor settlement
                    notes: Process before noon
                    status: SUCCESS
                    created_at: '2025-10-25T14:34:04.254Z'
          headers: {}
          x-apidog-name: Created
        '400':
          description: Bad Request
          content:
            application/json:
              schema: &ref_0
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                BadRequest:
                  summary: BadRequest
                  value:
                    error_code: INVALID_INPUT
                    error_message: Input parameters failed validation
                    details:
                      - field: amount
                        message: amount must be greater than zero
                        code: out_of_range
                    status_code: 400
          headers: {}
          x-apidog-name: Bad Request
        '401':
          description: Not Authorized
          content:
            application/json:
              schema: *ref_0
              examples:
                Unauthorized:
                  summary: Unauthorized
                  value:
                    error_code: UNAUTHORIZED_ACCESS
                    error_message: You are not authorized to access this resource.
                    details:
                      - field: authorization
                        message: Valid Bearer token required
                        code: unauthorized_access
                    status_code: 401
          headers: {}
          x-apidog-name: Unauthorized
        '403':
          description: Not Allowed
          content:
            application/json:
              schema: *ref_0
              examples:
                Forbidden:
                  summary: Forbidden
                  value:
                    error_code: FORBIDDEN
                    error_message: Forbidden
                    details:
                      - field: authorization
                        message: Insufficient permissions to access this resource
                        code: forbidden
                    status_code: 403
          headers: {}
          x-apidog-name: Forbidden
      security:
        - bearerAuth3: []
          x-apidog:
            schemeGroups:
              - id: h8Kef0hiojqxYIVsSv6Cg
                schemeIds:
                  - bearerAuth3
            required: true
            use:
              id: h8Kef0hiojqxYIVsSv6Cg
            scopes:
              h8Kef0hiojqxYIVsSv6Cg:
                bearerAuth3: []
      x-apidog-folder: Vrtx Closed loop/Money Movement
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1053095/apis/api-24814165-run
components:
  schemas:
    PayoutCreatePayload:
      type: object
      required:
        - amount
        - currency
      description: API payload for sending payouts from a business wallet.
      properties:
        source_account_number:
          type:
            - string
            - 'null'
          examples:
            - '819900000019'
          pattern: '[089]\d{11}'
          description: Wallet account number
        source_external_reference:
          type:
            - string
            - 'null'
          examples:
            - WALLET-RIYADH-001
          maxLength: 120
          description: Wallet external reference
        destination_account_number:
          type:
            - string
            - 'null'
          examples:
            - '819900000019'
          pattern: '[089]\d{11}'
          description: Wallet account number
        destination_external_reference:
          type:
            - string
            - 'null'
          examples:
            - WALLET-RIYADH-001
          maxLength: 120
          description: Wallet external reference
        amount:
          type: string
          examples:
            - '250.00'
          pattern: ^[0-9]+(\.[0-9]{1,3})?$
          description: Amount in major currency units
        currency:
          type: string
          examples:
            - SAR
          pattern: ^[A-Z]{3}$
          description: ISO 4217 currency
        external_reference:
          type:
            - string
            - 'null'
          examples:
            - PO-001
          maxLength: 64
          description: Client-supplied external reference
        purpose:
          type:
            - string
            - 'null'
          examples:
            - Vendor settlement
          maxLength: 255
          description: Purpose for the payout
        notes:
          type:
            - string
            - 'null'
          examples:
            - Process before noon
          maxLength: 512
          description: Additional notes
      allOf:
        - oneOf:
            - type: object
              required:
                - source_account_number
              properties:
                source_account_number:
                  type: string
                  pattern: '[89][0-9]{11}'
                  description: >-
                    12-digit wallet account number (8-prefix for wallet,
                    9-prefix for business)
                  examples:
                    - '819900000019'
              x-apidog-orders:
                - source_account_number
              x-apidog-ignore-properties: []
            - type: object
              required:
                - source_external_reference
              properties:
                source_external_reference:
                  type: string
                  description: External wallet reference controlled by the integrator
                  maxLength: 120
                  examples:
                    - WALLET-RIYADH-001
              x-apidog-orders:
                - source_external_reference
              x-apidog-ignore-properties: []
          x-apidog-orders: []
        - oneOf:
            - type: object
              required:
                - destination_account_number
              properties:
                destination_account_number:
                  type: string
                  pattern: '[89][0-9]{11}'
                  description: >-
                    12-digit wallet account number (8-prefix for wallet,
                    9-prefix for business)
                  examples:
                    - '819900000019'
              x-apidog-orders:
                - destination_account_number
              x-apidog-ignore-properties: []
            - type: object
              required:
                - destination_external_reference
              properties:
                destination_external_reference:
                  type: string
                  description: External wallet reference controlled by the integrator
                  maxLength: 120
                  examples:
                    - WALLET-RIYADH-001
              x-apidog-orders:
                - destination_external_reference
              x-apidog-ignore-properties: []
          x-apidog-orders: []
      x-apidog-orders:
        - source_account_number
        - source_external_reference
        - destination_account_number
        - destination_external_reference
        - amount
        - currency
        - external_reference
        - purpose
        - notes
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    ErrorResponse:
      type: object
      properties:
        error_code:
          type: string
        error_message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetail'
        status_code:
          type: integer
          format: int32
      x-apidog-orders:
        - error_code
        - error_message
        - details
        - status_code
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    ErrorDetail:
      type: object
      properties:
        field:
          type: string
        message:
          type: string
        code:
          type: string
      x-apidog-orders:
        - field
        - message
        - code
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes:
    bearerAuth:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: Enter your JWT access token for authentication
    bearerAuth1:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
    bearerAuth2:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: Enter your JWT access token for authentication
    bearerAuth3:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT issued by Keycloak. The client_id/azp in the token must map to a
        configured tenant (public, fai, neomrs; e.g., fai-sandbox -> fai) or
        requests will return 403.
    bearerAuth4:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: Enter your JWT access token for authentication
    bearer:
      type: http
      scheme: bearer
servers:
  - url: https://api.sandbox.vrtx.sa
    description: Sandbox
security:
  - bearer: []

```
