0% found this document useful (0 votes)
274 views37 pages

WebPOS 3rd Party Integration Tool (W3P)

Third Party Integration Tool to WebPos

Uploaded by

Guntur Ks
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
274 views37 pages

WebPOS 3rd Party Integration Tool (W3P)

Third Party Integration Tool to WebPos

Uploaded by

Guntur Ks
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

WebPOS 3rd Party Integration Tool (W3P)

Jan 18, 2019 – major updates to make the tool more SAP friendly

Dec 6, 2018 – added SET_TRANSMIT_LOG, <ftransmitid>,<fkey>

Sep 6, 2017 – added account, mutex control

Oct 27, 2020 (RS) - added <frestrict_office_flag>, <fofficeid> in GET_ACCOUNT action

- added Purchasing Module (GET_RR, GET_DELIVERY, UPDATE_RR)

This document will guide third party to connect with WebPOS through WebPOS 3rd Party Integration Tool of W3P.

Key Functions

Master Database
Product Master (Two Way)
Warehouse Master (Two Way)
Account Master (Two Way)

Transactional Database Exchange

POS transaction (One Way)


Inventory Transaction (Two Way)

Table of Contents

I. SOAP Technology
Components of W3P
User Credentials
SOAP Interface
II. PULL MASTER DATA
ACTION: GET_ACCOUNT
Synchronization Flow Example
Account Master Synchronization
ACTION: GET_CREDIT
ACTION: GET_OFFICE
ACTION: GET_PRODUCT
ACTION: GET_SERIAL
ACTION: GET_WAREHOUSE
III. SAVE MASTER DATA
ACTION : SAVE_ACCOUNT
fthirdpartyid
Return Values
Account Master Mapping
Formatting Errors
ACTION : SAVE_CREDIT
ACTION : SAVE_OFFICE
ACTION : SAVE_PRODUCT
ACTION : SAVE_SERIAL
ACTION : SAVE_UOM
ACTION : SAVE_WAREHOUSE
IV. Inventory Movements
ACTION: SAVE_STOCK_ADJUSTMENT, SAVE_STOCK_COUNT, SAVE_STOCK_TRANSFER
fdoctype 0 = IN, 1 = OUT ,101 = TRANSFER
Header Mapping
Product Mapping
ACTION: GET_STOCK_ADJUSTMENT, GET_STOCK_COUNT, GET_STOCK_TRANSFER
ACTION: VOID_STOCK_ADJUSTMENT, VOID_STOCK_COUNT, VOID_STOCK_TRANSFER
ACTION: GET_STOCK_STATUS
ACTION: SAVE_STOCK_STATUS
STOCK STATUS SYNCING
V. Sales
ACTION: GET_SALES

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 1
Sales Header Mapping
Sales Product Mapping
Sales Payment Mapping
ACTION: GET_SALES_TRANSACTION
VI. PURCHASING
ACTION: GET_RR
Receiving Report Header Mapping
Receiving Report Product Mapping
ACTION: GET_DELIVERY
Delivery Report Header Mapping
Delivery Report Product Mapping
ACTION: UPDATE_RR
VII. OTHERS
ACTION: REGISTER_WEBHOOK
ACTION: SAVE_LOCAL_KEY
ACTION : GET_LOCAL_KEY
ACTION: POST_LOG
ACTION: BYPASS_RECORD
ACTION: CONCLUDE_RECORD
Mutual Exclusion Control
Maximum Characters
VIII. Activation

I. SOAP Technology
We will use SOAP to communicate.

All examples here will be in PHP.

Components of W3P
W3P will have 2 components:
1st component (W3P-1) will be based in PHP and reside in the same server as WebPOS. This will be SOAP server based extension of WebPOS.
2nd component (W3P-2) will be OS specific to the requirement of the 3rd party system. In case of SAP, this will be VB based in Windows environment.
For other system, this can be PHP based running in linux, etc.
W3P-2 will handle all customization specific to communicate with 3rd party system and relay them through W3P-1 through the standard interface.
WebPOS will be shielded from all of these.
W3P-2 can also be developed by the 3rd party system.

WebPOS

W3P-1 (Standard SOAP Server)

W3P-2 (SAP) W3P-2 (System W3P-2 (System 2) W3P-2 (System 3) W3P-2 (System 4)...
VB, Windows 1)
PHP, Linux

User Credentials
Maintained per company account
Each company can have multiple users. To communicate from different location , we can register several users with same company.
3rd party must request Alliance to register the users before any exchange can take place. In return, they will received an ID (w3p_id ) and
access key (w3p_key) which they need to use in all SOAP communication.

SOAP Interface
We will have single entry point for all SOAP communications -

URL : http://<server>/appserv/app/w3p/W3PSoapServer.php
WSDL : http://<server>/appserv/app/w3p/w3p.wsdl

Function : call

Parameters : action one of the following

5 - Other Essentials

POST_LOG

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 2
REGISTER_WEBHOOK
SOAP_HEADER

GET_LOCAL_KEY
SAVE_LOCAL_KEY

param xml string

Example Code:

<?php
ini_set("soap.wsdl_cache_enabled", "0");
$client = new SoapClient("http://localhost:8888/appserv/app/w3p/w3p.wsdl",
array("location" => "http://localhost:8888/appserv/app/w3p/W3PSoapServer.php")

$p = "<root>
<id>
<fw3p_id>15082683</fw3p_id>
<fw3p_key>12345</fw3p_key>
</id>
<data>
<filter>
<faccountid>WEBPOS</faccountid>
</filter>
</data>
</root>";
$s = $client->call("GET_ACCOUNT",$p);
echo "RESULT=".$s."\n";
?>

Note

<id> section will remain the same for all calls.

II. PULL MASTER DATA

ACTION: GET_ACCOUNT

Parameter

<data>
<filter>
<faccountid>WEBPOS</faccountid>
<fthirdpartyid>WEBPOS</fthirdpartyid>
<fkeyword></fkeyword>
<fcustomer_flag>0</fcustomer_flag>
<fsupplier_flag>0</fsupplier_flag>
</filter>
</data>

Available filters: faccountid, fthirdpartyid, fkeyword, fcustomer_flag, fsupplier_flag

To search for single or selected records, you do not need to specify these parameters. Just supply the filter.

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 3
Actual Example: Getting Account based on Keyword

$p = "
<root>
<id>
<fw3p_id>15082683</fw3p_id>
<fw3p_key>12345</fw3p_key>
</id>
<data>
<filter>
<fkeyword>WEBPOS</fkeyword>
</filter>
</data>
</root>
";
$s = $client->call("GET_ACCOUNT",$p);

This will return the account with "WEBPOS".

Return value will be

<root>
<return_code>0</return_code>
<data>
<fnew_batchid>20190118170641</fnew_batchid>
<flast_batchid>
<flast_key>2</flast_key>
<fdone>1</fdone>
<record id="WEBPOS">
<faccountid>WEBPOS</faccountid>
<fthirdpartyid>WEBPOS</fthirdpartyid>
<fname>WEBPOS</fname>
<factive_flag>1</factive_flag>
<fmemo>
<fcustomer_flag>1</fcustomer_flag>
<fsupplier_flag>0</fsupplier_flag>
<fupdated_date>20190114143611</fupdated_date>
<fthirdparty_branchid>1</fthirdparty_branchid>
<frestrict_office_flag>1</frestrict_office_flag>
<fofficeid>MAIN</fofficeid>
</fmemo></record>
</flast_batchid></data>
</root>

Basic Business Rule in getting records from WebPOS

soap->call(ACTION,
<root>
<id>
<fw3p_id>
<fw3p_key>
<data>
<flast_batchid> YYYYMMDDHHMMSS
Last successful full synchronization
blank if from scratch
<fnew_batchid> YYYYMMDDHHMMSS
if blank, it represents the first batch of download
Downloads are broken into batches to avoid lumping
everything together
<flast_key> Last record count from last batch
we will resume from flast_key + 1

Return Value

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 4
<return_code>
<messages>
<data>
<fnew_batchid>
<flast_batchid>
<flast_key>
<fdone> 0 : not yet, 1: yes
<record>
<record>
<faccountid>
<fthirdpartyid>
<record>
<record>
...

3rd party system needs to store the data (fnew_batchid, flast_batchid, flast_key) for the next cycle of pull record call.

Synchronization Flow Example

Cycle Parameter (3rd party need to store this) Return Value

Batch 1, 1st time flast_batchid = blank fnew_batchid = 20170704145000


fnew_batchid = blank flast_batchid = blank
flast_key = blank flast_key = 100
(if fnew_batchid is blank, flast_key will be automatically disregarded) fdone = 0
(100 lines have returned)

Batch 1, 2nd time fnew_batchid = 20170704145000 fnew_batchid = 20170704145000


flast_batchid = blank flast_batchid = blank
flast_key = 100 flast_key = 200
fdone = 0
(return next 100 lines)

Batch 1, 3rd time fnew_batchid = 20170704145000 fnew_batchid = 20170704145000


flast_batchid = blank flast_batchid = blank
flast_key = 200 flast_key = 250
fdone = 1
(return the remaining 50 lines)

At this point, 3rd party should store these values since fdone = 1

flast_batchid = fnew_batchid or
flast_batchid = 20170704145000

Batch 2, 1st time flast_batchid = 20170704145000 fnew_batchid = 20170704180000


fnew_batchid = blank flast_batchid = 20170704145000
flast_key = blank flast_key = 100
fdone = 0
(return 100 lines that have changed or added)

Batch 2, 2nd time fnew_batchid = 20170704180000 fnew_batchid = 20170704180000


flast_batchid = 20170704145000 flast_batchid = 20170704145000
flast_key = 100 flast_key = 50
fdone = 1
(return the remaining 50 lines)

At this point, 3rd party should store these values since fdone = 1

flast_batchid = fnew_batchid or
flast_batchid = 20170704180000

Account Master Synchronization

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 5
Actual Example:

$p = "<root>
<id>
<fw3p_id>15082683</fw3p_id>
<fw3p_key>12345</fw3p_key>
</id>
<data>
<filter>
<fnew_batchid>20170704180000</fnew_batchid>
<flast_batchid>20170704145000</flast_batchid>
<flast_key>100</flast_key>
</filter>
</data>
</root>
";
$s = $client->call("GET_ACCOUNT",$p);

ACTION: GET_CREDIT

Parameter

<data>
<filter>
<fcreditid>WEBPOS</fcreditid>
<fthirdpartyid>WEBPOS</fthirdpartyid>
<fkeyword></fkeyword>
</filter>
</data>

Available filters: fcreditid, fthirdpartyid, fkeyword

Return Values:

<root>
<return_code>0</return_code>
<data>
<fnew_batchid>20190118183546</fnew_batchid>
<flast_batchid>
<flast_key>1</flast_key>
<fdone>1</fdone>
<record id="4">
<fcreditid>4</fcreditid>
<fthirdpartyid>4</fthirdpartyid>
<fname>Visa</fname>
<fmemo>VISA</fmemo>
</record>
</flast_batchid></data>
</root>

ACTION: GET_OFFICE

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 6
Parameter

<data>
<filter>
<fofficeid>MAIN</fofficeid>
<fthirdpartyid>MAIN</fthirdpartyid>
<fkeyword></fkeyword>
</filter>
</data>

Available filters: fofficeid, fthirdpartyid, fkeyword

Return Values:

<root>
<return_code>0</return_code>
<data>
<fnew_batchid>20190121100248</fnew_batchid>
<flast_batchid></flast_batchid>
<flast_key>2</flast_key>
<fdone>1</fdone>
<record id="MAIN">
<fofficeid>MAIN</fofficeid>
<fthirdpartyid>13</fthirdpartyid>
<fname>Main Branch</fname>
<factive_flag>1</factive_flag>
<fsiteid>MAIN</fsiteid>
<fmemo>Generated by default</fmemo>
<faddress1></faddress1>
<faddress2></faddress2>
<faddress3></faddress3>
<fphone></fphone>
<fupdated_date>20190111152956</fupdated_date>
<fthirdparty_siteid>MAIN</fthirdparty_siteid>
</record>
</data>
</root>

ACTION: GET_PRODUCT

Parameter

<data>
<filter>
<fproductid>01</fproductid>
<fthirdpartyid></fthirdpartyid>
<fkeyword></fkeyword>
<fcompress>1</fcompress>
</filter>
</data>

Available filters: fproductid, fthirdpartyid, fkeyword

If fcompress = 1, COMPRESS = ZLIB

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 7
Return Values:

<root>
<return_code>0</return_code>
<data>
<fnew_batchid>20190121100931</fnew_batchid>
<flast_batchid/>
<flast_key>2</flast_key>
<fdone>1</fdone>
<record id="0ESPRESSO">
<fproductid>0ESPRESSO</fproductid>
<fthirdpartyid>0ESPRESSO</fthirdpartyid>
<fname>ESPRESSO GROUND</fname>
<factive_flag>1</factive_flag>
<fmemo/>
<fsale_flag>1</fsale_flag>
<fuomid>PCS</fuomid>
<fstnd_cost>1.000000</fstnd_cost>
<fpurchase_uom>GRAM</fpurchase_uom>
<falternate1/>
<flist_price>1.000000</flist_price>
<ftax_type>0</ftax_type>
<fproduct_type>0</fproduct_type>
<fbarcode1/>
<fbarcode2/>
<fbarcode3/>
<fvariationid/>
<fsub_product_flag>0</fsub_product_flag>
<fsingle_lot_flag>0</fsingle_lot_flag>
<fcategory_value1/>
<fcategory_value2/>
<fcategory_value3/>
<fcategory_value4/>
<fcategory_value5/>
<fcategory_value6/>
<fupdated_date>20180830163955</fupdated_date>
</record>
</data>
</root>

ACTION: GET_SERIAL

Parameter

<data>
<filter>
<flotno>J3</flotno>
<fproductid>01</fproductid>
<fthirdparty_productid></fthirdparty_productid>
<fcompress>1</fcompress>
</filter>
</data>

Available filters: fproductid, fthirdpartyid, fkeyword

If fcompress = 1, COMPRESS = ZLIB

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 8
Return Values:

<root>
<return_code>0</return_code>
<data>
<fnew_batchid>20200824160638</fnew_batchid>
<flast_batchid/>
<flast_key>2</flast_key>
<fdone>1</fdone>
<record id="J3">
<fproductid>LOT1</fproductid>
<fthirdpartyid>J3</fthirdpartyid>
<flotno>J3</flotno>
<fime1>J31</fime1>
<fime2>J32</fime2>
<fmemo/>
<factive_flag>1</factive_flag>
<fupdated_date>20200824152442</fupdated_date>
<fname>LOT1</fname>
</record>
</data>
</root>

ACTION: GET_UOM

Parameter

<data>
<filter>
<fuomid>PCS</fuomid>
<fthirdpartyid></fthirdpartyid>
<fkeyword></fkeyword>
</filter>
</data>

Available filters: fuomid, fthirdpartyid, fkeyword

Return Values:

<root>
<return_code>0</return_code>
<data>
<fnew_batchid>20190121101103</fnew_batchid>
<flast_batchid/>
<flast_key>2</flast_key>
<fdone>1</fdone>
<record id="PCS">
<fuomid>PCS</fuomid>
<fname>PCS</fname>
<fbase_uom>PCS</fbase_uom>
<fupdated_date>20160916170523</fupdated_date>
<def>
<fuom>PCS</fuom>
<fqty>1.000000</fqty>
</def>
</record>
</data>
</root>

ACTION: GET_WAREHOUSE

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 9
Parameter

<data>
<filter>
<fsiteid>01</fsiteid>
<fthirdpartyid>01</fthirdpartyid>
<fkeyword></fkeyword>
</filter>
</data>

Available filters: fsiteid, fthirdpartyid, fkeyword

Return Values:

<root>
<return_code>0</return_code>
<data>
<fnew_batchid>20190121095234</fnew_batchid>
<flast_batchid/>
<flast_key>1</flast_key>
<fdone>1</fdone>
<record id="01">
<fsiteid>01</fsiteid>
<fthirdpartyid>01</fthirdpartyid>
<fname>General Warehouse</fname>
<factive_flag>1</factive_flag>
<fmemo>Ported from SAP</fmemo>
<fupdated_date>20190111121103</fupdated_date>
</record>
</data>
</root>

III. SAVE MASTER DATA


This is pushing account records to WebPOS.
3rd Party System WebPOS

ACTION : SAVE_ACCOUNT
You use this to save or update accounts – one or multiple records at a time.

Parameters:

<id> section = see above, uniform for all


<data>
<record>
<faccountid>
<fthirdpartyid>
<fname>
...

Basic business rules that are applicable to all push method.

to delete record, set factive_flag = 0


if there are no changes, WebPOS will not update the records
if the attribute is not specified, that means the old record will be retained
you must explicitly specify the parameter if you wish to set it to blank (ie. <fmemo/>)
separate each record in <record>

fthirdpartyid

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 10
We allow third party to use their ID for product, account and warehouse.
WebPOS will still maintain its own code. If fthirdparty ID is in the same format with WebPOS (ALPHA NUMERIC + -), WebPOS will adopt it.
Either way, we need to supply at least one of the key (ie. faccountid or fthirdpartyid in case of account).

Actual Example: Pushing Account Master Data

$p = "
<root>
<id>
<fw3p_id>15082683</fw3p_id>
<fw3p_key>12345</fw3p_key>
</id>
<data>
<record>
<fthirdpartyid>ACCOUNT01</fthirdpartyid>
<fname>John Doe</fname>
<fmemo>This a memo.</fmemo>
</record>
</data>
</root>
";

$s = $client->call("SAVE_ACCOUNT",$p);

Return Values
These return codes are applicable to all

<return_code> 0 if everything goes well, otherwise error code


999 warning

error code
100 action not supported
101 ID is invalid
102 database error
103 parameter error (ie. Invalid parameter)
104 operation error
105 no records
106 concurrent user access, busy

<messages> list of error messages


<message>
<message>

Actual Example Return

<root>
<return_code>0</return_code>
<data>
<record id="AC004554" result="OK">
<fthirdpartyid>Account01</fthirdpartyid>
<fname>John Doe</fname>
<new_fmemo>This a memo.</new_fmemo>
<faccountid>AC004554</faccountid>
<fmemo>This a memo.</fmemo>
<femail>account01@test.com</femail>
<fresult>OK</fresult>
</record>
</data>
</root>

Basically tells you which account has been successfully updated or not.

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 11
Account Master Mapping

Column Description

faccountid up to 16 chars, alphanumeric

fthirdpartyid up to 64 chars

fname up to 64 chars

femail up to 64 chars

factive_flag 0: inactive, 1: active

fcustomer_flag 1: yes, 0: no

fsupplier_flag 1: yes, 0: no

fmemo up to 255 chars

if both customer and supplier flags are 0s, then this will automatically make the record inactive.

Additional Return Values After Save

fupdated_date YYYYMMDDHHMMSS

Formatting Errors

Actual Example:

<root>
<return_code>104</return_code>
<data>
<record id="..." result="ERROR">
...
<fresult>ERROR</fresult>
<errors>
<error>faccountid is not a valid code, must be alphanumeric, consisting of
max 40 chars</error>
</errors>
</record>
</data>
</root>

ACTION : SAVE_CREDIT
Credit Master Mapping

Column Description

fcreditid WebPOS ID, up to 16 chars (ALPHANUMERIC + - only)

fthirdpartyid up to 64 chars

fname up to 64 chars

fmemo up to 255 chars

Additional Return Values After Save

fupdated_date YYYYMMDDHHMMSS

ACTION : SAVE_OFFICE
Office Master Mapping

Column Description

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 12
fofficeid WebPOS ID, up to 16 chars (ALPHANUMERIC + - only)

fthirdpartyid up to 64 chars

fname up to 64 chars

factive_flag 0 or 1

fsiteid up to 16 chars, alphanumeric

fmemo up to 255 chars

faddress1 up to 64 chars

faddress2 up to 64 chars

faddress3 up to 64 chars

fphone up to 64 chars

Additional Return Values After Save

fupdated_date YYYYMMDDHHMMSS

ACTION : SAVE_PRODUCT
Product Master Mapping

Column Description

fproductid WebPOS ID, up to 64 chars (ALPHANUMERIC + - only)

*Mandatory if you want to map 3rd party product to existing HQ Product

*Without fproductid, 3rd party product will be saved as a new product

fthirdpartyid up to 64 chars, required if new

fname up to 64 chars

factive_flag 0 or 1

fmemo up to 255 chars

flist_price basic list price

ftax_type 0: inclusive tax, 1: exclusive, 2: non tax, 3: VAT exempt

fproduct_type 0:General Inventory, 1:Lot, S: Services, K: Kit, A: Article, V:Variation


for other items such as choices, etc, use S: Services

fbarcode1 alternate barcode, up to 64 chars

fbarcode2 alternate barcode, reserved for EAN 13

fbarcode3 alternate barcode, reserved for ISBN

fvariationid this is the final product id of type variation

fuomid base UOM

fpurchase_uom UOM Detail

fstnd_cost Standard Cost (Note: Local key auto_update_product_cost)

Additional Return Values After Save

fupdated_date YYYYMMDDHHMMSS

ACTION : SAVE_SERIAL
Product Serial Master Mapping

Column Description

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 13
flotno WebPOS ID, up to 32 chars (ALPHANUMERIC + - only)

fproductid Product ID, up to 64 chars

fime1 Manufacturing Code 1, up to 64 chars

fime2 Manufacturing Code 2, up to 64 chars

fmemo Memo

factive_flag 0 or 1

Additional Return Values After Save

fupdated_date YYYYMMDDHHMMSS

fupdated_by W3P ( W3P-ID)

fcreated_date YYYYMMDDHHMMSS

fcreated_date W3P (W3P-ID)

Actual Example: Lot Number with Details

<data>
<record>
<flotno>J4</flotno>
<fthirdpartyid>J4</fthirdpartyid>
<fproductid>LOT1</fproductid>
<fime1>J41</fime1>
<fime2>J42</fime2>
<fmemo/>
<factive_flag>1</factive_flag>
</record>
</data>

ACTION : SAVE_UOM
Unit of Measure Master Mapping

Column Description

fuomid WebPOS ID, up to 16 chars (ALPHANUMERIC + - only)

fname up to 64 chars

fbase_uom up to 16 chars

Additional Return Values After Save

fupdated_date YYYYMMDDHHMMSS

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 14
Actual Example: UOM with Details

<data>
<record>
<fuomid>XX3</fuomid>
<fname>test</fname>
<fbase_uom>XX3</fbase_uom>
<def>
<fqty>6</fqty>
<fuom>XX6</fuom>
</def>
<def>
<fqty>4</fqty>
<fuom>XX4</fuom>
</def>
</record>
</data>

ACTION : SAVE_WAREHOUSE
Warehouse Master Mapping

Column Description

fsiteid WebPOS ID, up to 16 chars (ALPHANUMERIC + - only)

fthirdpartyid up to 64 chars

fname up to 64 chars

factive_flag 0 or 1

fmemo up to 255 chars

Additional Return Values After Save

fupdated_date YYYYMMDDHHMMSS

IV. Inventory Movements


ACTION: SAVE_STOCK_ADJUSTMENT, SAVE_STOCK_COUNT, SAVE_STOCK_TRANSFER

Parameters

<data>
<record>
<freference_code/>
<fdoctype>0</fdoctype>
<ftrxdate>20190120</ftrxdate>
<fsiteid>MAIN</fsiteid>
<fthirdparty_siteid/>
<fmemo/>
<fcreated_date>20171231000012</fcreated_date>
<product>
<fproductid>000</fproductid>
<fthirdparty_productid/>
<fqty>-2</fqty>
<fuom>PCS</fuom>
<fuomqty>1.000000</fuomqty>
<fextprice>50.000000</fextprice>
</product>
</record>
</data>

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 15
fdoctype 0 = IN, 1 = OUT ,101 = TRANSFER

Header Mapping

Column Description

freference_code Must be unique as much as possible, up to 20 chars


This is one way to access the document

ftrxdate YYYYMMDD, if omitted, will use current date


must be from 3 months to current date

fsiteid WebPOS Site ID

fthirdparty_siteid thirdparty site id

fdst_siteid Applicable only for SAVE_STOCK_TRANSFER

fthirdparty_dst_siteid thirdparty site id

thirdparty site id fmemo up to 255 chars

fcreated_date YYYYMMDDHHMSS, very important, must specify this to avoid posting the same document

ftransmitid blank or the ID when it was tagged as processed in SET_TRANSMIT_LOG

fkey unique key identifying this record

Others

fstatus_flag POSTED, REVERSED, REVERSAL

Product Mapping

Column Description

fproductid Product ID under WebPOS

fthirdparty_productid Third party product ID

flotno Lot No

fqty Adjusted Qty


For stock adjustment and transfer only
For stock adjustment, can be positive or negative
For stock transfer, must be positive
This is return value only for stock count

fnew_qty Stock count only, stock quantity of third party system

fuom Unit of Measure, up to 16 chars

fuomqty Unit of Measure, up to 16 chars

fextprice Cost

Additional Return Values After Save

Header Section

fposted_date YYYYMMDDHHMMSS

fresult OK or ERROR

ftotal_cost Total cost

fdocument_no Generated series no

If error, additional sections

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 16
<fresult>ERROR</fresult>
<errors>
<error>Line 1 : fproductid is invalid, must be an active inventory product</error>
</errors>

Additional Items for Product Section

fseqno Sequence No

fold_qty for stock count only

we will use stock count to sync the stock status regularly


no record or product lines will be saved if there are no changes
we should schedule syncing depending on business requirements, typically 1-2 times a day

ACTION: GET_STOCK_ADJUSTMENT, GET_STOCK_COUNT, GET_STOCK_TRANSFER


Get the list of inventory transaction.

Parameters

<data>
<filter>
<fdocument_no></fdocument_no>
<freference_code></freference_code>
<fsiteid></fsiteid>
<fmemo></fmemo>
<fposted_by></fposted_by>
<ffrom>20190101</ffrom>
<fto></fto>
<ftrxtype>1</ftrxtype>
<fdoctype>1</fdoctype>
</filter>
</data>

Applicable Filters : fdocument_no, freference_code, fsiteid, fdst_siteid, fthirdparty_siteid, fthirparty_dst_siteid, fposted_by, ffrom, fto

ffrom, fto in this format YYYYMMDD,YYYYMMDD


fdoctype is based on the Adjustment Type ID
you can specify fposted_by = W3P, to get all third party source, or W3P(w3p_id) for specific source

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 17
Return Data

<root>
<return_code>0</return_code>
<data>
<fnew_batchid>201912</fnew_batchid>
<flast_batchid>20180103140000</flast_batchid>
<flast_key>11</flast_key>
<fdone>0</fdone>
<record>
<fdocument_no>3236</fdocument_no>
<freference_code>FWM01219</freference_code>
<ftrxdate>20190101</ftrxdate>
<fdoctype>1</fdoctype>
<fstatus_flag>POSTED</fstatus_flag>
<fsiteid>MEGAWORLD</fsiteid>
<fthirdparty_siteid>WH000007</fthirdparty_siteid>
<fsite_name>megaworld</fsite_name>
<fmemo>g.uli sa customer kay hupas</fmemo>
<ftotal_cost>-22.020000</ftotal_cost>
<fposted_by>BBFINVENTORYCLERK@GMAIL.COM</fposted_by>
<fposted_date>20190102133742</fposted_date>
<ftrxtype>1</ftrxtype>
<fofficeid>MEGAWORLD</fofficeid>
<fthirdparty_officeid>14</fthirdparty_officeid>
<foffice_name>Megaworld ilo-ilo city</foffice_name>
<fkey>W3P-INV-15082683-100-3236</fkey>
<ftransmitid></ftransmitid>
<product>
<fseqno>1</fseqno>
<fproductid>CHP00008</fproductid>
<fthirdparty_productid>CHP00008</fthirdparty_productid>
<flotno></flotno>
<fqty>1.000000</fqty>
<fuom>PCS</fuom>
<fuomqty>1.000000</fuomqty>
<fextprice>22.020000</fextprice>
<funitprice>22.020000</funitprice>
<fuomid>PCS</fuomid>
<fbase_uom>PCS</fbase_uom>
</product>
</record>
</data>
</root>

ACTION: VOID_STOCK_ADJUSTMENT, VOID_STOCK_COUNT, VOID_STOCK_TRANSFER


Allow posted transaction to be voided.

Parameters:

Parameters for Multiple Void

<data>
<record>
<fdocument_no>
<freference_code>
</record>
<record> ... </record>
</data>

for multiple void

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 18
Either fdocument_no or freference_code must be specified.

Error if more than one records found for freference_code

Return Values

<data>
<record>
<fdocument_no>33</fdocument_no>
<fresult>ERROR</fresult>
<errors>
<error>No POSTED transaction found with given condition</error>
</errors>
</record>
<record>
<freference_code>GRX125</freference_code>
<fresult>ERROR</fresult>
<errors>
<error>No POSTED transaction found with given condition</error>
</errors>
</record>
</data>

If there are errors, <fresult> and <errors> will be returned.

ACTION: GET_STOCK_STATUS
Get the stock status of WebPOS

Parameters

<data>
<filter>
<fproductid/>
<flotno/>
<fsiteid/>
<fthirdparty_productid/>
<fthirdparty_siteid />
</filter>
</data>

Available Filters: fproductid, flotno, fsiteid, fthirdparty_productid, fthirdparty_siteid

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 19
Return Values

<root>
<return_code>0</return_code>
<data>
<fnew_batchid>20190122095307</fnew_batchid>
<flast_batchid></flast_batchid>
<flast_key>10</flast_key>
<fdone>1</fdone>
<record>
<fproductid>0ESPRESSO</fproductid>
<fsiteid>WH01</fsiteid>
<flotno>
<fthirdparty_productid>0ESPRESSO</fthirdparty_productid>
<fthirdparty_siteid>WH01</fthirdparty_siteid>
<fqty>-121880.000000</fqty>
</flotno>
</record>
</data>
</root>

ACTION: SAVE_STOCK_STATUS

Parameters

<data>
<record>
<fthirdparty_productid>0ESPRESSO</fthirdparty_productid>
<fthirdparty_siteid>MAIN</fthirdparty_siteid>
<flotno></flotno>
<fqty>50</fqty>
<fstnd_cost>23.5</fstnd_cost>
</record>
<record>...</record>
</data>

Return Values

<root>
<return_code>0</return_code>
<data>
<record>Main Branch was successfully posted as reference #304</record>
</data>
</root>

STOCK STATUS SYNCING


WebPOS will only track the inventory that were updated.
All items will be returned.

The strategy for syncing is to do this in interval. Typically once or twice a day.

Example
8:00am Start syncing

Subsequent sync
Check if flast_key = 0

Meaning, we have already finished our previous syncing

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 20
Check if flast_batchid is beyond our interval

if ((flast_batchid + interval) < current timestamp)


start a new syncing sequence
otherwise, ignore, we just synced this

*interval maybe 24h, 12h, 8h, etc.

Otherwise,
We're not done with previous syncing

Continue syncing
if fdone = 1
Save fnew_batchid to flast_batchid, flast_key = 0

We can alternatively save current time stamp to flast_batchid so the next interval will start at the end of current syncing process.

V. Sales
ACTION: GET_SALES
Get the summarized sales for each reading

Parameters

<data>
<filter>
<ftermid>0002</ftermid>
<ffrom>20190106</ffrom>
<fto>20190106</fto>
<fzcounter>504</fzcounter>
<fper_customer_flag>0</fper_customer_flag>
</filter>
</data>

Applicable filters : ftermid, ffrom, fto, fdocument_no, fzcounter, fper_customer_flag

if fper_customer_flag
= 0, we will group the entire sales together, each product will be segregated by warehouse
= 1, we will group the sales by customer, each product will be segregated by warehouse

Return Format

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 21
<root>
<return_code>0</return_code>
<data>
<fnew_batchid>20190121113643</fnew_batchid>
<flast_batchid></flast_batchid>
<flast_key>2</flast_key>
<fdone>0</fdone>
<record>
<fsale_date>20190106</fsale_date>
<fzcounter>504</fzcounter>
<ftermid>0002</ftermid>
<ffrom_document_no>20667</ffrom_document_no>
<fto_document_no>20701</fto_document_no>
<fupdated_date>20190106200008</fupdated_date>
<sales>
<fsale_date>20190106</fsale_date>
<fthirdparty_branchid>13</fthirdparty_branchid>
<ftotal_discount>75.000000</ftotal_discount>
<fline_discount>0.000000</fline_discount>
<fscdiscount>713.100000</fscdiscount>
<fpwd_discount>0.000000</fpwd_discount>
<fdip_discount>0.000000</fdip_discount>
<fgross>63368.940000</fgross>
<flocal_tax>0.000000</flocal_tax>
<famusement_tax>0.000000</famusement_tax>
<frefund>0.000000</frefund>
<fservice_charge>5744.900000</fservice_charge>
<ftax>5868.410000</ftax>
<ftax_sale>54771.660000</ftax_sale>
<fnotax_sale>0.000000</fnotax_sale>
<fzero_rated_sale>0.000000</fzero_rated_sale>
<fcash>45544.220000</fcash>
<fcharge>0.000000</fcharge>
<fcredit>17824.720000</fcredit>
<fcheck>0.000000</fcheck>
<fothers>0.000000</fothers>
<fevat>427.860000</fevat>
<fvat_exempt>8597.280952</fvat_exempt>
<fewt>0.000000</fewt>
<fcustomer_count>85</fcustomer_count>
<fkey>W3P-SALES-15082683-0002-504</fkey>
<ftransmitid>
<product>
<fproductid>12</fproductid>
<fthirdparty_productid>12</fthirdparty_productid>
<fsiteid>MAIN</fsiteid>
<fthirdparty_siteid>MAIN</fthirdparty_siteid>
<flotno></flotno>
<fqty>1.000000</fqty>
<ftotal_line>132.00</ftotal_line>
<ftax>12.86</ftax>
<fbase_uom>ORDER</fbase_uom>
<fpriceid/>
<fuomid>ORDER</fuomid>
<fentry_type>0</fentry_type>
</product>
<product>...</product>
<payment>
<ftype>CASH</ftype>
<famount>45544.220000</famount>
<finfo1></finfo1>
</payment>
<payment>...</payment>
</sales>
</record>
</data>
</root>

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 22
Notes

Available only after the reading.

Sales Header Mapping

Column Description

fsale_date YYYYMMDD

fzcounter EOD counter

ftermid 0001, 0002

fofficeid Branch ID

ffrom_document_no Starting receipt

fto_document_no Ending receipt

ftotal_discount Regular discount (header and line)

fline_discount Regular line discount

fscdiscount Total SC Discount

fpwd_discount PWD discount

fdip_discount Diplomat Discount

fgross Total Gross

flocal_tax Local Tax

famusement_tax Amusement Tax

frefund Total Refund

fservice_charge Service Charge

ftax Total Tax

ftax_sale Tax Sale

fnotax_sale Non Tax Sale

fzero_rated_sale Zero Rated Sale

fcash Total Cash

fcharge Charge payment

fcheck Check Payment

fcredit Credit Card Payment

fothers Other types (including coupon, debit card, etc)

fcustomer_count Customer count

fevat EVAT

fvat_exempt Total VAT exempted sales

fewt EWT

fupdated_date YYYYMMDDHHMMSS

if fper_customer_flag is 1, additional columns

faccountid Customer ID

faccount_name Customer Name

fthirdparty_accountid Third party account id

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 23
ftransmitid blank or the ID when it was tagged as processed in

SET_TRANSMIT_LOG

fkeyunique key identifying this record

Custom Fields

fswirlid for CBTL only, Sales Swirl ID

ftotal_swirl for CBTL only, Total Swirl Amount

Sales Product Mapping

Column Description

fproductid Product ID

fthirdparty_productid Third party ID of the product

fsiteid Warehouse ID

fthirdparty_siteid Third party ID of warehouse

flotno Lot No

ftotal_discount Includes regular, pwd, senior, etc

ftotal_line Line Total

fpriceid Price ID

ftax Total Tax

ftax_type 0: include, 1:exclusive, 2: non tax, 3: zero rated

fentry_type 0: regular/others, 1: choice type product, 4: kit components, 9: choices of the choice type product

Sales Payment Mapping

Column Description

ftype CASH, CREDIT, CHECK, CHARGE, COUPON, EXCESS, OTHERS (all other payment types)

famount Total amount

ACTION: GET_SALES_TRANSACTION

Parameters

<data>
<filter>
<ftermid>0002</ftermid>
<ffrom>20190106</ffrom>
<fto>20190106</fto>
<fzcounter>504</fzcounter>
<faccountid></faccountid>
<fthirdparty_accountid></fthirdparty_accountid>
<fdocument_no></fdocument_no>
<fexclude_return>0<
/fexclude_return>
<fexclude_void>1</fexclude_void>
</filter>
</data>

Applicable filter : ftermid, ffrom, fto, fdocument_no, fzcounter, faccountid, fhirdparty_accountid, fexclude_return, fexclude_void

If fexclude_void is set to "1", voided transactions will not be included in the list.
If fexclude_return is set to "1", returned transactions will not be included in the list.

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 24
Return Format

<root>
<return_code>0</return_code>
<data>
<fnew_batchid>20190121114617</fnew_batchid>
<flast_batchid/>
<flast_key>35</flast_key>
<fdone>1</fdone>
<record>
<fsale_date>20190106</fsale_date>
<fsale_time>1100</fsale_time>
<fzcounter>504</fzcounter>
<ftermid>0002</ftermid>
<fdocument_no>20667</fdocument_no>
<faccountid/>
<faccount_name/>
<fthirdparty_accountid/>
<ftotal_discount>0.000000</ftotal_discount>
<fline_discount>0.000000</fline_discount>
<fscdiscount>0.000000</fscdiscount>
<fpwd_discount>0.000000</fpwd_discount>
<fdip_discount>0.000000</fdip_discount>
<fgross>1056.000000</fgross>
<flocal_tax>0.000000</flocal_tax>
<famusement_tax>0.000000</famusement_tax>
<frefund>0.000000</frefund>
<fservice_charge>96.000000</fservice_charge>
<fsubtotal>960.000000</fsubtotal>
<ftax>102.860000</ftax>
<ftax_sale>960.000000</ftax_sale>
<fnotax_sale>0.000000</fnotax_sale>
<fzero_rated_sale>0.000000</fzero_rated_sale>
<fcash>1056.000000</fcash>
<fcharge>0.000000</fcharge>
<fcredit>0.000000</fcredit>
<fcheck>0.000000</fcheck>
<fothers>0.000000</fothers>
<fevat>0.000000</fevat>
<fvat_exempt>96.000000</fvat_exempt>
<fewt>0.000000</fewt>
<fcustomer_count>1</fcustomer_count>
<fposted_date>20190106113056</fposted_date>
<fupdated_date>20190106200008</fupdated_date>
<fcashierid>CATHERINE</fcashierid>
<product>
<fseqno>1</fseqno>
<fproductid>FRESH2</fproductid>
<fthirdparty_productid>FRESH2</fthirdparty_productid>
<fsiteid>MAIN</fsiteid>
<fthirdparty_siteid>MAIN</fthirdparty_siteid>
<flotno/>
<fqty>1.000000</fqty>
<fuomqty>1.000000</fuomqty>
<ftax>10.714286</ftax>
<fextprice>100.00</fextprice>
<ftotal_discount>0.00</ftotal_discount>
<ftotal_line>100.00</ftotal_line>
<ftax_type>0</ftax_type>
<ftype>0</ftype>
<fdeposit_flag>0</fdeposit_flag>
</product>
<product>...
</product>
<payment>
<fseqno>1</fseqno>
<ftype>CASH</ftype>
<fmemo/>
<famount>1056.000000</famount>
<finfo1/>

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 25
<finfo2/>
<finfo3/>
<ftrxdate/>
</payment>
</record>
</data>
</root>

fdeposit_flag possible values

0 = "Active Deposit"
3 = "Claimed Deposit"
B = "Claim Transaction"
4 = "Claim Transaction (with Deposit)"
2 = "Claim Transaction (without Deposit)"

If empty or not added, will return all rows regardless of the deposit flag.

Notes

Available only after the reading.

Sales Header Mapping


Column Description

fsale_date YYYYMMDD

fsale_time HHMM

fzcounter EOD counter

ftermid 0001, 0002

fdocument_no Receipt No

faccountid Customer ID

faccount_name Customer Name

fthirdparty_accountid Third party account id

ftotal_discount Regular discount (header and line)

fline_discount Regular line discount

fscdiscount Total SC Discount

fpwd_discount PWD discount

fdip_discount Diplomat Discount

fgross Total Gross

flocal_tax Local Tax

famusement_tax Amusement Tax

frefund Total Refund

fservice_charge Service Charge

fsubtotal Subtotal

ftax Total Tax

ftax_sale Tax Sale

fnotax_sale Non Tax Sale

fzero_rated_sale Zero Rated Sale

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 26
fcash Total Cash

fcharge Charge payment

fcheck Check Payment

fcredit Credit Card Payment

fothers Other types (including coupon, debit card, etc)

fcustomer_count Customer count

fevat EVAT

fvat_exempt Total VAT exempted sales

fewt EWT

fvar Sales By Product Computation


SUM(salesproduct.ftotal_line * (1 + sales.fvar / 100)) as ftotal

fposted_date YYYYMMDDHHMMSS

fcreated_date YYYYMMDDHHMMSS, date when sales was created

fupdated_date YYYYMMDDHHMMSS, date when sales was updated

Custom Fields

fswirlid for CBTL only, Sales Swirl ID

ftotal_swirl for CBTL only, Total Swirl Amount

Sales Product Mapping

Column Description

fseqno Sequence No

fsiteid Warehouse ID

fthirdparty_siteid Third party ID of warehouse

fproductid Product ID

fthirdparty_productid Third party ID of the product

flotno Lot No

fqty Qty

fuomqty Multiplier to base quantity

fextprice Line price

ftotal_discount Includes regular, pwd, senior, etc

ftotal_line Line Total

ftax Total Tax

ftax_type 0: include, 1:exclusive, 2: non tax, 3: zero rated

ftype 0: regular,1: choice, 2: choices, 4: kit components, 5: others

kit components and choices will have no price, just qty

Sales Payment Mapping

Column Description

fseqno Sequence No

ftype CASH, CREDIT, CHECK, CHARGE, OTHERS

fmemo Memo if any

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 27
famount Total amount

finfo1 Supplementary information like Bank, Credit Card ID

finfo2

finfo3

VI. PURCHASING

ACTION: GET_RR

Parameters

<data>
<filter>
<fdocument_no>3</fdocument_no>
<fstatus_flag>6</fstatus_flag>
<frrfrom>20180808</frrfrom>
<frrto>20190808</frrto>
<fsource_flag>0</fsource_flag>
<freference_code></freference_code>
<fofficeid>MAIN</fofficeid>
<fsiteid>MAIN</fsiteid>
<fsupplierid>0</fsupplierid>
<fref_siteid></fref_siteid>
<fthirdpartyid>3</fthirdpartyid>
</filter>
</data>

Applicable filters : fdocument_no, fstatus_flag, frrfrom & frrto, fsource_flag, freference_code, fofficeid, fsiteid, fsupplierid, fref_siteid, fthirdpartyid

Return Value

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 28
Return Format

<root>
<return_code>0</return_code>
<data>
<fnew_batchid>20201027104004</fnew_batchid>
<flast_batchid/>
<flast_key>1</flast_key>
<fdone>1</fdone>
<record>
<frrid>3</frrid>
<fofficeid>MAIN</fofficeid>
<fthirdpartyid>3</fthirdpartyid>
<ftrxdate>20180808</ftrxdate>
<freference_code/>
<fdocument_no>3</fdocument_no>
<fsiteid>MAIN</fsiteid>
<fref_siteid>SHOST-18011886,RAWR</fref_siteid>
<fsource_flag>0</fsource_flag>
<fsupplierid>0</fsupplierid>
<fsupplier_name>Cashier</fsupplier_name>
<fmemo/>
<fstatus_flag>6</fstatus_flag>
<product>
<fproductid>COKE</fproductid>
<fproduct_name>Coke</fproduct_name>
<fordered_qty>1.000000</fordered_qty>
<fqty>1.000000</fqty>
<fuomid>BOX</fuomid>
<fextprice>10.000000</fextprice>
<funitprice>10.000000</funitprice>
<ftotal_cost>10.000000000000</ftotal_cost>
<fdr_no>0</fdr_no>
<flotno/>
<fexpiry/>
</product>
</record>
</data>
</root>

Receiving Report Header Mapping

Column Description

frrid Receiving Report ID

fofficeid Transacting Branch

fthirdpartyid Third party ID

ftrxdate Transaction Date

freference_code Reference Code

fdocument_no Document No.

fsiteid Warehouse

fref_siteid Source Warehouse

fsource_flag Received From Warehouse

(Supplier = 0; Warehouse = 1)

fsupplierid Supplier ID

fsupplier_name Supplier Name

fmemo Memo

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 29
fstatus_flag Document Status

(Pending= 0; Voided = 7; Cancelled= 1; Post= 6)

Receiving Report Product Mapping

Column Description

fproductid Product ID

fproduct_name Product Name

fordered_qty Ordered Quantity

fqty Product Quantity

fuomid Unit of Measure ID

fextprice Cost/Price

funitprice Unit/List Price

ftotal_cost Total Cost

fdr_no Delivery No.

flotno Lot No.

fexpiry Product Expiry

ACTION: GET_DELIVERY

Parameters

<data>
<filter>
<fdocument_no></fdocument_no>
<fdrfrom></fdrfrom>
<fdrto></fdrto>
<freference_code></freference_code>
<fofficeid></fofficeid>
<fsiteid></fsiteid>
<fdst_siteid></fdst_siteid>
<fauto_receipt_flag></fauto_receipt_flag>
<fstatus_flag></fstatus_flag>
<ffulfillment_flag></ffulfillment_flag>
<fthirdpartyid></fthirdpartyid>
</filter>
</data>

Applicable filters : fdocument_no, fstatus_flag, frrfrom & frrto, fsource_flag, freference_code, fofficeid, fsiteid, fsupplierid, fref_siteid, fthirdpartyid

Return Value

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 30
Return Format

<root>
<return_code>0</return_code>
<data>
<fnew_batchid>20201027132839</fnew_batchid>
<flast_batchid/>
<flast_key>1</flast_key>
<fdone>1</fdone>
<record>
<fdeliveryid>24</fdeliveryid>
<fofficeid>BR000003</fofficeid>
<ftrxdate>20201026</ftrxdate>
<freference_code>RERER</freference_code>
<fdocument_no>20</fdocument_no>
<fsiteid>MAIN</fsiteid>
<fdst_siteid>WH01</fdst_siteid>
<fauto_receipt_flag>0</fauto_receipt_flag>
<fstatus_flag>6</fstatus_flag>
<ffulfillment_flag>0</ffulfillment_flag>
<fmemo>RERER</fmemo>
<product>
<fproductid>LT</fproductid>
<fproduct_name>LT</fproduct_name>
<fonreplenish_qty>0.000000</fonreplenish_qty>
<fqty>1.000000</fqty>
<fuom>PCS</fuom>
<fextprice>100.000000</fextprice>
<funitprice>100.000000</funitprice>
<ftotal_cost>100.000000000000</ftotal_cost>
<flotno>A</flotno>
<fserved_qty>1.000000</fserved_qty>
</product>
<product>
<fproductid>LT</fproductid>
<fproduct_name>LT</fproduct_name>
<fonreplenish_qty>0.000000</fonreplenish_qty>
<fqty>1.000000</fqty>
<fuom>PCS</fuom>
<fextprice>100.000000</fextprice>
<funitprice>100.000000</funitprice>
<ftotal_cost>100.000000000000</ftotal_cost>
<flotno>B</flotno>
<fserved_qty>0.000000</fserved_qty>
</product>
</record>
</data>
</root>

Delivery Report Header Mapping

Column Description

fdeliveryid Transacting Branch

fofficeid Third party ID

ftrxdate Transaction Date

freference_code Reference Code

fdocument_no Document No.

fsiteid Warehouse

fdst_siteid Source Warehouse

fauto_receipt_flag Received From Warehouse

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 31
fstatus_flag Supplier ID

ffulfillment_flag Supplier Name

fmemo Memo

Delivery Report Product Mapping

Column Description

fproductid Product ID

fproduct_name Product Name

fonreplenish_qty Request/Replenish Quantity

fqty Product Quantity

fuom Unit of Measure

fextprice Cost/Price

funitprice Unit/List Price

ftotal_cost Total Cost

fdr_no Delivery No.

flotno Lot No.

fserved_qty Received Quantity

ACTION: UPDATE_RR
Allow posted transaction to be voided and pending transactions to be cancelled.

Parameters for Multiple Void

Parameters

<data>
<record>
<fdocument_no>
<freference_code>
<fstatus_flag>

</record>
<record> ... </record>
</data>

For multiple Void/Cancel,

Either fdocument_no or freference_code must be specified.

Either set 6 in fstatus_flag to Cancel a pending status or 7 to Void a posted status

Error if more than one records found for freference_code or incorrect

Error if fstatus_flag or null, not equals to 6 if pending or 7 if posted

Error if either fdocument_no, freference_code or status_flag is null or incorrect

Return Value

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 32
Return Format

<data>
<record>
<fdocument_no/>
<freference_code>77786</freference_code>
<fstatus_flag>7</fstatus_flag>
<fresult>ERROR</fresult>
<errors>
<error>fdocument_no is Required</error>
<error>No POSTED/CANCELLED transaction found with given condition</error>
</errors>
</record>
<record>
<fdocument_no>23</fdocument_no>
<freference_code>8871</freference_code>
<fstatus_flag>7</fstatus_flag>
<fresult>ERROR</fresult>
<errors>
<error>No POSTED/CANCELLED transaction found with given condition</error>
</errors>
</record>
</data>

If there are errors, <fresult> and <errors> will be returned.

VII. OTHERS

WARNING

We're longer supporting the webhook implementation, instead you can use a much improved SOAP implementation above.

ACTION: REGISTER_WEBHOOK
If the third party wishes to be notified if there are changes in the system, they can register their webhook.

One webhook per user. Multiple webhooks allowed for one company or account.

Parameter

<data>
<fproduct_url>http://127.0.0.1:8888/appserv/app/w3p/sample_webhook/webhook_product.php</fproduct_url>
<fwarehouse_url>http://127.0.0.1:8888/appserv/app/w3p/sample_webhook/webhook_warehouse.php<
/fwarehouse_url>
<faccount_url>http://127.0.0.1:8888/appserv/app/w3p/sample_webhook/webhook_account.php</faccount_url>
<fsales_url>http://127.0.0.1:8888/appserv/app/w3p/sample_webhook/webhook_sales.php</fsales_url>
<finventory_url>http://127.0.0.1:8888/appserv/app/w3p/sample_webhook/webhook_inventory.php<
/finventory_url>
<fsync_url>http://127.0.0.1:8888/appserv/app/w3p/sample_webhook/webhook_sync.php</fsync_url>
</data>

url = must be valid URL

Sales URL = if terminal performs EOD, and uploads the data to server, system will trigger this.
User can either download the sales transaction or sales summary.

Inventory URL = this has very high traffic. Every time there are changes in the inventory (sales or adjustment), it will trigger this. Use this with caution.

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 33
Return Values

<root>
<return_code>0</return_code>
<data>
<record>
<fkey>fproduct_url</fkey>
<fvalue>http://127.0.0.1:8888/appserv/app/w3p/sample_webhook/webhook_product.php<
/fvalue>
<fresult>OK</fresult>
</record>
<record> ... </record>
</data>
</root>

ACTION: SAVE_LOCAL_KEY
Allows third party to store small custom data in WebPOS. Usually data relevant to syncing (ie. flast_batchid, flast_key).

Parameters

<data>
<record>
<fkey>PRODUCT-FLAST_BATCHID</fkey>
<fvalue>VALUE 1</fvalue>
</record>
<record> ... </record>
</data>

Column Description

fkey can be up to 80 characters

fvalue up to 255 characters

Return Values

<root>
<return_code>0</return_code>
<data>
<record>
<fkey>PRODUCT-FLAST_BATCHID</fkey>
<fvalue>VALUE 1</fvalue>
<fresult>OK</fresult>
</record>
</data>
</root>

ACTION : GET_LOCAL_KEY
Allows user to retrieve the custom data.

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 34
Parameters

<data>
<filter>
<fkey>PRODUCT%</fkey>
</filter>
</data>

This retrieves all the information related to the search.


You can use wildcard search denoted by %.

Return Values

<root>
<return_code>0</return_code>
<data>
<record id="mst_product_tpi_auto_assign">
<fkey>mst_product_tpi_auto_assign</fkey>
<fvalue>1</fvalue>
</record>
<record id="mst_product_tpi_max_len">
<fkey>mst_product_tpi_max_len</fkey>
<fvalue>50</fvalue>
</record>
<record id="mst_product_tpi_prefix">
<fkey>mst_product_tpi_prefix</fkey>
<fvalue>PR</fvalue>
</record>
</data>
</root>

ACTION: POST_LOG
Logs all requests being processed.

Parameters

<data>
<fstatus_flag>ERROR</fstatus_flag>
<frecordid>INVENTORY</frecordid>
<finput_param>The input data you used, must be properly formatted</finput_param>
<foutput_param>The output data you got, must be properly formatted</foutput_param>
</data>

Column Description

fstatus_flag OK, ERROR

frecordid PRODUCT,SALES,INVENTORY,ACCOUNT,WAREHOUSE,WEBHOOK,W3P

<root>
<return_code>0</return_code>
</root>

ACTION: BYPASS_RECORD
Log all exceptions and errors on W3P using bypass record.
For cases when there is a need to block synchronization because of urgent errors.
In order to proceed, users then have to bypass the exceptions.

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 35
Parameters

<data>
<frecordid>PRODUCT</frecordid>
<fid>PRODUCT-02</fid>
<finput_param>Product 02, contains illegal characters.</finput_param>
<ferror_msg>Error Outputing Product 01</ferror_msg>
<faction>PRODUCT.PushToSAP</faction>
<fsource>1</fsource>
</data>

Column Description

frecordid PRODUCT,SALES,INVENTORY,ACCOUNT,WAREHOUSE,WEBHOOK,W3P

fid up to 100 characters

finput_param blob

ferror_msg up to 256 characters

faction up to 64 characters

fsource Default is 1.

Return Values

<root>
<return_code>0</return_code>
<data>
<fbypass_flag>0</fbypass_flag>
</data>
</root>

fbypass_flag is initially set to 0. Once bypassed, the record will be deleted from the exception list.

ACTION: CONCLUDE_RECORD
Exceptions can be bypassed through this.

Parameters

<data>
<frecordid>PRODUCT</frecordid>
<fid>PRODUCT-02</fid>
</data>

This operation will permanently delete the exception from the exception lists.

Mutual Exclusion Control


Each user can only request one at a time. While processing, the same user cannot issue another request. Flood control error will be returned.

Maximum Characters
To specify the maximum characters of master records for product, account and warehouse, use SAVE_LOCAL_KEY.

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 36
Example:

$p = "
<root>
<id>
<fw3p_id>17021082</fw3p_id>
<fw3p_key>12345678</fw3p_key>
</id>
<data>
<record>
<fkey>MST_ACCOUNT_MAX_LEN</fkey>
<fvalue>14</fvalue>
</record>
<record>
<fkey>MST_PRODUCT_MAX_LEN</fkey>
<fvalue>14</fvalue>
</record>
<record>
<fkey>MST_WAREHOUSE_MAX_LEN</fkey>
<fvalue>14</fvalue>
</record>
</data>
</root>";

$s = $client->call("SAVE_LOCAL_KEY",$p);

VIII. Activation
Activation is done per company.

Currently, this is done manually by inserting an entry on w3p_sm_user table.

Column Description

fcompanyid Company ID (Ex: SHOST-18092342)

fw3p_id W3P ID, usually use the number component of company ID. (Ex: 18092342)

fw3p_key Key or password. Used together with the w3p ID for authentication.

fname Company Name

factive_flag Active Flag, 1 (Active), 0 (Inactive)

For 3rd Party Integration purposes (ex. SAP Integration)

fpassword Access to w3p tool. Default pass is "54321"

femail Optional

W3P Activation

INSERT INTO w3p_sm_user (fcompanyid, fw3p_id, fw3p_key, fname, factive_flag, fpassword)


VALUES ("SHOST-18092342","18092342","12345","Company Name","1","!x=G8NTQzMjE=@");

[END OF DOCUMENT]

Copyright © 2009-2019 Alliance Software Inc. and Alliance WebPOS. All Rights Reserved. Page 37

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy