[POST] .../v1/docwholesale/add
Creates a new partner shipment document. Use this method to create a shipment-to-partner document header before adding item lines with WholeSaleOperation/Add. The request body must contain date, partner_id, stock_id, currency_id and vat_calculation_type; attached_user_id is optional and defaults to the current request user when omitted or 0, exchange_rate defaults from currency data when not provided for non-base currency and description is limited to 300 characters. The stock_partner_wholesale_able tariff option must be enabled, the selected stock must be available to the current request user, closed periods prevent creating the document and an optional contract must exist and use the same currency; validation, tariff, permission, stock access, contract, period, database or webhook/persistence errors are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| attached_user_id | Int64 | Optional | Responsible user ID. If omitted or 0, the API uses the current request user. |
| contract_id | Int64 | Optional | Contract ID. Optional; when provided, the contract currency must match currency_id. |
| currency_id | Int64 | Required | Currency ID. |
| date | Int64 | Required | Shipment-to-partner document date as Unix time in seconds. |
| description | String | Optional | Additional description. Maximum length is 300 characters. |
| exchange_rate | Decimal | Optional | Exchange rate. Optional; base currency uses 1 and missing non-base rate is taken from the currency catalog. |
| partner_id | Int64 | Required | Partner ID. |
| price_type_id | Int64 | Optional | Price type ID used by shipment operations when prices are recalculated from a price type. |
| seller_id | Int64 | Optional | Seller user ID. |
| stock_id | Int64 | Required | Stock ID. |
| vat_calculation_type | String | Required | VAT calculation mode: No - do not accrue, Exclude - included in the amount, Include - added on top. Allowed values: No, Exclude, Include. |
Request Example
{
"date": 1767225600,
"partner_id": 301,
"stock_id": 11,
"currency_id": 1,
"contract_id": 701,
"exchange_rate": 1,
"vat_calculation_type": "Exclude",
"attached_user_id": 5,
"seller_id": 6,
"price_type_id": 7,
"description": "Shipment to partner warehouse"
}
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": 5601
}
}