The Validate Account Code integration allows Unimarket to request real-time verification of accounting information (such as FOPAL or ledger data), from an external ERP or Finance system during the checkout process. This ensures that the buyer is authorized to use specific accounts, the account combinations are correct, and there is sufficient budget available.
How it Works
This is a synchronous integration point, meaning the external system must respond while the user is actively waiting in the checkout process. A rapid response time is essential to prevent system timeouts and ensure a smooth user experience.
Request Data
For every line item on a requisition, Unimarket sends the following key data to the ERP for validation:
Line Details: Line number, quantity, and product code (SKU).
Pricing: Unit price and the total amount (excluding tax).
Accounting: The specific account code (individual parts) and any account code splits if applicable.
Response and Results
The external system evaluates the data and responds with one of three statuses for each line item:
| Result | Outcome |
|---|---|
| Valid | The line passes validation. If all lines are valid, the requisition proceeds to checkout normally. |
| Invalid | The requisition is stopped. The buyer cannot proceed until the accounting information is corrected. |
| Warning | The requisition remains on the checkout page and displays a message to the user. The user can choose to click checkout again to bypass the warning and continue. |
Key Response Requirements
The response from the ERP back to Unimarket must include:
Line Number: To identify which item the result applies to.
Result Status: Valid, Invalid, or Warning.
Account Code: The accounting string being validated.
Message: A description (maximum 255 characters) that the buyer will see, such as "Available funds confirmed" or a specific error message.
Technical Documentation
Detailed XML message examples and technical specifications for this integration, can be found on help article Integration Technical Documentation Examples.
Sample 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>
Sample 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>