Back to Rest API

Update Key

This API endpoint allows you to update the details of a specific key in the WC Key Manager. The key can be updated with new values such as valid_for, activation_limit, and the key value itself. To update this data, you can use the POST method with the endpoint.

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}}

Request Body

ParameterDescription
valid_forThe validity period of the key. Example: 2.
activation_limitThe maximum number of activations allowed. Example: 1.
keyThe actual key value. Example: WPXFt.

Response Body

{
"id": 2,
"key": "WPXFt",
"product_id": 79,
"order_id": 0,
"order_item_id": 0,
"subscription_id": 0,
"vendor_id": 0,
"customer_id": 0,
"source": "preset",
"status": "available",
"valid_for": 2,
"uuid": "d5962bb0-195e-41f7-9d9f-11da31ee791b",
"activation_limit": 1,
"activation_count": 0,
"ordered_at": null,
"expires_at": null,
"created_at": "2024-07-14 10:45:58",
"updated_at": null
}

Related Docs

Scroll to Top