> 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 project must have `allow_create_and_post` enabled, otherwise the request is rejected with 400).

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /invoices:
    post:
      operationId: Create Invoice
      summary: Create Invoice
      description: >-
        Creates an invoice. `items` is required. `allow_post` is optional; when
        true, the invoice is posted immediately after creation (the project must
        have `allow_create_and_post` enabled, otherwise the request is rejected
        with 400).
      tags:
        - invoices
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Sales_Invoices_Create
                  Invoice_Response_201
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/InvoicesPostRequestBodyContentApplicationJsonSchemaItemsItems
                subject:
                  type: string
                due_date:
                  type: string
                  format: date-time
                order_id:
                  type: string
                allow_post:
                  type: boolean
                adjustments:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/InvoicesPostRequestBodyContentApplicationJsonSchemaAdjustmentsItems
                customer_id:
                  type: string
                  format: uuid
                invoice_date:
                  type: string
                  format: date-time
                reverse_charge:
                  type: boolean
                sales_personnel_id:
                  type: string
                  format: uuid
              required:
                - items
                - subject
                - due_date
                - order_id
                - allow_post
                - adjustments
                - customer_id
                - invoice_date
                - reverse_charge
                - sales_personnel_id
servers:
  - url: https://api.papertracc.com/v1
    description: Production
  - url: https://api.papertracc.com/rc-1
    description: Release Candidate 1
components:
  schemas:
    InvoicesPostRequestBodyContentApplicationJsonSchemaItemsItems:
      type: object
      properties:
        rate:
          type: integer
        amount:
          type: integer
        detail:
          type: string
        tax_id:
          type: string
          format: uuid
        quantity:
          type: integer
        account_id:
          type: string
          format: uuid
        inventory_id:
          type: string
          format: uuid
        currency_code:
          type: string
      required:
        - rate
        - amount
        - detail
        - tax_id
        - quantity
        - account_id
        - inventory_id
        - currency_code
      title: InvoicesPostRequestBodyContentApplicationJsonSchemaItemsItems
    InvoicesPostRequestBodyContentApplicationJsonSchemaAdjustmentsItems:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
        value:
          type: number
          format: double
        amount:
          type: integer
        operation:
          type: string
        account_id:
          type: string
          format: uuid
      required:
        - name
        - type
        - value
        - amount
        - operation
        - account_id
      title: InvoicesPostRequestBodyContentApplicationJsonSchemaAdjustmentsItems
    InvoicesPostResponsesContentApplicationJsonSchemaDataItemsItems:
      type: object
      properties:
        rate:
          type: integer
        amount:
          type: integer
        detail:
          type: string
        tax_id:
          type: string
          format: uuid
        quantity:
          type: integer
        account_id:
          type: string
          format: uuid
        inventory_id:
          type: string
          format: uuid
        currency_code:
          type: string
      required:
        - rate
        - amount
        - detail
        - tax_id
        - quantity
        - account_id
        - inventory_id
        - currency_code
      title: InvoicesPostResponsesContentApplicationJsonSchemaDataItemsItems
    InvoicesPostResponsesContentApplicationJsonSchemaDataContent:
      type: object
      properties: {}
      title: InvoicesPostResponsesContentApplicationJsonSchemaDataContent
    InvoicesPostResponsesContentApplicationJsonSchemaDataCustomerAccountsItems:
      type: object
      properties:
        bank:
          type: string
        code:
          type: string
        vat_id:
          type: string
          format: uuid
        is_default:
          type: boolean
        account_name:
          type: string
        currency_code:
          type: string
        account_number:
          type: string
      required:
        - bank
        - code
        - vat_id
        - is_default
        - account_name
        - currency_code
        - account_number
      title: >-
        InvoicesPostResponsesContentApplicationJsonSchemaDataCustomerAccountsItems
    InvoicesPostResponsesContentApplicationJsonSchemaDataCustomerBillingAddress:
      type: object
      properties:
        city:
          type: string
        name:
          type: string
        phone:
          type: string
        state:
          type: string
        country:
          type: string
        post_code:
          type: string
        address_one:
          type: string
        country_code:
          type: string
      required:
        - city
        - name
        - phone
        - state
        - country
        - post_code
        - address_one
        - country_code
      title: >-
        InvoicesPostResponsesContentApplicationJsonSchemaDataCustomerBillingAddress
    InvoicesPostResponsesContentApplicationJsonSchemaDataCustomerShippingAddress:
      type: object
      properties:
        city:
          type: string
        name:
          type: string
        phone:
          type: string
        state:
          type: string
        country:
          type: string
        post_code:
          type: string
        address_one:
          type: string
        country_code:
          type: string
      required:
        - city
        - name
        - phone
        - state
        - country
        - post_code
        - address_one
        - country_code
      title: >-
        InvoicesPostResponsesContentApplicationJsonSchemaDataCustomerShippingAddress
    InvoicesPostResponsesContentApplicationJsonSchemaDataCustomer:
      type: object
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
        email:
          type: string
          format: email
        phone:
          type: string
        accounts:
          type: array
          items:
            $ref: >-
              #/components/schemas/InvoicesPostResponsesContentApplicationJsonSchemaDataCustomerAccountsItems
        last_name:
          type: string
        contact_id:
          type: string
          format: uuid
        created_at:
          type: string
          format: date-time
        first_name:
          type: string
        project_id:
          type: string
        company_name:
          type: string
        display_name:
          type: string
        billing_address:
          $ref: >-
            #/components/schemas/InvoicesPostResponsesContentApplicationJsonSchemaDataCustomerBillingAddress
        shipping_address:
          $ref: >-
            #/components/schemas/InvoicesPostResponsesContentApplicationJsonSchemaDataCustomerShippingAddress
      required:
        - id
        - type
        - email
        - phone
        - accounts
        - last_name
        - contact_id
        - created_at
        - first_name
        - project_id
        - company_name
        - display_name
        - billing_address
        - shipping_address
      title: InvoicesPostResponsesContentApplicationJsonSchemaDataCustomer
    InvoicesPostResponsesContentApplicationJsonSchemaData:
      type: object
      properties:
        id:
          type: string
          format: uuid
        items:
          type: array
          items:
            $ref: >-
              #/components/schemas/InvoicesPostResponsesContentApplicationJsonSchemaDataItemsItems
        amount:
          type: string
        status:
          type: string
        content:
          $ref: >-
            #/components/schemas/InvoicesPostResponsesContentApplicationJsonSchemaDataContent
        approval:
          type: integer
        customer:
          $ref: >-
            #/components/schemas/InvoicesPostResponsesContentApplicationJsonSchemaDataCustomer
        due_date:
          type: string
          format: date-time
        file_url:
          description: Any type
        order_id:
          type: string
        approvals:
          type: array
          items:
            description: Any type
        created_at:
          type: string
          format: date-time
        is_overdue:
          type: boolean
        project_id:
          type: string
        prepared_by:
          type: string
        invoice_date:
          type: string
          format: date-time
        currency_code:
          type: string
        exchange_rate:
          type: string
        journal_status:
          type: string
        reverse_charge:
          type: boolean
        sales_personnel:
          description: Any type
        debit_account_id:
          description: Any type
        journal_entry_id:
          description: Any type
        invoice_reference:
          type: string
      required:
        - id
        - items
        - amount
        - status
        - content
        - approval
        - customer
        - due_date
        - order_id
        - approvals
        - created_at
        - is_overdue
        - project_id
        - prepared_by
        - invoice_date
        - currency_code
        - exchange_rate
        - journal_status
        - reverse_charge
        - invoice_reference
      title: InvoicesPostResponsesContentApplicationJsonSchemaData
    Sales_Invoices_Create Invoice_Response_201:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/InvoicesPostResponsesContentApplicationJsonSchemaData
        status:
          type: boolean
        message:
          type: string
      required:
        - data
        - status
        - message
      title: Sales_Invoices_Create Invoice_Response_201
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    identityAuth:
      type: apiKey
      in: header
      name: identity
      description: The identity for the active project.

```

## Examples

### 201 Created



**Request**

```json
undefined
```

**Response**

```json
{
  "data": {
    "id": "1243891e-40a8-4a88-8e1f-0397adcbf85e",
    "items": [
      {
        "rate": 50000,
        "amount": 500000,
        "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"
      }
    ],
    "amount": "537500.00",
    "status": "DRAFT",
    "content": {},
    "approval": 0,
    "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": {
        "city": "Lagos",
        "name": "Office",
        "phone": "+2348012345678",
        "state": "Lagos",
        "country": "Nigeria",
        "post_code": "100001",
        "address_one": "12 Marina Road",
        "country_code": "NG"
      },
      "shipping_address": {
        "city": "Lagos",
        "name": "Office",
        "phone": "+2348012345678",
        "state": "Lagos",
        "country": "Nigeria",
        "post_code": "100001",
        "address_one": "12 Marina Road",
        "country_code": "NG"
      }
    },
    "due_date": "2026-07-18T10:00:00Z",
    "order_id": "ORD-1001",
    "approvals": [],
    "created_at": "2026-06-18T10:00:00Z",
    "is_overdue": false,
    "project_id": "spruce-demo",
    "prepared_by": "user-token-hash",
    "invoice_date": "2026-06-18T10:00:00Z",
    "currency_code": "NGN",
    "exchange_rate": "1.00",
    "journal_status": "UNPOSTED",
    "reverse_charge": false,
    "invoice_reference": "INV-0001"
  },
  "status": true,
  "message": "Successfully created invoice"
}
```

**SDK Code**

```python 201 Created
import requests

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

headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 201 Created
const url = 'https://api.papertracc.com/v1/invoices';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: undefined
};

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

```go 201 Created
package main

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

func main() {

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

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

	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 201 Created
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'

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

```java 201 Created
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")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.papertracc.com/v1/invoices', [
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp 201 Created
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");
IRestResponse response = client.Execute(request);
```

```swift 201 Created
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]

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

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

### 201 Created (Created and Posted)



**Request**

```json
undefined
```

**Response**

```json
{
  "data": {
    "id": "1243891e-40a8-4a88-8e1f-0397adcbf85e",
    "items": [
      {
        "rate": 50000,
        "amount": 500000,
        "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"
      }
    ],
    "amount": "537500.00",
    "status": "POSTED",
    "content": {},
    "approval": 0,
    "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": {
        "city": "Lagos",
        "name": "Office",
        "phone": "+2348012345678",
        "state": "Lagos",
        "country": "Nigeria",
        "post_code": "100001",
        "address_one": "12 Marina Road",
        "country_code": "NG"
      },
      "shipping_address": {
        "city": "Lagos",
        "name": "Office",
        "phone": "+2348012345678",
        "state": "Lagos",
        "country": "Nigeria",
        "post_code": "100001",
        "address_one": "12 Marina Road",
        "country_code": "NG"
      }
    },
    "due_date": "2026-07-18T10:00:00Z",
    "order_id": "ORD-1001",
    "approvals": [],
    "created_at": "2026-06-18T10:00:00Z",
    "is_overdue": false,
    "project_id": "spruce-demo",
    "prepared_by": "user-token-hash",
    "invoice_date": "2026-06-18T10:00:00Z",
    "currency_code": "NGN",
    "exchange_rate": "1.00",
    "journal_status": "POSTED",
    "reverse_charge": false,
    "invoice_reference": "INV-0001"
  },
  "status": true,
  "message": "Successfully created and posted invoice"
}
```

**SDK Code**

```python 201 Created (Created and Posted)
import requests

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

headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 201 Created (Created and Posted)
const url = 'https://api.papertracc.com/v1/invoices';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: undefined
};

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

```go 201 Created (Created and Posted)
package main

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

func main() {

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

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

	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 201 Created (Created and Posted)
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'

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

```java 201 Created (Created and Posted)
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")
  .asString();
```

```php 201 Created (Created and Posted)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.papertracc.com/v1/invoices', [
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp 201 Created (Created and Posted)
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");
IRestResponse response = client.Execute(request);
```

```swift 201 Created (Created and Posted)
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]

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

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

### Sales_Invoices_Create Invoice_example



**Request**

```json
undefined
```

**Response**

```json
{
  "data": {
    "id": "1243891e-40a8-4a88-8e1f-0397adcbf85e",
    "items": [
      {
        "rate": 50000,
        "amount": 500000,
        "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"
      }
    ],
    "amount": "537500.00",
    "status": "DRAFT",
    "content": {},
    "approval": 0,
    "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": {
        "city": "Lagos",
        "name": "Office",
        "phone": "+2348012345678",
        "state": "Lagos",
        "country": "Nigeria",
        "post_code": "100001",
        "address_one": "12 Marina Road",
        "country_code": "NG"
      },
      "shipping_address": {
        "city": "Lagos",
        "name": "Office",
        "phone": "+2348012345678",
        "state": "Lagos",
        "country": "Nigeria",
        "post_code": "100001",
        "address_one": "12 Marina Road",
        "country_code": "NG"
      }
    },
    "due_date": "2026-07-18T10:00:00Z",
    "order_id": "ORD-1001",
    "approvals": [],
    "created_at": "2026-06-18T10:00:00Z",
    "is_overdue": false,
    "project_id": "spruce-demo",
    "prepared_by": "user-token-hash",
    "invoice_date": "2026-06-18T10:00:00Z",
    "currency_code": "NGN",
    "exchange_rate": "1.00",
    "journal_status": "UNPOSTED",
    "reverse_charge": false,
    "invoice_reference": "INV-0001"
  },
  "status": true,
  "message": "Invoice created but could not be posted"
}
```

**SDK Code**

```python Sales_Invoices_Create Invoice_example
import requests

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

headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Sales_Invoices_Create Invoice_example
const url = 'https://api.papertracc.com/v1/invoices';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: undefined
};

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

```go Sales_Invoices_Create Invoice_example
package main

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

func main() {

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

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

	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 Sales_Invoices_Create Invoice_example
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'

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

```java Sales_Invoices_Create Invoice_example
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")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.papertracc.com/v1/invoices', [
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Sales_Invoices_Create Invoice_example
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");
IRestResponse response = client.Execute(request);
```

```swift Sales_Invoices_Create Invoice_example
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]

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

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



**Request**

```json
{
  "items": [
    {
      "rate": 50000,
      "amount": 500000,
      "detail": "Implementation consulting services",
      "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"
    }
  ],
  "subject": "Implementation consulting services",
  "due_date": "2026-07-18T10:00:00.000Z",
  "order_id": "ORD-1001",
  "allow_post": false,
  "adjustments": [
    {
      "name": "VAT",
      "type": "PERCENTAGE_RATE",
      "value": 7.5,
      "amount": 37500,
      "operation": "ADDITION",
      "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9"
    }
  ],
  "customer_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
  "invoice_date": "2026-06-18T10:00:00.000Z",
  "reverse_charge": false,
  "sales_personnel_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501"
}
```

**Response**

```json
{
  "data": {
    "id": "1243891e-40a8-4a88-8e1f-0397adcbf85e",
    "items": [
      {
        "rate": 50000,
        "amount": 500000,
        "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"
      }
    ],
    "amount": "537500.00",
    "status": "DRAFT",
    "content": {},
    "approval": 0,
    "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": {
        "city": "Lagos",
        "name": "Office",
        "phone": "+2348012345678",
        "state": "Lagos",
        "country": "Nigeria",
        "post_code": "100001",
        "address_one": "12 Marina Road",
        "country_code": "NG"
      },
      "shipping_address": {
        "city": "Lagos",
        "name": "Office",
        "phone": "+2348012345678",
        "state": "Lagos",
        "country": "Nigeria",
        "post_code": "100001",
        "address_one": "12 Marina Road",
        "country_code": "NG"
      }
    },
    "due_date": "2026-07-18T10:00:00Z",
    "order_id": "ORD-1001",
    "approvals": [],
    "created_at": "2026-06-18T10:00:00Z",
    "is_overdue": false,
    "project_id": "spruce-demo",
    "prepared_by": "user-token-hash",
    "invoice_date": "2026-06-18T10:00:00Z",
    "currency_code": "NGN",
    "exchange_rate": "1.00",
    "journal_status": "UNPOSTED",
    "reverse_charge": false,
    "invoice_reference": "INV-0001"
  },
  "status": true,
  "message": "Successfully created invoice"
}
```

**SDK Code**

```python Create a draft invoice
import requests

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

payload = {
    "items": [
        {
            "rate": 50000,
            "amount": 500000,
            "detail": "Implementation consulting services",
            "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"
        }
    ],
    "subject": "Implementation consulting services",
    "due_date": "2026-07-18T10:00:00.000Z",
    "order_id": "ORD-1001",
    "allow_post": False,
    "adjustments": [
        {
            "name": "VAT",
            "type": "PERCENTAGE_RATE",
            "value": 7.5,
            "amount": 37500,
            "operation": "ADDITION",
            "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9"
        }
    ],
    "customer_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
    "invoice_date": "2026-06-18T10:00:00.000Z",
    "reverse_charge": False,
    "sales_personnel_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501"
}
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: '{"items":[{"rate":50000,"amount":500000,"detail":"Implementation consulting services","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"}],"subject":"Implementation consulting services","due_date":"2026-07-18T10:00:00.000Z","order_id":"ORD-1001","allow_post":false,"adjustments":[{"name":"VAT","type":"PERCENTAGE_RATE","value":7.5,"amount":37500,"operation":"ADDITION","account_id":"2b0d1461-e52e-4a1a-a69c-11801431c2c9"}],"customer_id":"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501","invoice_date":"2026-06-18T10:00:00.000Z","reverse_charge":false,"sales_personnel_id":"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501"}'
};

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

**Response**

```json
{
  "data": {
    "id": "1243891e-40a8-4a88-8e1f-0397adcbf85e",
    "items": [
      {
        "rate": 50000,
        "amount": 500000,
        "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"
      }
    ],
    "amount": "537500.00",
    "status": "DRAFT",
    "content": {},
    "approval": 0,
    "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": {
        "city": "Lagos",
        "name": "Office",
        "phone": "+2348012345678",
        "state": "Lagos",
        "country": "Nigeria",
        "post_code": "100001",
        "address_one": "12 Marina Road",
        "country_code": "NG"
      },
      "shipping_address": {
        "city": "Lagos",
        "name": "Office",
        "phone": "+2348012345678",
        "state": "Lagos",
        "country": "Nigeria",
        "post_code": "100001",
        "address_one": "12 Marina Road",
        "country_code": "NG"
      }
    },
    "due_date": "2026-07-18T10:00:00Z",
    "order_id": "ORD-1001",
    "approvals": [],
    "created_at": "2026-06-18T10:00:00Z",
    "is_overdue": false,
    "project_id": "spruce-demo",
    "prepared_by": "user-token-hash",
    "invoice_date": "2026-06-18T10:00:00Z",
    "currency_code": "NGN",
    "exchange_rate": "1.00",
    "journal_status": "UNPOSTED",
    "reverse_charge": false,
    "invoice_reference": "INV-0001"
  },
  "status": true,
  "message": "Successfully created invoice"
}
```

**SDK Code**

```python Create and post invoice
import requests

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

payload = {
    "items": [
        {
            "rate": 50000,
            "amount": 500000,
            "detail": "Implementation consulting services",
            "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"
        }
    ],
    "subject": "Implementation consulting services - posted on create",
    "due_date": "2026-07-18T10:00:00.000Z",
    "order_id": "ORD-1001-POST",
    "allow_post": True,
    "adjustments": [
        {
            "name": "VAT",
            "type": "PERCENTAGE_RATE",
            "value": 7.5,
            "amount": 37500,
            "operation": "ADDITION",
            "account_id": "2b0d1461-e52e-4a1a-a69c-11801431c2c9"
        }
    ],
    "customer_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501",
    "invoice_date": "2026-06-18T10:00:00.000Z",
    "reverse_charge": False,
    "sales_personnel_id": "7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501"
}
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: '{"items":[{"rate":50000,"amount":500000,"detail":"Implementation consulting services","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"}],"subject":"Implementation consulting services - posted on create","due_date":"2026-07-18T10:00:00.000Z","order_id":"ORD-1001-POST","allow_post":true,"adjustments":[{"name":"VAT","type":"PERCENTAGE_RATE","value":7.5,"amount":37500,"operation":"ADDITION","account_id":"2b0d1461-e52e-4a1a-a69c-11801431c2c9"}],"customer_id":"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501","invoice_date":"2026-06-18T10:00:00.000Z","reverse_charge":false,"sales_personnel_id":"7d2c9c72-392c-4f8d-b3f1-c1fef2c2d501"}'
};

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