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

# Create AR Invoice

POST https://connect.plex.com/accounting/v1/ar-invoices
Content-Type: application/json

Create a new AR invoice.

Reference: https://rockwell.ferndocs.com/api-reference/accounts-receivable-invoices-api/create-ar-invoice

## Request

### Body (application/json)

This endpoint expects an object.

- `customerId` (string, optional)
- `customerName` (string, optional)
- `invoiceDate` (datetime, optional)
- `invoiceType` (string, optional)
- `paymentTerms` (string, optional)
- `currency` (string, optional)
- `subtotal` (integer, optional)
- `taxAmount` (integer, optional)
- `totalAmount` (integer, optional)

## Response

### 201

201 Created - AR Invoice Successfully Created

- `id` (string, optional)
- `customerId` (string, optional)
- `customerName` (string, optional)
- `invoiceDate` (date, optional)
- `dueDate` (date, optional)
- `currency` (string, optional)
- `status` (string, optional)
- `paymentTerms` (string, optional)
- `referenceNumber` (string, optional)
- `notes` (string, optional)
- `lineItems` (list of AccountingV1ArInvoicesPostResponsesContentApplicationJsonSchemaLineItemsItems, optional)
- `subtotal` (integer, optional)
- `taxTotal` (double, optional)
- `totalAmount` (double, optional)
- `createdAt` (datetime, optional)
- `updatedAt` (datetime, optional)

## Errors

### 400 Bad Request Error

400 Bad Request - Validation Error

- `error` (AccountingV1ArInvoicesPostResponsesContentApplicationJsonSchemaError, optional)

### 401 Unauthorized Error

401 Unauthorized - Missing or Invalid Bearer Token

- `error` (AccountingV1ArInvoicesPostResponsesContentApplicationJsonSchemaError, optional)

### 404 Not Found Error

404 Not Found - Referenced Customer Not Found

- `error` (AccountingV1ArInvoicesPostResponsesContentApplicationJsonSchemaError, optional)

### 500 Internal Server Error

500 Internal Server Error - Server-Side Error

- `error` (AccountingV1ArInvoicesPostResponsesContentApplicationJsonSchemaError, optional)

## Types

### AccountingV1ArInvoicesPostResponsesContentApplicationJsonSchemaLineItemsItems

- `lineId` (string, optional)
- `description` (string, optional)
- `quantity` (integer, optional)
- `unitPrice` (double, optional)
- `taxCode` (string, optional)
- `taxRate` (double, optional)
- `amount` (integer, optional)

### AccountingV1ArInvoicesPostResponsesContentApplicationJsonSchemaError

- `code` (string, optional)
- `message` (string, optional)
- `traceId` (string, optional)
- `timestamp` (datetime, optional)
- `support` (AccountingV1ArInvoicesPostResponsesContentApplicationJsonSchemaErrorSupport, optional)

### AccountingV1ArInvoicesPostResponsesContentApplicationJsonSchemaErrorSupport

- `contactUrl` (string, optional)
- `documentationUrl` (string, optional)

## Examples

**Request**

```json
{
  "customerId": "CUST-001",
  "customerName": "Ford Authorized Distributor",
  "invoiceDate": "2026-02-18T00:00:00Z",
  "invoiceType": "Standard",
  "paymentTerms": "Net 30",
  "currency": "USD",
  "subtotal": 38500,
  "taxAmount": 3080,
  "totalAmount": 41580
}
```

**Response**

```json
{
  "id": "inv_7f3a92bc1d04e",
  "customerId": "cust_4a8f2d1e9b3c",
  "customerName": "Meridian Industrial Solutions LLC",
  "invoiceDate": "2025-07-01",
  "dueDate": "2025-07-31",
  "currency": "USD",
  "status": "Draft",
  "paymentTerms": "NET30",
  "referenceNumber": "PO-2025-00847",
  "notes": "Q3 manufacturing components order per contract MSA-2024-112.",
  "lineItems": [
    {
      "lineId": "line_001a4f8c2e",
      "description": "Precision CNC Machined Brackets - Grade A Steel",
      "quantity": 500,
      "unitPrice": 18.75,
      "taxCode": "TX_US_MI",
      "taxRate": 0.06,
      "amount": 9375
    },
    {
      "lineId": "line_002b7d3a1f",
      "description": "Industrial Fastener Assembly Kit - M8 Stainless",
      "quantity": 1200,
      "unitPrice": 4.2,
      "taxCode": "TX_US_MI",
      "taxRate": 0.06,
      "amount": 5040
    }
  ],
  "subtotal": 14415,
  "taxTotal": 864.9,
  "totalAmount": 15279.9,
  "createdAt": "2025-07-01T08:42:17.334Z",
  "updatedAt": "2025-07-01T08:42:17.334Z"
}
```

**SDK Code**

```python createArInvoice_example
import requests

url = "https://connect.plex.com/accounting/v1/ar-invoices"

payload = {
    "customerId": "CUST-001",
    "customerName": "Ford Authorized Distributor",
    "invoiceDate": "2026-02-18T00:00:00Z",
    "invoiceType": "Standard",
    "paymentTerms": "Net 30",
    "currency": "USD",
    "subtotal": 38500,
    "taxAmount": 3080,
    "totalAmount": 41580
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript createArInvoice_example
const url = 'https://connect.plex.com/accounting/v1/ar-invoices';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"customerId":"CUST-001","customerName":"Ford Authorized Distributor","invoiceDate":"2026-02-18T00:00:00Z","invoiceType":"Standard","paymentTerms":"Net 30","currency":"USD","subtotal":38500,"taxAmount":3080,"totalAmount":41580}'
};

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

```go createArInvoice_example
package main

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

func main() {

	url := "https://connect.plex.com/accounting/v1/ar-invoices"

	payload := strings.NewReader("{\n  \"customerId\": \"CUST-001\",\n  \"customerName\": \"Ford Authorized Distributor\",\n  \"invoiceDate\": \"2026-02-18T00:00:00Z\",\n  \"invoiceType\": \"Standard\",\n  \"paymentTerms\": \"Net 30\",\n  \"currency\": \"USD\",\n  \"subtotal\": 38500,\n  \"taxAmount\": 3080,\n  \"totalAmount\": 41580\n}")

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

	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

url = URI("https://connect.plex.com/accounting/v1/ar-invoices")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"customerId\": \"CUST-001\",\n  \"customerName\": \"Ford Authorized Distributor\",\n  \"invoiceDate\": \"2026-02-18T00:00:00Z\",\n  \"invoiceType\": \"Standard\",\n  \"paymentTerms\": \"Net 30\",\n  \"currency\": \"USD\",\n  \"subtotal\": 38500,\n  \"taxAmount\": 3080,\n  \"totalAmount\": 41580\n}"

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

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

HttpResponse<String> response = Unirest.post("https://connect.plex.com/accounting/v1/ar-invoices")
  .header("Content-Type", "application/json")
  .body("{\n  \"customerId\": \"CUST-001\",\n  \"customerName\": \"Ford Authorized Distributor\",\n  \"invoiceDate\": \"2026-02-18T00:00:00Z\",\n  \"invoiceType\": \"Standard\",\n  \"paymentTerms\": \"Net 30\",\n  \"currency\": \"USD\",\n  \"subtotal\": 38500,\n  \"taxAmount\": 3080,\n  \"totalAmount\": 41580\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://connect.plex.com/accounting/v1/ar-invoices', [
  'body' => '{
  "customerId": "CUST-001",
  "customerName": "Ford Authorized Distributor",
  "invoiceDate": "2026-02-18T00:00:00Z",
  "invoiceType": "Standard",
  "paymentTerms": "Net 30",
  "currency": "USD",
  "subtotal": 38500,
  "taxAmount": 3080,
  "totalAmount": 41580
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp createArInvoice_example
using RestSharp;

var client = new RestClient("https://connect.plex.com/accounting/v1/ar-invoices");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"customerId\": \"CUST-001\",\n  \"customerName\": \"Ford Authorized Distributor\",\n  \"invoiceDate\": \"2026-02-18T00:00:00Z\",\n  \"invoiceType\": \"Standard\",\n  \"paymentTerms\": \"Net 30\",\n  \"currency\": \"USD\",\n  \"subtotal\": 38500,\n  \"taxAmount\": 3080,\n  \"totalAmount\": 41580\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift createArInvoice_example
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "customerId": "CUST-001",
  "customerName": "Ford Authorized Distributor",
  "invoiceDate": "2026-02-18T00:00:00Z",
  "invoiceType": "Standard",
  "paymentTerms": "Net 30",
  "currency": "USD",
  "subtotal": 38500,
  "taxAmount": 3080,
  "totalAmount": 41580
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://connect.plex.com/accounting/v1/ar-invoices")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```