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

# Create a new or update existing Invoices entries.

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

Create a new or update existing Invoices entries with the provided data.

## Required Fields Summary

| Field              | Type   | Description                                                   |
| ------------------ | ------ | ------------------------------------------------------------- |
| `source_system_id` | string | Unique identifier of the invoice in the ERP system            |
| `vendor_id`        | string | Id of the Vendor/Supplier                                     |
| `invoice_number`   | string | Invoice number                                                |
| `invoice_date`     | date   | Date the invoice was issued by the vendor. Format: yyyy-mm-dd |
| `currency_id`      | string | Transactional currency id                                     |
| `invoice_amount`   | double | Invoice or Invoice line amount                                |

If using the **Insights Module**, the following fields are also required:

* `po_id`
* `period`
* `subsidiary_debit_id`
* `department_debit_id`

⚠️ **Important:** The `period` field must follow the format `yyyy-mm-01` (e.g., `2026-03-01`).

For **unapproved or late invoices**, the following fields are also required:

* `invoice_line_id`
* `invoice_date_created`

Reference: https://developers.gappify.com/api-reference/inbound-to-gappify/3/post

## Authentication

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

## Servers

- `https://api.gappify.com/v1` (Production, default)
- `https://api.uat.gappifyinc.com/v1` (UAT)

## Request

### Body (application/json)

This endpoint expects a list of InvoicesPostPayload.

- `list of InvoicesPostPayload`

## Response

### 202

- `request_id` (UUID, required) — Unique identifier for the request
- `status` ("IN_PROGRESS", required) — Status of the request

## Errors

### 401 Unauthorized Error

- `message` (string, required) — The error message
- `success` (boolean, required)

### 422 Unprocessable Entity Error

- `message` (string, required) — The error message
- `errors` (string, required) — The error details

### 404 Not Found Error

- `list of string`

### 500 Internal Server Error

- `list of string`

## Types

### InvoicesPostPayload

- `source_system_id` (string, required) — Unique identifier of the invoice in the ERP system. This value will be used to match source data and perform upserts.
- `vendor_id` (string, required) — Id of the Vendor/Supplier. This value should match the source_vendors->g_source_system_id which will be used to send back as part of JE to ERP.
- `invoice_number` (string, required) — Invoice number.
- `invoice_date` (date, required) — Date the invoice was issued by the vendor. Format: yyyy-mm-dd.
- `currency_id` (string, required) — Transactional currency id of the invoice. This value should match the g_source_system_id in source_coas.
- `invoice_amount` (double, required) — Invoice or Invoice line amount.
- `invoice_type` (string, optional) — Type of invoice.
- `invoice_line_id` (string, optional) — Id of the invoice line.
- `invoice_date_created` (datetime, optional) — This is the date and time when the invoice is created in the source system.
- `po_id` (string, optional) — Id of the PO linked to the invoice.
- `memo` (string, optional) — Invoice header memo.
- `created_by` (string, optional)
- `last_modified_by` (string, optional)
- `period` (string, optional) — Period representation of the invoice. **Format:** `yyyy-mm-01` (e.g., `2026-03-01`).'
- `subsidiary_debit_id` (string, optional) — Subsidiary id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `item` (string, optional)
- `item_id` (string, optional)
- `glaccount_debit_id` (string, optional) — GLAccount debit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `glaccount_credit_id` (string, optional) — GLAccount credit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `department_debit_id` (string, optional) — Department/Cost Center debit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `department_credit_id` (string, optional) — Department/Cost Center credit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `product_debit_id` (string, optional) — Product debit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `product_credit_id` (string, optional) — Product credit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `location_debit_id` (string, optional) — Location debit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `location_credit_id` (string, optional) — Location credit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `class_debit_id` (string, optional) — Class debit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `class_credit_id` (string, optional) — Class credit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `project_debit_id` (string, optional) — Project debit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `project_credit_id` (string, optional) — Project credit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `invoice_memo` (string, optional) — Description of the invoice or invoice line where applicable.
- `status` (string, optional) — Status of the invoice or invoice line.
- `start_date` (date, optional) — Start date of the invoice or invoice line if applicable.
- `end_date` (date, optional) — End date of the invoice or invoice line if applicable.
- `invoice_quantity` (double, optional) — Quantity based value of the invoice or invoice line if applicable.
- `exchange_rate` (double, optional)
- `channel_debit_id` (string, optional) — Channel debit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `channel_credit_id` (string, optional) — Channel credit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `region_debit_id` (string, optional) — Region debit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `region_credit_id` (string, optional) — Region credit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `company_debit_id` (string, optional) — Company debit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `company_credit_id` (string, optional) — Company credit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `intercompany_debit_id` (string, optional) — Intercompay debit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `intercompany_credit_id` (string, optional) — Intercompay credit id linked to the invoice. This value should match the g_source_system_id in source_coas.
- `po_number` (string, optional) — PO number linked to the invoice.
- `po_line_id` (string, optional) — Line Id of the PO linked to the invoice.
- `custom_text_1` (string, optional) — User-defined custom text field
- `custom_text_2` (string, optional) — User-defined custom text field
- `custom_text_3` (string, optional) — User-defined custom text field
- `custom_text_4` (string, optional) — User-defined custom text field
- `custom_text_5` (string, optional) — User-defined custom text field
- `custom_date_1` (date, optional) — User-defined custom date field
- `custom_date_2` (date, optional) — User-defined custom date field
- `custom_date_3` (date, optional) — User-defined custom date field
- `custom_date_4` (date, optional) — User-defined custom date field
- `custom_date_5` (date, optional) — User-defined custom date field
- `custom_numeric_1` (double, optional) — User-defined custom numeric field
- `custom_numeric_2` (double, optional) — User-defined custom numeric field
- `custom_numeric_3` (double, optional) — User-defined custom numeric field
- `custom_numeric_4` (double, optional) — User-defined custom numeric field
- `custom_numeric_5` (double, optional) — User-defined custom numeric field
- `invoice_id` (string, optional) — This is the source system id of the invoice header

## Examples

**Request**

```json
[
  {
    "source_system_id": "source_system_id",
    "vendor_id": "vendor_id",
    "invoice_number": "invoice_number",
    "invoice_date": "2023-01-15",
    "currency_id": "currency_id",
    "invoice_amount": 1.1
  },
  {
    "source_system_id": "source_system_id",
    "vendor_id": "vendor_id",
    "invoice_number": "invoice_number",
    "invoice_date": "2023-01-15",
    "currency_id": "currency_id",
    "invoice_amount": 1.1
  }
]
```

**Response**

```json
{
  "request_id": "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  "status": "IN_PROGRESS"
}
```

**SDK Code**

```python
import requests

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

payload = [
    {
        "source_system_id": "source_system_id",
        "vendor_id": "vendor_id",
        "invoice_number": "invoice_number",
        "invoice_date": "2023-01-15",
        "currency_id": "currency_id",
        "invoice_amount": 1.1
    },
    {
        "source_system_id": "source_system_id",
        "vendor_id": "vendor_id",
        "invoice_number": "invoice_number",
        "invoice_date": "2023-01-15",
        "currency_id": "currency_id",
        "invoice_amount": 1.1
    }
]
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.gappify.com/v1/invoices';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '[{"source_system_id":"source_system_id","vendor_id":"vendor_id","invoice_number":"invoice_number","invoice_date":"2023-01-15","currency_id":"currency_id","invoice_amount":1.1},{"source_system_id":"source_system_id","vendor_id":"vendor_id","invoice_number":"invoice_number","invoice_date":"2023-01-15","currency_id":"currency_id","invoice_amount":1.1}]'
};

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

```go
package main

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

func main() {

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

	payload := strings.NewReader("[\n  {\n    \"source_system_id\": \"source_system_id\",\n    \"vendor_id\": \"vendor_id\",\n    \"invoice_number\": \"invoice_number\",\n    \"invoice_date\": \"2023-01-15\",\n    \"currency_id\": \"currency_id\",\n    \"invoice_amount\": 1.1\n  },\n  {\n    \"source_system_id\": \"source_system_id\",\n    \"vendor_id\": \"vendor_id\",\n    \"invoice_number\": \"invoice_number\",\n    \"invoice_date\": \"2023-01-15\",\n    \"currency_id\": \"currency_id\",\n    \"invoice_amount\": 1.1\n  }\n]")

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

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

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

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n  {\n    \"source_system_id\": \"source_system_id\",\n    \"vendor_id\": \"vendor_id\",\n    \"invoice_number\": \"invoice_number\",\n    \"invoice_date\": \"2023-01-15\",\n    \"currency_id\": \"currency_id\",\n    \"invoice_amount\": 1.1\n  },\n  {\n    \"source_system_id\": \"source_system_id\",\n    \"vendor_id\": \"vendor_id\",\n    \"invoice_number\": \"invoice_number\",\n    \"invoice_date\": \"2023-01-15\",\n    \"currency_id\": \"currency_id\",\n    \"invoice_amount\": 1.1\n  }\n]"

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

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

HttpResponse<String> response = Unirest.post("https://api.gappify.com/v1/invoices")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("[\n  {\n    \"source_system_id\": \"source_system_id\",\n    \"vendor_id\": \"vendor_id\",\n    \"invoice_number\": \"invoice_number\",\n    \"invoice_date\": \"2023-01-15\",\n    \"currency_id\": \"currency_id\",\n    \"invoice_amount\": 1.1\n  },\n  {\n    \"source_system_id\": \"source_system_id\",\n    \"vendor_id\": \"vendor_id\",\n    \"invoice_number\": \"invoice_number\",\n    \"invoice_date\": \"2023-01-15\",\n    \"currency_id\": \"currency_id\",\n    \"invoice_amount\": 1.1\n  }\n]")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.gappify.com/v1/invoices', [
  'body' => '[
  {
    "source_system_id": "source_system_id",
    "vendor_id": "vendor_id",
    "invoice_number": "invoice_number",
    "invoice_date": "2023-01-15",
    "currency_id": "currency_id",
    "invoice_amount": 1.1
  },
  {
    "source_system_id": "source_system_id",
    "vendor_id": "vendor_id",
    "invoice_number": "invoice_number",
    "invoice_date": "2023-01-15",
    "currency_id": "currency_id",
    "invoice_amount": 1.1
  }
]',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.gappify.com/v1/invoices");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "[\n  {\n    \"source_system_id\": \"source_system_id\",\n    \"vendor_id\": \"vendor_id\",\n    \"invoice_number\": \"invoice_number\",\n    \"invoice_date\": \"2023-01-15\",\n    \"currency_id\": \"currency_id\",\n    \"invoice_amount\": 1.1\n  },\n  {\n    \"source_system_id\": \"source_system_id\",\n    \"vendor_id\": \"vendor_id\",\n    \"invoice_number\": \"invoice_number\",\n    \"invoice_date\": \"2023-01-15\",\n    \"currency_id\": \"currency_id\",\n    \"invoice_amount\": 1.1\n  }\n]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  [
    "source_system_id": "source_system_id",
    "vendor_id": "vendor_id",
    "invoice_number": "invoice_number",
    "invoice_date": "2023-01-15",
    "currency_id": "currency_id",
    "invoice_amount": 1.1
  ],
  [
    "source_system_id": "source_system_id",
    "vendor_id": "vendor_id",
    "invoice_number": "invoice_number",
    "invoice_date": "2023-01-15",
    "currency_id": "currency_id",
    "invoice_amount": 1.1
  ]
] as [String : Any]

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

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