Skip to main content

Order Contact object fields and Data Query

Zuora

Order Contact object fields and Data Query

You can perform queries from the Order Contact object through Data Query. For information about the basic usage of Data Query, see Constructing SQL Queries in Data Query.

Order Contact fields

The following table lists all the fields that are defined on the Order Contact object. You can access the Order Contact object and all its fields through Data Query and the Orders API.

Field name Format Description
address1 String The first line of the contact's address, which is often a street address or business name.
address2 String The second line of the contact's address.
city String The city of the contact's address.
country String The country of the contact's address. If you are using Zuora Tax, be aware that it requires a country in the sold-to contact to calculate tax. If no sold-to contact is provided, a bill-to contact might be used.
county String The county. May optionally be used by Zuora Tax to calculate county tax.
firstName String The contact's first name.
lastName String The contact's last name.
postalCode String The zip code for the contact's address.
state String The state or province of the contact's address. If you are using Zuora Tax, be aware that if the country is USA or Canada, Zuora Tax requires a state or province in the sold-to contact to calculate tax. If no sold-to contact is provided, a bill-to contact might be used.
id String The ID of the order line item.
deleted Boolean Indicates whether this record has been removed.
createdById String The ID of the Zuora user who created this order line item.
createdDate DateTime The date and time when the order line item is created.
updatedById String The ID of the Zuora user who updated the order line item.
updatedDate DateTime The date and time when the order line item is updated.

Common use cases

The following query examples demonstrate how to use Data Query to access the Order Contact fields.

  •  Query Order Contact by using the Order Number.

    SELECT contact.Address1,contact.City,contact.Country,contact.FirstName,contact.LastName,contact.PostalCode,contact.State ,oli.ItemNumber,oli.ItemName,o.OrderNumber
    from OrderContact contact join OrderLineItem oli on contact.Id=oli.SoldToOrderContactId join Orders o on oli.OrderId=o.Id
    where contact.FirstName='Bob' and contact.LastName='Barker' and o.OrderNumber='O-00000085'
    

    The query result is as follows:

    Address1   City       Country   FirstName    LastName    PostalCode    State    ItemNumber    ItemName      orderNumber
    2 Main St   Atlanta United States    Bob         Barker      30303    Georgia    2   delivery fee      O-00000085
    
  •  Retrieve the Order Contact by Id.

    SELECT contact.Address1,contact.City,contact.Country,contact.FirstName,contact.LastName,contact.PostalCode,contact.State,contact.Id
    from OrderContact contact
    where contact.FirstName='Bob' and contact.LastName='Barker'
    

    The query result is as follows:

    Address1   City       Country   FirstName    LastName    PostalCode    State    ItemNumber    ItemName      orderNumber
    2 Main St   Atlanta United States    Bob         Barker      30303    Georgia    2   delivery fee      O-00000085