Direct Mail API - Postcards

Create a single postcard

This request will create a postcard and perform a mail merge to put the address and any variable data in place.

[POST]
https://ca.stannp.com/api/v1/postcards/create

Parameters

ParameterTypeDescription
sizemandatoryEither "4x6" or "6x9" or "6x11".
Download our 4x6 design guide.
Download our 6x9 design guide.
Download our 6x11 design guide.

Request Example

        curl "https://ca.stannp.com/api/v1/postcards/create" \
-u {API_KEY}: \

    

Response Example

{
  "success": true,
  "data": {
    "pdf": "https://www.stannp.com/assets/samples/a6-postcard-sample.pdf",
    "id": "0",
    "created": "2020-12-17T15:42:22+00:00",
    "format": "A6",
    "cost": "0.78",
    "status": "test"
  }
}

Get a single postcard

Obtain the mailpiece object for the postcard id specified.

[GET]
https://ca.stannp.com/api/v1/postcards/get/:id

Parameters

ParameterTypeDescription
idmandatoryThe ID of the postcard to retrieve.

Request Example

        curl "https://ca.stannp.com/api/v1/postcards/get/:id" \
-u {API_KEY}:
    

Response Example

{
  "success": true,
  "data": {
    "id": "16818211",
    "timestamp": "2019-10-30 00:14:04",
    "status": "cancelled",
    "type": "postcard",
    "format": "A6",
    "pdf_file": "https://dash.stannp.com/api/v1/storage/get/port/1550016843/pdfs/sample.pdf",
    "dispatched": null,
    "country": "GB",
    "cost": "0.00",
    "addons": "",
    "tags": "",
    "postcode": "AB12 3CD",
    "address": "123 Sample Street"
  }
}

Cancel a postcard

You can cancel a postcard if we haven't started processing it yet.

[POST]
https://ca.stannp.com/api/v1/postcards/cancel

Parameters

ParameterTypeDescription
idmandatoryThe ID of the postcard to cancel.

Request Example

        curl "https://ca.stannp.com/api/v1/postcards/cancel" \
-u {API_KEY}: \

    

Response Example

{
  "success": true
}