Payments Queries

Retrieve payments received from customers or sent to suppliers.

Payment — Returns a single payment by id

query GetPayment($id: ID!) {
  Payment(id: $id) {
    id
    amount
    paid_at
    notes
    payment_method { id label }
    customer { id label }
    invoice_payments {
      id
      amount
      invoice { id label }
    }
  }
}

Payments — Returns a paginated list of payments with sorting and filters

query Payments(
  $where: QueryPaymentsWhereWhereConditions,
  $orderBy: [QueryPaymentsOrderByOrderByClause!],
  $search: String,
  $first: Int,
  $page: Int
) {
  Payments(
    where: $where,
    orderBy: $orderBy,
    search: $search,
    first: $first,
    page: $page
  ) {
    paginatorInfo {
      total
      currentPage
    }
    data {
      id
      amount
      paid_at
      customer { id label }
    }
  }
}

InvoicePayment — Returns a single invoice payment by id

query GetInvoicePayment($id: ID!) {
  InvoicePayment(id: $id) {
    id
    amount
    invoice { id label }
    invoice_payable {
      ... on Payment { id amount }
      ... on CreditNote { id total }
    }
  }
}

InvoicePayments — Returns a paginated list of invoice payments with sorting and filters

query InvoicePayments(
  $where: QueryInvoicePaymentsWhereWhereConditions,
  $orderBy: [QueryInvoicePaymentsOrderByOrderByClause!],
  $first: Int,
  $page: Int
) {
  InvoicePayments(
    where: $where,
    orderBy: $orderBy,
    first: $first,
    page: $page
  ) {
    paginatorInfo {
      total
      currentPage
    }
    data {
      id
      amount
      invoice_id
      invoice_payable_id
      invoice_payable_type
    }
  }
}

Available fields

Payment

FieldTypeDescription
idIntUnique identifier.
amountFloatPayment amount.
paid_atDateDate of payment.
notesStringPublic description or notes.
created_atDateTimeCreation time.
updated_atDateTimeLast update time.
integrations[Integration]Linked external platforms.
payment_methodPaymentMethodMethod used (e.g., Cash, Credit Card).
customerCustomerAssociated customer.
invoice_payments[InvoicePayment]Allocation of the payment to specific invoices.
custom_fields[EntityCustomField]Custom fields for this entity.

Data Types

InvoicePayment

Represents the link between a Payment (or Credit Note) and an Invoice.

FieldTypeDescription
idIDLink ID.
amountFloatAmount allocated to the invoice.
invoice_idIntLinked invoice ID.
invoice_payable_idIntID of the source Payment or Credit Note.
invoice_payable_typeStringType of the source document (Payment or CreditNote).
created_atDateTimeLink creation time.
invoiceInvoiceTarget invoice.
invoice_payableInvoicePayableUnion type: Payment or CreditNote. Use inline fragments (... on Payment { ... }) to query fields.

Filters

The following fields can be used in the where parameter:

id, amount, paid_at, notes, payment_method_id, invoice_id, customer_id, customer_tag_id, created_at, updated_at.

Example Filters:

FieldExample
id{ "column": "ID", "operator": "EQ", "value": 200050 }
amount{ "column": "AMOUNT", "operator": "GT", "value": 100.0 }
paid_at{ "column": "PAID_AT", "operator": "GTE", "value": "2025-01-01" }
customer_id{ "column": "CUSTOMER_ID", "operator": "EQ", "value": 100001 }
invoice_id{ "column": "INVOICE_ID", "operator": "EXISTS", "value": 200001 }

InvoicePayments Filters

The following fields can be used in the where parameter for InvoicePayments:

amount, invoice_id, invoice_payable_id, invoice_payable_type.

Example Filters:

FieldExample
invoice_id{ "column": "INVOICE_ID", "operator": "EQ", "value": 200001 }
invoice_payable_type{ "column": "INVOICE_PAYABLE_TYPE", "operator": "EQ", "value": "Payment" }

Sorting

You can sort results using the orderBy parameter:

  • id
  • amount
  • paid_at
  • notes
  • payment_method_id
  • payment_method_label
  • customer_label
  • created_at
  • updated_at

InvoicePayments Sorting

You can sort results using the orderBy parameter:

  • amount
  • invoice_id
  • invoice_payable_id
  • invoice_payable_type