query paymentAuthenticated
Fetches a single payment by its id. Returns null when no payment matches.
Returns Payment
Arguments
| Argument | Type | Description |
|---|---|---|
id | ID! |
Example request
curl -X POST 'https://graph.clientloop.com/' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{
"query": "query Payment($id: ID!) { payment(id: $id) { id orgId provider configurationId originalAmount amount currency status date expectedSettlementDate expectedFundsAvailableDate source { name connectionId orderId invoiceId invoiceNumber transactionId contactId contactName contactEmail } contactId paymentSessionId paymentPlanId paymentSession { id orgId status amount currency callbackUrl successUrl link contactId contact { id orgId ownerId name givenName familyName email phone deletedAt createdAt updatedAt } contactRef { contactId contactName contactFirstName contactLastName contactEmail contactPhone } transactionRef invoiceIds invoiceRefs { orderId invoiceId invoiceNumber amount } expirationDate paymentId createdAt updatedAt checkoutConfigurationId invoiceTotal brandLogoUrl brandName } } }",
"variables": {
"id": "abc123"
}
}'const response = await fetch('https://graph.clientloop.com/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer <api-key>',
},
body: JSON.stringify({
query: `
query Payment($id: ID!) {
payment(id: $id) {
id
orgId
provider
configurationId
originalAmount
amount
currency
status
date
expectedSettlementDate
expectedFundsAvailableDate
source {
name
connectionId
orderId
invoiceId
invoiceNumber
transactionId
contactId
contactName
contactEmail
}
contactId
paymentSessionId
paymentPlanId
paymentSession {
id
orgId
status
amount
currency
callbackUrl
successUrl
link
contactId
contact {
id
orgId
ownerId
name
givenName
familyName
email
phone
deletedAt
createdAt
updatedAt
}
contactRef {
contactId
contactName
contactFirstName
contactLastName
contactEmail
contactPhone
}
transactionRef
invoiceIds
invoiceRefs {
orderId
invoiceId
invoiceNumber
amount
}
expirationDate
paymentId
createdAt
updatedAt
checkoutConfigurationId
invoiceTotal
brandLogoUrl
brandName
}
}
}
`,
variables: {
"id": "abc123"
},
}),
});
const { data, errors } = await response.json();<?php
$body = <<<'JSON'
{
"query": "query Payment($id: ID!) { payment(id: $id) { id orgId provider configurationId originalAmount amount currency status date expectedSettlementDate expectedFundsAvailableDate source { name connectionId orderId invoiceId invoiceNumber transactionId contactId contactName contactEmail } contactId paymentSessionId paymentPlanId paymentSession { id orgId status amount currency callbackUrl successUrl link contactId contact { id orgId ownerId name givenName familyName email phone deletedAt createdAt updatedAt } contactRef { contactId contactName contactFirstName contactLastName contactEmail contactPhone } transactionRef invoiceIds invoiceRefs { orderId invoiceId invoiceNumber amount } expirationDate paymentId createdAt updatedAt checkoutConfigurationId invoiceTotal brandLogoUrl brandName } } }",
"variables": {
"id": "abc123"
}
}
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 Payment($id: ID!) { payment(id: $id) { id orgId provider configurationId originalAmount amount currency status date expectedSettlementDate expectedFundsAvailableDate source { name connectionId orderId invoiceId invoiceNumber transactionId contactId contactName contactEmail } contactId paymentSessionId paymentPlanId paymentSession { id orgId status amount currency callbackUrl successUrl link contactId contact { id orgId ownerId name givenName familyName email phone deletedAt createdAt updatedAt } contactRef { contactId contactName contactFirstName contactLastName contactEmail contactPhone } transactionRef invoiceIds invoiceRefs { orderId invoiceId invoiceNumber amount } expirationDate paymentId createdAt updatedAt checkoutConfigurationId invoiceTotal brandLogoUrl brandName } } }",
"variables": {
"id": "abc123"
}
}
""";
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 Payment($id: ID!) { payment(id: $id) { id orgId provider configurationId originalAmount amount currency status date expectedSettlementDate expectedFundsAvailableDate source { name connectionId orderId invoiceId invoiceNumber transactionId contactId contactName contactEmail } contactId paymentSessionId paymentPlanId paymentSession { id orgId status amount currency callbackUrl successUrl link contactId contact { id orgId ownerId name givenName familyName email phone deletedAt createdAt updatedAt } contactRef { contactId contactName contactFirstName contactLastName contactEmail contactPhone } transactionRef invoiceIds invoiceRefs { orderId invoiceId invoiceNumber amount } expirationDate paymentId createdAt updatedAt checkoutConfigurationId invoiceTotal brandLogoUrl brandName } } }",
"variables": {
"id": "abc123"
}
}
""";
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
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 |
paymentSession | PaymentSession | Payment session that facilitated 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. |
type PaymentSession
Represents a payment session a customer can use to make a payment. This session is used to configuration and setup the payment experience for an individual customer's session during checkout.
| Field | Type | Description |
|---|---|---|
id | ID! | Unique identifier for the payment session. |
orgId | ID! | Organization identifier the payment session belongs to. |
status | PaymentSessionStatus! | Status of the payment session. |
amount | Amount! | Total payment amount. Ex. 100.10 |
currency | Currency! | Three letter ISO currency code. Ex. USD |
callbackUrl | URL | URL to receive payment session events |
successUrl | URL | URL to redirect after a payment session is completed by the customer |
link | URL | Link to the payment session. This will be null if the session is expired or completed. This link is used to redirect the user to the payment page or may be used to embedded payment flow depending on the configuration provided. |
contactId | ID | ID for the contact for which this payment session is attached. |
contact | Contact | Contact for which this payment session is attached. |
contactRef | PaymentSessionContactRef | Optional merchant supplied reference contact information external to the platform. |
transactionRef | String | Optional merchant supplied reference ID for the transaction external to the platform. |
invoiceIds | [String!] | Optional array of invoice IDs which this payment session is attached to. You cannot provide both invoiceIds and invoiceRefs. Note that some feature are unavailable unless at least one invoiceId or invoiceRef is provided. |
invoiceRefs | [PaymentSessionInvoiceRef!] | Optional array of invoice references which this payment session is attached to. You cannot provide both invoiceIds and invoiceRefs. Note that some features are unavailable unless at least one invoiceId or invoiceRef is provided. |
expirationDate | DateTime | Optional expiration date for the payment session. ISO 8601 format. |
paymentId | ID | Payment ID associated with this payment session. If the payment session status is completed, this will be populated. It may also be populated if the payment session was attached to a pre-created payment record. |
createdAt | DateTime! | Date the payment session was created |
updatedAt | DateTime! | Date the payment session was last updated |
checkoutConfigurationId | ID | The checkout configuration ID used for this payment session. |
invoiceTotal | Amount | Optional total amount due across the referenced invoices. When the payment amount exceeds this total (for example because of a surcharge or tip), financing options such as FlexPay are disabled since they cannot finance the additional amount. |
brandLogoUrl | URL | Optional caller-supplied URL to a logo image to display during checkout, overriding the default branding. |
brandName | String | Optional caller-supplied brand or merchant name to display during checkout, overriding the organization name. |
enum PaymentSessionStatus
ExpiredActiveCompletedCanceled
scalar URL
A URL with protocol and port. ex. https://example.com
type Contact
| Field | Type | Description |
|---|---|---|
id | ID! | Unique ID of the contact. |
orgId | ID! | ID of the organization that owns the contact. |
ownerId | ID! | Global ID of the owning organization ( |
name | String! | Full name of the contact. |
givenName | String | Given name of the contact. |
familyName | String | Family name of the contact. |
email | Email | Email address of the contact. |
phone | Phone | Phone number of the contact. This will be validated and normalized to the E.164 format. |
deletedAt | String | Set when the contact has been soft-deleted; null for an active contact. |
createdAt | String! | Date and time when the contact was created. |
updatedAt | String! | Date and time when the contact was last updated. |
idv | ContactIdvSessionDetail | The latest Plaid identity-verification session for this contact. On the public graph this exposes the session timestamps, the captured selfie video, the captured identity documents, and the individual check outcomes; the remaining detail is private-graph only. Null when the contact has never started a session. Fetched on demand from Plaid — request it only when needed. |
type PaymentSessionContactRef
Merchant provide contact information for use during a payment session.
| Field | Type | Description |
|---|---|---|
contactId | ID | |
contactName | String | |
contactFirstName | String | |
contactLastName | String | |
contactEmail | Email | |
contactPhone | Phone | |
address | GlobalAddress |
type PaymentSessionInvoiceRef
Merchant provided invoice information for use during a payment session.
| Field | Type | Description |
|---|---|---|
orderId | String | The merchant provided order identifier. |
invoiceId | String | The merchant provided invoice identifier. |
invoiceNumber | String | The merchant provided invoice number. |
amount | Amount | The total amount of the invoice. Ex 999.99 |
lines | [PaymentSessionInvoiceLineItemRef!] | The line items inside the merchant provided invoice. |
billingContact | PaymentSessionContactRef | Billing contact information associated with the invoice |
shippingContact | PaymentSessionContactRef | Billing contact information associated with the invoice |
scalar Email
An email address
scalar Phone
E.164 formatted phone number. Ex. +14155554345
type ContactIdvSessionDetail
Details of a contact's Plaid identity-verification session, fetched on demand from Plaid. The public graph exposes the timestamps, the captured selfie video, the captured identity documents, and the individual check outcomes; the remaining fields — including the raw Plaid pass-throughs they are derived from — are private-graph only.
| Field | Type | Description |
|---|---|---|
status | ContactIdvSessionStatus! | Where the verification as a whole stands. Success, Failed and PendingReview are all terminal and all carry captured identity; Active is still in progress, and Expired or Canceled never produced one. |
createdAt | DateTime! | |
completedAt | DateTime | |
documents | [ContactIdvDocument!]! | Captured identity documents, pulled out of documentary_verification: each document's category and its captured images. |
selfieVideoUrl | String | URL of the captured selfie video, pulled out of selfieCheck for direct access. Plaid-hosted and expiring; null when the template did not capture a selfie video. |
nameMatch | IdvMatchSummary | How the name that the contact supplied compared against Plaid's data sources. Null when the KYC step has not run. |
dateOfBirthMatch | IdvMatchSummary | How the date of birth compared against Plaid's data sources. Null when the KYC step has not run. |
phoneNumberMatch | IdvMatchSummary | How the phone number compared against Plaid's data sources. Null when the KYC step has not run. |
addressMatch | IdvMatchSummary | How the address compared against Plaid's data sources. Null when the KYC step has not run. |
taxIdMatch | IdvMatchSummary | How the tax id (SSN) compared against Plaid's data sources, from Plaid's id_number check. Null when the KYC step has not run. |
livenessCheck | IdvLivenessStatus | Whether the captured selfie passed liveness detection. Null when the selfie step has not run or captured no analysis. |
facialComparisonCheck | IdvFacialComparisonStatus | Whether the captured selfie matched the face on the identity document. Null when the selfie step has not run or captured no analysis. |
type GlobalAddress
Address of a physical location
| Field | Type | Description |
|---|---|---|
lines | [String!]! | Street, unit, building number, etc. |
locality | String | City, town or municipality designation |
administrativeArea | String | State, province or area designation |
postalCode | String | Postal code or ZIP code |
countryCode | String! | 2-letter country code. Ex. USA |
type PaymentSessionInvoiceLineItemRef
Merchant provided invoice line item information for use during a payment session.
| Field | Type | Description |
|---|---|---|
num | Int! | |
quantity | Float | |
price | Amount | |
productId | String | |
productSku | String | |
productName | String | |
productDescription | String | |
productImageUrl | URL |
enum ContactIdvSessionStatus
Where a contact's verification stands. Mirrors the shared IdvSessionStatus but is declared separately so the contact graph's public surface does not depend on a type owned by the application module.
ActiveExpiredCanceledSuccessFailedPendingReview
type ContactIdvDocument
A captured identity document from a contact's Plaid documentary verification.
| Field | Type | Description |
|---|---|---|
category | String | Document category as classified by Plaid (e.g. drivers_license, id_card, passport). Null when Plaid could not classify the document. |
images | [ContactIdvDocumentImage!]! | Captured images for this document (e.g. originalFront, croppedBack, face). |
enum IdvMatchSummary
How one value that the contact supplied compared against the data sources that Plaid checked it against. NoData means Plaid held nothing to compare with; NoInput means the contact supplied nothing to compare.
MatchPartialMatchNoMatchNoDataNoInput
enum IdvLivenessStatus
Whether the captured selfie passed liveness detection — that a live person was present rather than a photograph or a screen.
SuccessFailed
enum IdvFacialComparisonStatus
How the captured selfie compared against the face on the captured identity document. NoInput means one of the two was never captured.
MatchNoMatchNoInput
type ContactIdvDocumentImage
A single captured image belonging to a ContactIdvDocument. Plaid-hosted and expiring.
| Field | Type | Description |
|---|---|---|
name | String | Image identifier (e.g. originalFront, croppedBack, face). |
url | String | Plaid-hosted URL of the image. Expires. |