Mercury: List invoice payments
Mercury invoices.listInvoicePayments: arguments, response, policy and SDK examples.
← Invoices operations · Get started
Operation mercury.listinvoicepayments
Provider route: GET /ar/invoices/{invoiceId}/payments. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/mercury with npm, or alter-sdk-mercury with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { MercuryIntegration } from "@alter-ai/mercury";
async function execute(input: Parameters<MercuryIntegration["invoices"]["listInvoicePayments"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new MercuryIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.invoices.listInvoicePayments(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_mercury import MercuryIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = MercuryIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.invoices.list_invoice_payments(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.invoiceId | string | Required within parent | ID for the invoice. Format: uuid |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand List invoice payments — response body |
Referenced models: List invoice payments — response body
Schemas
Section titled “Schemas”List invoice payments — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | The payments applied to an invoice, oldest first. Payments that were removed from the invoice are not included. |
payments | array | Required within parent | The payments applied to the invoice. |
payments[] | Model | Each item | Expand List invoice payments — response body — payments item |
Referenced models: List invoice payments — response body — payments item
List invoice payments — response body — payments item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A payment applied to an invoice. Exactly one of @transaction@, @cardCharge@, or @manual@ is present, matching @type@. |
amount | JSON | Required within parent | |
amount (allOf 1) | Model | All variants apply | Expand Request to send money — response body — amount value |
amount (allOf 2) | JSON | All variants apply | The amount of the payment applied to this invoice. |
appliedDate | JSON | Required within parent | |
appliedDate (allOf 1) | string | All variants apply | Format: date |
appliedDate (allOf 2) | JSON | All variants apply | The date the payment was applied to the invoice. For payments marked as paid or matched in Mercury, the date entered then; otherwise the date Mercury received the payment. |
cardCharge | JSON | Optional | |
cardCharge (anyOf 1) | JSON | Alternative | |
cardCharge (anyOf 1) (allOf 1) | Model | All variants apply | Expand List invoice payments — response body — payments item card Charge Present when @type@ is @card Charge@ brand, last4 |
cardCharge (anyOf 1) (allOf 2) | JSON | All variants apply | Present when @type@ is @cardCharge@. |
cardCharge (anyOf 2) | null | Alternative | |
createdAt | JSON | Required within parent | |
createdAt (allOf 1) | string | All variants apply | Format: yyyy-mm-ddThh:MM:ssZ |
createdAt (allOf 2) | JSON | All variants apply | When the payment was recorded. |
currencyCode | JSON | Required within parent | |
currencyCode (allOf 1) | string | All variants apply | |
currencyCode (allOf 2) | JSON | All variants apply | ISO 4217 currency code of the amount. Always "USD". |
id | JSON | Required within parent | |
id (allOf 1) | string | All variants apply | ID for the invoice payment. Format: uuid |
id (allOf 2) | JSON | All variants apply | The ID of the payment. |
manual | JSON | Optional | |
manual (anyOf 1) | JSON | Alternative | |
manual (anyOf 1) (allOf 1) | Model | All variants apply | Expand List invoice payments — response body — payments item manual Present when @type@ is @manual@ method |
manual (anyOf 1) (allOf 2) | JSON | All variants apply | Present when @type@ is @manual@. |
manual (anyOf 2) | null | Alternative | |
transaction | JSON | Optional | |
transaction (anyOf 1) | JSON | Alternative | |
transaction (anyOf 1) (allOf 1) | Model | All variants apply | Expand List invoice payments — response body — payments item transaction Present when @type@ is @transaction@ counterparty Name, id, kind, matched By, status |
transaction (anyOf 1) (allOf 2) | JSON | All variants apply | Present when @type@ is @transaction@. |
transaction (anyOf 2) | null | Alternative | |
type | JSON | Required within parent | |
type (allOf 1) | string | All variants apply | Known values: transaction, cardCharge, manual |
type (allOf 2) | JSON | All variants apply | Where the money for the payment came from. |
Referenced models: Request to send money — response body — amount value, List invoice payments — response body — payments item card Charge Present when @type@ is @card Charge@ brand, last4, List invoice payments — response body — payments item manual Present when @type@ is @manual@ method, List invoice payments — response body — payments item transaction Present when @type@ is @transaction@ counterparty Name, id, kind, matched By, status
Request to send money — response body — amount value
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | number | Alternative | A positive dollar amount with at least 1 cent. Format: double Minimum: 0.01 |
$ (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
List invoice payments — response body — payments item card Charge Present when @type@ is @card Charge@ brand, last4
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Details of a card payment made by your customer through the invoice. |
brand | JSON | Required within parent | |
brand (allOf 1) | string | All variants apply | Known values: amex, cartesBancaires, diners, discover, eftposAu, girocard, jaywan, jcb, link, mastercard, troy, unionpay, visa, unknown |
brand (allOf 2) | JSON | All variants apply | The brand of the card that was charged. |
last4 | string | Required within parent | The last 4 digits of the card that was charged. |
List invoice payments — response body — payments item manual Present when @type@ is @manual@ method
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Details of a payment received outside Mercury and marked as paid. |
method | JSON | Required within parent | |
method (allOf 1) | string | All variants apply | Known values: cash, check, card, other |
method (allOf 2) | JSON | All variants apply | How the payment was made. |
List invoice payments — response body — payments item transaction Present when @type@ is @transaction@ counterparty Name, id, kind, matched By, status
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Details of a payment made by a transaction in one of your Mercury accounts. |
counterpartyName | string | Required within parent | The name of the party that sent the money. |
id | JSON | Required within parent | |
id (allOf 1) | string | All variants apply | ID for this transaction Format: uuid |
id (allOf 2) | JSON | All variants apply | The ID of the transaction. For payments that Mercury routed to the invoice's destination account, this is the ID of the routing transfer. |
kind | JSON | Required within parent | |
kind (allOf 1) | Model | All variants apply | Expand Get transaction by ID — response body — kind string |
kind (allOf 2) | JSON | All variants apply | The kind of the transaction that paid the invoice. |
matchedBy | JSON | Required within parent | |
matchedBy (allOf 1) | string | All variants apply | Known values: automatic, manual |
matchedBy (allOf 2) | JSON | All variants apply | Whether the transaction was matched to the invoice automatically or by a user. |
status | JSON | Required within parent | |
status (allOf 1) | string | All variants apply | Known values: pending, sent, cancelled, failed, reversed, blocked |
status (allOf 2) | JSON | All variants apply | The status of the transaction that paid the invoice. |
Referenced models: Get transaction by ID — response body — kind string
Get transaction by ID — response body — kind string
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | string | Root | Known values: externalTransfer, internalTransfer, outgoingPayment, creditCardCredit, creditCardTransaction, debitCardCredit, debitCardTransaction, cardInternationalTransactionFee, cardInternationalTransactionFeeRebate, cardInternationalTransactionFeeReversal, cardInternationalTransactionFeeRebateReversal, incomingDomesticWire, checkDeposit, incomingInternationalWire, treasuryTransfer, currencyCloudReturn, wireFee, personalBankingSubscriptionFee, billingEngineSubscriptionFee, expenseReimbursement, exogenousWireDrawdown, interestPayment, other |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: mercury.listinvoicepayments. Catalog operation: mercury:listInvoicePayments. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.