Add a Payment Term
Creates a new payment term.
HTTP Request
- URL:
/paymentTerms - Method:
POST - Headers:
accessToken: Required. Your API access token.Content-Type:application/json
- Required scope:
READ_ORDERorREAD_WRITE_ORDER
Request Body
The request body is a JSON object with the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
name | String | Yes | Name of the payment term. Must be unique. |
status | Boolean | No | Whether the payment term is active. Default is true. |
dueType | String | No | net or fulfillment. Default is net. |
paymentDueDays | Number | No | Number of days until payment is due. Required when dueType is net. Default is 0. |
cURL Example
curl --location '<BASE_URL>/paymentTerms' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Net 60",
"status": true,
"dueType": "net",
"paymentDueDays": 60
}'
Response
- 200 OK: The payment term was created successfully.
- 400 Bad Request: The access token is missing or invalid, a field is missing or not valid, or a payment term with the same name already exists.
Sample JSON Response
{
"success": true,
"data": {
"id": "67a46366869ddc960b432623",
"name": "Net 60",
"status": true,
"dueType": "net",
"paymentDueDays": 60,
"createdAt": "2025-02-06T07:23:18.394Z",
"updatedAt": "2025-02-06T07:23:18.394Z"
}
}
Response Details
| Field | Type | Description |
|---|---|---|
success | Boolean | Whether the request was successful. |
data | Object | The new payment term. See Payment Term Data. |
Notes
- If the name is already used, the response message is
Payment term name already exists.