API docs

Create a product listing-publication

POST
/publication/create

Create a product listing that users can order via the Peecho Checkout. After creation, you can use the ID returned by the endpoint and go to https://test.www.peecho.com/print/{ID} to view the checkout page for that product or publication.

The product listing can be set up as a single product with a specific price, or as multiple products from the same category with prices determined by the profit markup defined in your account settings.

Request Body

application/json
  1. body
apiKey?string

API key of your account

order?

The merchant reference number

customSpine?string

Here you can provide an URL to the spine (OR use the following fields to give us texts and fonts and we build it for you)

spineColorHex?string
spineText?string
spineTextTop?string
spineTextBottom?string
spineTextSize?number
spineTextColor?string
spineFontFamily?string
Value in"Arial""Brandon""DarkCourier""Georgia""GochiHand""Helvetica""Tahoma""TimesNewRoman""Verdana"
currency?string

currency code for price display e.g "EUR" or "USD"

locale?string
Value in"en""es""nl""de""fi""sv""it""fr""pl"
filterSize?string
filterColour?string
filterCategory?string
fixedOfferingId?string
fixedOfferingPrice?string
redirect?
enableSecureCheckout?boolean

Send a 'true' value if you want to enable the secure checkout enabling only authorised users to access it. This will make the endpoint return a secure_publication_id and a token. Access the checkout using this endpoint: https://test.www.peecho.com/checkout/print/en/{secure_publication_id}?token={token}.

secureCheckoutExpirationDate?string

Send an expiration date in the CET timezone if you want the secure checkout to expire after a while, in this format 'dd-MM-yyyy HH:mm:ss'.

Response Body

OK

application/json
  1. response

Default response — the publication id.

id?number
Example Request
curl -X POST 'https://test.www.peecho.com/rest/v3/publication/create' \  -H 'Content-Type: application/json' \  -d '{  "apiKey": "APABCD1234XXXXI",  "currency": "EUR",  "locale": "nl",  "order": {    "reference": "DK123LLP",    "product": {      "title": "Test Publication endpoint",      "source": {        "file": {          "src": "https://calin-thumbnailer.s3-eu-west-1.amazonaws.com/api-test.pdf",          "pages": 28,          "dimensions": {            "height": 210,            "width": 297          }        }      },      "thumbnail": {        "src": "https://calin-thumbnailer.s3-eu-west-1.amazonaws.com/download.jfif"      }    }  }}'
Example Response
{  "id": 123456}