Sage 50 US Purchase Order XML
The Import Purchase Orders task allows you to create new purchase orders, or update existing purchase orders in Sage 50 US. We recommend that the ExternalId field be populated by the unique id of the order from the external system, Zynk uses this field to track purchase orders already imported to prevent duplicates being created in Sage.
Tasks
Tasks
Any Sage fields not documented below are not supported with our exports, if there are additional fields you need contact us at [email protected].
Complete import file for creating a purchase order:-
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfPurchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<PurchaseOrder Operation="Create">
<ExternalId />
<Key>2ff80f5a-d4c2-4e9c-9151-4ca9e3fa87de</Key>
<ReferenceNumber />
<Date>2015-03-15T00:00:00</Date>
<AccountReference>20000-00</AccountReference>
<ShipToAddress>
<Name>Bellwether Garden Supply</Name>
<Address>
<Address1>1505 Pavilion Place</Address1>
<Address2 />
<City>Norcross</City>
<State>GA</State>
<Zip>30093-3203</Zip>
<Country>USA</Country>
</Address>
</ShipToAddress>
<ShipVia>None</ShipVia>
<TermsDescription>2% 10, Net 30 Days</TermsDescription>
<InternalNote />
<VendorReference>SOGARDEN</VendorReference>
<PrintVendorNoteAfterLineItems>false</PrintVendorNoteAfterLineItems>
<VendorNote />
<MainAddress>
<Name>Southern Garden Wholesale</Name>
<Address>
<Address1>4555 Oakland Park Blvd.</Address1>
<Address2 />
<City>Atlanta</City>
<State>GA</State>
<Zip>30312</Zip>
<Country>USA</Country>
</Address>
</MainAddress>
<GoodThroughDate>2015-04-14T00:00:00</GoodThroughDate>
<IsDropShip>false</IsDropShip>
<PurchaseOrderLines>
<PurchaseOrderLine>
<AccountReference>12000-00</AccountReference>
<Amount>215.8500000000000000000</Amount>
<Description>Catalog # LM400500 Rotary Lawn Mower - 3HP</Description>
<IsUsed>true</IsUsed>
<InventoryItemReference>EQLW-14130</InventoryItemReference>
<Quantity>3.0000000000000000000</Quantity>
<UnitPrice>71.9500000000000000000</UnitPrice>
<QuantityReceived>0.0000000000000000000</QuantityReceived>
</PurchaseOrderLine>
</PurchaseOrderLines>
</PurchaseOrder>
</ArrayOfPurchaseOrder>
In each of the following sections most of the XML has been omitted to make the samples easier to read. The sections have been broken up into the various sections of the purchase order record as viewed within Sage 50 US.
Operation
When importing orders you can specify whether you would like to create a new order, or update an existing order, via the Operation
attribute on each record. It can have one of the following values:
- Create - Indicates that a new purchase order should be created in Sage. If an
Operation
attribute isn't specified in the XML, it will default to "Create". - Update - Indicates that an existing purchase order should be updated in Sage. Please note that we don't support updating the 'Vendor ID', 'Customer ID', or the 'PO No' fields, but all other fields can be updated.
In order to update an existing purchase order, you must provide at least one of the following fields in your XML to identify which purchase order you want to update.
Sage Field | XML Field | Example | Field Type | Field Length | Input |
---|---|---|---|---|---|
N/A | ExternalId* | 123 | string | 255 | Optional |
PO No | ReferenceNumber | 10322 | string | 20 | Optional |
N/A | Key* | 9683178a-43f4-4c47-b27f-e6e9f45dc8c3 | guid | - | Optional |
- ExternalId* - The purchase order must have been imported into Sage by the same Zynk workflow for matching by ExternalId to work.
- Key* - This is the unique identifier from the Sage database. The value can only be seen in the output from the Export Purchase Orders task.
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfPurchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<PurchaseOrder Operation="Update">
<ExternalId>123</ExternalId>
<ReferenceNumber>10322</ReferenceNumber>
<Key>9683178a-43f4-4c47-b27f-e6e9f45dc8c3</Key>
</PurchaseOrder>
</ArrayOfPurchaseOrder>
Specifying The Vendor Record
When importing purchase orders you must specify the related vendor record, by providing the vendor reference. The vendor reference must already exist in Sage.
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfPurchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<PurchaseOrder>
<VendorReference>SOGARDEN</VendorReference>
</PurchaseOrder>
</ArrayOfPurchaseOrder>
Main Purchase Order Fields
The below will let you specify the main fields required for a purchase order record.
Sage Field | XML Field | Example | Field Type | Field Length | Input |
---|---|---|---|---|---|
N/A | ExternalId | 123 | string | 255 | Optional |
Vendor ID | VendorReference | SOGARDEN | string | 20 | Required, must exist in Sage as a vendor |
Customer ID* | CustomerReference | ARMSTRONG | string | 20 | Optional, if provided it must exist in Sage as a customer |
Remit to > Name | MainAddress/Name | Southern Garden Wholesale | string | 39 | Optional |
Remit to > Address Line 1 | MainAddress/Address1 | 4555 Oakland Park Blvd. | string | 30 | Optional |
Remit to > Address Line 2 | MainAddress/Address2 | Suite A | string | 30 | Optional |
Remit to > City | MainAddress/City | Atlanta | string | 20 | Optional |
Remit to > St | MainAddress/State | GA | string | 2 | Optional |
Remit to > Zip | MainAddress/Zip | 30312 | string | 12 | Optional |
Remit to > Country | MainAddress/Country | USA | string | 15 | Optional |
Ship to > Name | ShipToAddress/Name | Bellwether Garden Supply | string | 39 | Optional |
Ship to > Address Line 1 | ShipToAddress/Address1 | 1505 Pavilion Place | string | 30 | Optional |
Ship to > Address Line 2 | ShipToAddress/Address2 | Suite A | string | 30 | Optional |
Ship to > City | ShipToAddress/City | Norcross | string | 20 | Optional |
Ship to > St | ShipToAddress/State | GA | string | 2 | Optional |
Ship to > Zip | ShipToAddress/Zip | 30093-3203 | string | 12 | Optional |
Ship to > Country | ShipToAddress/Country | USA | string | 15 | Optional |
Date | Date | 2023-01-31T00:00:00 | datetime | - | Optional, defaults to day of import |
Good thru | GoodThroughDate | 2023-02-31T00:00:00 | datetime | - | Optional, defaults to day of import |
PO No | ReferenceNumber | 10322 | string | 20 | Optional, if provided must be unique, if left out will use the next available number from Sage |
Drop ship | IsDropShip | true | bool | - | Optional |
Terms | TermsDescription | Net 30 Days | string | 35 | Optional |
Ship via* | ShipVia | None | string | 20 | Optional |
A/P account* | AccountReference | 20000-00 | string | 15 | Optional |
Vendor Note | VendorNote | Leave by the door | string | 2000 | Optional |
Print* | PrintVendorNoteAfterLineItems | false | bool | - | Optional |
Internal Note | InternalNote | Leave by the door | string | 2000 | Optional |
- Customer ID* - can only be set when the 'Drop ship' field is true
- Ship via* - can only be what you have setup in Inventory Item Defaults on the Taxes/Shipping tab
- A/R account* - can only be what you have setup in Sage under Maintain Chart of Accounts
- Print* - set to false to use print Before Line Items, set to true to use print After Line Items
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfPurchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<PurchaseOrder>
<ExternalId>123</ExternalId>
<VendorReference>SOGARDEN</VendorReference>
<MainAddress>
<Name>Southern Garden Wholesale</Name>
<Address>
<Address1>4555 Oakland Park Blvd.</Address1>
<Address2>Suite A</Address2>
<City>Atlanta</City>
<State>GA</State>
<Zip>30312</Zip>
<Country>USA</Country>
</Address>
</MainAddress>
<ShipToAddress>
<Name>Bellwether Garden Supply</Name>
<Address>
<Address1>1505 Pavilion Place</Address1>
<Address2 />
<City>Norcross</City>
<State>GA</State>
<Zip>30093-3203</Zip>
<Country>USA</Country>
</Address>
</ShipToAddress>
<Date>2023-01-31T00:00:00</Date>
<GoodThroughDate>2023-02-31T00:00:00</GoodThroughDate>
<ReferenceNumber>10322</ReferenceNumber>
<IsDropShip>true</IsDropShip>
<TermsDescription>Net 30 Days</TermsDescription>
<ShipVia>None</ShipVia>
<AccountReference>20000-00</AccountReference>
<VendorNote>Leave by the door</VendorNote>
<PrintVendorNoteAfterLineItems>false</PrintVendorNoteAfterLineItems>
<InternalNote>Leave by the door</InternalNote>
</PurchaseOrder>
</ArrayOfPurchaseOrder>
Item Line Fields
The below will let you specify the item line fields required for a purchase order line. You can provide multiple PurchaseOrderLine
elements as children of the PurchaseOrderLines
element.
When updating an existing order in Sage, the following behaviour applies to the purchase order lines:
- If one or more
PurchaseOrderLine
elements are provided, any existing lines will be removed from Sage. The lines you have provided in the XML will then be added to the purchase order. - If no
PurchaseOrderLine
elements are provided, no changes will be made to the lines. Any existing lines in Sage will be preserved.
Sage Field | XML Field | Example | Field Type | Field Length | Input |
---|---|---|---|---|---|
Quantity | Quantity | 2 | decimal | - | Optional |
Item | InventoryItemReference | BOOK-11010 | string | 20 | Optional |
Description | Description | Bell-Grow Series: Gardening Handbook (Madison) | string | 30 | Optional |
GL Account* | AccountReference | 40000-BK | string | 15 | Optional |
Unit Price | UnitPrice | 29.95 | decimal | - | Optional, must be 0 if Quantity is 0 |
Job* | JobReference | SHARP | string | 20 | Optional |
- GL Account* - can only be what you have setup in Sage under Maintain Chart of Accounts.
- Job* - can only be what you have setup in Sage under Maintain Jobs.
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfPurchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<PurchaseOrder>
<PurchaseOrderLines>
<PurchaseOrderLine>
<Quantity>2.00</Quantity>
<InventoryItemReference>BOOK-11010</InventoryItemReference>
<Description>Bell-Grow Series: Gardening Handbook (Madison)</Description>
<AccountReference>40000-BK</AccountReference>
<UnitPrice>29.95</UnitPrice>
<JobReference>SHARP</JobReference>
</PurchaseOrderLine>
</PurchaseOrderLines>
</PurchaseOrder>
</ArrayOfPurchaseOrder>