Add or Update Opportunity

post
Add or Update Opportunity

[PlatformAddress]/api/1.0/venue?action=addOrUpdateOpportunity
Request
Response
Path Parameters
id
optional
integer
The unique identifier of opportunity (Leave empty if adding a new opportunity)
venueId
required
integer
The unique venue if of the opportunity
qualityId
optional
integer
The quality of opportunity
companyId
optional
integer
The unique company id of opportunity (Required when lead belongs to a company and the id is missing)
industryId
optional
integer
The unique industry id of opportunity
sourceId
optional
integer
The unique source id of opportunity (Required when the ID parameter is missing)
referralContactId
optional
integer
The contact Id of referral for "Referral Program" source. (Required when the source is Referral Program and referralContact parameter is missing )
referralContact
optional
object
The data array of contact. See addOrUpdateContact API in contact namespace for parameters.
referralCompanyId
optional
integer
The company Id of referral for "Referral Program" source. (Required when the source is Referral Program and referralCompany parameter is missing )
referralCompany
optional
object
The data array of company. See addOrUpdateCompany API in contact namespace for parameters.
confirmedQuoteId
optional
integer
The unique confirmed quote id of opportunity
confirmedQuoteStatus
optional
integer
The status id of the confirmed quote
cancelledQuoteId
optional
integer
The unique cancelled quote id of opportunity
lostToCompetition
optional
integer
The ID of the lost reason
closedDate
optional
string
The close date of the opportunity
companyLeadContactId
optional
integer
The unique contact ID of the company contact (Required when lead belongs to company and id is missing)
contactId
optional
integer
The unique contact id of opportunity (Required when opportunity belongs to contact and id is missing)
name
optional
string
The name for the opportunity (Required when id is missing)
ownerUserId
optional
integer
The sales person id of opportunity
typeId
optional
integer
The type of opportunity (Required when id is missing)
stageId
optional
integer
The stage of opportunity (Required when id is missing)
stageReasonId
optional
integer
The unique stage reason id of opportunity
channelId
optional
string
The channel id of Opportunity
description
optional
string
The description for the opportunity
200: OK
{
"success": true,
"id": 755
}

Example Request

Add Opportunity

{
"venueId": "107",
"name": "Lead By API",
"contactId": "918",
"typeId": "18",
"sourceId": "25",
"stageId": "69",
"industryId": "77",
"stageReasonId": "127",
"closedDate": "2017-05-05",
"referralCompany": {
"businessName": "Business",
"primaryContact": {
"firstName": "Test",
"lastName": "Test",
"email": "Test@gmail.com"
}
},
"referralContact": {
"firstName": "Test",
"lastName": "Test",
"email": "Test@gmail.com"
}
}

Update Opportunity

{
"id": 755,
"venueId": "107",
"name": "Updated Name"
}

Returns

Property

Description

success

Whether or not the opportunity was added to the venue

id

The unique id of the opportunity

Throws

Code

Description

Specific Code: 24221

The request is empty

Specific Code: 24222

The opportunity does not exist

Specific Code: 24224

The opportunity details are invalid

This call takes values for a opportunity, and either

  1. Updates the values for that opportunity (after you have provided an id in the parameters), or

  2. Adds the opportunity to the system (if the id parameter is missing) 1. The result of this call will contain the status of the result (either

    true or false) and the opportunity identifier of the updated or newly

    created opportunity.