Reporting API - Stannp Direct Mail API Documentation

Reporting Summary

Retrieves a status summary on individual items within a date range. Use a start date and end date in the following format: YYYY-MM-DD. The end date will include everything on that day.

[GET]
https://api-us1.stannp.com/api/v1/reporting/summary/:startdate/:enddate

Parameters

ParameterTypeDescription
receivedstringWe have received the request.
producingstringWe are printing or finishing the mailpiece.
handed_overstringWe have handed the mailpiece over to the delivery service (Canada Post, etc.).
local_deliverystringThe item is at the final delivery office and will be delivered within 24 hours.
deliveredstringWe estimate the item has been successfully delivered.
returnedstringThe item was returned. Normally due to incorrect recipient details.
cancelledstringThe item has been cancelled before it was produced and posted.

Request Example

        curl "https://api-us1.stannp.com/api/v1/reporting/summary/:startdate/:enddate" \
-u {API_KEY}:
    

Response Example

{
  "success": true,
  "data": {
    "total": 2000,
    "received": 0,
    "printing": 0,
    "handed_over": 0,
    "local_delivery": 400,
    "delivered": 1599,
    "returned": 1,
    "cancelled": 0
  }
}

List Mailpieces

Retrieves a list of mailpiece objects sent within the specified date range. Status and tag filters are optional.

[GET]
https://api-us1.stannp.com/api/v1/reporting/list/:startdate/:enddate/[:status]/[:tag]

Parameters

ParameterTypeDescription
startdatedateStart date of the reporting period (YYYY-MM-DD).
enddatedateEnd date of the reporting period (YYYY-MM-DD).
statusstringStatus filter (e.g., delivered, returned, etc.).
tagstringTag filter for searching by custom tags.

Request Example

        curl "https://api-us1.stannp.com/api/v1/reporting/list/:startdate/:enddate/[:status]/[:tag]" \
-u {API_KEY}:
    

Response Example

{
  "success": true,
  "data": {
    "singles": [
      {
        "id": "6829954",
        "timestamp": "2018-02-11 07:08:55",
        "status": "delivered",
        "type": "postcard",
        "format": "A6",
        "pdf_file": "https://dash.stannp.com/api/v1/storage/get/bourbon/1518386934/pdf-production/000000000000000-0000000.pdf",
        "dispatched": "2018-02-11 15:12:52",
        "country": "CA",
        "cost": "0.42",
        "addons": "",
        "tags": "tag123,tag456",
        "postcode": "M5G 1X8",
        "address": "1234 Maple Street, Toronto, ON M5G 1X8"
      }
    ]
  }
}