---
title: s_stocks_edit
url: 'https://gidas.saver.lt/api/s_stocks_edit'
markdown: 'https://gidas.saver.lt/api/s_stocks_edit.md'
date: '2026-09-29'
description: 'Last update 2026-09-29 This method is for creating stocks operation document. Method could be called multiple times for appending rows to stocks document. All parameters are expected via HTTP POST. Mandatory parameters Name Description Notes session_id Session id login RIVILE username …'
taxonomy:
  category:
    - docs
---

[](#)  [ Pradžia ](https://gidas.saver.lt/)     [ API ](https://gidas.saver.lt/api)      s\_stocks\_edit    

# s\_stocks\_edit

Last update 2026-09-29

This method is for creating stocks operation document. Method could be called multiple times for appending rows to stocks document. All parameters are expected via HTTP POST.

#### Mandatory parameters

| Name | Description | Notes |
|---|---|---|
| **session\_id** | Session id |  |
| **login** | RIVILE username |  |
| **pass** | RIVILE password hashed in **MD5** |  |
| **stocksOperationId** | Unique stocks operation id. 0 if new document must be created | i11\_kodas\_in |
| **stocksOperationNr** | Stocks operation document number | i11\_dok\_nr |
| **stocksOperationDep** | Stocks operation department | i11\_kodas\_is |
| **stocksRow** | document rows list JSON format |  |

#### stocksRow

| Name | Description | Notes |
|---|---|---|
| **stocksRowType** | row type  1 - product 3 - code | i12\_tipas |
| **stocksRowCode** | code of stocks row If stocksRowType = 1 then ID of product. If stocksRowType = 3 then ID of code | i12\_kodas\_ps |
| **stocksRowQty** | stocks row quantity | i12\_kiekis |

If stocksRowQty is < 0, then product quantity will be written off, otherwise quantity will be increased.

#### Additional parameters

| Name | Description | Notes |
|---|---|---|
| **lang** | Web service response language. **EN** **LT** or **RU** |  |
| **testMode** | Test mode on / off. If 1 No actual documment will be created, just parameters , test. 0 By default |  |
| **stocksOperationDescription** | Stock operation description | i11\_pav |
| **stocksOperationDate** | Date of stocks operation in YYYY-MM-DD format. By default current date | i11\_op\_data |
| **stocksOperationStatus** | Stocks operation status | i11\_busena |
| **stocksOperationType** | Stocks operation type 1 - inventory 2 - write-off 3 - production 4 - Adjustments 5 - stocks  6 - Other   Default value 6 is used | i11\_tipas |
| **stocksLogisticCode1** | Logistic code 1 | i11\_kodas\_ls\_1 |
| **stocksLogisticCode2** | Logistic code 2 | i11\_kodas\_ls\_2 |
| **stocksLogisticCode3** | Logistic code 3 | i11\_kodas\_ls\_3 |
| **stocksLogisticCode4** | Logistic code 4 | i11\_kodas\_ls\_4 |
| **stocksDescription1** | Description 1 | i11\_aprasymas1 |
| **stocksDescription2** | Description 2 | i11\_aprasymas2 |
| **stocksDescription3** | Description 3 | i11\_aprasymas3 |

#### stocksRow

| Name | Description | Notes |
|---|---|---|
| **stocksRowName** | stocks row name | i12\_pav |
| **stocksRowObject** | stocks row object | i12\_kodas\_os |
| **stocksRowCenter** | stocks row center | i12\_kodas\_os\_c |
| **stocksRowSerial** | stocks row serial | i12\_serija |
| **stocksRowAccount** | General Ledger account number (6000 by default) | i12\_kodas\_ss |
| **stocksRowDescription1** | stocks document row description 1 field | i12\_aprasymas1 |
| **stocksRowDescription2** | stocks document row description 2 field | i12\_aprasymas2 |
| **stocksRowDescription3** | stocks document row description 3 field | i12\_aprasymas3 |
| **stocksRowCertificate** | stocks row certificate | i12\_sertifikatas |
| **stocksRowAmount** | stocks row amount without VAT | i12\_sav\_suma |

stocksRowAmount is necessary if stocksRowQty is > 0 in case off quantity increase operation , otherwise it will be ignored.

#### Web service returns

| Name | Description | Notes |
|---|---|---|
| **status** | Web service status |  |
| **description** | Status description |  |
| **login** | RIVILE username |  |
| **stocksOperationId** | Stocks operation id |  |

#### Web service status list

| Name | Description |
|---|---|
| **00** | Ok |
| **01** | No parameter **session\_id** |
| **02** | No parameter **login** |
| **03** | No parameter **pass** |
| **04** | Login failed |
| **05** | No parameter **stocksOperationId** |
| **06** | Stocks document not found |
| **07** | Parameter **stocksOperationDate** validation error |
| **08** | **stocksOperationType** values 1,2,3,4,5,6 only allowed |
| **09** | Wrong parameter **lang** , values **LT**,**EN**,**RU** only. |
| **10** | Department not found |
| **11** | **stocksOperationDep** identification error |
| **12** | **testMode** only values 0,1 allowed |
| **13** | Parameter **stocksOperationStatus** validation error. Values 1-99 only. |
| **14** | **stocksLogisticCodeX** not found |
| **15** | Parameter stocksRow is not json List. |
| **16** | Parameter stocksRow not found |
| **17** | stocksRow field - **stocksRowType** is required |
| **18** | stocksRowType values 1,3 only allowed |
| **19** | stocksRow field - **stocksRowCode** is required |
| **20** | Product code not found |
| **21** | Code not found |
| **22** | **stocksRowQty** not number |
| **23** | Fraction is 1 but Quantity not whole number |
| **24** | **salesRowObject** not found |
| **25** | **stocksRowCenter** not found |
| **26** | **stocksRowAmount** not number |
| **27** | **stocksRowAccount** not found |
| **28** | Insufficient quantity |
| **29** | System does not have required parameter **riv\_id** |
| **30** | New document. Mandatory field **stocksOperationDep** is required |
| **31** | New document. Mandatory field - stocksOperationNr required |
| **32** | Document with the same number exists. **stocksOperationNr** |
| **33** | Stocks document is confirmed |
| **98** | DB connect error |
| **99** | Web service POST parameters error |

 [ ](https://gidas.saver.lt/api/s_stocks_delete) [](https://gidas.saver.lt/api/s_stocks_op_list)

---

## Navigation

- Parent: [API](https://gidas.saver.lt/api.md)
- Previous: [s_stocks_delete](https://gidas.saver.lt/api/s_stocks_delete.md)
- Next: [s_stocks_op_list](https://gidas.saver.lt/api/s_stocks_op_list.md)
