contracts.renew

What it does

Record the next term on the same contract, preserving billing calendars and historical prices. Supply evidenced list/capped prices and index facts; above-cap quotes are recorded and flagged. agreements without changes keeps the current agreement change rules; changes: {} clears them.

Before you send it

An authorized OAuth connection may call it, including a headless client. Effective membership, application grant and token permissions still apply. Describe contracts.renew through GET /v1/catalog/commands/{name} before acting.

The envelope may reference a registered source document of kind contract, source_document; this is separate from any evidence required by the input.

Inputs

Put these fields inside the envelope’s input object. The outer envelope names the command, a stable idempotency_key and effective_at; request and recovery rules explain those separately. Use exact minor-unit integer strings for monetary fields. Take existing IDs from prior reads or command results; choose a new identity only where the command asks for one.

Required means required within its containing object; an optional parent can be omitted.

FieldTypeRequiredMeaning and accepted values
contractIdstringYesMinimum length: 1. Example: "ctr_vendor".
expectedDocumentIdstringYesMinimum length: 1. Example: "doc_contract".
sourceFactIdstringYesMinimum length: 1. Example: "renewal-quote".
termIndexintegerYesMinimum: 1. Example: 1.
termsobjectNo
indexFactsobjectNo
evidenceobjectYes
evidence.acceptancearrayYesItems: object. Minimum items: 1. Maximum items: 20.
evidence.acceptance[].kindstringYesChoose "tap_message", "x402_receipt", "chain_tx", "signed_doc", "stripe_object", "other". Example: "other".
evidence.acceptance[].refstringYesMinimum length: 1. Example: "vendor-quote".
evidence.acceptance[].signerstringNoMinimum length: 1.
agreementsobjectNo
agreements.changesobjectNo
agreements.changes.termsChangeschema-definedNoChoose a matching alternative in the exact schema below.
agreements.changes.priceChangeschema-definedNoChoose a matching alternative in the exact schema below.
agreements.refsarrayYesItems: object. Minimum items: 1. Maximum items: 20.
agreements.refs[].keystringYesMinimum length: 1.
agreements.refs[].rolestringYesChoose "agreement", "order_form", "schedule", "policy".
agreements.refs[].urlstringYesFormat: uri. Minimum length: 1. Maximum length: 2048.
agreements.refs[].labelstringNoMinimum length: 1.
agreements.refs[].cidstringNoMinimum length: 1.
agreements.refs[].methodobjectYes
agreements.refs[].method.kindstringYesChoose "pdf", "markdown", "html", "html_blanked", "html_extract", "embedded_json", "api_json", "text_render", "unstable".
agreements.refs[].method.commandstringNoMinimum length: 1. Maximum length: 1000.
agreements.refs[].seenAtstringYesFormat: date. Minimum length: 1. Pattern: "^\\d{4}-\\d{2}-\\d{2}$".
agreements.refs[].historystringNoChoose "vendor_archive", "git", "wayback".
agreements.refs[].catalogobjectNo
agreements.refs[].catalog.cidstringYesMinimum length: 1.
agreements.refs[].documentIdstringNoMinimum length: 1.
agreements.precedenceobjectYes
agreements.precedence.statedbooleanYes
agreements.precedence.orderarrayNoItems: string. Minimum items: 0. Maximum items: 20.
agreements.precedence.orderFormWinsOnarrayNoItems: string. Minimum items: 0. Maximum items: 20.
lengthschema-definedNoChoose a matching alternative in the exact schema below.
rolloverobjectNo
rollover.activityKeystringYesMinimum length: 1.
rollover.obligationKeystringYesMinimum length: 1.
rollover.factsobjectYes

After acceptance

When the command emits events, its documented effects and receipt are recorded in the command transaction. The response returns commandId, replayed, the command-specific result below and emitted events with their IDs and CIDs. A command is not automatically a cash movement or revenue recognition: use the behavior above to determine what this command records.

Inspect result and the affected records or reports before continuing. Save returned identifiers for later calls. Fetch GET /v1/commands/{id} with commandId to recover the accepted receipt; retry the same intent with the same idempotency key if the response was lost. Some commands can succeed with events: [] and return a transient result and commandId without persisting a receipt. A lookup of that ID can return null; retain the returned result and verify the affected record. Retrying can re-evaluate the current state rather than replay a stored result. A domain no_change is a separate success outcome with no persisted receipt.

Result fields

Required means required within its containing object; an optional parent can be omitted.

FieldTypeRequiredMeaning and accepted values
idstringNoMinimum length: 1.
documentIdstringNoMinimum length: 1.
decisionsarrayNoItems: object.

All commands · Operation and errors · Reusable schemas

Keep credentials out of prompts; rehearse writes only in a disposable sandbox.

Exact request schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": {
      "const": "contracts.renew"
    },
    "input": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "contractId": {
          "type": "string",
          "minLength": 1
        },
        "expectedDocumentId": {
          "type": "string",
          "minLength": 1
        },
        "sourceFactId": {
          "type": "string",
          "minLength": 1
        },
        "termIndex": {
          "type": "integer",
          "minimum": 1
        },
        "terms": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "indexFacts": {
          "type": "object",
          "additionalProperties": {
            "type": "integer",
            "minimum": -10000,
            "maximum": 100000
          }
        },
        "evidence": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "acceptance": {
              "type": "array",
              "minItems": 1,
              "maxItems": 20,
              "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "kind",
                  "ref"
                ],
                "properties": {
                  "kind": {
                    "enum": [
                      "tap_message",
                      "x402_receipt",
                      "chain_tx",
                      "signed_doc",
                      "stripe_object",
                      "other"
                    ]
                  },
                  "ref": {
                    "type": "string",
                    "minLength": 1
                  },
                  "signer": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          },
          "required": [
            "acceptance"
          ]
        },
        "agreements": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "changes": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "termsChange": {
                  "anyOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "rule": {
                          "const": "on_posting"
                        },
                        "from": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "rule"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "rule": {
                          "const": "after_notice"
                        },
                        "from": {
                          "type": "string",
                          "minLength": 1
                        },
                        "noticeDays": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 366
                        }
                      },
                      "required": [
                        "rule",
                        "noticeDays"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "rule": {
                          "const": "next_term"
                        },
                        "from": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "rule"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "rule": {
                          "const": "at_renewal"
                        },
                        "from": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "rule"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "rule": {
                          "const": "locked_to_order"
                        },
                        "from": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "rule"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "rule": {
                          "const": "objection_until_renewal"
                        },
                        "from": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "rule"
                      ]
                    }
                  ]
                },
                "priceChange": {
                  "anyOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "rule": {
                          "const": "no_notice"
                        },
                        "from": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "rule"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "rule": {
                          "const": "after_notice"
                        },
                        "from": {
                          "type": "string",
                          "minLength": 1
                        },
                        "noticeDays": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 366
                        }
                      },
                      "required": [
                        "rule",
                        "noticeDays"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "rule": {
                          "const": "held_for_paid_term"
                        },
                        "from": {
                          "type": "string",
                          "minLength": 1
                        },
                        "noticeDays": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 366
                        }
                      },
                      "required": [
                        "rule",
                        "noticeDays"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "rule": {
                          "const": "at_renewal"
                        },
                        "from": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "rule"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "rule": {
                          "const": "capped_at_renewal"
                        },
                        "from": {
                          "type": "string",
                          "minLength": 1
                        },
                        "capPpm": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 10000000
                        },
                        "index": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "rule",
                        "capPpm"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "rule": {
                          "const": "mid_term_credit"
                        },
                        "from": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "rule"
                      ]
                    }
                  ]
                }
              },
              "required": []
            },
            "refs": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1
                  },
                  "role": {
                    "enum": [
                      "agreement",
                      "order_form",
                      "schedule",
                      "policy"
                    ]
                  },
                  "url": {
                    "type": "string",
                    "minLength": 1,
                    "format": "uri",
                    "maxLength": 2048
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1
                  },
                  "cid": {
                    "type": "string",
                    "minLength": 1
                  },
                  "method": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "kind": {
                        "enum": [
                          "pdf",
                          "markdown",
                          "html",
                          "html_blanked",
                          "html_extract",
                          "embedded_json",
                          "api_json",
                          "text_render",
                          "unstable"
                        ]
                      },
                      "command": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 1000
                      }
                    },
                    "required": [
                      "kind"
                    ]
                  },
                  "seenAt": {
                    "type": "string",
                    "minLength": 1,
                    "format": "date",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "history": {
                    "enum": [
                      "vendor_archive",
                      "git",
                      "wayback"
                    ]
                  },
                  "catalog": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "cid": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "cid"
                    ]
                  },
                  "documentId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "key",
                  "role",
                  "url",
                  "method",
                  "seenAt"
                ]
              },
              "maxItems": 20,
              "minItems": 1
            },
            "precedence": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "stated": {
                  "type": "boolean"
                },
                "order": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "maxItems": 20,
                  "minItems": 0
                },
                "orderFormWinsOn": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "maxItems": 20,
                  "minItems": 0
                }
              },
              "required": [
                "stated"
              ]
            }
          },
          "required": [
            "refs",
            "precedence"
          ]
        },
        "length": {
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "everyMonths": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 120
                }
              },
              "required": [
                "everyMonths"
              ]
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "everyDays": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3660
                }
              },
              "required": [
                "everyDays"
              ]
            }
          ]
        },
        "rollover": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "activityKey": {
              "type": "string",
              "minLength": 1
            },
            "obligationKey": {
              "type": "string",
              "minLength": 1
            },
            "facts": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "required": [
            "activityKey",
            "obligationKey",
            "facts"
          ]
        }
      },
      "required": [
        "contractId",
        "expectedDocumentId",
        "sourceFactId",
        "termIndex",
        "evidence"
      ]
    },
    "idempotency_key": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "effective_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
    },
    "source_document_id": {
      "description": "A registered document of kind contract, source_document that caused this command.",
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "name",
    "input",
    "idempotency_key",
    "effective_at"
  ],
  "additionalProperties": false
}

Accepted command receipt

{
  "type": "object",
  "required": [
    "commandId",
    "replayed",
    "result",
    "events"
  ],
  "properties": {
    "commandId": {
      "type": "string"
    },
    "replayed": {
      "type": "boolean"
    },
    "imported": {
      "const": true,
      "description": "The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."
    },
    "result": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "documentId": {
          "type": "string",
          "minLength": 1
        },
        "decisions": {
          "type": "array",
          "items": {
            "type": "object"
          }
        }
      }
    },
    "events": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "cid": {
            "type": "string"
          }
        }
      }
    }
  }
}

Example request

{
  "name": "contracts.renew",
  "input": {
    "contractId": "ctr_vendor",
    "expectedDocumentId": "doc_contract",
    "sourceFactId": "renewal-quote",
    "termIndex": 1,
    "evidence": {
      "acceptance": [
        {
          "kind": "other",
          "ref": "vendor-quote"
        }
      ]
    }
  },
  "effective_at": "2026-09-01T00:00:00Z",
  "idempotency_key": "contracts.renew-example-0"
}
Navigate documentation