Create a shipment
curl --request POST \
--url https://api.getprimo.com/shipments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fromAddress": {
"street": "<string>",
"postalCode": "<string>",
"city": "<string>",
"name": "<string>",
"contactName": "<string>",
"phone": "<string>",
"complement": "<string>",
"country": "<string>",
"countryCode": "<string>"
},
"toAddress": {
"street": "<string>",
"postalCode": "<string>",
"city": "<string>",
"name": "<string>",
"contactName": "<string>",
"phone": "<string>",
"complement": "<string>",
"country": "<string>",
"countryCode": "<string>"
},
"parcel": {
"weight": 10050,
"length": 505,
"width": 505,
"height": 505
},
"hasInsurance": true,
"value": 123,
"content": [
{
"name": "<string>",
"id": "<string>",
"type": "<string>"
}
],
"billingProfileId": "<string>",
"comment": "<string>",
"notificationEmails": [],
"createBoxShipment": true
}
'import requests
url = "https://api.getprimo.com/shipments"
payload = {
"fromAddress": {
"street": "<string>",
"postalCode": "<string>",
"city": "<string>",
"name": "<string>",
"contactName": "<string>",
"phone": "<string>",
"complement": "<string>",
"country": "<string>",
"countryCode": "<string>"
},
"toAddress": {
"street": "<string>",
"postalCode": "<string>",
"city": "<string>",
"name": "<string>",
"contactName": "<string>",
"phone": "<string>",
"complement": "<string>",
"country": "<string>",
"countryCode": "<string>"
},
"parcel": {
"weight": 10050,
"length": 505,
"width": 505,
"height": 505
},
"hasInsurance": True,
"value": 123,
"content": [
{
"name": "<string>",
"id": "<string>",
"type": "<string>"
}
],
"billingProfileId": "<string>",
"comment": "<string>",
"notificationEmails": [],
"createBoxShipment": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fromAddress: {
street: '<string>',
postalCode: '<string>',
city: '<string>',
name: '<string>',
contactName: '<string>',
phone: '<string>',
complement: '<string>',
country: '<string>',
countryCode: '<string>'
},
toAddress: {
street: '<string>',
postalCode: '<string>',
city: '<string>',
name: '<string>',
contactName: '<string>',
phone: '<string>',
complement: '<string>',
country: '<string>',
countryCode: '<string>'
},
parcel: {weight: 10050, length: 505, width: 505, height: 505},
hasInsurance: true,
value: 123,
content: [{name: '<string>', id: '<string>', type: '<string>'}],
billingProfileId: '<string>',
comment: '<string>',
notificationEmails: [],
createBoxShipment: true
})
};
fetch('https://api.getprimo.com/shipments', 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.getprimo.com/shipments",
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([
'fromAddress' => [
'street' => '<string>',
'postalCode' => '<string>',
'city' => '<string>',
'name' => '<string>',
'contactName' => '<string>',
'phone' => '<string>',
'complement' => '<string>',
'country' => '<string>',
'countryCode' => '<string>'
],
'toAddress' => [
'street' => '<string>',
'postalCode' => '<string>',
'city' => '<string>',
'name' => '<string>',
'contactName' => '<string>',
'phone' => '<string>',
'complement' => '<string>',
'country' => '<string>',
'countryCode' => '<string>'
],
'parcel' => [
'weight' => 10050,
'length' => 505,
'width' => 505,
'height' => 505
],
'hasInsurance' => true,
'value' => 123,
'content' => [
[
'name' => '<string>',
'id' => '<string>',
'type' => '<string>'
]
],
'billingProfileId' => '<string>',
'comment' => '<string>',
'notificationEmails' => [
],
'createBoxShipment' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.getprimo.com/shipments"
payload := strings.NewReader("{\n \"fromAddress\": {\n \"street\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\",\n \"name\": \"<string>\",\n \"contactName\": \"<string>\",\n \"phone\": \"<string>\",\n \"complement\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\"\n },\n \"toAddress\": {\n \"street\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\",\n \"name\": \"<string>\",\n \"contactName\": \"<string>\",\n \"phone\": \"<string>\",\n \"complement\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\"\n },\n \"parcel\": {\n \"weight\": 10050,\n \"length\": 505,\n \"width\": 505,\n \"height\": 505\n },\n \"hasInsurance\": true,\n \"value\": 123,\n \"content\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"billingProfileId\": \"<string>\",\n \"comment\": \"<string>\",\n \"notificationEmails\": [],\n \"createBoxShipment\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.getprimo.com/shipments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fromAddress\": {\n \"street\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\",\n \"name\": \"<string>\",\n \"contactName\": \"<string>\",\n \"phone\": \"<string>\",\n \"complement\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\"\n },\n \"toAddress\": {\n \"street\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\",\n \"name\": \"<string>\",\n \"contactName\": \"<string>\",\n \"phone\": \"<string>\",\n \"complement\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\"\n },\n \"parcel\": {\n \"weight\": 10050,\n \"length\": 505,\n \"width\": 505,\n \"height\": 505\n },\n \"hasInsurance\": true,\n \"value\": 123,\n \"content\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"billingProfileId\": \"<string>\",\n \"comment\": \"<string>\",\n \"notificationEmails\": [],\n \"createBoxShipment\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getprimo.com/shipments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fromAddress\": {\n \"street\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\",\n \"name\": \"<string>\",\n \"contactName\": \"<string>\",\n \"phone\": \"<string>\",\n \"complement\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\"\n },\n \"toAddress\": {\n \"street\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\",\n \"name\": \"<string>\",\n \"contactName\": \"<string>\",\n \"phone\": \"<string>\",\n \"complement\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\"\n },\n \"parcel\": {\n \"weight\": 10050,\n \"length\": 505,\n \"width\": 505,\n \"height\": 505\n },\n \"hasInsurance\": true,\n \"value\": 123,\n \"content\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"billingProfileId\": \"<string>\",\n \"comment\": \"<string>\",\n \"notificationEmails\": [],\n \"createBoxShipment\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true
}Shipments
Create a shipment
Create a new shipment for your company.
Provide sender and recipient addresses, parcel dimensions, content list, and billing profile.
POST
/
shipments
Create a shipment
curl --request POST \
--url https://api.getprimo.com/shipments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fromAddress": {
"street": "<string>",
"postalCode": "<string>",
"city": "<string>",
"name": "<string>",
"contactName": "<string>",
"phone": "<string>",
"complement": "<string>",
"country": "<string>",
"countryCode": "<string>"
},
"toAddress": {
"street": "<string>",
"postalCode": "<string>",
"city": "<string>",
"name": "<string>",
"contactName": "<string>",
"phone": "<string>",
"complement": "<string>",
"country": "<string>",
"countryCode": "<string>"
},
"parcel": {
"weight": 10050,
"length": 505,
"width": 505,
"height": 505
},
"hasInsurance": true,
"value": 123,
"content": [
{
"name": "<string>",
"id": "<string>",
"type": "<string>"
}
],
"billingProfileId": "<string>",
"comment": "<string>",
"notificationEmails": [],
"createBoxShipment": true
}
'import requests
url = "https://api.getprimo.com/shipments"
payload = {
"fromAddress": {
"street": "<string>",
"postalCode": "<string>",
"city": "<string>",
"name": "<string>",
"contactName": "<string>",
"phone": "<string>",
"complement": "<string>",
"country": "<string>",
"countryCode": "<string>"
},
"toAddress": {
"street": "<string>",
"postalCode": "<string>",
"city": "<string>",
"name": "<string>",
"contactName": "<string>",
"phone": "<string>",
"complement": "<string>",
"country": "<string>",
"countryCode": "<string>"
},
"parcel": {
"weight": 10050,
"length": 505,
"width": 505,
"height": 505
},
"hasInsurance": True,
"value": 123,
"content": [
{
"name": "<string>",
"id": "<string>",
"type": "<string>"
}
],
"billingProfileId": "<string>",
"comment": "<string>",
"notificationEmails": [],
"createBoxShipment": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fromAddress: {
street: '<string>',
postalCode: '<string>',
city: '<string>',
name: '<string>',
contactName: '<string>',
phone: '<string>',
complement: '<string>',
country: '<string>',
countryCode: '<string>'
},
toAddress: {
street: '<string>',
postalCode: '<string>',
city: '<string>',
name: '<string>',
contactName: '<string>',
phone: '<string>',
complement: '<string>',
country: '<string>',
countryCode: '<string>'
},
parcel: {weight: 10050, length: 505, width: 505, height: 505},
hasInsurance: true,
value: 123,
content: [{name: '<string>', id: '<string>', type: '<string>'}],
billingProfileId: '<string>',
comment: '<string>',
notificationEmails: [],
createBoxShipment: true
})
};
fetch('https://api.getprimo.com/shipments', 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.getprimo.com/shipments",
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([
'fromAddress' => [
'street' => '<string>',
'postalCode' => '<string>',
'city' => '<string>',
'name' => '<string>',
'contactName' => '<string>',
'phone' => '<string>',
'complement' => '<string>',
'country' => '<string>',
'countryCode' => '<string>'
],
'toAddress' => [
'street' => '<string>',
'postalCode' => '<string>',
'city' => '<string>',
'name' => '<string>',
'contactName' => '<string>',
'phone' => '<string>',
'complement' => '<string>',
'country' => '<string>',
'countryCode' => '<string>'
],
'parcel' => [
'weight' => 10050,
'length' => 505,
'width' => 505,
'height' => 505
],
'hasInsurance' => true,
'value' => 123,
'content' => [
[
'name' => '<string>',
'id' => '<string>',
'type' => '<string>'
]
],
'billingProfileId' => '<string>',
'comment' => '<string>',
'notificationEmails' => [
],
'createBoxShipment' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.getprimo.com/shipments"
payload := strings.NewReader("{\n \"fromAddress\": {\n \"street\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\",\n \"name\": \"<string>\",\n \"contactName\": \"<string>\",\n \"phone\": \"<string>\",\n \"complement\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\"\n },\n \"toAddress\": {\n \"street\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\",\n \"name\": \"<string>\",\n \"contactName\": \"<string>\",\n \"phone\": \"<string>\",\n \"complement\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\"\n },\n \"parcel\": {\n \"weight\": 10050,\n \"length\": 505,\n \"width\": 505,\n \"height\": 505\n },\n \"hasInsurance\": true,\n \"value\": 123,\n \"content\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"billingProfileId\": \"<string>\",\n \"comment\": \"<string>\",\n \"notificationEmails\": [],\n \"createBoxShipment\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.getprimo.com/shipments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fromAddress\": {\n \"street\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\",\n \"name\": \"<string>\",\n \"contactName\": \"<string>\",\n \"phone\": \"<string>\",\n \"complement\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\"\n },\n \"toAddress\": {\n \"street\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\",\n \"name\": \"<string>\",\n \"contactName\": \"<string>\",\n \"phone\": \"<string>\",\n \"complement\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\"\n },\n \"parcel\": {\n \"weight\": 10050,\n \"length\": 505,\n \"width\": 505,\n \"height\": 505\n },\n \"hasInsurance\": true,\n \"value\": 123,\n \"content\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"billingProfileId\": \"<string>\",\n \"comment\": \"<string>\",\n \"notificationEmails\": [],\n \"createBoxShipment\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getprimo.com/shipments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fromAddress\": {\n \"street\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\",\n \"name\": \"<string>\",\n \"contactName\": \"<string>\",\n \"phone\": \"<string>\",\n \"complement\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\"\n },\n \"toAddress\": {\n \"street\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\",\n \"name\": \"<string>\",\n \"contactName\": \"<string>\",\n \"phone\": \"<string>\",\n \"complement\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\"\n },\n \"parcel\": {\n \"weight\": 10050,\n \"length\": 505,\n \"width\": 505,\n \"height\": 505\n },\n \"hasInsurance\": true,\n \"value\": 123,\n \"content\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"billingProfileId\": \"<string>\",\n \"comment\": \"<string>\",\n \"notificationEmails\": [],\n \"createBoxShipment\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true
}Key: Write
Scope: Company
Authorizations
Use your Primo API key in the Authorization header as Bearer <API_KEY>.
Body
application/json
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Required range:
x <= 9007199254740991Show child attributes
Show child attributes
Minimum string length:
1Available options:
ONBOARDING, OFFBOARDING, RENEWAL, SEND_TO_EMPLOYEE, SEND_TO_OFFICE, RECYCLE, REPAIR, RESELL, OTHER, BOX Response
default - application/json
Was this page helpful?
⌘I