メインコンテンツへスキップ

get-contract

dci get-contract customerID contractID

Returns the specified contract.

Output

OK - Contract returned.

By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.

FieldTypeDescription
versionsarray of objectThe contract versions, newest last, with their billing terms.
versions[].versionintegerContract version number.
versions[].statusstringVersion status.
versions[].namestring
versions[].startDatestring (date-time)
versions[].endDatestring (date-time)
versions[].effectiveStartstring (date-time)
versions[].effectiveEndstring (date-time)
versions[].renewalPolicystring
versions[].cancellationReasonstring
versions[].billingProfileobject
versions[].invoicesEmailstring (email)
versions[].contractUpdatesEmailstring (email)
versions[].doitInvoicingEnabledbooleanWhether DoiT generates invoices for this contract.
versions[].managementAccountsarray of string
versions[].billingRulesarray of object
versions[].priceBooksarray of object
versions[].customLineItemsarray of object
idstringThe unique identifier of the contract.
customerIdstringThe customer (tenant) that holds the contract.
typestringThe immutable contract type.
statusstringThe contract status. One of: "draft", "scheduled", "active", "cancelled", "expired", "superseded".
namestringThe contract name.
startDatestring (date-time)The contract start date.
endDatestring (date-time)The contract end date.
renewalPolicystringThe renewal policy. One of: "auto", "manual", "fixed".
doitInvoicingEnabledbooleanWhether DoiT generates invoices for this contract.
currentVersionNumberintegerThe current version number of the contract.
timeCreatedstring (date-time)When the contract was created.
Raw JSON schema
{
"description": "A single contract with its version terms. DoiT-internal fields are not exposed.",
"allOf": [
{
"type": "object",
"description": "External view of a contract. DoiT-internal fields are not exposed.",
"properties": {
"id": {
"type": "string",
"description": "The unique identifier of the contract."
},
"customerId": {
"type": "string",
"description": "The customer (tenant) that holds the contract."
},
"type": {
"type": "string",
"description": "The immutable contract type."
},
"status": {
"type": "string",
"description": "The contract status.",
"enum": [
"draft",
"scheduled",
"active",
"cancelled",
"expired",
"superseded"
]
},
"name": {
"type": "string",
"description": "The contract name."
},
"startDate": {
"type": "string",
"format": "date-time",
"nullable": true,
"description": "The contract start date."
},
"endDate": {
"type": "string",
"format": "date-time",
"nullable": true,
"description": "The contract end date."
},
"renewalPolicy": {
"type": "string",
"description": "The renewal policy.",
"enum": [
"auto",
"manual",
"fixed"
]
},
"doitInvoicingEnabled": {
"type": "boolean",
"description": "Whether DoiT generates invoices for this contract."
},
"currentVersionNumber": {
"type": "integer",
"nullable": true,
"description": "The current version number of the contract."
},
"timeCreated": {
"type": "string",
"format": "date-time",
"description": "When the contract was created."
}
}
},
{
"type": "object",
"properties": {
"versions": {
"type": "array",
"description": "The contract versions, newest last, with their billing terms.",
"items": {
"type": "object",
"properties": {
"version": {
"type": "integer",
"description": "Contract version number."
},
"status": {
"type": "string",
"description": "Version status."
},
"name": {
"type": "string"
},
"startDate": {
"type": "string",
"format": "date-time"
},
"endDate": {
"type": "string",
"format": "date-time",
"nullable": true
},
"effectiveStart": {
"type": "string",
"format": "date-time"
},
"effectiveEnd": {
"type": "string",
"format": "date-time",
"nullable": true
},
"renewalPolicy": {
"type": "string"
},
"cancellationReason": {
"type": "string",
"nullable": true
},
"billingProfile": {
"type": "object"
},
"invoicesEmail": {
"type": "string",
"format": "email"
},
"contractUpdatesEmail": {
"type": "string",
"format": "email"
},
"doitInvoicingEnabled": {
"type": "boolean",
"description": "Whether DoiT generates invoices for this contract."
},
"managementAccounts": {
"type": "array",
"items": {
"type": "string"
}
},
"billingRules": {
"type": "array",
"items": {
"type": "object"
}
},
"priceBooks": {
"type": "array",
"items": {
"type": "object"
}
},
"customLineItems": {
"type": "array",
"items": {
"type": "object"
}
}
}
}
}
}
}
]
}

Errors

On failure, dci prints a single error message — with a hint when one is available — and exits with a typed code your scripts can branch on. See Errors and exit codes for the full contract.

HTTP statusExit codeError codeMeaning
40110AUTHENTICATION_FAILEDNot signed in, or the API token is invalid. Run dci login or check DCI_API_KEY.
40311PERMISSION_DENIEDThe DoiT user or the active customer context does not have access.
40420RESOURCE_NOT_FOUNDThe requested resource does not exist. Check the identifier argument.

Aliases: getcontract