Invoice attachment access (pre-signed URLs)

Downloads invoice attachments via 1-hour pre-signed S3 URLs. Useful for documentary audits or compliance verifications.

โ†“ Download skill (.md)
86/100ยท๐Ÿ” Ad hocยทIntermediateControllerAP Manager
ComplianceReconciliationget_payable_attachments

๐ŸŽฏ Skill purpose

Downloads invoice attachments via 1-hour pre-signed S3 URLs. Useful for documentary audits or compliance verifications.

๐Ÿ“Š What it produces

1-hour valid access URLs for all attachments on the invoice, ready to open.

โšก Benefit

Before

Manual download from the Spendesk UI, one file at a time.

After

Direct access to attachment URLs, ready to share or archive in bulk.



# Instructions โ€” Access to supporting documents

## โš ๏ธ URLs with a limited lifetime: 1 hour

URLs returned by `get_payable_attachments` are **pre-signed AWS S3 links**.

```
X-Amz-Expires=3600 โ†’ expires 1 hour after generation
```

**Never:**
- Store these URLs in a database
- Cache them in a long conversational context
- Pass them to a third-party system that would use them later

**Always:** share the URL immediately and tell the user it expires in 1h.

## โš ๏ธ Tool cache = 3300s (55min)

The tool itself is cached for 55 minutes.
If the URL was retrieved at the start of the cache window, it will only have **5 minutes** left at the end of the cache window.
โ†’ For interactive use, don't hesitate to call the tool again if the time between two uses exceeds 30 minutes.

## Step 1 โ€” Get the payableId

Call `get_payables` with the appropriate filter to find the target payable.
```json
{
  "companyId": "...",
  "filters": { "field": "documentaryEvidenceStatus", "operator": "=", "value": ["provided"] },
  "pageSize": 20
}
```
โ†’ Extract the `id` field of the payable you're interested in.

## Step 2 โ€” Retrieve the attachments

```json
{ "companyId": "...", "payableId": "<payable-id>" }
```

## Step 3 โ€” Interpret the fields

For each attachment:
- `url`: direct download link (valid for 1h) โ€” to share immediately
- `mimetype`: MIME type (`image/jpeg`, `application/pdf`, `image/png`, etc.) โ€” inform the user
- `checksum`: MD5 hash of the file for integrity verification
- `attachedAt`: attachment date (format `YYYY-MM-DD`, not datetime)

## Step 4 โ€” Present the result

```
Supporting document found for invoice [description]:
- Type: image/jpeg
- Attached on: 2023-01-11
- Download link: [URL]
โš ๏ธ This link expires in 1 hour. After expiry, call the command again to get a new link.
```

## Live example (real data)

```json
{
  "mimetype": "image/jpeg",
  "checksum": "107fc4b2a439cbeb84c91c9764b9744d",
  "attachedAt": "2023-01-11",
  "url": "https://spx-production.s3.eu-west-1.amazonaws.com/invoices/nTtrU1GKV_5633342?X-Amz-Expires=3600..."
}
```
โ†’ S3 bucket: `spx-production.s3.eu-west-1.amazonaws.com` (EU region)
โ†’ Expiry: 3600s confirmed live

## Example prompt

- "Show me the supporting document for the Airbnb invoice" โ†’ get_payables search + get_payable_attachments
- "Download the PDF of last month's Oracle invoice" โ†’ filter supplier + get_payable_attachments
- "Check that the attachment isn't corrupted" โ†’ compare local checksum vs API checksum

How to install this skill

/
  1. 1
    Download the file s21-payable-attachments-url-expiry.md using the button above.
  2. 2
    Place the file in the .claude/ directory of your project (or ~/.claude/ for a global install).
    cp s21-payable-attachments-url-expiry.md .claude/s21-payable-attachments-url-expiry.md
  3. 3
    Use in Claude Code โ€” the skill is automatically discovered. Describe your need in natural language and Claude will apply the skill instructions.
๐Ÿ’ก Make sure the Spendesk MCP is configured in your .claude/settings.json with the tools get_payable_attachments.

Similar skills

โ˜… Top
95/100ยท๐Ÿ” Ad hocยทExpert

MCP coverage audit & gap analysis

Probes all available MCP tools, re-evaluates coverage of 50 persona use cases, detects new fields or tools, and regenerates the gap analysis report.

CFOControllerAP Manager
90/100ยท๐Ÿ“… WeeklyยทBeginner

Card requests via get_requests

Explains how to use get_requests for card requests and why expense reimbursements don't appear there. Avoids a frequent source of confusion between two distinct workflows.

ControllerFinance Analyst
90/100ยท๐Ÿ” Ad hocยทIntermediate

Active vs archived cost centers

Distinguishes active cost centers from archived ones with correct use of get_cost_centers. Avoids the counter-intuitive isArchived vs isActive naming convention pitfall.

ControllerFinance Analyst