JSON Print Request Formatting

Support for JSON print request formatting was added in EPP 10.1.0.0 and is currently recognized through EPP Web Service print requests and File Drop job files.

JSON print requests allow multiple AND different label templates to be referenced in a single print request body; but only supports defining a single printer destination. A single JSON print request will result in a single EPP print job created, whether the JSON structure contains one or multiple ‘label’ definitions.

JSON Print Request Components

  • “labels”: The parent container for all labels in the request.
    • “_FORMAT”: Label Template (Format) Name. Required and case sensitive.
    • “_PRINTERNAME”: Name of print destination. Required and case sensitive.
    • “_QUANTITY”: Number of label copies. Required.
    • Controls which single printer destination the label(s) will be routed to
  • “label”: Child container for individual label definitions
    • “_FORMAT”: Label Template (Format) Name
    • “_PRINTERNAME”: Optional and case sensitive.
    • “_QUANTITY”: Number of label copies
    • Contains variable string assignments to be used in generated label output
    • Multi label requests will only have one ‘label’ element, containing an array of individual label definitions.
{
  "labels": {
    "_FORMAT": "#Samples\\MIL-STD\\MIL-STD-129P.zebra.lbl",
    "_PRINTERNAME": "defaultSite#FauxPrinter",
    "_QUANTITY": 1,
    "label": [
      {
        "_FORMAT": "#Samples\\MIL-STD\\MIL-STD-129P.zebra.lbl",
        "_PRINTERNAME": "defaultSite#FauxPrinter",
        "_QUANTITY": 2,
        "variable": []
      },
      {
        "_FORMAT": "#Samples\\NetSuite\\ItemLabel4x6.lbl",
        "_PRINTERNAME": "defaultSite#FauxPrinter",
        "_QUANTITY": 1,
        "variable": []
      },
      {
        "_FORMAT": "#Samples\\NetSuite\\ItemLabel4x6.lbl",
        "_PRINTERNAME": "defaultSite#FauxPrinter",
        "_QUANTITY": 1,
        "variable": []
      }
    ]
  }
}
  • “variable”: Value assignments for variables used in the referenced EPP label template.
    • The ‘name’ attribute defines the variables used in the label template design.
    • The ‘content’ attribute defines the value assigned to the variable for the print request.
    • All EPP Data Dictionary item types will be defined this way; not just VARIABLE items.
    • Passing an empty variable assignment can be done in three ways, using either example below or simply not defining the variable in the print request.
      • { “name”:“ToName”, “content”:“Courtney Robert Haine” }
      • { “content”:“Malcom Fitzcarraldo”, “name”:“FromName” }
    • Variable values need to be JSON compatible, so some characters require esca.
      Examples:CharacterEncodingform feed\fline feed\ncarriage return\r""\\

Examples:

Below example is for one label.

{
  "labels": {
    "_FORMAT": "#Samples\\MIL-STD\\MIL-STD-129P.zebra.lbl",
    "_PRINTERNAME": "defaultSite#FauxPrinter",
    "_QUANTITY": 1,
    "label": [
      {
        "_FORMAT": "#Samples\\NetSuite\\ItemLabel4x6.lbl",
        "_PRINTERNAME": "defaultSite#FauxPrinter",
        "_QUANTITY": 1,
        "variable": [
          { "name":"ItemNumber", "content":"10000000042" },
          { "name":"Manufacturer", "content":"Megadodo Publications" },
          { "name":"ManufacturerCountry", "content":"UK" },
          { "name":"ItemDescription", "content":"The Hitchhiker's Guide to the Galaxy" },
          { "name":"Quantity", "content":"1" },
          { "name":"UnitofMeasure", "content":"EA" }
        ]
      }
    ]
  }
}

Below example includes two labels, for one printer:

{
  "labels": {
    "_FORMAT": "#Samples\\MIL-STD\\MIL-STD-129P.zebra.lbl",
    "_PRINTERNAME": "defaultSite#FauxPrinter",
    "_QUANTITY": 1,
    "label": [
      {
        "_FORMAT": "#Samples\\MIL-STD\\MIL-STD-129P.zebra.lbl",
        "_PRINTERNAME": "defaultSite#FauxPrinter",
        "_QUANTITY": 1,
        "variable": [
          { "name":"ToName", "content":"Mr Holmes" },
          { "name":"ToAddressLine1", "content":"221B Baker Street" },
          { "name":"ToAddressLine2", "content":"" },
          { "name":"ToAddressLine3", "content":"" },
          { "name":"ToCity", "content":"London" },
          { "name":"ToState", "content":"" },
          { "name":"ToZip", "content":"EC1Y 8SY" },
          { "name":"FromName", "content":"James Moriarty" },
          { "name":"FromAddressLine1", "content":"32 Windsor Gardens" },
          { "name":"FromCity", "content":"London" },
          { "name":"FromState", "content":"" },
          { "name":"FromZip", "content":"EC1Y 8SY" },
          { "name":"SW8123", "content":"SW81238350D001XXX" },
          { "name":"DOV", "content":"DOV" },
          { "name":"RMS", "content":"RMS" },
          { "name":"Piece01", "content":"1" },
          { "name":"Piece02", "content":"1" },
          { "name":"Weight", "content":"7760" },
          { "name":"ShipDate", "content":"24SEP2001" },
          { "name":"RDD", "content":"999" },
          { "name":"Cube", "content":"385" },
          { "name":"Project", "content":"9BU" },
          { "name":"Case", "content":"CKM" },
          { "name":"W55XGJ", "content":"W55XGJ" },
          { "name":"TAC", "content":"SZZZ" },
          { "name":"TypSrv", "content":"Frt" },
          { "name":"Postage", "content":"LTL" },
          { "name":"Priority", "content":"1" },
          { "name":"POD", "content":"RMS" },
          { "name":"EPC_Dod-96", "content":"2F02032533139342DFDC1C35" }
        ]
      },
      {
        "_FORMAT": "#Samples\\NetSuite\\ItemLabel4x6.lbl",
        "_PRINTERNAME": "defaultSite#FauxPrinter",
        "_QUANTITY": 1,
        "variable": [
          { "name":"ItemNumber", "content":"10000000042" },
          { "name":"Manufacturer", "content":"Megadodo Publications" },
          { "name":"ManufacturerCountry", "content":"UK" },
          { "name":"ItemDescription", "content":"The Hitchhiker's Guide to the Galaxy" },
          { "name":"Quantity", "content":"1" },
          { "name":"UnitofMeasure", "content":"EA" }
        ]
      }
    ]
  }
}