K3S-ReStore APIs


This is the API guide for all the calls to interact with the K3S-ReStore Database.

All API calls will be to a CL program that begins with BC_. This will call an RPG program with the prefix BR_. So BC_DELSUPL will call the RPG program BR_DELSUPL and return whether it was successful or not with a possible error message. You can refer to the File Field Descriptions to see what is the meaning of values being passed.

For any program that is an Update to a record (for example UPDSUPL) any field with an 'ID' prefix will be non-updatable via the program and used for identification of what records should be updated in the database.

A prefix of 'SB' will be applied to the front of all fields where a value is 'expected' to be submitted. 

A prefix of 'RV' will be applied to the front of all fields that are used to return values. 

All APIs will assume that the values submitted will be in the order they are listed in the API guide, correctly defined alphanumerics or numerics, and no longer than the listed size. The API will validate the data otherwise. 

Each CL/RPG API will have a test program with the prefix TT_ to help test the API with no parameters needing to be supplied. The test program will call the CL which in turn calls the RPG. This ensures each individual piece works. EX: TT_ADDSUPL, when called, will add a test supplier that can be deleted by calling TT_DELSUPL. 

Add Product(s) To Order - ADPR
        CPYADPR - Copy Product From Another Supplier
       
GETADPR - Get Product From Host System
        ADDADPR - Add Nonstock Product
        
ADSADPR - Add Product From Another Supplier

All Supplier Products - SPLE
UPDSPLE - Update Supplier and Product Lead Time Values *

Approved Orders - APOR
CALAPOR - Calculate Approved Order Totals 

Automated Add Days - AUTO
ADDAUTO - Add automated add days entry *
CPYAUTO - Copy automated add days entry *
DELAUTODelete automated add days entry * 
UPDAUTO - Update automated add days entry *

Batches - BACH
ADDBACH - Add new batch *
CHGBACH - Change batch status *

DELBACH - Delete batch *
LCKBACH - Lock batch *
RVWBACH - Batch entry reviewed 
UNLBACH - Unlock batch *


Buyer Group Settings - BUYR
ADDBUYR - Add buyer group *
DELBUYR - Delete
 buyer group *
UPDBUYR - Update buyer group *

Change Product Source - CHGP
ADDCHGP - Add change product source *
DELCHGP - Delete change product source *
UPDCHGP - Update change product source *

Combined Suppliers - CBSP
ADCCBSP - Add child supplier *
CRTCBSP - Create orders for combined supplier *
DELCBSP - Delete combined supplier *
DECCBSP - Delete child supplier *


Company Settings - COMP
UPDCOMP - Update company settings *

Customer Usage Batch - CUSG
ADDCUSG - Add customer usage batch *
ADPCUSG - Add product to customer usage batch *
DELCUSG - Delete customer usage batch *
DLPCUSG - Delete product from customer usage batch *
GENCUSG - Generate entries for customer usage batch *
PRCCUSG - Process customer usage batch *
RVRCUSG - Reverse customer usage batch *
UPDCUSG - Update customer usage batch *
UPPCUSG - Update product on customer usage batch *


Daily Information Management - DAYM
UPDDAYM - Update daily information 

Deal System - DEAL
ADDDEAL - Add deal
ADPDEAL - Add permanent deal
ADTDEAL - Add deal template
APRDEAL - Add products to deal
CPRDEAL - Copy deal to all products of a supplier
DELDEAL - Delete deal
DLPDEAL - Delete permanent deal
DPRDEAL - Delete products from deal
DLTDEAL - Delete deal template
PRCDEAL - Process deal
SELDEAL - Select locations for deal
SMBDEAL - Submit report
UPDDEAL - Update deal
UPPDEAL - Update permanent deal
UPRDEAL - Update product on deal
UPTDEAL - Update deal template

Discount Bracket Level Maintenance - BKTL
ADDBKTL - Add a bracket level 
DELBKTL - Delete a bracket level *
DFTBKTL - Next bracket level to add *
SELBKTL - Select a bracket level *
UPDBKTL - Update a bracket level 

History of Products - HT12
CALHT12 - Calculate history of product 
UHSHT12 - Update history of product 
FRMHT12 - Calculate history of product from certain period 
CPYHT12 - Copy history of product *
UFMHT12 - Update history of product from certain period 

History of Products - HT13
CALHT13 - Calculate history of product 
UHSHT13 - Update history of product 
FRMHT13 - Calculate history of product from certain period 
CPYHT13 - Copy history of product *
UFMHT13 - Update history of product from certain period 

History of Products - HT52
CALHT52 - Calculate history of product
UHSHT52 - Update history of product
FRMHT52 - Calculate history of product from certain period 
CPYHT52 - Copy history of product
UFMHT52 - Update history of product from certain period

Hold Outs - HOLD
ADDHOLD - Add hold out *
DELHOLD - Delete hold out *
GENHOLD - Generate entries *
GPCHOLD - Copy All P.O. Group Hold Out *
GPDHOLD - Delete All P.O. Group Hold Out *
GPAHOLD - Add P.O. Group Hold  Out *
GDPHOLD - Delete P.O. Group Hold Out *

GUPHOLD - Update P.O. Group Hold Out *
GRCHOLD - Copy All Product  Group Hold Out *
GRDHOLD - Delete All Product Group Hold Out *
GRAHOLD - Add Product Group Hold  Out *
GDRHOLD - Delete Product Group Hold Out *
GURHOLD - Update Product Group Hold Out *
UPDHOLD - Update hold out *

Hub Transfer System - HUBT
ADDHUBT - Add hub transfer 
CPYHUBT  - Copy hub transfer 
DELHUBT - Delete hub transfer 
ASLHUBT  - Add Supplier to Supplier Link hub transfer 
DSLHUBT  - Delete Supplier to Supplier Link hub transfer 

USLHUBT  - Update Supplier to Supplier Link hub transfer
APLHUBT  - Add Supplier to Product  Link hub transfer 
DPLHUBT  - Delete  Supplier to Product Link hub transfer 
UPLHUBT  - Update Supplier to Product Link hub transfer 
UPDHUBT - Update hub transfer 

Location Settings - LOCN
ADDLOCN - Add location 
DELLOCN - Delete location 
DFTLOCN - Default location values 
UPDLOCN - Update location *

Night Job Log - NITE
RETNITE - This returns the beginning and ending timestamps of the last successful night job. *
SUMNITE - This creates a night job log summary *

Notepad - NOTE
ADDNOTE - Add a note 
DELNOTE - Delete a note 
UPDNOTE - Update a note 

Order Cycle Analysis - ORCY
CALORCY- Calculate an Order Cycle *
ESTORCY - Estimate Order Cycle *
LTUORCY - Last Update to Order Cycle *
UPDORCY - Update an Order Cycle 

Orders - ORDR
APRORDR - Approve an order 
PODORDR - Next PO Number, other order defaults 
CALORDR - Recalculate an order 
CANORDR - Cancel order *
CLRORDR - Clear order *
DFTORDR - Get the order defaults *
FWDORDR - Forward buy an order *
LCKORDR - Lock an order *
RBDORDR - Rebuild an order *
RTRORDR - Retrieve bracket costs *
UNCORDR - Un-Cancel order *
UNLORDR - Unlock an order *
TOTORDR - Order summary totals 
USRORDR - User total dollar adjustments 
BRCORDR - Recalculate all orders for buyer group
RSTORDR - Remove quantities from approved order and reset

Overstock Product Transfer - OVPT
ADDOVPT - Add overstock transfer
DELOVPT - Delete overstock transfer
UPDOVPT - Update overstock transfer

Period End Filters - PEFL
ADDPEFL - Add period end filter 
CPYPEFL - Copy period end filter 
DELPEFL - Delete period end filter 
UPDPEFL - Update period end filter 

Period End Schedule - PERD
ADJPERD - Adjust remaining period for years 
UPDPERD - Update period end schedule 

Processing Schedule - PROC
EXNPROC - Set Exclude to No 
EXYPROC - Set Exclude to Yes 
ALNPROC - Set Alternate Source to No 
ALYPROC - Set Alternate Source to Yes 
PRCPROC - Set Processed to No 
LOGPROC - Returns the series number of a Night Job 
NXTPROC - Returns date of next processing job 

Product Delay Days - DELY
ADDDELY - Add product delay day entry 
DELDELY - Delete product delay day 
entry 
UPDDELY - Update product delay day entry 


Product Links - LINK
ADDLINK - Add product link 
CPYLINK - Copy product link 

DELLINK - Delete product link 
UPDLINK - Update product link 

Product Maintenance - PROD
PERPROD - Last completed period for product 
PROPROD - Update Promotional Product Info *
STSPROD - Set User Status of Product *
UPDPROD - Update a product *

Products on Suggested Orders - PROR
STSPROR - Update user status for product 
TOTPROR - Product totals by permanent/temporary code *
TRSPROR - Tracking Signal *
UAVPROR - Update average of product on suggested order *
UDVPROR - Update divisor of a product on suggested order 
UOCPROR - Update Order Cost of a product on suggested order 
UPDPROR - Update product quantity to order on suggestion 
L21PROR - Last 21 Days Demand By Week 
DEMPROR - Last 3 periods demand 
DAYPROR - Days on hand and on order *
LSSPROR - Lead Time and Safety Stock Approximate Units *
CALPROR - SOQ Simulator *
SPTPROR - Update Permanent and Temporary Split Codes *
DIVPROR - Automatically Divide Products Into Different Split Codes *
RSTPROR - Reset all products from a suggested order into Temp Code 1 
FBOPROR - Calculate the Forward Bought and Overstock units 
ATHPROR - Calculate the Actually On Hand Inventory and Theoretical On Hand

Product Transfer - PRTR
        TRFPRTR - Transfer product from
        DELPRTR - Delete product transfer
        
UPDPRTR - Update product transfer

Reports - REPT
        OBSREPT - Obsolete Products Report
        OVRREPT - Overstock Analysis Report
        
FORREPT - Forecasting Accuracy Report
        INVREPT - Inventory Performance Report
        ORCREPT - Order Cycle Analysis Report
        DEAREPT - Deal Markup Report
        PURREPT - Purchase Adjustments Report
        UPEREPT - User PE Performance Report
        TRNREPT - Turns Report
        SPLREPT - Supplier Lost Opportunities Report
        RNKREPT - Ranking Reports

Safety Stock Analyzer - SAFE
        CALSAFE - Safety stock analyzer *
 
Sales Journal - SAJO
        TOTSAJO - Total in Sales Journal for submitted dates
        CUSSAJO - Percentage of total for customer for product purchased within dates
       
Seasonal Profiles for Monthly - SZ12
ADDSZ12 - Add a season profile *
ANLSZ12 - Analyze for seasonality *
CALSZ12 - Calculate seasonality *
DELSZ12 - Delete a seasonal profile *
UPDSZ12 - Update a seasonal profile *
SELSZ12 - Select an existing seasonal profile *
DFTSZ12 - Default seasonal profile ID for new profile *
TSTSZ12 - Seasonality Analyzer Test *
BPRSZ12 - Better Seasonality Profile Test *

Seasonal Profiles for 13/4 Weekly - SZ13
ADDSZ13 - Add a season profile *
ANLSZ13 - Analyze for seasonality *
CALSZ13 - Calculate seasonality *
DELSZ13 - Delete a seasonal profile *
UPDSZ13 - Update a seasonal profile *
SELSZ13 - Select an existing seasonal profile *
DFTSZ13 - Default seasonal profile ID for new profile *
TSTSZ13 - Seasonality Analyzer Test *
BPRSZ13 - Better Seasonality Profile Test *

Seasonal Profiles for Daily Replenishment - SZ52
ADDSZ52 - Add a season profile *
CALSZ52 - Calculate seasonality
DELSZ52 - Delete a seasonal profile *
UPDSZ52 - Update a seasonal profile
SELSZ52 - Select an existing seasonal profile
DFTSZ52 - Default seasonal profile ID for new profile *

Service Level Exceptions - SRVC
ADDSRVC - Add service level exception
DELSRVC - Delete service level exception
SMBSRVC - Submit service level exception report
UPDSRVC - Update service level exception

Service Level Targets  - TARG
ADDTARG - Add service level target
ADGTARG - Add group service level target
ADSTARG - Add supplier group service level target
DELTARG - Delete service level target

DEGTARG - Delete group service level target
DESTARG - Delete supplier group service level target
UPGTARG - Update group service level target
UPSTARG - Update supplier group service level target
UPDTARG - Update service level target

Split Orders  - SPLT
CMBSPLT - Combined supplier split *
DPRSPLT - Deals (separate products) split *
DQTSPLT - Deals (separate quantity) split *
EXTSPLT - External source separation split *
LINSPLT - Number of lines per order split *
LOCSPLT - Location split *
MSSSPLT - Multi-shipments split *
PG1SPLT - Product group 1 split *
PG2SPLT - Product group 2 split *
PG3SPLT - Product group 3 split *
PG4SPLT - Product group 4 split *
PG5SPLT - Product group 5 split *
REQSPLT - Required split *
SELSPLT - Product select check split *
SPRSPLT - Split code permanent split *
STMSPLT - Split code temporary split *
USDSPLT - Unit straight down split *
USPSPLT - User system supplier split *


Sign On Check - SIGNON
        SIGNON - Perform system checks while signing on (more checks to add) 

Supplier Reorganization  - SPOG
SETSPOG - Set suppliers for a buyer group and location to SO_USERA1 = 0 
RSTSPOG - Recalculate SO_USERA1 suppliers for a buyer group and location based off SUPLLOG 


Supplier Maintenance - SUPL
ADDSUPL - Add a supplier *
CPYSUPL - Copy to all suppliers
DELSUPL - Delete a supplier *
DFTSUPL - Defaults for adding supplier *
UPDSUPL  - Update a supplier *
UFCSUPL - Update a supplier's fixed cycle 
RMFSUPL - Remove a fixed cycle from a supplier 

Table Codes- TABL
ADDTABL - Add Parent table code *
CPYTABL - Copy Parent table code *
DELTABL - Delete Parent table code 
UPDTABL - Update Parent table code *
ADCTABL - Add Child table code *
CPCTABL - Copy Child table code *
DECTABL - Delete Child table code
UPCTABL - Update Child 
table code *

User Preference- USER
ADDUSER - Add user preference *
DELUSER - Delete user preference *
DFTUSER - Default user preference 
UPDUSER - Update user preference *

Variable Order Cycle Profile  - VORC
ADDVORC - Add VOC profile
DELVORC - Delete 
VOC profile
UPDVORC - Update 
VOC profile

Weekly Distribution - WEEK
ADDWEEK - Add weekly distribution pattern
ANLWEEK - Analyze weekly distribution
GENWEEK - Generate new weekly distribution record
INCWEEK - Include / Exclude week
RMVWEEK - Remove all product records for a supplier
RMSWEEK - Remove all safety stock records for a supplier 
UPDWEEK - Update weekly distribution

Year To Date Purchases - YTDP
ADDYTDP - Add year to date purchase history
UPDYTDP - Update year to date purchase history

Your Space Calls - YOUR
DETYOUR - Your Space on Product Details 
HISYOUR - Your Space on Product History 
TODYOUR - Your Space on Today's Suggested Orders 
PRDYOUR - Your Space on Products On Suggested Orders 




Comments