---
title: s_opportunities_edit
url: 'https://gidas.saver.lt/api/s_opportunities_edit'
markdown: 'https://gidas.saver.lt/api/s_opportunities_edit.md'
date: '2026-06-19'
description: 'Last update 2026-06-19 This method is for creating / editing opportunities. 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 leadId opportunity ID 0 for new leadN…'
taxonomy:
  category:
    - docs
---

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

# s\_opportunities\_edit

Last update 2026-06-19

This method is for creating / editing opportunities. 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** |  |
| **leadId** | opportunity ID | 0 for new |
| **leadName** | opportunity Name | Mandatory for new, optional for edit |

#### Additional parameters

| Name | Description | Notes |
|---|---|---|
| **lang** | Web service response language. **EN** **LT** or **RU** |  |
| **testMode** | Error validation, no operation | 0-1 |
| **leadDescription** | Description |  |
| **leadDateFrom** | Date from | Format YYYY-MM-DD HH:MM:SS |
| **leadDateTo** | Date to | Format YYYY-MM-DD HH:MM:SS |
| **leadNextDate** | Next action date | Format YYYY-MM-DD HH:MM:SS |
| **leadStageId** | Stage ID |  |
| **leadPipeId** | Pipe ID |  |
| **leadLoseId** | ACTIVE/WIN/LOSE ID | Provide 9999 for active opportunity, 0 for WIN ,1-99 for LOSE |
| **leadSourceId** | Source ID |  |
| **leadColor** | Color code |  |
| **leadLink** | URL Link |  |
| **leadContactId** | Contact ID |  |
| **leadContactName** | Contact Name |  |
| **leadContactTitle** | Contact Title |  |
| **leadContactPhone** | Contact Phone |  |
| **leadContactMobPhone** | Contact Mob Phone |  |
| **leadContactEmail** | Contact Email |  |
| **leadSum** | Sum | Works if leadSalesDecription3 not provided |
| **leadSalesDecription3** | Sales document ID |  |
| **leadUser** | User |  |
| **leadClientCode** | Client code | Provide "000000000000" for potential client |
| **leadClientName** | Potential client name | When leadClientCode = "000000000000" |
| **leadClientCompanyCode** | Potential client company code | When leadClientCode = "000000000000" |
| **leadClientVatCode** | Potential client VAT code | When leadClientCode = "000000000000" |
| **leadClientAddress** | Potential client address | When leadClientCode = "000000000000" |
| **leadClientRating** | Potential client rating | When leadClientCode = "000000000000" |
| **leadClientShortName** | Potential client short name | When leadClientCode = "000000000000" |
| **leadClientNotes** | Potential client notes | When leadClientCode = "000000000000" |
| **leadClientDescription** | Potential client description | When leadClientCode = "000000000000" |
| **leadClientTags** | Potential client tags | When leadClientCode = "000000000000" |
| **leadClientWebLink** | Potential client URL link | When leadClientCode = "000000000000" |
| **leadLogisticCode1** | Logistic code 1 |  |
| **leadLogisticCode2** | Logistic code 2 |  |
| **leadLogisticCode3** | Logistic code 3 |  |
| **leadLogisticCode4** | Logistic code 4 |  |

#### Web service returns

| Name | Description | Notes |
|---|---|---|
| **status** | Web service status |  |
| **description** | Status description |  |
| **login** | RIVILE username |  |
| **list** | List with data |  |

#### 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 or wrong parameter **leadId** |
| **06** | leadId not found |
| **07** | No parameter **leadNem** |
| **08** | No module permission fo user |
| **09** | Wrong parameter lang , values **LT**,**EN**,**RU** only. |
| **12** | Error in parameter **testMode**. Possible values 0-1 |
| **14** | Parameter **leadDateFrom** validation error. Input must be yyyy-mm-dd format |
| **15** | Parameter **leadDateTo** validation error. Input must be yyyy-mm-dd format |
| **16** | Parameter **leadNextDate** validation error. Input must be yyyy-mm-dd format |
| **17** | Parameter **leadPipeId** validation error. Input must be numeric and in ... range |
| **18** | Parameter **leadStageId** validation error. Input must be numeric and in ... range |
| **19** | Parameter **leadLoseId** validation error. Input must be numeric and in ... range |
| **20** | Parameter **leadSourceId** validation error. Input must be numeric and in ... range |
| **21** | Parameter **leadUser** validation error. User not found |
| **22** | Parameter **leadClientCode** validation error. Client not found |
| **98** | SQL error |

Example of succesfull API usage via INSOMNIA ![pic2](https://gidas.saver.lt/user/pages/098.api/011.s_opportunities_edit/pic2.jpg)![pic1](https://gidas.saver.lt/user/pages/098.api/011.s_opportunities_edit/pic1.jpg)

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

---

## Navigation

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