Create a parcels report
curl --request POST \
--url https://panel.sendcloud.sc/api/v2/reporting/parcels \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"fields": [],
"filters": {
"direction": "outgoing",
"integration_id": 2,
"updated_after": "2023-11-07T05:31:56Z",
"updated_before": "2023-11-07T05:31:56Z",
"announced_after": "2023-11-07T05:31:56Z",
"announced_before": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://panel.sendcloud.sc/api/v2/reporting/parcels"
payload = {
"fields": [],
"filters": {
"direction": "outgoing",
"integration_id": 2,
"updated_after": "2023-11-07T05:31:56Z",
"updated_before": "2023-11-07T05:31:56Z",
"announced_after": "2023-11-07T05:31:56Z",
"announced_before": "2023-11-07T05:31:56Z"
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fields: [],
filters: {
direction: 'outgoing',
integration_id: 2,
updated_after: '2023-11-07T05:31:56Z',
updated_before: '2023-11-07T05:31:56Z',
announced_after: '2023-11-07T05:31:56Z',
announced_before: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://panel.sendcloud.sc/api/v2/reporting/parcels', 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://panel.sendcloud.sc/api/v2/reporting/parcels",
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([
'fields' => [
],
'filters' => [
'direction' => 'outgoing',
'integration_id' => 2,
'updated_after' => '2023-11-07T05:31:56Z',
'updated_before' => '2023-11-07T05:31:56Z',
'announced_after' => '2023-11-07T05:31:56Z',
'announced_before' => '2023-11-07T05:31:56Z'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://panel.sendcloud.sc/api/v2/reporting/parcels"
payload := strings.NewReader("{\n \"fields\": [],\n \"filters\": {\n \"direction\": \"outgoing\",\n \"integration_id\": 2,\n \"updated_after\": \"2023-11-07T05:31:56Z\",\n \"updated_before\": \"2023-11-07T05:31:56Z\",\n \"announced_after\": \"2023-11-07T05:31:56Z\",\n \"announced_before\": \"2023-11-07T05:31:56Z\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://panel.sendcloud.sc/api/v2/reporting/parcels")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"fields\": [],\n \"filters\": {\n \"direction\": \"outgoing\",\n \"integration_id\": 2,\n \"updated_after\": \"2023-11-07T05:31:56Z\",\n \"updated_before\": \"2023-11-07T05:31:56Z\",\n \"announced_after\": \"2023-11-07T05:31:56Z\",\n \"announced_before\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://panel.sendcloud.sc/api/v2/reporting/parcels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fields\": [],\n \"filters\": {\n \"direction\": \"outgoing\",\n \"integration_id\": 2,\n \"updated_after\": \"2023-11-07T05:31:56Z\",\n \"updated_before\": \"2023-11-07T05:31:56Z\",\n \"announced_after\": \"2023-11-07T05:31:56Z\",\n \"announced_before\": \"2023-11-07T05:31:56Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"filters": {
"direction": "outgoing",
"integration_id": 2,
"updated_after": "2023-11-07T05:31:56Z",
"updated_before": "2023-11-07T05:31:56Z",
"announced_after": "2023-11-07T05:31:56Z",
"announced_before": "2023-11-07T05:31:56Z"
},
"fields": [
"parcel_id"
],
"id": "419f3be0-2f49-434b-bee4-d8cff9cf7d01",
"user_id": 1,
"status": "ready",
"status_message": "The report is ready",
"url": "https://reporting-service.s3.eu-central-1.amazonaws.com/reports/report-type/2021-08-09/afc46bb9-95d3-4880-80f7-660da3e68b5c.csv",
"expires_at": "2022-07-14T08:38:10.226217Z",
"updated_at": "2022-07-14T08:23:10.226265Z",
"created_at": "2022-07-14T08:23:10.226265Z"
}{
"detail": [
{
"loc": [
"body",
"fields"
],
"msg": "value is not a valid enumeration member; permitted: 'parcel_id', 'direction', 'carrier_code', 'carrier_name', 'from_company_name', 'contract_id', 'contract_type', 'origin_city', 'origin_postal_code', 'origin_country_code', 'origin_country_name', 'destination_city', 'destination_postal_code', 'destination_country_code', 'destination_country_name', 'order_number', 'tracking_number', 'created_at', 'updated_at', 'announced_at', 'shipped_at', 'first_delivery_at', 'arrived_at', 'shipping_method', 'shipping_method_name', 'price', 'global_status_slug', 'carrier_status', 'integration_id', 'integration_type', 'weight'",
"type": "type_error.enum",
"ctx": {
"enum_values": [
"parcel_id",
"direction",
"carrier_code",
"carrier_name",
"from_company_name",
"contract_id",
"contract_type",
"origin_city",
"origin_postal_code",
"origin_country_code",
"origin_country_name",
"destination_city",
"destination_postal_code",
"destination_country_code",
"destination_country_name",
"order_number",
"tracking_number",
"created_at",
"updated_at",
"announced_at",
"shipped_at",
"first_delivery_at",
"arrived_at",
"shipping_method",
"shipping_method_name",
"price",
"global_status_slug",
"carrier_status",
"integration_id",
"integration_type",
"weight"
]
}
}
]
}Reporting API
Create a parcels report
Generate a CSV report containing information about outgoing or incoming parcels.
POST
/
reporting
/
parcels
Create a parcels report
curl --request POST \
--url https://panel.sendcloud.sc/api/v2/reporting/parcels \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"fields": [],
"filters": {
"direction": "outgoing",
"integration_id": 2,
"updated_after": "2023-11-07T05:31:56Z",
"updated_before": "2023-11-07T05:31:56Z",
"announced_after": "2023-11-07T05:31:56Z",
"announced_before": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://panel.sendcloud.sc/api/v2/reporting/parcels"
payload = {
"fields": [],
"filters": {
"direction": "outgoing",
"integration_id": 2,
"updated_after": "2023-11-07T05:31:56Z",
"updated_before": "2023-11-07T05:31:56Z",
"announced_after": "2023-11-07T05:31:56Z",
"announced_before": "2023-11-07T05:31:56Z"
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fields: [],
filters: {
direction: 'outgoing',
integration_id: 2,
updated_after: '2023-11-07T05:31:56Z',
updated_before: '2023-11-07T05:31:56Z',
announced_after: '2023-11-07T05:31:56Z',
announced_before: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://panel.sendcloud.sc/api/v2/reporting/parcels', 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://panel.sendcloud.sc/api/v2/reporting/parcels",
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([
'fields' => [
],
'filters' => [
'direction' => 'outgoing',
'integration_id' => 2,
'updated_after' => '2023-11-07T05:31:56Z',
'updated_before' => '2023-11-07T05:31:56Z',
'announced_after' => '2023-11-07T05:31:56Z',
'announced_before' => '2023-11-07T05:31:56Z'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://panel.sendcloud.sc/api/v2/reporting/parcels"
payload := strings.NewReader("{\n \"fields\": [],\n \"filters\": {\n \"direction\": \"outgoing\",\n \"integration_id\": 2,\n \"updated_after\": \"2023-11-07T05:31:56Z\",\n \"updated_before\": \"2023-11-07T05:31:56Z\",\n \"announced_after\": \"2023-11-07T05:31:56Z\",\n \"announced_before\": \"2023-11-07T05:31:56Z\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://panel.sendcloud.sc/api/v2/reporting/parcels")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"fields\": [],\n \"filters\": {\n \"direction\": \"outgoing\",\n \"integration_id\": 2,\n \"updated_after\": \"2023-11-07T05:31:56Z\",\n \"updated_before\": \"2023-11-07T05:31:56Z\",\n \"announced_after\": \"2023-11-07T05:31:56Z\",\n \"announced_before\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://panel.sendcloud.sc/api/v2/reporting/parcels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fields\": [],\n \"filters\": {\n \"direction\": \"outgoing\",\n \"integration_id\": 2,\n \"updated_after\": \"2023-11-07T05:31:56Z\",\n \"updated_before\": \"2023-11-07T05:31:56Z\",\n \"announced_after\": \"2023-11-07T05:31:56Z\",\n \"announced_before\": \"2023-11-07T05:31:56Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"filters": {
"direction": "outgoing",
"integration_id": 2,
"updated_after": "2023-11-07T05:31:56Z",
"updated_before": "2023-11-07T05:31:56Z",
"announced_after": "2023-11-07T05:31:56Z",
"announced_before": "2023-11-07T05:31:56Z"
},
"fields": [
"parcel_id"
],
"id": "419f3be0-2f49-434b-bee4-d8cff9cf7d01",
"user_id": 1,
"status": "ready",
"status_message": "The report is ready",
"url": "https://reporting-service.s3.eu-central-1.amazonaws.com/reports/report-type/2021-08-09/afc46bb9-95d3-4880-80f7-660da3e68b5c.csv",
"expires_at": "2022-07-14T08:38:10.226217Z",
"updated_at": "2022-07-14T08:23:10.226265Z",
"created_at": "2022-07-14T08:23:10.226265Z"
}{
"detail": [
{
"loc": [
"body",
"fields"
],
"msg": "value is not a valid enumeration member; permitted: 'parcel_id', 'direction', 'carrier_code', 'carrier_name', 'from_company_name', 'contract_id', 'contract_type', 'origin_city', 'origin_postal_code', 'origin_country_code', 'origin_country_name', 'destination_city', 'destination_postal_code', 'destination_country_code', 'destination_country_name', 'order_number', 'tracking_number', 'created_at', 'updated_at', 'announced_at', 'shipped_at', 'first_delivery_at', 'arrived_at', 'shipping_method', 'shipping_method_name', 'price', 'global_status_slug', 'carrier_status', 'integration_id', 'integration_type', 'weight'",
"type": "type_error.enum",
"ctx": {
"enum_values": [
"parcel_id",
"direction",
"carrier_code",
"carrier_name",
"from_company_name",
"contract_id",
"contract_type",
"origin_city",
"origin_postal_code",
"origin_country_code",
"origin_country_name",
"destination_city",
"destination_postal_code",
"destination_country_code",
"destination_country_name",
"order_number",
"tracking_number",
"created_at",
"updated_at",
"announced_at",
"shipped_at",
"first_delivery_at",
"arrived_at",
"shipping_method",
"shipping_method_name",
"price",
"global_status_slug",
"carrier_status",
"integration_id",
"integration_type",
"weight"
]
}
}
]
}OAuth2 scopes required:
read:analytics. See Scopes for OAuth apps.filters provided, and the columns will be determined by the fields parameter.
Use this endpoint to create the report and obtain the report id, which you will use to obtain the actual CSV download via the Retrieve a parcels report endpoint.Authorizations
HTTPBasicAuthOAuth2ClientCreds
Body
application/json
A parcel report request
The parcel fields to include for the report
Available options:
parcel_id, direction, carrier_code, carrier_name, from_company_name, contract_id, contract_type, origin_city, origin_postal_code, origin_country_code, origin_country_name, destination_city, destination_postal_code, destination_country_code, destination_country_name, order_number, tracking_number, created_at, updated_at, announced_at, shipped_at, first_delivery_at, arrived_at, shipping_method, shipping_method_name, price, global_status_slug, carrier_status, integration_id, integration_type, weight Response
Successful Response
Report information
This model contains information about the creation of a report and the status of processing such report.
The parcel fields to include for the report
Available options:
parcel_id, direction, carrier_code, carrier_name, from_company_name, contract_id, contract_type, origin_city, origin_postal_code, origin_country_code, origin_country_name, destination_city, destination_postal_code, destination_country_code, destination_country_name, order_number, tracking_number, created_at, updated_at, announced_at, shipped_at, first_delivery_at, arrived_at, shipping_method, shipping_method_name, price, global_status_slug, carrier_status, integration_id, integration_type, weight