Skip to main content

create-contract-template

dci create-contract-template

Creates a contract template for the authenticated tenant (from the bearer token). Requires ContractTemplatesAdmin, DoiT API access (platform:externalApi), and the channelops:contracts:templates entitlement.

Request

Content-Type: application/json

Schema

{
"type": "object",
"description": "Payload for creating or updating a contract template.",
"required": [
"name",
"platform",
"eligibleFrom"
],
"properties": {
"name": {
"type": "string"
},
"platform": {
"type": "string"
},
"structure": {
"description": "Which preset the template started from. Optional — an omitted or blank value is recorded as \"blank\".",
"type": "string"
},
"eligibleFrom": {
"type": "string",
"format": "date-time"
},
"eligibleTo": {
"type": "string",
"format": "date-time"
},
"billingRules": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"managementAccounts": {
"type": "array",
"items": {
"type": "string"
}
},
"filters": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"formula": {
"type": "string"
}
}
}
},
"priceBooks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"managementAccounts": {
"type": "array",
"items": {
"type": "string"
}
},
"rules": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"percentageChange": {
"type": "number",
"format": "double"
},
"unitPrice": {
"type": "number",
"format": "double"
},
"filters": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"formula": {
"type": "string"
},
"cloud": {
"type": "string"
},
"lineItemDescription": {
"type": "string"
},
"applyInLine": {
"type": "boolean"
},
"includeCredits": {
"type": "boolean"
},
"applyAWSEligibleDiscount": {
"type": "boolean"
}
}
}
}
}
}
},
"customLineItems": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}

Output

Created - Contract template created.

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

FieldTypeDescription
templateIdstring
namestring
platformstring
statusstringOne of: "active", "archived".
structurestring
eligibleFromstring (date-time)
eligibleTostring (date-time)
billingRulesarray of object
billingRules[].namestring
billingRules[].managementAccountsarray of string
billingRules[].filtersarray of object
billingRules[].formulastring
priceBooksarray of object
priceBooks[].namestring
priceBooks[].managementAccountsarray of string
priceBooks[].rulesarray of object
priceBooks[].rules[].namestring
priceBooks[].rules[].percentageChangenumber (double)
priceBooks[].rules[].unitPricenumber (double)
priceBooks[].rules[].filtersarray of object
priceBooks[].rules[].formulastring
priceBooks[].rules[].cloudstring
priceBooks[].rules[].lineItemDescriptionstring
priceBooks[].rules[].applyInLineboolean
priceBooks[].rules[].includeCreditsboolean
priceBooks[].rules[].applyAWSEligibleDiscountboolean
customLineItemsarray of object
createdAtstring (date-time)
updatedAtstring (date-time)
archivedAtstring (date-time)
Raw JSON schema
{
"type": "object",
"description": "Contract template returned by the PartnerOps external API.",
"properties": {
"templateId": {
"type": "string"
},
"name": {
"type": "string"
},
"platform": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"active",
"archived"
]
},
"structure": {
"type": "string"
},
"eligibleFrom": {
"type": "string",
"format": "date-time"
},
"eligibleTo": {
"type": "string",
"format": "date-time"
},
"billingRules": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"managementAccounts": {
"type": "array",
"items": {
"type": "string"
}
},
"filters": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"formula": {
"type": "string"
}
}
}
},
"priceBooks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"managementAccounts": {
"type": "array",
"items": {
"type": "string"
}
},
"rules": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"percentageChange": {
"type": "number",
"format": "double"
},
"unitPrice": {
"type": "number",
"format": "double"
},
"filters": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"formula": {
"type": "string"
},
"cloud": {
"type": "string"
},
"lineItemDescription": {
"type": "string"
},
"applyInLine": {
"type": "boolean"
},
"includeCredits": {
"type": "boolean"
},
"applyAWSEligibleDiscount": {
"type": "boolean"
}
}
}
}
}
}
},
"customLineItems": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
},
"archivedAt": {
"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 statusExit codeError codeMeaning
40030VALIDATION_ERRORThe arguments or request body were rejected. Review the command's flags and payload.
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.
40921RESOURCE_CONFLICTThe operation conflicts with the resource's current state.
50040API_SERVER_ERRORThe API failed to process the request. Retryable; contact DoiT support if it persists.

Aliases: createcontracttemplate