Fulfilling Purchases

Fulfilling Project Purchases

API Key Type Required:  E-Commerce API (Limited Availability)

This API allows external sites to take orders without having to direct end users to Lulu's website.  The external vendor can send a list of orders through this API, and we will print the book and send it directly to their customer.  Once a month, Lulu will invoice the external vendor for the price of the book and the shipping.  Lulu requires that the external vendor have a reseller's agreement, which means that we do not charge sales tax for these orders, but we require that the vendor charge the appropriate taxes.

Fulfill Order

Purpose

Submit the order so that Lulu will print the books and ship them to your end users.  Currently, this API only supports shipping within the United States.

QUERY_STRING

  • api_key -- Your api key for the ECommerce API.
  • auth_token -- The auth_token returned from logging in with the Authentication API.

POST Arguments

Endpoint

https://apps.lulu.com/api/shop/v1/order?auth_token=${auth_token}&api_key=${api_key}
You may only submit one order at a time.  To submit multiple orders, please make multiple calls to the API.  This API is also single-threaded at the server.  If you place two fulfill order requests at the same time, the second will fail.

Response (XML)

<?xml version="1.0" encoding="UTF-8"?>
<order xmlns="http://developer.lulu.com/orders/1.0" number="${customer order #}">
    <luluOrderNumber>${lulu order #}</luluOrderNumber>
</order>

Errors

All errors follow the same basic format:

<notifications>
    <notification>
        <code>100010001</code>
        <severity>ERROR</severity>
        <text>Order has already been submitted</text>
        <details>
            <detail key="orderNumber" value="1234"/>
        </details>
    </notification>
</notifications>         
For all errors, you will receive the appropriate HTTP Error.  One of:
  • 400 - Incoming XML is malformed
  • 403 - User does not have the Invoiced permission
  • 500 - Server has encountered an error.
  • 503 - Server is too busy

Get Order Status

Purpose

Get the status of a specific order. The result of this API call will also be sent to the requestor if a callback URL is specified in the order request.

QUERY_STRING

  • luluOrderNumber -- The order number that was returned from the order request.
  • api_key -- Your api key for the ECommerce API.
  • auth_token -- The auth_token returned from logging in with the Authentication API.

Endpoint

https://apps.lulu.com/shop/v1/order/${luluOrderNumber}?auth_token=${auth_token}&api_key=${api_key}

XML Response

An XML representation of the order, including the current status.

Errors

All errors follow the same basic format:

<notifications>
    <notification>
        <code>100010001</code>
        <severity>ERROR</severity>
        <text>Order has already been submitted</text>
        <details>
            <detail key="orderNumber" value="1234"/>
        </details>
    </notification>
</notifications>         
For all errors, you will receive the appropriate HTTP Error.  One of:
  • 400 - Incoming XML is malformed
  • 403 - User does not have the Invoiced permission
  • 500 - Server has encountered an error.
  • 503 - Server is too busy

Estimate Shipping Cost

Purpose

Determine the cost for shipping the requested order. This is an estimate only. The exact shipping costs will be returned from the order ingestion API. If this request is made close to when the order is submitted, it should be accurate. Do NOT cache the results of this API.

QUERY_STRING

  • api_key -- Your api key for the ECommerce API.
  • auth_token -- The auth_token returned from logging in with the Authentication API.

POST Arguments

Endpoint

https://apps.lulu.com/shop/v1/getshipquote?auth_token=${auth_token}&api_key=${api_key}

XML Response

An XML representation of all available shipping costs.

Errors

All errors follow the same basic format:

<notifications>
    <notification>
        <code>100010001</code>
        <severity>ERROR</severity>
        <text>Order has already been submitted</text>
        <details>
            <detail key="orderNumber" value="1234"/>
        </details>
    </notification>
</notifications>         
For all errors, you will receive the appropriate HTTP Error.  One of:
  • 400 - Incoming XML is malformed
  • 403 - User does not have the Invoiced permission
  • 500 - Server has encountered an error.
  • 503 - Server is too busy