query paymentsAuthenticated
Lists payments as a Relay-style, cursor-paginated connection.
Page forward by starting with first: N, then passing the previous response's pageInfo.endCursor back as after (repeat while pageInfo.hasNextPage); page backward with last + before. Scope the results with one of orgId / agencyId / configurationId and/or a start/end date range via PaymentsInput. See PaymentConnection for the response shape. Results are ordered newest first.
Returns PaymentConnection!
Arguments
| Argument | Type | Description |
|---|---|---|
input | PaymentsInput |
Example request
curl -X POST 'https://graph.clientloop.com/' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{
"query": "query Payments($input: PaymentsInput) { payments(input: $input) { edges { node { id orgId provider configurationId originalAmount amount currency status date expectedSettlementDate expectedFundsAvailableDate contactId paymentSessionId paymentPlanId } cursor } pageInfo { hasNextPage hasPreviousPage startCursor endCursor } } }",
"variables": {
"input": {
"first": 42,
"after": "example",
"last": 42,
"before": "example",
"orgId": "abc123",
"agencyId": "abc123",
"configurationId": "abc123",
"start": "example",
"end": "example"
}
}
}'const response = await fetch('https://graph.clientloop.com/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer <api-key>',
},
body: JSON.stringify({
query: `
query Payments($input: PaymentsInput) {
payments(input: $input) {
edges {
node {
id
orgId
provider
configurationId
originalAmount
amount
currency
status
date
expectedSettlementDate
expectedFundsAvailableDate
contactId
paymentSessionId
paymentPlanId
}
cursor
}
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
}
}
`,
variables: {
"input": {
"first": 42,
"after": "example",
"last": 42,
"before": "example",
"orgId": "abc123",
"agencyId": "abc123",
"configurationId": "abc123",
"start": "example",
"end": "example"
}
},
}),
});
const { data, errors } = await response.json();<?php
$body = <<<'JSON'
{
"query": "query Payments($input: PaymentsInput) { payments(input: $input) { edges { node { id orgId provider configurationId originalAmount amount currency status date expectedSettlementDate expectedFundsAvailableDate contactId paymentSessionId paymentPlanId } cursor } pageInfo { hasNextPage hasPreviousPage startCursor endCursor } } }",
"variables": {
"input": {
"first": 42,
"after": "example",
"last": 42,
"before": "example",
"orgId": "abc123",
"agencyId": "abc123",
"configurationId": "abc123",
"start": "example",
"end": "example"
}
}
}
JSON;
$ch = curl_init('https://graph.clientloop.com/');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer <api-key>',
],
CURLOPT_POSTFIELDS => $body,
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
var body = """
{
"query": "query Payments($input: PaymentsInput) { payments(input: $input) { edges { node { id orgId provider configurationId originalAmount amount currency status date expectedSettlementDate expectedFundsAvailableDate contactId paymentSessionId paymentPlanId } cursor } pageInfo { hasNextPage hasPreviousPage startCursor endCursor } } }",
"variables": {
"input": {
"first": 42,
"after": "example",
"last": 42,
"before": "example",
"orgId": "abc123",
"agencyId": "abc123",
"configurationId": "abc123",
"start": "example",
"end": "example"
}
}
}
""";
var request = HttpRequest.newBuilder(URI.create("https://graph.clientloop.com/"))
.header("Content-Type", "application/json")
.header("Authorization", "Bearer <api-key>")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());using System.Net.Http;
using System.Text;
var body = """
{
"query": "query Payments($input: PaymentsInput) { payments(input: $input) { edges { node { id orgId provider configurationId originalAmount amount currency status date expectedSettlementDate expectedFundsAvailableDate contactId paymentSessionId paymentPlanId } cursor } pageInfo { hasNextPage hasPreviousPage startCursor endCursor } } }",
"variables": {
"input": {
"first": 42,
"after": "example",
"last": 42,
"before": "example",
"orgId": "abc123",
"agencyId": "abc123",
"configurationId": "abc123",
"start": "example",
"end": "example"
}
}
}
""";
using var client = new HttpClient();
using var content = new StringContent(body, Encoding.UTF8, "application/json");
client.DefaultRequestHeaders.Add("Authorization", "Bearer <api-key>");
var response = await client.PostAsync("https://graph.clientloop.com/", content);
var result = await response.Content.ReadAsStringAsync();Types
input PaymentsInput
Filter and pagination for the payments connection.
Pagination is Relay cursor-based, not page/offset based — see the Relay Connections spec. Page forward with first + after, or backward with last + before; never mix the two directions in a single call. Cursors are opaque strings taken from a previous response's pageInfo (or edges[].cursor) — treat them as black boxes, don't build or parse them yourself.
Scope the list by supplying at most one of orgId, agencyId, or configurationId (omit all three to list every payment), and optionally a start/end payment-date range. Results are ordered newest first.
| Field | Type | Description |
|---|---|---|
first | Int | Forward pagination: return at most the first N payments from the start of the result window. Pair with after to walk forward. Do not combine with last/before. When omitted (and no last), a default page size is used. |
after | String | Forward pagination cursor: return the payments that come after this cursor. Use the pageInfo.endCursor from the previous page. Pair with first. |
last | Int | Backward pagination: return at most the last N payments nearest the end of the result window. Pair with before to walk backward. Do not combine with first/after. |
before | String | Backward pagination cursor: return the payments that come before this cursor. Use the pageInfo.startCursor from the previous page. Pair with last. |
orgId | ID | List payments for this org. Mutually exclusive with agencyId / configurationId. |
agencyId | ID | List payments for this agency. Mutually exclusive with orgId / configurationId. |
configurationId | ID | List payments for this provider configuration. Mutually exclusive with orgId / agencyId. |
start | String | Inclusive lower bound on payment date (ISO 8601). Filters on the payment's date. |
end | String | Inclusive upper bound on payment date (ISO 8601). Filters on the payment's date. |
type PaymentConnection
A page of payments following the Relay Connection spec. edges holds the payments in this page (each with its cursor) and pageInfo describes whether more pages exist in each direction plus the cursors that bound this page.
Typical "load more" loop: read edges[].node for the data, then if pageInfo.hasNextPage is true request the next page with payments(input: { first: N, after: pageInfo.endCursor, ...same filters }).
| Field | Type | Description |
|---|---|---|
edges | [PaymentEdge!]! | The payments in this page, ordered newest first. |
pageInfo | PageInfo! | Pagination metadata for this page: hasNextPage/hasPreviousPage and the startCursor/endCursor bounds. |
type PaymentEdge
A single element of a PaymentConnection page: the payment itself (node) plus the opaque cursor that points at it. Pass a cursor back as after (forward) or before (backward) to page relative to this row.
| Field | Type | Description |
|---|---|---|
node | Payment! | The payment at this position in the page. |
cursor | String! | Opaque cursor identifying this payment's position, for use as after or before. |
type PageInfo
PageInfo type for cursor-based pagination following the Relay specification for cursor based pagination.
| Field | Type | Description |
|---|---|---|
hasNextPage | Boolean! | |
hasPreviousPage | Boolean! | |
startCursor | String | |
endCursor | String |
type Payment
| Field | Type | Description |
|---|---|---|
id | ID! | Unique id of the payment (a bare KSUID). |
orgId | ID | The platform organization that facilitated this payment. |
provider | PaymentProvider | Payment provider that was used to process this payment |
configurationId | ID | ID of the payment provider configuration that facilitated this payment |
originalAmount | Amount! | Original amount for the payment. If this payment has only been authorized and is in a pending state this will be the amount authorized for the payment. |
amount | Amount! | Amount of the payment. This may differ from the orginal amount if the captured payment amount is different than the authorized amount. |
currency | Currency! | Currency of the payment |
status | PaymentStatus! | Status of the payment |
date | DateTime! | The date the payment was created. If payments are pre-created pending, this date will be updated when the payment is actually completed. |
expectedSettlementDate | String | The estimates date funds will be settled. |
expectedFundsAvailableDate | String | The estimated date funds will be available to the merchant. |
source | PaymentSource | Integration source details for this payment. |
contactId | ID | Optional ID of the platform contact associated with this payment. |
paymentSessionId | ID | ID of the payment session that facilitated this payment |
paymentPlanId | ID | ID of the payment plan that generated this payment |
enum PaymentProvider
NMIPlaidCLP
scalar Amount
A monetary amount with up to two decimal places. Ex. 111.11
scalar Currency
Three letter ISO 4217 currency code. Ex. USD
enum PaymentStatus
PendingCompletedFinalizedCanceled
scalar DateTime
ISO 8601 formatted date time. Ex. 2023-11-23T14:30:00Z
type PaymentSource
The source of the payment. This is used to identify the integration and specific connection that facilitated the payment within the integration.
| Field | Type | Description |
|---|---|---|
name | String | Name of the integration that facilitated this payment. This is typically the name of the integration that's using the checkout process like an ecommerce platform or CRM. |
connectionId | ID | The ID of the connection within the integration that facilitated this payment. |
orderId | String | Optional merchant supplied order ID associated with the payment. |
invoiceId | String | Optional merchant supplied invoice ID associated with the payment. |
invoiceNumber | String | Optional merchant supplied invoice number associated with the payment. |
transactionId | String | Optional merchant supplied transaction ID associated with the payment. |
contactId | String | Optional merchant supplied contact ID for which this payment session is attached. |
contactName | String | Optional merchant supplied contact name for which this payment session is attached. |
contactEmail | String | Optional merchant supplied contact email for which this payment session is attached. |