# Query Inventory History Events POST https://api.shipbob.com/2026-01/inventory/history:query Content-Type: application/json Fetches inventory movement events that change on-hand quantities within the ShipBob network. Returns events such as receiving/stow, order picks, adjustments, restocks, and attribute updates. Filter by inventory IDs, event category, date range, and facility. Supports cursor-based pagination for large result sets. Reference: https://developer.shipbob.com/api/inventory/query-inventory-history-events ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Query Inventory History Events version: endpoint_inventory.queryInventoryHistoryEvents paths: /2026-01/inventory/history:query: post: operationId: query-inventory-history-events summary: Query Inventory History Events description: >- Fetches inventory movement events that change on-hand quantities within the ShipBob network. Returns events such as receiving/stow, order picks, adjustments, restocks, and attribute updates. Filter by inventory IDs, event category, date range, and facility. Supports cursor-based pagination for large result sets. tags: - - subpackage_inventory parameters: - name: cursor in: query description: '' required: false schema: type: string format: int32 - name: Authorization in: header description: Authentication using Personal Access Token (PAT) token or OAuth2 required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: >- #/components/schemas/FulfillmentCenterInventoryService.InventoryHistoryResponse requestBody: content: application/json: schema: $ref: >- #/components/schemas/FulfillmentCenterInventoryService.MerchantHistoryRequest components: schemas: FulfillmentCenterInventoryService.MerchantHistoryRequest: type: object properties: cursor: type: - integer - 'null' description: >- Optional. Pagination cursor using the `inventory_audit_event_id` from the previous response. Returns events after this ID. end_date: type: - string - 'null' format: date-time description: >- Recommended. End date for filtering events. If omitted, defaults to current date. event_category: type: - string - 'null' description: >- Recommended. Filter by event type: `OrderPicked`, `InventoryAdjusted`, `InventoryFacilityUpdated`, `AttributeUpdated`, `InventoryReceived`, `InventoryRestocked`, `ReceivingStow`, or `KittingStow`. facility_id: type: integer description: >- Required. The ShipBob fulfillment center ID where the inventory events occurred. To find available facility IDs, use the [Get Fulfillment Centers](/api/2026-01/receiving/get-fulfillment-centers) endpoint. inventory_ids: type: - array - 'null' items: type: integer description: >- Recommended. Filter by specific inventory IDs. Returns events for these inventories only. start_date: type: - string - 'null' format: date-time description: >- Recommended. Start date for filtering events. If omitted, defaults to 90 days ago. Maximum range is 90 days. required: - facility_id FulfillmentCenterInventoryService.InventoryHistoryAdditionalReference: type: object properties: key: type: - string - 'null' description: >- The reference key (e.g., WRO ID, order ID, or other contextual identifier). value: type: - string - 'null' description: The reference value corresponding to the key. FulfillmentCenterInventoryService.YukiOperationalStageEnumTypeResponse: type: object properties: description: type: - string - 'null' description: >- Human-readable description of the operational stage (e.g., 'Available', 'Reserved', 'In Transit'). id: type: integer description: Numeric identifier for the operational stage. FulfillmentCenterInventoryService.Ulid: type: object properties: random: type: - string - 'null' format: byte description: >- Random component of the ULID (Universally Unique Lexicographically Sortable Identifier). time: type: string format: date-time description: >- Timestamp component of the ULID, representing when the identifier was created. FulfillmentCenterInventoryService.InventoryHistoryDetails: type: object properties: committed_quantity_change: type: integer description: The change in committed (allocated) quantity. expiration_date: type: - string - 'null' format: date-time description: The expiration date for this inventory lot, if applicable. facility_id: type: integer description: The fulfillment center ID where this quantity change occurred. inventory_status: type: - string - 'null' description: The current status of the inventory. location_id: type: integer description: The physical shelf/bin location ID within the fulfillment center. lot_number: type: - string - 'null' description: The lot number associated with this inventory, if applicable. operational_stage: $ref: >- #/components/schemas/FulfillmentCenterInventoryService.YukiOperationalStageEnumTypeResponse description: >- The operational stage of the inventory (e.g., available, reserved, in-transit). pack_description_id: $ref: '#/components/schemas/FulfillmentCenterInventoryService.Ulid' description: Identifier for the packaging configuration of this inventory. quantity_change: type: integer description: >- The change in on-hand quantity. Positive for increments, negative for decrements. sku: type: - string - 'null' description: The merchant SKU for this inventory item. yuki_id: $ref: '#/components/schemas/FulfillmentCenterInventoryService.Ulid' description: >- Unique identifier for the physical inventory unit (Yuki) in ShipBob's system. FulfillmentCenterInventoryService.InventoryHistory: type: object properties: additional_reference: type: - array - 'null' items: $ref: >- #/components/schemas/FulfillmentCenterInventoryService.InventoryHistoryAdditionalReference description: Additional key-value reference data related to this event. decrement: $ref: >- #/components/schemas/FulfillmentCenterInventoryService.InventoryHistoryDetails description: Details of the source location where inventory quantity decreased. event_category: type: - string - 'null' description: >- The type of inventory event. Supported values: `OrderPicked`, `InventoryAdjusted`, `InventoryFacilityUpdated`, `AttributeUpdated`, `InventoryReceived`, `InventoryRestocked`, `ReceivingStow`, `KittingStow`. event_datetime: type: string format: date-time description: The timestamp when this inventory event occurred. increment: $ref: >- #/components/schemas/FulfillmentCenterInventoryService.InventoryHistoryDetails description: >- Details of the destination location where inventory quantity increased. inventory_audit_event_id: type: integer description: >- Unique identifier for this event. Use as cursor value for pagination to fetch subsequent records. inventory_id: type: integer description: The ShipBob inventory ID for this item. shipbob_order_id: type: - integer - 'null' description: >- The ShipBob order ID associated with this event, if applicable (e.g., for `OrderPicked` events). FulfillmentCenterInventoryService.InventoryHistoryResponse: type: object properties: data: type: - array - 'null' items: $ref: >- #/components/schemas/FulfillmentCenterInventoryService.InventoryHistory description: Array of inventory history events matching the query criteria. first: type: - string - 'null' description: URL to retrieve the first page of results. last: type: - string - 'null' description: URL to retrieve the last page of results. next: type: - string - 'null' description: >- URL to retrieve the next page of results. Null if no more results available. prev: type: - string - 'null' description: >- URL to retrieve the previous page of results. Null if on the first page. ``` ## SDK Code Examples ```python Inventory_queryInventoryHistoryEvents_example import requests url = "https://api.shipbob.com/2026-01/inventory/history:query" payload = { "facility_id": 0, "cursor": 0, "end_date": "2019-08-24T14:15:22Z", "event_category": "string", "inventory_ids": [0], "start_date": "2019-08-24T14:15:22Z" } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Inventory_queryInventoryHistoryEvents_example const url = 'https://api.shipbob.com/2026-01/inventory/history:query'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"facility_id":0,"cursor":0,"end_date":"2019-08-24T14:15:22Z","event_category":"string","inventory_ids":[0],"start_date":"2019-08-24T14:15:22Z"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Inventory_queryInventoryHistoryEvents_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.shipbob.com/2026-01/inventory/history:query" payload := strings.NewReader("{\n \"facility_id\": 0,\n \"cursor\": 0,\n \"end_date\": \"2019-08-24T14:15:22Z\",\n \"event_category\": \"string\",\n \"inventory_ids\": [\n 0\n ],\n \"start_date\": \"2019-08-24T14:15:22Z\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Inventory_queryInventoryHistoryEvents_example require 'uri' require 'net/http' url = URI("https://api.shipbob.com/2026-01/inventory/history:query") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"facility_id\": 0,\n \"cursor\": 0,\n \"end_date\": \"2019-08-24T14:15:22Z\",\n \"event_category\": \"string\",\n \"inventory_ids\": [\n 0\n ],\n \"start_date\": \"2019-08-24T14:15:22Z\"\n}" response = http.request(request) puts response.read_body ``` ```java Inventory_queryInventoryHistoryEvents_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.shipbob.com/2026-01/inventory/history:query") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"facility_id\": 0,\n \"cursor\": 0,\n \"end_date\": \"2019-08-24T14:15:22Z\",\n \"event_category\": \"string\",\n \"inventory_ids\": [\n 0\n ],\n \"start_date\": \"2019-08-24T14:15:22Z\"\n}") .asString(); ``` ```php Inventory_queryInventoryHistoryEvents_example request('POST', 'https://api.shipbob.com/2026-01/inventory/history:query', [ 'body' => '{ "facility_id": 0, "cursor": 0, "end_date": "2019-08-24T14:15:22Z", "event_category": "string", "inventory_ids": [ 0 ], "start_date": "2019-08-24T14:15:22Z" }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Inventory_queryInventoryHistoryEvents_example using RestSharp; var client = new RestClient("https://api.shipbob.com/2026-01/inventory/history:query"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"facility_id\": 0,\n \"cursor\": 0,\n \"end_date\": \"2019-08-24T14:15:22Z\",\n \"event_category\": \"string\",\n \"inventory_ids\": [\n 0\n ],\n \"start_date\": \"2019-08-24T14:15:22Z\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Inventory_queryInventoryHistoryEvents_example import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "facility_id": 0, "cursor": 0, "end_date": "2019-08-24T14:15:22Z", "event_category": "string", "inventory_ids": [0], "start_date": "2019-08-24T14:15:22Z" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.shipbob.com/2026-01/inventory/history:query")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```