License Keys
Deactivate License Key
Deactivate a license key instance.
This endpoint doesn’t require authentication and can be safely used on a public client, like a desktop application or a mobile app. If you plan to validate a license key on a server, use the
/v1/license-keys/deactivateendpoint instead.
POST
/
v1
/
customer-portal
/
license-keys
/
deactivate
Go (SDK)
package main
import(
"context"
polargo "github.com/polarsource/polar-go"
"github.com/polarsource/polar-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := polargo.New()
res, err := s.CustomerPortal.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() as polar:
polar.customer_portal.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();
async function run() {
await polar.customerPortal.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()->build();
$request = new Components\LicenseKeyDeactivate(
key: '<key>',
organizationId: '<value>',
activationId: '<value>',
);
$response = $sdk->customerPortal->licenseKeys->deactivate(
request: $request
);
if ($response->statusCode === 200) {
// handle response
}curl --request POST \
--url https://api.polar.sh/v1/customer-portal/license-keys/deactivate \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"organization_id": "<string>",
"activation_id": "<string>"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({key: '<string>', organization_id: '<string>', activation_id: '<string>'})
};
fetch('https://api.polar.sh/v1/customer-portal/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/customer-portal/license-keys/deactivate")
.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/customer-portal/license-keys/deactivate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
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
Get License KeyGet a license key.
**Scopes**: `customer_portal:read` `customer_portal:write`
Next
⌘I
Go (SDK)
package main
import(
"context"
polargo "github.com/polarsource/polar-go"
"github.com/polarsource/polar-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := polargo.New()
res, err := s.CustomerPortal.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() as polar:
polar.customer_portal.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();
async function run() {
await polar.customerPortal.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()->build();
$request = new Components\LicenseKeyDeactivate(
key: '<key>',
organizationId: '<value>',
activationId: '<value>',
);
$response = $sdk->customerPortal->licenseKeys->deactivate(
request: $request
);
if ($response->statusCode === 200) {
// handle response
}curl --request POST \
--url https://api.polar.sh/v1/customer-portal/license-keys/deactivate \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"organization_id": "<string>",
"activation_id": "<string>"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({key: '<string>', organization_id: '<string>', activation_id: '<string>'})
};
fetch('https://api.polar.sh/v1/customer-portal/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/customer-portal/license-keys/deactivate")
.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/customer-portal/license-keys/deactivate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
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": {}
}
]
}
