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

# Create Expense

POST https://api.papertracc.com/v1/expenses
Content-Type: application/json

Creates a direct expense.

Requires the `can_create_expense` permission on the key owner's role.

**Keys:** secret key only.

Reference: https://api-docs.papertracc.com/core/purchases/expenses/create-expense

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.
- `identity` header (required) — The identity for the active workspace.

## Servers

- `https://api.papertracc.com/v1` (Production, default)
- `https://api.papertracc.com/rc-1` (Release Candidate 1)

## Request

### Body (application/json)

This endpoint expects an object.

- `items` (list of ExpensesPostRequestBodyContentApplicationJsonSchemaItemsItems, required)
- `account_id` (string, required)
- `expense_date` (datetime, required)
- `documents` (list of ExpensesPostRequestBodyContentApplicationJsonSchemaDocumentsItems, optional)
- `vendor_id` (string, optional)
- `adjustments` (list of ExpensesPostRequestBodyContentApplicationJsonSchemaAdjustmentsItems, optional)
- `exchange_rate` (double, optional)

## Response

### 201

Created

- `data` (ExpensesPostResponsesContentApplicationJsonSchemaData, required)
- `status` (boolean, required)
- `message` (string, required)

## Errors

### 401 Unauthorized Error

The API key is missing or invalid, the key owner is no longer an active member of the organisation, or the key owner is not a member of the workspace in the `identity` header.

- `status` (boolean, required)
- `message` (string, required)
- `error_code` (enum, optional) — Machine-readable reason. Present on 402 and 403 responses.
  - Allowed values: `PERMISSION_DENIED`, `SERVICE_DISABLED`, `OPEN_API_NOT_ENABLED`
- `permission` (string, optional) — The role permission the request needs. Set when `error_code` is `PERMISSION_DENIED`.
- `service` (string, optional) — The workspace service that is turned off. Set when `error_code` is `SERVICE_DISABLED`.

### 402 Payment Required Error

The workspace's subscription plan does not include the Open API.

- `status` (boolean, required)
- `message` (string, required)
- `error_code` (enum, optional) — Machine-readable reason. Present on 402 and 403 responses.
  - Allowed values: `PERMISSION_DENIED`, `SERVICE_DISABLED`, `OPEN_API_NOT_ENABLED`
- `permission` (string, optional) — The role permission the request needs. Set when `error_code` is `PERMISSION_DENIED`.
- `service` (string, optional) — The workspace service that is turned off. Set when `error_code` is `SERVICE_DISABLED`.

### 403 Forbidden Error

Either the key owner's role does not include the permission this endpoint needs (`PERMISSION_DENIED`), or the service this endpoint belongs to is turned off for the workspace (`SERVICE_DISABLED`).

- `status` (boolean, required)
- `message` (string, required)
- `error_code` (enum, optional) — Machine-readable reason. Present on 402 and 403 responses.
  - Allowed values: `PERMISSION_DENIED`, `SERVICE_DISABLED`, `OPEN_API_NOT_ENABLED`
- `permission` (string, optional) — The role permission the request needs. Set when `error_code` is `PERMISSION_DENIED`.
- `service` (string, optional) — The workspace service that is turned off. Set when `error_code` is `SERVICE_DISABLED`.

## Types

### ExpensesPostRequestBodyContentApplicationJsonSchemaItemsItems

- `rate` (double, required) — Price of one unit. Use 0 for a free line. A negative rate is rejected.
- `detail` (string, required)
- `quantity` (double, required) — Quantity of the line. Must be greater than zero. Fractional quantities are accepted to 4 decimal places and anything finer is rounded. When `sku` points at an item sold `EACH`, the quantity must be a whole number.
- `currency_code` (string, required)
- `amount` (double, optional)
- `tax_id` (string, optional)
- `unit` (string, optional) — Unit the line is billed in, for example `CARTON`. Optional, at most 50 characters. When `sku` points at an item that has a selling unit and this is omitted or matches it, the selling unit is used and `quantity` follows that unit's rules. A different unit is kept as sent.
- `account_id` (string, optional)
- `sku` (string, optional) — SKU of an inventory item. The line is tied to that item and takes its account, tax and selling unit. Rejected with 404 when no item has this SKU.
- `vat` (string, optional)
- `vat_rate` (double, optional)
- `vendor_id` (string, optional)
- `dynamic_fields` (ExpensesPostRequestBodyContentApplicationJsonSchemaItemsItemsDynamicFields, optional)

### ExpensesPostRequestBodyContentApplicationJsonSchemaDocumentsItems

- `file_data` (string, required)
- `file_name` (string, required)
- `file_type` (string, optional)

### ExpensesPostRequestBodyContentApplicationJsonSchemaAdjustmentsItems

- `name` (string, required)
- `type` (string, required)
- `value` (double, required)
- `amount` (double, required)
- `operation` (string, required)
- `account_id` (string, required)

### ExpensesPostResponsesContentApplicationJsonSchemaData

- `id` (string, required)
- `items` (list of ExpensesPostResponsesContentApplicationJsonSchemaDataItemsItems, required)
- `amount` (string, required)
- `status` (string, required)
- `vendor` (ExpensesPostResponsesContentApplicationJsonSchemaDataVendor, required)
- `paid_by` (string, required)
- `documents` (list of any, required)
- `vendor_id` (string, required)
- `account_id` (string, required)
- `created_at` (datetime, required)
- `project_id` (string, required)
- `adjustments` (list of ExpensesPostResponsesContentApplicationJsonSchemaDataAdjustmentsItems, required)
- `expense_date` (datetime, required)
- `currency_code` (string, required)
- `exchange_rate` (string, required)
- `journal_status` (string, required)
- `journal_entry_id` (string, required)
- `expense_reference` (string, required)

### ExpensesPostRequestBodyContentApplicationJsonSchemaItemsItemsDynamicFields

### ExpensesPostResponsesContentApplicationJsonSchemaDataItemsItems

- `rate` (string, required) — Decimal value serialized as a string, e.g. "12.50".
- `amount` (string, required) — Decimal value serialized as a string, e.g. "12.50".
- `detail` (string, required)
- `tax_id` (string, required)
- `quantity` (double, required) — Quantity of the line, as a number with at most 4 decimal places.
- `account_id` (string, required)
- `inventory_id` (string, required)
- `currency_code` (string, required)
- `sku` (string, optional) — SKU of the inventory item the line is tied to. Empty when the line was created without a `sku`.
- `tax_name` (string, optional)
- `vat` (string, optional)
- `unit` (string, optional) — Unit of measure for the line: the item's selling unit (`EACH`, `G`, `KG`, `OZ`, `LB`, `ML`, `L`, `FL_OZ`, `CM`, `M`, `IN`, `FT`, `YD`) or the label sent on the request. Omitted when the line has no unit.

### ExpensesPostResponsesContentApplicationJsonSchemaDataVendor

- `id` (string, required)
- `display_name` (string, required)

### ExpensesPostResponsesContentApplicationJsonSchemaDataAdjustmentsItems

- `name` (string, required)
- `type` (string, required)
- `value` (string, required) — Decimal value serialized as a string, e.g. "12.50".
- `amount` (string, required) — Decimal value serialized as a string, e.g. "12.50".
- `operation` (string, required)
- `account_id` (string, required)

## Examples

**Request**

```json
{
  "items": [
    {
      "rate": 50000,
      "detail": "Consulting hours",
      "quantity": 10,
      "currency_code": "NGN",
      "amount": 500000,
      "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1",
      "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
      "sku": "SKU-1001"
    }
  ],
  "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
  "expense_date": "2026-06-18T10:00:00.000Z",
  "documents": [
    {
      "file_data": "base64_string_here",
      "file_name": "expense-receipt.pdf",
      "file_type": "application/pdf"
    }
  ],
  "vendor_id": "0cb2d1a5-2f50-43a1-8c3f-df06f998ef51",
  "adjustments": [
    {
      "name": "VAT",
      "type": "PERCENTAGE_RATE",
      "value": 7.5,
      "amount": 37500,
      "operation": "ADDITION",
      "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9"
    }
  ],
  "is_test": false
}
```

**Response**

```json
{
  "data": {
    "id": "0bc96ff4-cff0-448c-a96c-17030ca7cbb8",
    "items": [
      {
        "rate": "50000.00",
        "amount": "500000.00",
        "detail": "Consulting hours",
        "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1",
        "quantity": 10,
        "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
        "inventory_id": "55a40b4d-a23a-49aa-a417-828913e9a5c8",
        "currency_code": "NGN",
        "sku": "SKU-1001"
      }
    ],
    "amount": "75000.00",
    "status": "POSTED",
    "vendor": {
      "id": "0cb2d1a5-2f50-43a1-8c3f-df06f998ef51",
      "display_name": "Global Softworks"
    },
    "paid_by": "user-token-hash",
    "documents": [],
    "vendor_id": "0cb2d1a5-2f50-43a1-8c3f-df06f998ef51",
    "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
    "created_at": "2026-06-18T10:00:00Z",
    "project_id": "spruce-demo",
    "adjustments": [
      {
        "name": "VAT",
        "type": "PERCENTAGE_RATE",
        "value": "7.50",
        "amount": "37500.00",
        "operation": "ADDITION",
        "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9"
      }
    ],
    "expense_date": "2026-06-18T10:00:00Z",
    "currency_code": "NGN",
    "exchange_rate": "1.00",
    "journal_status": "POSTED",
    "journal_entry_id": "JE-0002",
    "expense_reference": "EXP-0001"
  },
  "status": true,
  "message": "Successfully created expense"
}
```

**SDK Code**

```python Purchases_Expenses_Create Expense_example
import requests

url = "https://api.papertracc.com/v1/expenses"

payload = {
    "items": [
        {
            "rate": 50000,
            "detail": "Consulting hours",
            "quantity": 10,
            "currency_code": "NGN",
            "amount": 500000,
            "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1",
            "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
            "sku": "SKU-1001"
        }
    ],
    "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
    "expense_date": "2026-06-18T10:00:00.000Z",
    "documents": [
        {
            "file_data": "base64_string_here",
            "file_name": "expense-receipt.pdf",
            "file_type": "application/pdf"
        }
    ],
    "vendor_id": "0cb2d1a5-2f50-43a1-8c3f-df06f998ef51",
    "adjustments": [
        {
            "name": "VAT",
            "type": "PERCENTAGE_RATE",
            "value": 7.5,
            "amount": 37500,
            "operation": "ADDITION",
            "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9"
        }
    ],
    "is_test": False
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Purchases_Expenses_Create Expense_example
const url = 'https://api.papertracc.com/v1/expenses';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"items":[{"rate":50000,"detail":"Consulting hours","quantity":10,"currency_code":"NGN","amount":500000,"tax_id":"78c68f6d-d734-4822-9a6c-73f517a0e5c1","account_id":"d037d299-3029-4dc7-8e72-172f80f23c4f","sku":"SKU-1001"}],"account_id":"d037d299-3029-4dc7-8e72-172f80f23c4f","expense_date":"2026-06-18T10:00:00.000Z","documents":[{"file_data":"base64_string_here","file_name":"expense-receipt.pdf","file_type":"application/pdf"}],"vendor_id":"0cb2d1a5-2f50-43a1-8c3f-df06f998ef51","adjustments":[{"name":"VAT","type":"PERCENTAGE_RATE","value":7.5,"amount":37500,"operation":"ADDITION","account_id":"2b0d1461-e52e-4a1a-a69c-11801431c2c9"}],"is_test":false}'
};

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

```go Purchases_Expenses_Create Expense_example
package main

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

func main() {

	url := "https://api.papertracc.com/v1/expenses"

	payload := strings.NewReader("{\n  \"items\": [\n    {\n      \"rate\": 50000,\n      \"detail\": \"Consulting hours\",\n      \"quantity\": 10,\n      \"currency_code\": \"NGN\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"sku\": \"SKU-1001\"\n    }\n  ],\n  \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"expense_date\": \"2026-06-18T10:00:00.000Z\",\n  \"documents\": [\n    {\n      \"file_data\": \"base64_string_here\",\n      \"file_name\": \"expense-receipt.pdf\",\n      \"file_type\": \"application/pdf\"\n    }\n  ],\n  \"vendor_id\": \"0cb2d1a5-2f50-43a1-8c3f-df06f998ef51\",\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"type\": \"PERCENTAGE_RATE\",\n      \"value\": 7.5,\n      \"amount\": 37500,\n      \"operation\": \"ADDITION\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\"\n    }\n  ],\n  \"is_test\": false\n}")

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

	req.Header.Add("Authorization", "Bearer <apiKey>")
	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 Purchases_Expenses_Create Expense_example
require 'uri'
require 'net/http'

url = URI("https://api.papertracc.com/v1/expenses")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"items\": [\n    {\n      \"rate\": 50000,\n      \"detail\": \"Consulting hours\",\n      \"quantity\": 10,\n      \"currency_code\": \"NGN\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"sku\": \"SKU-1001\"\n    }\n  ],\n  \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"expense_date\": \"2026-06-18T10:00:00.000Z\",\n  \"documents\": [\n    {\n      \"file_data\": \"base64_string_here\",\n      \"file_name\": \"expense-receipt.pdf\",\n      \"file_type\": \"application/pdf\"\n    }\n  ],\n  \"vendor_id\": \"0cb2d1a5-2f50-43a1-8c3f-df06f998ef51\",\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"type\": \"PERCENTAGE_RATE\",\n      \"value\": 7.5,\n      \"amount\": 37500,\n      \"operation\": \"ADDITION\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\"\n    }\n  ],\n  \"is_test\": false\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.papertracc.com/v1/expenses")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"items\": [\n    {\n      \"rate\": 50000,\n      \"detail\": \"Consulting hours\",\n      \"quantity\": 10,\n      \"currency_code\": \"NGN\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"sku\": \"SKU-1001\"\n    }\n  ],\n  \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"expense_date\": \"2026-06-18T10:00:00.000Z\",\n  \"documents\": [\n    {\n      \"file_data\": \"base64_string_here\",\n      \"file_name\": \"expense-receipt.pdf\",\n      \"file_type\": \"application/pdf\"\n    }\n  ],\n  \"vendor_id\": \"0cb2d1a5-2f50-43a1-8c3f-df06f998ef51\",\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"type\": \"PERCENTAGE_RATE\",\n      \"value\": 7.5,\n      \"amount\": 37500,\n      \"operation\": \"ADDITION\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\"\n    }\n  ],\n  \"is_test\": false\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.papertracc.com/v1/expenses', [
  'body' => '{
  "items": [
    {
      "rate": 50000,
      "detail": "Consulting hours",
      "quantity": 10,
      "currency_code": "NGN",
      "amount": 500000,
      "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1",
      "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
      "sku": "SKU-1001"
    }
  ],
  "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
  "expense_date": "2026-06-18T10:00:00.000Z",
  "documents": [
    {
      "file_data": "base64_string_here",
      "file_name": "expense-receipt.pdf",
      "file_type": "application/pdf"
    }
  ],
  "vendor_id": "0cb2d1a5-2f50-43a1-8c3f-df06f998ef51",
  "adjustments": [
    {
      "name": "VAT",
      "type": "PERCENTAGE_RATE",
      "value": 7.5,
      "amount": 37500,
      "operation": "ADDITION",
      "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9"
    }
  ],
  "is_test": false
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Purchases_Expenses_Create Expense_example
using RestSharp;

var client = new RestClient("https://api.papertracc.com/v1/expenses");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"items\": [\n    {\n      \"rate\": 50000,\n      \"detail\": \"Consulting hours\",\n      \"quantity\": 10,\n      \"currency_code\": \"NGN\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"sku\": \"SKU-1001\"\n    }\n  ],\n  \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"expense_date\": \"2026-06-18T10:00:00.000Z\",\n  \"documents\": [\n    {\n      \"file_data\": \"base64_string_here\",\n      \"file_name\": \"expense-receipt.pdf\",\n      \"file_type\": \"application/pdf\"\n    }\n  ],\n  \"vendor_id\": \"0cb2d1a5-2f50-43a1-8c3f-df06f998ef51\",\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"type\": \"PERCENTAGE_RATE\",\n      \"value\": 7.5,\n      \"amount\": 37500,\n      \"operation\": \"ADDITION\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\"\n    }\n  ],\n  \"is_test\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Purchases_Expenses_Create Expense_example
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "items": [
    [
      "rate": 50000,
      "detail": "Consulting hours",
      "quantity": 10,
      "currency_code": "NGN",
      "amount": 500000,
      "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1",
      "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
      "sku": "SKU-1001"
    ]
  ],
  "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
  "expense_date": "2026-06-18T10:00:00.000Z",
  "documents": [
    [
      "file_data": "base64_string_here",
      "file_name": "expense-receipt.pdf",
      "file_type": "application/pdf"
    ]
  ],
  "vendor_id": "0cb2d1a5-2f50-43a1-8c3f-df06f998ef51",
  "adjustments": [
    [
      "name": "VAT",
      "type": "PERCENTAGE_RATE",
      "value": 7.5,
      "amount": 37500,
      "operation": "ADDITION",
      "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9"
    ]
  ],
  "is_test": false
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.papertracc.com/v1/expenses")! 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()
```