Get an organization discount
curl --request GET \
--url {schemes}://api.upsun.com/discounts/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "{schemes}://api.upsun.com/discounts/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('{schemes}://api.upsun.com/discounts/{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 => "{schemes}://api.upsun.com/discounts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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 := "{schemes}://api.upsun.com/discounts/{id}"
req, _ := http.NewRequest("GET", 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.get("{schemes}://api.upsun.com/discounts/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("{schemes}://api.upsun.com/discounts/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 123,
"organization_id": "<string>",
"type": "allowance",
"type_label": "<string>",
"status": "inactive",
"commitment": {
"months": 123,
"amount": {
"monthly": {
"formatted": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_symbol": "<string>"
},
"commitment_period": {
"formatted": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_symbol": "<string>"
},
"contract_total": {
"formatted": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_symbol": "<string>"
}
},
"net": {
"monthly": {
"formatted": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_symbol": "<string>"
},
"commitment_period": {
"formatted": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_symbol": "<string>"
},
"contract_total": {
"formatted": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_symbol": "<string>"
}
}
},
"total_months": 123,
"discount": {
"monthly": {
"formatted": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_symbol": "<string>"
},
"commitment_period": {
"formatted": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_symbol": "<string>"
},
"contract_total": {
"formatted": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_symbol": "<string>"
}
},
"config": {},
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z"
}Discounts
Get an organization discount
GET
/
discounts
/
{id}
Get an organization discount
curl --request GET \
--url {schemes}://api.upsun.com/discounts/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "{schemes}://api.upsun.com/discounts/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('{schemes}://api.upsun.com/discounts/{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 => "{schemes}://api.upsun.com/discounts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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 := "{schemes}://api.upsun.com/discounts/{id}"
req, _ := http.NewRequest("GET", 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.get("{schemes}://api.upsun.com/discounts/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("{schemes}://api.upsun.com/discounts/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 123,
"organization_id": "<string>",
"type": "allowance",
"type_label": "<string>",
"status": "inactive",
"commitment": {
"months": 123,
"amount": {
"monthly": {
"formatted": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_symbol": "<string>"
},
"commitment_period": {
"formatted": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_symbol": "<string>"
},
"contract_total": {
"formatted": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_symbol": "<string>"
}
},
"net": {
"monthly": {
"formatted": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_symbol": "<string>"
},
"commitment_period": {
"formatted": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_symbol": "<string>"
},
"contract_total": {
"formatted": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_symbol": "<string>"
}
}
},
"total_months": 123,
"discount": {
"monthly": {
"formatted": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_symbol": "<string>"
},
"commitment_period": {
"formatted": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_symbol": "<string>"
},
"contract_total": {
"formatted": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_symbol": "<string>"
}
},
"config": {},
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the organization discount
Response
200 - application/json
A discount object
The discount object.
The ID of the organization discount.
The ULID of the organization the discount applies to.
The machine name of the discount type.
Available options:
allowance, startup, enterprise The label of the discount type.
The status of the discount.
Available options:
inactive, active, expired, deactivated The minimum commitment associated with the discount (if applicable).
Show child attributes
Show child attributes
The contract length in months (if applicable).
Discount value per relevant time periods.
Show child attributes
Show child attributes
The discount type specific configuration.
The start time of the discount period.
The end time of the discount period (if applicable).
Last modified on September 25, 2026
Was this page helpful?