Get License Key

Retrieve the details of a specific license key by its ID.

Request

use dodopayments_rust::{to_pretty_json, DodoPaymentsClientBuilder};

#[tokio::main]

async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let api_key = std::env::var("DODO_API_KEY")?;

    let client = DodoPaymentsClientBuilder::new()
        .bearer_token(&api_key)
        .enviroment("test_mode")
        .build()?;

    let license_key_id = "lic_xxxxxxxxxx";

    let resp = client
        .licenses()
        .license_keys()
        .id(license_key_id)
        .retrieve()
        .send()
        .await?;

    println!("{}", to_pretty_json(&resp)?);

    Ok(())
}

Path Parameters

ParameterTypeDescription
idstringLicense key ID

Responses

200 Status

FieldTypeDescription
activations_limitobjectThe maximum number of activations allowed for this license key.
business_idstringThe unique identifier of the business associated with the license key.
created_atstringThe timestamp indicating when the license key was created, in UTC.
customer_idstringThe unique identifier of the customer associated with the license key.
expires_atobjectThe timestamp indicating when the license key expires, in UTC.
idstringThe unique identifier of the license key.
instances_countintegerThe current number of instances activated for this license key.
keystringThe license key string.
payment_idstringThe unique identifier of the payment associated with the license key.
product_idstringThe unique identifier of the product associated with the license key.
statusLicenseKeyStatusThe current status of the license key (e.g., active, inactive, expired).
subscription_idobjectThe unique identifier of the subscription associated with the license key, if any.

License key found

404 Status

License key not found

500 Status

Something went wrong :(