[POST] .../v1/doccommercialoffer/add
Creates a new commercial offer document. Use this method to create a commercial offer document before adding offer rows with CommercialOfferOperation/Add. The request requires the commercial offer add permission and the commercial offer tariff option; date, partner_id, currency_id and vat_calculation_type are required and attached_user_id defaults to the current request user when omitted or 0. The method stores partner, currency, VAT calculation mode, exchange rate, optional responsible user and optional description; base currency forces exchange_rate to 1, while non-base currency accepts a positive decimal exchange rate or uses the currency directory value. Business errors such as missing body, invalid required fields, denied access, disabled tariff option, unknown currency, invalid exchange rate, database failures or action log failures are returned as HTTP 200 ErrorResult.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| attached_user_id | Int64 | Optional | Responsible user ID. |
| currency_id | Int64 | Required | Commercial offer document currency ID. |
| date | Int64 | Required | Commercial offer document date as Unix time in seconds. |
| description | String | Optional | Additional description. |
| exchange_rate | Decimal | Optional | Exchange rate. |
| partner_id | Int64 | Required | Partner ID. |
| vat_calculation_type | String | Optional | VAT calculation mode: No - do not accrue, Exclude - included in the amount, Include - added on top. Allowed values: No, Exclude, Include. |
Request Example
{
"attached_user_id": 1,
"currency_id": 1,
"date": 1,
"description": "string",
"exchange_rate": 1.0,
"partner_id": 1,
"vat_calculation_type": "No"
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Insert | Created record result. |
Response Example
{
"ok": true,
"result": {
"new_id": 1
}
}