You need to sign in to do that
Don't have an account?

Creating an opportunity using Rest API
Using the following call and JSON data I have been trying to Create a new opportunity attached to an account. Headers/Call are correct as I've been able to create Leads/Accounts. Something with the JSON is wrong but i'm not sure what it is.
/services/data/v53.0/sobjects/Opportunity
data={
'Name': "Test opportunity",
'Accountid': "XXXXXXXXXXXXX",
'closedate': "1/12/2021",
'stagename':"Needs Analysis",
'Probability': "10"
}
/services/data/v53.0/sobjects/Opportunity
data={
'Name': "Test opportunity",
'Accountid': "XXXXXXXXXXXXX",
'closedate': "1/12/2021",
'stagename':"Needs Analysis",
'Probability': "10"
}
All Answers
That worked, I believe the issue I was having was the format of the Date.
Another question, is there anyway to call the account with the actual name? For my script storing the IDs will be kind of a nightmare.