Get all order emissions for a customer
curl --request GET \
--url https://api.gocrex.com/api/customer-emissions/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.gocrex.com/api/customer-emissions/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.gocrex.com/api/customer-emissions/{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.gocrex.com/api/customer-emissions/{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 => [
"X-API-Key: <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.gocrex.com/api/customer-emissions/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<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.gocrex.com/api/customer-emissions/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gocrex.com/api/customer-emissions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"customer_id": "some-customer-id",
"emission_unit": "kgCO2e",
"number_of_orders": 1,
"orders": [
{
"created_at": "2025-02-07T09:24:16.498110Z",
"customer_id": "some-customer-id",
"emission_unit": "kgCO2e",
"items": [
{
"device_id": "lap-app-lap-app-m3mba138c8g16c8g",
"emission_breakdown": {
"packaging": {
"description": "Packaging of the device",
"emission": 1.47325,
"emission_unit": "kgCO2e",
"ghg_category": "Category 1: Purchased goods and services",
"ghg_scope": "3",
"type": "estimated"
},
"product_embodied_emission": {
"description": "Embodied emission of Apple MacBook Air 13 M3 (8C CPU + 8C GPU + 16C NE + 8GB)",
"emission": 6.834375,
"emission_unit": "kgCO2e",
"ghg_category": "Category 1: Purchased goods and services",
"ghg_scope": "3",
"type": "estimated"
},
"product_use": {
"description": "Emission from use of Apple MacBook Air 13 M3 (8C CPU + 8C GPU + 16C NE + 8GB)",
"emission": 1.603125,
"emission_unit": "kgCO2e",
"ghg_category": "Electricity",
"ghg_scope": "2",
"type": "indicative"
},
"transportation": {
"description": "Upstream transportation of the device",
"emission": 0.01815,
"emission_unit": "kgCO2e",
"ghg_category": "Category 4: Upstream transportation and distribution",
"ghg_scope": "3",
"type": "estimated"
}
},
"serial_number": "XYX",
"total_emission": 9.9289,
"type": "product"
}
],
"order_date": "2024-12-12",
"order_id": "some-order-id-1A",
"status": "created",
"tenure_start_date": "2025-01-01",
"total_emission": 9.9289
}
],
"total_emission": 9.9289
}{
"code": "unauthorized",
"detail": "Invalid API key"
}Endpoints
Get all order emissions for a customer
Return all order emissions for a customer
Get all order emissions for a customer
curl --request GET \
--url https://api.gocrex.com/api/customer-emissions/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.gocrex.com/api/customer-emissions/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.gocrex.com/api/customer-emissions/{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.gocrex.com/api/customer-emissions/{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 => [
"X-API-Key: <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.gocrex.com/api/customer-emissions/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<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.gocrex.com/api/customer-emissions/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gocrex.com/api/customer-emissions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"customer_id": "some-customer-id",
"emission_unit": "kgCO2e",
"number_of_orders": 1,
"orders": [
{
"created_at": "2025-02-07T09:24:16.498110Z",
"customer_id": "some-customer-id",
"emission_unit": "kgCO2e",
"items": [
{
"device_id": "lap-app-lap-app-m3mba138c8g16c8g",
"emission_breakdown": {
"packaging": {
"description": "Packaging of the device",
"emission": 1.47325,
"emission_unit": "kgCO2e",
"ghg_category": "Category 1: Purchased goods and services",
"ghg_scope": "3",
"type": "estimated"
},
"product_embodied_emission": {
"description": "Embodied emission of Apple MacBook Air 13 M3 (8C CPU + 8C GPU + 16C NE + 8GB)",
"emission": 6.834375,
"emission_unit": "kgCO2e",
"ghg_category": "Category 1: Purchased goods and services",
"ghg_scope": "3",
"type": "estimated"
},
"product_use": {
"description": "Emission from use of Apple MacBook Air 13 M3 (8C CPU + 8C GPU + 16C NE + 8GB)",
"emission": 1.603125,
"emission_unit": "kgCO2e",
"ghg_category": "Electricity",
"ghg_scope": "2",
"type": "indicative"
},
"transportation": {
"description": "Upstream transportation of the device",
"emission": 0.01815,
"emission_unit": "kgCO2e",
"ghg_category": "Category 4: Upstream transportation and distribution",
"ghg_scope": "3",
"type": "estimated"
}
},
"serial_number": "XYX",
"total_emission": 9.9289,
"type": "product"
}
],
"order_date": "2024-12-12",
"order_id": "some-order-id-1A",
"status": "created",
"tenure_start_date": "2025-01-01",
"total_emission": 9.9289
}
],
"total_emission": 9.9289
}{
"code": "unauthorized",
"detail": "Invalid API key"
}Authorizations
Path Parameters
Customer ID
Response
CustomerOrderEmissionsResponse
⌘I