curl -X POST "https://{globale_api_domain}/subscriptions/billing-summary/calculate" \
-H "Authorization: Bearer {JWT Token}" \
-H "Idempotency-Key: 3f1a7c2e-9b40-4d6f-8a21-5c9e0b7d4a11" \
-H "Content-Type: application/json" \
-d '{"subscriptionId":"123456","merchantGuid":"1234567890","currencyCode":"USD","products":[{"code":"PROD-001","quantity":2,"price":149.99}]}'import requests
url = "https://{globale_api_domain}/subscriptions/billing-summary/calculate"
payload = {
"subscriptionId": "123456",
"merchantGuid": "1234567890",
"currencyCode": "USD",
"products": [
{
"code": "PROD-001",
"quantity": 2,
"price": 149.99
}
],
"shippingAmount": 5
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subscriptionId: '123456',
merchantGuid: '1234567890',
currencyCode: 'USD',
products: [{code: 'PROD-001', quantity: 2, price: 149.99}],
shippingAmount: 5
})
};
fetch('https://{globale_api_domain}/subscriptions/billing-summary/calculate', 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://{globale_api_domain}/subscriptions/billing-summary/calculate",
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([
'subscriptionId' => '123456',
'merchantGuid' => '1234567890',
'currencyCode' => 'USD',
'products' => [
[
'code' => 'PROD-001',
'quantity' => 2,
'price' => 149.99
]
],
'shippingAmount' => 5
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{globale_api_domain}/subscriptions/billing-summary/calculate"
payload := strings.NewReader("{\n \"subscriptionId\": \"123456\",\n \"merchantGuid\": \"1234567890\",\n \"currencyCode\": \"USD\",\n \"products\": [\n {\n \"code\": \"PROD-001\",\n \"quantity\": 2,\n \"price\": 149.99\n }\n ],\n \"shippingAmount\": 5\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://{globale_api_domain}/subscriptions/billing-summary/calculate")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"subscriptionId\": \"123456\",\n \"merchantGuid\": \"1234567890\",\n \"currencyCode\": \"USD\",\n \"products\": [\n {\n \"code\": \"PROD-001\",\n \"quantity\": 2,\n \"price\": 149.99\n }\n ],\n \"shippingAmount\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{globale_api_domain}/subscriptions/billing-summary/calculate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subscriptionId\": \"123456\",\n \"merchantGuid\": \"1234567890\",\n \"currencyCode\": \"USD\",\n \"products\": [\n {\n \"code\": \"PROD-001\",\n \"quantity\": 2,\n \"price\": 149.99\n }\n ],\n \"shippingAmount\": 5\n}"
response = http.request(request)
puts response.read_body{
"externalReference": "req-7890",
"selectedShippingOption": {
"optionId": "1042",
"name": "DHL Standard",
"price": 6.99,
"currencyCode": "USD"
},
"dtResults": [
{
"deliveryId": "0",
"shippingServiceCode": "STD-SHMID",
"status": {
"isSuccessful": true
},
"lineItems": [
{
"index": "111",
"code": "item-001",
"hsCode": "123456",
"dutyLines": [
{
"name": "Import Duty",
"price": 2,
"rate": 0.02
}
],
"taxLines": [
{
"name": "Sales Tax",
"price": 1.5,
"rate": 0.1
}
]
}
],
"shipping": {
"taxLines": [
{
"name": "Sales Tax",
"price": 1.5,
"rate": 0.1
}
]
},
"additionalFees": [
{
"name": "Formal Clearance Fee",
"price": 15
}
],
"totals": {
"taxes": 3,
"duties": 2,
"additionalFees": 15
}
}
],
"fxRates": [
{
"fxRate": 3.75,
"fxMarginRate": 1.02,
"fxRateServiceProviderId": 5,
"currencyFrom": "ILS",
"currencyTo": "USD"
}
]
}Calculate billing summary (Subscription Manager to Global-e)
Subscription Manager calls Global-e to calculate the recurring billing summary - the selected shipping option (physical / hybrid subscriptions) and duties and taxes
curl -X POST "https://{globale_api_domain}/subscriptions/billing-summary/calculate" \
-H "Authorization: Bearer {JWT Token}" \
-H "Idempotency-Key: 3f1a7c2e-9b40-4d6f-8a21-5c9e0b7d4a11" \
-H "Content-Type: application/json" \
-d '{"subscriptionId":"123456","merchantGuid":"1234567890","currencyCode":"USD","products":[{"code":"PROD-001","quantity":2,"price":149.99}]}'import requests
url = "https://{globale_api_domain}/subscriptions/billing-summary/calculate"
payload = {
"subscriptionId": "123456",
"merchantGuid": "1234567890",
"currencyCode": "USD",
"products": [
{
"code": "PROD-001",
"quantity": 2,
"price": 149.99
}
],
"shippingAmount": 5
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subscriptionId: '123456',
merchantGuid: '1234567890',
currencyCode: 'USD',
products: [{code: 'PROD-001', quantity: 2, price: 149.99}],
shippingAmount: 5
})
};
fetch('https://{globale_api_domain}/subscriptions/billing-summary/calculate', 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://{globale_api_domain}/subscriptions/billing-summary/calculate",
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([
'subscriptionId' => '123456',
'merchantGuid' => '1234567890',
'currencyCode' => 'USD',
'products' => [
[
'code' => 'PROD-001',
'quantity' => 2,
'price' => 149.99
]
],
'shippingAmount' => 5
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{globale_api_domain}/subscriptions/billing-summary/calculate"
payload := strings.NewReader("{\n \"subscriptionId\": \"123456\",\n \"merchantGuid\": \"1234567890\",\n \"currencyCode\": \"USD\",\n \"products\": [\n {\n \"code\": \"PROD-001\",\n \"quantity\": 2,\n \"price\": 149.99\n }\n ],\n \"shippingAmount\": 5\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://{globale_api_domain}/subscriptions/billing-summary/calculate")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"subscriptionId\": \"123456\",\n \"merchantGuid\": \"1234567890\",\n \"currencyCode\": \"USD\",\n \"products\": [\n {\n \"code\": \"PROD-001\",\n \"quantity\": 2,\n \"price\": 149.99\n }\n ],\n \"shippingAmount\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{globale_api_domain}/subscriptions/billing-summary/calculate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subscriptionId\": \"123456\",\n \"merchantGuid\": \"1234567890\",\n \"currencyCode\": \"USD\",\n \"products\": [\n {\n \"code\": \"PROD-001\",\n \"quantity\": 2,\n \"price\": 149.99\n }\n ],\n \"shippingAmount\": 5\n}"
response = http.request(request)
puts response.read_body{
"externalReference": "req-7890",
"selectedShippingOption": {
"optionId": "1042",
"name": "DHL Standard",
"price": 6.99,
"currencyCode": "USD"
},
"dtResults": [
{
"deliveryId": "0",
"shippingServiceCode": "STD-SHMID",
"status": {
"isSuccessful": true
},
"lineItems": [
{
"index": "111",
"code": "item-001",
"hsCode": "123456",
"dutyLines": [
{
"name": "Import Duty",
"price": 2,
"rate": 0.02
}
],
"taxLines": [
{
"name": "Sales Tax",
"price": 1.5,
"rate": 0.1
}
]
}
],
"shipping": {
"taxLines": [
{
"name": "Sales Tax",
"price": 1.5,
"rate": 0.1
}
]
},
"additionalFees": [
{
"name": "Formal Clearance Fee",
"price": 15
}
],
"totals": {
"taxes": 3,
"duties": 2,
"additionalFees": 15
}
}
],
"fxRates": [
{
"fxRate": 3.75,
"fxMarginRate": 1.02,
"fxRateServiceProviderId": 5,
"currencyFrom": "ILS",
"currencyTo": "USD"
}
]
}Headers
Unique identifier for the request; the same value must be sent on retries so the operation is applied at most once.
Body
Unique identifier of subscription in the subscription manager.
100Global-e merchant unique identifier
ISO 4217 currency code
^[A-Z]{3}$List of products
1Show child attributes
Show child attributes
Applied discounts for this cycle; not persisted on the subscription.
Show child attributes
Show child attributes
Shipping amount charged to the shopper for this cycle. 0 means free shipping; omit to let Global-e price it
x >= 0Response
Billing summary - selected shipping option and duties and taxes values.
Unique identifier for the request
50Array of duty/tax calculation results
Show child attributes
Show child attributes
Shipping option selected for the recurring order (physical / hybrid subscriptions). Not returned for digital-only subscriptions.
Show child attributes
Show child attributes
Foreign exchange rates used in calculations
Show child attributes
Show child attributes

