cURL
curl -X PATCH "https://{globale_api_domain}/subscriptions/123456" \
-H "Authorization: Bearer {JWT Token}" \
-H "Idempotency-Key: 3f1a7c2e-9b40-4d6f-8a21-5c9e0b7d4a11" \
-H "Content-Type: application/json" \
-d '{"merchantGuid":"1234567890","shippingAddress":{"firstName":"Jane","lastName":"Doe","address1":"Mariahilfer Strasse 10","city":"Berlin","zip":"10115","countryCode":"DE"}}'import requests
url = "https://{globale_api_domain}/subscriptions/{subscriptionId}"
payload = {
"merchantGuid": "1234567890",
"shippingAddress": {
"firstName": "Jane",
"lastName": "Doe",
"address1": "Mariahilfer Strasse 10",
"address2": "Apt 4",
"city": "Berlin",
"stateOrProvince": "Berlin",
"stateCode": "BE",
"zip": "10115",
"countryCode": "DE",
"phone": "+49 30 1234567",
"email": "jane.doe@example.com"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Idempotency-Key': '<idempotency-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantGuid: '1234567890',
shippingAddress: {
firstName: 'Jane',
lastName: 'Doe',
address1: 'Mariahilfer Strasse 10',
address2: 'Apt 4',
city: 'Berlin',
stateOrProvince: 'Berlin',
stateCode: 'BE',
zip: '10115',
countryCode: 'DE',
phone: '+49 30 1234567',
email: 'jane.doe@example.com'
}
})
};
fetch('https://{globale_api_domain}/subscriptions/{subscriptionId}', 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/{subscriptionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'merchantGuid' => '1234567890',
'shippingAddress' => [
'firstName' => 'Jane',
'lastName' => 'Doe',
'address1' => 'Mariahilfer Strasse 10',
'address2' => 'Apt 4',
'city' => 'Berlin',
'stateOrProvince' => 'Berlin',
'stateCode' => 'BE',
'zip' => '10115',
'countryCode' => 'DE',
'phone' => '+49 30 1234567',
'email' => 'jane.doe@example.com'
]
]),
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/{subscriptionId}"
payload := strings.NewReader("{\n \"merchantGuid\": \"1234567890\",\n \"shippingAddress\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"address1\": \"Mariahilfer Strasse 10\",\n \"address2\": \"Apt 4\",\n \"city\": \"Berlin\",\n \"stateOrProvince\": \"Berlin\",\n \"stateCode\": \"BE\",\n \"zip\": \"10115\",\n \"countryCode\": \"DE\",\n \"phone\": \"+49 30 1234567\",\n \"email\": \"jane.doe@example.com\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://{globale_api_domain}/subscriptions/{subscriptionId}")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"merchantGuid\": \"1234567890\",\n \"shippingAddress\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"address1\": \"Mariahilfer Strasse 10\",\n \"address2\": \"Apt 4\",\n \"city\": \"Berlin\",\n \"stateOrProvince\": \"Berlin\",\n \"stateCode\": \"BE\",\n \"zip\": \"10115\",\n \"countryCode\": \"DE\",\n \"phone\": \"+49 30 1234567\",\n \"email\": \"jane.doe@example.com\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{globale_api_domain}/subscriptions/{subscriptionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchantGuid\": \"1234567890\",\n \"shippingAddress\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"address1\": \"Mariahilfer Strasse 10\",\n \"address2\": \"Apt 4\",\n \"city\": \"Berlin\",\n \"stateOrProvince\": \"Berlin\",\n \"stateCode\": \"BE\",\n \"zip\": \"10115\",\n \"countryCode\": \"DE\",\n \"phone\": \"+49 30 1234567\",\n \"email\": \"jane.doe@example.com\"\n }\n}"
response = http.request(request)
puts response.read_bodyUpdate a subscription (Subscription Manager to Global-e)
Subscription Manager calls Global-e to patch an existing subscription. Only the fields present in the request body are updated. Currently the only patchable field is the shipping address; its country cannot be changed (same country only).
PATCH
/
subscriptions
/
{subscriptionId}
cURL
curl -X PATCH "https://{globale_api_domain}/subscriptions/123456" \
-H "Authorization: Bearer {JWT Token}" \
-H "Idempotency-Key: 3f1a7c2e-9b40-4d6f-8a21-5c9e0b7d4a11" \
-H "Content-Type: application/json" \
-d '{"merchantGuid":"1234567890","shippingAddress":{"firstName":"Jane","lastName":"Doe","address1":"Mariahilfer Strasse 10","city":"Berlin","zip":"10115","countryCode":"DE"}}'import requests
url = "https://{globale_api_domain}/subscriptions/{subscriptionId}"
payload = {
"merchantGuid": "1234567890",
"shippingAddress": {
"firstName": "Jane",
"lastName": "Doe",
"address1": "Mariahilfer Strasse 10",
"address2": "Apt 4",
"city": "Berlin",
"stateOrProvince": "Berlin",
"stateCode": "BE",
"zip": "10115",
"countryCode": "DE",
"phone": "+49 30 1234567",
"email": "jane.doe@example.com"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Idempotency-Key': '<idempotency-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantGuid: '1234567890',
shippingAddress: {
firstName: 'Jane',
lastName: 'Doe',
address1: 'Mariahilfer Strasse 10',
address2: 'Apt 4',
city: 'Berlin',
stateOrProvince: 'Berlin',
stateCode: 'BE',
zip: '10115',
countryCode: 'DE',
phone: '+49 30 1234567',
email: 'jane.doe@example.com'
}
})
};
fetch('https://{globale_api_domain}/subscriptions/{subscriptionId}', 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/{subscriptionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'merchantGuid' => '1234567890',
'shippingAddress' => [
'firstName' => 'Jane',
'lastName' => 'Doe',
'address1' => 'Mariahilfer Strasse 10',
'address2' => 'Apt 4',
'city' => 'Berlin',
'stateOrProvince' => 'Berlin',
'stateCode' => 'BE',
'zip' => '10115',
'countryCode' => 'DE',
'phone' => '+49 30 1234567',
'email' => 'jane.doe@example.com'
]
]),
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/{subscriptionId}"
payload := strings.NewReader("{\n \"merchantGuid\": \"1234567890\",\n \"shippingAddress\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"address1\": \"Mariahilfer Strasse 10\",\n \"address2\": \"Apt 4\",\n \"city\": \"Berlin\",\n \"stateOrProvince\": \"Berlin\",\n \"stateCode\": \"BE\",\n \"zip\": \"10115\",\n \"countryCode\": \"DE\",\n \"phone\": \"+49 30 1234567\",\n \"email\": \"jane.doe@example.com\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://{globale_api_domain}/subscriptions/{subscriptionId}")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"merchantGuid\": \"1234567890\",\n \"shippingAddress\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"address1\": \"Mariahilfer Strasse 10\",\n \"address2\": \"Apt 4\",\n \"city\": \"Berlin\",\n \"stateOrProvince\": \"Berlin\",\n \"stateCode\": \"BE\",\n \"zip\": \"10115\",\n \"countryCode\": \"DE\",\n \"phone\": \"+49 30 1234567\",\n \"email\": \"jane.doe@example.com\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{globale_api_domain}/subscriptions/{subscriptionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchantGuid\": \"1234567890\",\n \"shippingAddress\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"address1\": \"Mariahilfer Strasse 10\",\n \"address2\": \"Apt 4\",\n \"city\": \"Berlin\",\n \"stateOrProvince\": \"Berlin\",\n \"stateCode\": \"BE\",\n \"zip\": \"10115\",\n \"countryCode\": \"DE\",\n \"phone\": \"+49 30 1234567\",\n \"email\": \"jane.doe@example.com\"\n }\n}"
response = http.request(request)
puts response.read_bodyPart of the Subscription Connector integration guide — see it for when and how to use this endpoint.
Headers
Path Parameters
Body
application/json
Request to patch an existing subscription. Only the properties present in the request are updated. Currently only shippingAddress is supported.
Response
No Content - the subscription was updated; no response body is returned.

