> 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 Invoice

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

Creates an invoice. `items` is required. `allow_post` is optional; when true, the invoice is posted immediately after creation (the workspace must have `allow_create_and_post` enabled, otherwise the request is rejected with 400). Send `payment_term_id` to put the invoice on a payment term, or `due_date` for a fixed date; the term wins when both are sent. With neither, the customer's default term is used, then the workspace default term, then the workspace's default due days.

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

**Keys:** secret key only.

Reference: https://api-docs.papertracc.com/core/sales/invoices/create-invoice

## 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 a CreateInvoiceRequest.

- `customer_id` (string, required)
- `invoice_date` (datetime, required) — Must include exactly 3 fractional-second digits, e.g. 2025-12-29T18:00:00.000Z. Timestamps with no fractional seconds, or with a different digit count (e.g. microseconds), are rejected.
- `items` (list of CreateInvoiceItem, required)
- `exchange_rate` (double, optional)
- `debit_account_id` (string, optional)
- `sales_personnel_id` (string, optional) — Sales personnel to credit for this invoice. Accepts either a ProfileSalesPersonnel id or a Contact id; if a Contact id is given and no sales-personnel record is linked to it yet, one is created automatically.
- `commission` (CommissionOverride, optional) — Per-invoice override of the workspace's default commission terms.
- `order_id` (string, optional)
- `subject` (string, optional)
- `due_date` (datetime, optional) — Must include exactly 3 fractional-second digits, e.g. 2025-12-29T18:00:00.000Z. Timestamps with no fractional seconds, or with a different digit count (e.g. microseconds), are rejected.
- `payment_term_id` (string, optional) — Payment term to apply. Takes precedence over `due_date`. The document's due dates and any early-payment discount are worked out from the term and returned in `payment_schedule`.
- `reverse_charge` (boolean, optional)
- `adjustments` (list of CreateInvoiceAdjustment, optional)
- `allow_post` (boolean, optional)
- `incentives` (IncentiveSelection, optional) — Promotions and loyalty points to apply. Send only what to apply; the server calculates every amount. Discounts are subtracted from the invoice total and allocated across the eligible lines.

## Response

### 201

Created

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

### 202

Accepted

- `data` (InvoicesPostResponsesContentApplicationJsonSchemaData, 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

### CreateInvoiceItem

- `detail` (string, required)
- `currency_code` (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.
- `rate` (double, required) — Price of one unit. Use 0 for a free line. A negative rate is rejected.
- `unit` (string, optional) — Unit of measure label for the line, for example `hours`. Optional, at most 50 characters. When `sku` points at an item that has a selling unit, that unit is used and this value is ignored.
- `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.
- `account_id` (string, optional)
- `vat` (string, optional)
- `vat_rate` (double, optional)
- `amount` (double, optional)
- `tax_id` (string, optional)
- `dynamic_fields` (CreateInvoiceItemDynamicFields, optional)

### CommissionOverride

Per-invoice override of the workspace's default commission terms.

- `rate_type` (enum, optional) — Overrides the commission rate type for this invoice only.
  - Allowed values: `PERCENTAGE_RATE`, `FLAT_RATE`
- `basis` (enum, optional) — Overrides what the commission rate is applied against for this invoice only.
  - Allowed values: `SUBTOTAL`, `GROSS`, `MARGIN`
- `rate` (string, optional) — Overrides the commission rate for this invoice only. A percentage (e.g. "5") or a flat amount, depending on rate_type.
- `run_mode` (enum, optional) — Overrides how the commission on this invoice is settled: INSTANT bills it immediately as it accrues, MANUAL waits for a hand-triggered run, SCHEDULED waits for the next scheduled run.
  - Allowed values: `INSTANT`, `MANUAL`, `SCHEDULED`

### CreateInvoiceAdjustment

- `name` (string, required)
- `account_id` (string, required)
- `value` (double, required)
- `type` (enum, required)
  - Allowed values: `FLAT_RATE`, `PERCENTAGE_RATE`
- `operation` (enum, required)
  - Allowed values: `ADDITION`, `SUBTRACTION`
- `amount` (double, optional) — Optional - not required despite appearing so in some older client integrations.

### IncentiveSelection

Promotions and loyalty points to apply. Send only what to apply; the server calculates every amount. Discounts are subtracted from the invoice total and allocated across the eligible lines.

- `promotions` (list of PromotionSelection, optional) — Each promotion may appear once. Promotions that are not combinable with each other are rejected. Shipping and free-shipping promotions cannot be applied to invoices.
- `loyalty_points` (double, optional) — Loyalty points to redeem. Requires a customer with an active loyalty account and enough points; the value is calculated from the loyalty program's redemption rate.

### Invoice

- `id` (string, required)
- `invoice_reference` (string, required)
- `project_id` (string, required)
- `prepared_by` (string, required)
- `amount` (string, required)
- `total_paid` (string, required) — Decimal value serialized as a string.
- `payment_status` (enum, required) — How far the document has been settled, derived from amount and total_paid. Independent of status, which tracks the document workflow - a sent invoice that is part paid stays SENT with a payment_status of PARTIAL.
  - Allowed values: `UNPAID`, `PARTIAL`, `PAID`
- `status` (string, required)
- `journal_status` (string, required)
- `currency_code` (string, required)
- `exchange_rate` (string, required)
- `order_id` (string, required, nullable)
- `reverse_charge` (boolean, required, nullable)
- `is_overdue` (boolean, required, nullable)
- `approval` (integer, required, nullable)
- `content` (EmailContent, required)
- `items` (list of InvoiceItem, required)
- `adjustments` (list of InvoiceAdjustment, required)
- `payment_schedule` (PaymentSchedule, required, nullable) — The payment schedule built from the document's payment term, or null when the document has a plain due date.
- `customer` (Customer, required)
- `approvals` (list of VoucherApproval, required)
- `invoice_date` (datetime, required) — Must include exactly 3 fractional-second digits, e.g. 2025-12-29T18:00:00.000Z. Timestamps with no fractional seconds, or with a different digit count (e.g. microseconds), are rejected.
- `due_date` (datetime, required) — Must include exactly 3 fractional-second digits, e.g. 2025-12-29T18:00:00.000Z. Timestamps with no fractional seconds, or with a different digit count (e.g. microseconds), are rejected.
- `created_at` (datetime, required) — Must include exactly 3 fractional-second digits, e.g. 2025-12-29T18:00:00.000Z. Timestamps with no fractional seconds, or with a different digit count (e.g. microseconds), are rejected.
- `file_url` (string, optional, nullable)
- `journal_entry_id` (string, optional, nullable)
- `debit_account_id` (string, optional, nullable)
- `sales_personnel` (SalesPersonnel, optional)

### InvoicesPostResponsesContentApplicationJsonSchemaData

- `id` (string, required)
- `items` (list of InvoicesPostResponsesContentApplicationJsonSchemaDataItemsItems, required)
- `amount` (string, required)
- `status` (string, required)
- `content` (InvoicesPostResponsesContentApplicationJsonSchemaDataContent, required)
- `approval` (integer, required)
- `customer` (InvoicesPostResponsesContentApplicationJsonSchemaDataCustomer, required)
- `due_date` (datetime, required)
- `order_id` (string, required)
- `approvals` (list of any, required)
- `created_at` (datetime, required)
- `is_overdue` (boolean, required)
- `project_id` (string, required)
- `prepared_by` (string, required)
- `invoice_date` (datetime, required)
- `currency_code` (string, required)
- `exchange_rate` (string, required)
- `journal_status` (string, required)
- `reverse_charge` (boolean, required)
- `invoice_reference` (string, required)
- `payment_schedule` (PaymentSchedule, required, nullable) — The payment schedule built from the document's payment term, or null when the document has a plain due date.
- `file_url` (any, optional)
- `sales_personnel` (InvoicesPostResponsesContentApplicationJsonSchemaDataSalesPersonnel, optional, nullable)
- `debit_account_id` (any, optional)
- `journal_entry_id` (any, optional)
- `payment_status` (enum, optional) — How far the document has been settled, derived from amount and total_paid. Independent of status, which tracks the document workflow - a sent invoice that is part paid stays SENT with a payment_status of PARTIAL.
  - Allowed values: `UNPAID`, `PARTIAL`, `PAID`

### CreateInvoiceItemDynamicFields

### PromotionSelection

- `promotion_id` (string, required) — Promotion to apply. The discount amount is calculated by the server from the promotion's configuration and the invoice lines.
- `code` (string, optional) — Required when the promotion is code-based. Matched case-insensitively.
- `account_id` (string, optional) — Account the discount posts to. Must be an active account in the workspace. Defaults to the workspace's Sales Returns & Allowances account.

### EmailContent

- `subject` (string, optional)
- `cc` (string, optional)
- `notes` (string, optional)
- `terms` (string, optional)

### InvoiceItem

- `detail` (string, required)
- `tax_id` (string, required, nullable)
- `quantity` (double, required) — Quantity of the line, as a number with at most 4 decimal places.
- `rate` (string, required) — Decimal value serialized as a string, e.g. "12.50".
- `amount` (string, required) — Decimal value serialized as a string, e.g. "37.50".
- `inventory_id` (string, required, nullable)
- `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.
- `account_id` (string, optional, nullable)
- `cost_price` (string, optional, nullable) — Decimal value serialized as a string.
- `dynamic_fields` (InvoiceItemDynamicFields, optional)
- `discount` (string, optional) — Portion of promotion and loyalty discounts allocated to this line, in the invoice currency. Decimal value serialized as a string.

### InvoiceAdjustment

- `name` (string, required)
- `account_id` (string, required)
- `value` (string, required) — Decimal value serialized as a string.
- `type` (enum, required)
  - Allowed values: `FLAT_RATE`, `PERCENTAGE_RATE`
- `operation` (enum, required)
  - Allowed values: `ADDITION`, `SUBTRACTION`
- `amount` (string, required) — Decimal value serialized as a string.
- `promotion_id` (string, optional, nullable) — Set when this adjustment is a promotion discount.
- `code_used` (string, optional, nullable) — Promotion code used, for code-based promotions.
- `loyalty_points` (string, optional, nullable) — Loyalty points redeemed, when this adjustment is a loyalty redemption. Decimal value serialized as a string.

### PaymentSchedule

- `term_id` (string, required, nullable) — The payment term the schedule was built from.
- `name` (string, required) — The term name at the time it was applied.
- `net_days` (integer, required)
- `instalments` (list of PaymentScheduleInstalment, required) — Empty when the document has a single due date, which is then `due_date` on the document.
- `discount` (PaymentScheduleDiscount, required, nullable) — Early-payment discount on this document, or null.
- `is_layaway` (boolean, optional) — Present and true on a layaway order's schedule.
- `release_instalment` (integer, optional) — Present on a layaway order's schedule: the instalment after which the goods are released.

### Customer

- `id` (string, required)
- `type` (string, required)
- `email` (string, required)
- `phone` (string, required)
- `accounts` (list of BankAccount, required)
- `last_name` (string, required)
- `contact_id` (string, required)
- `created_at` (datetime, required) — Must include exactly 3 fractional-second digits, e.g. 2025-12-29T18:00:00.000Z. Timestamps with no fractional seconds, or with a different digit count (e.g. microseconds), are rejected.
- `first_name` (string, required)
- `project_id` (string, required)
- `company_name` (string, required)
- `display_name` (string, required)
- `billing_address` (Address, required)
- `shipping_address` (Address, required)
- `payment_term_id` (string, optional, nullable) — The contact's default payment term, or null when none is set.

### VoucherApproval

- `email` (string, optional)
- `first_name` (string, optional)
- `last_name` (string, optional)
- `status` (boolean, optional)
- `date` (datetime, optional) — Must include exactly 3 fractional-second digits, e.g. 2025-12-29T18:00:00.000Z. Timestamps with no fractional seconds, or with a different digit count (e.g. microseconds), are rejected.

### SalesPersonnel

- `id` (string, optional)
- `project_id` (string, optional)
- `display_name` (string, optional)
- `first_name` (string, optional)
- `last_name` (string, optional)
- `email` (string, optional)
- `phone` (string, optional)
- `is_active` (boolean, optional)
- `created_at` (datetime, optional) — Must include exactly 3 fractional-second digits, e.g. 2025-12-29T18:00:00.000Z. Timestamps with no fractional seconds, or with a different digit count (e.g. microseconds), are rejected.

### InvoicesPostResponsesContentApplicationJsonSchemaDataItemsItems

- `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.

### InvoicesPostResponsesContentApplicationJsonSchemaDataContent

### InvoicesPostResponsesContentApplicationJsonSchemaDataCustomer

- `id` (string, required)
- `type` (string, required)
- `email` (string, required)
- `phone` (string, required)
- `accounts` (list of InvoicesPostResponsesContentApplicationJsonSchemaDataCustomerAccountsItems, required)
- `last_name` (string, required)
- `contact_id` (string, required)
- `created_at` (datetime, required)
- `first_name` (string, required)
- `project_id` (string, required)
- `company_name` (string, required)
- `display_name` (string, required)
- `billing_address` (InvoicesPostResponsesContentApplicationJsonSchemaDataCustomerBillingAddress, required)
- `shipping_address` (InvoicesPostResponsesContentApplicationJsonSchemaDataCustomerShippingAddress, required)
- `payment_term_id` (string, optional, nullable) — The contact's default payment term, or null when none is set.

### InvoicesPostResponsesContentApplicationJsonSchemaDataSalesPersonnel

- `id` (string, optional)
- `project_id` (string, optional)
- `display_name` (string, optional)
- `first_name` (string, optional)
- `last_name` (string, optional)
- `email` (string, optional)
- `phone` (string, optional)
- `is_active` (boolean, optional)
- `created_at` (datetime, optional)

### InvoiceItemDynamicFields

### PaymentScheduleInstalment

- `type` (enum, required) — `PERCENTAGE_RATE` reads `value` as a percentage of the document total. `FLAT_RATE` reads it as an amount in the document currency.
  - Allowed values: `PERCENTAGE_RATE`, `FLAT_RATE`
- `value` (string, required) — Decimal value serialized as a string.
- `net_days` (integer, required)
- `due_date` (datetime, required) — RFC 3339 timestamp. Fractional seconds are present when the underlying value has sub-second precision and are variable-length (not padded to a fixed number of digits) - they may be absent entirely, e.g. 2025-12-29T18:00:00Z, or carry up to 9 digits, e.g. 2025-12-29T18:00:00.610806Z.
- `amount` (string, required) — The share of the document total due on `due_date`. Decimal value serialized as a string.

### PaymentScheduleDiscount

- `type` (enum, required) — `PERCENTAGE_RATE` reads `value` as a percentage of the document total. `FLAT_RATE` reads it as an amount in the document currency.
  - Allowed values: `PERCENTAGE_RATE`, `FLAT_RATE`
- `value` (string, required) — Decimal value serialized as a string.
- `net_days` (integer, required)
- `deadline` (datetime, required) — The last day the discount can be taken.
- `amount` (string, required) — The discount available on this document. Decimal value serialized as a string.

### BankAccount

- `bank` (string, required)
- `code` (string, required)
- `vat_id` (string, required)
- `is_default` (boolean, required)
- `account_name` (string, required)
- `currency_code` (string, required)
- `account_number` (string, required)

### Address

- `name` (string, required)
- `address_one` (string, required)
- `city` (string, required)
- `state` (string, required)
- `country` (string, required)
- `country_code` (string, required)
- `post_code` (string, required)
- `phone` (string, required)

### InvoicesPostResponsesContentApplicationJsonSchemaDataCustomerAccountsItems

- `bank` (string, required)
- `code` (string, required)
- `vat_id` (string, required)
- `is_default` (boolean, required)
- `account_name` (string, required)
- `currency_code` (string, required)
- `account_number` (string, required)

### InvoicesPostResponsesContentApplicationJsonSchemaDataCustomerBillingAddress

- `city` (string, required)
- `name` (string, required)
- `phone` (string, required)
- `state` (string, required)
- `country` (string, required)
- `post_code` (string, required)
- `address_one` (string, required)
- `country_code` (string, required)

### InvoicesPostResponsesContentApplicationJsonSchemaDataCustomerShippingAddress

- `city` (string, required)
- `name` (string, required)
- `phone` (string, required)
- `state` (string, required)
- `country` (string, required)
- `post_code` (string, required)
- `address_one` (string, required)
- `country_code` (string, required)

## Examples

### Create a draft invoice

**Request**

```json
{
  "customer_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "invoice_date": "2026-06-18T10:00:00.000Z",
  "items": [
    {
      "detail": "Implementation consulting services",
      "currency_code": "NGN",
      "quantity": 10,
      "rate": 50000,
      "sku": "SKU-1001",
      "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
      "amount": 500000,
      "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1"
    }
  ],
  "debit_account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
  "sales_personnel_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "order_id": "ORD-1001",
  "subject": "Implementation consulting services",
  "due_date": "2026-07-18T10:00:00.000Z",
  "reverse_charge": false,
  "adjustments": [
    {
      "name": "VAT",
      "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9",
      "value": 7.5,
      "type": "PERCENTAGE_RATE",
      "operation": "ADDITION",
      "amount": 37500
    }
  ],
  "allow_post": false
}
```

**Response**

```json
{
  "data": {
    "id": "1243891e-40a8-4a88-8e1f-0397adcbf85e",
    "invoice_reference": "INV-0001",
    "project_id": "spruce-demo",
    "prepared_by": "user-token-hash",
    "amount": "537500.00",
    "total_paid": "0.00",
    "payment_status": "UNPAID",
    "status": "DRAFT",
    "journal_status": "UNPOSTED",
    "currency_code": "NGN",
    "exchange_rate": "1.00",
    "order_id": "ORD-1001",
    "reverse_charge": false,
    "is_overdue": false,
    "approval": 0,
    "content": {},
    "items": [
      {
        "detail": "Consulting hours",
        "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1",
        "quantity": 10,
        "rate": "50000.00",
        "amount": "500000.00",
        "inventory_id": "55a40b4d-a23a-49aa-a417-828913e9a5c8",
        "currency_code": "NGN",
        "sku": "SKU-1001",
        "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f"
      }
    ],
    "adjustments": [
      {
        "name": "VAT",
        "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9",
        "value": "7.50",
        "type": "PERCENTAGE_RATE",
        "operation": "ADDITION",
        "amount": "37500.00"
      }
    ],
    "payment_schedule": null,
    "customer": {
      "id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
      "type": "INDIVIDUAL",
      "email": "john@example.com",
      "phone": "+2348012345678",
      "accounts": [
        {
          "bank": "Spruce Bank",
          "code": "044",
          "vat_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1",
          "is_default": true,
          "account_name": "John Doe",
          "currency_code": "NGN",
          "account_number": "1234567890"
        }
      ],
      "last_name": "Doe",
      "contact_id": "64595845-34ec-482c-b0fe-ae617a0f8335",
      "created_at": "2026-06-18T10:00:00Z",
      "first_name": "John",
      "project_id": "spruce-demo",
      "company_name": "Acme Corp",
      "display_name": "John Doe",
      "billing_address": {
        "name": "Office",
        "address_one": "12 Marina Road",
        "city": "Lagos",
        "state": "Lagos",
        "country": "Nigeria",
        "country_code": "NG",
        "post_code": "100001",
        "phone": "+2348012345678"
      },
      "shipping_address": {
        "name": "Office",
        "address_one": "12 Marina Road",
        "city": "Lagos",
        "state": "Lagos",
        "country": "Nigeria",
        "country_code": "NG",
        "post_code": "100001",
        "phone": "+2348012345678"
      },
      "payment_term_id": null
    },
    "approvals": [],
    "invoice_date": "2026-06-18T10:00:00Z",
    "due_date": "2026-07-18T10:00:00Z",
    "created_at": "2026-08-19T12:19:57.610806Z",
    "file_url": null,
    "journal_entry_id": null,
    "debit_account_id": null
  },
  "status": true,
  "message": "Successfully created invoice"
}
```

**SDK Code**

```python Create a draft invoice
import requests

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

payload = {
    "customer_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
    "invoice_date": "2026-06-18T10:00:00.000Z",
    "items": [
        {
            "detail": "Implementation consulting services",
            "currency_code": "NGN",
            "quantity": 10,
            "rate": 50000,
            "sku": "SKU-1001",
            "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
            "amount": 500000,
            "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1"
        }
    ],
    "debit_account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
    "sales_personnel_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
    "order_id": "ORD-1001",
    "subject": "Implementation consulting services",
    "due_date": "2026-07-18T10:00:00.000Z",
    "reverse_charge": False,
    "adjustments": [
        {
            "name": "VAT",
            "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9",
            "value": 7.5,
            "type": "PERCENTAGE_RATE",
            "operation": "ADDITION",
            "amount": 37500
        }
    ],
    "allow_post": False
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Create a draft invoice
const url = 'https://api.papertracc.com/v1/invoices';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"customer_id":"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501","invoice_date":"2026-06-18T10:00:00.000Z","items":[{"detail":"Implementation consulting services","currency_code":"NGN","quantity":10,"rate":50000,"sku":"SKU-1001","account_id":"d037d299-3029-4dc7-8e72-172f80f23c4f","amount":500000,"tax_id":"78c68f6d-d734-4822-9a6c-73f517a0e5c1"}],"debit_account_id":"d037d299-3029-4dc7-8e72-172f80f23c4f","sales_personnel_id":"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501","order_id":"ORD-1001","subject":"Implementation consulting services","due_date":"2026-07-18T10:00:00.000Z","reverse_charge":false,"adjustments":[{"name":"VAT","account_id":"2b0d1461-e52e-4a1a-a69c-11801431c2c9","value":7.5,"type":"PERCENTAGE_RATE","operation":"ADDITION","amount":37500}],"allow_post":false}'
};

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

```go Create a draft invoice
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"customer_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"invoice_date\": \"2026-06-18T10:00:00.000Z\",\n  \"items\": [\n    {\n      \"detail\": \"Implementation consulting services\",\n      \"currency_code\": \"NGN\",\n      \"quantity\": 10,\n      \"rate\": 50000,\n      \"sku\": \"SKU-1001\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\"\n    }\n  ],\n  \"debit_account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"sales_personnel_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"order_id\": \"ORD-1001\",\n  \"subject\": \"Implementation consulting services\",\n  \"due_date\": \"2026-07-18T10:00:00.000Z\",\n  \"reverse_charge\": false,\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\",\n      \"value\": 7.5,\n      \"type\": \"PERCENTAGE_RATE\",\n      \"operation\": \"ADDITION\",\n      \"amount\": 37500\n    }\n  ],\n  \"allow_post\": 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 Create a draft invoice
require 'uri'
require 'net/http'

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

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  \"customer_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"invoice_date\": \"2026-06-18T10:00:00.000Z\",\n  \"items\": [\n    {\n      \"detail\": \"Implementation consulting services\",\n      \"currency_code\": \"NGN\",\n      \"quantity\": 10,\n      \"rate\": 50000,\n      \"sku\": \"SKU-1001\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\"\n    }\n  ],\n  \"debit_account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"sales_personnel_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"order_id\": \"ORD-1001\",\n  \"subject\": \"Implementation consulting services\",\n  \"due_date\": \"2026-07-18T10:00:00.000Z\",\n  \"reverse_charge\": false,\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\",\n      \"value\": 7.5,\n      \"type\": \"PERCENTAGE_RATE\",\n      \"operation\": \"ADDITION\",\n      \"amount\": 37500\n    }\n  ],\n  \"allow_post\": false\n}"

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

```java Create a draft invoice
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.papertracc.com/v1/invoices")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customer_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"invoice_date\": \"2026-06-18T10:00:00.000Z\",\n  \"items\": [\n    {\n      \"detail\": \"Implementation consulting services\",\n      \"currency_code\": \"NGN\",\n      \"quantity\": 10,\n      \"rate\": 50000,\n      \"sku\": \"SKU-1001\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\"\n    }\n  ],\n  \"debit_account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"sales_personnel_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"order_id\": \"ORD-1001\",\n  \"subject\": \"Implementation consulting services\",\n  \"due_date\": \"2026-07-18T10:00:00.000Z\",\n  \"reverse_charge\": false,\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\",\n      \"value\": 7.5,\n      \"type\": \"PERCENTAGE_RATE\",\n      \"operation\": \"ADDITION\",\n      \"amount\": 37500\n    }\n  ],\n  \"allow_post\": false\n}")
  .asString();
```

```php Create a draft invoice
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.papertracc.com/v1/invoices', [
  'body' => '{
  "customer_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "invoice_date": "2026-06-18T10:00:00.000Z",
  "items": [
    {
      "detail": "Implementation consulting services",
      "currency_code": "NGN",
      "quantity": 10,
      "rate": 50000,
      "sku": "SKU-1001",
      "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
      "amount": 500000,
      "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1"
    }
  ],
  "debit_account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
  "sales_personnel_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "order_id": "ORD-1001",
  "subject": "Implementation consulting services",
  "due_date": "2026-07-18T10:00:00.000Z",
  "reverse_charge": false,
  "adjustments": [
    {
      "name": "VAT",
      "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9",
      "value": 7.5,
      "type": "PERCENTAGE_RATE",
      "operation": "ADDITION",
      "amount": 37500
    }
  ],
  "allow_post": false
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Create a draft invoice
using RestSharp;

var client = new RestClient("https://api.papertracc.com/v1/invoices");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"customer_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"invoice_date\": \"2026-06-18T10:00:00.000Z\",\n  \"items\": [\n    {\n      \"detail\": \"Implementation consulting services\",\n      \"currency_code\": \"NGN\",\n      \"quantity\": 10,\n      \"rate\": 50000,\n      \"sku\": \"SKU-1001\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\"\n    }\n  ],\n  \"debit_account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"sales_personnel_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"order_id\": \"ORD-1001\",\n  \"subject\": \"Implementation consulting services\",\n  \"due_date\": \"2026-07-18T10:00:00.000Z\",\n  \"reverse_charge\": false,\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\",\n      \"value\": 7.5,\n      \"type\": \"PERCENTAGE_RATE\",\n      \"operation\": \"ADDITION\",\n      \"amount\": 37500\n    }\n  ],\n  \"allow_post\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create a draft invoice
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "customer_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "invoice_date": "2026-06-18T10:00:00.000Z",
  "items": [
    [
      "detail": "Implementation consulting services",
      "currency_code": "NGN",
      "quantity": 10,
      "rate": 50000,
      "sku": "SKU-1001",
      "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
      "amount": 500000,
      "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1"
    ]
  ],
  "debit_account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
  "sales_personnel_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "order_id": "ORD-1001",
  "subject": "Implementation consulting services",
  "due_date": "2026-07-18T10:00:00.000Z",
  "reverse_charge": false,
  "adjustments": [
    [
      "name": "VAT",
      "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9",
      "value": 7.5,
      "type": "PERCENTAGE_RATE",
      "operation": "ADDITION",
      "amount": 37500
    ]
  ],
  "allow_post": false
] as [String : Any]

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

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

### Create and post invoice

**Request**

```json
{
  "customer_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "invoice_date": "2026-06-18T10:00:00.000Z",
  "items": [
    {
      "detail": "Implementation consulting services",
      "currency_code": "NGN",
      "quantity": 10,
      "rate": 50000,
      "sku": "SKU-1001",
      "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
      "amount": 500000,
      "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1"
    }
  ],
  "debit_account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
  "sales_personnel_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "order_id": "ORD-1001-POST",
  "subject": "Implementation consulting services - posted on create",
  "due_date": "2026-07-18T10:00:00.000Z",
  "reverse_charge": false,
  "adjustments": [
    {
      "name": "VAT",
      "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9",
      "value": 7.5,
      "type": "PERCENTAGE_RATE",
      "operation": "ADDITION",
      "amount": 37500
    }
  ],
  "allow_post": true
}
```

**Response**

```json
{
  "data": {
    "id": "1243891e-40a8-4a88-8e1f-0397adcbf85e",
    "invoice_reference": "INV-0001",
    "project_id": "spruce-demo",
    "prepared_by": "user-token-hash",
    "amount": "537500.00",
    "total_paid": "0.00",
    "payment_status": "UNPAID",
    "status": "POSTED",
    "journal_status": "POSTED",
    "currency_code": "NGN",
    "exchange_rate": "1.00",
    "order_id": "ORD-1001",
    "reverse_charge": false,
    "is_overdue": false,
    "approval": 0,
    "content": {},
    "items": [
      {
        "detail": "Consulting hours",
        "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1",
        "quantity": 10,
        "rate": "50000.00",
        "amount": "500000.00",
        "inventory_id": "55a40b4d-a23a-49aa-a417-828913e9a5c8",
        "currency_code": "NGN",
        "sku": "SKU-1001",
        "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f"
      }
    ],
    "adjustments": [
      {
        "name": "VAT",
        "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9",
        "value": "7.50",
        "type": "PERCENTAGE_RATE",
        "operation": "ADDITION",
        "amount": "37500.00"
      }
    ],
    "payment_schedule": null,
    "customer": {
      "id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
      "type": "INDIVIDUAL",
      "email": "john@example.com",
      "phone": "+2348012345678",
      "accounts": [
        {
          "bank": "Spruce Bank",
          "code": "044",
          "vat_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1",
          "is_default": true,
          "account_name": "John Doe",
          "currency_code": "NGN",
          "account_number": "1234567890"
        }
      ],
      "last_name": "Doe",
      "contact_id": "64595845-34ec-482c-b0fe-ae617a0f8335",
      "created_at": "2026-06-18T10:00:00Z",
      "first_name": "John",
      "project_id": "spruce-demo",
      "company_name": "Acme Corp",
      "display_name": "John Doe",
      "billing_address": {
        "name": "Office",
        "address_one": "12 Marina Road",
        "city": "Lagos",
        "state": "Lagos",
        "country": "Nigeria",
        "country_code": "NG",
        "post_code": "100001",
        "phone": "+2348012345678"
      },
      "shipping_address": {
        "name": "Office",
        "address_one": "12 Marina Road",
        "city": "Lagos",
        "state": "Lagos",
        "country": "Nigeria",
        "country_code": "NG",
        "post_code": "100001",
        "phone": "+2348012345678"
      },
      "payment_term_id": null
    },
    "approvals": [],
    "invoice_date": "2026-06-18T10:00:00Z",
    "due_date": "2026-07-18T10:00:00Z",
    "created_at": "2026-08-19T12:19:57.610806Z",
    "file_url": null,
    "journal_entry_id": null,
    "debit_account_id": null
  },
  "status": true,
  "message": "Successfully created and posted invoice"
}
```

**SDK Code**

```python Create and post invoice
import requests

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

payload = {
    "customer_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
    "invoice_date": "2026-06-18T10:00:00.000Z",
    "items": [
        {
            "detail": "Implementation consulting services",
            "currency_code": "NGN",
            "quantity": 10,
            "rate": 50000,
            "sku": "SKU-1001",
            "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
            "amount": 500000,
            "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1"
        }
    ],
    "debit_account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
    "sales_personnel_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
    "order_id": "ORD-1001-POST",
    "subject": "Implementation consulting services - posted on create",
    "due_date": "2026-07-18T10:00:00.000Z",
    "reverse_charge": False,
    "adjustments": [
        {
            "name": "VAT",
            "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9",
            "value": 7.5,
            "type": "PERCENTAGE_RATE",
            "operation": "ADDITION",
            "amount": 37500
        }
    ],
    "allow_post": True
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Create and post invoice
const url = 'https://api.papertracc.com/v1/invoices';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"customer_id":"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501","invoice_date":"2026-06-18T10:00:00.000Z","items":[{"detail":"Implementation consulting services","currency_code":"NGN","quantity":10,"rate":50000,"sku":"SKU-1001","account_id":"d037d299-3029-4dc7-8e72-172f80f23c4f","amount":500000,"tax_id":"78c68f6d-d734-4822-9a6c-73f517a0e5c1"}],"debit_account_id":"d037d299-3029-4dc7-8e72-172f80f23c4f","sales_personnel_id":"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501","order_id":"ORD-1001-POST","subject":"Implementation consulting services - posted on create","due_date":"2026-07-18T10:00:00.000Z","reverse_charge":false,"adjustments":[{"name":"VAT","account_id":"2b0d1461-e52e-4a1a-a69c-11801431c2c9","value":7.5,"type":"PERCENTAGE_RATE","operation":"ADDITION","amount":37500}],"allow_post":true}'
};

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

```go Create and post invoice
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"customer_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"invoice_date\": \"2026-06-18T10:00:00.000Z\",\n  \"items\": [\n    {\n      \"detail\": \"Implementation consulting services\",\n      \"currency_code\": \"NGN\",\n      \"quantity\": 10,\n      \"rate\": 50000,\n      \"sku\": \"SKU-1001\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\"\n    }\n  ],\n  \"debit_account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"sales_personnel_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"order_id\": \"ORD-1001-POST\",\n  \"subject\": \"Implementation consulting services - posted on create\",\n  \"due_date\": \"2026-07-18T10:00:00.000Z\",\n  \"reverse_charge\": false,\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\",\n      \"value\": 7.5,\n      \"type\": \"PERCENTAGE_RATE\",\n      \"operation\": \"ADDITION\",\n      \"amount\": 37500\n    }\n  ],\n  \"allow_post\": true\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 Create and post invoice
require 'uri'
require 'net/http'

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

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  \"customer_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"invoice_date\": \"2026-06-18T10:00:00.000Z\",\n  \"items\": [\n    {\n      \"detail\": \"Implementation consulting services\",\n      \"currency_code\": \"NGN\",\n      \"quantity\": 10,\n      \"rate\": 50000,\n      \"sku\": \"SKU-1001\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\"\n    }\n  ],\n  \"debit_account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"sales_personnel_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"order_id\": \"ORD-1001-POST\",\n  \"subject\": \"Implementation consulting services - posted on create\",\n  \"due_date\": \"2026-07-18T10:00:00.000Z\",\n  \"reverse_charge\": false,\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\",\n      \"value\": 7.5,\n      \"type\": \"PERCENTAGE_RATE\",\n      \"operation\": \"ADDITION\",\n      \"amount\": 37500\n    }\n  ],\n  \"allow_post\": true\n}"

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

```java Create and post invoice
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.papertracc.com/v1/invoices")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customer_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"invoice_date\": \"2026-06-18T10:00:00.000Z\",\n  \"items\": [\n    {\n      \"detail\": \"Implementation consulting services\",\n      \"currency_code\": \"NGN\",\n      \"quantity\": 10,\n      \"rate\": 50000,\n      \"sku\": \"SKU-1001\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\"\n    }\n  ],\n  \"debit_account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"sales_personnel_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"order_id\": \"ORD-1001-POST\",\n  \"subject\": \"Implementation consulting services - posted on create\",\n  \"due_date\": \"2026-07-18T10:00:00.000Z\",\n  \"reverse_charge\": false,\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\",\n      \"value\": 7.5,\n      \"type\": \"PERCENTAGE_RATE\",\n      \"operation\": \"ADDITION\",\n      \"amount\": 37500\n    }\n  ],\n  \"allow_post\": true\n}")
  .asString();
```

```php Create and post invoice
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.papertracc.com/v1/invoices', [
  'body' => '{
  "customer_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "invoice_date": "2026-06-18T10:00:00.000Z",
  "items": [
    {
      "detail": "Implementation consulting services",
      "currency_code": "NGN",
      "quantity": 10,
      "rate": 50000,
      "sku": "SKU-1001",
      "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
      "amount": 500000,
      "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1"
    }
  ],
  "debit_account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
  "sales_personnel_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "order_id": "ORD-1001-POST",
  "subject": "Implementation consulting services - posted on create",
  "due_date": "2026-07-18T10:00:00.000Z",
  "reverse_charge": false,
  "adjustments": [
    {
      "name": "VAT",
      "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9",
      "value": 7.5,
      "type": "PERCENTAGE_RATE",
      "operation": "ADDITION",
      "amount": 37500
    }
  ],
  "allow_post": true
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Create and post invoice
using RestSharp;

var client = new RestClient("https://api.papertracc.com/v1/invoices");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"customer_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"invoice_date\": \"2026-06-18T10:00:00.000Z\",\n  \"items\": [\n    {\n      \"detail\": \"Implementation consulting services\",\n      \"currency_code\": \"NGN\",\n      \"quantity\": 10,\n      \"rate\": 50000,\n      \"sku\": \"SKU-1001\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\"\n    }\n  ],\n  \"debit_account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"sales_personnel_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"order_id\": \"ORD-1001-POST\",\n  \"subject\": \"Implementation consulting services - posted on create\",\n  \"due_date\": \"2026-07-18T10:00:00.000Z\",\n  \"reverse_charge\": false,\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\",\n      \"value\": 7.5,\n      \"type\": \"PERCENTAGE_RATE\",\n      \"operation\": \"ADDITION\",\n      \"amount\": 37500\n    }\n  ],\n  \"allow_post\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create and post invoice
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "customer_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "invoice_date": "2026-06-18T10:00:00.000Z",
  "items": [
    [
      "detail": "Implementation consulting services",
      "currency_code": "NGN",
      "quantity": 10,
      "rate": 50000,
      "sku": "SKU-1001",
      "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
      "amount": 500000,
      "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1"
    ]
  ],
  "debit_account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
  "sales_personnel_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "order_id": "ORD-1001-POST",
  "subject": "Implementation consulting services - posted on create",
  "due_date": "2026-07-18T10:00:00.000Z",
  "reverse_charge": false,
  "adjustments": [
    [
      "name": "VAT",
      "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9",
      "value": 7.5,
      "type": "PERCENTAGE_RATE",
      "operation": "ADDITION",
      "amount": 37500
    ]
  ],
  "allow_post": true
] as [String : Any]

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

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

### Create and post invoice

**Request**

```json
{
  "customer_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "invoice_date": "2026-06-18T10:00:00.000Z",
  "items": [
    {
      "detail": "Implementation consulting services",
      "currency_code": "NGN",
      "quantity": 10,
      "rate": 50000,
      "sku": "SKU-1001",
      "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
      "amount": 500000,
      "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1"
    }
  ],
  "debit_account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
  "sales_personnel_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "order_id": "ORD-1001-POST",
  "subject": "Implementation consulting services - posted on create",
  "due_date": "2026-07-18T10:00:00.000Z",
  "reverse_charge": false,
  "adjustments": [
    {
      "name": "VAT",
      "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9",
      "value": 7.5,
      "type": "PERCENTAGE_RATE",
      "operation": "ADDITION",
      "amount": 37500
    }
  ],
  "allow_post": true
}
```

**Response**

```json
{
  "data": {
    "id": "1243891e-40a8-4a88-8e1f-0397adcbf85e",
    "invoice_reference": "INV-0001",
    "project_id": "spruce-demo",
    "prepared_by": "user-token-hash",
    "amount": "537500.00",
    "status": "DRAFT",
    "journal_status": "UNPOSTED",
    "currency_code": "NGN",
    "exchange_rate": "1.00",
    "order_id": "ORD-1001",
    "reverse_charge": false,
    "is_overdue": false,
    "approval": 0,
    "content": {},
    "items": [
      {
        "detail": "Consulting hours",
        "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1",
        "quantity": 10,
        "rate": "50000.00",
        "amount": "500000.00",
        "inventory_id": "55a40b4d-a23a-49aa-a417-828913e9a5c8",
        "currency_code": "NGN",
        "sku": "SKU-1001",
        "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f"
      }
    ],
    "payment_schedule": null,
    "customer": {
      "id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
      "type": "INDIVIDUAL",
      "email": "john@example.com",
      "phone": "+2348012345678",
      "accounts": [
        {
          "bank": "Spruce Bank",
          "code": "044",
          "vat_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1",
          "is_default": true,
          "account_name": "John Doe",
          "currency_code": "NGN",
          "account_number": "1234567890"
        }
      ],
      "last_name": "Doe",
      "contact_id": "64595845-34ec-482c-b0fe-ae617a0f8335",
      "created_at": "2026-06-18T10:00:00Z",
      "first_name": "John",
      "project_id": "spruce-demo",
      "company_name": "Acme Corp",
      "display_name": "John Doe",
      "billing_address": {
        "name": "Office",
        "address_one": "12 Marina Road",
        "city": "Lagos",
        "state": "Lagos",
        "country": "Nigeria",
        "country_code": "NG",
        "post_code": "100001",
        "phone": "+2348012345678"
      },
      "shipping_address": {
        "name": "Office",
        "address_one": "12 Marina Road",
        "city": "Lagos",
        "state": "Lagos",
        "country": "Nigeria",
        "country_code": "NG",
        "post_code": "100001",
        "phone": "+2348012345678"
      },
      "payment_term_id": null
    },
    "approvals": [],
    "invoice_date": "2026-06-18T10:00:00Z",
    "due_date": "2026-07-18T10:00:00Z",
    "created_at": "2026-06-18T10:00:00Z",
    "sales_personnel": null
  },
  "status": true,
  "message": "Invoice created but could not be posted"
}
```

**SDK Code**

```python Create and post invoice
import requests

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

payload = {
    "customer_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
    "invoice_date": "2026-06-18T10:00:00.000Z",
    "items": [
        {
            "detail": "Implementation consulting services",
            "currency_code": "NGN",
            "quantity": 10,
            "rate": 50000,
            "sku": "SKU-1001",
            "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
            "amount": 500000,
            "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1"
        }
    ],
    "debit_account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
    "sales_personnel_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
    "order_id": "ORD-1001-POST",
    "subject": "Implementation consulting services - posted on create",
    "due_date": "2026-07-18T10:00:00.000Z",
    "reverse_charge": False,
    "adjustments": [
        {
            "name": "VAT",
            "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9",
            "value": 7.5,
            "type": "PERCENTAGE_RATE",
            "operation": "ADDITION",
            "amount": 37500
        }
    ],
    "allow_post": True
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Create and post invoice
const url = 'https://api.papertracc.com/v1/invoices';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"customer_id":"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501","invoice_date":"2026-06-18T10:00:00.000Z","items":[{"detail":"Implementation consulting services","currency_code":"NGN","quantity":10,"rate":50000,"sku":"SKU-1001","account_id":"d037d299-3029-4dc7-8e72-172f80f23c4f","amount":500000,"tax_id":"78c68f6d-d734-4822-9a6c-73f517a0e5c1"}],"debit_account_id":"d037d299-3029-4dc7-8e72-172f80f23c4f","sales_personnel_id":"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501","order_id":"ORD-1001-POST","subject":"Implementation consulting services - posted on create","due_date":"2026-07-18T10:00:00.000Z","reverse_charge":false,"adjustments":[{"name":"VAT","account_id":"2b0d1461-e52e-4a1a-a69c-11801431c2c9","value":7.5,"type":"PERCENTAGE_RATE","operation":"ADDITION","amount":37500}],"allow_post":true}'
};

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

```go Create and post invoice
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"customer_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"invoice_date\": \"2026-06-18T10:00:00.000Z\",\n  \"items\": [\n    {\n      \"detail\": \"Implementation consulting services\",\n      \"currency_code\": \"NGN\",\n      \"quantity\": 10,\n      \"rate\": 50000,\n      \"sku\": \"SKU-1001\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\"\n    }\n  ],\n  \"debit_account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"sales_personnel_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"order_id\": \"ORD-1001-POST\",\n  \"subject\": \"Implementation consulting services - posted on create\",\n  \"due_date\": \"2026-07-18T10:00:00.000Z\",\n  \"reverse_charge\": false,\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\",\n      \"value\": 7.5,\n      \"type\": \"PERCENTAGE_RATE\",\n      \"operation\": \"ADDITION\",\n      \"amount\": 37500\n    }\n  ],\n  \"allow_post\": true\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 Create and post invoice
require 'uri'
require 'net/http'

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

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  \"customer_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"invoice_date\": \"2026-06-18T10:00:00.000Z\",\n  \"items\": [\n    {\n      \"detail\": \"Implementation consulting services\",\n      \"currency_code\": \"NGN\",\n      \"quantity\": 10,\n      \"rate\": 50000,\n      \"sku\": \"SKU-1001\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\"\n    }\n  ],\n  \"debit_account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"sales_personnel_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"order_id\": \"ORD-1001-POST\",\n  \"subject\": \"Implementation consulting services - posted on create\",\n  \"due_date\": \"2026-07-18T10:00:00.000Z\",\n  \"reverse_charge\": false,\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\",\n      \"value\": 7.5,\n      \"type\": \"PERCENTAGE_RATE\",\n      \"operation\": \"ADDITION\",\n      \"amount\": 37500\n    }\n  ],\n  \"allow_post\": true\n}"

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

```java Create and post invoice
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.papertracc.com/v1/invoices")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customer_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"invoice_date\": \"2026-06-18T10:00:00.000Z\",\n  \"items\": [\n    {\n      \"detail\": \"Implementation consulting services\",\n      \"currency_code\": \"NGN\",\n      \"quantity\": 10,\n      \"rate\": 50000,\n      \"sku\": \"SKU-1001\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\"\n    }\n  ],\n  \"debit_account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"sales_personnel_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"order_id\": \"ORD-1001-POST\",\n  \"subject\": \"Implementation consulting services - posted on create\",\n  \"due_date\": \"2026-07-18T10:00:00.000Z\",\n  \"reverse_charge\": false,\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\",\n      \"value\": 7.5,\n      \"type\": \"PERCENTAGE_RATE\",\n      \"operation\": \"ADDITION\",\n      \"amount\": 37500\n    }\n  ],\n  \"allow_post\": true\n}")
  .asString();
```

```php Create and post invoice
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.papertracc.com/v1/invoices', [
  'body' => '{
  "customer_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "invoice_date": "2026-06-18T10:00:00.000Z",
  "items": [
    {
      "detail": "Implementation consulting services",
      "currency_code": "NGN",
      "quantity": 10,
      "rate": 50000,
      "sku": "SKU-1001",
      "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
      "amount": 500000,
      "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1"
    }
  ],
  "debit_account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
  "sales_personnel_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "order_id": "ORD-1001-POST",
  "subject": "Implementation consulting services - posted on create",
  "due_date": "2026-07-18T10:00:00.000Z",
  "reverse_charge": false,
  "adjustments": [
    {
      "name": "VAT",
      "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9",
      "value": 7.5,
      "type": "PERCENTAGE_RATE",
      "operation": "ADDITION",
      "amount": 37500
    }
  ],
  "allow_post": true
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Create and post invoice
using RestSharp;

var client = new RestClient("https://api.papertracc.com/v1/invoices");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"customer_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"invoice_date\": \"2026-06-18T10:00:00.000Z\",\n  \"items\": [\n    {\n      \"detail\": \"Implementation consulting services\",\n      \"currency_code\": \"NGN\",\n      \"quantity\": 10,\n      \"rate\": 50000,\n      \"sku\": \"SKU-1001\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\"\n    }\n  ],\n  \"debit_account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"sales_personnel_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"order_id\": \"ORD-1001-POST\",\n  \"subject\": \"Implementation consulting services - posted on create\",\n  \"due_date\": \"2026-07-18T10:00:00.000Z\",\n  \"reverse_charge\": false,\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\",\n      \"value\": 7.5,\n      \"type\": \"PERCENTAGE_RATE\",\n      \"operation\": \"ADDITION\",\n      \"amount\": 37500\n    }\n  ],\n  \"allow_post\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create and post invoice
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "customer_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "invoice_date": "2026-06-18T10:00:00.000Z",
  "items": [
    [
      "detail": "Implementation consulting services",
      "currency_code": "NGN",
      "quantity": 10,
      "rate": 50000,
      "sku": "SKU-1001",
      "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
      "amount": 500000,
      "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1"
    ]
  ],
  "debit_account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
  "sales_personnel_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "order_id": "ORD-1001-POST",
  "subject": "Implementation consulting services - posted on create",
  "due_date": "2026-07-18T10:00:00.000Z",
  "reverse_charge": false,
  "adjustments": [
    [
      "name": "VAT",
      "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9",
      "value": 7.5,
      "type": "PERCENTAGE_RATE",
      "operation": "ADDITION",
      "amount": 37500
    ]
  ],
  "allow_post": true
] as [String : Any]

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

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

### Create a draft invoice on a payment term

**Request**

```json
{
  "customer_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "invoice_date": "2026-06-18T10:00:00.000Z",
  "items": [
    {
      "detail": "Implementation consulting services",
      "currency_code": "NGN",
      "quantity": 10,
      "rate": 50000,
      "sku": "SKU-1001",
      "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
      "amount": 500000,
      "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1"
    }
  ],
  "debit_account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
  "sales_personnel_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "order_id": "ORD-1001",
  "subject": "Implementation consulting services",
  "payment_term_id": "a4d2e9f1-6b3c-4e8a-b7d5-1c9f0e2a3b47",
  "reverse_charge": false,
  "adjustments": [
    {
      "name": "VAT",
      "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9",
      "value": 7.5,
      "type": "PERCENTAGE_RATE",
      "operation": "ADDITION",
      "amount": 37500
    }
  ],
  "allow_post": false
}
```

**Response**

```json
{
  "data": {
    "id": "1243891e-40a8-4a88-8e1f-0397adcbf85e",
    "invoice_reference": "INV-0001",
    "project_id": "spruce-demo",
    "prepared_by": "user-token-hash",
    "amount": "537500.00",
    "total_paid": "0.00",
    "payment_status": "UNPAID",
    "status": "DRAFT",
    "journal_status": "UNPOSTED",
    "currency_code": "NGN",
    "exchange_rate": "1.00",
    "order_id": "ORD-1001",
    "reverse_charge": false,
    "is_overdue": false,
    "approval": 0,
    "content": {},
    "items": [
      {
        "detail": "Consulting hours",
        "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1",
        "quantity": 10,
        "rate": "50000.00",
        "amount": "500000.00",
        "inventory_id": "55a40b4d-a23a-49aa-a417-828913e9a5c8",
        "currency_code": "NGN",
        "sku": "SKU-1001",
        "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f"
      }
    ],
    "adjustments": [
      {
        "name": "VAT",
        "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9",
        "value": "7.50",
        "type": "PERCENTAGE_RATE",
        "operation": "ADDITION",
        "amount": "37500.00"
      }
    ],
    "payment_schedule": null,
    "customer": {
      "id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
      "type": "INDIVIDUAL",
      "email": "john@example.com",
      "phone": "+2348012345678",
      "accounts": [
        {
          "bank": "Spruce Bank",
          "code": "044",
          "vat_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1",
          "is_default": true,
          "account_name": "John Doe",
          "currency_code": "NGN",
          "account_number": "1234567890"
        }
      ],
      "last_name": "Doe",
      "contact_id": "64595845-34ec-482c-b0fe-ae617a0f8335",
      "created_at": "2026-06-18T10:00:00Z",
      "first_name": "John",
      "project_id": "spruce-demo",
      "company_name": "Acme Corp",
      "display_name": "John Doe",
      "billing_address": {
        "name": "Office",
        "address_one": "12 Marina Road",
        "city": "Lagos",
        "state": "Lagos",
        "country": "Nigeria",
        "country_code": "NG",
        "post_code": "100001",
        "phone": "+2348012345678"
      },
      "shipping_address": {
        "name": "Office",
        "address_one": "12 Marina Road",
        "city": "Lagos",
        "state": "Lagos",
        "country": "Nigeria",
        "country_code": "NG",
        "post_code": "100001",
        "phone": "+2348012345678"
      },
      "payment_term_id": null
    },
    "approvals": [],
    "invoice_date": "2026-06-18T10:00:00Z",
    "due_date": "2026-07-18T10:00:00Z",
    "created_at": "2026-08-19T12:19:57.610806Z",
    "file_url": null,
    "journal_entry_id": null,
    "debit_account_id": null
  },
  "status": true,
  "message": "Successfully created invoice"
}
```

**SDK Code**

```python Create a draft invoice on a payment term
import requests

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

payload = {
    "customer_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
    "invoice_date": "2026-06-18T10:00:00.000Z",
    "items": [
        {
            "detail": "Implementation consulting services",
            "currency_code": "NGN",
            "quantity": 10,
            "rate": 50000,
            "sku": "SKU-1001",
            "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
            "amount": 500000,
            "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1"
        }
    ],
    "debit_account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
    "sales_personnel_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
    "order_id": "ORD-1001",
    "subject": "Implementation consulting services",
    "payment_term_id": "a4d2e9f1-6b3c-4e8a-b7d5-1c9f0e2a3b47",
    "reverse_charge": False,
    "adjustments": [
        {
            "name": "VAT",
            "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9",
            "value": 7.5,
            "type": "PERCENTAGE_RATE",
            "operation": "ADDITION",
            "amount": 37500
        }
    ],
    "allow_post": False
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Create a draft invoice on a payment term
const url = 'https://api.papertracc.com/v1/invoices';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"customer_id":"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501","invoice_date":"2026-06-18T10:00:00.000Z","items":[{"detail":"Implementation consulting services","currency_code":"NGN","quantity":10,"rate":50000,"sku":"SKU-1001","account_id":"d037d299-3029-4dc7-8e72-172f80f23c4f","amount":500000,"tax_id":"78c68f6d-d734-4822-9a6c-73f517a0e5c1"}],"debit_account_id":"d037d299-3029-4dc7-8e72-172f80f23c4f","sales_personnel_id":"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501","order_id":"ORD-1001","subject":"Implementation consulting services","payment_term_id":"a4d2e9f1-6b3c-4e8a-b7d5-1c9f0e2a3b47","reverse_charge":false,"adjustments":[{"name":"VAT","account_id":"2b0d1461-e52e-4a1a-a69c-11801431c2c9","value":7.5,"type":"PERCENTAGE_RATE","operation":"ADDITION","amount":37500}],"allow_post":false}'
};

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

```go Create a draft invoice on a payment term
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"customer_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"invoice_date\": \"2026-06-18T10:00:00.000Z\",\n  \"items\": [\n    {\n      \"detail\": \"Implementation consulting services\",\n      \"currency_code\": \"NGN\",\n      \"quantity\": 10,\n      \"rate\": 50000,\n      \"sku\": \"SKU-1001\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\"\n    }\n  ],\n  \"debit_account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"sales_personnel_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"order_id\": \"ORD-1001\",\n  \"subject\": \"Implementation consulting services\",\n  \"payment_term_id\": \"a4d2e9f1-6b3c-4e8a-b7d5-1c9f0e2a3b47\",\n  \"reverse_charge\": false,\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\",\n      \"value\": 7.5,\n      \"type\": \"PERCENTAGE_RATE\",\n      \"operation\": \"ADDITION\",\n      \"amount\": 37500\n    }\n  ],\n  \"allow_post\": 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 Create a draft invoice on a payment term
require 'uri'
require 'net/http'

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

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  \"customer_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"invoice_date\": \"2026-06-18T10:00:00.000Z\",\n  \"items\": [\n    {\n      \"detail\": \"Implementation consulting services\",\n      \"currency_code\": \"NGN\",\n      \"quantity\": 10,\n      \"rate\": 50000,\n      \"sku\": \"SKU-1001\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\"\n    }\n  ],\n  \"debit_account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"sales_personnel_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"order_id\": \"ORD-1001\",\n  \"subject\": \"Implementation consulting services\",\n  \"payment_term_id\": \"a4d2e9f1-6b3c-4e8a-b7d5-1c9f0e2a3b47\",\n  \"reverse_charge\": false,\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\",\n      \"value\": 7.5,\n      \"type\": \"PERCENTAGE_RATE\",\n      \"operation\": \"ADDITION\",\n      \"amount\": 37500\n    }\n  ],\n  \"allow_post\": false\n}"

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

```java Create a draft invoice on a payment term
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.papertracc.com/v1/invoices")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customer_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"invoice_date\": \"2026-06-18T10:00:00.000Z\",\n  \"items\": [\n    {\n      \"detail\": \"Implementation consulting services\",\n      \"currency_code\": \"NGN\",\n      \"quantity\": 10,\n      \"rate\": 50000,\n      \"sku\": \"SKU-1001\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\"\n    }\n  ],\n  \"debit_account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"sales_personnel_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"order_id\": \"ORD-1001\",\n  \"subject\": \"Implementation consulting services\",\n  \"payment_term_id\": \"a4d2e9f1-6b3c-4e8a-b7d5-1c9f0e2a3b47\",\n  \"reverse_charge\": false,\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\",\n      \"value\": 7.5,\n      \"type\": \"PERCENTAGE_RATE\",\n      \"operation\": \"ADDITION\",\n      \"amount\": 37500\n    }\n  ],\n  \"allow_post\": false\n}")
  .asString();
```

```php Create a draft invoice on a payment term
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.papertracc.com/v1/invoices', [
  'body' => '{
  "customer_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "invoice_date": "2026-06-18T10:00:00.000Z",
  "items": [
    {
      "detail": "Implementation consulting services",
      "currency_code": "NGN",
      "quantity": 10,
      "rate": 50000,
      "sku": "SKU-1001",
      "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
      "amount": 500000,
      "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1"
    }
  ],
  "debit_account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
  "sales_personnel_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "order_id": "ORD-1001",
  "subject": "Implementation consulting services",
  "payment_term_id": "a4d2e9f1-6b3c-4e8a-b7d5-1c9f0e2a3b47",
  "reverse_charge": false,
  "adjustments": [
    {
      "name": "VAT",
      "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9",
      "value": 7.5,
      "type": "PERCENTAGE_RATE",
      "operation": "ADDITION",
      "amount": 37500
    }
  ],
  "allow_post": false
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Create a draft invoice on a payment term
using RestSharp;

var client = new RestClient("https://api.papertracc.com/v1/invoices");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"customer_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"invoice_date\": \"2026-06-18T10:00:00.000Z\",\n  \"items\": [\n    {\n      \"detail\": \"Implementation consulting services\",\n      \"currency_code\": \"NGN\",\n      \"quantity\": 10,\n      \"rate\": 50000,\n      \"sku\": \"SKU-1001\",\n      \"account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n      \"amount\": 500000,\n      \"tax_id\": \"78c68f6d-d734-4822-9a6c-73f517a0e5c1\"\n    }\n  ],\n  \"debit_account_id\": \"d037d299-3029-4dc7-8e72-172f80f23c4f\",\n  \"sales_personnel_id\": \"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501\",\n  \"order_id\": \"ORD-1001\",\n  \"subject\": \"Implementation consulting services\",\n  \"payment_term_id\": \"a4d2e9f1-6b3c-4e8a-b7d5-1c9f0e2a3b47\",\n  \"reverse_charge\": false,\n  \"adjustments\": [\n    {\n      \"name\": \"VAT\",\n      \"account_id\": \"2b0d1461-e52e-4a1a-a69c-11801431c2c9\",\n      \"value\": 7.5,\n      \"type\": \"PERCENTAGE_RATE\",\n      \"operation\": \"ADDITION\",\n      \"amount\": 37500\n    }\n  ],\n  \"allow_post\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create a draft invoice on a payment term
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "customer_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "invoice_date": "2026-06-18T10:00:00.000Z",
  "items": [
    [
      "detail": "Implementation consulting services",
      "currency_code": "NGN",
      "quantity": 10,
      "rate": 50000,
      "sku": "SKU-1001",
      "account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
      "amount": 500000,
      "tax_id": "78c68f6d-d734-4822-9a6c-73f517a0e5c1"
    ]
  ],
  "debit_account_id": "d037d299-3029-4dc7-8e72-172f80f23c4f",
  "sales_personnel_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "order_id": "ORD-1001",
  "subject": "Implementation consulting services",
  "payment_term_id": "a4d2e9f1-6b3c-4e8a-b7d5-1c9f0e2a3b47",
  "reverse_charge": false,
  "adjustments": [
    [
      "name": "VAT",
      "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9",
      "value": 7.5,
      "type": "PERCENTAGE_RATE",
      "operation": "ADDITION",
      "amount": 37500
    ]
  ],
  "allow_post": false
] as [String : Any]

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

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