novinzodevelopers
Your store's APIApps referenceLicenses

Update Variant

PUT/admin/variants/{variantId}/update

Turns license keys on for a product variant, or sets the terms of its licenses. validForMs is how long a license lasts from its sale, in milliseconds, and 0 means it never expires; maxUses is how many times its key may be activated, and 0 means unlimited. Licenses already sold keep the terms they were sold with. A "generated" keySource makes a key for each sale; a "supplied" one sells its keys, and either replaces the variant's unsold keys, so saving "generated" drops them. You never see those keys: the form keeps them, whereas with "review": "approval" this payload runs as it is and replaces them, so use the form for a variant whose keys the store supplies.

Path Parameters

variantId*string
Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

validForMs*integer
Range0 <= value <= 3153600000000
maxUses*integer
Range0 <= value <= 1000000
keySource*|

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/admin/variants/string/update" \  -H "Content-Type: application/json" \  -d '{    "validForMs": 0,    "maxUses": 0,    "keySource": {      "_tag": "generated"    }  }'
{  "outcome": "created"}