Quote viewers upgrade
curl --request POST \
--url https://api.streamskill.pro/v1/purchases/{orderId}/upgrade-viewers/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_viewers": 200
}
'import requests
url = "https://api.streamskill.pro/v1/purchases/{orderId}/upgrade-viewers/quote"
payload = { "target_viewers": 200 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({target_viewers: 200})
};
fetch('https://api.streamskill.pro/v1/purchases/{orderId}/upgrade-viewers/quote', 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.streamskill.pro/v1/purchases/{orderId}/upgrade-viewers/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'target_viewers' => 200
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.streamskill.pro/v1/purchases/{orderId}/upgrade-viewers/quote"
payload := strings.NewReader("{\n \"target_viewers\": 200\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.streamskill.pro/v1/purchases/{orderId}/upgrade-viewers/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target_viewers\": 200\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.streamskill.pro/v1/purchases/{orderId}/upgrade-viewers/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_viewers\": 200\n}"
response = http.request(request)
puts response.read_body{
"to_viewers": 200,
"remaining_seconds": 3600,
"amount": 12.5,
"currency": "usd"
}{
"error_code": "not_found",
"name": "Record not found.",
"message": "Record not found.",
"code": 0,
"status": 404,
"type": "record_not_found_exception"
}{
"error_code": "not_supported",
"name": "Action is not available for this order",
"message": "Action is not available for this order",
"code": 0,
"status": 405,
"type": "action_unavailable"
}{
"error_code": "already_done",
"name": "Order already completed",
"message": "Order already completed",
"code": 0,
"status": 409,
"type": "purchase_done"
}{
"error_code": "validation_error",
"name": "The Channel field is required.",
"message": "The Channel field is required.",
"code": 0,
"status": 422,
"type": "validate_exception",
"errors": {
"channel": [
"The Channel field is required."
]
}
}Actions
Quote viewers upgrade
Get the cost of increasing an order’s viewer limit. The cost is based on the order’s remaining time. This request does not charge your balance or change the order.
POST
/
purchases
/
{orderId}
/
upgrade-viewers
/
quote
Quote viewers upgrade
curl --request POST \
--url https://api.streamskill.pro/v1/purchases/{orderId}/upgrade-viewers/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_viewers": 200
}
'import requests
url = "https://api.streamskill.pro/v1/purchases/{orderId}/upgrade-viewers/quote"
payload = { "target_viewers": 200 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({target_viewers: 200})
};
fetch('https://api.streamskill.pro/v1/purchases/{orderId}/upgrade-viewers/quote', 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.streamskill.pro/v1/purchases/{orderId}/upgrade-viewers/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'target_viewers' => 200
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.streamskill.pro/v1/purchases/{orderId}/upgrade-viewers/quote"
payload := strings.NewReader("{\n \"target_viewers\": 200\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.streamskill.pro/v1/purchases/{orderId}/upgrade-viewers/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target_viewers\": 200\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.streamskill.pro/v1/purchases/{orderId}/upgrade-viewers/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_viewers\": 200\n}"
response = http.request(request)
puts response.read_body{
"to_viewers": 200,
"remaining_seconds": 3600,
"amount": 12.5,
"currency": "usd"
}{
"error_code": "not_found",
"name": "Record not found.",
"message": "Record not found.",
"code": 0,
"status": 404,
"type": "record_not_found_exception"
}{
"error_code": "not_supported",
"name": "Action is not available for this order",
"message": "Action is not available for this order",
"code": 0,
"status": 405,
"type": "action_unavailable"
}{
"error_code": "already_done",
"name": "Order already completed",
"message": "Order already completed",
"code": 0,
"status": 409,
"type": "purchase_done"
}{
"error_code": "validation_error",
"name": "The Channel field is required.",
"message": "The Channel field is required.",
"code": 0,
"status": 422,
"type": "validate_exception",
"errors": {
"channel": [
"The Channel field is required."
]
}
}target_viewers is the new total viewer limit. To increase an order from 100 to 200 viewers, send 200.
To apply the upgrade, call Upgrade viewers with the same target_viewers and the returned amount as max_amount. The final cost is recalculated when you apply the upgrade.Authorizations
Body
application/json
Response
Estimated upgrade cost.