# POST /invoices/:invoice_id/send-to-xero

**Resource:** [Invoices](./invoices.md)  
**MCP tool:** `send_invoice_to_xero`  
**Scopes:** `invoices:write`  
**Write operation:** yes

Put a TrustPager invoice (source_platform native) into the workspace's connected Xero, so the books match, without emailing anyone. Use it for an invoice already emailed or already paid (for example paid by bank transfer before it reached Xero, so the deposit has an invoice to reconcile against). The invoice becomes the Xero invoice: source_platform becomes xero, while its lines, opportunity, contact, designed page and pay page stay. An invoice the customer already has (emailed or paid) keeps its number in Xero; otherwise Xero gives it its own number. Xero sends no email. An invoice with payments recorded needs payment_account_id, the Xero bank account the money went into (list them with query_integration, query xero_accounts, type BANK): it goes in approved and the payment is recorded in Xero against that account, so Xero shows it paid and the bank deposit is matched to that payment when reconciling. GST follows how the invoice was made (included, added, or none). Each line posts to its account_code, else the workspace default (200). A draft goes to Xero as a draft, an open invoice as approved. You rarely need this for a new invoice: in a Xero workspace create_invoice puts it in Xero, and send_invoice puts it in Xero before emailing. Refused when Xero is not connected, the invoice has no contact, is already in Xero, or is void.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `invoice_id` | path | string | yes |  |
| `xero_integration_id` | body | string | no | Xero organisation - the connected Xero organisation to put the invoice in (its id from list_integrations, platform xero). Only needed when the workspace has more than one Xero organisation connected: left out, the organisation the invoice was made for is used, then the invoice design’s, then the workspace default. |
| `payment_account_id` | body | string | no | Needed only when the invoice has payments recorded: the Xero AccountID of the bank account the money went into (query_integration, query xero_accounts, type BANK). The payment is recorded in Xero against it. |
| `require_approval` | body | boolean | no | Optional. Set true to route this write into the approval queue for human review instead of executing it immediately (returns 202 + an approval_id). Works even when your key/token has permission to execute directly. |

## Request example

```bash
curl -X POST   "https://api.trustpager.com/functions/v1/api/v1/invoices/:invoice_id/send-to-xero"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"require_approval":"..."}'
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`