Benefits
Delete Benefit
Delete a benefit.
[!WARNING] Every grants associated with the benefit will be revoked. Users will lose access to the benefit.
Scopes: benefits:write
DELETE
/
v1
/
benefits
/
{id}
Go (SDK)
package main
import(
"context"
"os"
polargo "github.com/polarsource/polar-go"
"log"
)
func main() {
ctx := context.Background()
s := polargo.New(
polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
)
res, err := s.Benefits.Delete(ctx, "<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.benefits.delete(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.benefits.delete({
id: "<value>",
});
}
run();declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
$sdk = Polar\Polar::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$response = $sdk->benefits->delete(
id: '<value>'
);
if ($response->statusCode === 200) {
// handle response
}curl --request DELETE \
--url https://api.polar.sh/v1/benefits/{id} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.polar.sh/v1/benefits/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.delete("https://api.polar.sh/v1/benefits/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polar.sh/v1/benefits/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"error": "<string>",
"detail": "<string>"
}{
"error": "<string>",
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Was this page helpful?
⌘I
Go (SDK)
package main
import(
"context"
"os"
polargo "github.com/polarsource/polar-go"
"log"
)
func main() {
ctx := context.Background()
s := polargo.New(
polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
)
res, err := s.Benefits.Delete(ctx, "<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.benefits.delete(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.benefits.delete({
id: "<value>",
});
}
run();declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
$sdk = Polar\Polar::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$response = $sdk->benefits->delete(
id: '<value>'
);
if ($response->statusCode === 200) {
// handle response
}curl --request DELETE \
--url https://api.polar.sh/v1/benefits/{id} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.polar.sh/v1/benefits/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.delete("https://api.polar.sh/v1/benefits/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polar.sh/v1/benefits/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"error": "<string>",
"detail": "<string>"
}{
"error": "<string>",
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}
