# 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;

![](https://3140720386-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LJxF2RKg63Q700gpAQ8%2F-LLTmI-ER1lK0UYmCNde%2F-LLTnlZETQrmKxCenZmS%2Fimage.png?alt=media\&token=801165ce-0d43-4300-aa65-13490b45c5cb)

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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
