POST Sale
Some tooltip text!
• 16 minutes to read
• 16 minutes to read
POST /api/v1/Sale
Creates a new SaleEntity
Calls the Sale agent service SaveSaleEntity. NsApiSlow threshold: 2000 ms.
Query String Parameters
| Parameter Name | Type | Description |
|---|---|---|
| $select | string | Optional comma separated list of properties to include in the result. Other fields are then nulled out to reduce payload size: "Name,department,category" Default = show all fields. |
POST /api/v1/Sale?$select=name,department,category/id
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: newEntity
The SaleEntity to be saved.
| 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:
OK
| Response | Description |
|---|---|
| 200 | OK |
Response body: SaleEntityWithLinks
| Property Name | Type | Description |
|---|---|---|
| Appointment | Appointment | Simple read-only appointment data. Carrier object for Appointment. Services for the Appointment Carrier is available from the Appointment Agent. |
| Associate | Associate | The sale owner Use MDO List name "associate" to get list items. |
| 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. Use MDO List name "contact" to get list items. |
| 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. Use MDO List name "project" to get list items. |
| 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. Use MDO List name "person" to get list items. |
| Currency | Currency | The currency the sale object was sold in Use MDO List name "currency" to get list items. |
| Competitor | Competitor | List of all possible competitors. Use MDO List name "comptr" to get list items. |
| Credited | Credited | List of who is to be credited for the sale. Use MDO List name "credited" to get list items. |
| Rating | Rating | The sale rating Use MDO List name "prob" to get list items. |
| Reason | Reason | The sale reason Use MDO List name "reason" to get list items. |
| Source | Source | The sale source Use MDO List name "source" to get list items. |
| Status | string | The state of the Sale: Open / Sold / Lost / Stalled |
| Saledate | date-time | (expected / lost / won) sales date |
| Amount | double | Total sale amount |
| SaleId | int32 | Primary key |
| Earning | double | Earning on sale |
| EarningPercent | double | Earning as percent of total |
| Heading | string | Sale heading (short description?) |
| Number | string | Alphanumeric user field |
| Probability | int32 | Actual probability, may differ from the one in the list |
| CreatedDate | date-time | Registered date in UTC. |
| UpdatedDate | date-time | 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 | int32 | Number of active links to sale, document, appointment. |
| Links | array | List of all elements linked to the sale. |
| NextDueDate | date-time | 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 | Use MDO List name "saletype" to get list items. |
| ReasonSold | ReasonSold | Use MDO List name "reasonsold" to get list items. |
| ReasonStalled | ReasonStalled | Use MDO List name "reasonstalled" to get list items. |
| ReopenDate | date-time | Date the sale is to be reopened; valid only for status=stalled. Not necessarily the same as the nextDueDate. |
| SaleStakeholders | array | |
| ActiveErpLinks | int32 | 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 UserDefinedFields properties are deprecated in favor of this combined collection. |
| PublishEventDate | date-time | Publish event date |
| PublishTo | date-time | Publication valid to (inclusive) |
| PublishFrom | date-time | Publication valid from (inclusive) |
| IsPublished | bool | Publication is published |
| VisibleFor | array | The set of users or groups the record is visible for |
| TableRight | TableRight | The carrier's table right |
| FieldProperties | object | Field property dictionary mapping field names to field access rights. |
| _Links | object |
Sample request
POST /api/v1/Sale
Authorization: Basic dGplMDpUamUw
Accept: application/json; charset=utf-8
Accept-Language: *
Content-Type: application/json; charset=utf-8
{
"Appointment": null,
"Associate": null,
"UpdatedBy": null,
"CreatedBy": null,
"Contact": null,
"Project": null,
"SaleText": "et",
"Person": null,
"Currency": null,
"Competitor": null,
"Credited": null,
"Rating": null,
"Reason": null,
"Source": null,
"Status": "Lost",
"Saledate": "2019-06-26T14:34:02.2845767+02:00",
"Amount": 10395.478,
"SaleId": 520,
"Earning": 21079.284,
"EarningPercent": 288.328,
"Heading": "cupiditate",
"Number": "1460641",
"Probability": 966,
"CreatedDate": "2023-10-12T14:34:02.2845767+02:00",
"UpdatedDate": "2010-04-28T14:34:02.2845767+02:00",
"Completed": "Completed",
"ActiveLinks": 123,
"Links": [
{
"EntityName": "Feil, Ernser and Mueller",
"Id": 747,
"Description": "Self-enabling attitude-oriented complexity",
"ExtraInfo": "modi",
"LinkId": 255
},
{
"EntityName": "Feil, Ernser and Mueller",
"Id": 747,
"Description": "Self-enabling attitude-oriented complexity",
"ExtraInfo": "modi",
"LinkId": 255
}
],
"NextDueDate": "2004-09-16T14:34:02.2845767+02:00",
"Postit": "esse",
"SaleType": null,
"ReasonSold": null,
"ReasonStalled": null,
"ReopenDate": "2016-06-24T14:34:02.2845767+02:00",
"SaleStakeholders": [
{
"StakeholderRoleName": "Reichert-Parker",
"Comment": "iusto",
"StakeholderRoleId": 57,
"CountryId": 18,
"PersonId": 211,
"EmailDescription": "kayleigh@stiedemannarmstrong.com",
"EmailId": 985,
"EmailAddress": "maye_ziemann@schaefer.uk",
"PhoneId": 745,
"ContactName": "Bednar, Braun and Yundt",
"ContactId": 46,
"SaleId": 894,
"Mrmrs": "similique",
"Firstname": "Eric",
"MiddleName": "McCullough, Simonis and Lindgren",
"Lastname": "Nikolaus",
"SaleStakeholderId": 942,
"Rank": 89,
"Phone": "845.549.5016 x946"
}
],
"ActiveErpLinks": 333,
"UserDefinedFields": {
"SuperOffice:1": "Janiya Raynor",
"SuperOffice:2": "True"
},
"ExtraFields": {
"ExtraFields1": "quo",
"ExtraFields2": "rerum"
},
"CustomFields": {
"CustomFields1": "iste",
"CustomFields2": "est"
},
"PublishEventDate": "2007-09-29T14:34:02.2845767+02:00",
"PublishTo": "2022-01-28T14:34:02.2845767+01:00",
"PublishFrom": "2022-12-12T14:34:02.2845767+01:00",
"IsPublished": false,
"VisibleFor": [
{
"VisibleId": 193,
"Visibility": "All",
"DisplayValue": "qui"
},
{
"VisibleId": 193,
"Visibility": "All",
"DisplayValue": "qui"
}
]
}
Sample response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"Appointment": null,
"Associate": null,
"UpdatedBy": null,
"CreatedBy": null,
"Contact": null,
"Project": null,
"SaleText": "dolore",
"Person": null,
"Currency": null,
"Competitor": null,
"Credited": null,
"Rating": null,
"Reason": null,
"Source": null,
"Status": "Lost",
"Saledate": "2023-10-13T14:34:02.2845767+02:00",
"Amount": 4660.258,
"SaleId": 902,
"Earning": 1241.0639999999999,
"EarningPercent": 26034.138,
"Heading": "dolorem",
"Number": "796410",
"Probability": 871,
"CreatedDate": "2013-08-26T14:34:02.2845767+02:00",
"UpdatedDate": "2014-06-07T14:34:02.2845767+02:00",
"Completed": "Completed",
"ActiveLinks": 130,
"Links": [
{
"EntityName": "McDermott-Hudson",
"Id": 458,
"Description": "Persevering real-time circuit",
"ExtraInfo": "sunt",
"LinkId": 757,
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.String",
"FieldLength": 48
}
}
}
],
"NextDueDate": "2021-10-11T14:34:02.2845767+02:00",
"Postit": "delectus",
"SaleType": null,
"ReasonSold": null,
"ReasonStalled": null,
"ReopenDate": "2014-09-19T14:34:02.3003233+02:00",
"SaleStakeholders": [
{
"StakeholderRoleName": "Cummings, Harber and Sipes",
"Comment": "assumenda",
"StakeholderRoleId": 783,
"CountryId": 424,
"PersonId": 417,
"EmailDescription": "landen.lebsack@hahnrath.name",
"EmailId": 223,
"EmailAddress": "jaunita_haag@connblanda.ca",
"PhoneId": 137,
"ContactName": "Bogan, Stracke and Kilback",
"ContactId": 441,
"SaleId": 423,
"Mrmrs": "quisquam",
"Firstname": "Aletha",
"MiddleName": "Jacobi LLC",
"Lastname": "Cummerata",
"SaleStakeholderId": 378,
"Rank": 298,
"Phone": "(181)023-2876 x1533",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.String",
"FieldLength": 278
}
}
}
],
"ActiveErpLinks": 147,
"UserDefinedFields": {
"SuperOffice:1": "1805161853",
"SuperOffice:2": "Vivienne Pollich"
},
"ExtraFields": {
"ExtraFields1": "quidem",
"ExtraFields2": "asperiores"
},
"CustomFields": {
"CustomFields1": "consequuntur",
"CustomFields2": "eius"
},
"PublishEventDate": "2005-11-18T14:34:02.3003233+01:00",
"PublishTo": "2015-05-02T14:34:02.3003233+02:00",
"PublishFrom": "2009-02-07T14:34:02.3003233+01:00",
"IsPublished": false,
"VisibleFor": [
{
"VisibleId": 451,
"Visibility": "All",
"DisplayValue": "qui",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.String",
"FieldLength": 639
}
}
},
{
"VisibleId": 451,
"Visibility": "All",
"DisplayValue": "qui",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.String",
"FieldLength": 639
}
}
}
],
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.String",
"FieldLength": 716
}
},
"_Links": {
"Self": "https://www.example.com/api/v1/contact/321",
"Archive": "https://www.example.com/api/v1/contact"
}
}