Skip to main content

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:

ParameterTypeDescription
pageIntegerThe page number to retrieve. Default is 1.
limitIntegerThe number of items to retrieve per page. Default is 10.
statusBooleanFilter the results based on the payment term's status.
idsStringComma-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

KeyTypeDescription
successBooleanIndicates if the request was successful.
dataArray of ObjectsList of payment terms.
paginationObjectProvides pagination details given below.

Payment Terms Data

FieldTypeDescription
_idStringThe unique identifier of the payment term.
nameStringThe name of the payment term.
statusBooleanThe status of the payment term.
dueTypeStringSpecifies the condition upon which the payment is due.
paymentDueDaysIntegerNumber of days after the dueType upon which the payment is due.
createdAtStringTimestamp of when the payment term was created (in ISO 8601 format).
updatedAtStringTimestamp of when the payment term was last updated (in ISO 8601 format).
idStringDuplicate field for ID, often used for front-end purposes or data binding.

Pagination Details

KeyTypeDescription
pageIntegerCurrent page number being viewed.
totalIntegerTotal number of available pages.
countIntegerTotal number of items available on the page.

Notes

  • Ensure that the accessToken provided is valid and has not expired.
  • The server's response will be paginated if there are multiple entries.