cURL
curl -X DELETE \
/customers/{id} \
--header "Authorization: Bearer <token>"import requests
url = "https://coreapi.io/customers/{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/customers/{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/customers/{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;
}{
"type": "https://tools.ietf.org/html/rfc2616#section-10",
"detail": "The customer could not be deleted due missing preconditions.",
"violations": [
{
"propertyPath": "",
"message": "The customer has active invoices.",
"code": "customer_has_invoices"
}
]
}{
"message": "Customer deletion failed",
"code": "customer_deletion_error"
}Customer
Delete customer
Deletes a customer. The customer can only be deleted if there are no invoices, active subscriptions or booked payments related to this customer. Otherwise you can only archive the customer.
Required permissions:customer:writeDELETE
/
customers
/
{id}
cURL
curl -X DELETE \
/customers/{id} \
--header "Authorization: Bearer <token>"import requests
url = "https://coreapi.io/customers/{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/customers/{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/customers/{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;
}{
"type": "https://tools.ietf.org/html/rfc2616#section-10",
"detail": "The customer could not be deleted due missing preconditions.",
"violations": [
{
"propertyPath": "",
"message": "The customer has active invoices.",
"code": "customer_has_invoices"
}
]
}{
"message": "Customer deletion failed",
"code": "customer_deletion_error"
}War diese Seite hilfreich?