Order Data Structures

Order

Description

An XML representation of the order that you would like to have fulfilled.  This includes all of the information required to print and ship the book to your end-users.

Example

<?xml version="1.0" encoding="UTF-8"?>
<order xmlns="http://developer.lulu.com/orders/1.0" number="1234">
    <createdOn>2010-04-05T06:06:52Z</createdOn>
    <updatedOn>2010-04-05T06:15:32Z</updatedOn>
    <currency>USD</currency> 
    <shippingAddress>
        <firstName>Jane</firstName>
        <lastName>Doe</lastName>
        <fullName>Jane Doe</fullName>
        <company/>
        <street1>123 Example Ave</street1>
        <street2/>
        <city>New York</city>
        <state>NY</state>
        <postalCode>12312</postalCode>
        <country>US</country>
        <phone/>
    </shippingAddress>
    <orderItems>
        <orderItem> 
            <sku>1234567</sku>
            <name>My Latest Book</name>
            <qtyPurchased>1</qtyPurchased>
            <itemPrice>100.00</itemPrice> 
        </orderItem>
    </orderItems>        
    <adjustments>
        <adjustment>
            <shipping>
                <label>USPS Express Mail Overnight</label>
                <amount>3.99</amount>
                <carrier>USPS</carrier>
                <serviceLevel>1_DAY</serviceLevel>
            </shipping>
        </adjustment>
    </adjustments>
    <callback>
        <url>https://my.website.com/orderstatus</url>
        <mimeType>application/xml</mimetype>  
    </callback>  
</order>

Fields

Field Data Type Required? Description
number integer yes The unique order identifier in your system.  This value is used to ensure that each order is only submitted one time.  After you successfully place an order, Lulu will reject any subsequent order that uses the same order ID.
createdOn date yes The date the order was created in ISO8601 format
updatedOn date yes The date the order was last modified in ISO8601 format
currency string yes The currency in which the order was placed.  Valid values are:  USD (US Dollars), EUR (Euros), and GBP (Pounds Sterling)
shippingAddress data structure yes The address to use when shipping the order.
orderItems list of data structures yes The list of line items to fulfill.
adjustments list of data structures yes A list of the adjustments to the order that are requested.
callback data structure no If supplied, the order system will POST a notification when the order status changes.

Address

Fields

Field Data Type Required? Description
firstName string yes
The first name of the user, limited to 22 characters
lastName string yes The last name of the user, limited to 22 characters.
fullName
string
no
The first and last name of the user, limited to 45 charactes.
company string no The company the user works for, limited to 45 characters
street1
string
yes
The first portion of the street address, limited to 45 characters.
street2 string
no
The second portion of the street address, limited to 45 characters.
city
string yes
The city for the user.
state
string yes The state for the user.  This should be the 2 character ISO code.
postalCode
string yes
The postal code for this city and state
country string yes The 2-letter ISO 3166-1 code representing the country of the shipping address.
phone string yes The phone number for this user.  While this is not required, when possible it should be submitted, because some shipping options require a phone number to deliver the package.  This should always include a 10 digit number.

Order Items

Fields

Field Data Type Required? Description
sku
string
yes The product ID of the book, as returned by the publication API
name
string
yes
The name of the book.  This is used for reconcilliation and error checking only.
qtyPurchased
integer
yes
How many copies of the book to fulfill.
itemPrice float yes The expected price on Lulu.com.  This price must be close to the price you will pay Lulu.com (author price if you are the author, or retail price if you are not).  The order ingestion system will verify the price.

Adjustments

Currently only shipping adjustments are allowed to an order.

Fields

Field Data Type Required? Description
label
string
yes
A human-readable string describing the shipping type
amount
string
yes The amount of money you charged your customer for shipping.  This does not relate to what Lulu will charge the application  developer and is largely ignored by our system.
carrier
string
yes
The desired carrier.  The exact carrier that is used will differ based on which print vendor actually fulfills the order, but we try to match the requested carrier.
serviceLevel
integer
yes
The machine-readable description of the service level requested.  This must be one of our supported shipping levels

Callback

Description

A callback URL can be specified in order to be notified of order status changes, whether successful or in error. The notification will be POSTed with a POST body equivalent to the response of a status call.

Fields

Field Data Type Required? Description
url
string
yes
A URL that the system should contact when the order's status changes.
mimeType string
no The mimetype for the callback request.  The E-Commerce APIs currently only support application/xml

Shipping Cost

Description

An XML representation of the shipping options for the submitted order.  This is a list of shipping options.

Example

<shipquote xmlns="http://developer.lulu.com/orders/1.0">
  <shipping>
     <label>Mail</label>
     <amount>21.49</amount>
     <carrier>LULU_MAIL</carrier>
     <serviceLevel>5 - 15</serviceLevel>
     <trackable/>
  </shipping>
  <shipping>
     <label>Ground</label>
     <amount>27.49</amount>
     <carrier>LULU_GROUND</carrier>
     <serviceLevel>2 - 5</serviceLevel>
     <trackable>1</trackable>
  </shipping>
  <shipping>
     <label>Expedited</label>
     <amount>44.99</amount>
     <carrier>LULU_EXPEDITED</carrier>
     <serviceLevel>2 - 2</serviceLevel>
     <trackable>1</trackable>
  </shipping>
  <shipping>
     <label>Express</label>
     <amount>82.99</amount>
     <carrier>LULU_EXPRESS</carrier>
     <serviceLevel>1 - 1</serviceLevel>
     <trackable>1</trackable>
   </shipping>
</shipquote>

Fields

Field Data Type Required? Description
label
string yes The human readable string for the shipping option.
amount price yes The price for shipping this order.
carrier string yes The specifier for the shipping option.
serviceLevel string yes The range of days that it might take to deliver the package with this option.
trackable boolean
yes
Is this shipping option trackable.