Skip to main content

List Contracts

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

Retrieves a list of customer contracts and their details, including the terms of each contract and the discounts applied to all resources under each contract. For additional details about contracts, click here.


Parameters


No parameters.


Attributes


status boolean

Indicates the status of the request to retrieve a list of contracts, true indicates success, while false indicates an error.


message string

A message describing the success or failure of the request.


count integer

The number of contracts in the list.


contracts array of objects

An array of objects containing information about customer contracts.

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" \
-H "accept: application/json"\
-H "api_key: YOUR API KEY"
Response
{
"status": true,
"message": "Getting customer contracts list successful",
"count": 1,
"contracts": [
{
"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",
"status": "Active",
"description": "",
"end_date": "2024-03-14T11:10:00"
}
]
}

Returns

Returns the status of the request to retrieve a list of contracts and an array of contracts objects, each providing details on a contract. The contract object contains the ID, timestamp of creation, end date when the contract will expire, the expiration_policy which determines whether or not contract resources will be retained after contract expiration, organization ID, status of the contract as Active or otherwise, and a description for the contract. 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 each resource within the contract. Refer to the attributes of the array of discounts objects for more information.


Back to top