Find a BOM

HTTP Request

POST /v1/bill-of-materials/search

Summary

This operation provides details of Bill of Materials (BOM) based on filter criteria.

Request URLs

Sandbox: https://shipping-api-sandbox.pitneybowes.com/shippingservices/fulfillment/v1/bill-of-materials/search
Production: https://shipping-api.pitneybowes.com/shippingservices/fulfillment/v1/bill-of-materials/search

Query Parameters

Query parameters are optional.

Name

Description

page

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

Default value: 1

size

The number of fulfilled orders to return 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 identifier 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 one of the following: - asc: - desc:

For example: pcreateDate-asc:

searchFields

Array[Object]

Defines 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:

    • parentSku

    • childSku

    • brand

    • includeInactive

    • createDate

    • updateDate

    • pbCreateDate

    • pbupdateDate

    • billOfMaterialId

  • values: Required when name is set to parentSku, childSku or includeInactive. This field takes a String array. Enter the values to search for as separate Strings in the array.

  • from: Applies only when name is set to createDate. updateDate, pbCreateDate or pbUpdateDate. Enter the start of the date range, as a String.

  • to: Applies only when name is set to createDate. updateDate, pbCreateDate or pbUpdateDate. Enter the end of the date range, as a String.

If no date filter is specified, the API returns BOM 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 products 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 boms per page in the result set.

page

Number

The page number indicating which set of items will be returned in the response. So, the combination of page=1 and size=20 returns the first 20 items. The combination of page=2 and size=20 returns items 21 through 40..

sort

Array[String]

Lists the property used to sort the response and the sort order.

boms

Array[BOM Objects]

Bom result set based on filter criteria and sort order

BOM Objects

The bom array returns the bom Object:

Name

Data Type

Description

parentSku

String

SKU of the parent product.

status

String

Status of Bill of material (Active/Inactive).

billOfMaterialId

String

Unique Pitney Bowes id assigned to BOM.

createDate

String

Create date of Bill of material.

updateDate

String

Update date of Bill of material.

pbCreateDate

String

Date when Bill of material was created on Pitney Bowes side.

pbUpdateDate

String

Date when Bill of material was modified on Pitney Bowes side.

bom details

Array[BOM Details Object]

Bill of material details.

clientId

String

The client ID assigned by Pitney Bowes.

Bom Details Object

Bom Details payload:

Name

Data Type

Description

childSku

String

SKU of the child product. Must belong to master catalog.

quantity

integer

Quantity of the child product.

Sample Request

curl -X POST ".../v1/bill-of-materials/search" \
-H "Authorization: Bearer <oauth_token>" \
-H "X-PB-TransactionId: <unique_identifier>" \
-d '
 {
   "clientId": "1234",
   "sort": [
     "pbCreateDate-asc-asc"
    ],
    "searchFields": [
      {
         "name": "parentSku",
         "values": [
            "1685603906265"
         ]
         },
         {
             "name":"pbCreateDate",
             "to": "2023-07-10T00:00:00Z",
             "from":  "2023-06-05T00:00:00Z"
     }
  ]
}

Sample Response

{

    "totalPages": 1,
    "totalElements": 2,
    "first": true,
    "last": true,
    "size": 20,
    "page": 1,
    "sort": [
    "pbCreateDate-asc"
    ],
    "boms": [
        {
            "parentSku": "1685603906265",
            "status": "Active",
            "billOfMaterialId": "BM2862A0017978434441940995US",
            "createDate": "01/14/2022 04:13:13",
            "pbCreateDate": "07/05/2023 06:11:52",
            "pbUpdateDate": "07/05/2023 09:06:26",
            "bom details": [
                {
                    "childSku": "1688537421275",
                    "quantity": 3
                }
           ]
       },
    {

             "parentSku": "1685603906265",
             "status": "Active",
             "billOfMaterialId": "BM2862A0018023370252062721US",
             "createDate": "01/14/2022 04:13:13",
             "pbCreateDate": "07/05/2023 09:07:59",
             "pbUpdateDate": "07/05/2023 09:09:52",
             "bom details": [
                 {
                     "childSku": "1688537421275",
                     "quantity": 3
                 }
            ]
        }
    ]
  }

Error Codes

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