Contents
On this page
Delete Opportunity - Plugixa CRM
DELETE /plugixa-crm/v1/opportunities/{id}
Move a opportunity to the trash. It can be brought back with Restore Opportunity or removed for good with Purge Opportunity.
Any user with access to Plugixa CRM. With Plugixa CRM Pro roles, the user’s role must also allow deleting this opportunity.
Moving to the trash is a delete for everything listening. The
opportunity.deletedwebhook event PRO fires now, not on purge.
Request
DELETE https://your-site.example/wp-json/plugixa-crm/v1/opportunities/24
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The opportunity’s id |
Responses
200 OK. The opportunity is in the trash.
{
"success": true,
"data": {
"trashed": true
}
}
| Field | Type | Meaning |
|---|---|---|
data.trashed |
boolean |
Always true |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_crm_not_found |
No opportunity with that id, or it is already in the trash. |
Plus the errors every endpoint can return.
Examples
curl -s -X DELETE "https://your-site.example/wp-json/plugixa-crm/v1/opportunities/24" \
-u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-crm/v1/opportunities/24');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`);
const response = await fetch('https://your-site.example/wp-json/plugixa-crm/v1/opportunities/24', {
method: 'DELETE',
headers: {
'Authorization': auth,
},
});
const { data } = await response.json();
Quick Links
Share