Create an opportunity
opportunity.create(OpportunityCreateParams**kwargs) -> OpportunityCreateResponse
POST/v1/opportunities
Creates a new opportunity record. The $name and $stage fields and the $account relationship are required.
After creation, Lightfield automatically generates an opportunity summary in the background. The $opportunityStatus field is read-only and cannot be set via the API. The $task and $note relationships are also read-only — manage them via the $opportunity relationship on the task, or the $account/$opportunity note relationships instead.
Supports idempotency via the Idempotency-Key header.
Required scope: opportunities:create
Rate limit category: Write
Parameters
Returns
Create an opportunity
from lightfield import Lightfield
client = Lightfield(
api_key="My API Key",
)
opportunity_create_response = client.opportunity.create(
fields={
"foo": "string"
},
relationships={
"foo": "string"
},
)
print(opportunity_create_response.id){
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
}
}Returns Examples
{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
}
}