License Keys
Deactivate License Key
Deactivate a license key instance.
Scopes: license_keys:write
POST
/
v1
/
license-keys
/
deactivate
Go (SDK)
package main
import(
"context"
"os"
polargo "github.com/polarsource/polar-go"
"github.com/polarsource/polar-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := polargo.New(
polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
)
res, err := s.LicenseKeys.Deactivate(ctx, components.LicenseKeyDeactivate{
Key: "<key>",
OrganizationID: "<value>",
ActivationID: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}from polar_sdk import Polar
with Polar(
access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:
polar.license_keys.deactivate(request={
"key": "<key>",
"organization_id": "<value>",
"activation_id": "<value>",
})
# Use the SDK ...import { Polar } from "@polar-sh/sdk";
const polar = new Polar({
accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
});
async function run() {
await polar.licenseKeys.deactivate({
key: "<key>",
organizationId: "<value>",
activationId: "<value>",
});
}
run();declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
use Polar\Models\Components;
$sdk = Polar\Polar::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$request = new Components\LicenseKeyDeactivate(
key: '<key>',
organizationId: '<value>',
activationId: '<value>',
);
$response = $sdk->licenseKeys->deactivate(
request: $request
);
if ($response->statusCode === 200) {
// handle response
}curl --request POST \
--url https://api.polar.sh/v1/license-keys/deactivate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"organization_id": "<string>",
"activation_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({key: '<string>', organization_id: '<string>', activation_id: '<string>'})
};
fetch('https://api.polar.sh/v1/license-keys/deactivate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.polar.sh/v1/license-keys/deactivate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"<string>\",\n \"organization_id\": \"<string>\",\n \"activation_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polar.sh/v1/license-keys/deactivate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"key\": \"<string>\",\n \"organization_id\": \"<string>\",\n \"activation_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Was this page helpful?
Previous
List MembersList members with optional customer ID filter.
**Scopes**: `members:read` `members:write`
Next
⌘I
Go (SDK)
package main
import(
"context"
"os"
polargo "github.com/polarsource/polar-go"
"github.com/polarsource/polar-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := polargo.New(
polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
)
res, err := s.LicenseKeys.Deactivate(ctx, components.LicenseKeyDeactivate{
Key: "<key>",
OrganizationID: "<value>",
ActivationID: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}from polar_sdk import Polar
with Polar(
access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:
polar.license_keys.deactivate(request={
"key": "<key>",
"organization_id": "<value>",
"activation_id": "<value>",
})
# Use the SDK ...import { Polar } from "@polar-sh/sdk";
const polar = new Polar({
accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
});
async function run() {
await polar.licenseKeys.deactivate({
key: "<key>",
organizationId: "<value>",
activationId: "<value>",
});
}
run();declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
use Polar\Models\Components;
$sdk = Polar\Polar::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$request = new Components\LicenseKeyDeactivate(
key: '<key>',
organizationId: '<value>',
activationId: '<value>',
);
$response = $sdk->licenseKeys->deactivate(
request: $request
);
if ($response->statusCode === 200) {
// handle response
}curl --request POST \
--url https://api.polar.sh/v1/license-keys/deactivate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"organization_id": "<string>",
"activation_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({key: '<string>', organization_id: '<string>', activation_id: '<string>'})
};
fetch('https://api.polar.sh/v1/license-keys/deactivate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.polar.sh/v1/license-keys/deactivate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"<string>\",\n \"organization_id\": \"<string>\",\n \"activation_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polar.sh/v1/license-keys/deactivate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"key\": \"<string>\",\n \"organization_id\": \"<string>\",\n \"activation_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}
