Sales & CRMMu Mutation

recordPayment

Topics: Commerce

Record a payment against an invoice: writes a payment ledger row and rolls the payment up onto the invoice (paidAmount, paid/partiallyPaid, paidAt) and its order (paymentStatus), atomically. Requires payment:write permission.

Returns

OTCRecordPaymentPayload!

Arguments

The invoice being paid and the amount, plus the optional ledger detail (currency, method, reference, notes, receipt date) and the invoice-level payment method/reference.

Examples

Record Commerce Payment

mutation RecordCommercePayment($input: OTCRecordPaymentInput!) {
  recordPayment(input: $input) {
    payment { id amount currency method reference }
    invoice { id status totalAmount paidAmount }
    order { id paymentStatus }
    errors { path message }
  }
}

Variables

{
  "input": {
    "invoiceId": "inv_01h455vb4pex5vsknk084sn02q",
    "amount": 1000,
    "currency": "EUR",
    "method": "BANK_TRANSFER",
    "reference": "BANK-2042",
    "receivedAt": "2026-10-22T09:00:00.000Z"
  }
}
Exact field SDL
"""
Record a payment against an invoice: writes a payment ledger row and rolls the payment up onto the invoice (`paidAmount`, `paid`/`partiallyPaid`, `paidAt`) and its order (`paymentStatus`), atomically. Requires payment:write permission.
"""
recordPayment(
  """
  The invoice being paid and the amount, plus the optional ledger detail (currency, method, reference, notes, receipt date) and the invoice-level payment method/reference.
  """
  input: OTCRecordPaymentInput!
): OTCRecordPaymentPayload! @topic(names: ["commerce"]) @topic_example(names: ["commerce.record-payment"])

Declared on Mutation. Access is checked by the platform for each operation.