Create Opportunity
1 min
POST
https://api.nue.io/cpq/opportunities
Body Parameters
- bodyCreateOpportunityRequestrequiredExample
{ "opportunityName": "Enterprise Deal - Q2", "closeDate": "2025-06-30", "stage": "Prospecting", "accountId": "001D000000IRFmaIAH", "description": "New enterprise opportunity", "probability": 25 }Description- opportunityNamestringrequiredExampleDescription
- closeDatestring<date>requiredExampleDescriptionFormatdate
- stagestringrequiredExampleDescription
- accountIdstringrequiredExampleDescription
- descriptionstringDescription
- nextStepstringDescription
- probabilitynumberDescriptionMinimum0Maximum100
Responses
201
- CreateOpportunityResponseDescription
- idstringExampleDescription
- opportunityNamestringDescription
- closeDatestring<date>DescriptionFormatdate
- stagestringDescription
- salesforceUrlstringDescription
400
401
curl
curl --request POST \
--url https://api.nue.io/cpq/opportunities \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"opportunityName": "Enterprise Deal - Q2",
"closeDate": "2025-06-30",
"stage": "Prospecting",
"accountId": "001D000000IRFmaIAH"
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"opportunityName": "Enterprise Deal - Q2",
"closeDate": "2025-06-30",
"stage": "Prospecting",
"accountId": "001D000000IRFmaIAH"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.nue.io/cpq/opportunities", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.nue.io/cpq/opportunities")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"opportunityName": "Enterprise Deal - Q2",
"closeDate": "2025-06-30",
"stage": "Prospecting",
"accountId": "001D000000IRFmaIAH"
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.nue.io/cpq/opportunities"
payload = json.dumps({
"opportunityName": "Enterprise Deal - Q2",
"closeDate": "2025-06-30",
"stage": "Prospecting",
"accountId": "001D000000IRFmaIAH"
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
201
// Opportunity created successfully
{
"id": "006D000000IqhSLIAZ",
"opportunityName": "",
"closeDate": "",
"stage": "",
"salesforceUrl": ""
}400
// Bad Request - Invalid input or business validation failure
401
// Unauthorized - Invalid or missing API key