curl --request POST \
--url https://console.perfgrid.com/api/v1/services/{service}/changes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"addon_service": "<string>",
"product": "<string>",
"options": [
"<string>"
],
"addon": "<string>",
"quantity": 500,
"promo_code": "<string>"
}
'import requests
url = "https://console.perfgrid.com/api/v1/services/{service}/changes"
payload = {
"addon_service": "<string>",
"product": "<string>",
"options": ["<string>"],
"addon": "<string>",
"quantity": 500,
"promo_code": "<string>"
}
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({
addon_service: '<string>',
product: '<string>',
options: ['<string>'],
addon: '<string>',
quantity: 500,
promo_code: '<string>'
})
};
fetch('https://console.perfgrid.com/api/v1/services/{service}/changes', 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://console.perfgrid.com/api/v1/services/{service}/changes",
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([
'addon_service' => '<string>',
'product' => '<string>',
'options' => [
'<string>'
],
'addon' => '<string>',
'quantity' => 500,
'promo_code' => '<string>'
]),
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://console.perfgrid.com/api/v1/services/{service}/changes"
payload := strings.NewReader("{\n \"addon_service\": \"<string>\",\n \"product\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"addon\": \"<string>\",\n \"quantity\": 500,\n \"promo_code\": \"<string>\"\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://console.perfgrid.com/api/v1/services/{service}/changes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"addon_service\": \"<string>\",\n \"product\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"addon\": \"<string>\",\n \"quantity\": 500,\n \"promo_code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.perfgrid.com/api/v1/services/{service}/changes")
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 \"addon_service\": \"<string>\",\n \"product\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"addon\": \"<string>\",\n \"quantity\": 500,\n \"promo_code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
"<unknown>"
]
}{
"message": "<string>",
"errors": {}
}Request a change
A change that costs more from now on, such as an upgrade or a new
addon, needs services.order and comes back with its proforma to pay.
Any other change, such as a downgrade or a billing cycle change, needs
services.manage and comes back with the day it takes effect. A
billing cycle change is refused with a 422 while a later renewal of the
service is already invoiced: pay the open renewal invoices first.
curl --request POST \
--url https://console.perfgrid.com/api/v1/services/{service}/changes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"addon_service": "<string>",
"product": "<string>",
"options": [
"<string>"
],
"addon": "<string>",
"quantity": 500,
"promo_code": "<string>"
}
'import requests
url = "https://console.perfgrid.com/api/v1/services/{service}/changes"
payload = {
"addon_service": "<string>",
"product": "<string>",
"options": ["<string>"],
"addon": "<string>",
"quantity": 500,
"promo_code": "<string>"
}
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({
addon_service: '<string>',
product: '<string>',
options: ['<string>'],
addon: '<string>',
quantity: 500,
promo_code: '<string>'
})
};
fetch('https://console.perfgrid.com/api/v1/services/{service}/changes', 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://console.perfgrid.com/api/v1/services/{service}/changes",
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([
'addon_service' => '<string>',
'product' => '<string>',
'options' => [
'<string>'
],
'addon' => '<string>',
'quantity' => 500,
'promo_code' => '<string>'
]),
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://console.perfgrid.com/api/v1/services/{service}/changes"
payload := strings.NewReader("{\n \"addon_service\": \"<string>\",\n \"product\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"addon\": \"<string>\",\n \"quantity\": 500,\n \"promo_code\": \"<string>\"\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://console.perfgrid.com/api/v1/services/{service}/changes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"addon_service\": \"<string>\",\n \"product\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"addon\": \"<string>\",\n \"quantity\": 500,\n \"promo_code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.perfgrid.com/api/v1/services/{service}/changes")
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 \"addon_service\": \"<string>\",\n \"product\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"addon\": \"<string>\",\n \"quantity\": 500,\n \"promo_code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
"<unknown>"
]
}{
"message": "<string>",
"errors": {}
}Authorizations
An API token from API tokens in the console, sent as Authorization: Bearer pgapi_.... It works for one billing account, and its permissions decide which endpoints it may call.
Path Parameters
Body
One change to a service, as the console offers it: a new package
(product), new option choices (options), a new billing cycle
(cycle), an addon to add (addon, with quantity), or an addon's
quantity (quantity with addon_service). The ids are the ones
GET /services/{service}/change-options gives; a quote says whether the
change is possible.
The addon service the change is about (a quantity change); the service itself when left out.
26The package to move to.
26Option id => value id (select), a number (quantity) or true/false (yes/no). Options not given keep their choice.
How often a service is billed: once (one_time, never renewed), or every month, three months, six months or year.
one_time, monthly, quarterly, semi_annually, annually An addon to add.
261 <= x <= 100064