Handle Generate Proposal

​

CRM-10243 — a proposal computed from the contract's current terms.

Read-only: it returns the active template's slots filled from the CRM, the line items, and why each blank is blank, and stores nothing. Reached from a contract (contractId) or a deal (dealId, resolved to its live contract). Refused with {code, message} for a closed deal, a snapshot or duplicate contract (400), an account with no active proposal template (409), or a missing deal or contract (404). The document comes from the compose action. A plain def: the reads are synchronous and belong in the thread pool.

Body·

required
application/json

Generate from a contract, or from a deal, which resolves to its live contract.

  • Contract ID

  • Deal ID

Responses

  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/proposals/generate
curl https://crm.dreamhub.ai/api/v1/contracts/proposals/generate \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "contractId": "",
  "dealId": ""
}'
{
  "templateId": "string",
  "versionId": "string",
  "proposalName": "string",
  "contractId": "string",
  "dealId": "string",
  "sections": [
    {
      "id": "string",
      "title": "string"
    }
  ],
  "signaturePlaces": 1,
  "slots": [
    {
      "id": "string",
      "section": "string",
      "label": "string",
      "kind": "string",
      "source": "string",
      "record": "string",
      "display": "string",
      "readOnly": true,
      "multiline": true,
      "maxLength": 1,
      "boxes": [
        {
          "page": 1,
          "x": 1,
          "y": 1,
          "width": 1,
          "height": 1,
          "fontSize": 1,
          "padding": 1,
          "font": "string",
          "color": "string"
        }
      ],
      "value": "string",
      "typedValue": "string",
      "missing": {
        "record": "string",
        "recordId": "string",
        "field": "string"
      },
      "needsInput": false
    }
  ],
  "lines": [
    {
      "additionalProperty": "string"
    }
  ],
  "actions": [
    {
      "name": "string",
      "uri": "string",
      "method": "string"
    }
  ]
}