The WC Key Manager plugin provides a REST API endpoint that allows you to retrieve and display key demands on the key ID, along with detailed information.To access this data, you can use the GET 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:
{
"id": 3,
"key": "PYPM-SW3U-Q93F-NMOU",
"product_id": 71,
"order_id": 108,
"order_item_id": 2,
"subscription_id": 0,
"vendor_id": 0,
"customer_id": 1,
"price": 2,
"source": "preset",
"status": "sold",
"valid_for": 0,
"uuid": "8a28f7ca-3168-49a8-8a97-365abf938661",
"activation_limit": 0,
"activation_count": 0,
"ordered_at": "2024-07-14 10:46:18",
"expires_at": null,
"created_at": "2024-07-14 10:46:18",
"updated_at": "2024-07-14 10:46:19"
}
Fields in API Response:
Parameter | Description |
---|---|
id | The unique identifier for the keys. |
key | The keys which is created. |
valid_for | Duration or validity period of the keys. |
activation_limit | Maximum number of times the keys can be activated. |
activation_count | Number of times the key has been 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. |
order_item_id | The unique identifier for a specific item within an 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. |
price | Price of the keys. |
ordered_at | Date and time when the key was ordered. |
status | The email address associated with the keys. |
created_at | Current status of the keys (e.g., active, available). |
uuid | It is a unique id. |
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. |
updated_at | Date and time when the key was last updated. |