Skip to content

Magnetic HQ Company XML

This XML format represents companies (clients) in Magnetic HQ. Customers and suppliers use the same format. Only the collection name differs.

Tasks

Minimal XML Sample

<?xml version="1.0" encoding="utf-8"?>
<MagneticHQData>
  <Customers>
    <Customer>
      <Name>Acme Ltd</Name>
      <ApprovedAccountsCustomer>true</ApprovedAccountsCustomer>
    </Customer>
  </Customers>
</MagneticHQData>

For suppliers, use Suppliers and Supplier in place of Customers and Customer, and set ApprovedAccountsSupplier.

Customer / Supplier

The Customer and Supplier elements represent a company in Magnetic HQ.

XML Field Example Field Type Input Description
ExternalId CUST001 string Optional Your own reference for the company. Stored in the Zynk truth database against the Magnetic HQ ID after import. Not sent to Magnetic HQ.
Id 53126881 long Optional Magnetic HQ company ID. Supply it to update an existing company.
Version 4 long Read only Magnetic HQ record version.
Name Acme Ltd string Required Company name. Also used to find an existing company when no Id is supplied.
ContactPerson Jane Smith string Optional Name of the main contact.
BillingName Acme Holdings Ltd string Optional Name to use on invoices.
ContactNumber 01234 567890 string Optional Main phone number.
EmailAddress [email protected] string Optional Main email address.
PhysicalAddress 1 High Street, Leeds, LS1 1AA string Optional Physical address, as a single text field.
PostalAddress PO Box 12, Leeds, LS1 1AB string Optional Postal address, as a single text field.
Website www.acme.example string Optional Website.
MailDomain acme.example string Optional Email domain, used by Magnetic HQ to link emails to the company.
Description Manufacturing client string Optional Description.
CreatedDate 1446815017313 long Read only When the company was created. See Data Types.
OtherInfo Prefers email contact string Optional Free text notes.
ExternalReference SAGE-ACME01 string Optional Reference held in Magnetic HQ, for example your accounts system's account code.
Tag lead string Optional Tag.
TaxNumber GB123456789 string Optional VAT or tax number.
KeyPerson Contact Optional The company's key contact.
Owner User Optional The Magnetic HQ user who owns the company.
Global false bool Optional Whether the company is visible to all users.
ApprovedAccountsCustomer true bool Optional Approved as a customer in Magnetic HQ accounts. Export Customers only returns companies where this is true.
ApprovedAccountsSupplier false bool Optional Approved as a supplier in Magnetic HQ accounts. Export Suppliers only returns companies where this is true.
LastActivityDate 1503412276262 long Read only Date of the last activity on the company.
ModifiedDate 1503412276262 long Read only When the company was last changed. Used by the export tasks to pick up changes.
CustomFields collection Export only See Custom Fields.

Note

Importing into the Customers collection does not mark the company as a customer by itself. Set ApprovedAccountsCustomer (or ApprovedAccountsSupplier for suppliers) to true if you want the company to appear in the matching export.

KeyPerson

The KeyPerson element is the company's key contact. The same Contact structure appears as Contact on orders.

XML Field Example Field Type Input Description
Id 53126884 long Read only Magnetic HQ contact ID.
Version 2 long Read only Magnetic HQ record version.
Title Mrs string Optional Title.
FirstName Jane string Optional First name.
LastName Smith string Optional Last name.
FullName Jane Smith string Optional Full name.
LandNumber 01234 567890 string Optional Landline number.
CellNumber 07700 900123 string Optional Mobile number.
FaxNumber string Optional Fax number.
Email [email protected] string Optional Email address. Not changed when updating an existing company.
PhysicalAddress string Optional Physical address.
PostalAddress string Optional Postal address.
Position Finance Director string Optional Job title.
OtherInfo string Optional Free text notes.
ExternalReference string Optional Reference held in Magnetic HQ.
Tag string Optional Tag.
CreatedDate 1446815017357 long Read only When the contact was created.
Owner User Optional The Magnetic HQ user who owns the contact.
Global false bool Optional Whether the contact is visible to all users.
CustomFields collection Export only See Custom Fields.

Owner

The Owner element is a Magnetic HQ user. On import, only Id is needed.

XML Field Example Field Type Input Description
Id 53090727 long Required Magnetic HQ user ID.

On export the user's full details are included, for example FirstName, LastName, FullName, Email, UserName, RoleType, Status, Active and the Magnetic HQ account (Company). These are for reference only.

Matching Existing Companies

Each record is checked against Magnetic HQ in this order:

  1. Id: if supplied and found, the company is updated. If Magnetic HQ cannot find it, a new company is created.
  2. Name: an exact match on company name. If one or more companies match, the first is updated.
  3. Otherwise a new company is created.

Warning

Do not rely on ExternalId to find companies imported before. Supply Id or Name instead.

Fields Changed on Update

When an existing company is updated, only these fields are changed, and only when you supply a non-empty value:

  • Name, ContactNumber, ContactPerson, BillingName, EmailAddress, PhysicalAddress, PostalAddress, Website, MailDomain, Description, OtherInfo, ExternalReference, Tag, TaxNumber
  • ApprovedAccountsCustomer and ApprovedAccountsSupplier
  • KeyPerson: Title, FirstName, LastName, FullName, LandNumber, CellNumber, FaxNumber, PhysicalAddress, PostalAddress, Position, OtherInfo, ExternalReference, Tag

Global is changed when you supply it. KeyPerson/Global is always set from the input, so leaving it out sets it to false. Owner and custom fields are never changed on update.

Complete XML Sample

<?xml version="1.0" encoding="utf-8"?>
<MagneticHQData>
  <Customers>
    <Customer>
      <ExternalId>CUST001</ExternalId>
      <Id>53126881</Id>
      <Name>Acme Ltd</Name>
      <ContactPerson>Jane Smith</ContactPerson>
      <BillingName>Acme Holdings Ltd</BillingName>
      <ContactNumber>01234 567890</ContactNumber>
      <EmailAddress>[email protected]</EmailAddress>
      <PhysicalAddress>1 High Street, Leeds, LS1 1AA</PhysicalAddress>
      <PostalAddress>PO Box 12, Leeds, LS1 1AB</PostalAddress>
      <Website>www.acme.example</Website>
      <MailDomain>acme.example</MailDomain>
      <Description>Manufacturing client</Description>
      <OtherInfo>Prefers email contact</OtherInfo>
      <ExternalReference>SAGE-ACME01</ExternalReference>
      <Tag>lead</Tag>
      <TaxNumber>GB123456789</TaxNumber>
      <KeyPerson>
        <Title>Mrs</Title>
        <FirstName>Jane</FirstName>
        <LastName>Smith</LastName>
        <FullName>Jane Smith</FullName>
        <LandNumber>01234 567890</LandNumber>
        <CellNumber>07700 900123</CellNumber>
        <Email>[email protected]</Email>
        <Position>Finance Director</Position>
        <Global>false</Global>
      </KeyPerson>
      <Owner>
        <Id>53090727</Id>
      </Owner>
      <Global>false</Global>
      <ApprovedAccountsCustomer>true</ApprovedAccountsCustomer>
      <ApprovedAccountsSupplier>false</ApprovedAccountsSupplier>
    </Customer>
  </Customers>
</MagneticHQData>