> 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 Payment Term

POST https://api.papertracc.com/v1/configs/payment-terms
Content-Type: application/json

Creates a payment term. Send `net_days` for a single due date, or `instalments` to split the total across two or more due dates. Either shape can carry an early-payment `discount`.

Instalments that are all `PERCENTAGE_RATE` must add up to 100. When percentages and flat amounts are mixed, the last instalment takes whatever remains of the document total. A percentage discount must be below 100, and the discount window must end before the final due date.

Requires the `can_create_payment_term` permission on the key owner's role. Available when the Invoices or Bills service is enabled for the workspace.

Reference: https://api-docs.papertracc.com/papertracc/configurations/payment-terms/create-payment-term

## 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 project.

## 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 CreatePaymentTermRequest.

- `name` (string, required) — Unique within the workspace, ignoring case.
- `net_days` (integer, optional, default: 0) — Calendar days from the document date to the due date. Ignored when `instalments` is sent; the last instalment's `net_days` is used.
- `is_default` (boolean, optional, default: false) — Make this the workspace default. The previous default is unset.
- `instalments` (list of PaymentTermRateInput, optional) — Omit for a single due date. Otherwise send at least two instalments, each with a different `net_days`.
- `discount` (PaymentTermRateInput, optional) — Early-payment discount. `net_days` is the last day it can be taken and must be earlier than the term's final due date.

## Response

### 201

Created

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

## Errors

### 400 Bad Request Error

A field is missing or malformed, or another payment term in the workspace already uses this name.

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

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

### 422 Unprocessable Entity Error

The term breaks one of the payment term rules, for example percentages that do not add up to 100.

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

### PaymentTermRateInput

- `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` (double, required)
- `net_days` (integer, required) — Calendar days after the document date.

### PaymentTerm

- `id` (string, required)
- `project_id` (string, required)
- `name` (string, required)
- `net_days` (integer, required) — Calendar days from the document date to the final due date. For a split term this is the last instalment's `net_days`.
- `is_default` (boolean, required) — The workspace default, applied to new invoices that name no term or due date and whose customer has no default term. Only one term is the default at a time.
- `is_active` (boolean, required) — Inactive terms cannot be applied to new documents. Documents that already use the term keep their schedule.
- `instalments` (list of PaymentTermRate, required) — Empty for a single due date. Otherwise two or more instalments ordered by `net_days`.
- `discount` (PaymentTermRate, required, nullable) — Early-payment discount, or null. `net_days` is the last day the discount can be taken.
- `created_at` (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.

### PaymentTermRate

- `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) — Calendar days after the document date.

## Examples

### Configurations_Payment Terms_Create Payment Term_example

**Response**

```json
{
  "data": {
    "id": "a4d2e9f1-6b3c-4e8a-b7d5-1c9f0e2a3b47",
    "project_id": "spruce-demo",
    "name": "2/10 Net 30",
    "net_days": 30,
    "is_default": false,
    "is_active": true,
    "instalments": [],
    "discount": {
      "type": "PERCENTAGE_RATE",
      "value": "2",
      "net_days": 10
    },
    "created_at": "2026-06-18T10:00:00Z"
  },
  "status": true,
  "message": "Successfully created payment term"
}
```

**SDK Code**

```python Configurations_Payment Terms_Create Payment Term_example
import requests

url = "https://api.papertracc.com/v1/configs/payment-terms"

headers = {"Authorization": "Bearer <apiKey>"}

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

print(response.json())
```

```javascript Configurations_Payment Terms_Create Payment Term_example
const url = 'https://api.papertracc.com/v1/configs/payment-terms';
const options = {method: 'POST', headers: {Authorization: 'Bearer <apiKey>'}};

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

```go Configurations_Payment Terms_Create Payment Term_example
package main

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

func main() {

	url := "https://api.papertracc.com/v1/configs/payment-terms"

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

	req.Header.Add("Authorization", "Bearer <apiKey>")

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

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

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

}
```

```ruby Configurations_Payment Terms_Create Payment Term_example
require 'uri'
require 'net/http'

url = URI("https://api.papertracc.com/v1/configs/payment-terms")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <apiKey>'

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

```java Configurations_Payment Terms_Create Payment Term_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.papertracc.com/v1/configs/payment-terms")
  .header("Authorization", "Bearer <apiKey>")
  .asString();
```

```php Configurations_Payment Terms_Create Payment Term_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.papertracc.com/v1/configs/payment-terms', [
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
  ],
]);

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

```csharp Configurations_Payment Terms_Create Payment Term_example
using RestSharp;

var client = new RestClient("https://api.papertracc.com/v1/configs/payment-terms");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Configurations_Payment Terms_Create Payment Term_example
import Foundation

let headers = ["Authorization": "Bearer <apiKey>"]

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

### Single due date

**Request**

```json
{
  "name": "Net 30",
  "net_days": 30,
  "is_default": true
}
```

**Response**

```json
{
  "data": {
    "id": "a4d2e9f1-6b3c-4e8a-b7d5-1c9f0e2a3b47",
    "project_id": "spruce-demo",
    "name": "2/10 Net 30",
    "net_days": 30,
    "is_default": false,
    "is_active": true,
    "instalments": [],
    "discount": {
      "type": "PERCENTAGE_RATE",
      "value": "2",
      "net_days": 10
    },
    "created_at": "2026-06-18T10:00:00Z"
  },
  "status": true,
  "message": "Successfully created payment term"
}
```

**SDK Code**

```python Single due date
import requests

url = "https://api.papertracc.com/v1/configs/payment-terms"

payload = {
    "name": "Net 30",
    "net_days": 30,
    "is_default": True
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Single due date
const url = 'https://api.papertracc.com/v1/configs/payment-terms';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"Net 30","net_days":30,"is_default":true}'
};

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

```go Single due date
package main

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

func main() {

	url := "https://api.papertracc.com/v1/configs/payment-terms"

	payload := strings.NewReader("{\n  \"name\": \"Net 30\",\n  \"net_days\": 30,\n  \"is_default\": 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 Single due date
require 'uri'
require 'net/http'

url = URI("https://api.papertracc.com/v1/configs/payment-terms")

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  \"name\": \"Net 30\",\n  \"net_days\": 30,\n  \"is_default\": true\n}"

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

```java Single due date
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.papertracc.com/v1/configs/payment-terms")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Net 30\",\n  \"net_days\": 30,\n  \"is_default\": true\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.papertracc.com/v1/configs/payment-terms', [
  'body' => '{
  "name": "Net 30",
  "net_days": 30,
  "is_default": true
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Single due date
using RestSharp;

var client = new RestClient("https://api.papertracc.com/v1/configs/payment-terms");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Net 30\",\n  \"net_days\": 30,\n  \"is_default\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Single due date
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Net 30",
  "net_days": 30,
  "is_default": true
] as [String : Any]

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

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

### Early-payment discount

**Request**

```json
{
  "name": "2/10 Net 30",
  "net_days": 30,
  "discount": {
    "type": "PERCENTAGE_RATE",
    "value": 2,
    "net_days": 10
  }
}
```

**Response**

```json
{
  "data": {
    "id": "a4d2e9f1-6b3c-4e8a-b7d5-1c9f0e2a3b47",
    "project_id": "spruce-demo",
    "name": "2/10 Net 30",
    "net_days": 30,
    "is_default": false,
    "is_active": true,
    "instalments": [],
    "discount": {
      "type": "PERCENTAGE_RATE",
      "value": "2",
      "net_days": 10
    },
    "created_at": "2026-06-18T10:00:00Z"
  },
  "status": true,
  "message": "Successfully created payment term"
}
```

**SDK Code**

```python Early-payment discount
import requests

url = "https://api.papertracc.com/v1/configs/payment-terms"

payload = {
    "name": "2/10 Net 30",
    "net_days": 30,
    "discount": {
        "type": "PERCENTAGE_RATE",
        "value": 2,
        "net_days": 10
    }
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Early-payment discount
const url = 'https://api.papertracc.com/v1/configs/payment-terms';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"2/10 Net 30","net_days":30,"discount":{"type":"PERCENTAGE_RATE","value":2,"net_days":10}}'
};

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

```go Early-payment discount
package main

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

func main() {

	url := "https://api.papertracc.com/v1/configs/payment-terms"

	payload := strings.NewReader("{\n  \"name\": \"2/10 Net 30\",\n  \"net_days\": 30,\n  \"discount\": {\n    \"type\": \"PERCENTAGE_RATE\",\n    \"value\": 2,\n    \"net_days\": 10\n  }\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 Early-payment discount
require 'uri'
require 'net/http'

url = URI("https://api.papertracc.com/v1/configs/payment-terms")

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  \"name\": \"2/10 Net 30\",\n  \"net_days\": 30,\n  \"discount\": {\n    \"type\": \"PERCENTAGE_RATE\",\n    \"value\": 2,\n    \"net_days\": 10\n  }\n}"

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

```java Early-payment discount
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.papertracc.com/v1/configs/payment-terms")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"2/10 Net 30\",\n  \"net_days\": 30,\n  \"discount\": {\n    \"type\": \"PERCENTAGE_RATE\",\n    \"value\": 2,\n    \"net_days\": 10\n  }\n}")
  .asString();
```

```php Early-payment discount
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.papertracc.com/v1/configs/payment-terms', [
  'body' => '{
  "name": "2/10 Net 30",
  "net_days": 30,
  "discount": {
    "type": "PERCENTAGE_RATE",
    "value": 2,
    "net_days": 10
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Early-payment discount
using RestSharp;

var client = new RestClient("https://api.papertracc.com/v1/configs/payment-terms");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"2/10 Net 30\",\n  \"net_days\": 30,\n  \"discount\": {\n    \"type\": \"PERCENTAGE_RATE\",\n    \"value\": 2,\n    \"net_days\": 10\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Early-payment discount
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "2/10 Net 30",
  "net_days": 30,
  "discount": [
    "type": "PERCENTAGE_RATE",
    "value": 2,
    "net_days": 10
  ]
] as [String : Any]

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

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

### Split instalments

**Request**

```json
{
  "name": "60/40 split",
  "instalments": [
    {
      "type": "PERCENTAGE_RATE",
      "value": 60,
      "net_days": 15
    },
    {
      "type": "PERCENTAGE_RATE",
      "value": 40,
      "net_days": 30
    }
  ]
}
```

**Response**

```json
{
  "data": {
    "id": "a4d2e9f1-6b3c-4e8a-b7d5-1c9f0e2a3b47",
    "project_id": "spruce-demo",
    "name": "2/10 Net 30",
    "net_days": 30,
    "is_default": false,
    "is_active": true,
    "instalments": [],
    "discount": {
      "type": "PERCENTAGE_RATE",
      "value": "2",
      "net_days": 10
    },
    "created_at": "2026-06-18T10:00:00Z"
  },
  "status": true,
  "message": "Successfully created payment term"
}
```

**SDK Code**

```python Split instalments
import requests

url = "https://api.papertracc.com/v1/configs/payment-terms"

payload = {
    "name": "60/40 split",
    "instalments": [
        {
            "type": "PERCENTAGE_RATE",
            "value": 60,
            "net_days": 15
        },
        {
            "type": "PERCENTAGE_RATE",
            "value": 40,
            "net_days": 30
        }
    ]
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Split instalments
const url = 'https://api.papertracc.com/v1/configs/payment-terms';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"60/40 split","instalments":[{"type":"PERCENTAGE_RATE","value":60,"net_days":15},{"type":"PERCENTAGE_RATE","value":40,"net_days":30}]}'
};

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

```go Split instalments
package main

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

func main() {

	url := "https://api.papertracc.com/v1/configs/payment-terms"

	payload := strings.NewReader("{\n  \"name\": \"60/40 split\",\n  \"instalments\": [\n    {\n      \"type\": \"PERCENTAGE_RATE\",\n      \"value\": 60,\n      \"net_days\": 15\n    },\n    {\n      \"type\": \"PERCENTAGE_RATE\",\n      \"value\": 40,\n      \"net_days\": 30\n    }\n  ]\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 Split instalments
require 'uri'
require 'net/http'

url = URI("https://api.papertracc.com/v1/configs/payment-terms")

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  \"name\": \"60/40 split\",\n  \"instalments\": [\n    {\n      \"type\": \"PERCENTAGE_RATE\",\n      \"value\": 60,\n      \"net_days\": 15\n    },\n    {\n      \"type\": \"PERCENTAGE_RATE\",\n      \"value\": 40,\n      \"net_days\": 30\n    }\n  ]\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.papertracc.com/v1/configs/payment-terms")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"60/40 split\",\n  \"instalments\": [\n    {\n      \"type\": \"PERCENTAGE_RATE\",\n      \"value\": 60,\n      \"net_days\": 15\n    },\n    {\n      \"type\": \"PERCENTAGE_RATE\",\n      \"value\": 40,\n      \"net_days\": 30\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.papertracc.com/v1/configs/payment-terms', [
  'body' => '{
  "name": "60/40 split",
  "instalments": [
    {
      "type": "PERCENTAGE_RATE",
      "value": 60,
      "net_days": 15
    },
    {
      "type": "PERCENTAGE_RATE",
      "value": 40,
      "net_days": 30
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Split instalments
using RestSharp;

var client = new RestClient("https://api.papertracc.com/v1/configs/payment-terms");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"60/40 split\",\n  \"instalments\": [\n    {\n      \"type\": \"PERCENTAGE_RATE\",\n      \"value\": 60,\n      \"net_days\": 15\n    },\n    {\n      \"type\": \"PERCENTAGE_RATE\",\n      \"value\": 40,\n      \"net_days\": 30\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Split instalments
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "60/40 split",
  "instalments": [
    [
      "type": "PERCENTAGE_RATE",
      "value": 60,
      "net_days": 15
    ],
    [
      "type": "PERCENTAGE_RATE",
      "value": 40,
      "net_days": 30
    ]
  ]
] as [String : Any]

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

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