Stock Transactions

Each product has its own Inventory and stock history. This is useful when auditing product movements across your project. Below is the Stock Transaction object, request and response examples for getting all stock transactions by Product ID.

The Stock Transaction Object

Attribute

Type

Description

id

string

The unique identifier for the stock transaction

type

string

The type represents the object being returned

action

string

The type of action performed by this transaction

product_id

string

The product identifier that this stock transaction is for

quantity

integer

The amount of stock affected by the stock transaction

Get All Product Stock Transactions

GET https://api.moltin.com/v2/inventories/:productId/transactions

Path Parameters

NameTypeDescription

productId

string

The ID for the product you're performing this action on

Headers

NameTypeDescription

Authorization

string

The Bearer token to grant access to the API

{
  "data": [
    {
      "id": "0b0e5be3-b88b-4574-8316-f2871a803a8a",
      "type": "stock-transaction",
      "action": "create",
      "product_id": "9eda5ba0-4f4a-4074-8547-ccb05d1b5981",
      "quantity": 1,
      "timestamps": {
        "created_at": "2018-02-05 14:00:11 +0000 UTC"
      }
    },
    {
      "id": "4638fc99-faec-416c-94e0-c3e0d11af436",
      "type": "stock-transaction",
      "action": "increment",
      "product_id": "9eda5ba0-4f4a-4074-8547-ccb05d1b5981",
      "quantity": 1,
      "timestamps": {
        "created_at": "2018-03-07 14:34:32 +0000 UTC"
      }
    },
    {
      "id": "2edaa5f6-45fe-4272-96d4-3c745f80c26d",
      "type": "stock-transaction",
      "action": "decrement",
      "product_id": "9eda5ba0-4f4a-4074-8547-ccb05d1b5981",
      "quantity": 1,
      "timestamps": {
        "created_at": "2018-03-07 14:44:21 +0000 UTC"
      }
    }
  ]
}
curl -X GET https://api.moltin.com/v2/inventories/:productId/transactions \
     -H "Authorization: Bearer XXXX"

Last updated