Licenses

A license is a unique code that a customer can use to access the member portal. Licenses can be purchased or manually created through the admin dashboard or API.

get
Get License

https://api.metalabs.io/v2/licenses/:license
This endpoint allows you to fetch information about a specified license.
Request
Response
Request
Path Parameters
license
required
string
License ID or key
Headers
Authorization
required
string
Your Meta Labs API key, preceded by "Basic"
Response
200: OK
License successfully retrieved.
{
"id": "g2cx1Fp1F",
"key": "1HFX-FCMH-ISYQ-K1RX",
"created": 1588872117684,
"plan": {
"id":
"price": "price_1HRQtzJDDtxs0PqrBwa7gsXD",
"roles": ["689221522468110379"],
"recurring": {
"interval": "month",
"interval_count": 1
}
"name": "Monthly",
"amount": 1000,
"type": "recurring",
"currency": "usd"
},
"member": {
"email": "ben@metalabs.io",
"discord": {
"id": "409443509163130880",
"tag": "Stray Dog#0001",
"username": "Stray Dog",
"discriminator": "0001",
"avatar": null
}
},
"customer": "cus_HEgnL2DvYSKnnE",
"payment_method": "pm_1GgDPyLTrosAq6ebT1dCGDmD",
"subscription": "sub_HEgnhG85a0rw4d",
"metadata": {}
}

patch
Update License

https://api.metalabs.io/v2/licenses/:license
Updates the specified license by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a license’s key, or plan.
Request
Response
Request
Path Parameters
license
required
string
License ID or key
Headers
Authorization
required
string
Your Meta Labs API key, preceded by "Basic"
Body Parameters
metadata
optional
object
Set of key-value pairs that you can attach to a license. This can be useful for storing additional information about the license in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.
Response
200: OK
The updated license object is returned upon success. Otherwise, this call throws an error.{
{
"id": "g2cx1Fp1F",
"key": "1HFX-FCMH-ISYQ-K1RX",
"created": 1588872117684,
"plan": {
"id":
"price": "price_1HRQtzJDDtxs0PqrBwa7gsXD",
"roles": ["689221522468110379"],
"recurring": {
"interval": "month",
"interval_count": 1
}
"name": "Monthly",
"amount": 1000,
"type": "recurring",
"currency": "usd"
},
"member": {
"email": "ben@metalabs.io",
"discord": {
"id": "409443509163130880",
"tag": "Stray Dog#0001",
"username": "Stray Dog",
"discriminator": "0001",
"avatar": null
}
},
"customer": "cus_HEgnL2DvYSKnnE",
"payment_method": "pm_1GgDPyLTrosAq6ebT1dCGDmD",
"subscription": "sub_HEgnhG85a0rw4d",
"metadata": {
"hardware_id": "1FE32809-FF74-5B25-9163-A61754C6054F"
}
}