Shared Types

Overview

Shared types are used where the same structure of data appears in more than one data type.
Reference date types (ending with Ref) link between data types in the Railz accounting data model.

AccountRef

Links to the Accounts data type.

📘

Financial Statements

While fInancial statements do not have an accountRef object, they do have account and subAccount fields on each line which can be used to link to the accounts data type.

📘

Xero Specific Rules

When pushing invoices to Xero, accountRef is required if no inventoryRef is used.

Found on:

FieldTypeDescription
id stringUnique identifier for the account in the accounting service provider.
name stringName of the account in the accounting service provider.
"accountsRef": {
    "id": "150",
    "name": "Advertising Expenses"
}

Address

Found on:

FieldTypeDescription
type stringType of the address, either:
billing
shipping
other
line1 stringLine 1 of the address.
line2 stringLine 2 of the address.
city stringCity of the address.
region stringRegion of the address.
country stringCountry of the address as 3 ISO alpha-3 characters. See Country
postalCode stringPostal code or zip code of the address.
{
  "type": "billing",
  "line1": "St Peter's Rd",
  "line2": "Suite 200",
  "city": "Cambridgeshire",
  "region": "West Land",    
  "country": "CAN",
  "postalCode": "P3E7D9"
}

Contact

Found on:

FieldTypeDescription
name stringContact Name.
phone arrayAn array of phone numbers.
address arrayAn array of addresses.
status stringContact status. Can be:
unknown
active
archived
modifiedDate string
See Date
Date the record was last changed in the accounting service provider.
{
  "name": "James Smith",
  "phone": "18004567890",
  "addresses":
  [
    {
      "type": "billing",
      "line1": "St Peter's Rd",
      "line2": "Suite 200",
      "city": "Cambridgeshire",
      "region": "West Land",
      "country": "CAN",
      "postalCode": "P3E7D9"
    }
  ],
  "status": "active",
  "modifiedDate": "2020-10-30T00:00:00.000Z"
}

CurrencyRef

Found on:

FieldTypeDescription
id
sortable, filterable
stringA three letter string representing the ISO-4217 code for the currency. See Currency]
name stringFull name of the currency.

📘

Using Currency Reference in Push

For convenience, when pushing data currencyRef can be used alone with the id as a value instead of nesting it within.

"currencyRef": {
    "id": "CAD",
    "name": "Canadian Dollar"
}

CustomerRef

Links to the Customers data type.

Found on:

FieldTypeDescription
id stringUnique identifier for the customer in the accounting service provider.
name stringName of the customer in the accounting service provider.
"customerRef": {    
  "id": "120",
  "name": "ABC Inc."
}

EntityRef

Depending on context, may link to the Customers or Vendors data type.

Found on:

"entityRef": {      
  "id": "100",
  "name": "ABC Inc",
  "type": "customer",    
}

📘

entityRef.type can be customer or vendor.

InventoryRef

Links to the Inventory data type.

📘

Xero Specific Rules

When pushing invoices to Xero, inventoryRef is required if no accountRef is used.

Found on:

FieldTypeDescription
id stringUnique identifier for the inventory item in the accounting service provider.
name stringName of the inventory item in the accounting service provider.
"inventoryRef": {   
  "id": "10",
  "name": "White golf balls"
}

PurchaseOrderRef

Links to the Purchase Orders data type.

Found on:

FieldTypeDescription
id stringUnique identifier for the purchase order in the accounting service provider.
name stringName of the purchase order in the accounting service provider.
"purchaseOrderRef": {   
  "id": "10",
  "purchaseOrderNumber": "PO-1245"
}

TaxRateRef

Links to the Tax Rates data type.

Found on:

FieldTypeDescription
id stringUnique identifier for the tax rate in the accounting service provider.
name stringName of the tax rate in the accounting service provider.
"taxRateRef": {
    "id": "15",
    "name": "GST/HST"
}

VendorRef

Links to the Vendors data type.

Found on:

FieldTypeDescription
id
sortable, filterable
stringUnique identifier for the vendor in the accounting service provider.
name stringName of the account in the vendor service provider.
"vendorRef": {      
  "id": "120",
  "name": "ABC Inc."
}

Did this page help you?