curl --request POST \
--url https://sendpaperplane.com/v1/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mail_class": "first_class",
"page_count": 1
}
'import requests
url = "https://sendpaperplane.com/v1/quotes"
payload = {
"mail_class": "first_class",
"page_count": 1
}
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({mail_class: 'first_class', page_count: 1})
};
fetch('https://sendpaperplane.com/v1/quotes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({mail_class: 'first_class', page_count: 1})
};
fetch('https://sendpaperplane.com/v1/quotes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sendpaperplane.com/v1/quotes"
payload := strings.NewReader("{\n \"mail_class\": \"first_class\",\n \"page_count\": 1\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))
}require 'uri'
require 'net/http'
url = URI("https://sendpaperplane.com/v1/quotes")
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 \"mail_class\": \"first_class\",\n \"page_count\": 1\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sendpaperplane.com/v1/quotes",
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([
'mail_class' => 'first_class',
'page_count' => 1
]),
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;
}HttpResponse<String> response = Unirest.post("https://sendpaperplane.com/v1/quotes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mail_class\": \"first_class\",\n \"page_count\": 1\n}")
.asString();{
"status": "ok",
"total_cents": 199,
"total": "$1.99",
"breakdown": [
{
"id": "first_class_letter_1_page",
"label": "First-Class letter, 1 page",
"amount_cents": 199
}
],
"note": "All-in price. Postage, printing and the envelope are included; the breakdown lists what makes up the total."
}{
"status": "failed",
"code": "<string>",
"reason": "<string>",
"next": [
"<string>"
]
}{
"status": "failed",
"code": "<string>",
"reason": "<string>",
"next": [
"<string>"
]
}{
"status": "failed",
"code": "<string>",
"reason": "<string>",
"next": [
"<string>"
]
}{
"status": "failed",
"code": "<string>",
"reason": "<string>",
"next": [
"<string>"
]
}Price a letter before sending it
Free — creates nothing and never touches payment. The price is all-in (postage, printing and the envelope included); breakdown lists the piece and any options that make up the total. Quoting first is the recommended shape for agents: it is the safe call, and it tells the user what a send will cost.
Supply to plus text (or pdf_url) and the response also carries a single-use confirmation_token bound to that exact letter and price. POST /v1/orders requires one on the agent path, so this is where a send begins.
curl --request POST \
--url https://sendpaperplane.com/v1/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mail_class": "first_class",
"page_count": 1
}
'import requests
url = "https://sendpaperplane.com/v1/quotes"
payload = {
"mail_class": "first_class",
"page_count": 1
}
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({mail_class: 'first_class', page_count: 1})
};
fetch('https://sendpaperplane.com/v1/quotes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({mail_class: 'first_class', page_count: 1})
};
fetch('https://sendpaperplane.com/v1/quotes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sendpaperplane.com/v1/quotes"
payload := strings.NewReader("{\n \"mail_class\": \"first_class\",\n \"page_count\": 1\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))
}require 'uri'
require 'net/http'
url = URI("https://sendpaperplane.com/v1/quotes")
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 \"mail_class\": \"first_class\",\n \"page_count\": 1\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sendpaperplane.com/v1/quotes",
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([
'mail_class' => 'first_class',
'page_count' => 1
]),
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;
}HttpResponse<String> response = Unirest.post("https://sendpaperplane.com/v1/quotes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mail_class\": \"first_class\",\n \"page_count\": 1\n}")
.asString();{
"status": "ok",
"total_cents": 199,
"total": "$1.99",
"breakdown": [
{
"id": "first_class_letter_1_page",
"label": "First-Class letter, 1 page",
"amount_cents": 199
}
],
"note": "All-in price. Postage, printing and the envelope are included; the breakdown lists what makes up the total."
}{
"status": "failed",
"code": "<string>",
"reason": "<string>",
"next": [
"<string>"
]
}{
"status": "failed",
"code": "<string>",
"reason": "<string>",
"next": [
"<string>"
]
}{
"status": "failed",
"code": "<string>",
"reason": "<string>",
"next": [
"<string>"
]
}{
"status": "failed",
"code": "<string>",
"reason": "<string>",
"next": [
"<string>"
]
}Authorizations
Optional developer API key: Authorization: Bearer pp_live_… (or pp_test_… for a sandbox-only key). Omitting it is a supported way to call every route. A key that is sent and does not verify is refused with 401 rather than treated as anonymous, so a typo fails loudly instead of quietly losing the restriction you meant to apply. Enabled per deployment via SCOPED_API_KEYS.
Body
first_class, certified, certified_err, priority 1 <= x <= 12Hide child attributes
Hide child attributes
1 - 801 - 1201 - 802^\d{5}(-\d{4})?$120"US"50000^up_[0-9a-f]{32}\.pdf$Response
Priced quote. confirmation_token, expires_in_minutes, and next appear only when to and content were supplied.
"ok"-9007199254740991 <= x <= 9007199254740991-9007199254740991 <= x <= 9007199254740991Was this page helpful?