Overview
The validate-account-code-request/response message is used by Unimarket to request an external system to validate the Account Code (FOPAL, ledger) information the buyer has entered on their requisition. The Account Code information is passed to the external system so that checks can be made around things such as the user's ability to purchase on that account, the account combination being used and if there is available budget. The external system responds back to Unimarket with a Yes, No, or Warning. This can then be used to stop the buyer from purchasing (if No) and/or display a warning or other related information such as the available budget (any message the external system provides).
This is a synchronous integration point that must respond while the user is waiting in the checkout process so a quick response time is key to avoid timeout.
Request
<user-ref identity="user" domain="UNIMARKET_USERNAME_DOMAIN"/>
<validate-account-code-request>
<validate-account-code-line line-number="1" quantity="1" sku="productcode">
<unit-price iso-currency-code="NZD">10.00</unit-price>
<total iso-currency-code="NZD">10.00</total>
<account-code distribution-percentage="60.0" format-ref="format" value="a-b">
<part description="a description" part="a format">a</part>
<part description="b description" part="b format">b</part>
</account-code>
<account-code distribution-percentage="40.0" format-ref="format" value="c-d">
<part description="c description" part="c format">c</part>
<part description="d description" part="d format">d</part>
</account-code>
<organisation-unit-ref code="orgunit" organisation-code="org" parent-code="org"/>
</validate-account-code-line>
</validate-account-code-request>
Key Request Data
For each line on the requisition the following key data is passed to the ERP for validation:
- Line Number
- Quantity
- Product Code
- Currency
- Unit Price
- Total (excluding)
- Account code (individual parts)
- Account Code splits (if applicable)
Response
<?xml version="1.0" encoding="UTF-8"?>
<u1.1:validate-account-code-response xmlns:u1.1="http://www.unimarket.com/schema/unimarket-ws-1.1">
<u1.1:response code="OK"/>
<u1.1:account-code-validation line-number="1" result="VALID">
<u1.1:account-code value="partA1-partA2-partA3-partA4" format-ref="formatcodea"/>
<u1.1:message>
partA1-partA2-partA3-partA4 is valid
</u1.1:message>
</u1.1:account-code-validation>
<u1.1:account-code-validation line-number="1" result="VALID">
<u1.1:account-code value="partB1-partB2-partB3-partB4" format-ref="formatcodea"/>
<u1.1:message>
partB1-partB2-partB3-partB4 is valid
</u1.1:message>
</u1.1:account-code-validation>
<u1.1:account-code-validation line-number="2" result="INVALID">
<u1.1:account-code value="partB1-partB2-partB3-partB4" format-ref="formatcodea"/>
<u1.1:message>
partB1-partB2-partB3-partB4 is invalid
</u1.1:message>
</u1.1:account-code-validation>
<u1.1:account-code-validation line-number="3" result="INVALID">
<u1.1:account-code value="partC1-partC2-partC3-partC4" format-ref="formatcodea"/>
<u1.1:message>
partC1-partC2-partC3-partC4 is invalid
</u1.1:message>
</u1.1:account-code-validation>
</u1.1:validate-account-code-response>
Key Response Data
For each line on the requisition the following data is will be required in the response from the ERP back to Unimarket:
- Line Number
- Result: Valid, Invalid, Warning
- Account code: The accounting string
- Message (Char limit of 255): ‘There are available Funds’ (whatever buyers should see - can include the $$ amount if provided).
Message Results
Note that there can be Valid, Invalid and Warning lines in the same response.
- Valid: Line will pass. If all lines have this then the requisition will checkout as per normal without a budget message displaying.
- Invalid: If any of the lines are Invalid the requisition will be stopped. This can be coupled with a message.
- Warning: If any of the lines are Warning the requisition will be remain on the checkout page and display any provided messages to the user. If the user clicks checkout again they will be able to continue.
Technical Documentation
Technical details relating to the integration can be found below: