Audit

End Point

'Audit/Execute' API endpoint is used to conduct various of audit queries within P4W system.

POST https://{tenant_name}.p4warehouse.com/api/Audit/Execute

Headers

NameTypeDescription

ApiKey*

String

System API key

Request Body

NameTypeDescription

Array

String

Array of parameters and rules to use for audit query

[
    {
        "$id": "1",
        "TypeEnum": 2,
        "Type": "ProductRemove",
        "SubType": "AdjustOut",
        "Timestamp": "2023-07-18T20:40:45.290883+00:00",
        "ClientId": "91c64445-04d0-41da-a9ce-f05c0db7d4d4",
        "Client": "02",
        "UserId": "58d281c4-f29d-4b36-9300-87b5d6681919",
        "Username": "hh",
        "ReferenceType": null,
        "ReferenceId": null,
        "ReferenceCode": null,
        "ProductId": "f8ee74b8-6868-40f0-b8fb-ecd2ee2d6940",
        "Sku": "PRODUCT008",
        "FromWarehouse": "01",
        "FromBinId": "c09bdc46-7a69-4ae5-9f4c-942654efcf8d",
        "FromBin": "S-1-A",
        "FromLpnId": null,
        "FromLpn": null,
        "IsFromBinEmpty": true,
        "IsFromLpnEmpty": null,
        "ToWarehouse": null,
        "ToBinId": null,
        "ToBin": null,
        "ToLpnId": null,
        "ToLpn": null,
        "PacksizeId": null,
        "PacksizeName": null,
        "PacksizeBarcode": null,
        "EachCount": null,
        "NumberOfPacks": null,
        "LotNumber": null,
        "ExpiryDate": null,
        "SerialNumber": null,
        "Quantity": 5.0000,
        "AbsoluteFromQuantity": 0.0000,
        "AbsoluteToQuantity": null,
        "Reason": "Misc",
        "IntegrationReference": null,
        "IntegrationMessage": null,
        "IntegrationTimestamp": null,
        "Id": "63c9451f-3bce-4dee-8454-555120a58907",
        "DateCreated": "2023-07-18T20:40:45.290883+00:00",
        "TypeName": "Pro4Soft.TenantData.Entities.Infrastructure.AuditRecord",
        "TypeNameShort": "AuditRecord"
    },
    {
        "$id": "2",
        "TypeEnum": 0,
        "Type": "ProductAdd",
        "SubType": "AdjustIn",
        "Timestamp": "2023-07-13T18:38:52.5793527+00:00",
        "ClientId": "91c64445-04d0-41da-a9ce-f05c0db7d4d4",
        "Client": "02",
        "UserId": "58d281c4-f29d-4b36-9300-87b5d6681919",
        "Username": "hh",
        "ReferenceType": null,
        "ReferenceId": null,
        "ReferenceCode": null,
        "ProductId": "f8ee74b8-6868-40f0-b8fb-ecd2ee2d6940",
        "Sku": "PRODUCT008",
        "FromWarehouse": null,
        "FromBinId": null,
        "FromBin": null,
        "FromLpnId": null,
        "FromLpn": null,
        "IsFromBinEmpty": null,
        "IsFromLpnEmpty": null,
        "ToWarehouse": "01",
        "ToBinId": "8ccda73d-f332-4ec9-810a-a3718c7b323b",
        "ToBin": "A-16-B",
        "ToLpnId": null,
        "ToLpn": null
        ...

JSON Example

Here is an example of a JSON payload to create new audit query containing adjustments ( adjust in and adjust out) within the warehouse.

{
  "Filter": {
    "Condition": "And",
    "Rules": [
      {
        "Field": "Type",
        "Value": "Handling",
        "Operator": "NotEqual"
      },
      {
        "Condition": "Or",
        "Rules": [
          {
            "Field": "SubType",
            "Value": "AdjustIn",
            "Operator": "Equal"
          },
          {
            "Field": "SubType",
            "Value": "AdjustOut",
            "Operator": "Equal"
          }
        ]
      }
    ]
  },
  "GroupFields": [],
  "Aggregation": {
    "Type": "None"
  }
}

Use aggregations to further specify audit queries usnig API calls.