Merge two opportunities
client.Merge.MergeOpportunities(ctx, body) (*MergeMergeOpportunitiesResponse, error)
POST/v1/opportunities/merge
Merges two opportunities into one. The primary opportunity retains its ID; the duplicate is soft-deleted. Both opportunities must belong to the same account.
Required scopes: opportunities:update + opportunities:delete
Rate limit category: Write
Merge two opportunities
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"),
)
mergeMergeOpportunitiesResponse, err := client.Merge.MergeOpportunities(context.TODO(), githubcomlightfldlightfieldgo.MergeMergeOpportunitiesParams{
DuplicateID: "duplicateId",
PrimaryID: "primaryId",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", mergeMergeOpportunitiesResponse.Merge)
}
{
"merge": {
"id": "id",
"status": "status"
},
"primary": {
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
},
"summary": {
"fieldWriteCount": -9007199254740991,
"syncRepointedCount": -9007199254740991,
"warnings": [
"string"
]
}
}Returns Examples
{
"merge": {
"id": "id",
"status": "status"
},
"primary": {
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
},
"summary": {
"fieldWriteCount": -9007199254740991,
"syncRepointedCount": -9007199254740991,
"warnings": [
"string"
]
}
}