> For the complete documentation index, see [llms.txt](https://razortheory.gitbook.io/financial-assurance-module-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://razortheory.gitbook.io/financial-assurance-module-documentation/technical-documentation/interactions-with-vision.md).

# Interaction with VISION

One of the important aspects is the proper application data synchronization with the external services.

For this purposes in case of Financial Assurance module were added fetching Purchase Orders from VISION.&#x20;

VISION is external database maintained by UNICEF and used by different services. When Purchase Order Number is prompted, while creating new Engagement, backend is trying to find it inside the database. If no such record exists, the VISION will be used additionally and in case of success entity will be synchronized into the database.&#x20;

![](/files/-LLTnlZETQrmKxCenZmS)

VISION url to perform the purchase orders synchronization\
`https://devapis.unicef.org/BIService/BIWebService.svc/GetPurchaseOrderInfo_JSON/<vendor_number>`

Example response:

```javascript
[
  {
    'PURCHASING_ORG_CODE': '1234',
    'PURCHASING_GROUP_CODE': '123',
    'PURCHASING_GROUP_NAME': 'Belem, Brazil',
    'PLANT_CODE': '12345',
    'VENDOR_CODE': '123456789',
    'VENDOR_NAME': 'SAMPLE VENDOR EXAMPLE, LLC',
    'VENDOR_CTRY_NAME': 'Brazil',
    'GRANT_REF': 'AA000000000',
    'EXPIRY_DATE': '\\/Date(7654321000000)\\/',
    'DONOR_NAME': 'Example-Brazil',
    'PREQ_NO': '000000000',
    'PREQ_ITEM': 30,
    'PREQ_QTY': 1,
    'SO_NUMBER': '000',
    'PO_NUMBER': '1234567890',
    'PO_ITEM': 30,
    'PO_TYPE': 'ZLCO',
    'PO_DATE': '\\/Date(0123456700000)\\/',
    'PO_ITEM_QTY': 1,
    'CURRENCY_CODE': 'BRL',
    'AMOUNT_CURR': 21,
    'AMOUNT_USD': 42,
    'MATERIAL_CODE': 'Unknown',
    'MATERIAL_DESC': 'Unknown',
    'CREATE_DATE': '\\/Date(1351742400000)\\/',
    'UPDATE_DATE': '\\/Date(1404964800000)\\/'
  }
]
```

Fields mapping:

```
'purchase_order': {
    "order_number": "PO_NUMBER",
    "contract_start_date": "PO_DATE",
    "auditor_firm": "VENDOR_CODE",
},
'order_item': {
    "number": "PO_ITEM",
    "purchase_order": "PO_NUMBER",
},
'auditor_firm': {
    "vendor_number": "VENDOR_CODE",
    "name": "VENDOR_NAME",
    "country": "VENDOR_CTRY_NAME",
},
'grant': {
    "name": "GRANT_REF",
    "expiry": "EXPIRY_DATE",
    "donor": "DONOR_NAME"
},
'donor': {
    "name": "DONOR_NAME",
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://razortheory.gitbook.io/financial-assurance-module-documentation/technical-documentation/interactions-with-vision.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
