Zum Hauptinhalt springen
DELETE
/
products
/
{id}
JavaScript
import DodoPayments from 'dodopayments';

const client = new DodoPayments({
  bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});

await client.products.archive('pdt_R8AWMPiV8RyJElcCKvAID');
import os
from dodopayments import DodoPayments

client = DodoPayments(
    bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"),  # This is the default and can be omitted
)
client.products.archive(
    "pdt_R8AWMPiV8RyJElcCKvAID",
)
package main

import (
	"context"

	"github.com/dodopayments/dodopayments-go"
	"github.com/dodopayments/dodopayments-go/option"
)

func main() {
	client := dodopayments.NewClient(
		option.WithBearerToken("My Bearer Token"),
	)
	err := client.Products.Archive(context.TODO(), "pdt_R8AWMPiV8RyJElcCKvAID")
	if err != nil {
		panic(err.Error())
	}
}
package com.dodopayments.api.example;

import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.products.ProductArchiveParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();

        client.products().archive("pdt_R8AWMPiV8RyJElcCKvAID");
    }
}
package com.dodopayments.api.example

import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.products.ProductArchiveParams

fun main() {
    val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()

    client.products().archive("pdt_R8AWMPiV8RyJElcCKvAID")
}
require "dodopayments"

dodo_payments = Dodopayments::Client.new(
  bearer_token: "My Bearer Token",
  environment: "test_mode" # defaults to "live_mode"
)

result = dodo_payments.products.archive("pdt_R8AWMPiV8RyJElcCKvAID")

puts(result)
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Dodopayments\Client;
use Dodopayments\Core\Exceptions\APIException;

$client = new Client(
  bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
  environment: 'test_mode',
);

try {
  $result = $client->products->archive('pdt_R8AWMPiV8RyJElcCKvAID');

  var_dump($result);
} catch (APIException $e) {
  echo $e->getMessage();
}
using DodoPayments.Client;
using DodoPayments.Client.Models.Products;

DodoPaymentsClient client = new();

ProductArchiveParams parameters = new() { ID = "pdt_R8AWMPiV8RyJElcCKvAID" };

await client.Products.Archive(parameters);
use dodopayments::Client;

#[tokio::main]
async fn main() -> dodopayments::Result<()> {
    let client = Client::from_env()?;
    let id = "id";
    let result = client
        .products()
        .archive()
        .id(id)
        .await?;
    println!("{result:?}");
    Ok(())
}
curl --request DELETE \
  --url https://test.dodopayments.com/products/{id} \
  --header 'Authorization: Bearer <token>'

Autorisierungen

Authorization
string
header
erforderlich

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Pfadparameter

id
string
erforderlich

Product Id

Antwort

Product Delected Successfully

Zuletzt geändert am 28. Mai 2026