Lean Technologies Payouts API

The Payouts API from Lean Technologies — 12 operation(s) for payouts.

OpenAPI Specification

lean-technologies-payouts-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Consents Account On File Account Controls (New) Account Controls (New) Payouts API
  version: v0.2.3
servers:
- url: https://sandbox.leantech.me
  description: Sandbox
- url: https://api2.leantech.me
  description: Production
security:
- bearerAuth: []
tags:
- name: Payouts
paths:
  /payouts/v1/payment:
    post:
      summary: Create Payout Payment
      deprecated: false
      description: ''
      operationId: createPayout
      tags:
      - Payouts
      parameters:
      - name: idempotency-key
        in: header
        description: The Idempotency Key used to mark the transaction call to the API.
        required: false
        example: ''
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                payment_details:
                  type: array
                  items:
                    type: object
                    properties:
                      account_id:
                        type: string
                        description: Defines the `account_id` to send the money from
                      destination_details:
                        type: array
                        items:
                          type:
                          - object
                          - 'null'
                          properties:
                            payment_destination_id:
                              type: string
                              format: uuid
                              description: The Destination object to initiate the payment to
                            amount:
                              type: number
                              description: The amount to be transferred
                            description:
                              type: string
                              description: Payment reference information
                              maxLength: 32
                            authorize_payment:
                              type: boolean
                              description: When set to `true` the payment will be automatically authorized by the authorizer credentials in Payouts (requires an authorizer account to be set up in Payouts)
                              default: false
                          required:
                          - amount
                          - description
                          - authorize_payment
                        description: Defines the payee account for the payment
                    required:
                    - account_id
                    - destination_details
                  description: An array of payments to be queued and authorized
              required:
              - payment_details
            example:
              payment_details:
              - account_id: string
                destination_details:
                - payment_destination_id: 5fd95d40-9ea5-4678-8ffb-6b597f21965b
                  amount: 0
                  description: string
                  authorize_payment: false
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  end_user_id:
                    type: string
                    description: Internal ID of the credentials used to queue the payment, for audit purposes.
                  payouts_payment_details:
                    type: array
                    items:
                      type: object
                      properties:
                        payment_intent_id:
                          type: string
                          description: The related Payment Intent
                        payment_id:
                          type:
                          - string
                          - 'null'
                          description: The related Payment
                        initiate_payment_task_id:
                          type: string
                          description: Informative ID for tracing a payout in Lean. Used when debugging a payout with your support representative.
                        account_number:
                          type: string
                          description: Account number which is performing the payment
                        iban:
                          type: string
                          description: IBAN of the sending account
                        bank_identifier:
                          type: string
                          description: Identifier of the bank used to make the payment
                        destination_details:
                          type: object
                          properties:
                            destination_id:
                              type: string
                            amount:
                              type: integer
                              description: Amount paid out
                            currency:
                              type: string
                              description: Currency of the transaction
                            payment_status:
                              type: string
                              description: Status of the payment
                            recipient_details:
                              type: object
                              properties:
                                account_number:
                                  type: string
                                  description: Account number of the destination
                                iban:
                                  type: string
                                  description: Full IBAN of the destination
                                name:
                                  type: string
                                  description: Associated name of the destination
                              required:
                              - account_number
                              - iban
                              - name
                              description: Account details of the receiving account
                          required:
                          - destination_id
                          - amount
                          - currency
                          - payment_status
                          - recipient_details
                          description: Details of the receiving account
                      required:
                      - payment_intent_id
                required:
                - end_user_id
                - payouts_payment_details
              example:
                end_user_id: 560d6943-fa8e-4dd9-9717-50025bf2feae
                payouts_payment_details:
                - payment_intent_id: c97ccfea-b828-4850-bfe4-a06acfbb024b
                  initiate_payment_task_id: c4d5d3a9-f1bd-4361-9aff-42d4c7a9c3d0
                  account_number: '338247974759251'
                  iban: AE480484338247974759251
                  destination_details:
                    destination_id: 2dac22a7-e168-454d-960b-7dfaddab6a54
                    amount: 670
                    currency: SAR
                    payment_status: CREATED
                    recipient_details:
                      account_number: '1015000000601'
                      iban: SA760260001015000000601
                      name: Al Fulani
                  bank_identifier: LEAN_SME_MB1_UAE
          headers: {}
      security:
      - bearer: []
  /payouts/v1/bulk-payments:
    post:
      summary: Create Bulk Payout Payment
      deprecated: false
      description: ''
      operationId: createBulkPayout
      tags:
      - Payouts
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                account_id:
                  type: string
                  description: Account ID used to make the payment
                authorize_payment:
                  type: boolean
                  description: Defines whether the payment should be authorized by Lean or only queued
                payments:
                  type: array
                  items:
                    anyOf:
                    - $ref: '#/components/schemas/PayoutByDestinationPayload'
                      description: Create a payment to an ad-hoc beneficiary
                    - $ref: '#/components/schemas/PayoutByDestinationID'
                      description: Create a payment to an existing beneficiary
                  description: A list of payments to be executed
              required:
              - account_id
              - authorize_payment
              - payments
            example: ''
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  bulk_payment_intent_id:
                    type: string
                    enum:
                    - SINGLE_PAYMENT
                    - BULK_PAYMENTS_CSV
                    description: Identifier for this bulk payment
                  mechanism:
                    type: string
                    enum:
                    - CSV
                    description: The method Lean is utilizing to manage the payout payment(s).
                  sender_details:
                    type: object
                    properties:
                      bank_identifier:
                        type: string
                        description: Initiating bank identifier
                      account_number:
                        type: string
                      iban:
                        type: string
                    required:
                    - bank_identifier
                    - account_number
                    - iban
                    description: Details of the sending account
                  payouts_payment_details:
                    type: object
                    properties:
                      status:
                        type: string
                        description: Status of the payment
                      currency:
                        type: string
                        description: Currency to be debited
                      total_amount:
                        type: integer
                        description: Sum of all payment amounts in the bulk request
                      total_payments:
                        type: integer
                        description: Total number of payments in the bulk payment request
                    required:
                    - status
                    - currency
                    - total_amount
                    - total_payments
                    description: Details of the receiving account
                required:
                - bulk_payment_intent_id
                - mechanism
                - sender_details
                - payouts_payment_details
              example:
                bulk_payment_intent_id: 971bbe44-bbf5-4dd5-ac5b-7f1586f02a76
                mechanism: CSV
                sender_details:
                  bank_identifier: ALINMA_DC_SAU
                  account_number: '1231231231231231'
                  iban: SA940261231231231231231
                payouts_payment_details:
                  status: AWAITING_AUTHORIZATION
                  currency: SAR
                  total_amount: 500
                  total_payments: 5
          headers: {}
      security:
      - bearer: []
  /payouts/v1/payments:
    get:
      summary: List Payouts
      deprecated: false
      description: ''
      operationId: getPayouts
      tags:
      - Payouts
      parameters:
      - name: page_number
        in: query
        description: The page number.
        required: false
        schema:
          type: integer
          default: 0
      - name: page_size
        in: query
        description: The number of Payout payments to return per page.
        required: false
        schema:
          type: number
          default: 50
      - name: amount_min
        in: query
        description: The lower bound limit on the amount value for Payout payments.
        required: false
        schema:
          type: number
          format: double
      - name: amount_max
        in: query
        description: The upper bound limit on the amount value for Payout payments.
        required: false
        schema:
          type: number
          format: double
      - name: from
        in: query
        description: A DateTime in ISO-8601 format as the lower bound limit on the created_at value for Payout payments.
        required: false
        schema:
          type: string
          format: date-time
      - name: to
        in: query
        description: A DateTime in ISO-8601 format as the upper bound limit on the created_at value for Payout payments.
        required: false
        schema:
          type: string
          format: date-time
      - name: from_updated_at
        in: query
        description: A DateTime in ISO-8601 format as the lower bound limit on the updated_at value for Payout payments.
        required: false
        schema:
          type: string
          format: date-time
      - name: to_updated_at
        in: query
        description: A DateTime in ISO-8601 format as the upper bound limit on the updated_at value for Payout payments.
        required: false
        schema:
          type: string
          format: date-time
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  content:
                    type: array
                    items:
                      type: object
                      properties:
                        recipient_name:
                          type: string
                        recipient_bank_name:
                          type: string
                        recipient_iban:
                          type: string
                        description:
                          type: string
                        currency:
                          type: string
                        amount:
                          type: number
                        created_at:
                          type: string
                        payment_intent_id:
                          type: string
                        payment_id:
                          type: string
                        auto_authorized:
                          type: boolean
                        status:
                          type: string
                          enum:
                          - AWAITING_AUTHORIZATION
                          - PENDING_WITH_BANK
                          - ACCEPTED_BY_BANK
                          - FAILED
                      required:
                      - recipient_name
                      - recipient_bank_name
                      - recipient_iban
                      - description
                      - currency
                      - amount
                      - created_at
                      - payment_intent_id
                      - auto_authorized
                      - status
                      - payment_id
                  number:
                    type: integer
                    description: Current page number
                  size:
                    type: integer
                    description: Size of the page
                  total_elements:
                    type: integer
                    description: Total number of elements across all pages
                  pageable:
                    type: object
                    properties:
                      sort:
                        type: object
                        properties:
                          empty:
                            type: boolean
                            description: Response is empty
                          sorted:
                            type: boolean
                            description: Response is sorted
                          unsorted:
                            type: boolean
                            description: Response is unsorted
                        required:
                        - empty
                        - sorted
                        - unsorted
                        description: Sorting information
                      offset:
                        type: integer
                      page_size:
                        type: integer
                        description: Maximum size of a page of results
                      page_number:
                        type: integer
                        description: Current page number
                      paged:
                        type: boolean
                        description: Response is paged
                      unpaged:
                        type: boolean
                        description: Response is not paged
                    required:
                    - sort
                    - offset
                    - page_size
                    - page_number
                    - paged
                    - unpaged
                  last:
                    type: boolean
                    description: Is this the last page of the response
                  total_pages:
                    type: integer
                    description: Total number of available pages
                  sort:
                    type: object
                    properties:
                      empty:
                        type: boolean
                        description: Is response empty
                      sorted:
                        type: boolean
                        description: Is response sorted
                      unsorted:
                        type: boolean
                        description: Is response unsorted
                    required:
                    - empty
                    - sorted
                    - unsorted
                    description: Sorting information
                  first:
                    type: boolean
                    description: Is this the first page of the response
                  number_of_elements:
                    type: integer
                    description: Number of elements in the response
                  empty:
                    type: boolean
                    description: Is the response empty
                required:
                - content
                - number
                - size
                - total_elements
                - pageable
                - last
                - total_pages
                - sort
                - first
                - number_of_elements
                - empty
              example:
                content:
                - recipient_name: SHINRA ELECTRICITY
                  recipient_bank_name: SHINRA LTD.
                  recipient_iban: SA04033000001XXXXXXXXXX
                  description: INV001
                  currency: SAR
                  amount: 21.18
                  created_at: '2023-08-21T14:11:35.882645Z'
                  payment_intent_id: 7d496fab-4ff5-4221-85d7-43e5af28efdb
                  auto_authorized: false
                  status: ACCEPTED_BY_BANK
                number: 0
                size: 20
                total_elements: 1
                pageable:
                  sort:
                    empty: true
                    sorted: false
                    unsorted: true
                  offset: 0
                  page_size: 20
                  page_number: 0
                  paged: true
                  unpaged: false
                last: true
                total_pages: 1
                sort:
                  empty: true
                  sorted: false
                  unsorted: true
                first: true
                number_of_elements: 1
                empty: false
          headers: {}
      security:
      - bearer: []
  /payouts/v1/payments/{payment_id}/history:
    get:
      summary: Get Payment History
      deprecated: false
      description: ''
      operationId: getPaymentHistory
      tags:
      - Payouts
      parameters:
      - name: payment_id
        in: path
        description: ''
        required: true
        example: ''
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  customer_id:
                    type: string
                    description: The associated `customer_id` if any
                  end_user_id:
                    type: string
                    description: The set of credentials used to handle this payment
                  intent_id:
                    type: string
                    description: The associated Payment Intent
                  payments:
                    type: array
                    items:
                      type: object
                      properties:
                        payment_id:
                          type: string
                          description: The Payment ID
                        description:
                          type: string
                          description: The provided description for the payment
                        amount:
                          type: number
                          description: The amount instructed
                        bank_identifier:
                          type: string
                          description: The bank identifier that a payment is being made from
                        status:
                          type: string
                          description: The current status of the payment
                          enum:
                          - PENDING_WITH_BANK
                          - AWAITING_AUTHORIZATION
                          - FAILED
                          - ACCEPTED_BY_BANK
                        initiation_timestamp:
                          type: string
                          description: Time the payment was initiated
                        events:
                          type: array
                          items:
                            type: object
                            properties:
                              payment_id:
                                type: string
                                description: The Payment ID
                              event:
                                type: string
                                description: Either `payment.created` or `payment.updated`
                              status:
                                type: string
                                description: The status at the time of the event
                                enum:
                                - PENDING_WITH_BANK
                                - AWAITING_AUTHORIZATION
                                - FAILED
                                - ACCEPTED_BY_BANK
                              published_at:
                                type: string
                                description: Timestamp the event was published
                            required:
                            - payment_id
                            - event
                            - status
                            - published_at
                          description: Event stream of changes to the payment, reflects the change history of `status`
                required:
                - customer_id
                - end_user_id
                - intent_id
                - payments
              example:
                customer_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                end_user_id: 1c948406-47c2-41b4-8423-003697993ca4
                intent_id: 67d5c457-14b8-44ad-b13d-23a1d5284cd0
                payments:
                - payment_id: d651555e-18e6-4426-914a-7e50068000f2
                  description: LEAN 10 45 AM 982
                  amount: 530.5
                  bank_identifier: ALINMA_DC_SAU
                  status: ACCEPTED_BY_BANK
                  initiation_timestamp: '2024-04-08T05:15:59.777849Z'
                  events:
                  - payment_id: 299693c9-85df-468b-bfd1-38f2574fef6a
                    event: payment.created
                    status: AWAITING_AUTHORIZATION
                    published_at: '2024-04-08T05:15:59.784188Z'
                  - payment_id: 299693c9-85df-468b-bfd1-38f2574fef6a
                    event: payment.updated
                    status: ACCEPTED_BY_BANK
                    published_at: '2024-04-08T05:20:39.447073Z'
          headers: {}
      security:
      - bearer: []
  /payouts/v1/payment/destinations:
    post:
      summary: Create Payouts Destination(s)
      deprecated: false
      description: Create payment destinations for use with Payouts. Destinations created with Payouts create a corresponding beneficiary with your bank.
      operationId: createPayoutDestination
      tags:
      - Payouts
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                properties:
                  bank_identifier:
                    type: string
                    description: Uniquely identifies the bank of the benefeciary account
                  name:
                    type: string
                    description: The name of the legal entity associated with the account.
                  iban:
                    type: string
                    description: The IBAN of the account
                  display_name:
                    type: string
                    description: 'The friendly display name for the account. '
                  account_number:
                    type: string
                    description: The account number for the account.
                  swift_code:
                    type: string
                    description: The SWIFT Code for the bank account - required for most international destinations
                  ifsc:
                    type: string
                    description: The IFSC number for the bank account - required for international destinations in India.
                  sort_code:
                    type: string
                    description: The Sort Code for the bank account - required for international destinations in the UK
                  routing_number:
                    type: string
                    description: The Routing Number for the bank account - required for international destinations in the US.
                  transit_code:
                    type: string
                    description: The Transit Number for the bank account - required for international destinations in Canada
                  address:
                    type: string
                    description: The address of the owner of the destination bank account has registered with the bank.
                  branch_address:
                    type: string
                    description: The address of the branch that holds the account - required for all beneficiaries outside of ARE. This should be a single string with commas separating lines.
                  country:
                    type: string
                    description: The country that the holding financial institution is located in as a 3 letter ISO code.
                  city:
                    type: string
                    description: The city that the holding financial institution is located in.
                  customer_id:
                    type: string
                    description: The associated Lean Customer
                  currency_iso_code:
                    type: string
                    description: The currency of the payee account
                  postal_code:
                    type: string
                    description: The postal code of the bank branch that holds the account
                required:
                - name
                - iban
                - address
                - country
                - city
                - currency_iso_code
            example:
            - bank_identifier: LEAN_SME_MB1_KSA
              name: Santiago Keebler
              iban: AE123030303000
              display_name: ABC CORP
              account_number: '0303030'
              swift_code: UCHZPL2OXXX
              ifsc: HADBC0001234
              sort_code: '89'
              routing_number: '106519958'
              transit_code: '9'
              address: Texas Wisokystead Wayne County 802 Washington Street Apt. 205
              branch_address: Idaho East Elmore Marion County 59966 E 4th Avenue Suite 288
              country: SAU
              city: Riyadh
              customer_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
              currency_iso_code: SAR
              postal_code: '90710'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  add_benefeciary_task_id:
                    type: string
                    format: uuid
                    description: The unique ID to track the destination creation request. This is useful for debugging
                  destination_id:
                    type: string
                    description: The unique identifier for the Payment Destination object.
                  bank_identifier:
                    type: string
                  iban:
                    type: string
                    description: IBAN of the destination account
                  account_number:
                    type: string
                    description: The account number for the account.
                  display_name:
                    type: string
                    description: 'The friendly display name for the account. '
                  status:
                    type: string
                    description: Specifies the status of the destination
                    enum:
                    - CONFIRMED
                    - FAILED
                  error_message:
                    type: string
                    description: 'Error meesage received from the bank '
              example:
                add_beneficiary_task_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                destination_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                bank_identifier: LEAN_SME_MB1_UAE
                iban: AE123030303000
                account_number: '0303030'
                display_name: ABC CORP
                status: CONFIRMED
                error_message: string
          headers: {}
      security:
      - bearer: []
  /payouts/v1/payment/destinations/{destination_id}:
    get:
      summary: Get Payouts Destination
      deprecated: false
      description: Create payment destinations for use with Payouts. Destinations created with Payouts create a corresponding beneficiary with your bank.
      operationId: getPayoutDestinationById
      tags:
      - Payouts
      parameters:
      - name: destination_id
        in: path
        description: ''
        required: true
        example: ''
        schema:
          type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    description: The unique identifier for the Payment Destination object.
                  status:
                    type: string
                    description: The status of the beneficiary tied to the Destination
                    enum:
                    - ACTIVE
                    - PENDING
                    - FAILED
                    - AWAITING_BENEFICIARY_COOL_OFF
                  branch_address:
                    type: string
                    description: The address of the branch that holds the account - required fo

# --- truncated at 32 KB (84 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/lean-technologies/refs/heads/main/openapi/lean-technologies-payouts-api-openapi.yml