curl --request POST \
--url https://{globale_api_domain}/api/shipments/documents/upload \
--header 'Content-Type: application/json' \
--data '
{
"TrackingNumber": "JD014600004882753258",
"Documents": [
{
"DocumentType": "EAD",
"DocumentReference": "26GB02I89012847596",
"DocumentData": "JVBERi0xLjcNCi..."
}
]
}
'import requests
url = "https://{globale_api_domain}/api/shipments/documents/upload"
payload = {
"TrackingNumber": "JD014600004882753258",
"Documents": [
{
"DocumentType": "EAD",
"DocumentReference": "26GB02I89012847596",
"DocumentData": "JVBERi0xLjcNCi..."
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
TrackingNumber: 'JD014600004882753258',
Documents: [
{
DocumentType: 'EAD',
DocumentReference: '26GB02I89012847596',
DocumentData: 'JVBERi0xLjcNCi...'
}
]
})
};
fetch('https://{globale_api_domain}/api/shipments/documents/upload', 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}/api/shipments/documents/upload",
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([
'TrackingNumber' => 'JD014600004882753258',
'Documents' => [
[
'DocumentType' => 'EAD',
'DocumentReference' => '26GB02I89012847596',
'DocumentData' => 'JVBERi0xLjcNCi...'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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}/api/shipments/documents/upload"
payload := strings.NewReader("{\n \"TrackingNumber\": \"JD014600004882753258\",\n \"Documents\": [\n {\n \"DocumentType\": \"EAD\",\n \"DocumentReference\": \"26GB02I89012847596\",\n \"DocumentData\": \"JVBERi0xLjcNCi...\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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}/api/shipments/documents/upload")
.header("Content-Type", "application/json")
.body("{\n \"TrackingNumber\": \"JD014600004882753258\",\n \"Documents\": [\n {\n \"DocumentType\": \"EAD\",\n \"DocumentReference\": \"26GB02I89012847596\",\n \"DocumentData\": \"JVBERi0xLjcNCi...\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{globale_api_domain}/api/shipments/documents/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"TrackingNumber\": \"JD014600004882753258\",\n \"Documents\": [\n {\n \"DocumentType\": \"EAD\",\n \"DocumentReference\": \"26GB02I89012847596\",\n \"DocumentData\": \"JVBERi0xLjcNCi...\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"Success": true
}Upload shipment documents (Merchant to Global-e)
Attach a customs document — the EAD and its MRN reference — to a shipment Global-e has already created, before the parcel is dispatched.
curl --request POST \
--url https://{globale_api_domain}/api/shipments/documents/upload \
--header 'Content-Type: application/json' \
--data '
{
"TrackingNumber": "JD014600004882753258",
"Documents": [
{
"DocumentType": "EAD",
"DocumentReference": "26GB02I89012847596",
"DocumentData": "JVBERi0xLjcNCi..."
}
]
}
'import requests
url = "https://{globale_api_domain}/api/shipments/documents/upload"
payload = {
"TrackingNumber": "JD014600004882753258",
"Documents": [
{
"DocumentType": "EAD",
"DocumentReference": "26GB02I89012847596",
"DocumentData": "JVBERi0xLjcNCi..."
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
TrackingNumber: 'JD014600004882753258',
Documents: [
{
DocumentType: 'EAD',
DocumentReference: '26GB02I89012847596',
DocumentData: 'JVBERi0xLjcNCi...'
}
]
})
};
fetch('https://{globale_api_domain}/api/shipments/documents/upload', 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}/api/shipments/documents/upload",
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([
'TrackingNumber' => 'JD014600004882753258',
'Documents' => [
[
'DocumentType' => 'EAD',
'DocumentReference' => '26GB02I89012847596',
'DocumentData' => 'JVBERi0xLjcNCi...'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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}/api/shipments/documents/upload"
payload := strings.NewReader("{\n \"TrackingNumber\": \"JD014600004882753258\",\n \"Documents\": [\n {\n \"DocumentType\": \"EAD\",\n \"DocumentReference\": \"26GB02I89012847596\",\n \"DocumentData\": \"JVBERi0xLjcNCi...\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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}/api/shipments/documents/upload")
.header("Content-Type", "application/json")
.body("{\n \"TrackingNumber\": \"JD014600004882753258\",\n \"Documents\": [\n {\n \"DocumentType\": \"EAD\",\n \"DocumentReference\": \"26GB02I89012847596\",\n \"DocumentData\": \"JVBERi0xLjcNCi...\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{globale_api_domain}/api/shipments/documents/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"TrackingNumber\": \"JD014600004882753258\",\n \"Documents\": [\n {\n \"DocumentType\": \"EAD\",\n \"DocumentReference\": \"26GB02I89012847596\",\n \"DocumentData\": \"JVBERi0xLjcNCi...\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"Success": true
}403 Forbidden with no response body.- Get shipping documents — obtain the label and tracking number
- Submit bonded information — report bonded vs free-circulation status per product (when bonded reporting is required)
- Get shipment information — retrieve product, pricing and declaration header data (when you need the data Global-e holds)
- Create the export document — your side, not a Global-e API
- Upload shipment documents — upload the document and its reference to Global-e (when a document must be attached)
- Dispatch orders — End of Day
Body
Tracking number of the shipment, as returned by GetShippingDocuments. Identifies the shipment the documents are attached to, and must belong to your merchant account.
"JD014600004882753258"
The documents to attach to this shipment. At least one document must be provided; an empty list is rejected with A617. The current supported document type is EAD, and one EAD is attached per call. The list is an array so that further document types can be added later without changing the shape of the request.
1Show child attributes
Show child attributes
Response
The document was validated and stored against the shipment. Storage only — Global-e forwards the document and its reference to the carrier asynchronously afterwards, so this response is not a confirmation that the carrier has accepted it.
Indicates that the document was stored against the shipment. Returned only with HTTP 200, and always true. Failures are returned as an error response instead.
true

