# Get payment by ID

> 🔐 **Required role:** `API_ADMIN`
📖 **Data dictionary:** [Payment](/reference/data-dictionary/payment)

**Retrieve a specific payment by its unique identifier**
This endpoint provides detailed payment information including:
- Complete payment transaction details
- PCI-compliant payment method information (masked)
- Payment status and confirmation data
- Associated invoice and client relationships
- Payment processor integration details
- Audit trail and security compliance data

**Security & Compliance:**
- PCI DSS compliant data handling
- Secure payment processor ID tracking
- Payment confirmation date logging
- Audit trail for payment processing

**Payment Details Include:**
- Payment amount and currency
- Payment method (masked for security)
- Payment status and confirmation
- Associated invoice references
- Client relationship data
- Payment processor details

**Business Applications:**
- Payment verification and reconciliation
- Client payment history lookup
- Payment dispute resolution
- Audit and compliance reporting
- Payment method analysis

The `payment` field is an array containing at most one record. An id that
matches no payment returns 200 with `"payment": []`; the endpoint never
returns 404.
**Response Example:**

```json
{
  "payment": [
    {
      "payment_ar_tran_id": 1048,
      "ar_transaction_date": "2026-09-01T15:00:34.317714",
      "client_name": "Acme Corporation",
      "client_ref": "1337",
      "invoice_numbers": null,
      "is_aiwyn_payment": true,
      "is_partial_payment": false,
      "is_payment_success": true,
      "notes": "Paid by check",
      "engagement_names": null,
      "paid_by_full_name": "Jane Doe",
      "payment_payment_method": "Bank Transfer",
      "payment_pp_id": "pi_3UAtArIog7gyKVjp2cNQXIBJ",
      "refund_date": null,
      "refund_status": null,
      "staff_admin_id": true,
      "status": "Completed",
      "total_bill_amount": null,
      "amount": 10,
      "principal": 10,
      "total_processing_fee_amount": 0,
      "total_international_fee_amount": 0,
      "total_late_fee_amount": 0,
      "is_posted": false,
      "posted_to_bank_dt": null,
      "estimated_deposit_date": null,
      "dispute_status": null,
      "dispute_refund_date": null,
      "total_bill_amount_in_currency": null,
      "amount_in_currency": null,
      "principal_in_currency": null,
      "total_processing_fee_amount_in_currency": null,
      "total_international_fee_amount_in_currency": null,
      "total_late_fee_amount_in_currency": null,
      "currency_code": null
    }
  ]
}
```

Endpoint: GET /gql/v1/payment/{id}
Version: 1.0.0
Security: BearerAuth, CfAccessClientId, CfAccessClientSecret

## Security:

  - `BearerAuth` (unknown)
    http bearer JWT

  - `CfAccessClientId` (unknown)
    apiKey in header CF-Access-Client-Id

  - `CfAccessClientSecret` (unknown)
    apiKey in header CF-Access-Client-Secret

## Path parameters:

  - `id` (integer, required)
    Unique identifier of the payment

## Response 200:

  - `200` (unknown)
    Payment lookup completed. `payment` holds the matching payment, or is an
empty array when no payment has this id.

## Response 200 fields (application/json):

  - `payment` (array, required)
    Array containing the matching payment (empty if not found)

  - `payment.payment_ar_tran_id` (integer, required)
    AR transaction id of the payment (the id used by this endpoint)
    Example: 1048

  - `payment.ar_transaction_date` (string, required)
    Date/time of the AR transaction, as a local date-time with no time-zone offset
    Example: 2026-09-01T15:00:34.317714

  - `payment.client_name` (string, required)
    Name of the client the payment belongs to
    Example: Acme Corporation

  - `payment.client_ref` (string, required)
    External client reference number
    Example: 1337

  - `payment.invoice_numbers` (string | null, required)
    Comma-separated invoice numbers the payment is applied to
    Example: null

  - `payment.is_aiwyn_payment` (boolean, required)
    Whether the payment was created through Aiwyn
    Example: true

  - `payment.is_partial_payment` (boolean, required)
    Whether the payment only partially covers the billed amount
    Example: false

  - `payment.is_payment_success` (boolean, required)
    Whether the payment succeeded
    Example: true

  - `payment.notes` (string | null, required)
    Free-text notes on the payment
    Example: Paid by check

  - `payment.engagement_names` (string | null, required)
    Names of engagements associated with the payment
    Example: null

  - `payment.paid_by_full_name` (string | null, required)
    Full name of the payer
    Example: Jane Doe

  - `payment.payment_payment_method` (string | null, required)
    Human-readable payment method
    Example: Bank Transfer

  - `payment.payment_pp_id` (string | null, required)
    Payment processor (Stripe) identifier
    Example: pi_3UAtArIog7gyKVjp2cNQXIBJ

  - `payment.refund_date` (string | null, required)
    Date of refund, if refunded
    Example: null

  - `payment.refund_status` (string | null, required)
    Refund status, if refunded
    Example: null

  - `payment.staff_admin_id` (boolean, required)
    Staff/admin association flag
    Example: true

  - `payment.status` (string, required)
    Human-readable payment status
    Example: Completed

  - `payment.total_bill_amount` (number | null, required)
    Total billed amount
    Example: null

  - `payment.amount` (number, required)
    Payment amount
    Example: 10

  - `payment.principal` (number, required)
    Principal portion of the payment
    Example: 10

  - `payment.total_processing_fee_amount` (number, required)
    Total processing fee amount
    Example: 0

  - `payment.total_international_fee_amount` (number, required)
    Total international fee amount
    Example: 0

  - `payment.total_late_fee_amount` (number, required)
    Total late fee amount
    Example: 0

  - `payment.is_posted` (boolean, required)
    Whether the payment has been posted to the bank
    Example: false

  - `payment.posted_to_bank_dt` (string | null, required)
    Date/time the payment was posted to the bank
    Example: null

  - `payment.estimated_deposit_date` (string | null, required)
    Estimated deposit date, as a local date-time with no time-zone offset
    Example: null

  - `payment.dispute_status` (string | null, required)
    Dispute status, if disputed
    Example: null

  - `payment.dispute_refund_date` (string | null, required)
    Date of dispute-related refund, if any
    Example: null

  - `payment.total_bill_amount_in_currency` (number | null, required)
    Total billed amount in the payment's currency
    Example: null

  - `payment.amount_in_currency` (number | null, required)
    Payment amount in the payment's currency
    Example: null

  - `payment.principal_in_currency` (number | null, required)
    Principal portion in the payment's currency
    Example: null

  - `payment.total_processing_fee_amount_in_currency` (number | null, required)
    Total processing fee in the payment's currency
    Example: null

  - `payment.total_international_fee_amount_in_currency` (number | null, required)
    Total international fee in the payment's currency
    Example: null

  - `payment.total_late_fee_amount_in_currency` (number | null, required)
    Total late fee in the payment's currency
    Example: null

  - `payment.currency_code` (string | null, required)
    ISO currency code of the payment
    Example: null

  - `payment.card_type` (string | null, required)
    Card brand for card payments (for example visa), or the bank name for bank payments, as reported by the payment processor
    Example: visa

  - `payment.last4` (string | null, required)
    Last four digits of the card or account used for the payment
    Example: 4242

  - `payment.failure_reason` (string | null, required)
    Why the payment failed
    Example: null

  - `payment.failed_at` (string | null, required)
    When the payment failed
    Example: null

  - `payment.payment_confirmation_date` (string | null, required)
    When the payment was confirmed, as a local date-time with no time-zone offset. Determines whether a payment counts as completed or still pending.
    Example: 2026-09-01T15:00:34.317714

  - `payment.payment_source` (string | null, required)
    How the payment was made: MANUAL, AUTO_PAY, SCHEDULED, AUTO_DRAFT, PAYMENT_LINK, CLIENT_PORTAL, PRE_PAYMENT or UNSPECIFIED
    Example: CLIENT_PORTAL

  - `payment.payment` (object, required)
    Details from the payment record behind this row

  - `payment.payment.application_fee_amount` (number | null, required)
    Processor application fee charged on the payment
    Example: null

  - `payment.payment.company_name` (string | null, required)
    Company name of the payer
    Example: null

  - `payment.payment.created_at` (string, required)
    When the payment record was created
    Example: 2026-09-01T15:00:34.317714+00:00

  - `payment.payment.created_by_contact_id` (integer | null, required)
    Contact who made the payment
    Example: null

  - `payment.payment.created_by_staff_id` (integer | null, required)
    Staff member who recorded the payment
    Example: null

  - `payment.payment.firm_bank_account_id` (integer | null, required)
    Firm bank account the payment was deposited into; often empty because not every firm records it
    Example: null

  - `payment.payment.is_manual` (boolean | null, required)
    Whether the payment was recorded manually rather than taken through the gateway
    Example: false

  - `payment.payment.payor_name` (string | null, required)
    Name of the payer
    Example: null

  - `payment.payment.posted_to_bank` (boolean | null, required)
    Whether the payment was posted to the bank
    Example: false

  - `payment.payment.refunded_amount` (number | null, required)
    Amount refunded
    Example: null

  - `payment.payment.updated_at` (string, required)
    When the payment record was last updated
    Example: 2026-09-01T15:00:34.317714+00:00

## Response 400:

  - `400` (unknown)
    Bad request - the id is not an integer

## Response 400 fields (application/json):

  - `path` (string)
    Example: $

  - `error` (string, required)
    Example: invalid input syntax for type integer: "abc"

  - `code` (string, required)
    Example: data-exception

## Response 401:

  - `401` (unknown)
    Unauthorized - Invalid or missing authentication token

## Response 403:

  - `403` (unknown)
    Forbidden - Insufficient permissions to access this payment

## Response 500:

  - `500` (unknown)
    Internal server error

