Back to Rest API

Get Key

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

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:

{
"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:

ParameterDescription
idThe unique identifier for the keys.
keyThe keys which is created.
valid_forDuration or validity period of the keys.
activation_limitMaximum number of times the keys can be activated.
activation_countNumber of times the key has been 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.
order_item_idThe unique identifier for a specific item within an 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.
pricePrice of the keys.
ordered_atDate and time when the key was ordered.
statusThe email address associated with the keys.
created_atCurrent status of the keys (e.g., active, available).
uuidIt is a unique id.
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.
updated_atDate and time when the key was last updated.

Related Docs

Scroll to Top