Skip to content

Mercury: Unmatch a transaction from its bills or invoices

Mercury books.deleteBooksPaymentApplications: arguments, response, policy and SDK examples.

← Books operations · Get started

Operation mercury.deletebookspaymentapplications

Provider route: DELETE /books/line-entry/{lineEntryId}/payment-applications. Alter supplies the connection’s credentials and routing.

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["books"]["deleteBooksPaymentApplications"]>[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.books.deleteBooksPaymentApplications(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from 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.books.delete_books_payment_applications(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.lineEntryIdstringRequired within parentunique id for a line entry; emitted as base-58, but a base-16 UUID is also accepted
Format: base58 (max length 22)
queryobjectOptionalAdditional keys: not allowed
query.booksIdstringOptionalThe Books instance to act on. Must be the token organization’s own instance, which it defaults to.
Format: uuid

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Match a transaction to bills or invoices — response body

Referenced models: Match a transaction to bills or invoices — response body

Match a transaction to bills or invoices — response body
FieldTypePresenceDescription and constraints
$objectRootThe result of matching a line entry to bills or invoices, or of unmatching
it. Both operations return this shape.
billsarrayRequired within parentThe bills the request matched or unmatched. Empty when it matched or unmatched invoices.
bills[]ModelEach itemExpand Match a transaction to bills or invoices — response body — bills item
invoicesarrayRequired within parentThe invoices the request matched or unmatched. Empty when it matched or unmatched bills.
invoices[]ModelEach itemExpand Match a transaction to bills or invoices — response body — bills item
lineEntryJSONRequired within parent
lineEntry (allOf 1)ModelAll variants applyExpand Match a transaction to bills or invoices — response body — line Entry The line entry after the match or unmatch
lineEntry (allOf 2)JSONAll variants applyThe line entry.

Referenced models: Match a transaction to bills or invoices — response body — bills item, Match a transaction to bills or invoices — response body — line Entry The line entry after the match or unmatch

Match a transaction to bills or invoices — response body — bills item
FieldTypePresenceDescription and constraints
$objectRootA bill or invoice after the match or unmatch.
amountAdjustedJSONRequired within parent
amountAdjusted (allOf 1)ModelAll variants applyExpand Create a product — response body — unit Price value
amountAdjusted (allOf 2)JSONAll variants applyThe total of the adjustments booked against it, in dollars.
amountOutstandingJSONRequired within parent
amountOutstanding (allOf 1)ModelAll variants applyExpand Create a product — response body — unit Price value
amountOutstanding (allOf 2)JSONAll variants applyThe amount still owed, in dollars.
amountPaidJSONRequired within parent
amountPaid (allOf 1)ModelAll variants applyExpand Create a product — response body — unit Price value
amountPaid (allOf 2)JSONAll variants applyThe total of the payments applied to it, in dollars.
displayStatusJSONRequired within parent
displayStatus (allOf 1)stringAll variants applyKnown values: open, paid, draft, cancelled, overdue, partiallyPaid, processing
displayStatus (allOf 2)JSONAll variants applyThe status shown in Mercury, which also tells overdue and partially paid ones apart.
idstringRequired within parentThe ID of the bill or invoice.
Format: base58 (max length 22)
statusJSONRequired within parent
status (allOf 1)stringAll variants applyKnown values: open, paid, draft, cancelled, processing
status (allOf 2)JSONAll variants applyThe status of the bill or invoice.

Referenced models: Create a product — response body — unit Price value

Match a transaction to bills or invoices — response body — line Entry The line entry after the match or unmatch
FieldTypePresenceDescription and constraints
$objectRootThe line entry after the match or unmatch.
amountJSONRequired within parent
amount (allOf 1)ModelAll variants applyExpand Create a product — response body — unit Price value
amount (allOf 2)JSONAll variants applyThe unsigned amount of the line entry, in dollars.
amountAdjustedJSONRequired within parent
amountAdjusted (allOf 1)ModelAll variants applyExpand Create a product — response body — unit Price value
amountAdjusted (allOf 2)JSONAll variants applyHow much of the line entry is booked as line-level adjustments. 0 after an unmatch.
amountAppliedJSONRequired within parent
amountApplied (allOf 1)ModelAll variants applyExpand Create a product — response body — unit Price value
amountApplied (allOf 2)JSONAll variants applyHow much of the line entry is applied to bills or invoices. 0 after an unmatch.
idstringRequired within parentThe ID of the line entry, the one in the request path.
Format: base58 (max length 22)
journalEntryIdstringRequired within parentThe ID of the line entry's journal entry.
Format: base58 (max length 22)
transactionIdJSONOptional
transactionId (anyOf 1)stringAlternativeThe ID of the transaction the line entry belongs to, as `getBooksTransaction` takes it. Omitted when the line entry isn't a transaction's.
transactionId (anyOf 2)nullAlternative

Referenced models: Create a product — response body — unit Price value

Create a product — response body — unit Price value
FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)numberAlternativeA dollar amount
Format: double
$ (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

SDK function policy ID: mercury.deletebookspaymentapplications. Catalog operation: mercury:deleteBooksPaymentApplications. 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.

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand how our website, product, and documentation are used.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

Advertising

Shares visits and sign-ups with Meta, Reddit, and X so we can measure which of our ads work.

You can change these choices at any time from Cookie settings.