Find Work Orders

HTTP Requests

This operation provides two requests.

Return all Work Order Data

POST /v1/work-orders/search

Return a Subset of Work Order Data

POST /v1/work-orders/status/search

Summary

Use this operation to find work orders based on your search criteria. The operation provides two HTTP requests. The Return all Work Order Data request returns all fields in the Work Orders object for each result. The request to Return a Subset of Work Order Data returns a smaller payload focused on current status, as shown in the example at the end of this page.

Request URLs

Return all Work Order Data

Sandbox: https://shipping-api-sandbox.pitneybowes.com/shippingservices/fulfillment/v1/work-orders/search
Production: https://shipping-api.pitneybowes.com/shippingservices/fulfillment/v1/work-orders/search

Return a Subset of Work Order Data

Sandbox: https://shipping-api-sandbox.pitneybowes.com/shippingservices/fulfillment/v1/work-orders/status/search
Production: https://shipping-api.pitneybowes.com/shippingservices/fulfillment/v1/work-orders/status/search

Query Parameters

Query parameters are optional.

Name

Description

page

The page number to return in the result set. Page numbering starts at 1.

Default value: 1

size

The number of results per page.

Default value: 20

Request Headers

Name


Description

Authorization

Required. OAuth token generated using the Generate an OAuth Token API.

X-PB-TransactionId

Required. A unique identifier for the request, up to 25 characters. The following characters are allowed: letters, numbers, hyphens (-), and underscores (_).

Important: Ensure this is a unique ID.

Request Elements

Required fields are marked Required. All other fields are optional.

Name

Data Type

Description

clientId

String

Required. The client ID assigned by Pitney Bowes.

sort

Array[String]

The property upon which to sort and the sort order. Use the following syntax:

<property>-<sort_direction>

Where <property> is one of the following:

  • createDate

  • updateDate

  • pbCreateDate

  • pbUpdateDate

And <sort_direction> is either of the following:

  • asc: ascending

  • desc: descending

For example: "createDate-asc"

searchFields

Array[Object]

The search criteria. Each object in the array defines a search field and search values. The object takes the following elements:

  • name: Required. The name of the search field, entered as a String. Possible values:

    • status

    • workOrderIds

    • createDate

    • updateDate

    • cancelDate

    • completionDate

    • pbCreateDate

    • pbUpdateDate

    • pbCancelDate

  • values. Required when “searchFields.name” is set to “status” or “workOrderIds”. This field takes a String array. Enter the values to search for as separate Strings in the array.

  • from. Applies when “searchFields.name” is set to one of the above date fields. Enter the start of the date range, as a String.

  • to. Applies when “searchFields.name” is set to one of the above date fields. Enter the end of the date range, as a String.

If no date filter is specified, the API returns orders created in the last six months.

Response Elements

Name

Data Type

Description

totalPages

Number

The number of pages in the result set.

totalElements

Number

The number of work orders in the result set.

first

Boolean

If true, this is the first page of the result set.

last

Boolean

If true, this is the last page of the result set.

size

Number

The number of work orders per page.

page

Number

The page number to return. Page numbering starts at 1.

sort

Array[String]

The sort order.

workOrders

Array[Work Orders Object]

The work orders. Each object in the array is a separate work order.

Work Orders Object

The workOrders array returns the Work Orders object. Depending on which HTTP request you use, the array returns all fields in the Work Orders object or a subset of those fields.

Name


Data Type

Description

clientId

String

The client ID assigned by Pitney Bowes.

clientWorkOrderId

String

The work order ID assigned in the client system, up to 35 characters.

workOrderId

String

The work order ID assigned by Pitney Bowes.

workOrderName

String

The name of the work order in the client system, up to 30 characters.

description

String

The work order description, up to 250 characters.

type

String

The type of work order. Possible value:

  • KIT

  • REFURBISHED (Reserved for future use.)

  • OTHER (Reserved for future use.)

status

String

The order status. Possible values:

  • CREATED

  • INPROGRESS

  • CANCELED

  • CLOSED

  • COMPLETE

node

String

The ID for the Pitney Bowes Fulfillment Center where work order is to be produced.

createDate

String

The date and time the work order was created in the client system, specified in the ISO 8601 format: YYYY-MM-DDThh:mm:ssZ

updateDate

String

The date and time the work order was updated in the client system, specified in the ISO 8601 format: YYYY-MM-DDThh:mm:ssZ

pbCreateDate

String

The date and time the work order was created in the Pitney Bowes system, returned in the ISO 8601 format: YYYY-MM-DDThh:mm:ssZ

pbUpdateDate

String

The date and time the work order was updated in the Pitney Bowes system, returned in the ISO 8601 format: YYYY-MM-DDThh:mm:ssZ

sku

String

The SKU for the produced kit. The kit must be part of the master catalog, up to 30 characters.

brand

String

The seller’s brand name for the item, up to 50 characters.

workOrderQuantity

Number

The number of kits ordered.

priority

String

The priority of the work order. Possible values:

  • PRIORITY

  • STANDARD

requestedStartDate

String

The date and time by which the work order should be started, specified in the ISO 8601 format: YYYY-MM-DDThh:mm:ssZ

requestedCompletionDate

String

The date and time by which the work order should be completed, specified in the ISO 8601 format: YYYY-MM-DDThh:mm:ssZ

startDate

String

Date the work order was started.

completionDate

String

Date the work order was completed.

startQuantity

Number

Start quantity of the work order.

completedQuantity

Number

Quantity produced for the work order.

lotNumbers

Array[String]

Completed Lot numbers for the produced product.

serialNumbers

Array[String]

Reserved for future use.

rejectedQuantity

Number

Rejected quantity for the product.

scrappedQuantity

Number

Scrapped quantity for the product.

workOrderLines

Array[Object]

The child items.

workOrderLines.childSKU

String

The SKU of the child item. The item must be part of the master catalog.

workOrderLines.lotNumbers

Array[String]

The completed lot numbers for the produced product.

workOrderLines.serialNumbers

Array[String]

Reserved for future use.

workOrderLines.issuedQuantity

Number

The issued quantity of the child product.

cancelDate

String

If the work order was cancelled, the date the client cancelled the work order.

pbCancelDate

string

The date the work order is cancelled in the Pitney Bowes system.

cancelReason

string

If the work order was cancelled, this gives the reason for cancellation.

references

Array[Object]

Reserved for future use.

references.name

String

Reserved for future use.

references.value

String

Reserved for future use.

Sample Requests

See the following examples:

Sample Request to Return all Work Order Data

This request returns the full Work Orders object.

Example Request
curl -X POST ".../v1/work-orders/search" \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-TransactionId: <unique_identifier>" \
-d '
{
    "clientId": "1234",
    "sort": [
        "createDate-desc"
    ],
    "searchFields": [ {
        "name": "status",
        "values": [
            "CREATED",
            "INPROGRESS"
        ]
    },{
        "name": "Brands",
        "values": [
            "Acme"
        ]
    } ]
}'
Example Response
{
    "totalPages": 4,
    "totalElements": 78,
    "first": true,
    "last": false,
    "size": 20,
    "page": 1,
    "sort": [
        "createDate-desc"
    ],
    "workOrders": [ {
        "clientId": "1234",
        "clientWorkOrderId": "W-284238",
        "workOrderId": "WO1234A789117803242",
        "workOrderName": "Welcome Kit",
        "description": "Welcome Kit",
        "type": "KIT",
        "status": "CREATED",
        "node": "160",
        "createDate": "2022-04-07T016:00:00-07:00",
        "pbCreateDate": "2022-04-07T18:58:19-07:00",
        "sku": "Product-210411",
        "workOrderQuantity": 2000,
        "priority": "PRIORITY",
        "requestedStartDate": "2022-04-08T09:00:00-07:00",
        "requestedCompletionDate": "2022-04-08T016:00:00-07:00",
        "lotNumbers": [
            "LOT#11-2321-1134553",
            "LOT#11-2321-1134556"
        ],
        "workOrderLines": [ {
            "childSKU": "Product-120445",
            "lotNumbers": [
                "LOT#18-2321-245612",
                "LOT#18-2321-245618"
            ],
            "issuedQuantity": 10000
        },
        ...
        ]
    },
    ...
    ]
}

Sample Request to Return a Subset of Work Order Data

This request returns a subset of the fields in the Work Orders object.

Example Request
curl -X POST ".../v1/work-orders/status/search" \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-TransactionId: <unique_identifier>" \
-d '
{
    "clientId": "1234",
    "sort": [
        "createDate-desc"
    ],
    "searchFields": [ {
        "name": "status",
        "values": [
            "CREATED",
            "INPROGRESS"
        ]
    },{
        "name": "Brands",
        "values": [
            "Acme"
        ]
    } ]
}'
Example Response
{
    "totalPages": 4,
    "totalElements": 78,
    "first": true,
    "last": false,
    "size": 20,
    "page": 1,
    "sort": [
        "createDate-desc"
    ],
    "workOrderStatusList": [ {
        "clientId": "1234",
        "clientWorkOrderId": "W-284238",
        "workOrderId": "WO156A0029204893659052712",
        "workOrderName": "Welcome Kit",
        "description": "Welcome Kit",
        "type": "KIT",
        "status": "COMPLETE",
        "node": "160",
        "workOrderQuantity": 5000,
        "startDate": "2022-02-01T09:01:32Z”,
        "completionDate": "2022-02-01T09:07:54Z”,
        "startQuantity": 100,
        "completedQuantity": 100,
        "sku": "Product-210411"
    },
    ...
    ]
}

Error Codes

For lists of error codes returned by the Fulfillment APIs, please see 80-Prefix Error Codes (Fulfillment APIs).