> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.transxact.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.transxact.io/_mcp/server.

# Send an Invoice

POST https://api.transxact.io/v1/invoices/{id}/send

Releases a draft: assigns its Invoice number (from your prefix and counter in Settings) and makes its `url` work for the Customer. Transxact does not email it for you here; share the `url`, or email it from the dashboard. A sent Invoice can't be edited; void it and make another. The `Idempotency-Key` header is required: a retry returns the sent Invoice and uses no second number.

Reference: https://docs.transxact.io/api-reference/invoices/send

## Authentication

- `Authorization` header (bearer token, required) — Your secret key: sk_test_... in Test mode, sk_live_... in Live mode.

## Request

### Path parameters

- `id` (integer, optional) — Invoice identifier.

### Headers

- `idempotency-key` (string, required) — Client-generated key; a repeated key returns the original result instead of repeating the change.

## Response

### 200

The sent Invoice, or the original result of a retried key.

- `id` (integer, required) — Invoice identifier.
- `number` (string, required, nullable) — The Invoice number, such as `INV-0007`. Assigned when the Invoice is sent, so a draft has none; numbers are never reused.
- `status` (enum, required) — `draft` until sent and editable only from the dashboard. `sent`: the Customer can pay it. `paid`: paid in full. `void`: you voided it; it can no longer be paid.
  - Allowed values: `draft`, `sent`, `paid`, `void`
- `overdue` (boolean, required) — A sent, unpaid Invoice past its due date (Pacific/Fiji). Derived, not a status; the Customer can still pay.
- `mode` (enum, required) — `test` for an Invoice made with an `sk_test_` key, `live` for an `sk_live_` key.
  - Allowed values: `test`, `live`
- `customerName` (string, required) — Who you billed.
- `customerEmail` (string, required, nullable) — The Customer's email, if you gave one.
- `items` (list of InvoiceItem, required) — The line items, excluding tax.
- `taxLabel` (string, required, nullable) — Label of the tax line; null if none.
- `taxPercent` (double, required) — 0 when there is no tax line.
- `vatNumber` (string, required, nullable) — Your VAT number, if you gave one.
- `dueDate` (string, required) — `YYYY-MM-DD`, Pacific/Fiji.
- `subtotal` (integer, required) — Sum of the line items, in FJD cents (minor units).
- `tax` (integer, required) — The tax line, in FJD cents (minor units).
- `total` (integer, required) — Amount due; under FJD 5,000.00, in FJD cents (minor units).
- `url` (string, required) — The hosted page the Customer opens and pays on. Works once the Invoice is sent.
- `pdfUrl` (string, required, nullable) — Where to `GET` the PDF, with your secret key. Null on a draft.
- `createdAt` (integer, required) — Unix ms timestamp the draft was created.
- `sentAt` (integer, required, nullable) — Unix ms timestamp it was sent; null on a draft.
- `paidAt` (integer, required, nullable) — Unix ms timestamp it was paid; null until then.

## Errors

### 400 Bad Request Error

Refused (`invalid_request`), such as a total over the cap.

- `error` (ErrorError, required) — Branch on `code`; `message` is for logs.

### 401 Unauthorized Error

Invalid or missing API key.

- `error` (ErrorError, required) — Branch on `code`; `message` is for logs.

### 403 Forbidden Error

The account is not a Business account (`business_only`).

- `error` (ErrorError, required) — Branch on `code`; `message` is for logs.

### 404 Not Found Error

No such Invoice for this Merchant and mode.

- `error` (ErrorError, required) — Branch on `code`; `message` is for logs.

### 409 Conflict Error

The Invoice was not a draft (`invalid_state`).

- `error` (ErrorError, required) — Branch on `code`; `message` is for logs.

## Types

### InvoiceItem

- `description` (string, required) — What it is, up to 200 characters.
- `quantity` (integer, required) — Whole units, 1 to 9999.
- `unitPrice` (integer, required) — Price of one unit, excluding tax, in FJD cents (minor units).

### ErrorError

Branch on `code`; `message` is for logs.

- `code` (string, required) — Stable machine-readable error code.
- `message` (string, required) — Human-readable detail, not contractual.

## Examples

**Response**

```json
{
  "id": 42,
  "number": "INV-0007",
  "status": "sent",
  "overdue": false,
  "mode": "test",
  "customerName": "Mere Tuilagi",
  "customerEmail": "mere@example.com",
  "items": [
    {
      "description": "Tiling, kitchen",
      "quantity": 2,
      "unitPrice": 12000
    }
  ],
  "taxLabel": "VAT",
  "taxPercent": 15,
  "vatNumber": null,
  "dueDate": "2026-11-30",
  "subtotal": 24000,
  "tax": 3600,
  "total": 27600,
  "url": "https://transxact.io/i/k3j2h1g0f9e8d7c6",
  "pdfUrl": "https://api.transxact.io/v1/invoices/42/pdf",
  "createdAt": 1717086400000,
  "sentAt": 1717086400000,
  "paidAt": null
}
```

**SDK Code**

```python
import requests

url = "https://api.transxact.io/v1/invoices/42/send"

headers = {
    "idempotency-key": "a1b2c3d4-order-9912",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.transxact.io/v1/invoices/42/send';
const options = {
  method: 'POST',
  headers: {'idempotency-key': 'a1b2c3d4-order-9912', Authorization: 'Bearer <token>'}
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.transxact.io/v1/invoices/42/send"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("idempotency-key", "a1b2c3d4-order-9912")
	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.transxact.io/v1/invoices/42/send")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["idempotency-key"] = 'a1b2c3d4-order-9912'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.transxact.io/v1/invoices/42/send")
  .header("idempotency-key", "a1b2c3d4-order-9912")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.transxact.io/v1/invoices/42/send', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'idempotency-key' => 'a1b2c3d4-order-9912',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.transxact.io/v1/invoices/42/send");
var request = new RestRequest(Method.POST);
request.AddHeader("idempotency-key", "a1b2c3d4-order-9912");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "idempotency-key": "a1b2c3d4-order-9912",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.transxact.io/v1/invoices/42/send")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```