Get Payment Terms
This API endpoint retrieves a list of payment terms from the server.
HTTP Request
- URL:
/paymentTerms - Method:
GET - Headers:
accessToken: Required. This is your access token for authenticating the request.
Query Parameters
To effectively filter and paginate the payment terms, you can include the following query parameters:
| Parameter | Type | Description |
|---|---|---|
page | Integer | The page number to retrieve. Default is 1. |
limit | Integer | The number of items to retrieve per page. Default is 10. |
status | Boolean | Filter the results based on the payment term's status. |
ids | String | Comma-separated list of specific IDs to retrieve. |
cURL Example
Below is a sample cURL command that demonstrates how to make a request to the API endpoint:
curl --location '<BASE_URL>/paymentTerms?page=1&limit=10&status=true&ids=62349823012342143' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
- 200 OK: The request was successful, and the server returned a list of payment terms.
- 4XX: Client errors, such as an invalid access token or missing parameters.
- 5XX: Server errors indicating that something went wrong on the server's end.
Sample JSON Response
Below is an example of the JSON response you might receive from making a request to this endpoint:
{
"success": true,
"data": [
{
"_id": "67a1ed576ec18627bb245946",
"name": "Due on fulfilment",
"status": true,
"dueType": "fulfillment",
"paymentDueDays": 0,
"createdAt": "2025-02-04T10:35:03.014Z",
"updatedAt": "2025-02-04T10:40:21.065Z",
"__v": 0,
"id": "67a1ed576ec18627bb245946"
}
// Additional payment terms omitted for brevity...
],
"pagination": {
"page": 1,
"total": 7,
"count": 7
}
}
Response Details
| Key | Type | Description |
|---|---|---|
success | Boolean | Indicates if the request was successful. |
data | Array of Objects | List of payment terms. |
pagination | Object | Provides pagination details given below. |
Payment Terms Data
| Field | Type | Description |
|---|---|---|
_id | String | The unique identifier of the payment term. |
name | String | The name of the payment term. |
status | Boolean | The status of the payment term. |
dueType | String | Specifies the condition upon which the payment is due. |
paymentDueDays | Integer | Number of days after the dueType upon which the payment is due. |
createdAt | String | Timestamp of when the payment term was created (in ISO 8601 format). |
updatedAt | String | Timestamp of when the payment term was last updated (in ISO 8601 format). |
id | String | Duplicate field for ID, often used for front-end purposes or data binding. |
Pagination Details
| Key | Type | Description |
|---|---|---|
page | Integer | Current page number being viewed. |
total | Integer | Total number of available pages. |
count | Integer | Total number of items available on the page. |
Notes
- Ensure that the
accessTokenprovided is valid and has not expired. - The server's response will be paginated if there are multiple entries.