Skip to main content
GET
/
inventory
/
logs
/
{stock_id}
Get Inventory Logs
curl --request GET \
  --url https://api.decodahealth.com/inventory/logs/{stock_id} \
  --header 'API-KEY: <api-key>' \
  --header 'TENANT: <tenant>'
{
  "data": [
    {
      "action": "STOCK_CREATED",
      "creatorId": "<string>",
      "id": "<string>",
      "itemId": "<string>",
      "stockId": "<string>",
      "quantity": 123,
      "chargeId": "<string>",
      "createdDate": "2023-11-07T05:31:56Z",
      "shipmentId": "<string>",
      "supplierId": "<string>",
      "purchaseOrderId": "<string>",
      "note": "<string>",
      "locationId": "<string>",
      "stock": {
        "name": "<string>",
        "unit": "AMPOULES",
        "id": "<string>",
        "description": "<string>",
        "notes": "<string>",
        "category": "<string>",
        "minStockLevel": 123,
        "isArchived": false
      },
      "item": {
        "name": "<string>",
        "price": 123,
        "id": "<string>",
        "brandName": "<string>",
        "description": "<string>",
        "category": "<string>",
        "unit": "AMPOULES",
        "isPhysical": true,
        "isArchived": false,
        "internalNotes": "<string>",
        "sortOrder": 123,
        "allowCustomPricing": false,
        "type": "PRODUCT",
        "externalId": "<string>",
        "exemptedTaxIds": [
          "<string>"
        ],
        "cost": 123,
        "stocks": [
          {
            "itemId": "<string>",
            "stockId": "<string>",
            "quantityUsed": 123
          }
        ]
      },
      "charge": {
        "patientId": "<string>",
        "totalOutstanding": 123,
        "id": "<string>",
        "patient": {
          "id": "<string>",
          "type": "PROVIDER",
          "createdDate": "2023-11-07T05:31:56Z",
          "firstName": "<string>",
          "lastName": "<string>",
          "phoneNumber": "<string>",
          "email": "<string>",
          "locationId": "<string>",
          "externalId": "<string>",
          "address": "<string>",
          "addressLineTwo": "<string>",
          "city": "<string>",
          "state": "<string>",
          "zipCode": "<string>",
          "country": "<string>",
          "addressValid": true,
          "meta": {},
          "isArchived": true,
          "primaryLocationId": "<string>",
          "gender": "<string>",
          "pronouns": "<string>",
          "preferredName": "<string>",
          "dateOfBirth": "2023-12-25",
          "patientMedications": [
            "<string>"
          ],
          "patientSource": "SELF_SCHEDULING",
          "leadSource": "<string>",
          "onSchedulingBlacklist": true,
          "surchargeDisabled": true,
          "tags": [
            {
              "id": "<string>",
              "name": "<string>",
              "isActive": true,
              "createdDate": "2023-11-07T05:31:56Z",
              "emoji": "<string>",
              "color": "<string>",
              "updatedDate": "2023-11-07T05:31:56Z"
            }
          ],
          "creditBalance": 123,
          "preferredProviderId": "<string>",
          "dosespotPatientId": "<string>"
        },
        "total": 0,
        "description": "<string>",
        "status": "OUTSTANDING",
        "discountAmount": 0,
        "discountPercentage": 0,
        "externalId": "<string>",
        "externalCreatedDate": "2023-11-07T05:31:56Z",
        "ruleSetId": "<string>",
        "createdDate": "2023-11-07T05:31:56Z",
        "creatorId": "<string>",
        "items": [],
        "tips": [],
        "locationId": "<string>",
        "eventId": "<string>",
        "memberId": "<string>",
        "comment": "<string>",
        "meta": {},
        "merchantAccountId": "<string>"
      },
      "shipment": {
        "stockId": "<string>",
        "supplierId": "<string>",
        "locationId": "<string>",
        "quantity": 123,
        "remainingQuantity": 123,
        "locationName": "<string>",
        "id": "<string>",
        "poLineItemId": "<string>",
        "lotNumber": "<string>",
        "expiryDate": "2023-11-07T05:31:56Z",
        "sku": "<string>",
        "actualConversionFactor": 123,
        "cost": 123,
        "supplier": {
          "name": "<string>",
          "description": "<string>",
          "website": "<string>",
          "email": "<string>",
          "preferredContactMethod": "<string>",
          "phoneNumber": "<string>",
          "addressLineOne": "<string>",
          "addressLineTwo": "<string>",
          "city": "<string>",
          "state": "<string>",
          "zipCode": "<string>",
          "country": "<string>",
          "shipmentTime": 123,
          "isArchived": false,
          "defaultNotes": [
            {
              "content": "<string>",
              "id": "<string>",
              "supplierId": "<string>",
              "name": "<string>"
            }
          ],
          "id": "<string>"
        },
        "createdDate": "2023-11-07T05:31:56Z",
        "note": "<string>"
      },
      "supplier": {
        "name": "<string>",
        "description": "<string>",
        "website": "<string>",
        "email": "<string>",
        "preferredContactMethod": "<string>",
        "phoneNumber": "<string>",
        "addressLineOne": "<string>",
        "addressLineTwo": "<string>",
        "city": "<string>",
        "state": "<string>",
        "zipCode": "<string>",
        "country": "<string>",
        "shipmentTime": 123,
        "isArchived": false,
        "defaultNotes": [
          {
            "content": "<string>",
            "id": "<string>",
            "supplierId": "<string>",
            "name": "<string>"
          }
        ],
        "id": "<string>"
      },
      "purchaseOrder": {
        "supplierId": "<string>",
        "id": "<string>",
        "status": "PENDING",
        "issueDate": "2023-11-07T05:31:56Z",
        "completedDate": "2023-11-07T05:31:56Z",
        "supplier": {
          "name": "<string>",
          "description": "<string>",
          "website": "<string>",
          "email": "<string>",
          "preferredContactMethod": "<string>",
          "phoneNumber": "<string>",
          "addressLineOne": "<string>",
          "addressLineTwo": "<string>",
          "city": "<string>",
          "state": "<string>",
          "zipCode": "<string>",
          "country": "<string>",
          "shipmentTime": 123,
          "isArchived": false,
          "defaultNotes": [
            {
              "content": "<string>",
              "id": "<string>",
              "supplierId": "<string>",
              "name": "<string>"
            }
          ],
          "id": "<string>"
        },
        "lineItems": [
          {
            "supplierToStockUomId": "<string>",
            "locationId": "<string>",
            "quantity": 123,
            "id": "<string>",
            "purchaseOrderId": "<string>",
            "status": "PENDING",
            "quantityReceived": 1,
            "supplierToStockUom": {
              "supplierPartNumber": "<string>",
              "uom": "AMPOULES",
              "id": "<string>",
              "supplierToStockId": "<string>",
              "supplierToStock": {
                "supplierId": "<string>",
                "stockId": "<string>",
                "id": "<string>",
                "stock": {
                  "name": "<string>",
                  "unit": "AMPOULES",
                  "id": "<string>",
                  "description": "<string>",
                  "notes": "<string>",
                  "category": "<string>",
                  "minStockLevel": 123,
                  "isArchived": false
                }
              },
              "conversionFactor": 1,
              "isDefault": false,
              "displayLabel": "<string>",
              "price": 123,
              "leadTime": 1,
              "createdDate": "2023-11-07T05:31:56Z",
              "updatedDate": "2023-11-07T05:31:56Z",
              "isArchived": false
            },
            "location": {
              "id": "<string>",
              "name": "<string>",
              "isVirtual": true
            },
            "cost": 1,
            "createdDate": "2023-11-07T05:31:56Z",
            "updatedDate": "2023-11-07T05:31:56Z"
          }
        ],
        "notes": [
          {
            "content": "<string>",
            "id": "<string>",
            "purchaseOrderId": "<string>",
            "name": "<string>"
          }
        ],
        "createdDate": "2023-11-07T05:31:56Z",
        "updatedDate": "2023-11-07T05:31:56Z",
        "isArchived": false
      },
      "creator": {
        "id": "<string>",
        "type": "PROVIDER",
        "firstName": "<string>",
        "lastName": "<string>",
        "phoneNumber": "<string>",
        "email": "<string>",
        "locationId": "<string>"
      }
    }
  ],
  "nextCursor": "<string>",
  "hasMore": false
}

Headers

TENANT
string
required

The tenant you are making this request on behalf of

API-KEY
string
required

Your api key

Path Parameters

stock_id
string
required

Query Parameters

cursor
string<date-time> | null

ISO datetime cursor - fetches logs BEFORE this time

days
integer
default:30

Number of days to fetch

Required range: 1 <= x <= 90
action_types
enum<string>[] | null
Available options:
STOCK_CREATED,
STOCK_UPDATED,
STOCK_ARCHIVED,
DRAWDOWN,
PARTIAL_DRAWDOWN,
RESTORED,
SHIPMENT_RECEIVED,
SHIPMENT_UPDATED,
SHIPMENT_ARCHIVED,
ITEM_LINKED,
ITEM_UNLINKED,
SUPPLIER_TO_STOCK_LINKED,
SUPPLIER_TO_STOCK_UPDATED,
SUPPLIER_TO_STOCK_UNLINKED,
PO_CREATED,
PO_PLACED,
PO_CANCELLED,
PO_COMPLETED,
PO_ARCHIVED
location_ids
string[] | null
start_date
string<date-time> | null

Absolute start boundary (logs must be >= this)

end_date
string<date-time> | null

Absolute end boundary (logs must be <= this)

Response

Successful Response

Response containing inventory logs with cursor-based pagination.

data
InventoryLog · object[]

List of inventory logs

nextCursor
string | null

ISO datetime cursor for next page (fetch logs BEFORE this time)

hasMore
boolean
default:false

Whether there are more logs to fetch