cURL
curl --request DELETE 'https://api.integrateledger.com/v1/add-ons/extra_credits' \
-H "Authorization: Bearer $LEDGER_API_KEY"import os
from ledger_sdk import Ledger
ledger = Ledger(api_key=os.environ["LEDGER_API_KEY"])
ledger.archive_add_on("extra_credits")import { Ledger } from "@ledger/sdk";
const ledger = new Ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await ledger.archiveAddOn({ id: "extra_credits" });const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.integrateledger.com/v1/add-ons/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.integrateledger.com/v1/add-ons/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.integrateledger.com/v1/add-ons/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.integrateledger.com/v1/add-ons/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.integrateledger.com/v1/add-ons/{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{
"archived": true
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Add-ons
Archive an add-on
Hide a credit pack from future purchases while retaining purchase history.
DELETE
/
v1
/
add-ons
/
{id}
cURL
curl --request DELETE 'https://api.integrateledger.com/v1/add-ons/extra_credits' \
-H "Authorization: Bearer $LEDGER_API_KEY"import os
from ledger_sdk import Ledger
ledger = Ledger(api_key=os.environ["LEDGER_API_KEY"])
ledger.archive_add_on("extra_credits")import { Ledger } from "@ledger/sdk";
const ledger = new Ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await ledger.archiveAddOn({ id: "extra_credits" });const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.integrateledger.com/v1/add-ons/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.integrateledger.com/v1/add-ons/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.integrateledger.com/v1/add-ons/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.integrateledger.com/v1/add-ons/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.integrateledger.com/v1/add-ons/{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{
"archived": true
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Archives the active credit pack with this stable
id and returns { "archived": true }. It disappears from List active add-ons and cannot start new Checkouts. Existing paid purchases and credit grants remain in customer history.
An already opened Checkout can still complete against its captured price and credit amount. An unknown or already archived ID returns 404 not_found. Creating an add-on with the same ID later reactivates that pack. See Catalog for the full lifecycle.