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

# Tx Authorization

<Warning>
  **This API MUST be implemented by the Partner.** Platform's backend will check for fund availability and business rules before processing a transaction.
</Warning>

Our backend will consume this service by performing a `POST` request to:

`[Base-URL]/TxAuthorization`.

**Expected behavior:**
Authorization request to process a funds transaction between two parties (Sender and Recipient). The partner will internally validate the balance, limits, and compliance rules (e.g., *AML*, *Velocity*), responding whether the operation is **Authorized** (accompanied by a `TrackingIdentifier`) or denied for a specific reason in `NonAuthorizedReason`.


## OpenAPI

````yaml swagger-client-interfaces.json POST /client-interfaces/pmo/tx-authorization
openapi: 3.0.0
info:
  title: ''
  version: 0.0.1
servers: []
security: []
paths:
  /client-interfaces/pmo/tx-authorization:
    post:
      tags:
        - Partner Implemented APIs
      summary: Tx authorization
      operationId: txAuthorizationClientApi
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TxAuthorizationRequest'
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TxAuthorizationResponse'
      security: []
components:
  schemas:
    TxAuthorizationRequest:
      properties:
        TransactionId:
          type: string
        SenderPersonalData:
          $ref: '#/components/schemas/PersonalData'
        ReceiverPersonalData:
          $ref: '#/components/schemas/PersonalData'
        AccountIdentifier:
          type: string
        Amount:
          type: number
          format: double
        Currency:
          type: string
          description: 3 chars
        ExchangeRate:
          type: number
          format: double
        TrackingNumber:
          type: string
      required:
        - TransactionId
        - SenderPersonalData
        - ReceiverPersonalData
        - Amount
        - Currency
        - ExchangeRate
      type: object
      additionalProperties: false
    TxAuthorizationResponse:
      properties:
        AccountIdentifier:
          type: string
          description: >-
            Null or empty if is not found. If Null or empty, `Authorized` will
            be ignored.
        DisplayName:
          type: string
          description: >-
            Max 10, Only these chars -> [-_a-zA-Z0-9. 

            If Null or empty, it will be Parner Prefix (configured in backend) +
            last four Account numbers (e.g. `PRTN-0141`).
        Authorized:
          type: boolean
        NonAuthorizedReason:
          $ref: '#/components/schemas/NonAuthorizedReason'
        TrackingIdentifier:
          type: string
      required:
        - Authorized
        - TrackingIdentifier
      type: object
      additionalProperties: false
    PersonalData:
      description: >-
        Personal information. At least one of `PhoneNumber` or `Email` must be
        provided.
      properties:
        PhoneNumber:
          type: string
          description: User phone number. Required when `Email` is not provided.
        Email:
          type: string
          description: User email address. Required when `PhoneNumber` is not provided.
        FirstName:
          type: string
        MiddleName:
          type: string
        LastName:
          type: string
        LastName2:
          type: string
        Gender:
          type: string
        BirthDate:
          type: string
          description: Date formatted string, e.g. YYYY-MM-DD
        Address:
          $ref: '#/components/schemas/Address'
      required:
        - FirstName
        - LastName
        - Gender
        - BirthDate
        - Address
      type: object
      additionalProperties: false
    NonAuthorizedReason:
      type: string
      enum:
        - None
        - AccountBlocked
        - AccountBlockedByLaw
        - AccountBlockedByGovernment
        - ByVelocity
        - ByAmountLimit
        - ByAccumulateAmountLimit
        - InvalidAccount
        - InvalidParameter
        - InvalidCurrency
        - InvalidSenderData
        - InvalidDestinationData
        - InvalidExchangeRate
        - NonMatchingCurrencyAccount
        - InvalidAmount
    Address:
      properties:
        Address1:
          type: string
        Address2:
          type: string
        ZipCode:
          type: string
        City:
          type: string
        CountryCode:
          type: string
          description: ISO 3166-2
          minLength: 2
          maxLength: 2
        StateCode:
          type: string
          description: ISO 3166-2
      required:
        - Address1
        - City
        - CountryCode
        - StateCode
      type: object
      additionalProperties: false

````