query paymentAuthenticated

Fetches a single payment by its id. Returns null when no payment matches.

Returns Payment

Arguments

ArgumentTypeDescription
idID!

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 } }",
    "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
        }
      }
    `,
    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 } }",
  "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 } }",
  "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 } }",
  "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

FieldTypeDescription
idID!

Unique id of the payment (a bare KSUID).

orgIdID

The platform organization that facilitated this payment.

providerPaymentProvider

Payment provider that was used to process this payment

configurationIdID

ID of the payment provider configuration that facilitated this payment

originalAmountAmount!

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.

amountAmount!

Amount of the payment. This may differ from the orginal amount if the captured payment amount is different than the authorized amount.

currencyCurrency!

Currency of the payment

statusPaymentStatus!

Status of the payment

dateDateTime!

The date the payment was created. If payments are pre-created pending, this date will be updated when the payment is actually completed.

expectedSettlementDateString

The estimates date funds will be settled.

expectedFundsAvailableDateString

The estimated date funds will be available to the merchant.

sourcePaymentSource

Integration source details for this payment.

contactIdID

Optional ID of the platform contact associated with this payment.

paymentSessionIdID

ID of the payment session that facilitated this payment

paymentPlanIdID

ID of the payment plan that generated this payment

enum PaymentProvider

  • NMI
  • Plaid
  • CLP

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

  • Pending
  • Completed
  • Finalized
  • Canceled

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.

FieldTypeDescription
nameString

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.

connectionIdID

The ID of the connection within the integration that facilitated this payment.

orderIdString

Optional merchant supplied order ID associated with the payment.

invoiceIdString

Optional merchant supplied invoice ID associated with the payment.

invoiceNumberString

Optional merchant supplied invoice number associated with the payment.

transactionIdString

Optional merchant supplied transaction ID associated with the payment.

contactIdString

Optional merchant supplied contact ID for which this payment session is attached.

contactNameString

Optional merchant supplied contact name for which this payment session is attached.

contactEmailString

Optional merchant supplied contact email for which this payment session is attached.