> For the complete documentation index, see [llms.txt](https://tri.gitbook.io/tri-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tri.gitbook.io/tri-doc/liquidity-pool/create-invoice.md).

# Create Invoice

### Liquidity Pool

<mark style="color:green;">`POST`</mark> <https://sandbox.triangle.digital/api/v2/liquidity\\_pool/clients/{client\\_id}/invoices/create\\_invoice>

Adds Carbon Pool invoices of the client, several per call. An invoice can be sent either as a total per expense type or itemized — one line per expense, with the fields Air Travel and Lodging carry of their own — see `expense_lines` below. The answer lists the created invoices in the shape of [Get Invoices](/tri-doc/liquidity-pool/get-invoices.md).

**Path parameters**

<table data-full-width="true" data-search="false"><thead><tr><th width="230">Name</th><th width="110">Type</th><th>Description</th><th width="210">Where to take it from</th></tr></thead><tbody><tr><td><code>client_id</code></td><td>integer</td><td><strong>Required.</strong> The client the invoices belong to.</td><td><a href="/tri-doc/liquidity-pool/get-clients.md">Get Clients</a> — <code>client_id</code></td></tr></tbody></table>

**Headers**

<table data-full-width="true"><thead><tr><th>Name</th><th>Value</th></tr></thead><tbody><tr><td>Content-Type</td><td><code>application/json</code></td></tr></tbody></table>

**Body**

<table data-full-width="true" data-search="false"><thead><tr><th width="200">Name</th><th width="110">Type</th><th>Description</th><th width="260">Example</th></tr></thead><tbody><tr><td><code>hash</code></td><td>string</td><td><strong>Required.</strong> API key.</td><td>fk5f0iuy-rr06-j4x3-i75b-fy2s67s4ilo1</td></tr><tr><td><code>invoices</code></td><td>array</td><td><strong>Required.</strong> One object per invoice, fields below.</td><td></td></tr><tr><td><code>invoices[].invoice_number</code></td><td>string</td><td>Invoice number — the client assigns the value, as used in its own systems.</td><td>56WFFS23</td></tr><tr><td><code>invoices[].employee_number</code></td><td>string</td><td>Client-facing Employee ID — the client assigns the value, as used in its own systems; the <code>employee_number</code> of <a href="/tri-doc/liquidity-pool/get-employees.md">Get Employees</a>.</td><td>D2354324</td></tr><tr><td><code>invoices[].employee_name</code></td><td>string</td><td><strong>Required.</strong> Employee of the invoice.</td><td>John Smith</td></tr><tr><td><code>invoices[].transaction_date</code></td><td>string</td><td>Invoice date, MM/DD/YYYY.</td><td>07/07/2026</td></tr><tr><td><code>invoices[].transaction_type</code></td><td>string</td><td>One of: <code>business_travel</code>, <code>employee_commuting</code>, <code>purchased_goods_and_services</code>.</td><td>business_travel</td></tr><tr><td><code>invoices[].ai_compute</code> / <code>air_travel</code> / <code>vehicle</code> / <code>lodging</code> / <code>food</code></td><td>object</td><td>Per expense type — <code>co2</code> (tons, number) and <code>amount</code> (USD, number).</td><td><pre class="language-json"><code class="lang-json">{
  "co2": 3.0,
  "amount": 1.0
}
</code></pre></td></tr><tr><td><code>invoices[].expense_lines</code></td><td>array</td><td>Itemized form of the invoice: one object per expense line, several lines of the same expense type allowed. When it is sent, the per-expense-type objects above are ignored and each type's <code>co2</code> and <code>amount</code> are the SUM of its lines.</td><td></td></tr><tr><td><code>invoices[].expense_lines[].expense_type</code></td><td>string</td><td><strong>Required.</strong> One of: <code>ai_compute</code>, <code>air_travel</code>, <code>vehicle</code>, <code>lodging</code>, <code>food</code>.</td><td>air_travel</td></tr><tr><td><code>invoices[].expense_lines[].amount</code></td><td>number</td><td>USD of this line.</td><td>1.0</td></tr><tr><td><code>invoices[].expense_lines[].co2</code></td><td>number</td><td>Tons of CO<sub>2</sub> of this line. <strong>Not accepted for <code>ai_compute</code></strong>: the CO<sub>2</sub> of that line is computed by the platform from <code>provider</code>, <code>model_name</code> and <code>output_token_count</code>, and is <code>0</code> when those are not all filled in.</td><td>3.0</td></tr><tr><td><code>invoices[].expense_lines[].date</code></td><td>string</td><td>Air Travel and Lodging. Date of the flight or of the stay, MM/DD/YYYY.</td><td>09/01/2026</td></tr><tr><td><code>invoices[].expense_lines[].flight_origin</code></td><td>string</td><td>Air Travel only. Airport or city the flight departs from.</td><td>JFK</td></tr><tr><td><code>invoices[].expense_lines[].destination</code></td><td>string</td><td>Air Travel only. Airport or city the flight arrives at.</td><td>LHR</td></tr><tr><td><code>invoices[].expense_lines[].provider</code></td><td>string</td><td>Air Travel and Lodging — airline or hotel of the line. AI Compute — the AI provider, a <code>value</code> of <a href="/tri-doc/liquidity-pool/carbon-equivalent-reporting/ai-compute/get-ai-compute-providers.md">Get AI Compute Providers</a>.</td><td>Delta</td></tr><tr><td><code>invoices[].expense_lines[].distance_miles</code></td><td>number</td><td>Air Travel only. Distance in miles, up to 4 decimal places.</td><td>3450</td></tr><tr><td><code>invoices[].expense_lines[].round_trip</code></td><td>boolean</td><td>Air Travel only. Whether the flight is a round trip.</td><td>true</td></tr><tr><td><code>invoices[].expense_lines[].nights</code></td><td>integer</td><td>Lodging only. Number of nights, a whole number.</td><td>3</td></tr><tr><td><code>invoices[].expense_lines[].region</code></td><td>string</td><td>Lodging only. Region of the stay.</td><td>EMEA</td></tr><tr><td><code>invoices[].expense_lines[].model_name</code></td><td>string</td><td>AI Compute only. Model of the chosen provider — a value of <a href="/tri-doc/liquidity-pool/carbon-equivalent-reporting/ai-compute/get-ai-compute-models.md">Get AI Compute Models</a>.</td><td>claude-opus-4-20250514</td></tr><tr><td><code>invoices[].expense_lines[].output_token_count</code></td><td>integer</td><td>AI Compute only. Number of output tokens generated, a whole number of 0 or more.</td><td>1324345</td></tr></tbody></table>

```json
{
  "hash": "fk5f0iuy-rr06-j4x3-i75b-fy2s67s4ilo1",
  "invoices": [
    {
        "invoice_number": "56WFFS23",
        "employee_number": "D2354324",
        "employee_name": "John Smith",
        "transaction_date": "07/07/2026",
        "transaction_type": "business_travel",
        "ai_compute": {
            "co2": 0.0,
            "amount": 0.0
        },
        "air_travel": {
            "co2": 3.0,
            "amount": 1.0
        },
        "vehicle": {
            "co2": 0.0,
            "amount": 0.0
        },
        "lodging": {
            "co2": 0.0,
            "amount": 0.0
        },
        "food": {
            "co2": 0.0,
            "amount": 0.0
        },
        "expense_lines": [
            {
                "expense_type": "air_travel",
                "amount": 1.0,
                "co2": 3.0,
                "date": "09/01/2026",
                "flight_origin": "JFK",
                "destination": "LHR",
                "provider": "Delta",
                "distance_miles": 3450,
                "round_trip": true
            },
            {
                "expense_type": "ai_compute",
                "provider": "anthropic",
                "model_name": "claude-opus-4-20250514",
                "output_token_count": 1324345
            },
            {
                "expense_type": "lodging",
                "amount": 0.0,
                "co2": 0.0,
                "date": "09/02/2026",
                "nights": 3,
                "region": "EMEA",
                "provider": "Hilton"
            }
        ]
    }
  ]
}
```

**Response fields**

<table data-full-width="true" data-search="false"><thead><tr><th width="300">Field</th><th width="110">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>message</code></td><td>string</td><td>Human-readable result of the call.</td></tr><tr><td><code>success</code></td><td>boolean</td><td>Whether the invoices were created; a refused call answers HTTP 400.</td></tr><tr><td><code>data[]</code></td><td>object</td><td>The created invoices — the same row shape as <a href="/tri-doc/liquidity-pool/get-invoices.md">Get Invoices</a>, including <code>invoice_id</code>.</td></tr><tr><td><code>errors</code></td><td>object</td><td>400 only — validation problems keyed by the invoice's position in <code>invoices</code>; each problem names the field.</td></tr><tr><td><code>operations_count</code></td><td>integer</td><td>Always <code>1</code>.</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}
{% code fullWidth="false" %}

```json
{
    "message": "Invoices created successfully.",
    "success": true,
    "data": [
        {
            "invoice_id": 61,
            "invoice_number": "56WFFS23",
            "employee_id": 18,
            "employee_number": "D2354324",
            "employee_name": "John Smith",
            "transaction_date": "07/07/2026",
            "transaction_type": "business_travel",
            "credit_card": false,
            "ai_compute": {
                "co2": 0.0,
                "amount": 0.0
            },
            "air_travel": {
                "co2": 3.0,
                "amount": 1.0
            },
            "vehicle": {
                "co2": 0.0,
                "amount": 0.0
            },
            "lodging": {
                "co2": 0.0,
                "amount": 0.0
            },
            "food": {
                "co2": 0.0,
                "amount": 0.0
            },
            "expense_lines": [
                {
                    "expense_type": "air_travel",
                    "amount": 1.0,
                    "co2": 3.0,
                    "date": "09/01/2026",
                    "flight_origin": "JFK",
                    "destination": "LHR",
                    "provider": "Delta",
                    "distance_miles": 3450,
                    "round_trip": true
                }
            ],
            "total_co2": 3.0
        }
    ],
    "operations_count": 1
}
```

{% endcode %}
{% endtab %}

{% tab title="400" %}
A field is not valid — `errors` carries the problems per invoice; or the hash is unknown.

```json
{
    "message": "Error! No such hash.",
    "success": false
}
```

{% endtab %}
{% endtabs %}
