Disassociate an Opportunity from its Deal
curl --request DELETE \
--url https://public-api.stora.co/2025-09/opportunities/{opportunity_id}/associate_deal \
--header 'Authorization: Bearer <token>'import requests
url = "https://public-api.stora.co/2025-09/opportunities/{opportunity_id}/associate_deal"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://public-api.stora.co/2025-09/opportunities/{opportunity_id}/associate_deal', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://public-api.stora.co/2025-09/opportunities/{opportunity_id}/associate_deal",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://public-api.stora.co/2025-09/opportunities/{opportunity_id}/associate_deal"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://public-api.stora.co/2025-09/opportunities/{opportunity_id}/associate_deal")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.stora.co/2025-09/opportunities/{opportunity_id}/associate_deal")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"opportunity": {
"id": "opp_127b3057d5df338e",
"archived_at": null,
"associated_at": null,
"contact": {
"id": "con_1234567890abcdef"
},
"created_at": "2025-02-22T14:41:00Z",
"creator": {
"id": "tok_7f6e5fb4bb548dbc"
},
"deal": null,
"line_items": [],
"metadata": {},
"site": {
"id": "site_14b419f1096013f1"
},
"source": "public_api",
"status": "open",
"updated_at": "2025-02-22T14:41:00Z"
},
"meta": {
"request_id": "01563646-58c1-4607-8fe0-cae3e92c4477",
"curies": [
{
"name": "bo",
"href": "https://app.stora.test{rel}",
"templated": true,
"title": "Backoffice"
},
{
"name": "sf",
"href": "https://acme.stora.test{rel}",
"templated": true,
"title": "Storefront"
}
]
}
}{
"error": {
"code": "resource_not_found",
"details": [],
"links": [
{
"kind": "api_reference",
"name": "Disassociate an Opportunity from its Deal",
"url": "https://docs.stora.test/2025-09/api-reference/opportunities/disassociate-an-opportunity-from-its-deal"
},
{
"kind": "documentation",
"name": "Opportunities and deals",
"url": "https://docs.stora.test/2025-09/guides/opportunities-and-deals"
},
{
"kind": "open_api",
"name": "OpenAPI specification",
"url": "https://docs.stora.test/2025-09/openapi.json"
},
{
"kind": "documentation",
"name": "Errors",
"url": "https://docs.stora.test/2025-09/guides/errors#resource_not_found"
}
],
"message": "The Opportunity was not found.",
"request_id": "01563646-58c1-4607-8fe0-cae3e92c4477",
"type": "invalid_request_error"
}
}{
"error": {
"code": "opportunity_not_associated",
"details": [],
"links": [
{
"kind": "api_reference",
"name": "Disassociate an Opportunity from its Deal",
"url": "https://docs.stora.test/2025-09/api-reference/opportunities/disassociate-an-opportunity-from-its-deal"
},
{
"kind": "documentation",
"name": "Opportunities and deals",
"url": "https://docs.stora.test/2025-09/guides/opportunities-and-deals"
},
{
"kind": "open_api",
"name": "OpenAPI specification",
"url": "https://docs.stora.test/2025-09/openapi.json"
},
{
"kind": "documentation",
"name": "Errors",
"url": "https://docs.stora.test/2025-09/guides/errors#opportunity_not_associated"
}
],
"message": "The opportunity is not associated with a deal.",
"request_id": "01563646-58c1-4607-8fe0-cae3e92c4477",
"type": "invalid_request_error"
}
}{
"error": {
"code": "invalid_url_param",
"details": [
{
"message": "value `invalid` at `/opportunity_id` does not match pattern: ^opp_",
"pointer": "/opportunity_id"
}
],
"links": [
{
"kind": "api_reference",
"name": "Disassociate an Opportunity from its Deal",
"url": "https://docs.stora.test/2025-09/api-reference/opportunities/disassociate-an-opportunity-from-its-deal"
},
{
"kind": "documentation",
"name": "Opportunities and deals",
"url": "https://docs.stora.test/2025-09/guides/opportunities-and-deals"
},
{
"kind": "open_api",
"name": "OpenAPI specification",
"url": "https://docs.stora.test/2025-09/openapi.json"
},
{
"kind": "documentation",
"name": "Errors",
"url": "https://docs.stora.test/2025-09/guides/errors#invalid_url_param"
}
],
"message": "The request URL param is invalid.",
"request_id": "01563646-58c1-4607-8fe0-cae3e92c4477",
"type": "invalid_request_error"
}
}Opportunities
Disassociate an Opportunity from its Deal
Remove the association between an opportunity and its deal, so you can associate it with another deal or create a new deal from it. The opportunity returns to open, or to archived if it was archived while associated. The deal isn’t changed.
See Capture and qualify leads.
Required authorization scopes: public.opportunity:write, public.deal:write
DELETE
/
2025-09
/
opportunities
/
{opportunity_id}
/
associate_deal
Disassociate an Opportunity from its Deal
curl --request DELETE \
--url https://public-api.stora.co/2025-09/opportunities/{opportunity_id}/associate_deal \
--header 'Authorization: Bearer <token>'import requests
url = "https://public-api.stora.co/2025-09/opportunities/{opportunity_id}/associate_deal"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://public-api.stora.co/2025-09/opportunities/{opportunity_id}/associate_deal', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://public-api.stora.co/2025-09/opportunities/{opportunity_id}/associate_deal",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://public-api.stora.co/2025-09/opportunities/{opportunity_id}/associate_deal"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://public-api.stora.co/2025-09/opportunities/{opportunity_id}/associate_deal")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.stora.co/2025-09/opportunities/{opportunity_id}/associate_deal")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"opportunity": {
"id": "opp_127b3057d5df338e",
"archived_at": null,
"associated_at": null,
"contact": {
"id": "con_1234567890abcdef"
},
"created_at": "2025-02-22T14:41:00Z",
"creator": {
"id": "tok_7f6e5fb4bb548dbc"
},
"deal": null,
"line_items": [],
"metadata": {},
"site": {
"id": "site_14b419f1096013f1"
},
"source": "public_api",
"status": "open",
"updated_at": "2025-02-22T14:41:00Z"
},
"meta": {
"request_id": "01563646-58c1-4607-8fe0-cae3e92c4477",
"curies": [
{
"name": "bo",
"href": "https://app.stora.test{rel}",
"templated": true,
"title": "Backoffice"
},
{
"name": "sf",
"href": "https://acme.stora.test{rel}",
"templated": true,
"title": "Storefront"
}
]
}
}{
"error": {
"code": "resource_not_found",
"details": [],
"links": [
{
"kind": "api_reference",
"name": "Disassociate an Opportunity from its Deal",
"url": "https://docs.stora.test/2025-09/api-reference/opportunities/disassociate-an-opportunity-from-its-deal"
},
{
"kind": "documentation",
"name": "Opportunities and deals",
"url": "https://docs.stora.test/2025-09/guides/opportunities-and-deals"
},
{
"kind": "open_api",
"name": "OpenAPI specification",
"url": "https://docs.stora.test/2025-09/openapi.json"
},
{
"kind": "documentation",
"name": "Errors",
"url": "https://docs.stora.test/2025-09/guides/errors#resource_not_found"
}
],
"message": "The Opportunity was not found.",
"request_id": "01563646-58c1-4607-8fe0-cae3e92c4477",
"type": "invalid_request_error"
}
}{
"error": {
"code": "opportunity_not_associated",
"details": [],
"links": [
{
"kind": "api_reference",
"name": "Disassociate an Opportunity from its Deal",
"url": "https://docs.stora.test/2025-09/api-reference/opportunities/disassociate-an-opportunity-from-its-deal"
},
{
"kind": "documentation",
"name": "Opportunities and deals",
"url": "https://docs.stora.test/2025-09/guides/opportunities-and-deals"
},
{
"kind": "open_api",
"name": "OpenAPI specification",
"url": "https://docs.stora.test/2025-09/openapi.json"
},
{
"kind": "documentation",
"name": "Errors",
"url": "https://docs.stora.test/2025-09/guides/errors#opportunity_not_associated"
}
],
"message": "The opportunity is not associated with a deal.",
"request_id": "01563646-58c1-4607-8fe0-cae3e92c4477",
"type": "invalid_request_error"
}
}{
"error": {
"code": "invalid_url_param",
"details": [
{
"message": "value `invalid` at `/opportunity_id` does not match pattern: ^opp_",
"pointer": "/opportunity_id"
}
],
"links": [
{
"kind": "api_reference",
"name": "Disassociate an Opportunity from its Deal",
"url": "https://docs.stora.test/2025-09/api-reference/opportunities/disassociate-an-opportunity-from-its-deal"
},
{
"kind": "documentation",
"name": "Opportunities and deals",
"url": "https://docs.stora.test/2025-09/guides/opportunities-and-deals"
},
{
"kind": "open_api",
"name": "OpenAPI specification",
"url": "https://docs.stora.test/2025-09/openapi.json"
},
{
"kind": "documentation",
"name": "Errors",
"url": "https://docs.stora.test/2025-09/guides/errors#invalid_url_param"
}
],
"message": "The request URL param is invalid.",
"request_id": "01563646-58c1-4607-8fe0-cae3e92c4477",
"type": "invalid_request_error"
}
}Scopes
Query Parameters
This endpoint supports expandable responses. For more, see the documentation page.
Returns only the listed fields, such as id,status,site.name. Identifiers and constant fields such as object are always returned. A field inside an expandable association also needs it in expand, unless the collapsed association returns it, such as site.id. For more, see the documentation page.
Was this page helpful?