mercury_get_transaction_attachment
Obtain the pre-signed download URL(s) for a transaction's receipts / attachments.
Instructions
Obtain the pre-signed download URL(s) for a transaction's receipts / attachments.
USE WHEN: you actually intend to download a receipt — filing a supplier invoice, attaching a justification to a bookkeeping entry. Locate candidates first with mercury_list_transactions (hasAttachment: true), then call this for the one you want.
DO NOT USE: to check whether a receipt exists — mercury_list_transactions already reports hasAttachment without minting a credential. Do not call it across a whole statement to pre-fetch URLs: they expire in ~12 hours and every one you mint is a live bearer token sitting in transcripts and logs.
SIDE EFFECTS: none on Mercury (read-only). But the returned URL grants unauthenticated access to the document for ~12 hours to anyone who holds it — treat the response as a secret and do not echo it further than needed.
RETURNS: { transactionId, attachmentCount, attachments: [{ fileName, attachmentType, url }] }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fileName | No | Return only the attachment with this exact file name. Omit to return all. | |
| accountId | Yes | The Mercury account ID | |
| transactionId | Yes | The transaction ID |