create-contract
dci create-contract customerID
Creates a draft contract for the specified customer. Requires the caller to be the direct parent (T1 for a T2-level contract, T2 for a T3-level contract). Write access requires a role without contractsReadOnly; user API tokens must include the matching permission in their scope.
Request
Content-Type: application/json
Schema
{
"type": "object",
"description": "Contract create/update payload. Full field-level validation is applied server-side.",
"required": [
"name",
"startDate",
"renewalPolicy",
"invoicesEmail",
"contractUpdatesEmail",
"billingProfile"
],
"properties": {
"name": {
"type": "string"
},
"startDate": {
"type": "string",
"format": "date-time"
},
"endDate": {
"type": "string",
"format": "date-time",
"nullable": true
},
"renewalPolicy": {
"type": "string",
"enum": [
"auto",
"manual",
"fixed"
]
},
"invoicesEmail": {
"type": "string",
"format": "email"
},
"contractUpdatesEmail": {
"type": "string",
"format": "email"
},
"billingProfile": {
"type": "object",
"description": "The billing profile (name, country, state, city, address, zip)."
},
"managementAccounts": {
"type": "array",
"items": {
"type": "string"
}
},
"billingRules": {
"type": "array",
"items": {
"type": "object"
}
},
"priceBooks": {
"type": "array",
"items": {
"type": "object"
}
},
"customLineItems": {
"type": "array",
"items": {
"type": "object"
}
}
}
}
Output
Created - The contract draft was created.
By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.
| Field | Type | Description |
|---|---|---|
contractId | string | |
version | integer | |
status | string | |
message | string | |
timestamp | string (date-time) |
Raw JSON schema
{
"type": "object",
"description": "The result of creating a contract or contract version.",
"properties": {
"contractId": {
"type": "string"
},
"version": {
"type": "integer"
},
"status": {
"type": "string"
},
"message": {
"type": "string"
},
"timestamp": {
"type": "string",
"format": "date-time"
}
}
}
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 status | Exit code | Error code | Meaning |
|---|---|---|---|
| 400 | 30 | VALIDATION_ERROR | The arguments or request body were rejected. Review the command's flags and payload. |
| 401 | 10 | AUTHENTICATION_FAILED | Not signed in, or the API token is invalid. Run dci login or check DCI_API_KEY. |
| 403 | 11 | PERMISSION_DENIED | The DoiT user or the active customer context does not have access. |
Aliases: createcontract