cURL
curl -X POST "https://{globale_api_domain}/subscriptions/notifications" \
-H "Authorization: Bearer {JWT Token}" \
-H "Idempotency-Key: 3f1a7c2e-9b40-4d6f-8a21-5c9e0b7d4a11" \
-H "Content-Type: application/json" \
-d '{"notificationType":"SUBSCRIPTION_CREATED","subscriptionId":"123456","merchantGuid":"1234567890","orderId":"1234567890","externalReferenceId":"INV-001","products":["PROD-001","PROD-002"]}'import requests
url = "https://{globale_api_domain}/subscriptions/notifications"
payload = {
"notificationType": "SUBSCRIPTION_CREATED",
"subscriptionId": "123456",
"merchantGuid": "1234567890",
"orderId": "1234567890",
"externalReferenceId": "1234567890",
"products": ["PROD-001"]
}
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({
notificationType: 'SUBSCRIPTION_CREATED',
subscriptionId: '123456',
merchantGuid: '1234567890',
orderId: '1234567890',
externalReferenceId: '1234567890',
products: ['PROD-001']
})
};
fetch('https://{globale_api_domain}/subscriptions/notifications', 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/notifications",
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([
'notificationType' => 'SUBSCRIPTION_CREATED',
'subscriptionId' => '123456',
'merchantGuid' => '1234567890',
'orderId' => '1234567890',
'externalReferenceId' => '1234567890',
'products' => [
'PROD-001'
]
]),
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/notifications"
payload := strings.NewReader("{\n \"notificationType\": \"SUBSCRIPTION_CREATED\",\n \"subscriptionId\": \"123456\",\n \"merchantGuid\": \"1234567890\",\n \"orderId\": \"1234567890\",\n \"externalReferenceId\": \"1234567890\",\n \"products\": [\n \"PROD-001\"\n ]\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/notifications")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"notificationType\": \"SUBSCRIPTION_CREATED\",\n \"subscriptionId\": \"123456\",\n \"merchantGuid\": \"1234567890\",\n \"orderId\": \"1234567890\",\n \"externalReferenceId\": \"1234567890\",\n \"products\": [\n \"PROD-001\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{globale_api_domain}/subscriptions/notifications")
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 \"notificationType\": \"SUBSCRIPTION_CREATED\",\n \"subscriptionId\": \"123456\",\n \"merchantGuid\": \"1234567890\",\n \"orderId\": \"1234567890\",\n \"externalReferenceId\": \"1234567890\",\n \"products\": [\n \"PROD-001\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"description": "Request received successfully!"
}Subscription notifications (Subscription Manager to Global-e)
Subscription Manager informs Global-e about subscription’s updates.
POST
/
subscriptions
/
notifications
cURL
curl -X POST "https://{globale_api_domain}/subscriptions/notifications" \
-H "Authorization: Bearer {JWT Token}" \
-H "Idempotency-Key: 3f1a7c2e-9b40-4d6f-8a21-5c9e0b7d4a11" \
-H "Content-Type: application/json" \
-d '{"notificationType":"SUBSCRIPTION_CREATED","subscriptionId":"123456","merchantGuid":"1234567890","orderId":"1234567890","externalReferenceId":"INV-001","products":["PROD-001","PROD-002"]}'import requests
url = "https://{globale_api_domain}/subscriptions/notifications"
payload = {
"notificationType": "SUBSCRIPTION_CREATED",
"subscriptionId": "123456",
"merchantGuid": "1234567890",
"orderId": "1234567890",
"externalReferenceId": "1234567890",
"products": ["PROD-001"]
}
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({
notificationType: 'SUBSCRIPTION_CREATED',
subscriptionId: '123456',
merchantGuid: '1234567890',
orderId: '1234567890',
externalReferenceId: '1234567890',
products: ['PROD-001']
})
};
fetch('https://{globale_api_domain}/subscriptions/notifications', 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/notifications",
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([
'notificationType' => 'SUBSCRIPTION_CREATED',
'subscriptionId' => '123456',
'merchantGuid' => '1234567890',
'orderId' => '1234567890',
'externalReferenceId' => '1234567890',
'products' => [
'PROD-001'
]
]),
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/notifications"
payload := strings.NewReader("{\n \"notificationType\": \"SUBSCRIPTION_CREATED\",\n \"subscriptionId\": \"123456\",\n \"merchantGuid\": \"1234567890\",\n \"orderId\": \"1234567890\",\n \"externalReferenceId\": \"1234567890\",\n \"products\": [\n \"PROD-001\"\n ]\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/notifications")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"notificationType\": \"SUBSCRIPTION_CREATED\",\n \"subscriptionId\": \"123456\",\n \"merchantGuid\": \"1234567890\",\n \"orderId\": \"1234567890\",\n \"externalReferenceId\": \"1234567890\",\n \"products\": [\n \"PROD-001\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{globale_api_domain}/subscriptions/notifications")
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 \"notificationType\": \"SUBSCRIPTION_CREATED\",\n \"subscriptionId\": \"123456\",\n \"merchantGuid\": \"1234567890\",\n \"orderId\": \"1234567890\",\n \"externalReferenceId\": \"1234567890\",\n \"products\": [\n \"PROD-001\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"description": "Request received successfully!"
}Part of the Subscription Connector integration guide — see it for when and how to use this endpoint.
Headers
Unique identifier for the request; the same value must be sent on retries so the operation is applied at most once.
Body
application/json
- Option 1
- Option 2
A subscription creation event.
Unique order identifier in Global-e
List of products codes
Minimum array length:
1Unique product identifier
Which subscription lifecycle event this notification reports.
SUBSCRIPTION_CREATED— a subscription has been createdADDRESS_UPDATE— the subscription's shipping address has changed
Available options:
SUBSCRIPTION_CREATED, ADDRESS_UPDATE Unique identifier of subscription in the subscription manager.
Maximum string length:
100Global-e merchant unique identifier
Unique identifier of external document object, like invoiceId in the subscription manager
Response
Request accepted.
Human-readable message

