curl --request DELETE \
--url https://api.paygentic.io/v0/subscriptions/{id}/adjustments/{adjustmentId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paygentic.io/v0/subscriptions/{id}/adjustments/{adjustmentId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paygentic.io/v0/subscriptions/{id}/adjustments/{adjustmentId}', 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.paygentic.io/v0/subscriptions/{id}/adjustments/{adjustmentId}",
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.paygentic.io/v0/subscriptions/{id}/adjustments/{adjustmentId}"
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.paygentic.io/v0/subscriptions/{id}/adjustments/{adjustmentId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/subscriptions/{id}/adjustments/{adjustmentId}")
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{
"object": "subscriptionAdjustment",
"id": "<string>",
"subscriptionId": "<string>",
"type": "percentageDiscount",
"percentageDiscount": "<string>",
"usageDiscount": "<string>",
"minimumQuantity": "<string>",
"maximumQuantity": "<string>",
"targetPriceIds": [
"<string>"
],
"effectiveFrom": "2023-11-07T05:31:56Z",
"effectiveTo": "2023-11-07T05:31:56Z",
"description": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Delete Adjustment
Stops an adjustment from applying to any period it has not already been billed on. An adjustment that has never reached an issued invoice is removed, and the response is 204. An adjustment that has already been billed on an issued invoice is RETRACTED instead: its effectiveTo moves to the end of the last period it was billed on, the adjustment still exists, and the response is 200 carrying it. Read a 200 as “shortened”, not as “removed”. No invoice changes either way: an issued invoice keeps its numbers, and a draft loses the adjustment only when its period is calculated again. Deleting the same adjustment again returns the same 200 and the same window.
curl --request DELETE \
--url https://api.paygentic.io/v0/subscriptions/{id}/adjustments/{adjustmentId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paygentic.io/v0/subscriptions/{id}/adjustments/{adjustmentId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paygentic.io/v0/subscriptions/{id}/adjustments/{adjustmentId}', 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.paygentic.io/v0/subscriptions/{id}/adjustments/{adjustmentId}",
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.paygentic.io/v0/subscriptions/{id}/adjustments/{adjustmentId}"
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.paygentic.io/v0/subscriptions/{id}/adjustments/{adjustmentId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/subscriptions/{id}/adjustments/{adjustmentId}")
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{
"object": "subscriptionAdjustment",
"id": "<string>",
"subscriptionId": "<string>",
"type": "percentageDiscount",
"percentageDiscount": "<string>",
"usageDiscount": "<string>",
"minimumQuantity": "<string>",
"maximumQuantity": "<string>",
"targetPriceIds": [
"<string>"
],
"effectiveFrom": "2023-11-07T05:31:56Z",
"effectiveTo": "2023-11-07T05:31:56Z",
"description": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Authorizations
API key authentication
Response
The adjustment was retracted to the end of the last period it was billed on. It still exists, with a shortened window.
subscriptionAdjustment The adjustment ID
Unique identifier for a subscription
^sub_[a-zA-Z0-9]+$percentageDiscount, usageDiscount, minimumQuantity, maximumQuantity The discount rate as a decimal fraction between 0 and 1. "0.35" means 35 percent. Null on every other type.
The number of usage units taken off the targeted line's billable quantity. Null on every other type.
The contracted minimum quantity billed for one period of the targeted price. Null on every other type.
The contracted maximum quantity billed for one period of the targeted price. Null on every other type.
The prices this adjustment applies to. Exactly one price on a usageDiscount; empty on a percentageDiscount, which reduces every discountable charge. A minimumQuantity or maximumQuantity is created against exactly one price, and later lists more than one only where that charge moved to a new price — a floating subscription moving to a new plan version, or a price edit freezing the subscription's version. Every id listed is the same charge, and the bound applies to whichever one a period bills under.
Opens the window. Read per type: INCLUSIVE on a percentageDiscount, whose window is prorated by day overlap; EXCLUSIVE on a usageDiscount and on both quantity bounds, which apply to a line whose period END falls strictly after this instant.
Closes the window, or null for never. Read per type: EXCLUSIVE on a percentageDiscount; INCLUSIVE on a usageDiscount and on both quantity bounds, which apply to a line whose period END falls on or before this instant. A delete shortens this to the end of the last period the adjustment has already been billed on.
The deal's own name. Shown on each discount line a percentageDiscount emits; every other type emits no line, so its description is carried here only.
Was this page helpful?