Merchants
Version 2
Shipments

Shipments API v2

Use this page for the Merchant API v2 shipment flows, including voucher creation, cancellation, printing, and manifest generation.

Table of Contents

  1. Variables
  2. Shipments
  3. Error Codes

Variables

  • merchantAPIEndpoint: https://merchant.api.shopflix.gr/v2
  • orderId: GR--3001--MER78

Shipments

1. Create Voucher

POST {{merchantAPIEndpoint}}/shipments/{orderId}

Request Body

Content-Type: application/json

{
    "numberOfPackages": 1, // number_of_packages={X} int default 1
    "packageComment": "Test"
}

Response

Status: 200 OK

Content-Type: application/json

{
    "voucher": {
         "carrierName": "Courier Center",
         "deliveryKey":"courier_center_clever_point",
         "deliveryName": "Courier Center Clever Points",
         "trackingNumber": "013670308212",
         "deliveryToCourierEstimationDate": "1701958406"
    }
}

For possible deliveryKey values, see Carrier Delivery Method Values.

Error Response

Status: 400 BAD REQUEST
response
{
    "error": {
        "errorCode": "10352",
        "message": "Voucher already exists for this shipment."
    }
}
response
{
    "error": {
        "errorCode": "10350",
        "message": "The sale order could not be found."
    }
}

2. Cancel Voucher

DELETE {{merchantAPIEndpoint}}/shipments/{orderId}

Response

Status: 204 No Content
Status: 400 BAD REQUEST
response
{
    "error": {
        "errorCode": "10353",
        "message": "There is no voucher for this sale order."
    }
}

3. Print Voucher

GET {{merchantAPIEndpoint}}/shipments/{orderId}/print

Parameters

NameTypeDescriptionRequiredDefault
labelFormatstringVoucher label format. Use one of the values listed below for the shipment carrier.NoCarrier default

Available Label Format Options

ServiceAvailable ValuesDefaultExample
Diakinisisa4, a6, a4-3a4&labelFormat=a4
Courier Centerpdf, clean, singlepdf, singleclean, thermikopdf&labelFormat=pdf
Box Nowsinglepdf_100x150singlepdf_100x150&labelFormat=singlepdf_100x150

Example Request

GET {{merchantAPIEndpoint}}/shipments/{orderId}/print?labelFormat=pdf

Response

Status: 200 OK

Content-Type: application/json

response
{
    "shipments": [
        {
            "orderId": "GR--82--MER1243",
            "carrierName": "Courier Center",
            "deliveryName": "Box Now",
            "deliveryKey": "courier_center_box_now",
            "trackingNumber": "21456678909876",
            "voucherContent": "frregerthwhrhreher",
            "voucherFormat": "pdf",
            "deliveryToCourierEstimationDate": "1701958406",
            "error": null
        }
    ]
}

4. Print Mass Shipment Vouchers

GET {{merchantAPIEndpoint}}/shipments/{orderId1},{orderId2}/print

Response

Status: 200 OK
response
{
  "shipments": [
    {
      "orderId": "GR--81--MER1243",        // Order reference associated with the shipment
      "carrierName": "Courier Center",     // Courier company name
      "deliveryName": "Box Now",           // Delivery service name
      "deliveryKey": "courier_center_box_now", // Internal delivery method identifier
      "trackingNumber": "",                // Tracking number (empty if not yet available)
      "voucherContent": "",                // Encoded voucher content (empty if voucher not generated)
      "voucherFormat": "pdf",              // Voucher file format (e.g. pdf)
      "deliveryToCourierEstimationDate": "1701958406", // Estimated pickup date by courier (Unix timestamp)
      "error": {
        "errorMessage": "There is no voucher for this sale order.", // Human-readable error description
        "errorCode": "10353"              // Internal error code
      }
    },
    {
      "orderId": "GR--82--MER1243",        // Order reference associated with the shipment
      "carrierName": "Courier Center",     // Courier company name
      "deliveryName": null,                // Delivery service name (null if not specified)
      "deliveryKey": null,                 // Delivery method key (null if not specified)
      "trackingNumber": "21456678909876",  // Shipment tracking number
      "voucherContent": "frregerthwhrhreher", // Encoded voucher content
      "voucherFormat": "pdf",              // Voucher file format
      "deliveryToCourierEstimationDate": "1701958406", // Estimated pickup date by courier (Unix timestamp)
      "error": null                        // No error occurred for this shipment
    }
 
    // Additional shipment entries may be listed here...
  ]
}

5. Create Manifest

POST {{merchantAPIEndpoint}}/shipments/{orderId}/manifest

Response

Error Response

Status: 400 BAD REQUEST

Returned when the manifest cannot be created because no eligible sales orders were found.

response
{
    "manifestContent": null,
    "error": {
        "errorMessage": "The manifest could not be created due to the absence of sales orders",
        "errorCode": 10400
    }
}

Possible Reasons

  • Order does not exist for the given shipment_id.
  • Order is not ready for shipment.

Error Codes

CodeMessageExplanation
10301The order with id was not foundThe provided orderId does not exist or is invalid.
10350The sale order could not be foundThe sale order ID does not match any existing record.
10352Voucher already exists for this shipment.A shipment voucher has already been created for this order.
10353There is no voucher for this sale order.Cannot cancel or print a voucher because none exists for the given order.
10400The manifest could not be created due to the absence of sales orders.There are no eligible sales orders for manifest creation.
10401The order cannot be accepted.The order is in an invalid state for this action.

Quick Reference

EndpointDescriptionMethodResponse
/shipments/{orderId}Create shipment voucherPOSTVoucher details
/shipments/{orderId}Cancel shipment voucherDELETE204 No Content
/shipments/{orderId}/printPrint shipment voucherGETVoucher file
/shipments/{orderId1},{orderId2}/printPrint vouchers for multiple shipmentsGETMultiple vouchers
/shipments/{orderId}/manifestCreate shipment manifestPOSTManifest file