Create Shipment Document
curl --request POST \
--url https://api.upwell.com/api/rest/shipments/{shipmentId}/documents \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"shipmentId": "shi_01HZX4K7LOAD",
"input": {
"base64": "JVBERi0xLjQKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0NvdW50IDEvS2lkc1szIDAgUl0+PmVuZG9iagozIDAgb2JqPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9NZWRpYUJveFswIDAgMyAzXT4+ZW5kb2JqCnRyYWlsZXI8PC9Sb290IDEgMCBSPj4KJSVFT0YK",
"mimeType": "application/pdf",
"type": "PROOF_OF_DELIVERY",
"filename": "pod.pdf",
"visibleToCarrier": true,
"visibleToCustomer": false
}
}
'import requests
url = "https://api.upwell.com/api/rest/shipments/{shipmentId}/documents"
payload = {
"shipmentId": "shi_01HZX4K7LOAD",
"input": {
"base64": "JVBERi0xLjQKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0NvdW50IDEvS2lkc1szIDAgUl0+PmVuZG9iagozIDAgb2JqPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9NZWRpYUJveFswIDAgMyAzXT4+ZW5kb2JqCnRyYWlsZXI8PC9Sb290IDEgMCBSPj4KJSVFT0YK",
"mimeType": "application/pdf",
"type": "PROOF_OF_DELIVERY",
"filename": "pod.pdf",
"visibleToCarrier": True,
"visibleToCustomer": False
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
shipmentId: 'shi_01HZX4K7LOAD',
input: {
base64: 'JVBERi0xLjQKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0NvdW50IDEvS2lkc1szIDAgUl0+PmVuZG9iagozIDAgb2JqPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9NZWRpYUJveFswIDAgMyAzXT4+ZW5kb2JqCnRyYWlsZXI8PC9Sb290IDEgMCBSPj4KJSVFT0YK',
mimeType: 'application/pdf',
type: 'PROOF_OF_DELIVERY',
filename: 'pod.pdf',
visibleToCarrier: true,
visibleToCustomer: false
}
})
};
fetch('https://api.upwell.com/api/rest/shipments/{shipmentId}/documents', 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://api.upwell.com/api/rest/shipments/{shipmentId}/documents",
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([
'shipmentId' => 'shi_01HZX4K7LOAD',
'input' => [
'base64' => 'JVBERi0xLjQKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0NvdW50IDEvS2lkc1szIDAgUl0+PmVuZG9iagozIDAgb2JqPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9NZWRpYUJveFswIDAgMyAzXT4+ZW5kb2JqCnRyYWlsZXI8PC9Sb290IDEgMCBSPj4KJSVFT0YK',
'mimeType' => 'application/pdf',
'type' => 'PROOF_OF_DELIVERY',
'filename' => 'pod.pdf',
'visibleToCarrier' => true,
'visibleToCustomer' => false
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://api.upwell.com/api/rest/shipments/{shipmentId}/documents"
payload := strings.NewReader("{\n \"shipmentId\": \"shi_01HZX4K7LOAD\",\n \"input\": {\n \"base64\": \"JVBERi0xLjQKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0NvdW50IDEvS2lkc1szIDAgUl0+PmVuZG9iagozIDAgb2JqPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9NZWRpYUJveFswIDAgMyAzXT4+ZW5kb2JqCnRyYWlsZXI8PC9Sb290IDEgMCBSPj4KJSVFT0YK\",\n \"mimeType\": \"application/pdf\",\n \"type\": \"PROOF_OF_DELIVERY\",\n \"filename\": \"pod.pdf\",\n \"visibleToCarrier\": true,\n \"visibleToCustomer\": false\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-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://api.upwell.com/api/rest/shipments/{shipmentId}/documents")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"shipmentId\": \"shi_01HZX4K7LOAD\",\n \"input\": {\n \"base64\": \"JVBERi0xLjQKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0NvdW50IDEvS2lkc1szIDAgUl0+PmVuZG9iagozIDAgb2JqPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9NZWRpYUJveFswIDAgMyAzXT4+ZW5kb2JqCnRyYWlsZXI8PC9Sb290IDEgMCBSPj4KJSVFT0YK\",\n \"mimeType\": \"application/pdf\",\n \"type\": \"PROOF_OF_DELIVERY\",\n \"filename\": \"pod.pdf\",\n \"visibleToCarrier\": true,\n \"visibleToCustomer\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upwell.com/api/rest/shipments/{shipmentId}/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"shipmentId\": \"shi_01HZX4K7LOAD\",\n \"input\": {\n \"base64\": \"JVBERi0xLjQKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0NvdW50IDEvS2lkc1szIDAgUl0+PmVuZG9iagozIDAgb2JqPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9NZWRpYUJveFswIDAgMyAzXT4+ZW5kb2JqCnRyYWlsZXI8PC9Sb290IDEgMCBSPj4KJSVFT0YK\",\n \"mimeType\": \"application/pdf\",\n \"type\": \"PROOF_OF_DELIVERY\",\n \"filename\": \"pod.pdf\",\n \"visibleToCarrier\": true,\n \"visibleToCustomer\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"createShipmentDocument": {
"id": "file_01HZX4K7POD",
"documentId": "doc_01HZX4K7POD"
}
}{
"error": "Not-NULL violation. null value in column \"shipment_id\" of relation \"shipments\" violates not-null constraint",
"code": "constraint-violation"
}{
"error": "Authentication hook unauthorized this request",
"path": "$",
"code": "access-denied"
}Shipment Documents
Create Shipment Document
Create a new shipment document
POST
/
api
/
rest
/
shipments
/
{shipmentId}
/
documents
Create Shipment Document
curl --request POST \
--url https://api.upwell.com/api/rest/shipments/{shipmentId}/documents \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"shipmentId": "shi_01HZX4K7LOAD",
"input": {
"base64": "JVBERi0xLjQKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0NvdW50IDEvS2lkc1szIDAgUl0+PmVuZG9iagozIDAgb2JqPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9NZWRpYUJveFswIDAgMyAzXT4+ZW5kb2JqCnRyYWlsZXI8PC9Sb290IDEgMCBSPj4KJSVFT0YK",
"mimeType": "application/pdf",
"type": "PROOF_OF_DELIVERY",
"filename": "pod.pdf",
"visibleToCarrier": true,
"visibleToCustomer": false
}
}
'import requests
url = "https://api.upwell.com/api/rest/shipments/{shipmentId}/documents"
payload = {
"shipmentId": "shi_01HZX4K7LOAD",
"input": {
"base64": "JVBERi0xLjQKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0NvdW50IDEvS2lkc1szIDAgUl0+PmVuZG9iagozIDAgb2JqPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9NZWRpYUJveFswIDAgMyAzXT4+ZW5kb2JqCnRyYWlsZXI8PC9Sb290IDEgMCBSPj4KJSVFT0YK",
"mimeType": "application/pdf",
"type": "PROOF_OF_DELIVERY",
"filename": "pod.pdf",
"visibleToCarrier": True,
"visibleToCustomer": False
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
shipmentId: 'shi_01HZX4K7LOAD',
input: {
base64: 'JVBERi0xLjQKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0NvdW50IDEvS2lkc1szIDAgUl0+PmVuZG9iagozIDAgb2JqPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9NZWRpYUJveFswIDAgMyAzXT4+ZW5kb2JqCnRyYWlsZXI8PC9Sb290IDEgMCBSPj4KJSVFT0YK',
mimeType: 'application/pdf',
type: 'PROOF_OF_DELIVERY',
filename: 'pod.pdf',
visibleToCarrier: true,
visibleToCustomer: false
}
})
};
fetch('https://api.upwell.com/api/rest/shipments/{shipmentId}/documents', 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://api.upwell.com/api/rest/shipments/{shipmentId}/documents",
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([
'shipmentId' => 'shi_01HZX4K7LOAD',
'input' => [
'base64' => 'JVBERi0xLjQKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0NvdW50IDEvS2lkc1szIDAgUl0+PmVuZG9iagozIDAgb2JqPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9NZWRpYUJveFswIDAgMyAzXT4+ZW5kb2JqCnRyYWlsZXI8PC9Sb290IDEgMCBSPj4KJSVFT0YK',
'mimeType' => 'application/pdf',
'type' => 'PROOF_OF_DELIVERY',
'filename' => 'pod.pdf',
'visibleToCarrier' => true,
'visibleToCustomer' => false
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://api.upwell.com/api/rest/shipments/{shipmentId}/documents"
payload := strings.NewReader("{\n \"shipmentId\": \"shi_01HZX4K7LOAD\",\n \"input\": {\n \"base64\": \"JVBERi0xLjQKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0NvdW50IDEvS2lkc1szIDAgUl0+PmVuZG9iagozIDAgb2JqPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9NZWRpYUJveFswIDAgMyAzXT4+ZW5kb2JqCnRyYWlsZXI8PC9Sb290IDEgMCBSPj4KJSVFT0YK\",\n \"mimeType\": \"application/pdf\",\n \"type\": \"PROOF_OF_DELIVERY\",\n \"filename\": \"pod.pdf\",\n \"visibleToCarrier\": true,\n \"visibleToCustomer\": false\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-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://api.upwell.com/api/rest/shipments/{shipmentId}/documents")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"shipmentId\": \"shi_01HZX4K7LOAD\",\n \"input\": {\n \"base64\": \"JVBERi0xLjQKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0NvdW50IDEvS2lkc1szIDAgUl0+PmVuZG9iagozIDAgb2JqPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9NZWRpYUJveFswIDAgMyAzXT4+ZW5kb2JqCnRyYWlsZXI8PC9Sb290IDEgMCBSPj4KJSVFT0YK\",\n \"mimeType\": \"application/pdf\",\n \"type\": \"PROOF_OF_DELIVERY\",\n \"filename\": \"pod.pdf\",\n \"visibleToCarrier\": true,\n \"visibleToCustomer\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upwell.com/api/rest/shipments/{shipmentId}/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"shipmentId\": \"shi_01HZX4K7LOAD\",\n \"input\": {\n \"base64\": \"JVBERi0xLjQKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0NvdW50IDEvS2lkc1szIDAgUl0+PmVuZG9iagozIDAgb2JqPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9NZWRpYUJveFswIDAgMyAzXT4+ZW5kb2JqCnRyYWlsZXI8PC9Sb290IDEgMCBSPj4KJSVFT0YK\",\n \"mimeType\": \"application/pdf\",\n \"type\": \"PROOF_OF_DELIVERY\",\n \"filename\": \"pod.pdf\",\n \"visibleToCarrier\": true,\n \"visibleToCustomer\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"createShipmentDocument": {
"id": "file_01HZX4K7POD",
"documentId": "doc_01HZX4K7POD"
}
}{
"error": "Not-NULL violation. null value in column \"shipment_id\" of relation \"shipments\" violates not-null constraint",
"code": "constraint-violation"
}{
"error": "Authentication hook unauthorized this request",
"path": "$",
"code": "access-denied"
}Authorizations
Path Parameters
Body
application/json
Query parameters can also be provided in the request body as a JSON object
Response
Responses for POST /api/rest/shipments/{shipmentId}/documents

