Get Payment Term by ID
This API endpoint retrieves the details of a specific payment term based on the provided ID.
HTTP Request
- URL:
/api/paymentTerms/{id} - Method:
GET - Headers:
accessToken: Required. This is your access token for authenticating the request.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | String | The unique identifier of the payment term to retrieve. |
cURL Example
Below is a sample cURL command that demonstrates how to make a request to the API endpoint:
curl --location '/api/paymentTerms/67a1eeba9269290064a159a4' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
- 200 OK: The request was successful, and the server returned the details of the specified payment term.
- 4XX: Client errors indicating issues such as an invalid access token or ID not found.
- 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": {
"name": "Net 90",
"status": true,
"dueType": "net",
"paymentDueDays": 90,
"createdAt": "2025-02-04T10:40:58.825Z",
"updatedAt": "2025-02-04T10:40:58.825Z",
"id": "67a1eeba9269290064a159a4"
}
}
Response Details
| Key | Type | Description |
|---|---|---|
success | Boolean | Indicates if the request was successful. |
data | Object | Contains the details of the requested payment term. |
Payment Term Data
| Field | Type | Description |
|---|---|---|
name | String | The name of the payment term. |
status | Boolean | The current status of the payment term, indicating if it's active. |
dueType | String | Specifies the condition upon which the payment is due (e.g., "net"). |
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 | The unique identifier of the payment term. |
Notes
- Ensure that the
accessTokenprovided is valid and has not expired. - Replace
{id}in the URL with the actual ID of the payment term you want to retrieve.