> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qwoty.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Payment Term

> Create a new payment term with custom installment schedules

## Authorization

**Authorization** `string` *required*

Bearer token for authentication. Format: `Bearer qwoty_your_token`

## Request Body

**name** `string` *required*

Name of the payment term (max 50 characters)

**api\_name** `string` *required*

Unique API identifier (slug format, e.g., `net_30_days`)

**reference** `string`

Internal reference code (max 50 characters)

**is\_active** `boolean` (default: true)

Whether the payment term is active

**identifiers** `object`

External system identifiers

**Identifiers**

**identifiers.crm** `string`

CRM identifier

**identifiers.erp** `string`

ERP identifier

**identifiers.accounting** `string`

Accounting identifier

**installments** `array`

Array of payment installments. Total percentage must equal 100%.

**Installment Object**

**name** `string`

Name of the installment

**percentage** `number` *required*

Percentage of total amount (0-100)

**term** `enum` *required*

Payment term type. Options: `due_now`, `due_on_receipt`, `net15`, `net30`, `net45`, `net60`, `net90`, `net120`, `eom30`, `eom45`, `eom60`, `po_received`, `custom`

**custom\_text** `string`

Custom text (required if term is `custom`)

**order\_number** `number` *required*

Display order (1, 2, 3...)

**is\_date\_required** `boolean` (default: false)

Whether a due date must be entered on the quote for this installment. Only
applies to `custom` and `po_received` terms; ignored (stored as `false`) for
other terms.

> [!WARNING]
>
> The sum of all installment percentages must equal exactly 100%.

## Examples

```bash Simple Payment (100% Net 30) theme={null}
curl -X POST https://qwoty.app/api/payment-terms \
  -H "Authorization: Bearer qwoty_your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Net 30 Days",
    "api_name": "net_30_days",
    "reference": "PT001",
    "is_active": true,
    "installments": [
      {
        "name": "Full Payment",
        "percentage": 100,
        "term": "net30",
        "order_number": 1,
        "is_date_required": false
      }
    ]
  }'
```

```bash Split Payment (30% + 70%) theme={null}
curl -X POST https://qwoty.app/api/payment-terms \
  -H "Authorization: Bearer qwoty_your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "30% Deposit + 70% on Delivery",
    "api_name": "30_deposit_70_delivery",
    "reference": "PT002",
    "is_active": true,
    "installments": [
      {
        "name": "Deposit on Order",
        "percentage": 30,
        "term": "due_now",
        "order_number": 1,
        "is_date_required": false
      },
      {
        "name": "Balance on Delivery",
        "percentage": 70,
        "term": "due_on_receipt",
        "order_number": 2,
        "is_date_required": false
      }
    ]
  }'
```

```javascript JavaScript theme={null}
const response = await fetch('https://qwoty.app/api/payment-terms', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer qwoty_your_token',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Net 30 Days',
    api_name: 'net_30_days',
    is_active: true,
    installments: [
      {
        name: 'Full Payment',
        percentage: 100,
        term: 'net30',
        order_number: 1,
      },
    ],
  }),
})

const data = await response.json()
```

```python Python theme={null}
import requests

response = requests.post(
    'https://qwoty.app/api/payment-terms',
    headers={
        'Authorization': 'Bearer qwoty_your_token',
        'Content-Type': 'application/json'
    },
    json={
        'name': 'Net 30 Days',
        'api_name': 'net_30_days',
        'is_active': True,
        'installments': [
            {
                'name': 'Full Payment',
                'percentage': 100,
                'term': 'net30',
                'order_number': 1
            }
        ]
    }
)

data = response.json()
```

## Response

**success** `boolean`

Indicates if the request was successful

**data** `object`

The created payment term object

**Payment Term Object**

**id** `string`

Unique identifier (UUID)

**name** `string`

Payment term name

**api\_name** `string`

API identifier

**reference** `string`

Internal reference

**is\_active** `boolean`

Active status

**installments** `array`

Array of installment objects with id, name, percentage, term, custom\_text, order\_number, and is\_date\_required

**created\_at** `string`

ISO 8601 timestamp

```json Success Response theme={null}
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Net 30 Days",
    "api_name": "net_30_days",
    "reference": "PT001",
    "is_active": true,
    "installments": [
      {
        "id": "660e8400-e29b-41d4-a716-446655440001",
        "name": "Full Payment",
        "percentage": 100,
        "term": "net30",
        "order_number": 1,
        "is_date_required": false
      }
    ],
    "created_at": "2024-12-21T10:30:00Z"
  }
}
```

## Error Responses

```json Validation Error theme={null}
{
  "error": "Installment percentages must sum to 100%"
}
```

```json Duplicate API Name theme={null}
{
  "error": "Payment term with api_name 'net_30_days' already exists"
}
```

```json Unauthorized theme={null}
{
  "error": "Invalid or expired token"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.