# Tie An Invoice To An Entry Already Booked

> Solarium docs, Invoices. All requests are `POST https://api.trysolarium.com/graphql/` with `Authorization: Bearer <api key>` and a JSON body `{"query": ..., "variables": ...}`. Every query and mutation takes an `organizationId` (find it with `myOrganizations`). Index of all pages: https://trysolarium.com/llms.txt

For an invoice whose A/R you already booked by hand. The draft uses that entry as its booking, so the A/R is never counted twice. Nothing new is posted, pushed to QuickBooks or emailed.

### Arguments

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `params.invoice_id` | `String!` | Yes | A draft invoice |
| `params.event_id` | `String!` | Yes | The entry already booked for it: DR A/R for the invoice total, with the same tax, customer, currency and date |
| `params.date_tolerance_days` | `Int` | No | Days the entry's date may differ from the invoice's issue date (default 0). The preview shows the difference |
| `apply` | `Boolean` | No | true to tie them |

### Request

```graphql
mutation {
  previewOp(organizationId: "a1b2c3d4-...", name: "link_invoice_to_entry",
            params: { invoice_id: "9f3c...", event_id: "77e7...", date_tolerance_days: 1 }) { success result }
}
```

### Response

```json
{
  "data": {
    "previewOp": {
      "success": true,
      "result": {
        "summary": "INV-00031 For Harbour Rentals: CAD 1130.00 (Tax 130.00), Tied To The A/R Entry Already Booked On 2026-11-20. Nothing New Is Booked And No Email Goes Out.",
        "warnings": [
          "The Entry Is Dated 2026-11-20, 1 Day From The Invoice's 2026-11-21.",
          "The Entry Had No Customer. It's Now Tagged To Harbour Rentals."
        ],
        "data": {
          "status": "sent",
          "ledger_event_id": "77e7...",
          "adopted": { "event_id": "77e7...", "ar_amount": "1130.00", "tax_amount": "130.00", "contact_set": true, "date_difference_days": 1 }
        }
      }
    }
  }
}
```
