Update an opportunity
client.opportunity.update(stringid, OpportunityUpdateParams { fields, relationships } body, RequestOptionsoptions?): OpportunityUpdateResponse { id, createdAt, fields, 4 more }
POST/v1/opportunities/{id}
Updates an existing opportunity by ID. Only included fields and relationships are modified.
The $opportunityStatus field is read-only and cannot be updated. 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:update
Rate limit category: Write
Parameters
id: string
Unique identifier of the opportunity to update.
Returns
Update an opportunity
import Lightfield from 'lightfield';
const client = new Lightfield({
apiKey: 'My API Key',
});
const opportunityUpdateResponse = await client.opportunity.update('id');
console.log(opportunityUpdateResponse.id);{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}Returns Examples
{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}