Maintenance

Create a stock movement

Records a receive, transfer, scrap, or adjust stock movement against a part's inventory and returns the resulting inventory location(s). Not idempotent — retrying a request that already succeeded records the movement again.

<b>Rate limit:</b> 100 requests/min (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).

To use this endpoint, select Write Parts under the Work Orders category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>

Submit Feedback: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

post/maintenance/parts/stock-movements

Request

  • Base URL
    https://api.samsara.com
  • Auth
    HTTP bearer

Request body

batchstring

Batch or lot identifier the movement applies to, if the part is batch-tracked.

fromPlaceIdstring

Unique identifier of the place linked to the maintenance site the inventory is transferred out of. Transfer only.

happenedAtTimestring

Time when the movement occurred. Defaults to the current time if not provided.

movementTypestring required

Type of stock movement to record. Must be one of Receive, Transfer, Scrap, or Adjust; Unknown is rejected.

notesstring

Notes explaining the movement. Scrap and adjust only.

partSamsaraIdstring required

Unique identifier of the part definition the movement applies to.

placeIdstring

Unique identifier of the place linked to the maintenance site the movement targets. Required for receive, scrap, and adjust; rejected for transfer (use fromPlaceId and toPlaceId).

purchaseOrderstring

Purchase order reference for the received inventory. Receive only.

quantitynumber double required

Quantity moved, in the part's unit of measure. Positive magnitude for receive, transfer, and scrap; signed delta for adjust.

toPlaceIdstring

Unique identifier of the place linked to the maintenance site the inventory is transferred into. Transfer only.

vendorIdstring

Unique identifier of the vendor the inventory was received from. Receive only.

Example request

{
  "batch": "12345",
  "fromPlaceId": "12345",
  "happenedAtTime": "2019-06-13T19:08:25Z",
  "movementType": "12345",
  "notes": "12345",
  "partSamsaraId": "12345",
  "placeId": "12345",
  "purchaseOrder": "12345",
  "quantity": 123.45,
  "toPlaceId": "12345",
  "unitCost": {
    "amount": "12345",
    "currency": "12345"
  },
  "vendorId": "12345"
}

Response

OK response.

Example response

{
  "data": {
    "destinationLocation": {
      "aisle": "12345",
      "availableQuantity": 123.45,
      "bin": "12345",
      "createdAtTime": "2019-06-13T19:08:25Z",
      "currentQuantity": 123.45,
      "id": "12345",
      "isCostTracked": true,
      "isLowStock": true,
      "maxStockLevel": 123.45,
      "minStockLevel": 123.45,
      "partSamsara": "12345",
      "place": "12345",
      "reorderQuantity": 123.45,
      "reorderThreshold": 123.45,
      "reservedQuantity": 123.45,
      "row": "12345",
      "unitCost": {
        "amount": "12345",
        "currency": "12345"
      },
      "unitOfMeasureType": "12345",
      "updatedAtTime": "2019-06-13T19:08:25Z"
    },
    "sourceLocation": {
      "aisle": "12345",
      "availableQuantity": 123.45,
      "bin": "12345",
      "createdAtTime": "2019-06-13T19:08:25Z",
      "currentQuantity": 123.45,
      "id": "12345",
      "isCostTracked": true,
      "isLowStock": true,
      "maxStockLevel": 123.45,
      "minStockLevel": 123.45,
      "partSamsara": "12345",
      "place": "12345",
      "reorderQuantity": 123.45,
      "reorderThreshold": 123.45,
      "reservedQuantity": 123.45,
      "row": "12345",
      "unitCost": {
        "amount": "12345",
        "currency": "12345"
      },
      "unitOfMeasureType": "12345",
      "updatedAtTime": "2019-06-13T19:08:25Z"
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.