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

# List payments

> Lists cash payments, newest received first unless `orderBy` asks for another order. Page with `limit` and the cursors from the previous page; `hasMore` says whether more rows lie in the direction being read. Keep the same filters and the same `orderBy` for the whole run.



## OpenAPI

````yaml https://app.synthetic.ai/api/v1/openapi.json get /payments
openapi: 3.1.0
info:
  title: Synthetic API
  description: Read access to your Synthetic data.
  version: 0.1.0
servers:
  - url: https://app.synthetic.ai/api/v1
security: []
paths:
  /payments:
    get:
      tags:
        - Payments
      summary: List payments
      description: >-
        Lists cash payments, newest received first unless `orderBy` asks for
        another order. Page with `limit` and the cursors from the previous page;
        `hasMore` says whether more rows lie in the direction being read. Keep
        the same filters and the same `orderBy` for the whole run.
      operationId: payments-list
      parameters:
        - in: query
          name: customerId
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            description: Only payments attributed to this customer.
        - in: query
          name: hasCustomer
          schema:
            description: >-
              true for payments attributed to a customer, false for payments not
              yet attributed.
            type: boolean
        - in: query
          name: hasUnappliedAmount
          schema:
            description: >-
              true for payments with an amount, of their own or their bank
              fee's, not yet applied to an invoice.
            type: boolean
        - in: query
          name: orderBy
          schema:
            description: >-
              Fields to order by, each written `field:ASC` or `field:DESC` and
              separated by commas, applied in the order written — for example
              `customerName:ASC,amountCents:DESC`. Order by up to 3 of
              receivedDate, customerName, amountCents, bankFeeAmountCents,
              appliedAmountCents, unappliedAmountCents. Omit it for newest
              received first.
            type: string
        - in: query
          name: startingAfter
          schema:
            type: string
            minLength: 1
            maxLength: 1024
            pattern: ^[A-Za-z0-9._-]+$
            description: The nextCursor of the previous page, to read the page after it.
        - in: query
          name: endingBefore
          schema:
            type: string
            minLength: 1
            maxLength: 1024
            pattern: ^[A-Za-z0-9._-]+$
            description: The prevCursor of the previous page, to read the page before it.
        - in: query
          name: limit
          schema:
            default: 50
            description: Rows per page, 1 to 100.
            type: integer
            minimum: 1
            maximum: 100
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Payment'
                  hasMore:
                    type: boolean
                  nextCursor:
                    type: string
                  prevCursor:
                    type: string
                required:
                  - data
                  - hasMore
                additionalProperties: false
        '400':
          description: Input validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '500':
          description: An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
      security:
        - BearerAuth: []
components:
  schemas:
    Payment:
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        type:
          type: string
          enum:
            - CASH
            - BANK_FEE
          description: >-
            CASH for money received; BANK_FEE for the fee nested in a cash
            payment.
        parentPaymentId:
          anyOf:
            - type: string
              format: uuid
              pattern: >-
                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            - type: 'null'
          description: >-
            For a bank fee, the cash payment it was charged against; null for a
            cash payment.
        receivedDate:
          format: date-time
          description: >-
            The calendar date the payment was received, carried at UTC midnight.
            The time is not data.
          type: string
        customerId:
          anyOf:
            - type: string
              format: uuid
              pattern: >-
                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            - type: 'null'
        customerName:
          anyOf:
            - type: string
            - type: 'null'
        amountCents:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        appliedAmountCents:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        unappliedAmountCents:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        journalEntryId:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        bankFee:
          anyOf:
            - $ref: '#/components/schemas/Payment'
            - type: 'null'
          description: >-
            The bank fee charged against this payment, itself a payment. A fee
            has none.
        createdAt:
          type: string
        updatedAt:
          type: string
      required:
        - id
        - type
        - parentPaymentId
        - receivedDate
        - customerId
        - customerName
        - amountCents
        - appliedAmountCents
        - unappliedAmountCents
        - journalEntryId
        - bankFee
        - createdAt
        - updatedAt
      additionalProperties: false
      description: >-
        Money a customer paid: how much, which customer, how much of it has been
        applied to invoices, and the bank fee charged on it, which is a payment
        of type BANK_FEE.
    error.BAD_REQUEST:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Input validation failed
        code:
          type: string
          description: The error code
          example: BAD_REQUEST
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Input validation failed error (400)
      description: The error information
      example:
        code: BAD_REQUEST
        message: Input validation failed
        issues: []
    error.UNAUTHORIZED:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Unauthorized
        code:
          type: string
          description: The error code
          example: UNAUTHORIZED
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Unauthorized error (401)
      description: The error information
      example:
        code: UNAUTHORIZED
        message: Unauthorized
        issues: []
    error.INTERNAL_SERVER_ERROR:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: An unexpected error occurred.
        code:
          type: string
          description: The error code
          example: INTERNAL_SERVER_ERROR
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: An unexpected error occurred. error (500)
      description: The error information
      example:
        code: INTERNAL_SERVER_ERROR
        message: An unexpected error occurred.
        issues: []
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'An API key created in Settings, sent as `Authorization: Bearer <key>`.'

````