Monument

Invoice Payments

Invoice payment recording and reconciliation.

externalpermissionstable6 procedures
queryinvoicePayments.listByInvoiceInferred output

List payments for a specific invoice.

Input
{
  invoiceId: string;
  includeDeleted?: boolean | undefined;
}
Output
Array<{
  recordedBy: {
    id: string;
    name: string;
  } | null;
  id: string;
  organizationId: string;
  invoiceId: string;
  amount: string;
  paymentDate: string;
  paymentMethod: "other" | "bank_transfer" | "check" | "credit_card" | "cash" | null;
  reference: string | null;
  notes: string | null;
  source: "xero" | "quickbooks" | "myob" | "manual" | "stripe";
  externalPaymentId: string | null;
  stripePaymentIntentId: string | null;
  stripeChargeId: string | null;
  recordedByResourceId: string | null;
  createdAt: Date;
  updatedAt: Date | null;
  deletedAt: Date | null;
}>
mutationinvoicePayments.recordInferred output

Record a new payment for an invoice.

Input
{
  amount: number;
  invoiceId: string;
  paymentDate: string;
  notes?: string | undefined;
  paymentMethod?: "other" | "bank_transfer" | "check" | "credit_card" | "cash" | undefined;
  reference?: string | undefined;
}
Output
{
  id: string;
  organizationId: string;
  createdAt: Date;
  updatedAt: Date | null;
  deletedAt: Date | null;
  notes: string | null;
  amount: string;
  invoiceId: string;
  paymentDate: string;
  paymentMethod: "other" | "bank_transfer" | "check" | "credit_card" | "cash" | null;
  reference: string | null;
  source: "xero" | "quickbooks" | "myob" | "manual" | "stripe";
  externalPaymentId: string | null;
  stripePaymentIntentId: string | null;
  stripeChargeId: string | null;
  recordedByResourceId: string | null;
}
mutationinvoicePayments.updateInferred output

Update an existing payment. Only manual payments can be updated.

Input
{
  id: string;
  notes?: string | null | undefined;
  amount?: number | undefined;
  paymentDate?: string | undefined;
  paymentMethod?: "other" | "bank_transfer" | "check" | "credit_card" | "cash" | null | undefined;
  reference?: string | null | undefined;
}
Output
{
  id: string;
  organizationId: string;
  createdAt: Date;
  updatedAt: Date | null;
  deletedAt: Date | null;
  notes: string | null;
  amount: string;
  invoiceId: string;
  paymentDate: string;
  paymentMethod: "other" | "bank_transfer" | "check" | "credit_card" | "cash" | null;
  reference: string | null;
  source: "xero" | "quickbooks" | "myob" | "manual" | "stripe";
  externalPaymentId: string | null;
  stripePaymentIntentId: string | null;
  stripeChargeId: string | null;
  recordedByResourceId: string | null;
}
mutationinvoicePayments.deleteInferred output

Delete a payment (soft delete). Only manual payments can be deleted.

Input
{
  id: string;
}
Output
{
  success: boolean;
  payment: {
    id: string;
    organizationId: string;
    createdAt: Date;
    updatedAt: Date | null;
    deletedAt: Date | null;
    notes: string | null;
    amount: string;
    invoiceId: string;
    paymentDate: string;
    paymentMethod: "other" | "bank_transfer" | "check" | "credit_card" | "cash" | null;
    reference: string | null;
    source: "xero" | "quickbooks" | "myob" | "manual" | "stripe";
    externalPaymentId: string | null;
    stripePaymentIntentId: string | null;
    stripeChargeId: string | null;
    recordedByResourceId: string | null;
  };
}
queryinvoicePayments.getSummaryInferred output

Get payment summary for an invoice.

Input
{
  invoiceId: string;
}
Output
{
  invoiceId: string;
  invoiceTotal: number;
  amountPaid: number;
  amountDue: number;
  isPaid: boolean;
  isPartiallyPaid: boolean;
  paymentsBySource: Array<{
    source: "xero" | "quickbooks" | "myob" | "manual" | "stripe";
    count: number;
    total: number;
  }>;
}
mutationinvoicePayments.syncFromAccountingInferred output

Trigger a sync from the connected accounting system. Optionally specify specific invoice IDs to sync, or sync all non-paid invoices.

Input
{
  invoiceIds?: Array<string> | undefined;
}
Output
{
  success: boolean;
  message: string;
  invoiceCount: number;
}