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

# Get Payment Agreement Detail

> Retrieve the details of a specific payment agreement, including its current status. This endpoint provides insight into the lifecycle and status of a payment agreement, which can be one of the following:

- `created`: The customer has initiated the creation of the Payment Agreement.
- `active`: The Payment Agreement is active and ready to process payments.
- `suspended`: The Payment Agreement is temporarily suspended, pausing all associated transactions.
- `cancelled`: The Payment Agreement has been cancelled, and no further payments can be processed.
- `failed`: The Payment Agreement has failed due to an error.

For testing purposes, specific PayIDs can be used to simulate different statuses:

- `created`: Use PayID `no-action@example.com` to keep the agreement status as `created`.
- `failed`: Use PayID `error@example.com` to trigger a failure status.
- `cancelled`: Use PayID `cancel-agreement@example.com` to simulate a cancelled status.
- `suspended`: Use PayID `suspend-agreement@example.com` to simulate a suspended status.




## OpenAPI

````yaml /api/openapi/v1-reference.yaml get /v1/pay_to/payment_agreement/detail
openapi: 3.0.3
info:
  title: Payment APIs (AUD only)
  description: >-
    ## Introduction

    The Payment API Solution (AUD) offers developers a comprehensive suite of
    API services to build innovative AUD payment solutions efficiently. These
    APIs enable seamless transactions using various payment methods and
    functionalities, ensuring a robust, reliable, and scalable payment
    infrastructure tailored for the Australian market.

    ### Key Features

    - **Payment Methods**:
      - **Payment Link**: Supports payments via card and PayID.
      - **PayID**: Provides instant payments using a unique identifier.
      - **PayTo**: Enables scheduled or recurring payments.
      - **BSB/Account Number**: Allows direct bank transfers.
      - **Payout**: Manage payouts to designated accounts.

    - **Additional Functionalities**:
      - **Balance Management**: Real-time balance inquiries and updates.
      - **Reporting Services**: Generate detailed transaction and payment reports.

    This documentation provides detailed guidance for integrating these
    capabilities into your application.
  termsOfService: https://helloclever.co/terms
  contact:
    email: support@helloclever.co
  version: 1.0.11
servers:
  - url: https://api.cleverhub.co/api
    description: Sandbox Environment
  - url: https://api-merchant.helloclever.co/api
    description: Production Environment
security: []
paths:
  /v1/pay_to/payment_agreement/detail:
    get:
      tags:
        - AUD PayTo
      summary: Get Payment Agreement Detail
      description: >
        Retrieve the details of a specific payment agreement, including its
        current status. This endpoint provides insight into the lifecycle and
        status of a payment agreement, which can be one of the following:


        - `created`: The customer has initiated the creation of the Payment
        Agreement.

        - `active`: The Payment Agreement is active and ready to process
        payments.

        - `suspended`: The Payment Agreement is temporarily suspended, pausing
        all associated transactions.

        - `cancelled`: The Payment Agreement has been cancelled, and no further
        payments can be processed.

        - `failed`: The Payment Agreement has failed due to an error.


        For testing purposes, specific PayIDs can be used to simulate different
        statuses:


        - `created`: Use PayID `no-action@example.com` to keep the agreement
        status as `created`.

        - `failed`: Use PayID `error@example.com` to trigger a failure status.

        - `cancelled`: Use PayID `cancel-agreement@example.com` to simulate a
        cancelled status.

        - `suspended`: Use PayID `suspend-agreement@example.com` to simulate a
        suspended status.
      parameters:
        - in: query
          name: id
          required: true
          schema:
            type: integer
          description: The unique Hello Clever payment ID for the payment agreement.
          example: 12345
      responses:
        '200':
          description: Request processed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayToObject'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '422':
          description: Unprocessable Entity
      security:
        - app-id: []
          secret-key: []
components:
  schemas:
    PayToObject:
      type: object
      properties:
        id:
          type: integer
          description: >
            A unique identifier for the payment agreement, used for tracking and
            management.
          example: 12345
        payment_agreement_id:
          type: string
          description: >
            The unique identifier for the payment agreement, providing a
            reference to the specific agreement being handled.
          example: agreement-12345
        client_transaction_id:
          type: string
          description: >
            A unique ID for the transaction as provided by the merchant, used to
            ensure transactions can be uniquely tracked.
          minLength: 1
          maxLength: 90
          example: client-trans-001
        limit_amount:
          type: number
          description: >
            The maximum allowable amount for each payment under this agreement,
            helping to manage the scope of transactions.
          example: 5000
        description:
          type: string
          description: >
            A description of the payment agreement, providing context and
            information for the payer and merchant.
          minLength: 5
          maxLength: 140
          example: Monthly utility bill payment agreement.
        external_id:
          type: string
          description: >
            A custom identifier assigned to the payment agreement, typically
            used for tracking and reference purposes.
          maxLength: 255
          example: custom-agreement-id-7890
        status:
          type: string
          enum:
            - created
            - active
            - suspended
            - cancelled
            - failed
          description: >
            The current status of the payment agreement. Possible values
            include:

            - `created`: Agreement has been created but not yet activated.

            - `active`: Agreement is currently active.

            - `suspended`: Agreement has been temporarily suspended.

            - `cancelled`: Agreement has been cancelled.

            - `failed`: Agreement creation or payment has failed.
          example: active
        created_at:
          type: string
          format: date-time
          description: >
            The timestamp indicating when the payment agreement was created, in
            UTC.
          example: '2024-01-01T00:00:00Z'
        payment_agreement_type:
          type: string
          enum:
            - MORTGAGE
            - UTILITY
            - LOAN
            - DEPENDANT SUPPORT
            - GAMBLING
            - RETAIL
            - SALARY
            - PERSONAL
            - GOVERNMENT
            - PENSION
            - TAX
            - OTHER SERVICE
          description: >
            The type of payment agreement, indicating the nature of the payments
            involved.
          example: UTILITY
        agreement_details:
          oneOf:
            - $ref: '#/components/schemas/variable_agreement_details_obj'
            - $ref: '#/components/schemas/fixed_agreement_details_obj'
            - $ref: '#/components/schemas/usage_bases_agreement_details_obj'
            - $ref: '#/components/schemas/balloon_agreement_details_obj'
        payer_details:
          type: object
          description: >
            Details about the payer, including either bank account information
            or PayID details.
          properties:
            name:
              type: string
              description: |
                The name of the payer, used for identification and verification.
              pattern: ^(?![! ](?![!]*$))[a-zA-Z0-9 ]*(?![ ])$
              example: Jane Doe
            bank_account_details:
              type: object
              description: >
                Information about the payer's bank account, used for
                transactions involving bank details.
              properties:
                bsb:
                  type: string
                  description: >
                    The BSB (Bank-State-Branch) number of the payer's account,
                    used to identify the bank and branch.
                  example: '123456'
                account_number:
                  type: string
                  description: |
                    The account number associated with the payer's bank account.
                  example: '987654321'
            pay_id_details:
              type: object
              description: >
                Information about the payer's PayID, used for transactions
                involving a PayID.
              properties:
                pay_id:
                  type: string
                  description: >
                    The PayID associated with the payer, allowing payments to be
                    routed via this ID.
                  example: payer@payid.com
                pay_id_type:
                  type: string
                  enum:
                    - EMAIL
                    - PHONE
                    - ABN
                  description: |
                    The type of PayID being used. Valid values include:
                    - `EMAIL`: An email address.
                    - `PHONE`: A mobile or landline number.
                    - `ABN`: An Australian Business Number.
                  example: EMAIL
        payment_agreement_notification:
          type: object
          description: >
            Details for the merchant callback, including endpoint URL and
            authorization header for receiving status updates on the payment
            agreement.
          properties:
            endpoint_url:
              type: string
              format: uri
              description: >
                The URL to which Hello Clever will send notifications when the
                status of a transaction changes. The endpoint must be internet
                accessible and secured by TLS 1.2 or higher.
              example: https://merchant.com/payment_callback
            authorization_header:
              type: string
              description: >
                The authorization value that Hello Clever will include in the
                callback request header to authenticate the request.
              example: Bearer your_token
    variable_agreement_details_obj:
      type: object
      properties:
        variable_agreement_details_obj:
          type: object
          properties:
            start_date:
              type: string
              description: >
                The start date for the variable payment agreement, expressed in
                the format DD/MM/YY. This date is in the UTC timezone.
              example: 15/07/24
            frequency:
              type: string
              enum:
                - ADHOC
                - DAILY
                - FORTNIGHTLY
                - INTRADAY
                - SEMIANNUAL
                - MONTHLY
                - QUARTERLY
                - WEEKLY
                - ANNUAL
              description: >
                The frequency of payments for the agreement, indicating how
                often payments will occur.
              example: MONTHLY
    fixed_agreement_details_obj:
      type: object
      properties:
        fixed_agreement_details_obj:
          type: object
          properties:
            start_date:
              type: string
              description: >
                The start date for the fixed payment agreement, expressed in the
                format DD/MM/YY. This date is in the UTC timezone.
              example: 01/01/24
            frequency:
              type: string
              enum:
                - ADHOC
                - DAILY
                - FORTNIGHTLY
                - INTRADAY
                - SEMIANNUAL
                - MONTHLY
                - QUARTERLY
                - WEEKLY
                - ANNUAL
              description: >
                The frequency of payments for the agreement, indicating how
                often payments will occur.
              example: ANNUAL
    usage_bases_agreement_details_obj:
      type: object
      properties:
        usage_bases_agreement_details_obj:
          type: object
          properties:
            start_date:
              type: string
              description: >
                The start date for the usage-based payment agreement, expressed
                in the format DD/MM/YY. This date is in the UTC timezone.
              example: 10/03/24
            frequency:
              type: string
              enum:
                - ADHOC
                - DAILY
                - FORTNIGHTLY
                - INTRADAY
                - SEMIANNUAL
                - MONTHLY
                - QUARTERLY
                - WEEKLY
                - ANNUAL
              description: >
                The frequency of payments for the agreement, indicating how
                often payments will occur.
              example: WEEKLY
    balloon_agreement_details_obj:
      type: object
      properties:
        balloon_agreement_details_obj:
          type: object
          properties:
            start_date:
              type: string
              description: >
                The start date for the balloon payment agreement, expressed in
                the format DD/MM/YY. This date is in the UTC timezone.
              example: 20/11/24
            frequency:
              type: string
              enum:
                - ADHOC
                - DAILY
                - FORTNIGHTLY
                - INTRADAY
                - SEMIANNUAL
                - MONTHLY
                - QUARTERLY
                - WEEKLY
                - ANNUAL
              description: >
                The frequency of payments for the agreement, indicating how
                often payments will occur.
              example: FORTNIGHTLY
  securitySchemes:
    app-id:
      type: apiKey
      in: header
      name: app-id
      description: |
        A unique identifier assigned to each application.
    secret-key:
      type: apiKey
      in: header
      name: secret-key
      description: |
        A secure token associated with the `app-id`.

````

## Related topics

- [Build Recurring Billing with PayTo Agreements](/developer-reference/api-use-cases/build-recurring-billing-with-payto-agreements.md)
- [Get Payment Agreements](/api/aud-payto/get-payment-agreements.md)
- [Amend Payment Agreement](/api/aud-payto/amend-payment-agreement.md)
