Update an opportunity
client.Opportunity.Update(ctx, id, body) (*OpportunityUpdateResponse, error)
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
Update an opportunity
package main
import (
"context"
"fmt"
"github.com/Lightfld/lightfield-go"
"github.com/Lightfld/lightfield-go/option"
)
func main() {
client := githubcomlightfldlightfieldgo.NewClient(
option.WithAPIKey("My API Key"),
)
opportunityUpdateResponse, err := client.Opportunity.Update(
context.TODO(),
"id",
githubcomlightfldlightfieldgo.OpportunityUpdateParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", 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"
}