curl --request GET \
--url https://api.gcore.com/billing/org/v1/expenses/{id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.gcore.com/billing/org/v1/expenses/{id}"
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/{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 => "https://api.gcore.com/billing/org/v1/expenses/{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: <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/{id}"
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/{id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/billing/org/v1/expenses/{id}")
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{
"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>"
},
"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
}
]
}Get a single Expense
Retrieve a single Expense by ID.
curl --request GET \
--url https://api.gcore.com/billing/org/v1/expenses/{id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.gcore.com/billing/org/v1/expenses/{id}"
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/{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 => "https://api.gcore.com/billing/org/v1/expenses/{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: <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/{id}"
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/{id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/billing/org/v1/expenses/{id}")
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{
"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>"
},
"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
}
]
}Authorizations
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234_abcdef
Path Parameters
Response
Request successful.
Resolve client/payer for expenses that may be linked via addendum or directly via client.
The ID of the client associated with the expense.
The ID of the payer associated with the expense.
The client associated with the expense.
Show child attributes
Show child attributes
Public comment
Date of expense
The time range for which the expense is calculated.
Show child attributes
Show child attributes
Type of the calculation rule applied to the expense.
commit- commitovercommit- overcommitstepped- steppedstaged- stagedcommit_hourly-commit_hourly
commit, overcommit, stepped, staged, commit_hourly The currency used in the expense.
Show child attributes
Show child attributes
The monetary value of the expense.
^\d{1,3}\.\d{12}$The monetary value of the tax applied to the expense.
^\d{1,3}\.\d{12}$The tax rate applied to the expense.
^\d{1,2}\.\d{2}$Usage details associated with the expense.
Show child attributes
Show child attributes
Metric code of the feature associated with the expense.
The region associated with the expense.
Show child attributes
Show child attributes
The monetary value of the discount applied to the expense.
^\d{1,3}\.\d{12}$The discount applied to the expense, if any.
Show child attributes
Show child attributes
Indicates whether the expense has been deleted.
Description of the expense.
The product category associated with the feature of the expense.
Show child attributes
Show child attributes
The product associated with the expense.
Show child attributes
Show child attributes
The addendum associated with the expense.
Show child attributes
Show child attributes
The plan associated with the expense.
Show child attributes
Show child attributes
The feature associated with the expense.
Show child attributes
Show child attributes
The subscription associated with the expense.
The plan item associated with the expense.
Show child attributes
Show child attributes
List of invoice item IDs associated with the expense.
Show child attributes
Show child attributes
Was this page helpful?