Product Availability GET

URI

https://{DATACENTER}.brightpearlconnect.com/public-api/{ACCOUNT}
/warehouse-service/product-availability/{PRODUCT-ID-SET}

Refer to our documentation on URI syntax for more information on how to construct URIs.

Description

Returns the product availability for the given ID Set of product IDs.

The return of the method is a list of product IDs with the following information given for each product:

  • A summary giving the total product availability across all warehouses
  • A breakdown of availability for each warehouse that currently contains the product

You may retreive additional information by adding a query parameter to the uri (includeOptional) that can take one or more of the following values:

  • breakDownByLocation - Adds a list of summaries for each Location within the Warehouse(s) where the product(s) is situated.
  • allocatedOrders - Lists Sales Orders on which the product is allocated. For each sales order the Goods Notes associated with the product are listed.
  • allocatedTransfers - Lists Stock Transfers on which the product is allocated. For each stock transfer the Goods Notes associated with the product are listed.
For example
  • /product-availability/1006-1008,1111/?includeOptional=breakDownByLocation,allocatedOrders,allocatedTransfers,onOrder
  • /product-availability/1006-1008,1111/?includeOptional=breakDownByLocation
  • /product-availability/1006-1008,1111/?includeOptional=allocatedOrders
  • /product-availability/1006-1008,1111/?includeOptional=allocatedTransfers
  • /product-availability/1006-1008,1111/?includeOptional=onOrder

Note: This message is only applicable to stock tracked products. If an ID-SET contains the ID of a non stock tracked product that ID will be ignored.

Example 1

Demonstrates the simplest usage to get the product availability for product with id 1007.

Request URI

/product-availability/1007

Request body

{
}

Response

{
	"response": {
		"1007": {
			"total": {
				"inStock": 10,
				"onHand": 9,
				"allocated": 1,
				"inTransit": 2
			},
			"warehouses": {
				"2": {
					"inStock": 3,
					"onHand": 2,
					"allocated": 1,
					"inTransit": 0
				},
				"3": {
					"inStock": 7,
					"onHand": 7,
					"allocated": 0,
					"inTransit": 2
				}
			}
		}
	}
}

Example 2

Demonstrates fetching the product availability for products with IDs 1007 & 1008.

Request URI

/product-availability/1007,1008

Request body

{
}

Response

{
	"response": {
		"1007": {
			"total": {
				"inStock": 10,
				"onHand": 9,
				"allocated": 1,
				"inTransit": 2
			},
			"warehouses": {
				"2": {
					"inStock": 3,
					"onHand": 2,
					"allocated": 1,
					"inTransit": 0
				},
				"3": {
					"inStock": 7,
					"onHand": 7,
					"allocated": 0,
					"inTransit": 2
				}
			}
		},
		"1008": {
			"total": {
				"inStock": 0,
				"onHand": 0,
				"allocated": 0,
				"inTransit": 0
			},
			"warehouses": {
			}
		}
	}
}

Example 3

Demonstrates getting the product availability for product with id 1007 and the location breakdown.

Request URI

/product-availability/1007?includeOptional=breakDownByLocation

Request body

{
}

Response

{
	"response": {
		"1007": {
			"total": {
				"inStock": 10,
				"onHand": 9,
				"allocated": 1,
				"inTransit": 5
			},
			"warehouses": {
				"2": {
					"byLocation": {
						"6": {
							"inStock": 3,
							"onHand": 2,
							"allocated": 1,
							"inTransit": 2
						}
					},
					"inStock": 3,
					"onHand": 2,
					"allocated": 1,
					"inTransit": 2
				},
				"3": {
					"byLocation": {
						"7": {
							"inStock": 2,
							"onHand": 2,
							"allocated": 0,
							"inTransit": 1
						},
						"8": {
							"inStock": 5,
							"onHand": 5,
							"allocated": 0,
							"inTransit": 2
						}
					},
					"inStock": 7,
					"onHand": 7,
					"allocated": 0,
					"inTransit": 3
				}
			}
		}
	}
}

Example 4

Demonstrates retrieving on order breakdowns for a single product using the includeOptional.

Request URI

/product-availability/1007?includeOptional=onOrder

Request body

{
}

Response

{
	"response": {
		"1007": {
			"total": {
				"inStock": 10,
				"onHand": 9,
				"allocated": 1,
				"inTransit": 2,
				"onOrder": {
					"total": 75,
					"shipped": 30
				}
			},
			"warehouses": {
				"2": {
					"inStock": 3,
					"onHand": 2,
					"allocated": 1,
					"inTransit": 0,
					"onOrder": {
						"total": 50,
						"shipped": 10
					}
				},
				"3": {
					"inStock": 7,
					"onHand": 7,
					"allocated": 0,
					"inTransit": 2,
					"onOrder": {
						"total": 25,
						"shipped": 20
					}
				}
			}
		}
	}
}

Example 5

Demonstrates getting the product availability for product with id 1007 and the allocated orders.

Request URI

/product-availability/1007?includeOptional=allocatedOrders

Request body

{
}

Response

{
	"response": {
		"1007": {
			"total": {
				"inStock": 10,
				"onHand": 9,
				"allocated": 1,
				"inTransit": 2
			},
			"warehouses": {
				"2": {
					"inStock": 3,
					"onHand": 2,
					"allocated": 1,
					"inTransit": 0
				},
				"3": {
					"inStock": 7,
					"onHand": 7,
					"allocated": 0,
					"inTransit": 2
				}
			},
			"allocatedToOrders": {
				"25": [
					{
						"id": 3,
						"typeCode": "RV"
					}
				]
			}
		}
	}
}

Example 6

Demonstrates getting the product availability for product with id 1007 and the allocated transfers.

Request URI

/product-availability/1007?includeOptional=allocatedTransfers

Request body

{
}

Response

{
	"response": {
		"1007": {
			"total": {
				"inStock": 10,
				"onHand": 9,
				"allocated": 1,
				"inTransit": 2
			},
			"warehouses": {
				"2": {
					"inStock": 3,
					"onHand": 2,
					"allocated": 1,
					"inTransit": 0
				},
				"3": {
					"inStock": 7,
					"onHand": 7,
					"allocated": 0,
					"inTransit": 2
				}
			},
			"allocatedToTransfers": {
				"5": [
					{
						"id": 27,
						"typeCode": "GO"
					}
				]
			}
		}
	}
}

Example 7

Demonstrates retrieving the stock availability for products with IDs 1006-1008 & 1111, and requesting that multiple optional data blocks are returned. Note that as only product ID 1007 is currently held in stock, no breakDownByLocation or allocatedOrders data is returned for any of the other products

Request URI

/product-availability/1006-1008,1111/?includeOptional=breakDownByLocation,allocatedOrders

Request body

{
}

Response

{
	"response": {
		"1006": {
			"total": {
				"inStock": 0,
				"onHand": 0,
				"allocated": 0,
				"inTransit": 0
			},
			"warehouses": {
			}
		},
		"1007": {
			"total": {
				"inStock": 10,
				"onHand": 9,
				"allocated": 1,
				"inTransit": 4
			},
			"warehouses": {
				"2": {
					"byLocation": {
						"6": {
							"inStock": 3,
							"onHand": 2,
							"allocated": 1,
							"inTransit": 2
						}
					},
					"inStock": 3,
					"onHand": 2,
					"allocated": 1,
					"inTransit": 2
				},
				"3": {
					"byLocation": {
						"7": {
							"inStock": 2,
							"onHand": 2,
							"allocated": 0,
							"inTransit": 1
						},
						"8": {
							"inStock": 5,
							"onHand": 5,
							"allocated": 0,
							"inTransit": 1
						}
					},
					"inStock": 7,
					"onHand": 7,
					"allocated": 0,
					"inTransit": 2
				}
			},
			"allocatedToOrders": {
				"25": [
					{
						"id": 3,
						"typeCode": "RV"
					}
				]
			}
		},
		"1008": {
			"total": {
				"inStock": 0,
				"onHand": 0,
				"allocated": 0,
				"inTransit": 0
			},
			"warehouses": {
			}
		},
		"1111": {
			"total": {
				"inStock": 0,
				"onHand": 0,
				"allocated": 0,
				"inTransit": 0
			},
			"warehouses": {
			}
		}
	}
}