# Change a proposal

`PATCH /proposals/{id}` · Rivier · shop

Change a proposal; fields left out stay as they are. A sent proposal becomes a new revision and goes back to draft.

- Scope: shop:write
- Mcp: rivier_proposals_update
- Graphql: Mutation.shopProposalUpdate
- Sdk: shop.proposal.update
- Cli: proposals update

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "clientId": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "contact": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "email": {
          "type": "string",
          "format": "email",
          "maxLength": 254
        },
        "phone": {
          "type": "string",
          "maxLength": 60
        },
        "addressLines": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 200
          },
          "maxItems": 6,
          "default": []
        },
        "country": {
          "type": "string",
          "pattern": "^[A-Z]{2}$"
        },
        "vatId": {
          "type": "string",
          "maxLength": 60
        },
        "registration": {
          "type": "string",
          "maxLength": 60
        },
        "language": {
          "type": "string",
          "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$",
          "maxLength": 20
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "recipients": {
      "type": "object",
      "properties": {
        "to": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "maxLength": 200,
                "default": ""
              },
              "email": {
                "type": "string",
                "format": "email",
                "maxLength": 254
              },
              "contactId": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "email"
            ],
            "additionalProperties": false
          },
          "maxItems": 5,
          "default": []
        },
        "cc": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "maxLength": 200,
                "default": ""
              },
              "email": {
                "type": "string",
                "format": "email",
                "maxLength": 254
              },
              "contactId": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "email"
            ],
            "additionalProperties": false
          },
          "maxItems": 10,
          "default": []
        }
      },
      "additionalProperties": false
    },
    "currency": {
      "type": "string",
      "pattern": "^[a-z]{3}$"
    },
    "language": {
      "type": "string",
      "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$",
      "maxLength": 20
    },
    "title": {
      "type": "string",
      "maxLength": 200
    },
    "issueDate": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "validUntil": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "notes": {
      "type": "string",
      "maxLength": 4000
    },
    "terms": {
      "type": "string",
      "maxLength": 10000
    },
    "paymentInstructions": {
      "type": "string",
      "maxLength": 2000
    },
    "templateId": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "layout": {
      "type": "string",
      "enum": [
        "minimal",
        "classic",
        "modern",
        "bold"
      ]
    },
    "taxInclusive": {
      "type": "boolean"
    },
    "lines": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "quantity": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 1000000,
            "default": 1
          },
          "unit": {
            "type": "string",
            "maxLength": 10,
            "default": "C62"
          },
          "unitAmountMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 99999999999
          },
          "discountMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 99999999999,
            "default": 0
          },
          "taxRateBp": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          },
          "taxCategory": {
            "type": "string",
            "enum": [
              "S",
              "Z",
              "E",
              "AE",
              "K",
              "G",
              "O",
              "L",
              "M"
            ],
            "default": "S"
          },
          "optional": {
            "type": "boolean",
            "default": false
          },
          "selected": {
            "type": "boolean",
            "default": true
          }
        },
        "required": [
          "description",
          "unitAmountMinor"
        ],
        "additionalProperties": false
      },
      "maxItems": 200
    },
    "subject": {
      "type": "string",
      "maxLength": 300
    },
    "message": {
      "type": "string",
      "maxLength": 5000
    },
    "useCase": {
      "type": "string",
      "maxLength": 80
    },
    "sections": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "enum": [
              "scope",
              "deliverables",
              "timeline",
              "pricing",
              "terms",
              "custom"
            ]
          },
          "title": {
            "type": "string",
            "maxLength": 120,
            "default": ""
          },
          "body": {
            "type": "string",
            "maxLength": 20000,
            "default": ""
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 300
                },
                "detail": {
                  "type": "string",
                  "maxLength": 1000,
                  "default": ""
                },
                "when": {
                  "type": "string",
                  "maxLength": 60,
                  "default": ""
                }
              },
              "required": [
                "label"
              ],
              "additionalProperties": false
            },
            "maxItems": 60,
            "default": []
          }
        },
        "required": [
          "key"
        ],
        "additionalProperties": false
      },
      "maxItems": 30
    },
    "expectedVersion": {
      "type": "integer",
      "minimum": 1
    }
  },
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X PATCH 'https://api.rivier.ai/proposals/{id}' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "clientId": "string",
  "contact": {
    "name": "string"
  },
  "recipients": {
    "to": [],
    "cc": []
  },
  "currency": "string",
  "language": "string",
  "title": "string",
  "issueDate": "string",
  "validUntil": "string"
}'
```
