Back to Rest API

Delete Key

The WC Key Manager plugin provides a REST API endpoint that allows you to Delete the keys using key’s id, along with detailed information.To access this data, you can use the DELETE method with the endpoint ‘/keys’.

Here is an example of the API Call:

https://example.com/wp-json/wc/v1/keys/{id}/?consumer_key={{consumer_key}}&consumer_secret={{consumer_secret}}

Parameters

ParameterDescription
consumer_keyThe corresponding secret key is used for authentication with the WooCommerce API.
consumer_secretThe corresponding secret key is used for authentication with the WooCommerce API.
idThe unique identifier for a specific Key.

Example of API Response:

{
"deleted": true,
"previous": {
"key": "8CKW-QRLQ-FCD3-YA1X",
"product_id": 79,
"order_id": 107,
"order_item_id": 1,
"subscription_id": 0,
"vendor_id": 0,
"customer_id": 1,
"source": "preset",
"valid_for": 2,
"activation_limit": 1,
"expires_at": null
}
}

Fields in API Response:

ParameterDescription
deletedIf the key is deleted successfully then you will see true for this. This indicates the status of delete keys.
keyThe keys which is created.
activation_limitMaximum number of times the keys can be activated.
product_idThe unique identifier for a specific product in WooCommerce.
customer_idThe unique identifier for a specific customer in WooCommerce.
order_idThe unique identifier for a specific order in WooCommerce.
subscription_idThe unique identifier for a specific subscription in WooCommerce.
vendor_idThe unique identifier for a specific vendor in WooCommerce is especially relevant in a multi-vendor marketplace setup where different vendors sell products through the same WooCommerce store.
emailThe email address associated with the keys.
sourceThe unique identifier for a specific vendor in WooCommerce, is especially relevant in a multi-vendor marketplace setup where different vendors sell products through the same WooCommerce store.

Related Docs

Scroll to Top