POST Sale/Validate
Some tooltip text!
• 8 minutes to read
• 8 minutes to read
POST /api/v1/Sale/Validate
Check that entity is ready for saving, return error messages by field.
Request Headers
| Parameter Name | Description |
|---|---|
| Authorization | Supports 'Basic', 'SoTicket' and 'Bearer' schemes, depending on installation type. |
| X-XSRF-TOKEN | If not using Authorization header, you must provide XSRF value from cookie or hidden input field |
| Content-Type | Content-type of the request body: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded, application/json-patch+json, application/merge-patch+json |
| Accept | Content-type(s) you would like the response in: application/json, text/json, application/xml, text/xml, application/json-patch+json, application/merge-patch+json |
| Accept-Language | Convert string references and multi-language values into a specified language (iso2) code. |
| SO-Language | Convert string references and multi-language values into a specified language (iso2) code. Overrides Accept-Language value. |
| SO-Culture | Number, date formatting in a specified culture (iso2 language) code. Partially overrides SO-Language/Accept-Language value. Ignored if no Language set. |
| SO-TimeZone | Specify the timezone code that you would like date/time responses converted to. |
| SO-AppToken | The application token that identifies the partner app. Used when calling Online WebAPI from a server. |
Request Body: saleEntity
Entity to be checked for errors.
| Property Name | Type | Description |
|---|---|---|
| Appointment | Appointment | Simple read-only appointment data. |
| Associate | Associate | The sale owner |
| UpdatedBy | Associate | Who updated the sale |
| CreatedBy | Associate | Who created to sale |
| Contact | Contact | The contact associated with the sale. It may also be 0 if no contact is associated with the sale. |
| Project | Project | A sale may also be connected to a project, so you see the sale both on the company card, and on the project card. This does not mean that a project is required. |
| SaleText | String | Text describing the sale |
| Person | Person | A sale may also be connected to a person - this must be a contact person registered on the current contact. This does not mean that a person is required. |
| Currency | Currency | The currency the sale object was sold in |
| Competitor | Competitor | List of all possible competitors. |
| Credited | Credited | List of who is to be credited for the sale. |
| Rating | Rating | The sale rating |
| Reason | Reason | The sale reason |
| Source | Source | The sale source |
| Status | String | The state of the Sale: Open / Sold / Lost / Stalled |
| Saledate | String | (expected / lost / won) sales date |
| Amount | Number | Total sale amount |
| SaleId | Integer | Primary key |
| Earning | Number | Earning on sale |
| EarningPercent | Number | Earning as percent of total |
| Heading | String | Sale heading (short description?) |
| Number | String | Alphanumeric user field |
| Probability | Integer | Actual probability, may differ from the one in the list |
| CreatedDate | String | Registered date in UTC. |
| UpdatedDate | String | Last updated in UTC. |
| Completed | String | The Sale completed state. The completed state is either Started or Completed. NotStarted is treated as Started. The value maps to the Done database field. |
| ActiveLinks | Integer | Number of active links to sale, document, appointment. |
| Links | Array | List of all elements linked to the sale. |
| NextDueDate | String | Next due date, this is a denormalization of 'closest future activity date, or most recent if no future activities'. Maintained by the system, but very convenient for searching. |
| Postit | String | The actual text, max 2047 significant characters even though it is stored as a larger data type on some databases |
| SaleType | SaleType | |
| ReasonSold | ReasonSold | |
| ReasonStalled | ReasonStalled | |
| ReopenDate | String | Date the sale is to be reopened; valid only for status=stalled. Not necessarily the same as the nextDueDate. |
| SaleStakeholders | Array | |
| ActiveErpLinks | Integer | The number of active erp links |
| UserDefinedFields | Object | Deprecated: Use {SuperOffice.CRM.Services.SaleEntity.CustomFields} instead. Dictionary of user defined field data. The key string is the ProgId of the UdefField, or if the ProgId is empty it is a string of the format "SuperOffice:[UdefFieldIdentity]", e.g. "SuperOffice:1234" |
| ExtraFields | Object | Deprecated: Use {SuperOffice.CRM.Services.SaleEntity.CustomFields} instead. Extra fields added to the carrier. This could be data from Plug-ins, the foreign key system, external applications, etc. |
| CustomFields | Object | Udef + Extra fields added to the carrier. Extra fields as defined by changes to database schema + user-defined fields as defined by admin. Custom fields combines user defined fields and extra fields into one bucket. The individual {SuperOffice.CRM.Services.SaleEntity.ExtraFields} and |
| PublishEventDate | String | Publish event date |
| PublishTo | String | Publication valid to (inclusive) |
| PublishFrom | String | Publication valid from (inclusive) |
| IsPublished | Boolean | Publication is published |
| VisibleFor | Array | The set of users or groups the record is visible for |
Response:object
OK
| Response | Description |
|---|---|
| 200 | OK |
Response body: object
Sample request
POST /api/v1/Sale/Validate
Authorization: Basic dGplMDpUamUw
Accept: application/json; charset=utf-8
Accept-Language: sv
Content-Type: application/json; charset=utf-8
{
"Appointment": null,
"Associate": null,
"UpdatedBy": null,
"CreatedBy": null,
"Contact": null,
"Project": null,
"SaleText": "vel",
"Person": null,
"Currency": null,
"Competitor": null,
"Credited": null,
"Rating": null,
"Reason": null,
"Source": null,
"Status": "Lost",
"Saledate": "2014-06-12T14:34:02.3624465+02:00",
"Amount": 24379.386,
"SaleId": 691,
"Earning": 9336.186,
"EarningPercent": 16390.82,
"Heading": "sed",
"Number": "746384",
"Probability": 571,
"CreatedDate": "2024-07-31T14:34:02.3624465+02:00",
"UpdatedDate": "2018-08-18T14:34:02.3624465+02:00",
"Completed": "Completed",
"ActiveLinks": 616,
"Links": [
{
"EntityName": "Lebsack, Smith and Roberts",
"Id": 811,
"Description": "Open-architected logistical orchestration",
"ExtraInfo": "consequatur",
"LinkId": 657
},
{
"EntityName": "Lebsack, Smith and Roberts",
"Id": 811,
"Description": "Open-architected logistical orchestration",
"ExtraInfo": "consequatur",
"LinkId": 657
}
],
"NextDueDate": "2025-10-12T14:34:02.3624465+02:00",
"Postit": "quos",
"SaleType": null,
"ReasonSold": null,
"ReasonStalled": null,
"ReopenDate": "2018-09-26T14:34:02.3624465+02:00",
"SaleStakeholders": [
{
"StakeholderRoleName": "Hilpert-Nolan",
"Comment": "ipsam",
"StakeholderRoleId": 675,
"CountryId": 993,
"PersonId": 459,
"EmailDescription": "carroll.prohaska@hamillcole.co.uk",
"EmailId": 652,
"EmailAddress": "amara@upton.us",
"PhoneId": 413,
"ContactName": "Ward LLC",
"ContactId": 764,
"SaleId": 60,
"Mrmrs": "voluptate",
"Firstname": "Jaeden",
"MiddleName": "VonRueden Inc and Sons",
"Lastname": "Kuhic",
"SaleStakeholderId": 475,
"Rank": 719,
"Phone": "1-526-101-4626"
}
],
"ActiveErpLinks": 997,
"UserDefinedFields": {
"SuperOffice:1": "Mrs. Constance Wiley Corkery",
"SuperOffice:2": "Rosemarie Boyle"
},
"ExtraFields": {
"ExtraFields1": "est",
"ExtraFields2": "modi"
},
"CustomFields": {
"CustomFields1": "aut",
"CustomFields2": "odit"
},
"PublishEventDate": "2019-12-16T14:34:02.3624465+01:00",
"PublishTo": "2023-04-19T14:34:02.3624465+02:00",
"PublishFrom": "2019-03-31T14:34:02.3624465+02:00",
"IsPublished": true,
"VisibleFor": [
{
"VisibleId": 197,
"Visibility": "All",
"DisplayValue": "ab"
},
{
"VisibleId": 197,
"Visibility": "All",
"DisplayValue": "ab"
}
]
}
Sample response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"1": "nulla",
"2": "ipsum"
}