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

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 parameter 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.

Table 5-1421 Input Parameters

Parameter Name Required Data Type Description

limit

No

String (6)

Pagination limit. Default value is 1000.

offsetkey

No

String

Offset Key

eowDate

No

String

End of Week Date (YYYY-MM-DD)

location

No

String (10)

Location

locationType

No

String

Location Type

item

No

String

Item

dept

No

String (4)

Dept

class

No

String (4)

Class

subclass

No

String (4)

Subclass

salesType

No

String

Sales Type

year

No

String (4)

Year 454

month

No

String

Month 454

includeLatePosted

No

String

Include Late Posted Transaction

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)

Service Type

GET

ReST URL

MerchIntegrations/services/sales/itemLocation/weekly

Input Payload Details

Table 5-1422 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-1423 PageResultItemsItemLocHist - Object. See list of elements for detail

Element Name Required Data Type Description

items

No

Collection of Object

Collection of records

hasMore

No

Boolean

Boolean to signify if there are additional pages of data. This is true if limit = count

limit

No

Number

Requested page size. If the page size was not defined in the input request, a default page size is used to limit the number of records to fetch

count

No

Number

Number of record in the response object

links

No

Collection of Object

List of Self and/or Next URL

Table 5-1424 ItemLocHist - Object. See list of elements for detail

Element Name Required Data Type Description

eowDate

No

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

No

Number

This field contains numeric identifier of the location. This field may contain a store, warehouse.

locationType

No

String

This field specifies type of location in the location field. Valid values are S - Store, W - Warehouse.

item

No

String

This field specifies unique alphanumeric value that identifies the item

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

salesIssues

No

Number

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

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

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

This field contains the stock on hand for the item/location combination at the end of the week.

retail

No

Number

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

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

No

Number

This field contain the identifer of the year in which the transactions occurred based on the 454 calendar

month

No

Number

This field contain the identifer of the month in which the transactions occurred based on the 454 calendar

week

No

Number

This field contain the identifer of the week in which the transactions occurred based on the 454 calendar

dept

No

Number

This field uniquely identifies the department

class

No

Number

This field identifies the class within the department

subclass

No

Number

This field identifies the subclass within the department and class combination

postDate

No

date

Holds the business date the record is inserted or last updated. Format YYYY-MM-DD

Table 5-1425 LinkItem - Object. See list of elements for detail

Element Name Required Data Type Description

href

No

String

Service URL

rel

No

String

This can be either 'self' or 'next'. The 'next' link is present if there are more pages to fetches and contains the offsetkey which unique identifies the last record of this response.

Sample Response Message

{
"items": [
{
"eowDate": "2001-12-31",
"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": "2001-12-31"
}
],
"hasMore": true,
"limit": 1,
"count": 1,
"links": [
{
"href": "https://<server>:<port>/Application/services/resources?limit=1000",
"rel": "self"
}
]
}
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.

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"
}
]
}

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 parameter 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

String (6)

Pagination limit. Default value is 1000.

offsetkey

No

String

Offset Key

eowDate

No

String

End of Week Date (YYYY-MM-DD)

location

No

String (10)

Location

locationType

No

String

Location Type

item

No

String

Item

dept

No

String (4)

Dept

class

No

String (4)

Class

subclass

No

String (4)

Subclass

salesType

No

String

Sales Type

year

No

String (4)

Year 454

month

No

String

Month 454

includeLatePosted

No

String

Include Late Posted Transaction

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)

Table 5-1426 PageResultItemsItemLocHist - Object. See list of elements for detail

Element Name Required Data Type Description

items

No

Collection of Object

Collection of records

hasMore

No

Boolean

Boolean to signify if there are additional pages of data. This is true if limit = count

limit

No

Number

Requested page size. If the page size was not defined in the input request, a default page size is used to limit the number of records to fetch

count

No

Number

Number of record in the response object

links

No

Collection of Object

List of Self and/or Next URL

Table 5-1427 ItemLocHist - Object. See list of elements for detail

Element Name Required Data Type Description

eowDate

No

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

No

Number

This field contains numeric identifier of the location. This field may contain a store, warehouse.

locationType

No

String

This field specifies type of location in the location field. Valid values are S - Store, W - Warehouse.

item

No

String

This field specifies unique alphanumeric value that identifies the item

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

salesIssues

No

Number

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

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

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

This field contains the stock on hand for the item/location combination at the end of the week.

retail

No

Number

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

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

No

Number

This field contain the identifer of the year in which the transactions occurred based on the 454 calendar

month

No

Number

This field contain the identifer of the month in which the transactions occurred based on the 454 calendar

week

No

Number

This field contain the identifer of the week in which the transactions occurred based on the 454 calendar

dept

No

Number

This field uniquely identifies the department

class

No

Number

This field identifies the class within the department

subclass

No

Number

This field identifies the subclass within the department and class combination

postDate

No

date

Holds the business date the record is inserted or last updated. Format YYYY-MM-DD

Table 5-1428 LinkItem - Object. See list of elements for detail

Element Name Required Data Type Description

href

No

String

Service URL

rel

No

String

This can be either 'self' or 'next'. The 'next' link is present if there are more pages to fetches and contains the offsetkey which unique identifies the last record of this response.

Sample Response Message

{
"items": [
{
"eowDate": "2001-12-31",
"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": "2001-12-31"
}
],
"hasMore": true,
"limit": 1,
"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

Upload and Process Sales

Functional Area

Sales - Sales Processing

Business Overview

This ReST service allows for sales from an external Sales Audit or Point of Sale system to be uploaded directly into Merchandising and provides an alternative solution to existing POSU file upload solution. The validations imposed by this is similar to those enforced by the upload sales process that loads sales data from Sales Audit into Merchandising. This service expects each message to have transaction for a single store location. It supports Item level taxes and promotion or discount details, and determines posting and processing locations using existing configuration.

Service Type

POST

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

Table 5-1429 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-1430 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-1431 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-1432 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-1433 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)

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.

Table 5-1434 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"
]
}
]
}