curl --request GET \
--url https://api.gcore.com/billing/org/v1/expenses \
--header 'Authorization: <api-key>'import requests
url = "https://api.gcore.com/billing/org/v1/expenses"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/billing/org/v1/expenses', 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.gcore.com/billing/org/v1/expenses",
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: <api-key>"
],
]);
$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.gcore.com/billing/org/v1/expenses"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/billing/org/v1/expenses")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/billing/org/v1/expenses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"count": 123,
"results": [
{
"id": 123,
"client_id": 123,
"payer_id": 123,
"client": {
"id": 123,
"company_name": "<string>"
},
"comment": "<string>",
"for_date": "2023-11-07T05:31:56Z",
"period_range": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"calc_rule_type": "commit",
"currency": {
"id": 123,
"char_code": "<string>",
"symbol": "<string>"
},
"money_value": "<string>",
"tax_value": "<string>",
"tax_rate": "<string>",
"usage": {
"amount": "<string>",
"unit_name": "<string>"
},
"metric_ext_name": "<string>",
"region": {
"id": 123,
"name": "<string>",
"external_name": "<string>",
"internal_name": "<string>"
},
"discount_value": "<string>",
"discount": {
"id": 123,
"relative_value": "<string>",
"comment": "<string>"
},
"deleted": true,
"description": "<string>",
"product_category": {
"id": 123,
"name": "<string>"
},
"product": {
"id": 123,
"name": "<string>",
"internal_name": "<string>"
},
"addendum": {
"id": 123,
"active_range": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"status": "upcoming"
},
"plan": {
"id": 123,
"name": "<string>"
},
"feature": {
"id": 123,
"name": "<string>",
"erp_sku_id": "<string>"
},
"subscription": "<string>",
"plan_item": {
"id": 123,
"default": true,
"comment": "<string>",
"description": "<string>"
},
"invoices": [
{
"invoice_id": 123,
"invoice_date": "2023-12-25",
"invoice_item_id": 123
}
]
}
],
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100"
}List Expenses
Retrieve a list of Expense objects.
You can use query parameters to filter, sort, and paginate the results.
You can set the money_decimals query parameter to specify the number of decimal places for money fields.
Examples:
?money_decimals=2will return money values rounded to 2 decimal places.?money_decimals=maxwill return money values with the maximum precision.
curl --request GET \
--url https://api.gcore.com/billing/org/v1/expenses \
--header 'Authorization: <api-key>'import requests
url = "https://api.gcore.com/billing/org/v1/expenses"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/billing/org/v1/expenses', 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.gcore.com/billing/org/v1/expenses",
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: <api-key>"
],
]);
$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.gcore.com/billing/org/v1/expenses"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/billing/org/v1/expenses")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/billing/org/v1/expenses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"count": 123,
"results": [
{
"id": 123,
"client_id": 123,
"payer_id": 123,
"client": {
"id": 123,
"company_name": "<string>"
},
"comment": "<string>",
"for_date": "2023-11-07T05:31:56Z",
"period_range": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"calc_rule_type": "commit",
"currency": {
"id": 123,
"char_code": "<string>",
"symbol": "<string>"
},
"money_value": "<string>",
"tax_value": "<string>",
"tax_rate": "<string>",
"usage": {
"amount": "<string>",
"unit_name": "<string>"
},
"metric_ext_name": "<string>",
"region": {
"id": 123,
"name": "<string>",
"external_name": "<string>",
"internal_name": "<string>"
},
"discount_value": "<string>",
"discount": {
"id": 123,
"relative_value": "<string>",
"comment": "<string>"
},
"deleted": true,
"description": "<string>",
"product_category": {
"id": 123,
"name": "<string>"
},
"product": {
"id": 123,
"name": "<string>",
"internal_name": "<string>"
},
"addendum": {
"id": 123,
"active_range": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"status": "upcoming"
},
"plan": {
"id": 123,
"name": "<string>"
},
"feature": {
"id": 123,
"name": "<string>",
"erp_sku_id": "<string>"
},
"subscription": "<string>",
"plan_item": {
"id": 123,
"default": true,
"comment": "<string>",
"description": "<string>"
},
"invoices": [
{
"invoice_id": 123,
"invoice_date": "2023-12-25",
"invoice_item_id": 123
}
]
}
],
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100"
}Authorizations
Query Parameters
Filter by creation date-time.
Returns items created after the specified date-time (ISO 8601/RFC 3339 format, UTC).
You can specify a date with a time separated by a space, or just a date.
Examples:
&created_after=2025-05-15&created_after=2025-05-15 12:00:00&created_after=2025-05-15T12:00:00Z
Filter by creation date-time.
Returns items created before the specified date-time (ISO 8601/RFC 3339 format, UTC).
You can specify a date with a time separated by a space, or just a date.
Examples:
&created_before=2025-05-15&created_before=2025-05-15 12:00:00&created_before=2025-05-15T12:00:00Z
Ordering of the results.
For ascending sort order use field.asc, for descending sort order use field.desc.
For sorting by multiple parameters write them as comma separated string: client_id.asc,id.desc.
Final stable tiebreak ordering is added except when pk sorting used.
addendum_id.asc- Addendum idaddendum_id.desc- Addendum id (descending)period_range_start.asc- Period range startperiod_range_start.desc- Period range start (descending)period_range_end.asc- Period range endperiod_range_end.desc- Period range end (descending)calc_rule_type.asc- Calc rule typecalc_rule_type.desc- Calc rule type (descending)created_at.asc- Created atcreated_at.desc- Created at (descending)currency_id.asc- Currency idcurrency_id.desc- Currency id (descending)feature_name.asc- Feature namefeature_name.desc- Feature name (descending)for_date.asc- For datefor_date.desc- For date (descending)id.asc- Idid.desc- Id (descending)money_value.asc- Money valuemoney_value.desc- Money value (descending)plan_item_id.asc- Plan item idplan_item_id.desc- Plan item id (descending)product_name.asc- Product nameproduct_name.desc- Product name (descending)product_id.asc- Product idproduct_id.desc- Product id (descending)tax_rate.asc- Tax ratetax_rate.desc- Tax rate (descending)region_id.asc- Region idregion_id.desc- Region id (descending)region_name.asc- Region nameregion_name.desc- Region name (descending)
addendum_id.asc, addendum_id.desc, calc_rule_type.asc, calc_rule_type.desc, created_at.asc, created_at.desc, currency_id.asc, currency_id.desc, feature_name.asc, feature_name.desc, for_date.asc, for_date.desc, id.asc, id.desc, money_value.asc, money_value.desc, period_range_end.asc, period_range_end.desc, period_range_start.asc, period_range_start.desc, plan_item_id.asc, plan_item_id.desc, product_id.asc, product_id.desc, product_name.asc, product_name.desc, region_id.asc, region_id.desc, region_name.asc, region_name.desc, tax_rate.asc, tax_rate.desc Ordering of the results.
This field is left for compatibility and can be deprecated in future versions. Use order_by instead.
Default sort order is ascending. Put - before value for descending sort order: -id.
For sorting by multiple parameters write them as comma separated string: -client_id,id.
Final stable tiebreak ordering is added except when pk sorting used.
addendum_id- Addendum id-addendum_id- Addendum id (descending)period_range_start- Period range start-period_range_start- Period range start (descending)period_range_end- Period range end-period_range_end- Period range end (descending)calc_rule_type- Calc rule type-calc_rule_type- Calc rule type (descending)created_at- Created at-created_at- Created at (descending)currency_id- Currency id-currency_id- Currency id (descending)feature_name- Feature name-feature_name- Feature name (descending)for_date- For date-for_date- For date (descending)id- Id-id- Id (descending)money_value- Money value-money_value- Money value (descending)plan_item_id- Plan item id-plan_item_id- Plan item id (descending)product_name- Product name-product_name- Product name (descending)product_id- Product id-product_id- Product id (descending)tax_rate- Tax rate-tax_rate- Tax rate (descending)region_id- Region id-region_id- Region id (descending)region_name- Region name-region_name- Region name (descending)
-addendum_id, -calc_rule_type, -created_at, -currency_id, -feature_name, -for_date, -id, -money_value, -period_range_end, -period_range_start, -plan_item_id, -product_id, -product_name, -region_id, -region_name, -tax_rate, addendum_id, calc_rule_type, created_at, currency_id, feature_name, for_date, id, money_value, period_range_end, period_range_start, plan_item_id, product_id, product_name, region_id, region_name, tax_rate Filter by period range.
Returns items with a period ending after the specified date-time (ISO 8601/RFC 3339 format, UTC).
You can specify a date with a time separated by a space.
Examples:
&period_ends_after=2025-05-15 12:00:00&period_ends_after=2025-05-15T12:00:00Z
Filter by period range.
Returns items with a period ending before the specified date-time (ISO 8601/RFC 3339 format, UTC).
You can specify a date with a time separated by a space.
Examples:
&period_ends_before=2025-05-15 12:00:00&period_ends_before=2025-05-15T12:00:00Z
Filter by period range.
Returns items excluding those with a period containing the specified date-time (ISO 8601/RFC 3339 format, UTC).
You can specify a date with a time separated by a space.
Examples:
&period_outside=2025-05-15 12:00:00&period_outside=2025-05-15T12:00:00Z
Filter by period range.
Returns items with a period beginning after the specified date-time (ISO 8601/RFC 3339 format, UTC).
You can specify a date with a time separated by a space.
Examples:
&period_starts_after=2025-05-15 12:00:00&period_starts_after=2025-05-15T12:00:00Z
Filter by period range.
Returns items with a period beginning before the specified date-time (ISO 8601/RFC 3339 format, UTC).
You can specify a date with a time separated by a space.
Examples:
&period_starts_before=2025-05-15 12:00:00&period_starts_before=2025-05-15T12:00:00Z
Filter by product ID. Can be multiple.
Returns products with the specified ID.
Examples:
&product_id=1&product_id=1&product_id=2
Available values:
1- CDN2- Object Storage3- Web Security4- Streaming5- Cloud6- Colocation Services7- WG Private Cloud8- p2p9- DDoS Protection10- Managed DNS11- Other Services12- Premium Support13- Connectivity14- Hosting (G-Hosting)15- Managed Services16- Rent17- Software development18- VM Ware19- LaaS20- AWS Cloud21- FastEdge22- Technical Support23- WAAP25- Edge Proxy32- AI Managed Dedicated Compute65- Gclaw
Filter by product internal name. Can be multiple.
Returns products with the specified internal name.
Examples:
&product_internal_name=CDN&product_internal_name=CDN&product_internal_name=DNS
Available values:
AI_DEDCOMP- AI Managed Dedicated ComputeAWS_CLOUD- AWS CloudCDN- CDNCLOUD- CloudCONNECT- Colocation ServicesCONNECTIVITY- ConnectivityDDOS- Web SecurityDNS- Managed DNSFAST_EDGE- FastEdgeGCLAW- GclawGHOST- Hosting (G-Hosting)INFRASTRUCTURE_PROTECTION- DDoS ProtectionLAAS- LaaSMANAGED_SERVICES- Managed ServicesOTHER_SERVICES- Other ServicesP2P- p2pPREMIUM_SUPPORT- Premium SupportRENT- RentSHIELD_PROXY- Edge ProxySOFTWARE_DEVELOPMENT- Software developmentSTORAGE- Object StorageSTREAMING- StreamingTECHNICAL_SUPPORT- Technical SupportVMWARE- VM WareWAAP- WAAPWG_PRIVATE_CLOUD- WG Private Cloud
Was this page helpful?