Skip to content

GET /api/v3/objects/{lcuid}/can-be-deleted

Summary

GET /objects/{id}/can-be-deleted

Description

Determine if an object can be deleted. Call this method prior to calling the DELETE method to make sure there are not any outstanding reasons why you cannot delete this object.

This example uses an account object. The response will vary depending on the class of the object.

If the response field can_be_deleted : true then a call to DELETE should succeed.

Tags: objects

Parameters

Header Parameters

Name Type Required Description Example
Authorization string ✓ Yes Bearer {AuthToken}
Content-Type string ✓ Yes application/json
Accept string ✓ Yes application/json
AppIdV3 string ✓ Yes LCUID-LAP-********-****-****-****-************

Responses

Response: 200

Content Type: application/json

Schema

Type: object

Properties:

  • success (boolean): The request succeeded
  • can_be_deleted (boolean): The object can be deleted
  • what_else_will_be_deleted (object) Type: object

Properties:

  • comments (integer)
  • inventory_items (integer)
  • locations (integer)
  • inventory_exports (integer)
  • inventory_feeds (integer)

  • reasons (array): An array of reasons why the object cannot be deleted (if any)

Example Response
{
    "success": true,
    "can_be_deleted": true,
    "what_else_will_be_deleted": {
        "comments": 0,
        "inventory_items": 0,
        "locations": 0,
        "inventory_exports": 0,
        "inventory_feeds": 0
    },
    "reasons": []
}

Example Implementations

Bash (cURL)

curl --request GET \
    --get "https://api.lucit.app/api/v3/objects/LCUID-LA-506fc585-77be-11ec-acb9-c2cdb617d190/can-be-deleted" \
    --header "Authorization: Bearer {AuthToken}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "AppIdV3: LCUID-LAP-********-****-****-****-************"

JavaScript (Fetch API)

const url = new URL(
    "https://api.lucit.app/api/v3/objects/LCUID-LA-506fc585-77be-11ec-acb9-c2cdb617d190/can-be-deleted"
);

const headers = {
    "Authorization": "Bearer {AuthToken}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "AppIdV3": "LCUID-LAP-********-****-****-****-************",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

PHP (Guzzle)

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.lucit.app/api/v3/objects/LCUID-LA-506fc585-77be-11ec-acb9-c2cdb617d190/can-be-deleted',
    [
        'headers' => [
            'Authorization' => 'Bearer {AuthToken}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'AppIdV3' => 'LCUID-LAP-********-****-****-****-************',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Python (Requests)

import requests
import json

url = 'https://api.lucit.app/api/v3/objects/LCUID-LA-506fc585-77be-11ec-acb9-c2cdb617d190/can-be-deleted'
headers = {
  'Authorization': 'Bearer {AuthToken}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'AppIdV3': 'LCUID-LAP-********-****-****-****-************'
}

response = requests.request('GET', url, headers=headers)
response.json()

← Back to objects index | Back to main index