Skip to main content

Retrieve Contract Details

GET https://infrahub-api.nexgencloud.com/v1/pricebook/contracts/{contract_id}

Retrieves the details of a specified customer contract, including its terms and the discounts applied to all resources under the contract. Include the contract ID in the path to view its details. For more information about contracts, click here.


Path parameters


contract_id integer   Required

The unique identifier of the contract for which to retrieve details.


Attributes


status boolean

Indicates the status of the request to retrieve contract details, true indicates success, while false indicates an error.


message string

A message describing the success or failure of the request.


contract object

Contains information about the specified contract.

Show child attributes
created_at date-time

The timestamp when the contract was created.


expiration_policy integer

The expiration policy for the contract is represented by a value of 0, indicating that contracted resources will be deleted upon contract expiration, or 1, indicating that contracted resources will be retained, with billing continuing at market rates.


org_id integer

The unique identifier for the organization associated with the contract.


id integer

The unique identifier for the contract.


discounts array of objects

An array of objects containing information about discounts applied to each resource type associated with the contract.

Show child attributes
resource string

The resource to which the discount applies.


discount_amount float or null

If the discount_type used is percent, this specifies the discounted price of the resource in dollars.


discount_percent float or null

If the discount_type used is percent, this specifies the percentage discount to be applied to the market rate for a given resource.


validity_days integer or null

The number of days remaining for the validity of the discount code if provided.


discount_type string

The type of discount applied to the resource can be represented as either flat or percent. For flat discount type, the actual price of the discounted resource is specified, while for percent discount type, a percentage discount is applied to the market rate for the resource.


resource_id integer

The unique identifier for the resource associated with the discount.


discount_status string

The status of the discount (e.g., "active").


resource_count integer

The number of resources that the discount is applied to.


id integer

The unique identifier for the discount.


discount_code string or null

The discount code applied to the resource, if applicable.


start_date date-time

The start date of the discount.


end_date date-time

The end date of the discount.


start_date date-time

The start date of the contract.


status string

The status of the contract (e.g., "Active").


description string

A description of the contract.


end_date date-time

The end date of the contract.

Example request
curl -X GET "https://infrahub-api.nexgencloud.com/v1/pricebook/contracts/{contract_id}" \
-H "accept: application/json"\
-H "api_key: YOUR API KEY"
Response
{
"status": true,
"message": "Getting contract detail success",
"contract": {
"created_at": "2024-03-14T11:00:18",
"expiration_policy": 0,
"org_id": 29,
"id": 16,
"discounts": [
{
"resource": "RTX-A4000",
"discount_amount": 0.4300000071525574,
"discount_percent": null,
"validity_days": null,
"discount_type": "flat",
"resource_id": 10,
"discount_status": "active",
"resource_count": 1,
"id": 2044,
"discount_code": null,
"start_date": "2024-03-14T11:00:00",
"end_date": "2024-03-14T11:10:00"
},
{...}
],
"start_date": "2024-03-14T11:00:00",
"description": "",
"end_date": "2024-03-14T11:10:00"
}
}

Returns

Returns the status of the request to retrieve the details of a specified contract in the contract object. This object contains the contract ID, creation timestamp, expiration date, expiration policy (which determines whether contract resources are retained after expiration), organization ID, contract status (Active or otherwise), and a description. Additionally, it includes an array of discounts objects containing details on the discounts applied to contracted resources. Each discounts object specifies the terms of the discounts applied to individual resources within the contract. Refer to the attributes of the discounts objects for more information.


Back to top