Skip to main content

External Events

Real-time updates can be received by subscription from External Events for stock levels and transaction processing. External events is a service that provides access to events/notifications from HiiRetail Apps for External parties.

Read more about External Events

These are the events that can be subscribed to:

  • Stock Level Updates
  • Transaction Processing Updates

Stock Level Updates Schema

The stp.public.output.stock-level-updates.v2 schema is designed to capture essential information about stock level updates, including identifiers for the tenant, business unit, and item, as well as details about the stock type, quantity, cost, and relevant timestamps. The schema ensures that all required fields are present and restricts additional properties to maintain data integrity. The stock-type.json schema provides the enumeration of possible stock types, ensuring consistent categorization of stock items.

Properties

  1. tenantId The tenant Id.

  2. businessUnitId The id of the business unit (store).

  3. itemId The id of the item.

  4. stockType The type of stock. This references the stock-type.json schema which defines the possible stock types (e.g., SalesStock, InTransit, InOrder, Reserved, Returned, ReservedInOrder).

  5. quantity The quantity of the stock item.

  6. costAmount The cost amount of the stock item.

  7. currencyCode The 3-letter currency code for the transaction.

  8. averageCostAmount The average cost amount of the stock item.

  9. timestamp The timestamp of the stock level update in UTC timezone.

Processed Transaction Schema

The stp.public.output.processed-transactions.v3 schema is designed to capture comprehensive information about processed stock transactions. It includes identifiers for the transaction, tenant, business unit, and item, as well as details about the stock type, quantities, costs, and relevant timestamps. The schema also includes fields for document references, correlation identifiers, stock handling types and methods, and additional properties. This ensures that all necessary information is captured and structured consistently for processed transactions in a retail system.

Properties

  1. transactionId Unique id for the transaction.

  2. tenantId The tenant Id.

  3. businessUnitId The id of the business unit (store).

  4. itemId The id of the item.

  5. stockType The type of stock. This references the stock-type.json schema which defines the possible stock types (e.g., SalesStock, InTransit, InOrder, Reserved, Returned, ReservedInOrder).

  6. transactionDate The date of the transaction in UTC timezone. This is the actual timestamp for when the transaction was done in any system, e.g., POS, not when processed.

  7. quantity The quantity by which the targeted entity is affected. Expect to have 2 digits after the point precision.

  8. originalQuantity Quantity originally used for the document before processing. Expect to have 2 digits after the point precision.

  9. costAmount The cost amount by which the targeted entity is affected. Expect to have 3 digits after the point precision.

  10. salesAmount The sales price if sold. Expect to have 3 digits after the point precision.

  11. currencyCode 3 letter currency code for the transaction.

  12. reasonCode Reason code for the transaction.

  13. comment Additional comments for the transaction.

  14. documentType The type of document that produced this transaction.

  15. documentId The id of the document that produced this transaction.

  16. documentLineId The id of the document line that produced this transaction.

  17. businessPartnerId Identifier of the business partner attached to the affected StockItem.

  18. batchNumber The Batch/Lot number attached to the affected StockItem.

  19. serialNumber The serial number attached to the affected StockItem.

  20. correlationId A unique identifier used to correlate all transactions processed by a single message.

  21. linkIdExternal An optional unique identifier specified by the sender. Could be used to link several messages from the sender.

  22. linkIdRelated A unique identifier used to correlate the related transactions (one transaction causing several transactions during processing).

  23. linkIdStructure A unique identifier used to correlate transactions to the same structured item.

  24. linkIdDelayed A unique identifier used to correlate stock count transactions with delayed transactions (arrives after the stock count is processed, but is done before the stock count).

  25. sourceType Indicates the type of device performing the sale, e.g., Mobile Access, RS POS, Extenda POS, etc.

  26. sourceId Indicates the id of the device performing the transaction.

  27. stockHandlingTypeId

    • $ref: stock-handling-type.json Indicates the stock handling type at the time of processing the transaction, e.g., NoStockHandling, DoStockHandling, etc.
  28. stockHandlingMethodId

    • $ref: stock-handling-method.json Indicates the stock handling method at the time of processing the transaction, e.g., FIFO, FEFO, LIFO.
  29. useAverageWeightedCostPrice Indicates whether to use average weighted cost price (AWCP).

  30. isStructuredItem True if the item is a master product (containing child products) at the time of processing the transaction.

  31. createdBy Identity of the user triggering the transaction.

  32. bestBeforeDate Best before date of the stock item.

  33. expirationDate Expiration date of the stock item.

  34. purchasePrice Purchase price of the stock item.

  35. operationType The type of operation performed in the transaction. This references the transaction-operation-type.json schema which defines the possible operation types (e.g., UNKNOWN, GOODS_RECEIVED, ORDER_RESPONSE, PURCHASE_ORDER, RETURN, RESERVATION, STOCK_CORRECTION, STOCK_COUNT, STOCK_TRANSFER, STOCK_TRANSFER_RECEIVED, SUPPLIER_RETURN, TRANSACTION, SYNCHRONIZE_STOCK, DEPRECATION, SALES).

  36. additionalProperties Additional properties related to the transaction.

  37. remainingStockQuantity A snapshot of stock quantity for the processed stock type after this transaction is processed.

  38. remainingCostAmount A snapshot of stock cost amount after this transaction is processed.

  39. timestamp Timestamp of when the transaction was processed.

Stock Type Schema (stock-type.json)

The stock-type.json schema defines the possible types of stock in a retail system. It is used to categorize stock items based on their status or location within the supply chain.

Properties

  • type: string
  • enum:
    • SalesStock: Stock available for sale.
    • InTransit: Stock that is currently being transported.
    • InOrder: Stock that has been ordered but not yet received.
    • Reserved: Stock that is reserved for a specific purpose or customer.
    • Returned: Stock that has been returned by customers.
    • ReservedInOrder: Stock that is reserved and also in order.