ingestions.agreement_proposal

Prepare a manual contract draft from a complete retained agreement extraction. Returns a proposal only; does not accept an agreement or record financial activity.

What it does

Prepare a transient manual draft from exact complete retained agreement JSON classified agreement. Source fields: type:agreement, business, parties:{templateRole:partyName}, terms:{activityKey:{term:stringValue}}. Select an existing current active priced template and existing party/ledger bindings explicitly. Verify business and named counterparties; ordinary contracts.create validates every resolved term and binding. Terms carry JSON source pointers or explicit frozen catalog-default evidence. The query appends no event, receipt or ingestion revision.

Execute the returned ordinary command separately with current write authority; it creates a draft only. No automatic legal acceptance/activation, new template/effect definitions, PDF interpretation or amendment. Inline text remains unverified; preview is not a future write guarantee.

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 ingestions.agreement_proposal through GET /v1/catalog/commands/{name} before acting.

This command does not accept source_document_id in its envelope. Any input evidence requirements remain as documented below.

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
ingestionIdstringYes
agreementTextstringYes
templateDocumentIdstringNo
partyBindingsobjectYes
ledgerBindingsobjectNo

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
dispositionstringYesChoose "ready", "needs_information".
sourceobjectYes
source.documentIdstringYes
source.cidstringYes
source.formatstringYesChoose "markdown", "text", "document".
source.provenancestringYesChoose "caller_supplied_unverified", "registered_bytes".
source.textCidstringYes
source.locationobjectYes
source.location.startintegerYesMinimum: 0.
source.location.endintegerYesMinimum: 0.
missingarrayYesItems: string.
templateobjectNo
template.documentIdstringYes
template.cidstringYes
previewobjectNo
preview.statusstringYesMust be "draft".
preview.namestringYes
preview.activitiesarrayYesItems: object. Maximum items: 100.
preview.activities[].keystringYes
preview.activities[].activityDocumentIdstringYes
preview.activities[].termsobjectYes
termsEvidencearrayNoItems: object.
termsEvidence[].activityKeystringYes
termsEvidence[].termstringYes
termsEvidence[].valuestringYes
termsEvidence[].originstringYesChoose "source", "catalog".
termsEvidence[].pointerstring or nullYes
termsEvidence[].documentIdstringYes
termsEvidence[].cidstringYes
termsEvidence[].textCidstring or nullYes
commandobjectNo
command.namestringYesMust be "contracts.create".
command.inputobjectYes
command.input.classificationobjectNo
command.input.lifecycleobjectNo
command.input.lifecycle.termobjectYes
command.input.lifecycle.term.indexintegerYesMinimum: 1. Maximum: 9007199254740991.
command.input.lifecycle.term.startsOnstringYesFormat: date. Minimum length: 1. Pattern: "^\\d{4}-\\d{2}-\\d{2}$".
command.input.lifecycle.term.endsOnstringNoFormat: date. Minimum length: 1. Pattern: "^\\d{4}-\\d{2}-\\d{2}$".
command.input.lifecycle.term.rollingschema-definedNoChoose a matching alternative in the exact schema below.
command.input.lifecycle.atTermEndstringYesChoose "renew", "evergreen", "end", "renew_once".
command.input.lifecycle.renewalobjectNo
command.input.lifecycle.renewal.lengthschema-definedNoChoose a matching alternative in the exact schema below.
command.input.lifecycle.renewal.priceschema-definedYesChoose a matching alternative in the exact schema below.
command.input.lifecycle.noticeobjectYes
command.input.lifecycle.notice.daysintegerYesMinimum: 0. Maximum: 366.
command.input.lifecycle.notice.basisstringYesChoose "calendar", "weekdays".
command.input.lifecycle.notice.remindDaysBeforeintegerNoMinimum: 0. Maximum: 366.
command.input.lifecycle.cancellationobjectNo
command.input.lifecycle.cancellation.windowsarrayYesItems: object. Minimum items: 0. Maximum items: 20.
command.input.lifecycle.cancellation.windows[].fromstringYesChoose "term_start", "term_end".
command.input.lifecycle.cancellation.windows[].daysintegerYesMinimum: 0. Maximum: 366.
command.input.lifecycle.cancellation.onlyInWindowsbooleanNoMust be true.
command.input.lifecycle.cancellation.otherwiseschema-definedYesChoose a matching alternative in the exact schema below.
command.input.lifecycle.changesobjectNo
command.input.lifecycle.changes.termsChangeschema-definedNoChoose a matching alternative in the exact schema below.
command.input.lifecycle.changes.priceChangeschema-definedNoChoose a matching alternative in the exact schema below.
command.input.agreementsobjectNo
command.input.agreements.changesobjectNo
command.input.agreements.changes.termsChangeschema-definedNoChoose a matching alternative in the exact schema below.
command.input.agreements.changes.priceChangeschema-definedNoChoose a matching alternative in the exact schema below.
command.input.agreements.refsarrayYesItems: object. Minimum items: 1. Maximum items: 20.
command.input.agreements.refs[].keystringYesMinimum length: 1.
command.input.agreements.refs[].rolestringYesChoose "agreement", "order_form", "schedule", "policy".
command.input.agreements.refs[].urlstringYesFormat: uri. Minimum length: 1. Maximum length: 2048.
command.input.agreements.refs[].labelstringNoMinimum length: 1.
command.input.agreements.refs[].cidstringNoMinimum length: 1.
command.input.agreements.refs[].methodobjectYes
command.input.agreements.refs[].method.kindstringYesChoose "pdf", "markdown", "html", "html_blanked", "html_extract", "embedded_json", "api_json", "text_render", "unstable".
command.input.agreements.refs[].method.commandstringNoMinimum length: 1. Maximum length: 1000.
command.input.agreements.refs[].seenAtstringYesFormat: date. Minimum length: 1. Pattern: "^\\d{4}-\\d{2}-\\d{2}$".
command.input.agreements.refs[].historystringNoChoose "vendor_archive", "git", "wayback".
command.input.agreements.refs[].catalogobjectNo
command.input.agreements.refs[].catalog.cidstringYesMinimum length: 1.
command.input.agreements.refs[].documentIdstringNoMinimum length: 1.
command.input.agreements.precedenceobjectYes
command.input.agreements.precedence.statedbooleanYes
command.input.agreements.precedence.orderarrayNoItems: string. Minimum items: 0. Maximum items: 20.
command.input.agreements.precedence.orderFormWinsOnarrayNoItems: string. Minimum items: 0. Maximum items: 20.
command.input.paymentTermsobjectNo
command.input.paymentTerms.statementClosingDayintegerNoMinimum: 1. Maximum: 31.
command.input.paymentTerms.paymentDueDayintegerNoMinimum: 1. Maximum: 31.
command.input.paymentTerms.autopaybooleanNoWhether the issuer is instructed to collect automatically from the paying account.
command.input.paymentTerms.payingAccountIdstringNoRegistered payment account; omit to clear the default. Minimum length: 1.
command.input.templateDocumentIdstringNoMinimum length: 1.
command.input.definitionobjectNo
command.input.definition.vendorPlanobjectNo
command.input.definition.vendorPlan.catalogstringNo
command.input.definition.vendorPlan.cidstringYes
command.input.definition.vendorPlan.templatestringYes
command.input.definition.vendorPlan.relationstringYesChoose "adopted", "derived".
command.input.definition.lifecycleobjectNo
command.input.definition.lifecycle.termobjectYes
command.input.definition.lifecycle.term.indexintegerYesMinimum: 1. Maximum: 9007199254740991.
command.input.definition.lifecycle.term.startsOnstringYesFormat: date. Minimum length: 1. Pattern: "^\\d{4}-\\d{2}-\\d{2}$".
command.input.definition.lifecycle.term.endsOnstringNoFormat: date. Minimum length: 1. Pattern: "^\\d{4}-\\d{2}-\\d{2}$".
command.input.definition.lifecycle.term.rollingschema-definedNoChoose a matching alternative in the exact schema below.
command.input.definition.lifecycle.atTermEndstringYesChoose "renew", "evergreen", "end", "renew_once".
command.input.definition.lifecycle.renewalobjectNo
command.input.definition.lifecycle.renewal.lengthschema-definedNoChoose a matching alternative in the exact schema below.
command.input.definition.lifecycle.renewal.priceschema-definedYesChoose a matching alternative in the exact schema below.
command.input.definition.lifecycle.noticeobjectYes
command.input.definition.lifecycle.notice.daysintegerYesMinimum: 0. Maximum: 366.
command.input.definition.lifecycle.notice.basisstringYesChoose "calendar", "weekdays".
command.input.definition.lifecycle.notice.remindDaysBeforeintegerNoMinimum: 0. Maximum: 366.
command.input.definition.lifecycle.cancellationobjectNo
command.input.definition.lifecycle.cancellation.windowsarrayYesItems: object. Minimum items: 0. Maximum items: 20.
command.input.definition.lifecycle.cancellation.windows[].fromstringYesChoose "term_start", "term_end".
command.input.definition.lifecycle.cancellation.windows[].daysintegerYesMinimum: 0. Maximum: 366.
command.input.definition.lifecycle.cancellation.onlyInWindowsbooleanNoMust be true.
command.input.definition.lifecycle.cancellation.otherwiseschema-definedYesChoose a matching alternative in the exact schema below.
command.input.definition.lifecycle.changesobjectNo
command.input.definition.lifecycle.changes.termsChangeschema-definedNoChoose a matching alternative in the exact schema below.
command.input.definition.lifecycle.changes.priceChangeschema-definedNoChoose a matching alternative in the exact schema below.
command.input.definition.agreementsobjectNo
command.input.definition.agreements.changesobjectNo
command.input.definition.agreements.changes.termsChangeschema-definedNoChoose a matching alternative in the exact schema below.
command.input.definition.agreements.changes.priceChangeschema-definedNoChoose a matching alternative in the exact schema below.
command.input.definition.agreements.refsarrayYesItems: object. Minimum items: 1. Maximum items: 20.
command.input.definition.agreements.refs[].keystringYesMinimum length: 1.
command.input.definition.agreements.refs[].rolestringYesChoose "agreement", "order_form", "schedule", "policy".
command.input.definition.agreements.refs[].urlstringYesFormat: uri. Minimum length: 1. Maximum length: 2048.
command.input.definition.agreements.refs[].labelstringNoMinimum length: 1.
command.input.definition.agreements.refs[].cidstringNoMinimum length: 1.
command.input.definition.agreements.refs[].methodobjectYes
command.input.definition.agreements.refs[].method.kindstringYesChoose "pdf", "markdown", "html", "html_blanked", "html_extract", "embedded_json", "api_json", "text_render", "unstable".
command.input.definition.agreements.refs[].method.commandstringNoMinimum length: 1. Maximum length: 1000.
command.input.definition.agreements.refs[].seenAtstringYesFormat: date. Minimum length: 1. Pattern: "^\\d{4}-\\d{2}-\\d{2}$".
command.input.definition.agreements.refs[].historystringNoChoose "vendor_archive", "git", "wayback".
command.input.definition.agreements.refs[].catalogobjectNo
command.input.definition.agreements.refs[].catalog.cidstringYesMinimum length: 1.
command.input.definition.agreements.refs[].documentIdstringNoMinimum length: 1.
command.input.definition.agreements.precedenceobjectYes
command.input.definition.agreements.precedence.statedbooleanYes
command.input.definition.agreements.precedence.orderarrayNoItems: string. Minimum items: 0. Maximum items: 20.
command.input.definition.agreements.precedence.orderFormWinsOnarrayNoItems: string. Minimum items: 0. Maximum items: 20.
command.input.definition.modelstringYesMust be "priced-rights-v1".
command.input.definition.namestringYesMinimum length: 1.
command.input.definition.planstringNoChoose "on_sale", "off_sale".
command.input.definition.partiesarrayYesItems: string. Minimum items: 1. Maximum items: 100.
command.input.definition.partyCategoriesobjectNo
command.input.definition.ledgersobjectNo
command.input.definition.activitiesarrayYesItems: object. Minimum items: 1. Maximum items: 100.
command.input.definition.activities[].keystringYesMinimum length: 1.
command.input.definition.activities[].activityDocumentIdstringYesMinimum length: 1.
command.input.definition.activities[].partyRolestringYesMinimum length: 1.
command.input.definition.activities[].ledgersobjectNo
command.input.definition.activities[].termsobjectNo
command.input.definition.consequencesarrayNoItems: object. Minimum items: 0. Maximum items: 100.
command.input.definition.consequences[].keystringYesMinimum length: 1.
command.input.definition.consequences[].sourceRightsarrayYesItems: string. Minimum items: 1. Maximum items: 100.
command.input.definition.consequences[].ruleschema-definedYesChoose a matching alternative in the exact schema below.
command.input.definition.consequences[].triggerschema-definedYesChoose a matching alternative in the exact schema below.
command.input.definition.consequences[].evidencearrayYesEach item must be "acceptance", "economic", "service". Minimum items: 1. Maximum items: 100.
command.input.definition.creditPoolsarrayNoItems: object. Minimum items: 1. Maximum items: 20.
command.input.definition.creditPools[].keystringYesMinimum length: 1.
command.input.definition.creditPools[].lotsarrayYesItems: object. Minimum items: 1. Maximum items: 20.
command.input.definition.creditPools[].lots[].rightstringYesMinimum length: 1.
command.input.definition.creditPools[].lots[].eligibleRightsarrayYesItems: string. Minimum items: 1. Maximum items: 100.
command.input.definition.creditPools[].drawAtstringYesChoose "recognition", "billing".
command.input.definition.creditPools[].drawOrderarrayYesEach item must be "expiry", "granted_first", "bought_first", "narrowest_scope", "oldest". Minimum items: 1. Maximum items: 5.
command.input.partiesobjectYes
command.input.termsobjectNo
command.input.ledgerBindingsobjectNoLedger alias → existing ledger id. Every GAAP alias needs one. A business starts with its selected functional-currency ledger (USD only when omitted at initialization); binding a GAAP alias to another currency’s canonical id (led_ + the zero-padded ISO 4217 numeric code, e.g. led_00000000000000000000000978 for EUR) opens that ledger with this contract, even while it is a draft.
command.input.sourceDocumentIdsarrayNoItems: string. Maximum items: 100.
command.input.concessionobjectNoA concession offer this contract takes (concessions.create_offer), by offerId or by the code the customer typed: its discount becomes the terms of each right’s concession reduction, from the right’s start for the offer’s months. email is the customer’s address the offer is assigned to, or that its eligibility checks.
command.input.concession.offerIdstringNoMinimum length: 1.
command.input.concession.codestringNoMinimum length: 1.
command.input.concession.emailstringNoMinimum length: 1.
command.source_document_idstringYes
command.effective_atstringYesFormat: date-time.
command.idempotency_keystringYes

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": "ingestions.agreement_proposal"
    },
    "input": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "ingestionId",
        "agreementText",
        "partyBindings"
      ],
      "properties": {
        "ingestionId": {
          "type": "string"
        },
        "agreementText": {
          "type": "string"
        },
        "templateDocumentId": {
          "type": "string"
        },
        "partyBindings": {
          "type": "object",
          "maxProperties": 100,
          "additionalProperties": {
            "type": "string"
          }
        },
        "ledgerBindings": {
          "type": "object",
          "maxProperties": 100,
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "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))$"
    }
  },
  "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",
      "additionalProperties": false,
      "required": [
        "disposition",
        "source",
        "missing"
      ],
      "allOf": [
        {
          "if": {
            "properties": {
              "disposition": {
                "const": "ready"
              }
            }
          },
          "then": {
            "required": [
              "template",
              "preview",
              "termsEvidence",
              "command"
            ]
          }
        }
      ],
      "properties": {
        "disposition": {
          "enum": [
            "ready",
            "needs_information"
          ]
        },
        "source": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "documentId",
            "cid",
            "format",
            "provenance",
            "textCid",
            "location"
          ],
          "properties": {
            "documentId": {
              "type": "string"
            },
            "cid": {
              "type": "string"
            },
            "format": {
              "enum": [
                "markdown",
                "text",
                "document"
              ]
            },
            "provenance": {
              "enum": [
                "caller_supplied_unverified",
                "registered_bytes"
              ]
            },
            "textCid": {
              "type": "string"
            },
            "location": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "start",
                "end"
              ],
              "properties": {
                "start": {
                  "type": "integer",
                  "minimum": 0
                },
                "end": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          }
        },
        "missing": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "template": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "documentId",
            "cid"
          ],
          "properties": {
            "documentId": {
              "type": "string"
            },
            "cid": {
              "type": "string"
            }
          }
        },
        "preview": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "status",
            "name",
            "activities"
          ],
          "properties": {
            "status": {
              "const": "draft"
            },
            "name": {
              "type": "string"
            },
            "activities": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "key",
                  "activityDocumentId",
                  "terms"
                ],
                "properties": {
                  "key": {
                    "type": "string"
                  },
                  "activityDocumentId": {
                    "type": "string"
                  },
                  "terms": {
                    "type": "object",
                    "maxProperties": 100,
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "termsEvidence": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "activityKey",
              "term",
              "value",
              "origin",
              "pointer",
              "documentId",
              "cid",
              "textCid"
            ],
            "properties": {
              "activityKey": {
                "type": "string"
              },
              "term": {
                "type": "string"
              },
              "value": {
                "type": "string"
              },
              "origin": {
                "enum": [
                  "source",
                  "catalog"
                ]
              },
              "pointer": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "documentId": {
                "type": "string"
              },
              "cid": {
                "type": "string"
              },
              "textCid": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        },
        "command": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "name",
            "input",
            "source_document_id",
            "effective_at",
            "idempotency_key"
          ],
          "properties": {
            "name": {
              "const": "contracts.create"
            },
            "input": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "classification": {
                  "type": "object",
                  "maxProperties": 100,
                  "additionalProperties": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "expenseAccount": {
                        "type": "integer"
                      },
                      "expenseFunction": {
                        "type": "string"
                      },
                      "taxCode": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "taxTreatment": {
                        "enum": [
                          "exclusive",
                          "inclusive",
                          null
                        ]
                      }
                    }
                  }
                },
                "lifecycle": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "term": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "index": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 9007199254740991
                        },
                        "startsOn": {
                          "type": "string",
                          "minLength": 1,
                          "format": "date",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        "endsOn": {
                          "type": "string",
                          "minLength": 1,
                          "format": "date",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        "rolling": {
                          "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"
                              ]
                            }
                          ]
                        }
                      },
                      "required": [
                        "index",
                        "startsOn"
                      ]
                    },
                    "atTermEnd": {
                      "enum": [
                        "renew",
                        "evergreen",
                        "end",
                        "renew_once"
                      ]
                    },
                    "renewal": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "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"
                              ]
                            }
                          ]
                        },
                        "price": {
                          "anyOf": [
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "properties": {
                                "rule": {
                                  "enum": [
                                    "same",
                                    "list"
                                  ]
                                },
                                "reducedLosesPrice": {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "properties": {
                                    "quantityTerms": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "properties": {
                                          "right": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "term": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "right",
                                          "term"
                                        ]
                                      },
                                      "maxItems": 100,
                                      "minItems": 1
                                    }
                                  },
                                  "required": [
                                    "quantityTerms"
                                  ]
                                }
                              },
                              "required": [
                                "rule"
                              ]
                            },
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "properties": {
                                "rule": {
                                  "const": "uplift"
                                },
                                "bps": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 100000
                                },
                                "terms": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "properties": {
                                      "right": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "term": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "right",
                                      "term"
                                    ]
                                  },
                                  "maxItems": 100,
                                  "minItems": 1
                                },
                                "reducedLosesPrice": {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "properties": {
                                    "quantityTerms": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "properties": {
                                          "right": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "term": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "right",
                                          "term"
                                        ]
                                      },
                                      "maxItems": 100,
                                      "minItems": 1
                                    }
                                  },
                                  "required": [
                                    "quantityTerms"
                                  ]
                                }
                              },
                              "required": [
                                "rule",
                                "bps",
                                "terms"
                              ]
                            },
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "properties": {
                                "rule": {
                                  "const": "capped"
                                },
                                "bps": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 100000
                                },
                                "terms": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "properties": {
                                      "right": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "term": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "right",
                                      "term"
                                    ]
                                  },
                                  "maxItems": 100,
                                  "minItems": 1
                                },
                                "index": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "uncappedWhen": {
                                  "type": "array",
                                  "items": {
                                    "enum": [
                                      "quantity_reduced",
                                      "term_shortened"
                                    ]
                                  },
                                  "maxItems": 2,
                                  "minItems": 0
                                },
                                "reducedLosesPrice": {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "properties": {
                                    "quantityTerms": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "properties": {
                                          "right": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "term": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "right",
                                          "term"
                                        ]
                                      },
                                      "maxItems": 100,
                                      "minItems": 1
                                    }
                                  },
                                  "required": [
                                    "quantityTerms"
                                  ]
                                }
                              },
                              "required": [
                                "rule",
                                "bps",
                                "terms"
                              ]
                            }
                          ]
                        }
                      },
                      "required": [
                        "price"
                      ]
                    },
                    "notice": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "days": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 366
                        },
                        "basis": {
                          "enum": [
                            "calendar",
                            "weekdays"
                          ]
                        },
                        "remindDaysBefore": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 366
                        }
                      },
                      "required": [
                        "days",
                        "basis"
                      ]
                    },
                    "cancellation": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "windows": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "from": {
                                "enum": [
                                  "term_start",
                                  "term_end"
                                ]
                              },
                              "days": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 366
                              }
                            },
                            "required": [
                              "from",
                              "days"
                            ]
                          },
                          "maxItems": 20,
                          "minItems": 0
                        },
                        "onlyInWindows": {
                          "const": true
                        },
                        "otherwise": {
                          "anyOf": [
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "properties": {
                                "type": {
                                  "const": "none"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "properties": {
                                "type": {
                                  "const": "fee"
                                },
                                "right": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "type",
                                "right"
                              ]
                            },
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "properties": {
                                "type": {
                                  "const": "accelerate"
                                },
                                "rights": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "maxItems": 100,
                                  "minItems": 1
                                }
                              },
                              "required": [
                                "type",
                                "rights"
                              ]
                            }
                          ]
                        }
                      },
                      "required": [
                        "windows",
                        "otherwise"
                      ]
                    },
                    "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": []
                    }
                  },
                  "required": [
                    "term",
                    "atTermEnd",
                    "notice"
                  ]
                },
                "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"
                  ]
                },
                "paymentTerms": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "statementClosingDay": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 31
                    },
                    "paymentDueDay": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 31
                    },
                    "autopay": {
                      "type": "boolean",
                      "description": "Whether the issuer is instructed to collect automatically from the paying account."
                    },
                    "payingAccountId": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Registered payment account; omit to clear the default."
                    }
                  }
                },
                "templateDocumentId": {
                  "type": "string",
                  "minLength": 1
                },
                "definition": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "vendorPlan": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "catalog": {
                          "type": "string"
                        },
                        "cid": {
                          "type": "string"
                        },
                        "template": {
                          "type": "string"
                        },
                        "relation": {
                          "enum": [
                            "adopted",
                            "derived"
                          ]
                        }
                      },
                      "required": [
                        "cid",
                        "template",
                        "relation"
                      ]
                    },
                    "lifecycle": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "term": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "index": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 9007199254740991
                            },
                            "startsOn": {
                              "type": "string",
                              "minLength": 1,
                              "format": "date",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            "endsOn": {
                              "type": "string",
                              "minLength": 1,
                              "format": "date",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            "rolling": {
                              "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"
                                  ]
                                }
                              ]
                            }
                          },
                          "required": [
                            "index",
                            "startsOn"
                          ]
                        },
                        "atTermEnd": {
                          "enum": [
                            "renew",
                            "evergreen",
                            "end",
                            "renew_once"
                          ]
                        },
                        "renewal": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "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"
                                  ]
                                }
                              ]
                            },
                            "price": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "properties": {
                                    "rule": {
                                      "enum": [
                                        "same",
                                        "list"
                                      ]
                                    },
                                    "reducedLosesPrice": {
                                      "type": "object",
                                      "additionalProperties": false,
                                      "properties": {
                                        "quantityTerms": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "additionalProperties": false,
                                            "properties": {
                                              "right": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "term": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "right",
                                              "term"
                                            ]
                                          },
                                          "maxItems": 100,
                                          "minItems": 1
                                        }
                                      },
                                      "required": [
                                        "quantityTerms"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "rule"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "properties": {
                                    "rule": {
                                      "const": "uplift"
                                    },
                                    "bps": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 100000
                                    },
                                    "terms": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "properties": {
                                          "right": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "term": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "right",
                                          "term"
                                        ]
                                      },
                                      "maxItems": 100,
                                      "minItems": 1
                                    },
                                    "reducedLosesPrice": {
                                      "type": "object",
                                      "additionalProperties": false,
                                      "properties": {
                                        "quantityTerms": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "additionalProperties": false,
                                            "properties": {
                                              "right": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "term": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "right",
                                              "term"
                                            ]
                                          },
                                          "maxItems": 100,
                                          "minItems": 1
                                        }
                                      },
                                      "required": [
                                        "quantityTerms"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "rule",
                                    "bps",
                                    "terms"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "properties": {
                                    "rule": {
                                      "const": "capped"
                                    },
                                    "bps": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 100000
                                    },
                                    "terms": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "properties": {
                                          "right": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "term": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "right",
                                          "term"
                                        ]
                                      },
                                      "maxItems": 100,
                                      "minItems": 1
                                    },
                                    "index": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "uncappedWhen": {
                                      "type": "array",
                                      "items": {
                                        "enum": [
                                          "quantity_reduced",
                                          "term_shortened"
                                        ]
                                      },
                                      "maxItems": 2,
                                      "minItems": 0
                                    },
                                    "reducedLosesPrice": {
                                      "type": "object",
                                      "additionalProperties": false,
                                      "properties": {
                                        "quantityTerms": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "additionalProperties": false,
                                            "properties": {
                                              "right": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "term": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "right",
                                              "term"
                                            ]
                                          },
                                          "maxItems": 100,
                                          "minItems": 1
                                        }
                                      },
                                      "required": [
                                        "quantityTerms"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "rule",
                                    "bps",
                                    "terms"
                                  ]
                                }
                              ]
                            }
                          },
                          "required": [
                            "price"
                          ]
                        },
                        "notice": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "days": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 366
                            },
                            "basis": {
                              "enum": [
                                "calendar",
                                "weekdays"
                              ]
                            },
                            "remindDaysBefore": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 366
                            }
                          },
                          "required": [
                            "days",
                            "basis"
                          ]
                        },
                        "cancellation": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "windows": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "from": {
                                    "enum": [
                                      "term_start",
                                      "term_end"
                                    ]
                                  },
                                  "days": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 366
                                  }
                                },
                                "required": [
                                  "from",
                                  "days"
                                ]
                              },
                              "maxItems": 20,
                              "minItems": 0
                            },
                            "onlyInWindows": {
                              "const": true
                            },
                            "otherwise": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "properties": {
                                    "type": {
                                      "const": "none"
                                    }
                                  },
                                  "required": [
                                    "type"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "properties": {
                                    "type": {
                                      "const": "fee"
                                    },
                                    "right": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "right"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "properties": {
                                    "type": {
                                      "const": "accelerate"
                                    },
                                    "rights": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "maxItems": 100,
                                      "minItems": 1
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "rights"
                                  ]
                                }
                              ]
                            }
                          },
                          "required": [
                            "windows",
                            "otherwise"
                          ]
                        },
                        "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": []
                        }
                      },
                      "required": [
                        "term",
                        "atTermEnd",
                        "notice"
                      ]
                    },
                    "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"
                      ]
                    },
                    "model": {
                      "const": "priced-rights-v1"
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "plan": {
                      "enum": [
                        "on_sale",
                        "off_sale"
                      ]
                    },
                    "parties": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1
                      },
                      "minItems": 1,
                      "maxItems": 100
                    },
                    "partyCategories": {
                      "type": "object",
                      "maxProperties": 100,
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "enum": [
                            "customer",
                            "vendor",
                            "founder",
                            "investor",
                            "provider",
                            "employee"
                          ]
                        },
                        "minItems": 0,
                        "maxItems": 6
                      }
                    },
                    "ledgers": {
                      "type": "object",
                      "maxProperties": 100,
                      "additionalProperties": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "classification": {
                            "enum": [
                              "gaap",
                              "contractual",
                              "operational",
                              "ownership",
                              "planning"
                            ]
                          },
                          "unitKind": {
                            "enum": [
                              "currency",
                              "share",
                              "usage",
                              "credit",
                              "right",
                              "token",
                              "other"
                            ]
                          },
                          "unitCode": {
                            "type": "string",
                            "minLength": 1
                          },
                          "decimals": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 18
                          },
                          "accountTemplate": {
                            "enum": [
                              "gaap_startup",
                              "contract_flow",
                              "capacity",
                              "meter",
                              "entitlement",
                              "issued_instrument"
                            ]
                          }
                        },
                        "required": [
                          "classification",
                          "unitKind",
                          "unitCode",
                          "decimals",
                          "accountTemplate"
                        ]
                      }
                    },
                    "activities": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "key": {
                            "type": "string",
                            "minLength": 1
                          },
                          "activityDocumentId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "partyRole": {
                            "type": "string",
                            "minLength": 1
                          },
                          "ledgers": {
                            "type": "object",
                            "maxProperties": 100,
                            "additionalProperties": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "terms": {
                            "type": "object",
                            "maxProperties": 100,
                            "additionalProperties": {
                              "type": "string",
                              "minLength": 1
                            }
                          }
                        },
                        "required": [
                          "key",
                          "activityDocumentId",
                          "partyRole"
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 100
                    },
                    "consequences": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "key": {
                            "type": "string",
                            "minLength": 1
                          },
                          "sourceRights": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "minLength": 1
                            },
                            "minItems": 1,
                            "maxItems": 100
                          },
                          "rule": {
                            "anyOf": [
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "grant_capacity"
                                  },
                                  "capacityLedger": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "quantity": {
                                    "type": "string",
                                    "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                  },
                                  "expiresAtTerm": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "type",
                                  "capacityLedger",
                                  "quantity",
                                  "expiresAtTerm"
                                ]
                              },
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "consume_capacity"
                                  },
                                  "capacityLedger": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "quantity": {
                                    "type": "string",
                                    "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                  },
                                  "grantOccurrenceFact": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "overageRight": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "type",
                                  "capacityLedger",
                                  "quantity",
                                  "grantOccurrenceFact"
                                ]
                              },
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "expire_capacity"
                                  },
                                  "capacityLedger": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "valueLedger": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "type",
                                  "capacityLedger"
                                ]
                              },
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "minimum"
                                  },
                                  "eligibleRights": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "minItems": 1,
                                    "maxItems": 100
                                  },
                                  "minimum": {
                                    "type": "string",
                                    "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                  },
                                  "currencyTerm": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "completeThroughFact": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "type",
                                  "eligibleRights",
                                  "minimum",
                                  "currencyTerm",
                                  "completeThroughFact"
                                ]
                              },
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "refund_unearned"
                                  },
                                  "monetaryLedger": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "amount": {
                                    "type": "string",
                                    "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                  },
                                  "taxClaimFact": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "type",
                                  "monetaryLedger",
                                  "amount"
                                ]
                              },
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "profit_allocation"
                                  },
                                  "result": {
                                    "enum": [
                                      "profit",
                                      "loss"
                                    ]
                                  },
                                  "monetaryLedger": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "ownershipLedger": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "amount": {
                                    "type": "string",
                                    "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                  },
                                  "completeThroughFact": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "type",
                                  "monetaryLedger",
                                  "ownershipLedger",
                                  "amount",
                                  "completeThroughFact"
                                ]
                              },
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "profit_allocation"
                                  },
                                  "result": {
                                    "enum": [
                                      "profit",
                                      "loss"
                                    ]
                                  },
                                  "monetaryLedger": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "ownershipBasis": {
                                    "const": "agreement"
                                  },
                                  "amount": {
                                    "type": "string",
                                    "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                  },
                                  "completeThroughFact": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "type",
                                  "monetaryLedger",
                                  "ownershipBasis",
                                  "amount",
                                  "completeThroughFact"
                                ]
                              },
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "close_draws"
                                  },
                                  "monetaryLedger": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "completeThroughFact": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "type",
                                  "monetaryLedger",
                                  "completeThroughFact"
                                ]
                              },
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "authorize_units"
                                  },
                                  "unitsLedger": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "quantity": {
                                    "type": "string",
                                    "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                  }
                                },
                                "required": [
                                  "type",
                                  "unitsLedger",
                                  "quantity"
                                ]
                              },
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "issue_units"
                                  },
                                  "capitalAllocation": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "properties": {
                                      "shareCapital": {
                                        "type": "string",
                                        "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                      },
                                      "sharePremium": {
                                        "type": "string",
                                        "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                      }
                                    },
                                    "required": [
                                      "shareCapital",
                                      "sharePremium"
                                    ]
                                  },
                                  "unitsLedger": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "quantity": {
                                    "type": "string",
                                    "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                  },
                                  "consideration": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "properties": {
                                          "type": {
                                            "const": "money"
                                          },
                                          "amount": {
                                            "type": "string",
                                            "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                          },
                                          "currencyTerm": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "recognition": {
                                            "enum": [
                                              "unconditional_obligation",
                                              "condition_satisfied"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "amount",
                                          "currencyTerm",
                                          "recognition"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "properties": {
                                          "type": {
                                            "const": "units"
                                          },
                                          "quantity": {
                                            "type": "string",
                                            "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                          },
                                          "ledger": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "quantity",
                                          "ledger"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "properties": {
                                          "type": {
                                            "const": "claim"
                                          },
                                          "claimFact": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "amount": {
                                            "type": "string",
                                            "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                          },
                                          "currencyTerm": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "claimFact",
                                          "amount",
                                          "currencyTerm"
                                        ]
                                      }
                                    ]
                                  },
                                  "restricted": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "type",
                                  "unitsLedger",
                                  "quantity",
                                  "consideration",
                                  "restricted"
                                ]
                              },
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "capital_contribution"
                                  },
                                  "consideration": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "properties": {
                                          "type": {
                                            "const": "money"
                                          },
                                          "amount": {
                                            "type": "string",
                                            "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                          },
                                          "currencyTerm": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "recognition": {
                                            "enum": [
                                              "unconditional_obligation",
                                              "condition_satisfied"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "amount",
                                          "currencyTerm",
                                          "recognition"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "properties": {
                                          "type": {
                                            "const": "units"
                                          },
                                          "quantity": {
                                            "type": "string",
                                            "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                          },
                                          "ledger": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "quantity",
                                          "ledger"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "properties": {
                                          "type": {
                                            "const": "claim"
                                          },
                                          "claimFact": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "amount": {
                                            "type": "string",
                                            "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                          },
                                          "currencyTerm": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "claimFact",
                                          "amount",
                                          "currencyTerm"
                                        ]
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "type",
                                  "consideration"
                                ]
                              },
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "financing_commitment"
                                  },
                                  "consideration": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "properties": {
                                          "type": {
                                            "const": "money"
                                          },
                                          "amount": {
                                            "type": "string",
                                            "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                          },
                                          "currencyTerm": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "recognition": {
                                            "enum": [
                                              "unconditional_obligation",
                                              "condition_satisfied"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "amount",
                                          "currencyTerm",
                                          "recognition"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "properties": {
                                          "type": {
                                            "const": "units"
                                          },
                                          "quantity": {
                                            "type": "string",
                                            "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                          },
                                          "ledger": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "quantity",
                                          "ledger"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "properties": {
                                          "type": {
                                            "const": "claim"
                                          },
                                          "claimFact": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "amount": {
                                            "type": "string",
                                            "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                          },
                                          "currencyTerm": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "claimFact",
                                          "amount",
                                          "currencyTerm"
                                        ]
                                      }
                                    ]
                                  },
                                  "liability": {
                                    "const": "owner_advance"
                                  }
                                },
                                "required": [
                                  "type",
                                  "consideration"
                                ]
                              },
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "capital_distribution"
                                  },
                                  "amount": {
                                    "type": "string",
                                    "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                  }
                                },
                                "required": [
                                  "type",
                                  "amount"
                                ]
                              },
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "owner_draw"
                                  },
                                  "amount": {
                                    "type": "string",
                                    "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                  }
                                },
                                "required": [
                                  "type",
                                  "amount"
                                ]
                              },
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "vest_units"
                                  },
                                  "unitsLedger": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "quantity": {
                                    "type": "string",
                                    "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                  },
                                  "grantOccurrenceFact": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "type",
                                  "unitsLedger",
                                  "quantity",
                                  "grantOccurrenceFact"
                                ]
                              },
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "vest_units"
                                  },
                                  "unitsLedger": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "quantity": {
                                    "type": "string",
                                    "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                  },
                                  "grantConsequence": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "type",
                                  "unitsLedger",
                                  "quantity",
                                  "grantConsequence"
                                ]
                              },
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "convert_claim"
                                  },
                                  "claimFact": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "amount": {
                                    "type": "string",
                                    "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                  },
                                  "currencyTerm": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "monetaryLedger": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "equityAccount": {
                                    "enum": [
                                      3100,
                                      3110,
                                      3120
                                    ]
                                  },
                                  "units": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "properties": {
                                      "ledger": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "quantity": {
                                        "type": "string",
                                        "pattern": "^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"
                                      },
                                      "restricted": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "ledger",
                                      "quantity",
                                      "restricted"
                                    ]
                                  }
                                },
                                "required": [
                                  "type",
                                  "claimFact",
                                  "amount",
                                  "currencyTerm",
                                  "monetaryLedger",
                                  "equityAccount"
                                ]
                              }
                            ]
                          },
                          "trigger": {
                            "anyOf": [
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "transition"
                                  },
                                  "action": {
                                    "enum": [
                                      "accept",
                                      "cancel",
                                      "terminate"
                                    ]
                                  }
                                },
                                "required": [
                                  "type",
                                  "action"
                                ]
                              },
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "exercise"
                                  },
                                  "activityKey": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "type",
                                  "activityKey"
                                ]
                              },
                              {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "type": {
                                    "const": "period_close"
                                  },
                                  "schedule": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "properties": {
                                      "startTerm": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "anchorTerm": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "endTerm": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "everyMonths": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 120
                                      },
                                      "timing": {
                                        "enum": [
                                          "start",
                                          "end"
                                        ]
                                      },
                                      "offsetDays": {
                                        "type": "integer",
                                        "minimum": -365,
                                        "maximum": 365
                                      },
                                      "serviceEvidence": {
                                        "const": "elapsed_time"
                                      }
                                    },
                                    "required": [
                                      "startTerm",
                                      "everyMonths",
                                      "timing",
                                      "offsetDays"
                                    ]
                                  }
                                },
                                "required": [
                                  "type",
                                  "schedule"
                                ]
                              }
                            ]
                          },
                          "evidence": {
                            "type": "array",
                            "items": {
                              "enum": [
                                "acceptance",
                                "economic",
                                "service"
                              ]
                            },
                            "minItems": 1,
                            "maxItems": 100
                          }
                        },
                        "required": [
                          "key",
                          "sourceRights",
                          "trigger",
                          "rule",
                          "evidence"
                        ]
                      },
                      "minItems": 0,
                      "maxItems": 100
                    },
                    "creditPools": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "key": {
                            "type": "string",
                            "minLength": 1
                          },
                          "lots": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": false,
                              "properties": {
                                "right": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "eligibleRights": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "minItems": 1,
                                  "maxItems": 100
                                }
                              },
                              "required": [
                                "right",
                                "eligibleRights"
                              ]
                            },
                            "minItems": 1,
                            "maxItems": 20
                          },
                          "drawAt": {
                            "enum": [
                              "recognition",
                              "billing"
                            ]
                          },
                          "drawOrder": {
                            "type": "array",
                            "items": {
                              "enum": [
                                "expiry",
                                "granted_first",
                                "bought_first",
                                "narrowest_scope",
                                "oldest"
                              ]
                            },
                            "minItems": 1,
                            "maxItems": 5
                          }
                        },
                        "required": [
                          "key",
                          "lots",
                          "drawAt",
                          "drawOrder"
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 20
                    }
                  },
                  "required": [
                    "model",
                    "name",
                    "parties",
                    "activities"
                  ]
                },
                "parties": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string",
                    "minLength": 1
                  },
                  "maxProperties": 100
                },
                "terms": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "minLength": 1
                    },
                    "maxProperties": 100
                  },
                  "maxProperties": 100
                },
                "ledgerBindings": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string",
                    "minLength": 1
                  },
                  "maxProperties": 100,
                  "description": "Ledger alias → existing ledger id. Every GAAP alias needs one. A business starts with its selected functional-currency ledger (USD only when omitted at initialization); binding a GAAP alias to another currency's canonical id (led_ + the zero-padded ISO 4217 numeric code, e.g. led_00000000000000000000000978 for EUR) opens that ledger with this contract, even while it is a draft."
                },
                "sourceDocumentIds": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "maxItems": 100
                },
                "concession": {
                  "type": "object",
                  "additionalProperties": false,
                  "description": "A concession offer this contract takes (concessions.create_offer), by `offerId` or by the `code` the customer typed: its discount becomes the terms of each right's `concession` reduction, from the right's start for the offer's months. `email` is the customer's address the offer is assigned to, or that its eligibility checks.",
                  "properties": {
                    "offerId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "code": {
                      "type": "string",
                      "minLength": 1
                    },
                    "email": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                }
              },
              "required": [
                "parties"
              ]
            },
            "source_document_id": {
              "type": "string"
            },
            "effective_at": {
              "type": "string",
              "format": "date-time"
            },
            "idempotency_key": {
              "type": "string"
            }
          }
        }
      }
    },
    "events": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "cid": {
            "type": "string"
          }
        }
      }
    }
  }
}
Navigate documentation