> This page is for version v2024-05-25 (default).
> For other versions, use one of these documentation indexes:
> - v2024-05-25 (default): https://docs.monite.com/v-2024-05-25/llms.txt
> - v2024-01-31: https://docs.monite.com/v2024-01-31/llms.txt
> - v2023-09-01: https://docs.monite.com/v2023-09-01/llms.txt

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

# Create a payment term

POST https://api.sandbox.monite.com/v1/payment_terms
Content-Type: application/json

Reference: https://docs.monite.com/api/payment-terms/post-payment-terms

## Authentication

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

## Servers

- `https://api.sandbox.monite.com/v1` (sandbox, default)
- `https://api.monite.com/v1` (eu_production)
- `https://us.api.monite.com/v1` (na_production)

## Request

### Headers

- `x-monite-version` (string, required)
- `x-monite-entity-id` (string, required) — The ID of the entity that owns the requested resource.

### Body (application/json)

This endpoint expects an object.

- `name` (string, required)
- `term_final` (TermFinalDays, required) — The final tier of the payment term. Defines the invoice due date.
- `description` (string, optional)
- `term_1` (TermDiscountDays, optional) — The first tier of the payment term. Represents the terms of the first early discount.
- `term_2` (TermDiscountDays, optional) — The second tier of the payment term. Defines the terms of the second early discount.

## Response

### 201

Successful Response

- `id` (string, required)
- `name` (string, required)
- `term_final` (TermFinalDays, required) — The final tier of the payment term. Defines the invoice due date.
- `description` (string, optional)
- `term_1` (TermDiscountDays, optional) — The first tier of the payment term. Represents the terms of the first early discount.
- `term_2` (TermDiscountDays, optional) — The second tier of the payment term. Defines the terms of the second early discount.

## Errors

### 400 Post Payment Terms Request Bad Request Error

Bad Request

- `error` (ErrorSchema, required)

### 401 Post Payment Terms Request Unauthorized Error

The `Authorization` header is missing or contains an invalid or expired access token. See [Authentication](https://docs.monite.com/api/concepts/authentication) to learn how to authenticate API calls.

- `error` (ErrorSchema, required)

### 403 Post Payment Terms Request Forbidden Error

The specified access token does not have permissions to perform this operation.

- `error` (ErrorSchema, required)

### 422 Post Payment Terms Request Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 429 Post Payment Terms Request Too Many Requests Error

API rate limit has been exceeded. Check the response headers for the rate limit information.

- `any`

## Types

### TermFinalDays

- `number_of_days` (integer, required) — The amount of days after the invoice issue date.

### TermDiscountDays

- `discount` (integer, required) — The discount percentage in minor units. E.g., 200 means 2%. 1050 means 10.5%.
- `number_of_days` (integer, required) — The amount of days after the invoice issue date.

### ErrorSchema

- `message` (string, required)

### ValidationError

- `loc` (list of ValidationErrorLocItem, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItem

## Examples

### Net 30

**Request**

```json
{
  "name": "Net 30",
  "term_final": {
    "number_of_days": 30
  },
  "description": "Payment is due within 30 days after the invoice issue date"
}
```

**Response**

```json
{
  "id": "id",
  "name": "name",
  "term_final": {
    "number_of_days": 1
  },
  "description": "description",
  "term_1": {
    "discount": 1,
    "number_of_days": 1
  },
  "term_2": {
    "discount": 1,
    "number_of_days": 1
  }
}
```

**SDK Code**

```python Net 30
import requests

url = "https://api.sandbox.monite.com/v1/payment_terms"

payload = {
    "name": "Net 30",
    "term_final": { "number_of_days": 30 },
    "description": "Payment is due within 30 days after the invoice issue date"
}
headers = {
    "x-monite-version": "2024-05-25",
    "x-monite-entity-id": "9d2b4c8f-2087-4738-ba91-7359683c49a4",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Net 30
const url = 'https://api.sandbox.monite.com/v1/payment_terms';
const options = {
  method: 'POST',
  headers: {
    'x-monite-version': '2024-05-25',
    'x-monite-entity-id': '9d2b4c8f-2087-4738-ba91-7359683c49a4',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"name":"Net 30","term_final":{"number_of_days":30},"description":"Payment is due within 30 days after the invoice issue date"}'
};

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

```go Net 30
package main

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

func main() {

	url := "https://api.sandbox.monite.com/v1/payment_terms"

	payload := strings.NewReader("{\n  \"name\": \"Net 30\",\n  \"term_final\": {\n    \"number_of_days\": 30\n  },\n  \"description\": \"Payment is due within 30 days after the invoice issue date\"\n}")

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

	req.Header.Add("x-monite-version", "2024-05-25")
	req.Header.Add("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4")
	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 Net 30
require 'uri'
require 'net/http'

url = URI("https://api.sandbox.monite.com/v1/payment_terms")

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

request = Net::HTTP::Post.new(url)
request["x-monite-version"] = '2024-05-25'
request["x-monite-entity-id"] = '9d2b4c8f-2087-4738-ba91-7359683c49a4'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Net 30\",\n  \"term_final\": {\n    \"number_of_days\": 30\n  },\n  \"description\": \"Payment is due within 30 days after the invoice issue date\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.sandbox.monite.com/v1/payment_terms")
  .header("x-monite-version", "2024-05-25")
  .header("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Net 30\",\n  \"term_final\": {\n    \"number_of_days\": 30\n  },\n  \"description\": \"Payment is due within 30 days after the invoice issue date\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.sandbox.monite.com/v1/payment_terms', [
  'body' => '{
  "name": "Net 30",
  "term_final": {
    "number_of_days": 30
  },
  "description": "Payment is due within 30 days after the invoice issue date"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'x-monite-entity-id' => '9d2b4c8f-2087-4738-ba91-7359683c49a4',
    'x-monite-version' => '2024-05-25',
  ],
]);

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

```csharp Net 30
using RestSharp;

var client = new RestClient("https://api.sandbox.monite.com/v1/payment_terms");
var request = new RestRequest(Method.POST);
request.AddHeader("x-monite-version", "2024-05-25");
request.AddHeader("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Net 30\",\n  \"term_final\": {\n    \"number_of_days\": 30\n  },\n  \"description\": \"Payment is due within 30 days after the invoice issue date\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Net 30
import Foundation

let headers = [
  "x-monite-version": "2024-05-25",
  "x-monite-entity-id": "9d2b4c8f-2087-4738-ba91-7359683c49a4",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Net 30",
  "term_final": ["number_of_days": 30],
  "description": "Payment is due within 30 days after the invoice issue date"
] as [String : Any]

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

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

### 1/15, Net 30

**Request**

```json
{
  "name": "1/15, Net 30",
  "term_final": {
    "number_of_days": 30
  },
  "description": "The invoice must be paid within 30 days. 1% discount if paid within the first 15 days.",
  "term_1": {
    "discount": 100,
    "number_of_days": 15
  }
}
```

**Response**

```json
{
  "id": "id",
  "name": "name",
  "term_final": {
    "number_of_days": 1
  },
  "description": "description",
  "term_1": {
    "discount": 1,
    "number_of_days": 1
  },
  "term_2": {
    "discount": 1,
    "number_of_days": 1
  }
}
```

**SDK Code**

```python 1/15, Net 30
import requests

url = "https://api.sandbox.monite.com/v1/payment_terms"

payload = {
    "name": "1/15, Net 30",
    "term_final": { "number_of_days": 30 },
    "description": "The invoice must be paid within 30 days. 1% discount if paid within the first 15 days.",
    "term_1": {
        "discount": 100,
        "number_of_days": 15
    }
}
headers = {
    "x-monite-version": "2024-05-25",
    "x-monite-entity-id": "9d2b4c8f-2087-4738-ba91-7359683c49a4",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 1/15, Net 30
const url = 'https://api.sandbox.monite.com/v1/payment_terms';
const options = {
  method: 'POST',
  headers: {
    'x-monite-version': '2024-05-25',
    'x-monite-entity-id': '9d2b4c8f-2087-4738-ba91-7359683c49a4',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"name":"1/15, Net 30","term_final":{"number_of_days":30},"description":"The invoice must be paid within 30 days. 1% discount if paid within the first 15 days.","term_1":{"discount":100,"number_of_days":15}}'
};

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

```go 1/15, Net 30
package main

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

func main() {

	url := "https://api.sandbox.monite.com/v1/payment_terms"

	payload := strings.NewReader("{\n  \"name\": \"1/15, Net 30\",\n  \"term_final\": {\n    \"number_of_days\": 30\n  },\n  \"description\": \"The invoice must be paid within 30 days. 1% discount if paid within the first 15 days.\",\n  \"term_1\": {\n    \"discount\": 100,\n    \"number_of_days\": 15\n  }\n}")

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

	req.Header.Add("x-monite-version", "2024-05-25")
	req.Header.Add("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4")
	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 1/15, Net 30
require 'uri'
require 'net/http'

url = URI("https://api.sandbox.monite.com/v1/payment_terms")

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

request = Net::HTTP::Post.new(url)
request["x-monite-version"] = '2024-05-25'
request["x-monite-entity-id"] = '9d2b4c8f-2087-4738-ba91-7359683c49a4'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"1/15, Net 30\",\n  \"term_final\": {\n    \"number_of_days\": 30\n  },\n  \"description\": \"The invoice must be paid within 30 days. 1% discount if paid within the first 15 days.\",\n  \"term_1\": {\n    \"discount\": 100,\n    \"number_of_days\": 15\n  }\n}"

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

```java 1/15, Net 30
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.sandbox.monite.com/v1/payment_terms")
  .header("x-monite-version", "2024-05-25")
  .header("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"1/15, Net 30\",\n  \"term_final\": {\n    \"number_of_days\": 30\n  },\n  \"description\": \"The invoice must be paid within 30 days. 1% discount if paid within the first 15 days.\",\n  \"term_1\": {\n    \"discount\": 100,\n    \"number_of_days\": 15\n  }\n}")
  .asString();
```

```php 1/15, Net 30
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.sandbox.monite.com/v1/payment_terms', [
  'body' => '{
  "name": "1/15, Net 30",
  "term_final": {
    "number_of_days": 30
  },
  "description": "The invoice must be paid within 30 days. 1% discount if paid within the first 15 days.",
  "term_1": {
    "discount": 100,
    "number_of_days": 15
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'x-monite-entity-id' => '9d2b4c8f-2087-4738-ba91-7359683c49a4',
    'x-monite-version' => '2024-05-25',
  ],
]);

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

```csharp 1/15, Net 30
using RestSharp;

var client = new RestClient("https://api.sandbox.monite.com/v1/payment_terms");
var request = new RestRequest(Method.POST);
request.AddHeader("x-monite-version", "2024-05-25");
request.AddHeader("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"1/15, Net 30\",\n  \"term_final\": {\n    \"number_of_days\": 30\n  },\n  \"description\": \"The invoice must be paid within 30 days. 1% discount if paid within the first 15 days.\",\n  \"term_1\": {\n    \"discount\": 100,\n    \"number_of_days\": 15\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 1/15, Net 30
import Foundation

let headers = [
  "x-monite-version": "2024-05-25",
  "x-monite-entity-id": "9d2b4c8f-2087-4738-ba91-7359683c49a4",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "1/15, Net 30",
  "term_final": ["number_of_days": 30],
  "description": "The invoice must be paid within 30 days. 1% discount if paid within the first 15 days.",
  "term_1": [
    "discount": 100,
    "number_of_days": 15
  ]
] as [String : Any]

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

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

### 2/10, 1/20, Net 30

**Request**

```json
{
  "name": "2/10, 1/20, Net 30",
  "term_final": {
    "number_of_days": 30
  },
  "description": "The invoice must be paid within 30 days. 2% discount if paid within the first 10 days, 1% discount if paid within 20 days.",
  "term_1": {
    "discount": 200,
    "number_of_days": 10
  },
  "term_2": {
    "discount": 100,
    "number_of_days": 20
  }
}
```

**Response**

```json
{
  "id": "id",
  "name": "name",
  "term_final": {
    "number_of_days": 1
  },
  "description": "description",
  "term_1": {
    "discount": 1,
    "number_of_days": 1
  },
  "term_2": {
    "discount": 1,
    "number_of_days": 1
  }
}
```

**SDK Code**

```python 2/10, 1/20, Net 30
import requests

url = "https://api.sandbox.monite.com/v1/payment_terms"

payload = {
    "name": "2/10, 1/20, Net 30",
    "term_final": { "number_of_days": 30 },
    "description": "The invoice must be paid within 30 days. 2% discount if paid within the first 10 days, 1% discount if paid within 20 days.",
    "term_1": {
        "discount": 200,
        "number_of_days": 10
    },
    "term_2": {
        "discount": 100,
        "number_of_days": 20
    }
}
headers = {
    "x-monite-version": "2024-05-25",
    "x-monite-entity-id": "9d2b4c8f-2087-4738-ba91-7359683c49a4",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 2/10, 1/20, Net 30
const url = 'https://api.sandbox.monite.com/v1/payment_terms';
const options = {
  method: 'POST',
  headers: {
    'x-monite-version': '2024-05-25',
    'x-monite-entity-id': '9d2b4c8f-2087-4738-ba91-7359683c49a4',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"name":"2/10, 1/20, Net 30","term_final":{"number_of_days":30},"description":"The invoice must be paid within 30 days. 2% discount if paid within the first 10 days, 1% discount if paid within 20 days.","term_1":{"discount":200,"number_of_days":10},"term_2":{"discount":100,"number_of_days":20}}'
};

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

```go 2/10, 1/20, Net 30
package main

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

func main() {

	url := "https://api.sandbox.monite.com/v1/payment_terms"

	payload := strings.NewReader("{\n  \"name\": \"2/10, 1/20, Net 30\",\n  \"term_final\": {\n    \"number_of_days\": 30\n  },\n  \"description\": \"The invoice must be paid within 30 days. 2% discount if paid within the first 10 days, 1% discount if paid within 20 days.\",\n  \"term_1\": {\n    \"discount\": 200,\n    \"number_of_days\": 10\n  },\n  \"term_2\": {\n    \"discount\": 100,\n    \"number_of_days\": 20\n  }\n}")

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

	req.Header.Add("x-monite-version", "2024-05-25")
	req.Header.Add("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4")
	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 2/10, 1/20, Net 30
require 'uri'
require 'net/http'

url = URI("https://api.sandbox.monite.com/v1/payment_terms")

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

request = Net::HTTP::Post.new(url)
request["x-monite-version"] = '2024-05-25'
request["x-monite-entity-id"] = '9d2b4c8f-2087-4738-ba91-7359683c49a4'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"2/10, 1/20, Net 30\",\n  \"term_final\": {\n    \"number_of_days\": 30\n  },\n  \"description\": \"The invoice must be paid within 30 days. 2% discount if paid within the first 10 days, 1% discount if paid within 20 days.\",\n  \"term_1\": {\n    \"discount\": 200,\n    \"number_of_days\": 10\n  },\n  \"term_2\": {\n    \"discount\": 100,\n    \"number_of_days\": 20\n  }\n}"

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

```java 2/10, 1/20, Net 30
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.sandbox.monite.com/v1/payment_terms")
  .header("x-monite-version", "2024-05-25")
  .header("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"2/10, 1/20, Net 30\",\n  \"term_final\": {\n    \"number_of_days\": 30\n  },\n  \"description\": \"The invoice must be paid within 30 days. 2% discount if paid within the first 10 days, 1% discount if paid within 20 days.\",\n  \"term_1\": {\n    \"discount\": 200,\n    \"number_of_days\": 10\n  },\n  \"term_2\": {\n    \"discount\": 100,\n    \"number_of_days\": 20\n  }\n}")
  .asString();
```

```php 2/10, 1/20, Net 30
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.sandbox.monite.com/v1/payment_terms', [
  'body' => '{
  "name": "2/10, 1/20, Net 30",
  "term_final": {
    "number_of_days": 30
  },
  "description": "The invoice must be paid within 30 days. 2% discount if paid within the first 10 days, 1% discount if paid within 20 days.",
  "term_1": {
    "discount": 200,
    "number_of_days": 10
  },
  "term_2": {
    "discount": 100,
    "number_of_days": 20
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'x-monite-entity-id' => '9d2b4c8f-2087-4738-ba91-7359683c49a4',
    'x-monite-version' => '2024-05-25',
  ],
]);

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

```csharp 2/10, 1/20, Net 30
using RestSharp;

var client = new RestClient("https://api.sandbox.monite.com/v1/payment_terms");
var request = new RestRequest(Method.POST);
request.AddHeader("x-monite-version", "2024-05-25");
request.AddHeader("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"2/10, 1/20, Net 30\",\n  \"term_final\": {\n    \"number_of_days\": 30\n  },\n  \"description\": \"The invoice must be paid within 30 days. 2% discount if paid within the first 10 days, 1% discount if paid within 20 days.\",\n  \"term_1\": {\n    \"discount\": 200,\n    \"number_of_days\": 10\n  },\n  \"term_2\": {\n    \"discount\": 100,\n    \"number_of_days\": 20\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 2/10, 1/20, Net 30
import Foundation

let headers = [
  "x-monite-version": "2024-05-25",
  "x-monite-entity-id": "9d2b4c8f-2087-4738-ba91-7359683c49a4",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "2/10, 1/20, Net 30",
  "term_final": ["number_of_days": 30],
  "description": "The invoice must be paid within 30 days. 2% discount if paid within the first 10 days, 1% discount if paid within 20 days.",
  "term_1": [
    "discount": 200,
    "number_of_days": 10
  ],
  "term_2": [
    "discount": 100,
    "number_of_days": 20
  ]
] as [String : Any]

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

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