Skip to content

Print

APIs to print shipping labels and documents, configure and manage printer mappings, and retrieve print job status.

Print Document

Request

It contains information about a label or a document, e.g., a shipping label, a customs form, manifest report etc., that pertains to a shipment or manifest.

Security
bearerAuth
Headers
X-PB-Developer-Partner-Idstring

The Developer Partner ID is assigned by PB to uniquely identify a Developer's strategic business partners. If the developer is the sole business partner, this field isn't required.

X-PB-LocationIdstring

The X-PB-LocationId header identifies the enterprise, developer, or partner location under which a shipment is processed and billed. If the header is not provided, the system defaults to the enterprise-level location that was created during developer account onboarding. This default location is automatically used for shipment processing and billing.

Requirement Rules

  • The X-PB-LocationId header is optional when the shipment origin country code matches the enterprise's default address country code.
  • The X-PB-LocationId header is required when the shipment origin country code differs from the enterprise's default address country code.
  • If the header is required but not provided, the API will return a validation error "invalid origin countryCode".
X-PB-TransactionIdstring

A unique Transaction ID provided by the partner, which is used to enable debugging and linking between the client's transaction and the system.

Bodyapplication/jsonrequired
printerAliasNamestringrequired

Name of the Printer connected (directly or via network) to a Computer. Max length = 30

Example:"Pitney Bowes Printer"
datastringrequired

Content/Identifier of document e.g., DOCUMENT_REFERECE_ID. Actual document name e.g., abc.pdf. [IN] i.e base64 string, URL, file path

Example:"<<base64string>>"
dataTypestringrequired

Data Type of the document e.g., DOCUMENT_REFERENCE. [IN/OUT]

Enum:"BASE64""URL"
Example:"BASE64"
documentTypestringrequired

The format of the document file the print takes.

Enum:"ZPL2""ZPL""PDF"
Example:"ZPL2"
formNamestringrequired

The name of the Document Form.

Enum:"8x11""4x6""2x1""ENV10""ENV9""A1"
Example:"ENV10"
orientationstring

The orientation of the document layout: Portrait or Landscape.

Example:"PORTRAIT"
referenceobject
  • Contains key value map for passing references. Max references allowed is 6.
    - References are tags or information that is printed on Shipping Label based on the customer's requirement.
    - Reference Fields can have values/indication like department name, invoice no., package description, purchase order no., carrier note, cost account no., transportation no., or PO No., etc.
    - Each of the reference field can have only one indication/value.
curl -i -X POST \
  https://api-dev.sendpro360.pitneycloud.com/shipping/api/v1/document/print \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'X-PB-Developer-Partner-Id: string' \
  -H 'X-PB-LocationId: string' \
  -H 'X-PB-TransactionId: string' \
  -d '{
    "printerAliasName": "Pitney Bowes Printer",
    "data": "<<base64string>>",
    "dataType": "BASE64",
    "documentType": "ZPL2",
    "formName": "ENV10",
    "orientation": "PORTRAIT",
    "reference": {
      "reference1": "123456",
      "reference2": "SendTech",
      "reference3": "65439",
      "reference4": "FedEx First Overnight"
    }
  }'

Responses

The document has been printed successfully.

Bodyapplication/json
jobIdstring

Job ID of the printed document.

Example:"accc"
Response
{ "jobId": "accc" }