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
Parameter | Description |
---|---|
consumer_key | The corresponding secret key is used for authentication with the WooCommerce API. |
consumer_secret | The corresponding secret key is used for authentication with the WooCommerce API. |
id | The 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:
Parameter | Description |
---|---|
deleted | If the key is deleted successfully then you will see true for this. This indicates the status of delete keys. |
key | The keys which is created. |
activation_limit | Maximum number of times the keys can be activated. |
product_id | The unique identifier for a specific product in WooCommerce. |
customer_id | The unique identifier for a specific customer in WooCommerce. |
order_id | The unique identifier for a specific order in WooCommerce. |
subscription_id | The unique identifier for a specific subscription in WooCommerce. |
vendor_id | The 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. |
email | The email address associated with the keys. |
source | The 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. |