> ## Documentation Index
> Fetch the complete documentation index at: https://mcp.docs.relayfi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# get_invoice — Retrieve a single invoice

> Reference for the get_invoice MCP tool. Fetch one invoice with line items, taxes, discounts, totals, and links by its ID.

The `get_invoice` tool returns a single invoice by `invoiceId` within an organization, including line items, taxes, discounts, totals, and links. `intent`, `organizationId`, and `invoiceId` are required, and the token must carry the `invoices.read` scope.

> [!NOTE]
>
> Receivables tools require the organization to have invoicing set up in Relay. If it does not, the tool returns an error instead of data.

## Scope

Required OAuth scope: `invoices.read`

## Input

**organizationId** `string` *required*

The organization that owns the invoice. Must be one of the organizations the token can access.

**invoiceId** `string` *required*

The unique invoice identifier to retrieve.

**intent** `string` *required*

What the user asked for and why this call serves it, in 1 to 500 characters. Required on every tool call. See [Common tool arguments](https://mcp.docs.relayfi.com/concepts/transport.md#common-tool-arguments).

## Output

**data** `Invoice` *required*

The requested invoice.

**Invoice**

**id** `string` *required*

Unique invoice identifier. Use this value as `invoiceId`.

**organizationId** `string` *required*

Organization the invoice belongs to.

**status** `string` *required*

Invoice status. Values: `DRAFT`, `UNSENT`, `SENT`, `PROCESSING`, `PAID`, `OVERDUE`, `CANCELLED`, `SCHEDULED`, `PAYMENT_FAILED`.

**invoiceNumber** `string` *required*

Invoice number shown to the payer.

**contactId** `string` *required*

Contact the invoice is billed to. Pass to `get_contact` for details.

**memo** `string` *required*

Memo shown on the invoice.

**dueDate** `string` *required*

Due date in `YYYY-MM-DD` format.

**lineItems** `LineItem[]` *required*

Line items on the invoice.

**LineItem**

**description** `string` *required*

Description of the line item.

**quantity** `number` *required*

Quantity billed.

**unitPrice** `Money` *required*

Unit price as a [Money](https://mcp.docs.relayfi.com/concepts/results.md#money) object, rounded to cents.

**unitPriceDecimal** `string` *required*

Exact unit price as a decimal string.

**total** `Money` *required*

Line total.

**catalogItemId** `string | null` *required*

Catalog item the line was created from, if any.

**taxes** `object[]` *required*

Taxes applied to this line.

**discounts** `Discount[]` *required*

Discounts applied to this line.

**Discount**

**type** `string` *required*

Discount type. Values: `PERCENTAGE`, `FIXED`.

**percentage** `number`

Percentage off. Present when `type` is `PERCENTAGE`.

**amount** `Money`

Fixed amount off as a [Money](https://mcp.docs.relayfi.com/concepts/results.md#money) object. Present when `type` is `FIXED`.

**discounts** `Discount[]` *required*

Discounts applied to the whole invoice.

**Discount**

**type** `string` *required*

Discount type. Values: `PERCENTAGE`, `FIXED`.

**percentage** `number`

Percentage off. Present when `type` is `PERCENTAGE`.

**amount** `Money`

Fixed amount off as a [Money](https://mcp.docs.relayfi.com/concepts/results.md#money) object. Present when `type` is `FIXED`.

**lineItemTotal** `Money` *required*

Sum of line totals before invoice-level discounts and taxes.

**discountTotal** `Money` *required*

Total of all discounts.

**taxTotal** `Money` *required*

Total of all taxes.

**grandTotal** `Money` *required*

Amount due on the invoice.

**issuedAt** `string | null` *required*

Timestamp when the invoice was issued, in RFC 3339 format.

**sentAt** `string | null` *required*

Timestamp when the invoice was sent, in RFC 3339 format.

**paidAt** `string | null` *required*

Timestamp when the invoice was paid, in RFC 3339 format.

**createdAt** `string` *required*

Timestamp when the invoice was created, in RFC 3339 format.

**updatedAt** `string` *required*

Timestamp when the invoice was last updated, in RFC 3339 format.

**editUrl** `string` *required*

Link that opens the invoice in Relay. Always present. Pass it to the user exactly as returned.

**portalUrl** `string | null` *required*

Payer-facing link to view and pay the invoice. `null` for `DRAFT` invoices and may be `null` for some older invoices.

## Example

```json Request theme={null}
{
  "jsonrpc": "2.0",
  "id": 15,
  "method": "tools/call",
  "params": {
    "name": "get_invoice",
    "arguments": {
      "intent": "User asked for the total and payment link for invoice INV-0042.",
      "organizationId": "org_1",
      "invoiceId": "inv_1"
    }
  }
}
```

```json Response theme={null}
{
  "jsonrpc": "2.0",
  "id": 15,
  "result": {
    "structuredContent": {
      "data": {
        "id": "inv_1",
        "organizationId": "org_1",
        "status": "SENT",
        "invoiceNumber": "INV-0042",
        "contactId": "ct_1",
        "memo": "September consulting",
        "dueDate": "2026-10-31",
        "lineItems": [
          {
            "description": "Consulting hour",
            "quantity": 10,
            "unitPrice": {
              "cents": 15000,
              "display": "150.00",
              "currency": "USD"
            },
            "unitPriceDecimal": "150.00",
            "total": {
              "cents": 150000,
              "display": "1,500.00",
              "currency": "USD"
            },
            "catalogItemId": "item_1",
            "taxes": [],
            "discounts": []
          }
        ],
        "discounts": [
          {
            "type": "PERCENTAGE",
            "percentage": 10
          }
        ],
        "lineItemTotal": {
          "cents": 150000,
          "display": "1,500.00",
          "currency": "USD"
        },
        "discountTotal": {
          "cents": 15000,
          "display": "150.00",
          "currency": "USD"
        },
        "taxTotal": {
          "cents": 0,
          "display": "0.00",
          "currency": "USD"
        },
        "grandTotal": {
          "cents": 135000,
          "display": "1,350.00",
          "currency": "USD"
        },
        "issuedAt": "2026-10-01T14:00:00.000Z",
        "sentAt": "2026-10-01T14:05:00.000Z",
        "paidAt": null,
        "createdAt": "2026-09-30T18:12:00.000Z",
        "updatedAt": "2026-10-01T14:05:00.000Z",
        "editUrl": "https://app.relayfi.com/<invoice-link>",
        "portalUrl": "https://app.relayfi.com/<payer-link>"
      }
    }
  }
}
```

## Notes

* Always pass `editUrl` to the user exactly as returned. Do not construct or modify invoice links.
* `portalUrl` is the payer-facing link. It is `null` for `DRAFT` invoices and may be `null` for some older invoices.
* If the invoice does not exist or is not accessible with the provided token, the tool returns an MCP error: `Invoice not found or not accessible.`

> [card] [list\_invoices](https://mcp.docs.relayfi.com/tools/list-invoices.md)
>
> Search and list invoices.

> [card] [get\_contact](https://mcp.docs.relayfi.com/tools/get-contact.md)
>
> Look up the contact an invoice is billed to.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.