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

# Payout

> Initiate a Raast payout to credit a beneficiary IBAN



## OpenAPI

````yaml post /v1/aggregators/{raast-aggregator-id}/payout
openapi: 3.1.0
info:
  title: Raast Wire
  version: 1.0.0
  description: ''
servers:
  - url: https://api.getsafepay.com/raastwire
security: []
tags:
  - name: Aggregators
  - name: Access Keys
  - name: Merchants
  - name: Raast Merchants
  - name: Payments
  - name: Refunds
  - name: QRs
  - name: Utilities
  - name: Aliases
  - name: Ledgers
  - name: Webhooks
paths:
  /v1/aggregators/{raast-aggregator-id}/payout:
    parameters:
      - $ref: '#/components/parameters/AggregatorIdParam'
    post:
      tags:
        - Payments
      summary: Payout
      description: Initiate a Raast payout to credit a beneficiary IBAN
      requestBody:
        $ref: '#/components/requestBodies/CreatePayout'
      responses:
        '200':
          $ref: '#/components/responses/CreatePayoutResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - apiKey: []
components:
  parameters:
    AggregatorIdParam:
      name: raast-aggregator-id
      in: path
      required: true
      schema:
        type: string
        example: agg_2288490a-2176-4de5-b373-0ffb6f8e2e6e
      description: The unique identifier for the aggregator
  requestBodies:
    CreatePayout:
      description: Request to initiate a payout
      content:
        application/json:
          schema:
            type: object
            description: Payout initiation payload
            properties:
              request_id:
                type: string
                description: Unique identifier supplied by the client to ensure idempotency
              amount:
                type: string
                description: >-
                  Amount to credit in PKR, expressed as a string to preserve
                  formatting
              creditor_iban:
                type: string
                description: Destination IBAN that receives the payout
            required:
              - request_id
              - amount
              - creditor_iban
          examples:
            Create Payout:
              value:
                request_id: d44940a1-663b-4d92-91e7-65438e4bf80b
                amount: '200'
                creditor_iban: PK25ALFH0216001008658216
  responses:
    CreatePayoutResponse:
      description: This response contains details of a payout request
      headers:
        Content-Length:
          $ref: '#/components/headers/ContentLengthHeader'
        Date:
          $ref: '#/components/headers/DateHeader'
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/StandardResponse'
              - type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Payment'
          examples:
            Create Payout:
              value:
                api_version: v1
                data:
                  id: '44'
                  token: pm_2a8c2cfc-e61d-431e-a850-f1808405ca07
                  aggregator_id: agg_2288490a-2176-4de5-b373-0ffb6f8e2e6e
                  aggregator_merchant_id: ''
                  qr_code_id: ''
                  order_id: ''
                  type: PAYOUT
                  amount: '200'
                  status: P_INITIATED
                  uetr: 3335131b-b26c-41c6-a089-a3b4905dcc68
                  trace_reference: 2005867c-752f-430f-8619-a4c998423e3d
                  msg_id: QAI8456FZ5NOR5H6ITEVK2U2NCD7POCSKQS
                  instr_id: cb865267aec142d389f3ff728bb2492a
                  end_to_end_id: 3335131bb26c41c6a089a3b4905dcc68
                  pmt_inf_id: ''
                  request_id: d4659c62-2c4a-4e60-8dfa-cd504bf50cca
                  msg_created_at: '2025-10-02 11:03:11.041'
                  expires_at: '1970-01-01T00:00:00Z'
                  created_at: '2025-10-02T06:03:11Z'
                  updated_at: '2025-10-02T06:03:11Z'
                  txn_logs:
                    - id: '35'
                      type: TLT_PAYMENT
                      payment_id: pm_2a8c2cfc-e61d-431e-a850-f1808405ca07
                      status: P_INITIATED
                      refund_id: ''
                      settlement_id: ''
                      txn_desc: ''
                      addtl_info: ''
                      token: txnlog_b9679d70-8874-459b-ad55-28180c53f0b1
                      timestamp: '2025-10-02T06:03:11Z'
                      iso_msg_type: pain.013.001.09
                  payment_parties:
                    - id: '87'
                      token: pp_6a71861c-2e6a-4355-957e-0b6d8e4d9a06
                      role: ROLE_DEBITOR
                      payment_id: pm_2a8c2cfc-e61d-431e-a850-f1808405ca07
                      bank_account_id: acc_c03a57cb-a616-42a7-b1dc-de473217a558
                      bank_account:
                        id: '11'
                        token: acc_c03a57cb-a616-42a7-b1dc-de473217a558
                        vault_token: lock_464309f2-572f-493f-8272-e503277b06fd
                        title: SYED MUHAMMAD HAQANI
                        iban: ''
                        redacted_iban: PK84HABB************8594
                        hashed_iban: TAQswoYYIJaiPH15TAS5+tnFe7yDOK0kWP2wgSXwi7k=
                        servicer: HABBPKKARTG
                        bank: ''
                        created_at: '2025-03-13T09:12:35Z'
                        updated_at: '2025-03-13T09:12:35Z'
                      created_at: '2025-10-02T06:03:11Z'
                      updated_at: '2025-10-02T06:03:11Z'
                    - id: '88'
                      token: pp_42dd9241-794b-4fad-b4c2-ca8d88ce8ca6
                      role: ROLE_CREDITOR
                      payment_id: pm_2a8c2cfc-e61d-431e-a850-f1808405ca07
                      bank_account_id: acc_9fd8d208-0e51-4869-87ea-12bbfc3a3ad6
                      bank_account:
                        id: '81'
                        token: acc_9fd8d208-0e51-4869-87ea-12bbfc3a3ad6
                        vault_token: lock_124456f6-3e1d-4f31-8baa-ea914ed365f0
                        title: Title-1 1008658216
                        iban: ''
                        redacted_iban: PK25ALFH************8216
                        hashed_iban: 7zWv4dnBcoTKS4/dyrbMSWlFKVuwNWVkVlKmeRiu7Us=
                        servicer: ALFHPKKA
                        bank: ''
                        created_at: '2025-09-22T09:42:41Z'
                        updated_at: '2025-09-22T09:42:41Z'
                      created_at: '2025-10-02T06:03:11Z'
                      updated_at: '2025-10-02T06:03:11Z'
                  qr_code: null
                  aggregator_merchant: null
                  refunds: []
                  settlement: null
    Unauthorized:
      description: Unauthorized
      headers:
        Content-Length:
          $ref: '#/components/headers/ContentLengthHeader'
        Date:
          $ref: '#/components/headers/DateHeader'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorEnvelope'
          examples:
            Unauthorized:
              value:
                api_version: v1
                error:
                  code: error.unauthorized_access
                  message: partner access key is required in request header
    InternalError:
      description: Internal server error response
      headers:
        Content-Length:
          $ref: '#/components/headers/ContentLengthHeader'
        Date:
          $ref: '#/components/headers/DateHeader'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorEnvelope'
          examples:
            InternalServerError:
              value:
                api_version: v1
                error:
                  code: error.internal_server_error
                  message: rpc error code Internal desc = something went wrong
  headers:
    ContentLengthHeader:
      schema:
        type: string
        example: '256'
    DateHeader:
      schema:
        type: string
        example: Sat, 12 Aug 2023 08:55:04 GMT
  schemas:
    StandardResponse:
      type: object
      description: Standard response structure for successful operations
      properties:
        api_version:
          type: string
          example: v1
          description: The current version of the API spec
        data:
          type: object
          description: Contains the response data
    Payment:
      type: object
      description: Payment record returned by Safepay aggregator APIs.
      properties:
        id:
          type: string
          description: Internal identifier for the payment record.
        token:
          type: string
          description: Public token that uniquely identifies the payment.
        aggregator_id:
          type: string
          description: Aggregator identifier that owns the payment.
        aggregator_merchant_id:
          type: string
          description: Aggregator merchant on whose behalf the payment was initiated.
        qr_code_id:
          type: string
          description: Identifier of the QR code associated with the payment.
        order_id:
          type: string
          description: Merchant-supplied order identifier for the payment.
        type:
          type: string
          description: Indicates how the payment request was initiated.
          enum:
            - RTP_NOW
            - RTP_LATER
            - STATIC_QR
            - DYNAMIC_QR
        amount:
          type: string
          description: Payment amount expressed as a string to preserve formatting.
        status:
          type: string
          description: Current status of the payment.
          enum:
            - P_INITIATED
            - P_RECEIVED
            - P_CANCELLED
            - P_REJECTED
            - P_FAILED
            - P_AUTHORIZED
            - P_REVERSED
            - P_CAPTURED
            - P_SETTLED
            - P_PARTIALLY_REFUNDED
            - P_REFUNDED
        uetr:
          type: string
          description: Unique End-to-end Transaction Reference assigned by Raast.
        trace_reference:
          type: string
          description: Trace reference identifier used for reconciliation.
        msg_id:
          type: string
          description: Raast network message identifier for the payment.
        instr_id:
          type: string
          description: Instruction identifier from the Raast message payload.
        end_to_end_id:
          type: string
          description: End-to-end identifier recorded for the payment.
        pmt_inf_id:
          type: string
          description: Payment information identifier from the Raast message.
        request_id:
          type: string
          description: Client-supplied idempotency identifier.
        msg_created_at:
          type: string
          description: Timestamp captured in the Raast message associated with the payment.
        expires_at:
          allOf:
            - $ref: '#/components/schemas/Timestamp'
          description: Expiry timestamp for the payment request.
          nullable: true
        created_at:
          allOf:
            - $ref: '#/components/schemas/Timestamp'
          description: Timestamp when the payment record was created.
        updated_at:
          allOf:
            - $ref: '#/components/schemas/Timestamp'
          description: Timestamp when the payment record was last updated.
        txn_logs:
          type: array
          description: Lifecycle events generated for the payment.
          items:
            $ref: '#/components/schemas/TransactionLogs'
        payment_parties:
          type: array
          description: Participant records involved in the payment lifecycle.
          items:
            $ref: '#/components/schemas/PaymentParty'
        debitor:
          type: object
          description: Debitor metadata when available.
          nullable: true
        qr_code:
          allOf:
            - $ref: '#/components/schemas/QRCode'
          description: QR code details associated with the payment when available.
          nullable: true
        aggregator_merchant:
          allOf:
            - $ref: '#/components/schemas/Merchant'
          description: Aggregator merchant details when linked to the payment.
          nullable: true
        refunds:
          type: array
          description: Refunds applied to the payment.
          items:
            $ref: '#/components/schemas/Refund'
        settlement:
          type: object
          description: Settlement information for the payment when applicable.
          nullable: true
    ApiErrorEnvelope:
      type: object
      description: Error wrapper that includes the API version and error metadata
      properties:
        api_version:
          type: string
          description: Indicates the API version associated with the response
          example: v1
        error:
          description: Structured error details describing why the request failed
          allOf:
            - $ref: '#/components/schemas/ErrorResponse'
          example:
            code: error.unauthorized_access
            message: partner access key is required in request header
    Timestamp:
      type: string
      format: date-time
      description: ISO 8601 timestamp in UTC
      example: '2025-03-13T09:12:34.000Z'
    TransactionLogs:
      type: object
      description: Event log generated for a payment lifecycle transition.
      properties:
        id:
          type: string
          description: Identifier of the transaction log entry.
        type:
          type: string
          description: Classification of the logged event.
        payment_id:
          type: string
          description: Identifier of the payment linked to the event.
        status:
          type: string
          description: Payment status recorded by this log entry.
        refund_id:
          type: string
          description: Refund identifier when the log entry references a refund.
        settlement_id:
          type: string
          description: >-
            Settlement identifier when the log entry references settlement
            activity.
        txn_desc:
          type: string
          description: Human-readable description of the event.
        addtl_info:
          type: string
          description: Additional information provided for the event.
        token:
          type: string
          description: Public token assigned to the log entry.
        timestamp:
          type: string
          format: date-time
          description: ISO-8601 timestamp captured for the event.
        iso_msg_type:
          type: string
          description: Raast ISO message type associated with this event.
    PaymentParty:
      type: object
      description: Participant record linked to a payment or payout
      properties:
        id:
          type: string
          description: Internal Safepay identifier for the payment party
        token:
          type: string
          description: Public token representing the payment party
        role:
          type: string
          description: Role played by the participant in the transaction lifecycle
        payment_id:
          type: string
          description: Identifier of the payment that this party belongs to
        bank_account_id:
          type: string
          description: Identifier of the linked bank account
        bank_account:
          $ref: '#/components/schemas/BankAccount'
          description: Bank account resource associated with the party when available
        created_at:
          $ref: '#/components/schemas/Timestamp'
        updated_at:
          $ref: '#/components/schemas/Timestamp'
    QRCode:
      type: object
      properties:
        id:
          type: string
        token:
          type: string
        aggregator_merchant_id:
          type: string
        type:
          type: string
        code:
          type: string
        terminal_label:
          type: string
        reference_label:
          type: string
        is_deleted:
          type: boolean
        created_at:
          type: string
          format: date-time
    Merchant:
      type: object
      description: Merchant resource created under an aggregator for Raast transactions
      properties:
        id:
          type: string
          description: Internal Safepay identifier for the merchant
        token:
          type: string
          description: Public token identifying the aggregator merchant
        name:
          type: string
          description: Display name of the merchant
        aggregator_id:
          type: string
          description: Identifier of the aggregator that owns the merchant
        merchant_id:
          type: string
          description: Identifier of the linked Raast merchant account
        merchant_external_id:
          type: string
          description: Original merchant identifier provided by the aggregator
        bank_account_id:
          type: string
          description: Identifier of the settlement bank account
        enabled:
          type: boolean
          description: Indicates whether the merchant is currently active
        bank_account:
          $ref: '#/components/schemas/BankAccount'
        raast_merchant:
          $ref: '#/components/schemas/RaastMerchant'
        rate_card:
          $ref: '#/components/schemas/RateCard'
        created_at:
          $ref: '#/components/schemas/Timestamp'
        updated_at:
          $ref: '#/components/schemas/Timestamp'
    Refund:
      type: object
      properties:
        token:
          type: string
        payment_id:
          type: string
        amount:
          type: string
        type:
          type: string
        reason:
          type: string
        addtl_info:
          type: string
        status:
          type: string
        trace_reference:
          type: string
        msg_id:
          type: string
        return_id:
          type: string
        request_id:
          type: string
        msg_created_at:
          $ref: '#/components/schemas/Timestamp'
        settle_at:
          nullable: true
        created_at:
          $ref: '#/components/schemas/Timestamp'
        updated_at:
          $ref: '#/components/schemas/Timestamp'
    ErrorResponse:
      type: object
      description: Standard error response structure
      properties:
        code:
          type: string
          description: Error code identifying the type of error
        message:
          type: string
          description: Human-readable error message
    BankAccount:
      type: object
      properties:
        id:
          type: string
          description: Internal Safepay identifier for the bank account
        token:
          type: string
        vault_token:
          type: string
        title:
          type: string
        iban:
          type: string
        redacted_iban:
          type: string
        hashed_iban:
          type: string
        servicer:
          type: string
        bank:
          type: string
        depositor_id:
          type: string
        owner:
          type: string
        kind:
          type: integer
        version:
          type: string
        created_at:
          $ref: '#/components/schemas/Timestamp'
        updated_at:
          $ref: '#/components/schemas/Timestamp'
    RaastMerchant:
      type: object
      description: Raast merchant profile synchronized from the state bank registry
      properties:
        id:
          type: string
          description: Internal Safepay identifier for the Raast merchant record
        token:
          type: string
          description: Public Raast merchant token
        partner_id:
          type: string
          description: Identifier of the upstream partner associated with the merchant
        raast_record_id:
          type: string
          description: Identifier issued by the Raast directory
        status:
          type: string
          description: Current activation status reported by Raast
        uid_type:
          type: string
          description: Type of the merchant unique identifier such as NTN or CNIC
        uid_value:
          type: string
          description: Value of the unique identifier registered with Raast
        name:
          type: string
          description: Legal entity name on file with Raast
        document_type:
          type: string
          description: Supporting document type recorded during onboarding
        document_number:
          type: string
          description: Number of the supporting document
        address_details:
          type: object
          description: Merchant registered address per Raast records
          properties:
            country:
              type: string
              description: ISO 3166-1 alpha-2 country code
            city:
              type: string
              description: City of the address
            state_province_region:
              type: string
              description: Province or region of the address
            address_line:
              type: string
              description: Street-level address line
        contact_details:
          type: object
          description: Merchant contact information on file
          properties:
            mobile_number:
              type: string
              description: Merchant contact mobile number in E.164 format
            email:
              type: string
              format: email
              description: Merchant contact email address
        additional_details:
          type: object
          description: Optional public metadata collected during onboarding
          properties:
            dba:
              type: string
              description: Doing-business-as name if different from the legal name
            mcc:
              type: string
              description: Merchant category code associated with the merchant
            lat:
              type: string
              description: Latitude coordinate when available
            long:
              type: string
              description: Longitude coordinate when available
        additional_details_private:
          type: object
          description: Safepay private metadata for the Raast merchant
        created_at:
          $ref: '#/components/schemas/Timestamp'
        updated_at:
          $ref: '#/components/schemas/Timestamp'
    RateCard:
      type: object
      description: Rate configuration associated with a merchant for Raast payments
      properties:
        id:
          type: string
          description: Internal Safepay identifier for the rate card linkage
        token:
          type: string
          description: Public token representing the merchant rate card
        aggregator_merchant_id:
          type: string
          description: Identifier of the aggregator merchant that owns the rate card
        connector_id:
          type: string
          description: Identifier of the connector through which payments are processed
        rate_card_id:
          type: string
          description: Identifier of the underlying rate definition template
        ratecard_kind:
          $ref: '#/components/schemas/RateCardKind'
        fixed_rate:
          type: integer
          description: Fixed transaction fee in paisa when applicable
        tax_rate:
          type: number
          description: Tax rate applied to the fixed fee (fractional value)
        tax_region:
          type: string
          description: Region for which the tax rate applies
        variable_rate:
          type: number
          description: Percentage fee applied to the transaction amount
        sales_tax_withholding:
          type: number
          description: >-
            Sales tax withholding rate applied to the transaction (fractional
            value)
        income_tax_withholding:
          type: number
          description: >-
            Income tax withholding rate applied to the transaction (fractional
            value)
        created_at:
          $ref: '#/components/schemas/Timestamp'
        updated_at:
          $ref: '#/components/schemas/Timestamp'
    RateCardKind:
      type: string
      description: >-
        Enumerated rate card strategy where numeric Raast values map to
        constants (0: RateCardKind_unspecified, 1: RateCardKind_variable, 2:
        RateCardKind_fixed, 3: RateCardKind_blend).
      enum:
        - RateCardKind_unspecified
        - RateCardKind_variable
        - RateCardKind_fixed
        - RateCardKind_blend
      example: RateCardKind_fixed
  securitySchemes:
    apiKey:
      type: apiKey
      name: X-SFPY-AGGREGATOR-SECRET-KEY
      in: header

````