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

# Authorize Transaction

> This endpoint authorizes a transaction and holds funds for a specified period. This endpoint handles payout requests.

> **Record Creation:**
>
> Authorization record is created with **PENDING** status before MPGS call, then updated to **AUTHORIZED** on success or **FAILED** on error.
> 



## OpenAPI

````yaml /openapi.json post /card/auth_capture/authorize
openapi: 3.0.1
info:
  title: Payaza Documentation
  version: 2.0.0
  description: >-
    API reference for processing payments using Card, Bank Transfer, USSD, and
    QR Code methods.
servers:
  - url: https://api.payaza.africa/live
security:
  - ApiKeyAuth: []
  - TenantID: []
  - ProductID: []
tags:
  - name: Transfers
    description: >-
      Transfers are transactions made from your Payaza account to beneficiaries.
      Merchants can instantly transfer funds from their available balance. For
      every transfer, you need to specify the amount and the beneficiary’s
      details. You become eligible to make transfers after you have been
      verified. (you sign up, finish account activation and KYC verification).
  - name: Payaza Account
    description: >-
      This is our internal account that can be used to make payouts to other
      bank accounts, in single or in bulk. The Payaza account can also be used
      to receive settlements. It can also be used to track the transfer status
      of your transactions and check your balance instantly
  - name: Sub Accounts
    description: >-
      This enables you to establish Sub Payaza accounts for your customers. Each
      sub-account comes with an assigned static virtual account, facilitating
      direct funding for individual accounts. Furthermore, the Main Payaza
      account can directly initiate funding for each sub-account. These
      sub-accounts serve the purpose of managing unique account positions or
      balances and facilitating disbursements from these positions to specified
      beneficiaries.
  - name: EUR Accounts
    description: >-
      This endpoints enable you to create EUR subaccounts which can be used to
      make transfers as required .
  - name: Apple Pay and Google Pay
    description: >-
      Apple Pay and Google Pay give your customers a fast, familiar, and secure
      way to complete payments. Our APIs provide a gateway to provide these
      services to your users for a smooth payment experience.
  - name: Virtual Accounts
    description: >-
      Virtual Accounts are bank accounts that are created for a specific purpose
      and last for specified durations. Virtual accounts are issued by Payaza’s
      partner banks. Our virtual account APIs can be used to create virtual
      accounts and perform other tasks relevant to virtual accounts. Virtual
      accounts are created to foster easy payment collections for your business
      and platform. 

      Static/Reserved Account: This virtual account is created by the merchant
      and remains valid indefinitely. It can be used multiple times and does not
      expire. 

      Dynamic Account: This virtual account is generated for a specific
      transaction or purpose. Please note that dynamic virtual account remains
      valid for a temporary period of time or until a payment of the specified
      amount is received. Upon expiry, a merchant can generate another one for a
      different purpose.
  - name: Card Collection
    description: >-
      The Card Collection APIs can be used to make card transactions, refund
      transactions that have been performed, check the status of a transaction
      and so much more.
  - name: Card Tokenisation
    description: >-
      The Card Tokenisation APIs are used to create card tokens, charge cards
      using tokens, retrieve all tokens created by a merchant account and
      deleting any card token as desired.
  - name: Refunds And Chargebacks
    description: >-
      The Refunds and Chargeback APIs are used to initiate refunds, view your
      refund and chargeback history and so much more.
  - name: Branches
    description: >-
      The Refunds and Chargeback APIs are used to initiate refunds, view your
      refund and chargeback history and so much more.
  - name: Auth-Capture-Void
    description: >-
      The Auth-Capture-Void APIs provide a two-phase payment process where
      transactions are first authorized, then captured or voided. This allows
      merchants to hold funds and complete the transaction in the future.
  - name: Momo and ZAR Collections
    description: APIs for MoMo, ZAR and XOF collections.
  - name: Check Transaction Status(Merchant Reference)
    description: >-
      This endpoint is used to check the transaction status of a transaction
      using the Merchant Reference..
paths:
  /card/auth_capture/authorize:
    post:
      tags:
        - Auth-Capture-Void
      summary: Authorize Transaction
      description: >-
        This endpoint authorizes a transaction and holds funds for a specified
        period. This endpoint handles payout requests.


        > **Record Creation:**

        >

        > Authorization record is created with **PENDING** status before MPGS
        call, then updated to **AUTHORIZED** on success or **FAILED** on error.

        > 
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - f2f0cf19-1e9b-4ffd-b11b-24abe8ce8054
            examples:
              Authorize Transaction:
                summary: Authorize Transaction
                value:
                  authorization_reference: AUTH-1234567890
                  amount: 100
                  currency: NGN
                  order_reference: ORD-001
                  merchant_reference: MR-001
                  card_number: '5123456789012346'
                  card_expiry_month: '12'
                  card_expiry_year: '2025'
                  card_cvv: '123'
                  card_token: token_reference_here
                  customer_email: customer@example.com
                  customer_name: John Doe
                  expire_in_days: 7
                  authorization_webhook_url: https://example.com/webhook
                  authorization_redirect_url: https://merchant-site.com/checkout/complete
      responses:
        '200':
          description: Authorize Transaction
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/authorizeTransactionResponse'
              examples:
                Success 3DS Required:
                  summary: Success 3DS Required Response
                  value:
                    authorization_reference: AUTH-1234567890
                    status: PENDING
                    message: 3DS Authentication Required
                    do3dsAuth: true
                    threeDsHtml: <html>...</html>
                    threeDsUrl: https://acs.example.com/3ds
                    formData: cReq_or_PaReq_data_here
                Success 3DS Not Required:
                  summary: Success 3DS Not Required Response
                  value:
                    authorization_reference: AUTH-1234567890
                    status: AUTHORIZED
                    authorization_code: '123456'
                    authorized_amount: 100
                    currency: NGN
                    expires_at: '2025-01-19T10:30:00'
                    message: Authorization successful
                Error Response:
                  summary: Error Response
                  value:
                    status: DECLINED
                    message: Authorization failed
                    error_code: INVALID_CARD
                    error_message: Card number is invalid
        '400':
          description: Invalid request
      security:
        - ApiKeyAuth: []
components:
  schemas:
    authorizeTransactionResponse:
      title: Authorize Transaction
      type: object
      properties:
        status:
          type: string
          description: Status of the authorization (AUTHORIZED, PENDING, DECLINED).
          example: AUTHORIZED
        message:
          type: string
          description: Descriptive message about the status.
          example: Authorization successful
        authorization_reference:
          type: string
          nullable: true
          description: Unique reference for the authorization.
          example: AUTH-1234567890
        authorization_code:
          type: string
          nullable: true
          description: Code provided by the issuer if authorized.
          example: '123456'
        authorized_amount:
          type: number
          nullable: true
          description: The amount successfully held.
          example: 100
        currency:
          type: string
          nullable: true
          description: Currency code.
          example: NGN
        expires_at:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the hold expires.
          example: '2025-01-19T10:30:00'
        do3dsAuth:
          type: boolean
          description: Indicates if 3D Secure authentication is required.
          example: false
        threeDsUrl:
          type: string
          format: uri
          nullable: true
          description: URL to redirect for 3DS authentication.
          example: https://acs.example.com/3ds
        threeDsHtml:
          type: string
          nullable: true
          description: HTML content for 3DS page rendering.
          example: <html>...</html>
        formData:
          type: string
          nullable: true
          description: Form data (cReq/PaReq) for 3DS.
          example: cReq_or_PaReq_data_here
        error_code:
          type: string
          nullable: true
          description: Error code if declined.
          example: INVALID_CARD
        error_message:
          type: string
          nullable: true
          description: Detailed error description.
          example: Card number is invalid
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Payaza {{Public API Key in Base 64}}
    TenantID:
      type: apiKey
      in: header
      name: X-TenantID
      description: live or test
    ProductID:
      type: apiKey
      in: header
      name: X-ProductID
      description: 'default value is ‟app” '

````