Zum Hauptinhalt springen
DELETE
/
api
/
plans
/
{id}
Delete or archive a plan
curl --request DELETE \
  --url https://coreapi.io/api/plans/{id} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://coreapi.io/api/plans/{id}"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.text)
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

fetch('https://coreapi.io/api/plans/{id}', 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://coreapi.io/api/plans/{id}",
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;
}
{
  "status": "archived",
  "references": {
    "checkoutLinks": 123,
    "subscriptions": 123,
    "schedules": 123
  }
}
{
"status": 404,
"type": "PLAN__NOT_FOUND",
"title": "An error occurred",
"detail": "Plan not found."
}
{
"status": 404,
"type": "PLAN__NOT_FOUND",
"title": "An error occurred",
"detail": "Plan not found."
}
{
"status": 404,
"type": "PLAN__NOT_FOUND",
"title": "An error occurred",
"detail": "Plan not found."
}

Autorisierungen

Authorization
string
header
erforderlich

Organisation API token. Send it as Authorization: Bearer api_... The token is scoped to a single Organisation.

Pfadparameter

id
string<uuid>
erforderlich

The plan UUID.

Beispiel:

"1280792f-4e23-793d-8e9c-3a1bf36630bd"

Antwort

The plan was archived because it is still referenced.

Returned with status 200 when a plan could not be hard deleted because it is still referenced, and was archived instead.

status
enum<string>
Verfügbare Optionen:
archived
references
object