> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nexudus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Proposal

> Create a new Proposal record.

A **Proposal** bundles one or more contracts (`ProposalContract` records) that are presented to a customer for review and acceptance. Each `ProposalContract` carries the same properties as a `CoworkerContract` and becomes one when the proposal is accepted.

When a Proposal is created, a `ProposalContract` is automatically created and associated with it. From that point on, the contract-related fields on the Proposal (`TariffId`, `Desks`, `Variants`, `Price`, `StartDate`, `CancellationLimitDays`, `ContractTerm`, `CancellationDate`, `ExpirationDate`, `BillingDay`, `Quantity`) become read-only — they are all `createOnly`. Subsequent edits to those values must be made via the associated `ProposalContract`. Additional `ProposalContract` records can also be added.

Proposals support three optional attachments:

* **DocumentToSendId** — a `DocumentTemplate` entity presented to the customer instead of the standard price-schedule table before the proposal is accepted.
* **DocumentToSignId** — a `DocumentTemplate` entity used to generate a document for e-signature.
* **ProposalFile** — a file shown as a downloadable link before the proposal is accepted.

Set `DoNotIssueInvoice` to control whether the first invoice is issued automatically when the proposal is accepted.

## Authentication

<Note>
  This endpoint requires OAuth2 authentication. Include a valid bearer token in the `Authorization` header.
  The authenticated user must be a full unrestricted administrator or have the **`Proposal-Create`** role.
</Note>

## Enums

<Accordion title="eProposalStatus — ProposalStatus values">
  | Value | Name     |
  | ----- | -------- |
  | 1     | Draft    |
  | 2     | Sent     |
  | 3     | Accepted |
  | 4     | Rejected |
</Accordion>

## Request Body

### Required Fields

<ParamField body="IssuedById" type="integer" required>
  Issued By Id.
</ParamField>

<ParamField body="ResponsibleId" type="integer" required>
  Responsible Id.
</ParamField>

<ParamField body="CoworkerId" type="integer" required>
  Coworker Id.
</ParamField>

<ParamField body="Reference" type="string" required>
  Proposal reference.
</ParamField>

<ParamField body="ProposalStatus" type="integer" required>
  Proposal status. Defaults to `eProposalStatus.Draft`.
</ParamField>

<ParamField body="TariffId" type="integer" required>
  Tariff Id.
</ParamField>

<ParamField body="BillingDay" type="integer" required>
  Billing day of month for the initial contract. Becomes read-only after creation; edit via ProposalContract.
</ParamField>

<ParamField body="Quantity" type="integer" required>
  Quantity for the initial contract. Becomes read-only after creation; edit via ProposalContract.
</ParamField>

### Optional Fields

<ParamField body="Notes" type="string">
  Notes.
</ParamField>

<ParamField body="DocumentToSendId" type="integer">
  Document To Send Id.
</ParamField>

<ParamField body="DocumentToSignId" type="integer">
  Document To Sign Id.
</ParamField>

<ParamField body="DocumentToSignHtml" type="string">
  Document To Sign Html.
</ParamField>

<ParamField body="NewDocumentToSignBinaryDocumentUrl" type="string">
  New Document To Sign Binary Document Url.
</ParamField>

<ParamField body="ClearDocumentToSignBinaryDocumentFile" type="boolean">
  Clear Document To Sign Binary Document File.
</ParamField>

<ParamField body="DocumentToSendHtml" type="string">
  Document To Send Html.
</ParamField>

<ParamField body="NewDocumentToSendBinaryDocumentUrl" type="string">
  New Document To Send Binary Document Url.
</ParamField>

<ParamField body="ClearDocumentToSendBinaryDocumentFile" type="boolean">
  Clear Document To Send Binary Document File.
</ParamField>

<ParamField body="NewProposalFileUrl" type="string">
  New Proposal File Url.
</ParamField>

<ParamField body="ClearProposalFileFile" type="boolean">
  Clear Proposal File File.
</ParamField>

<ParamField body="Desks" type="integer[]">
  Desks.
</ParamField>

<ParamField body="Variants" type="integer[]">
  Variants.
</ParamField>

<ParamField body="Price" type="number">
  Price override for the initial contract. Becomes read-only after creation; edit via ProposalContract.
</ParamField>

<ParamField body="StartDate" type="string">
  Start date for the initial contract. Becomes read-only after creation; edit via ProposalContract.
</ParamField>

<ParamField body="CancellationLimitDays" type="integer">
  Cancellation limit in days for the initial contract. Becomes read-only after creation; edit via ProposalContract.
</ParamField>

<ParamField body="ContractTerm" type="string">
  Contract term end date for the initial contract. Becomes read-only after creation; edit via ProposalContract.
</ParamField>

<ParamField body="CancellationDate" type="string">
  Cancellation date for the initial contract. Becomes read-only after creation; edit via ProposalContract.
</ParamField>

<ParamField body="ExpirationDate" type="string">
  Proposal expiration date. Becomes read-only after creation; edit via ProposalContract.
</ParamField>

<ParamField body="DiscountCodeId" type="integer">
  Discount Code Id.
</ParamField>

<ParamField body="StartDateLocal" type="string">
  Start Date Local.
</ParamField>

<ParamField body="SentOnLocal" type="string">
  Sent On Local.
</ParamField>

<ParamField body="DoNotIssueInvoice" type="boolean">
  If true, the first invoice is not issued automatically when the proposal is accepted.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST \
    "https://spaces.nexudus.com/api/billing/proposals" \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "IssuedById": 0,
      "ResponsibleId": 0,
      "CoworkerId": 0,
      "Reference": "",
      "ProposalStatus": 0,
      "TariffId": 0,
      "BillingDay": 0,
      "Quantity": 0
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/billing/proposals',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        IssuedById: 0,
        ResponsibleId: 0,
        CoworkerId: 0,
        Reference: '',
        ProposalStatus: 0,
        TariffId: 0,
        BillingDay: 0,
        Quantity: 0
      })
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://spaces.nexudus.com/api/billing/proposals',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN',
          'Content-Type': 'application/json'
      },
      json={
          'IssuedById': 0,
          'ResponsibleId': 0,
          'CoworkerId': 0,
          'Reference': '',
          'ProposalStatus': 0,
          'TariffId': 0,
          'BillingDay': 0,
          'Quantity': 0
      }
  )

  data = response.json()
  ```
</CodeGroup>

## Response

### 200

<ResponseField name="Status" type="integer">
  HTTP status code. `200` on success.
</ResponseField>

<ResponseField name="Message" type="string">
  A human-readable message confirming the creation.
</ResponseField>

<ResponseField name="Value" type="object">
  Contains the `Id` of the newly created record.
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `true` if the proposal was created successfully.
</ResponseField>

<ResponseField name="Errors" type="array">
  `null` on success.
</ResponseField>

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "Proposal was successfully created.",
  "Value": {
    "Id": 87654321
  },
  "OpenInDialog": false,
  "OpenInWindow": false,
  "RedirectURL": null,
  "JavaScript": null,
  "UpdatedOn": "2025-01-15T10:30:00Z",
  "UpdatedBy": "admin@example.com",
  "Errors": null,
  "WasSuccessful": true
}
```

### 400

<ResponseField name="Message" type="string">
  A summary of the validation error(s), in the format `PropertyName: error message`.
</ResponseField>

<ResponseField name="Value" type="any">
  `null` on validation failure.
</ResponseField>

<ResponseField name="Errors" type="object[]">
  Array of validation errors.

  <Expandable>
    <ResponseField name="AttemptedValue" type="any">
      The value that was submitted for the field, or `null` if missing.
    </ResponseField>

    <ResponseField name="Message" type="string">
      The validation error message.
    </ResponseField>

    <ResponseField name="PropertyName" type="string">
      The name of the property that failed validation.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `false` when the request fails validation.
</ResponseField>

```json Example Response theme={null}
{
  "Message": "Reference: is a required field",
  "Value": null,
  "Errors": [
    {
      "AttemptedValue": null,
      "Message": "is a required field",
      "PropertyName": "Reference"
    }
  ],
  "WasSuccessful": false
}
```
