Full invoice detail (get_payable_by_id)

Gets the complete detail of a specific invoice by ID via get_payable_by_id. Includes accounting codes, resolved supplier, and analytical fields.

โ†“ Download skill (.md)
87/100ยท๐Ÿ” Ad hocยทBeginnerControllerAP Manager
ReconciliationERP exportget_payable_by_id

๐ŸŽฏ Skill purpose

Gets the complete detail of a specific invoice by ID via get_payable_by_id. Includes accounting codes, resolved supplier, and analytical fields.

๐Ÿ“Š What it produces

Full invoice record: amount, supplier, accounting codes, analytics, and action history.

โšก Benefit

Before

Navigation across multiple Spendesk screens to reconstruct the full detail of an invoice.

After

Complete invoice record in a single call, with all metadata.



# Full detail of an invoice (get_payable_by_id)

## Flow: get_payables โ†’ ID โ†’ get_payable_by_id

Do not search by invoice number directly โ€” first resolve the ID via `get_payables`:

### Step 1 โ€” Find the invoice ID

```json
{
  "companyId": "<companyId>",
  "filters": {
    "field": "documentaryEvidenceNumber",
    "operator": "=",
    "value": "INV-2026-001"
  },
  "pageSize": 5
}
```

Or via description:
```json
{ "field": "description", "operator": "contains", "value": "CBS Consultant" }
```

โ†’ Extract the `id` from the returned payable (e.g. `5c902f76-c87e-59a6-8bb8-4e70fbd1dd39`)

### Step 2 โ€” Enriched detail

```json
{
  "id": "5c902f76-c87e-59a6-8bb8-4e70fbd1dd39"
}
```

## What get_payable_by_id adds vs get_payables

| Information | get_payables | get_payable_by_id |
|-------------|--------------|-------------------|
| Supplier name | โŒ (only supplierId) | โœ… `counterparty.name` |
| Accounting account code | โŒ (only expenseAccountId) | โœ… `lineItems[].expenseAccount.code + description` |
| VAT account code | โŒ (only taxAccountId) | โœ… `lineItems[].vatAccount.code + description` |
| Analytics name | โŒ (only fieldEntityValueId) | โœ… `analyticalProperties[].valueName` |
| Cost center name | โŒ (in analyticalFieldAssociations) | โœ… `costCenterName` (at root) |
| Team name | โŒ | โœ… `teamName` |
| Amortization | โŒ | โœ… `amortisation` (null if absent) |
| Supplier AP code | โŒ | โœ… `counterparty.accountPayable.generalAccountCode` |

Example of an enriched response:
```json
{
  "counterparty": {
    "id": "76r950em3qde5o",
    "type": "supplier",
    "name": "Think Software",                          // โ† resolved name
    "accountPayable": {
      "generalAccountCode": "Think Software",          // โ† AP code
      "auxiliaryAccountCode": ""
    }
  },
  "lineItems": [{
    "expenseAccount": {
      "code": "622800",
      "description": "622800 - Other fees and intermediaries"  // โ† resolved account
    },
    "vatAccount": { "code": "445660", "rate": 20 },   // โ† resolved VAT
    "analyticalProperties": [{
      "fieldName": "Analytic codes",
      "valueName": "Banking investments"               // โ† resolved analytics
    }],
    "costCenterName": "X-old Banking"                  // โ† resolved cost center
  }],
  "teamName": "Banking"
}
```

## โš ๏ธ Different naming between get_payables and get_payable_by_id

Both endpoints use different field names for the same data:

| Concept | get_payables | get_payable_by_id |
|---------|--------------|-------------------|
| Accounting status | `state` | `bookkeepingStatus` |
| Detail lines | `itemLines[]` | `lineItems[]` |
| Spendesk entry date | `firstCreatedAt` | `createdAt` |
| ERP export date | `firstExportedAt` | `exportedAt` |
| User ID | `memberId` | `userId` |
| Due date | `dueDate` | `invoiceDueDate` |
| Document date | `creationDate` (datetime) | `payableDate` (date) |

โ†’ If your code handles both types of response, adapt field names according to the endpoint called.

## What is ABSENT from get_payable_by_id

`get_payable_by_id` does not return:
- `spendingAmount` / `spendingCurrency` / `spendingExchangeRate` โ€” for the original spending currency, use `get_payables`
- Full `documentaryEvidence` (validity, compliances) โ€” `invoiceNumber` is at the root but the validation structure is not there
- `kind` field (`expense` vs `reversal`)

## When to use which?

| Need | Recommended tool |
|--------|-----------------|
| List + filter invoices | `get_payables` |
| Resolved names (supplier, accounts, analytics) | `get_payable_by_id` |
| Original spending currency (spendingAmount) | `get_payables` |
| Amortization / full GL codes | `get_payable_by_id` |

## Example prompts

- "Show me the full detail of the CBS Consultant invoice with the accounting codes"
- "What is the expense account code of the Docusign invoice?"
- "Show the analytics and cost center of invoice INV-2026-001"

How to install this skill

/
  1. 1
    Download the file s20-detail-complet-facture.md using the button above.
  2. 2
    Place the file in the .claude/ directory of your project (or ~/.claude/ for a global install).
    cp s20-detail-complet-facture.md .claude/s20-detail-complet-facture.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_by_id.

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