curl --request POST \
--url https://carbon-engine.onrender.com/v1/orders/{id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://carbon-engine.onrender.com/v1/orders/{id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://carbon-engine.onrender.com/v1/orders/{id}/cancel', 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://carbon-engine.onrender.com/v1/orders/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://carbon-engine.onrender.com/v1/orders/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://carbon-engine.onrender.com/v1/orders/{id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://carbon-engine.onrender.com/v1/orders/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"orderNumber": "<string>",
"customer": "<string>",
"description": "<string>",
"price_sar_halalas": 123,
"amount_kg": 123,
"creditsPurchased": 123,
"callbackUrl": "<string>",
"state": "<string>",
"portfolio": "<string>",
"certificateUrl": "<string>",
"projectRecords": [
{
"project_id": "<string>",
"project_category_id": "<string>",
"credit_batch_id": "<string>",
"delta": 123,
"recorded_on": "2023-11-07T05:31:56Z"
}
],
"invoice": {
"amountDueSarHalalas": 123,
"balanceAppliedSarHalalas": 123,
"receiptUrl": "<string>"
}
}Cancel Order
When cancelling an order that has been fulfilled, a credit for the price of the order will be applied to the current invoice. This means that it is possible for the credit for a cancellation to appear on the invoice of the following billing period. For example, if a billing period ends between when the order was placed and when it is cancelled, then the credit will be applied to the latter billing period rather than the one during which the order was placed
curl --request POST \
--url https://carbon-engine.onrender.com/v1/orders/{id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://carbon-engine.onrender.com/v1/orders/{id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://carbon-engine.onrender.com/v1/orders/{id}/cancel', 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://carbon-engine.onrender.com/v1/orders/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://carbon-engine.onrender.com/v1/orders/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://carbon-engine.onrender.com/v1/orders/{id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://carbon-engine.onrender.com/v1/orders/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"orderNumber": "<string>",
"customer": "<string>",
"description": "<string>",
"price_sar_halalas": 123,
"amount_kg": 123,
"creditsPurchased": 123,
"callbackUrl": "<string>",
"state": "<string>",
"portfolio": "<string>",
"certificateUrl": "<string>",
"projectRecords": [
{
"project_id": "<string>",
"project_category_id": "<string>",
"credit_batch_id": "<string>",
"delta": 123,
"recorded_on": "2023-11-07T05:31:56Z"
}
],
"invoice": {
"amountDueSarHalalas": 123,
"balanceAppliedSarHalalas": 123,
"receiptUrl": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The order ID
Response
Order cancelled successfully
The unique order id
The unique order number
If purchased by customer
Description of the order
Total price of the credits purchased in SAR halalas
Number of carbon credits requested, in kilograms
Number of carbon credits fulfilled, in kilograms
Callback URL for order updates (if any)
Current status of the order, e.g., fulfilled, placed, or cancelled
The portfolio ID related to the order
URL to the order page with the certificate of the carbon credits
List of project records for this order
Show child attributes
Show child attributes
Show child attributes
Show child attributes
