Delete an opportunity
client.Opportunity.Delete(ctx, id, body) (*OpportunityDeleteResponse, error)
DELETE/v1/opportunities/{id}
Moves an opportunity to the trash. The opportunity is soft-deleted and may be restored from the Lightfield UI. Associated tasks, notes, and meetings are not deleted.
Calling delete on an already-trashed opportunity is a no-op and returns the existing record.
Required scope: opportunities:delete
Rate limit category: Write
Delete 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"),
)
opportunityDeleteResponse, err := client.Opportunity.Delete(
context.TODO(),
"id",
githubcomlightfldlightfieldgo.OpportunityDeleteParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", opportunityDeleteResponse.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"
}