# Upload Purchase Orders

You have the option of uploading Purchase Orders into the system using a csv file. This can be handy when getting hundreds of orders into Xoro at once. If you are performing a similar upload often and you find yourself doing a lot of data manipulation in Excel then you might want to request a utility to be built.

### Uploading Purchase Orders

You can upload the purchase orders using the steps mentioned below:

* Download the latest CSV Template from the “Upload Purchase Orders” module.
* Copy Purchase Orders information into the CSV Template.
* Upload the CSV Template into Xoro.

### Downloading the CSV template

* Go to "**Upload Purchase** **Orders"** module using the search menu.
* Click on “**Download Template.**

  <figure><img src="/files/yu6wwx7fov6VvBDXN8pT" alt=""><figcaption></figcaption></figure>

### **Copying the information into the template**

Once you’ve downloaded the template file, you can copy your data using any spreadsheet software. There are columns that you must complete and others that are optional. Mandatory fields are marked with a double asterisk (\*\*) prefix.

Below are some points to be noted when entering the data into the template.

* The file must be a CSV (Comma-separated values) file. The name of your file must end with csv.
* Make sure you don’t change any column headings from row 1 in the template; these are needed for the file to import correctly.
* All date fields will accept the MM-DD-YYYY format.
* Be mindful of any leading zeros in your data; some spreadsheet software will trim them automatically without notifying you. This can be resolved by ensuring your columns have correct formatting.
* Sometimes long numbers (UPC, etc.) are formatted as scientific notation. Be sure to change the formatting on this data to display these long numbers correctly.

{% hint style="info" %}
*If you’re importing more than 5,000 records, we recommend you split up the file.*
{% endhint %}

#### Upload Purchase Order Template Fields

<table><thead><tr><th width="262">Column Name</th><th width="109.33333333333331">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>**ThirdPartyRefNo</td><td>Text</td><td>Enter a reference number here for the order. Typically, if the order is from an E-Commerce platform or an older system, then the order# from there can be used. Repeat the same number multiple times contiguously to indicate which row(s) belong to one order. Use a new ThirdPartyRefNo for a new order.</td></tr><tr><td>ThirdPartySource</td><td>Text</td><td>If the order came from a third party platform, it can be indicated here.</td></tr><tr><td>**StoreName</td><td>Text</td><td>Enter your store code name associated with the order. This should match exactly with the store code registered in Xoro. The goods will eventually be received into this inventory set.</td></tr><tr><td>**CurrencyCode</td><td>Text</td><td>Enter the currency for the order. This must match with the customer’s currency, for instance, USD, CAD, etc.  For additional currencies, please contact Xorosoft.</td></tr><tr><td>**VendorName</td><td>Text</td><td>Enter the name of the vendor for this purchase order exactly as it is in Xoro.</td></tr><tr><td>VendorContact</td><td>Numeric</td><td>Enter any contact information for the vendor here.</td></tr><tr><td>**DateOrder</td><td>Date</td><td>Enter the date for the purchase order in the MM-DD-YYYY format.               </td></tr><tr><td>VendorReqDate</td><td>Date</td><td>Enter the date the PO was requested from the vendor in MM-DD-YYYY format.</td></tr><tr><td>**DateExpectedDelivery</td><td>Date</td><td>Enter the date the goods are expected to arrive for this PO in MM-DD-YYYY format.</td></tr><tr><td>ExpectedShipDate</td><td>Date</td><td>Enter the date on which the order is expected to be shipped in the MM-DD-YYYY format.</td></tr><tr><td>**CurrencyRate</td><td>Numeric</td><td>Enter the currency rate for the order.</td></tr><tr><td>Memo</td><td>Text</td><td>This field allows you to provide any notes or any additional information related to the purchase order. This allows you to add important details or instructions that need to be considered during order processing.</td></tr><tr><td>RefNumber</td><td>Text</td><td>Enter a reference number for the order that can be used for easy identification and tracking of the order.</td></tr><tr><td>ShippingTermsName</td><td>Text</td><td>Enter the shipping term for the order. Choose from: Prepaid, Collect, Prepaid&#x26; Billed, Collect&#x26; Allowed, and Third Party Billing.</td></tr><tr><td>PaymentTermsName</td><td>Text</td><td>Enter a payment term from the system for this order. This must match up exactly to a payment term in Xoro.</td></tr><tr><td>FobName</td><td>Text</td><td>If applicable, enter the Freight on Board here. Choose from: Origin or Destination.</td></tr><tr><td>BillFromAddress</td><td>Text</td><td>Enter the address information of the vendor.</td></tr><tr><td>BillFromCity</td><td>Text</td><td>Enter the city of the vendor.</td></tr><tr><td>BillFromState</td><td>Text</td><td>Enter the state of the vendor.</td></tr><tr><td>BillFromCountry</td><td>Text</td><td>Enter the country of the vendor.</td></tr><tr><td>BillFromPostalZipCode</td><td>Text</td><td>Enter the pin code of the vendor.</td></tr><tr><td>BillFromPhoneNumber</td><td>Numeric</td><td>Enter the phone number of the vendor.</td></tr><tr><td>BillFromEmail</td><td>Text</td><td>Enter the email of the vendor.</td></tr><tr><td>ShipToAddress</td><td>Text</td><td>Enter the address details of the store where the goods will be received.</td></tr><tr><td>ShipToCity</td><td>Text</td><td>Enter the city of the store where the goods will be received.</td></tr><tr><td>ShipToState</td><td>Text</td><td>Enter the state of the store where the goods will be received.</td></tr><tr><td>ShipToCountry</td><td>Text</td><td>Enter the country of the store where the goods will be received.</td></tr><tr><td>ShipToPostalZipCode</td><td>Text</td><td>Enter the zip code of the store where the goods will be received.</td></tr><tr><td>**PoItemNumber</td><td>Text</td><td>The Item SKU line for this PO. This SKU must match exactly with the item number in Xoro.</td></tr><tr><td>VendorPartNumber</td><td>Text</td><td>Enter the Vendor Part Number here. This is a unique identification code assigned by a vendor to a specific product or item they offer. It helps in tracking and identifying products within the vendor's inventory.</td></tr><tr><td>Description</td><td>Text</td><td>The item number’s description.</td></tr><tr><td>**UnitPrice</td><td>Text</td><td>Enter the unit price of the item.</td></tr><tr><td>**QtyOrder</td><td>Text</td><td>Enter the quantity of the item.</td></tr><tr><td>UomName</td><td>Text</td><td>Enter the unit of measurement for the item.</td></tr><tr><td>Discount</td><td>Text</td><td>Depending on the discount type, enter a percentage or decimal amount. If there is no discount, leave it as blank.</td></tr><tr><td>DiscountTypeName</td><td>Text</td><td>Enter "Percentage" or "Amount" if there is a discount for the item, otherwise, leave it blank.</td></tr><tr><td>TaxItemCode1</td><td>Text</td><td>Enter the code 1 of the tax item.</td></tr><tr><td>TaxItemValue1</td><td>Text</td><td>Enter the value 1 of the tax item.</td></tr><tr><td>TaxItemCode2</td><td>Text</td><td>Enter the code 2 of the tax item.</td></tr><tr><td>TaxItemValue2</td><td>Text</td><td>Enter the value 2 of the tax item.</td></tr><tr><td>TaxItemCode3</td><td>Text</td><td>Enter the code 3 of the tax item.</td></tr><tr><td>TaxItemValue3</td><td>Text</td><td>Enter the value 3 of the tax item.</td></tr><tr><td>TaxItemCode4</td><td>Text</td><td>Enter the code 4 of the tax item.</td></tr><tr><td>TaxItemValue4</td><td>Text</td><td>Enter the value 4 of the tax item.</td></tr><tr><td>BuyerName</td><td>Text</td><td>If the purchase order is converted from the sales order, this field captures the buyer who has requested the items. If the buyer is empty, then SO customer will be transferred to PO buyer name.</td></tr><tr><td>OrderLineClassName</td><td>Text</td><td>An item can belong to a class. Enter the name of that Class Code if you want to categorize your item. This must match exactly with the Class Name set up in Xoro.</td></tr><tr><td>OrderLineClassCode</td><td>Text</td><td>An item can belong to a class. Enter the code of that Class Code if you want to categorize your item. This must match exactly with the Class Code set up in Xoro.</td></tr><tr><td>DefaultLocationName</td><td>Text</td><td>Enter the default location for the item here.</td></tr><tr><td>OrderClassCode</td><td>Text</td><td>An order can belong to a Class (e.g. Wholesale, Retail, and E-Commerce). Enter the name of that Class Code if you want to categorize your orders. Reports can be generated based on these classes, which can show how your Wholesale is doing compared to your Retail, E-Commerce, etc. This must match exactly to how the Class Code is set up in Xoro.</td></tr><tr><td>OrderClassName</td><td>Text</td><td>An order can belong to a Class (e.g. Wholesale, Retail, and E-Commerce). Enter the name of the Class to categorize your orders. Reports can be generated based on these Classes, which can show how your Wholesale is doing compared to your Retail, E-Commerce, etc. This must match exactly to how the Class Name is set up in Xoro.</td></tr><tr><td>AutoReleasePurchaseOrder </td><td>Text</td><td>Enter "Y" if you want the order to be automatically uploaded in the "Released" status.</td></tr><tr><td>ItemIdentifierCode </td><td>Text</td><td><p>Enter the item identifier code here. </p><p>Item identifier code column specifies, how item number field value of the file will be used to match the item in the system. Below are the valid identifier codes to be used in upload purchase order.</p><ul><li>0 will represent Not Applicable.</li><li>1 will represent Item Number.</li><li>2 will represent Item UPC.</li><li>3 will represent Item Barcode.</li><li>4 will represent Alternate item number 1.</li><li>5 will represent Alternate item number 2.</li><li>6 will represent Alternate item number 3.</li><li>8 will represent Item Vendor Mapping.</li></ul></td></tr><tr><td>PoSubTypeName </td><td>Text</td><td>Enter the order type to associate with this PO as present in the order type module.</td></tr><tr><td>AddressVerificationIdentifierCode </td><td>Text</td><td><p>Enter the address verification identifier code here. Address verification identifier code column specifies how the addresses are going to be validated in the system. Below are the valid identifier codes to be used in upload purchase order.</p><ul><li>10 Do not validate address.</li><li>20 Validate address with warning.</li><li>30 Validate address with error.</li></ul></td></tr><tr><td>VoidAndCreate </td><td>Text</td><td>This field is used for updating an existing order. Enter "Y" to trigger the process. If this flag is enabled, the existing order will be voided and a new purchase order will be created with the updated details.</td></tr><tr><td>KeepOriginalOrderNumber</td><td>Text</td><td>When updating the purchase order, input "Y" here to retain the original order number for the updated order.</td></tr><tr><td>ShipServiceName</td><td>Text</td><td>Enter the ship service name for the order.</td></tr><tr><td>ShipMethodName </td><td>Text</td><td>Enter a shipping method for the order here. Choose from the available options: Pick Up, Delivery(Own Truck), and Delivery(Third Party).</td></tr><tr><td>CarrierName</td><td>Text</td><td>If the ship method is not Pick Up, enter the carrier for the order’s shipment exactly as it is in Xoro.</td></tr><tr><td>CarrierCode</td><td>Text</td><td>Enter the carrier code for the order’s shipment exactly as it is in Xoro.</td></tr><tr><td>ShipServiceCode </td><td>Text</td><td>Enter the ship service code for the order.</td></tr><tr><td>ShippingAccountNumber</td><td>Text</td><td>Enter the shipping account number here.</td></tr><tr><td>ImportError</td><td>Text</td><td>If there are any errors from an upload, they will be listed in this column.</td></tr><tr><td>CustomFields</td><td>Text</td><td>The custom fields columns allow you to enter data in the custom fields defined for the purchase order entity. This feature provides the flexibility to capture and store additional information relevant to the purchase order, tailoring the system to your unique business requirement.</td></tr><tr><td>OrderTypeCode</td><td>Text</td><td>Enter the code of the Order Type for the purchase order. If a valid code is provided, the system automatically derives the corresponding Order Type Name. If the code is invalid but a valid OrderTypeName is provided, the system considers the OrderTypeName.</td></tr><tr><td>OrderTypeName</td><td>Text</td><td>Enter the name of the Order Type for the purchase order. If a valid name is provided, the system automatically derives the corresponding Order Type Code. When both OrderTypeCode and OrderTypeName are provided, the system prioritizes the valid value.</td></tr><tr><td>BrandName</td><td>Text</td><td>Enter the brand name to associate with the purchase order. This is a header-level field and is applied to the entire order.</td></tr></tbody></table>

{% hint style="info" %}
For purchase orders with multiple lines, header-level fields such as **OrderTypeCode**, **OrderTypeName**, and **BrandName** are considered only from the first row of the order. Values in subsequent rows do not override these fields.

If no value is provided in the first row, the fields remain blank. If an invalid OrderTypeCode is provided, it is captured in the **ImportError** column while valid data continues to be processed.
{% endhint %}

### Uploading the template

Once you have filled the CSV file with your data, you can follow the steps below to upload it into Xoro:

* The **Default values** for required columns can be configured before the upload.

  <figure><img src="/files/sgDavRHhfch66YMDUhDs" alt=""><figcaption></figcaption></figure>
* Please check the defaults from the Upload Items module before uploading items.
* If the data in the template is blank or incorrect, then the uploader will fallback and use these specified default values.
* Click **Browse** to select the saved CSV Template file.

  <figure><img src="/files/OwPiGz3N40loRXNrw9h0" alt=""><figcaption></figcaption></figure>
* You can also check on the Split PO line(s) by default vendor box. (If you check this option, the third-party reference number, and vendor name will be ignored. PO(s) will be created based on the default vendor selected for every item.)

  <figure><img src="/files/GKGQofeJsekIXI7qc4z4" alt=""><figcaption></figcaption></figure>
* If you are updating an existing purchase order, you check the "Auto void and create new purchase order" box. However, if you have marked the respective flags in the upload file, you can skip this.

  <figure><img src="/files/ekbiTFEBq71LjjsRBBPl" alt=""><figcaption></figcaption></figure>
* After the file has been selected, click **Upload** to start importing.

  <figure><img src="/files/nK2msbEEzqph3xaeOFz1" alt=""><figcaption></figcaption></figure>
* While the import is in progress, the summary of the progress will be displayed at the bottom of the screen with the progress bar.
* After the import has been completed, the result will be displayed with the message for success or error (if any).
* Purchase orders will only get uploaded into the system if there are no errors in the file.
* If there are errors in the file, you can download the error file, fix the errors in the **Original File** and upload it back into Xoro.

{% hint style="info" %}
If the **“**[**Enable Pricing Rules in Purchase Modules**](/xoroerp-1/configuration/application/app-config/purchase.md#enable-pricing-rules-in-purchase-modules)**”** app configuration is enabled, an additional option called **“Re-Calculate Prices” (checkbox)** becomes available in the **Batch Upload Purchase Orders** module. If this option is selected during the upload process, the system automatically fetches the **Unit Cost** from the corresponding **Item Vendor Mapping** and ignores any Unit Cost values provided in the uploaded file.
{% endhint %}

### Updating the Purchase Order via upload

XoroERP allows you to update the purchase order via upload. This is useful when you want to update multiple purchase orders. “VoidandCreate” and “KeepOriginalOrderNumber” columns in the upload template are used to update the sales order.

If both of these fields are set to true, the existing Sales Order will be voided and a new Sales Order will be created with the same Order number. Additionally, you can set the “KeepOriginalOrderNumber” field to false to update the Purchase Order number as well.

{% hint style="info" %}
Please Note: To update, the Order must be in “Open” or “Released” status.
{% endhint %}

**How does it work?**

* Navigate to the Data Export Centre and search by “Purchase Order Detail”.
* Now, select the lines of the Purchase Order you want to update and click on Options > Export To Local – Selected.
* Open the download file, make the desired updates and save the file. Make sure to set the “IsVoidAndCreate” field to “Y”. This will void the existing Order and create a new order with the updated information.
* If you want to keep the original Order number, input the value “Y” in the column “KeepOriginalOrderNumber”. Alternatively, input “N” to change the Order number.
* Now, go to the Upload Purchase Order module and upload the file.
* The existing Purchase Order will be voided and a new Purchase Order will be created in the system with the same number and updated details. The new Order will be created with “Open” status.


---

# 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://docs.xorosoft.com/xoroerp-1/utilities/data-imports/upload-purchase-orders.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.
