Sales

The following services are included in this functional area:

Sales Download Service

The following services are included in this functional area:

Get Item Location Weekly Sales (deprecated)

Functional Area

Sales

Business Overview

Deprecated in v24.0.101.0: Scheduled for Removal in 2 Years. Use MerchIntegrations/services/sales/itemLocation/weekly

This webservice allows the store inventory system to query Merchandising for sales data for a specific item/location combination. Merchandising will respond by sending the available weeks of sales data, including the quantity sold, retail value and sales type (e.g. - Regular, Promotional, Clearance).

Service Type

POST

ReST URL
MerchIntegrations/services/sales/itemLocation/weekly/get
Input Payload Details

Table 5-1043 Get - Object. See list of elements for detail

Element Name Required Data Type Description

item

Yes

String (25)

Contains the item number in the distro.

location

Yes

Number (10)

This contains the destination location of the store order.

locationType

Yes

String (1)

This contains the destination location type of the store order.

Sample Input Message

{
  "item": "100100076",
  "location": 6000,
  "locationType": "S"
}
Response Code: 200 (Success)

Table 5-1044 GetResponse - Object. See list of elements for detail

Element Name Required Data Type Description

items

No

Collection of Object

References a collection of store order details.

Table 5-1045 Items - Object. See list of elements for detail

Element Name Required Data Type Description

eowDate

Yes

date

Contains the end of week date.

quantity

Yes

Number (12,4)

This contains the quantity of items in the order/transfer.

salesValue

Yes

Number (20,4)

This contains the value of the units sold.

salesType

Yes

String (1)

Indicates the type of sale which generated the sales.

Sample Response Message

{
  "items": [
    {
      "eowDate": "2001-12-31",
      "quantity": 1350,
      "salesValue": 2500000,
      "salesType": "?"
    }
  ]
}
Response Code: 400 (Error)

In case of error, the following standard error response will be returned. The element "validationErrors" will be present when input payload or input parameters are not as per the schema definition of this service. The element "businessError" will be present if the payload passes schema validation but exception is caught while processing business logic.

Sample Error Message

{
  "status": "ERROR",
  "message": "Error found in validation of input payload",
  "validationErrors": [
    {
      "error": "must be one of Y, N",
      "field": "createRecord.arg0.approveInd",
      "inputValue": "X"
    }
  ],
  "businessError": [
    "Error message"
  ]
}

Get Item Location Weekly Sales

Functional Area

Sales

Business Overview

This service retrieves weekly item sales information for store locations or inventory issues for warehouse locations from the Item Location History table (ITEM_LOC_HIST). Given the high volume of data in this table, it's recommended to use this service for retrieving filtered information using the available query parameters. This service requires at least one of the following query parameters to be included in the request.

  • End of Week Date
  • Item
  • Location

The optional query parameter of 'Include Late Posted Transaction' (valid values Y/N) is applicable if End of Week Date query parameter is passed. If this is passed as 'Y', the service will also retrieve late posted transactions from previous weeks that were posted within the requested End of Week period. This option is recommended when requesting information for the currently open week or recently closed week.

Service Type

GET

ReST URL
MerchIntegrations/services/sales/itemLocation/weekly
Input Parameters
Parameter Name Required Data Type Description
limit No Number (6) Pagination limit. Default Value is 1000
offsetkey No String Offset Key. Valid Value is combination of item eowDate, salesType and location
eowDate Yes* date This field contains the end of the week date of the week for the sales total and other calculations. Format YYYY-MM-DD
location Yes* Number (10) This field contains numeric identifier of the location. This field may contain a store, warehouse.
locationType No String (1) This field specifies type of location in the location field. Valid values are S - Store, W - Warehouse.
item Yes* String (25) This field specifies unique alphanumeric value that identifies the item
dept No Number (4) This field uniquely identifies the department
class No Number (4) This field identifies the class within the department
subclass No Number (4) This field identifies the subclass within the department and class combination
salesType No String This field indicates the type of sale or inventory movement. Valid Values are defined in code detail with code type SIST. Default seeded values are I - Issues From Warehouses to Stores, C - Clearance, P - Promotional, R - Regular
year No Number (4) This field contain the identifier of the year in which the transactions occurred based on the 454 calendar
month No Number (2) This field contain the identifier of the month in which the transactions occurred based on the 454 calendar
includeLatePosted No String (1) This field can be used in addition to query parameter of eowDate to additionally fetch late posted transaction from earlier weeks where the post date is within the provided end of week date period. Valid Values are Y – Yes, N – No. Default is N.
include No String Fields to include - comma separated (Example items.name,items.address.city)
exclude No String Fields to exclude - comma separated (Example items.address.contactFax,items.customFlexAttribute)
Response Code: 200 (Success)
Element Name Required Data Type Description
items No Collection of Object References a collection of weekly sales history.

Table 5-1046 Items - Object. See list of elements for detail

Element Name Required Data Type Description
eowDate Yes date This field contains the end of the week date of the week for the sales total and other calculations. Format YYYY-MM-DD
location Yes Number (10) This field contains numeric identifier of the location. This field may contain a store, warehouse.
locationType Yes String (1) This field specifies type of location in the location field. Valid values are S - Store, W - Warehouse.
item Yes String (25) This field specifies unique alphanumeric value that identifies the item
salesType Yes String (1) This field indicates the type of sale or inventory movement. Valid Values are defined in code detail with code type SIST. Default seeded values are I - Issues From Warehouses to Stores, C - Clearance, P - Promotional, R - Regular
salesIssues No Number (12,4) This field contains the number of units sold or transferred for item/location/week/sales type combination. If the location type is a store, then this value represents sales. If the location type is a warehouse, then this value represents outbound transfer/allocation transactions to stores.
value No Number (20,4) This field contains the retail value of the sales for the item/location/week/sales type combination. This field is stored in the local currency. This field will only hold a value for stores.
grossProfit No Number (20,4) This field contains the total gross profit calculated for the item/location/week/sales type. This is updated for each sale that occurs during the week and is calculated as (sales retail - cost of sales). This field will only hold a value for stores.
stock No Number (12,4) This field contains the stock on hand for the item/location combination at the end of the week.
retail No Number (20,4) This field contains the unit retail price of the item at the location at the end of the week. This field is stored in the local currency.
averageCost No Number (20,4) This field contains the average cost of the item at the location at the end of the week. This field is stored in the local currency
year Yes Number (4) This field contain the identifier of the year in which the transactions occurred based on the 454 calendar
month Yes Number (2) This field contain the identifier of the month in which the transactions occurred based on the 454 calendar
week Yes Number (1) This field contain the identifier of the week in which the transactions occurred based on the 454 calendar
dept Yes Number (4) This field uniquely identifies the department
class Yes Number (4) This field identifies the class within the department
subclass Yes Number (4) This field identifies the subclass within the department and class combination
postdate Yes Date Holds the business date the record is inserted or last updated. Format YYYY-MM-DD

Sample Response Message

{
  "items": [
    {
      "eowDate": "2024-01-10",
      "location": 10051,
      "locationType": "S",
      "item": "110023212",
      "salesType": "R",
      "salesIssues": 123,
      "value": 3823.83,
      "grossProfit": 8.6,
      "stock": 25,
      "retail": 29.95,
      "averageCost": 17.2,
      "year": 2023,
      "month": 1,
      "week": 4,
      "dept": 1031,
      "class": 1,
      "subclass": 1,
      "postDate": "2024-01-01"
    }
  ],
  "hasMore": true,
  "limit": 1000,
  "count": 1,
  "links": [
    {
      "href": "https://<server>:<port>/Application/services/resources?limit=1000",
      "rel": "self"
    }
  ]
}

Store Day User Upload Service

This section describes the Store Day User service.

Functional Area

Financials

Business Overview

The primary role of this service is to create or delete store day user and send them to Merchandising.

Create Store Day User

Business Overview

This service creates store day user by calling the SVCPROV_STOREDAYUSER package to load input data to the staging tables and then calling the core store day user package to validate and insert data to the Merchandising tables.

Service Type

Post

ReSTURL

financials/StoreDayUserREST/create StoreDayUser

Input Parameters

SvcprovSdudescRecRDO

Parameter Name Data Type

store

BigDecimal

businessDate

String

userId

String

JSON Structure

[{"store": null,
  " businessDate": null,
  " userId": null}]

BusinessDate will take input in string with the format as 'DD-MON-YYYY' and later converted to Timestamp format and insert in table.

Output

SvcprovSduStatusRecRDO

Parameter Name Data Type

statusMsg

String

sduErrTbl

List< SvcprovFailSduRecRDO >

SvcprovFailSduRecRDO

Parameter Name Data Type

store

BigDecimal

businessDate

String

userId

String

errorMsg

String

The output will contain the status of the request including validation errors, if any.

JSON Structure:

{
  "statusMsg": null,
  " sduErrTbl ": [
    {
      " store": null,
      " businessDate": null,
      " userId": null,
      "errorMsg": null,
      "links": [],
      "hyperMediaContent": {
        "linkRDO": []
      }
    }
  ],
  "links": [],
  "hyperMediaContent": {
    "linkRDO": []
  }
}
Table Impact

TABLE SELECT INSERT UPDATE DELETE

STORE_DAY_USER

Yes

Yes

No

No

SVC_STORE_DAY_USER

Yes

Yes

Yes

Yes

JOB_AUDIT_LOGS

No

Yes

No

No

JOB_AUDIT_PAYLOAD

No

Yes

No

No

Delete Store Day User

Business Overview

This service deletes store day user by calling the SVCPROV_SDU package to load input data to the staging tables and then calling the core store day user package to validate and delete data to the Merchandising tables.

Service Type

Post

ReSTURL

financials/StoreDayUserREST/delete StoreDayUser

Input Parameters

SvcprovSdudescRecRDO

Parameter Name Data Type

store

BigDecimal

businessDate

String

userId

String

JSON Structure

[{"store": null,
  " businessDate": null,
  " userId": null}]

BusinessDate will take input in string with the format as 'DD-MON-YYYY' and later converted to Timestamp format and delete from table.

Output

SvcprovSduStatusRecRDO

Parameter Name Data Type

statusMsg

String

sduErrTbl

List< SvcprovFailSduRecRDO >

SvcprovFailSduRecRDO

Parameter Name Data Type

store

BigDecimal

businessDate

String

userId

String

errorMsg

String

The output will contain the status of the request including validation errors, if any.

JSON Structure

{
  "statusMsg": null,
  " sduErrTbl ": [
    {
      " store": null,
      " businessDate": null,
      " userId": null,
      "errorMsg": null,
      "links": [],
      "hyperMediaContent": {
        "linkRDO": []
      }
    }
  ],
  "links": [],
  "hyperMediaContent": {
    "linkRDO": []
  }
}
Table Impact

TABLE SELECT INSERT UPDATE DELETE

STORE_DAY_USER

Yes

No

No

Yes

SVC_STORE_DAY_USER

Yes

Yes

Yes

Yes

JOB_AUDIT_LOGS

No

Yes

No

No

JOB_AUDIT_PAYLOAD

No

Yes

No

No

Functional Area

Sales - Sales Processing

Business Overview

This service allows the loading of sales data into Merchandising

Service Type

POST

ReST URL
MerchIntegrations/services/sales/uploadAndProcess
Input Payload Details

Table 5-1047 UploadAndProcess - Object. See list of elements for detail

Element Name Required Data Type Description
store Yes Number (10) The unique identifier of the store.
salesTransactions Yes Collection of Object

Table 5-1048 SalesTransactions - Object. See list of elements for detail

Element Name Required Data Type Description
transactionSeqNo Yes Number (10) Unique Sequence Number for each sales transaction line.
transactionDate Yes date Date sale/return transaction was processed at the POS
item Yes String (25) The ID number of an ITM or REF
transactionType Yes String (1) Transaction type code to specify whether transaction is a sale or a return
totalSalesQuantity Yes Number (12,4) number of units sold at a particular location
sellingUom Yes String (4) UOM at which this item was sold
totalSalesValue Yes Number (20,4) net sales value of goods sold
actualWeightQuantity No Number (12,4) The actual weight of the item, only populated for catchweight Items
totalTaxValue Yes Number (20,4) This will indicate total of all Tax amount for the item.
noInventoryReturnInd No String (1) This field contains an indicator that identifies a return without inventory. This is generally a non-required column, but in case of Returns, this is required.
returnDisposition No String (10) This field will contain the disposition code published by RWMS as part of the Returns upload to OMS.
returnWarehouse No Number (10) This field contains the physical warehouse ID for the warehouse identifier where the item was returned.
salesType Yes String (1) This field indicates whether the line item is a Regular Sale, a customer order serviced by OMS (External CO) or a customer order serviced by a store (In Store CO).
customerOrderNo No String (48) This field contains the customer order number ID.
fulfillOrderNo No String (48) This field contains the fulfillment order number ID.
fulfillLocationType No String (2) This field contains the fulfillment location type. and Valid values are found under the FLTP code type, for e.g In Store (ST), Supplier (SU), Warehouse (WH).
fulfillLocation No String (10) This field contains the fulfillment loc ID.
dropShipmentInd No String (1) Indicates whether the transaction is a drop shipment or not. If it is a drop shipment, indicator will be 'Y'. This field is not required, but will be defaulted to 'N' if blank
origStore No String (10) This field contains the original store value for a Return transaction.
postingStore No String (10) This field contains the store at which the item sale/return should be accounted for in case of cross-store sales happening at co-located stores. It is expected that this field will be populated only for items that are checked out at a different store from the one at which they are originally managed.
posTranId No Number (20) This field contains the unique identifier for a sale transaction,This is an Optional field.
consignmentUnitCost No String (20) This field contains the consignment unit cost that should be applied while posting the sales/returns to Merchandising.
consignmentRate No String (12) This field contains the consignment rate that should be applied while posting the sales/returns to Merchandising.
inventoryIdentifierType No String (6) This field contains the inventory identifier type passed in Sales/Return transactions. Valid values are found under the Inventory Identifier Types (IIDT) code type, for e.g Lot (L), Expiry Date (E), Import Document (D).
inventoryId No String (120) This field contains the inventory id value being passed in sales/return transactions.
taxes No Collection of Object
promotions No Collection of Object

Table 5-1049 Taxes - Object. See list of elements for detail

Element Name Required Data Type Description
taxCode Yes String (6) The Tax Code of the item
taxRate Yes Number (20,10) The tax rate of the item.
taxAmount Yes Number (20,4) The item level tax or prorated transaction level tax of the item .

Table 5-1050 Promotions - Object. See list of elements for detail

Element Name Required Data Type Description
promoTranType Yes String (5) This field contains the Promotion Sales Types and Valid values are found under the PRMT code type, for e.g In Store Discount (1004), Employee Discount (1005), External Promotion (2000), Internal Promotion (9999).
promoId No Number (10) Promotion number from Merchandising
promoComponent No Number (10,4) Links the promotion to additional pricing attributes. This contains the OFFER_ID from Pricing.
salesQuantity Yes Number (12,4) Sales quantity sold for this promotion type
salesValue Yes Number (20,4) Sales value for this promotion type
discountValue Yes Number (20,4) Discount value for this promotion type

Table 5-1051 UploadAndProcessError - Object. See list of elements for detail

Element Name Required Data Type Description
store Yes Number (10) Input store Value.
transactionSeqNo Yes Number (10) Input Unique Sequence Number.
errorMessage Yes Array of String

Sample Input Message

{
  "store": 1521,
  "salesTransactions": [
    {
      "transactionSeqNo": 1,
      "transactionDate": "2001-12-31",
      "item": "100100076",
      "transactionType": "S",
      "totalSalesQuantity": 21,
      "sellingUom": "EA",
      "totalSalesValue": 210,
      "actualWeightQuantity": null,
      "totalTaxValue": 13,
      "noInventoryReturnInd": null,
      "returnDisposition": null,
      "returnWarehouse": null,
      "salesType": "R",
      "customerOrderNo": null,
      "fulfillOrderNo": null,
      "fulfillLocationType": null,
      "fulfillLocation": null,
      "dropShipmentInd": "N",
      "origStore": null,
      "postingStore": null,
      "posTranId": 625,
      "consignmentUnitCost": null,
      "consignmentRate": null,
      "inventoryIdentifierType": null,
      "inventoryId": null,
      "taxes": [
        {
          "taxCode": "S",
          "taxRate": 1,
          "taxAmount": 1
        }
      ],
      "promotions": [
        {
          "promoTranType": "1004",
          "promoId": null,
          "promoComponent": null,
          "salesQuantity": 1,
          "salesValue": 1,
          "discountValue": 1
        }
      ]
    }
  ]
}
Response Code: 200 (Success)

Sample Response Message

{
  "status": "SUCCESS"
}
Response Code: 400 (Error)

If there is an error, the following standard error response will be returned. The element validationErrors will be present when the input payload or input parameters do not match the schema definition for this service. The element businessError will be present if the payload passes schema validation but an exception is caught while processing the business logic.

Table 5-1052 UploadAndProcessError - Object. See list of elements for detail

Element Name Required Data Type Description
store Yes Number (10) Input store Value.
transactionSeqNo Yes Number (10) Input Unique Sequence Number.
errorMessage Yes Array of String

Sample Error Message

{
  "status": "ERROR",
  "message": "Error found in validation of input payload",
  "validationErrors": [
    {
      "error": "must be one of Y, N",
      "field": "createRecord.arg0.approveInd",
      "inputValue": "X"
    }
  ],
  "businessError": [
    {
      "store": 1521,
      "transactionSeqNo": 1,
      "errorMessage": [
        "u0027Invalid Itemu0027"
      ]
    }
  ]
}