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

# Update Payment Term

PATCH https://api.papertracc.com/v1/configs/payment-terms/{id}
Content-Type: application/json

Updates a payment term. Fields left out are unchanged. `instalments` replaces the existing instalments, and an empty array turns the term back into a single due date. Send `clear_discount` to remove the early-payment discount. Set `is_active` to false to retire a term.

Documents keep the schedule they were given when the term was applied, so editing or deactivating a term does not change existing invoices or bills.

Requires the `can_modify_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/update-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

### Path parameters

- `id` (string, required) — Payment term ID.

### Body (application/json)

This endpoint expects an UpdatePaymentTermRequest.

- `name` (string, optional)
- `net_days` (integer, optional)
- `is_default` (boolean, optional)
- `is_active` (boolean, optional) — Deactivating a term also removes it as the workspace default.
- `instalments` (list of PaymentTermRateInput, optional) — Replaces the instalments. Send an empty array to turn the term back into a single due date, or omit the field to keep the existing ones.
- `discount` (PaymentTermRateInput, optional) — Replaces the early-payment discount.
- `clear_discount` (boolean, optional) — Send true to remove the early-payment discount.

## Response

### 200

OK

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

## Errors

### 400 Bad Request Error

The ID or a field is 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`.

### 404 Not Found Error

No payment term with this ID exists in the workspace.

- `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 updated term breaks one of the payment term rules.

- `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_Update Payment Term_example

**Response**

```json
{
  "data": {
    "id": "c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92",
    "project_id": "spruce-demo",
    "name": "50/50 split",
    "net_days": 30,
    "is_default": false,
    "is_active": true,
    "instalments": [
      {
        "type": "PERCENTAGE_RATE",
        "value": "50",
        "net_days": 15
      },
      {
        "type": "PERCENTAGE_RATE",
        "value": "50",
        "net_days": 30
      }
    ],
    "discount": null,
    "created_at": "2026-06-18T10:00:00Z"
  },
  "status": true,
  "message": "Successfully updated payment term"
}
```

**SDK Code**

```python Configurations_Payment Terms_Update Payment Term_example
import requests

url = "https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92"

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

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

print(response.json())
```

```javascript Configurations_Payment Terms_Update Payment Term_example
const url = 'https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92';
const options = {method: 'PATCH', 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_Update Payment Term_example
package main

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

func main() {

	url := "https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92"

	req, _ := http.NewRequest("PATCH", 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_Update Payment Term_example
require 'uri'
require 'net/http'

url = URI("https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92")

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

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

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

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

HttpResponse<String> response = Unirest.patch("https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92")
  .header("Authorization", "Bearer <apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92', [
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
  ],
]);

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

```csharp Configurations_Payment Terms_Update Payment Term_example
using RestSharp;

var client = new RestClient("https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Configurations_Payment Terms_Update Payment Term_example
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Rename and replace instalments

**Request**

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

**Response**

```json
{
  "data": {
    "id": "c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92",
    "project_id": "spruce-demo",
    "name": "50/50 split",
    "net_days": 30,
    "is_default": false,
    "is_active": true,
    "instalments": [
      {
        "type": "PERCENTAGE_RATE",
        "value": "50",
        "net_days": 15
      },
      {
        "type": "PERCENTAGE_RATE",
        "value": "50",
        "net_days": 30
      }
    ],
    "discount": null,
    "created_at": "2026-06-18T10:00:00Z"
  },
  "status": true,
  "message": "Successfully updated payment term"
}
```

**SDK Code**

```python Rename and replace instalments
import requests

url = "https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92"

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

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

print(response.json())
```

```javascript Rename and replace instalments
const url = 'https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"50/50 split","instalments":[{"type":"PERCENTAGE_RATE","value":50,"net_days":15},{"type":"PERCENTAGE_RATE","value":50,"net_days":30}]}'
};

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

```go Rename and replace instalments
package main

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

func main() {

	url := "https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92"

	payload := strings.NewReader("{\n  \"name\": \"50/50 split\",\n  \"instalments\": [\n    {\n      \"type\": \"PERCENTAGE_RATE\",\n      \"value\": 50,\n      \"net_days\": 15\n    },\n    {\n      \"type\": \"PERCENTAGE_RATE\",\n      \"value\": 50,\n      \"net_days\": 30\n    }\n  ]\n}")

	req, _ := http.NewRequest("PATCH", 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 Rename and replace instalments
require 'uri'
require 'net/http'

url = URI("https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"50/50 split\",\n  \"instalments\": [\n    {\n      \"type\": \"PERCENTAGE_RATE\",\n      \"value\": 50,\n      \"net_days\": 15\n    },\n    {\n      \"type\": \"PERCENTAGE_RATE\",\n      \"value\": 50,\n      \"net_days\": 30\n    }\n  ]\n}"

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

```java Rename and replace instalments
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"50/50 split\",\n  \"instalments\": [\n    {\n      \"type\": \"PERCENTAGE_RATE\",\n      \"value\": 50,\n      \"net_days\": 15\n    },\n    {\n      \"type\": \"PERCENTAGE_RATE\",\n      \"value\": 50,\n      \"net_days\": 30\n    }\n  ]\n}")
  .asString();
```

```php Rename and replace instalments
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92', [
  'body' => '{
  "name": "50/50 split",
  "instalments": [
    {
      "type": "PERCENTAGE_RATE",
      "value": 50,
      "net_days": 15
    },
    {
      "type": "PERCENTAGE_RATE",
      "value": 50,
      "net_days": 30
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Rename and replace instalments
using RestSharp;

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

```swift Rename and replace instalments
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "50/50 split",
  "instalments": [
    [
      "type": "PERCENTAGE_RATE",
      "value": 50,
      "net_days": 15
    ],
    [
      "type": "PERCENTAGE_RATE",
      "value": 50,
      "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/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Turn a split term into a single due date

**Request**

```json
{
  "net_days": 30,
  "instalments": []
}
```

**Response**

```json
{
  "data": {
    "id": "c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92",
    "project_id": "spruce-demo",
    "name": "50/50 split",
    "net_days": 30,
    "is_default": false,
    "is_active": true,
    "instalments": [
      {
        "type": "PERCENTAGE_RATE",
        "value": "50",
        "net_days": 15
      },
      {
        "type": "PERCENTAGE_RATE",
        "value": "50",
        "net_days": 30
      }
    ],
    "discount": null,
    "created_at": "2026-06-18T10:00:00Z"
  },
  "status": true,
  "message": "Successfully updated payment term"
}
```

**SDK Code**

```python Turn a split term into a single due date
import requests

url = "https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92"

payload = {
    "net_days": 30,
    "instalments": []
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Turn a split term into a single due date
const url = 'https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"net_days":30,"instalments":[]}'
};

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

```go Turn a split term into a single due date
package main

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

func main() {

	url := "https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92"

	payload := strings.NewReader("{\n  \"net_days\": 30,\n  \"instalments\": []\n}")

	req, _ := http.NewRequest("PATCH", 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 Turn a split term into a single due date
require 'uri'
require 'net/http'

url = URI("https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"net_days\": 30,\n  \"instalments\": []\n}"

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

```java Turn a split term into a single due date
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"net_days\": 30,\n  \"instalments\": []\n}")
  .asString();
```

```php Turn a split term into a single due date
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92', [
  'body' => '{
  "net_days": 30,
  "instalments": []
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Turn a split term into a single due date
using RestSharp;

var client = new RestClient("https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"net_days\": 30,\n  \"instalments\": []\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Turn a split term into a single due date
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Remove the early-payment discount

**Request**

```json
{
  "clear_discount": true
}
```

**Response**

```json
{
  "data": {
    "id": "c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92",
    "project_id": "spruce-demo",
    "name": "50/50 split",
    "net_days": 30,
    "is_default": false,
    "is_active": true,
    "instalments": [
      {
        "type": "PERCENTAGE_RATE",
        "value": "50",
        "net_days": 15
      },
      {
        "type": "PERCENTAGE_RATE",
        "value": "50",
        "net_days": 30
      }
    ],
    "discount": null,
    "created_at": "2026-06-18T10:00:00Z"
  },
  "status": true,
  "message": "Successfully updated payment term"
}
```

**SDK Code**

```python Remove the early-payment discount
import requests

url = "https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92"

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

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

print(response.json())
```

```javascript Remove the early-payment discount
const url = 'https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"clear_discount":true}'
};

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

```go Remove the early-payment discount
package main

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

func main() {

	url := "https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92"

	payload := strings.NewReader("{\n  \"clear_discount\": true\n}")

	req, _ := http.NewRequest("PATCH", 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 Remove the early-payment discount
require 'uri'
require 'net/http'

url = URI("https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"clear_discount\": true\n}"

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

```java Remove the early-payment discount
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"clear_discount\": true\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92', [
  'body' => '{
  "clear_discount": true
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Remove the early-payment discount
using RestSharp;

var client = new RestClient("https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"clear_discount\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Remove the early-payment discount
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["clear_discount": 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/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Deactivate a term

**Request**

```json
{
  "is_active": false
}
```

**Response**

```json
{
  "data": {
    "id": "c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92",
    "project_id": "spruce-demo",
    "name": "50/50 split",
    "net_days": 30,
    "is_default": false,
    "is_active": true,
    "instalments": [
      {
        "type": "PERCENTAGE_RATE",
        "value": "50",
        "net_days": 15
      },
      {
        "type": "PERCENTAGE_RATE",
        "value": "50",
        "net_days": 30
      }
    ],
    "discount": null,
    "created_at": "2026-06-18T10:00:00Z"
  },
  "status": true,
  "message": "Successfully updated payment term"
}
```

**SDK Code**

```python Deactivate a term
import requests

url = "https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92"

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

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

print(response.json())
```

```javascript Deactivate a term
const url = 'https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"is_active":false}'
};

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

```go Deactivate a term
package main

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

func main() {

	url := "https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92"

	payload := strings.NewReader("{\n  \"is_active\": false\n}")

	req, _ := http.NewRequest("PATCH", 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 Deactivate a term
require 'uri'
require 'net/http'

url = URI("https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"is_active\": false\n}"

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

```java Deactivate a term
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"is_active\": false\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92', [
  'body' => '{
  "is_active": false
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Deactivate a term
using RestSharp;

var client = new RestClient("https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"is_active\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Deactivate a term
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["is_active": false] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.papertracc.com/v1/configs/payment-terms/c81e7a35-2f4d-4b6c-9a0e-5d3b7f1c8e92")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```