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-972 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-973 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-974 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-975 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