Custom Shipping Method

In Picqer we provide some integrated shipping providers. When you want to connect with an other shipping provider, you can create your own webservice and link it in Picqer. This way you can create your own 'Create shipment' button in Picqer.

Creating the custom shipping method

Create a new JSON Push shipping provider Enter the Endpoint URL of your webservice. You can optionally choose to provide a username and password. Picqer will use those to authenticate with Auth Basic method.

When an user creates a shipment, we send a request to your endpoint with JSON data in the body. We provide the address data of the customer and the products of this order. Picqer expects a JSON response with a track and trace code and a PDF of the shipping label as a base64 encoded string.

15 seconds

When we send you the shipment request, you have 15 seconds to respond with the shipment details. Otherwise Picqer will show the request as failed and the user can send a new request.

Example

This is an example of the request we send to your endpoint when the user creates a shipment.

POST https://your-endpoint-url.com
{ "picklist": { "idpicklist": 105503, "picklistid": "20140079", "idcustomer": 5621, "idorder": 108319, "idwarehouse": 18, "deliveryname": "Alexander Depuis", "deliverycontact": null, "deliveryaddress": "Dorpsstraat 29", "deliveryaddress2": "", "deliveryzipcode": "2982 EM", "deliverycity": "Sneek", "deliveryregion": null, "deliverycountry": "NL", "emailaddress": "alex@example.org", "telephone": "+31612345678", "invoiced": false, "status": "closed", "totalproducts": 1, "totalpicked": 1, "created": "2014-10-09 21:48:54", "updated": "2014-10-09 21:48:58", "products": [ { "idproduct": 120486, "idvatgroup": 18, "productcode": "S14.OVS.50.54", "name": "Canon EOS 1100D + 18-55mm II IS", "amount": 1, "amount_picked": 1, "price": 10, "weight": 0, "stocklocation": "" } ] }, "weight": 0, "worth": 10, "sender": { "name": "Picqer", "contactname": "John Tester", "address": "Meander 601", "zipcode": "6825 ME", "region": null, "city": "Arnhem", "country": "NL" }, "recipient": { "name": "Alexander Depuis", "contactname": null, "address": "Dorpsstraat 29", "address2": "", "zipcode": "2982 EM", "city": "Sneek", "region": null, "country": "NL" } }
HTTP/1.1 200 OK { "identifier": "3SAPPL80237480", "trackingurl": "https://example.com/shipment/3SAPPL80237480", "carrier_key": "postnl", "label_contents_pdf": "--BASE64 ENCODED VERSION OF PDF--", "label_contents_zpl": "--BASE64 ENCODED VERSION OF ZPL--" }

Response attributes

These are the attributes that you can (or must) supply in your response. Your response must always have a 200 OK status, otherwise we will handle the call as failed.

Name Type Required Description
identifier string required Shipper's identifier of the shipment, like the trackingcode
trackingurl string optional URL of track and trace page
carrier_key string optional Key of the carrier, so Picqer can show the right logo. See available options below
label_contents_pdf string required Base64 encoded PDF document of label
label_contents_zpl string optional Base64 encoded ZPL document of label

Carrier keys

With a carrier key, Picqer knows wich carrier will deliver the package. We use this for example to show the logo of the carrier next to a shipment and for letting webshops know who the carrier is.

The following carrier keys can be submitted via the JSON push method:

  • bpost
  • dhl_de
  • dhl_for_you
  • dhl_nl
  • dpd_be
  • dpd_nl
  • gls
  • postal
  • postnl
  • red_je_pakketje
  • sandd2me
  • transmission
  • ups

ZPL Support

We always need a PDF version of the shipping label, but besides the PDF you can also provide a ZPL version of the label. If the printer supports ZPL, we will use the ZPL version of the label for improved print quality.

Errors

Whenever you respond with an other status than 200 OK, we will show an error message to the user. If you can, please provide a human readable error message for the user.

If an error occurred, return a 400 or 500 status code with a JSON body with an 'error' key. Like this:

HTTP/1.1 400 Bad Request { "error": "Shipping method is not allowed for recipient country Belgium." }

Picqer will show the given error message to the user.

Read more Stats