# Lulu

> Quote, validate and track books printed through Lulu.

App · 14 actions. Web page: https://docs.lodol.com/docs/integrations/lulu

## Actions

### Calculate cover dimensions

Calculate cover dimensions.

**Inputs**

- Pod package ID (`pod_package_id`, text, required): POD Package ID of the book.
- Interior page count (`interior_page_count`, number, required): Interior page count.
- Unit (`unit`, text): Requested unit of cover dimensions. Defaults to print points. One of: `pt`, `mm`, `inch`.

**Outputs**

- `data` (object): The response from Lulu.

**Example output**

```json
{
  "data": {
    "height": "example",
    "unit": "pt",
    "width": "example"
  }
}
```

### Calculate print job cost

Create a Print-Job cost calculation.

**Inputs**

- Line items (`line_items`, list, required): The line items that should be calculated
- City (`city`, text, required): City.
- Country code (`country_code`, text, required): [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country code
- Email (`email`, text): Email.
- Is business (`is_business`, true/false): Only relevant for US addresses. Some US carriers don't deliver to business-addresses on Saturday. Default: `false`.
- Name (`name`, text): Full name of the person, including first and last name.
- Organization (`organization`, text): Name of an organization. Required if no person name is given.
- Phone number (`phone_number`, text, required): Validation Regex Pattern: `^\+?[\d\s\-.\/()]{8,20}$`
- Postcode (`postcode`, text, required): Required for most countries
- State code (`state_code`, text): 2 or 3 letter state codes (officially called [ISO-3166-2 subdivision codes](https://en.wikipedia.org/wiki/ISO_3166-2)). They are required for some countries (e.g. US, MX, CA, AU)
- Street1 (`street1`, text, required): First address line
- Street2 (`street2`, text): Second address line
- Title (`title`, text): Title. One of: `MR`, `MISS`, `MRS`, `MS`, `DR`.
- Shipping option (`shipping_option`, text, required): The shipping option level. One of: `MAIL`, `PRIORITY_MAIL` (Priority mail), `GROUND_HD` (Ground hd), `GROUND_BUS` (Ground bus), `GROUND`, `EXPEDITED`, `EXPRESS`.

**Outputs**

- `data` (object): The response from Lulu.

**Example output**

```json
{
  "data": {
    "currency": "example",
    "fees": [],
    "fulfillment_cost": {
      "tax_rate": "example",
      "total_cost_excl_tax": "example",
      "total_cost_incl_tax": "example",
      "total_tax": "example"
    },
    "line_item_costs": [],
    "shipping_address": {
      "city": "example",
      "country_code": "example",
      "email": "example",
      "is_business": false,
      "name": "example",
      "organization": "example",
      "phone_number": "example",
      "postcode": "example",
      "state_code": "example",
      "street1": "example",
      "street2": "example",
      "suggested_address": {
        "city": "example",
        "country_code": "example",
        "postcode": "example",
        "state_code": "example",
        "street1": "example",
        "street2": "example"
      },
      "title": "MR",
      "warnings": []
    },
    "shipping_cost": {
      "tax_rate": "example",
      "total_cost_excl_tax": "example",
      "total_cost_incl_tax": "example",
      "total_tax": "example"
    },
    "total_cost_excl_tax": "example",
    "total_cost_incl_tax": "example",
    "total_discount_amount": "example",
    "total_tax": "example"
  }
}
```

### Cancel print job

Cancel a print job before it enters production.

**Inputs**

- Id (`id`, text, required): Id of the resource

**Outputs**

- `data` (object): The response from Lulu.

**Example output**

```json
{
  "data": {
    "changed": "example",
    "message": "example",
    "name": "CREATED"
  }
}
```

### Create print job

Create a new Print-Job.

**Inputs**

- Contact email (`contact_email`, text, required): Email address that should be contacted if questions regarding the Print-Job arise. Lulu recommends to use the email of a person who is responsible for placing the Print-Job like a developer or business owner.
- External ID (`external_id`, text): Arbitrary string to identify and connect a print job to your systems. Set it to an order number, a purchase order or whatever else works for your particular use case.
- Line items (`line_items`, list, required): The line items of a Print-Job, defining it's Printables and their quantities. The property name 'items' can be used instead.
- Production delay (`production_delay`, number): Delay before a newly created Print-Job is sent to production. Minimum is 60 minutes, maximum is 2880 minutes (=48 hours). As most cancellation requests occur right after an order has been placed, it makes sense to wait for some time before sending an order to production. Once production has started, orders cannot be canceled anymore. From 60 to 2880. Default: `60`.
- City (`city`, text, required): City.
- Country code (`country_code`, text, required): [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country code
- Email (`email`, text, required): Shipping carriers require an email address for notifications or handling delivery issues. If no email is given, the default email in the user profile will be used.
- Is business (`is_business`, true/false): Only relevant for US addresses. Some US carriers don't deliver to business-addresses on Saturday. Default: `false`.
- Name (`name`, text, required): Full name of the person, including first and last name.
- Organization (`organization`, text): Name of an organization. Required if no person name is given.
- Phone number (`phone_number`, text, required): Shipping carriers require a phone number for handling delivery issues. If no phone number is given, the default in the API user profile will be used. Validation Regex Pattern for phone numbers `^\+?[\d\s\-.\/()]{8,20}$`
- Postcode (`postcode`, text, required): Required for most countries
- State code (`state_code`, text): 2 or 3 letter state codes (officially called [ISO-3166-2 subdivision codes](https://en.wikipedia.org/wiki/ISO_3166-2)). They are required for some countries (e.g. US, MX, CA, AU)
- Street1 (`street1`, text, required): First address line
- Street2 (`street2`, text): Second address line
- Title (`title`, text): Title. One of: `MR`, `MISS`, `MRS`, `MS`, `DR`.
- Recipient tax ID (`recipient_tax_id`, text): The recipient’s tax identification number. Required for shipping addresses to Brazil, Chile, and Mexico.
- Shipping level (`shipping_level`, text, required): The shipping level that this Print-Job is shipped with. One of: `MAIL`, `PRIORITY_MAIL` (Priority mail), `GROUND_HD` (Ground hd), `GROUND_BUS` (Ground bus), `GROUND`, `EXPEDITED`, `EXPRESS`.

**Outputs**

- `data` (object): The response from Lulu.

**Example output**

```json
{
  "data": {
    "contact_email": "example",
    "costs": {
      "line_item_costs": {
        "cost_excl_discounts": "example",
        "discounts": [],
        "quantity": 1.0,
        "tax_rate": "example",
        "total_cost_excl_discounts": "example",
        "total_cost_excl_tax": "example",
        "total_cost_incl_tax": "example",
        "total_tax": "example",
        "unit_tier_cost": "example"
      },
      "shipping_cost": {
        "tax_rate": "example",
        "total_cost_excl_tax": "example",
        "total_cost_incl_tax": "example",
        "total_tax": "example"
      },
      "total_cost_excl_tax": "example",
      "total_cost_incl_tax": "example",
      "total_tax": "example"
    },
    "estimated_shipping_dates": {
      "arrival_max": "example",
      "arrival_min": "example",
      "dispatch_max": "example",
      "dispatch_min": "example"
    },
    "external_id": "example",
    "id": 1.0,
    "line_items": [],
    "order_id": "example",
    "production_delay": 1,
    "production_due_time": "example",
    "shipping_address": {
      "city": "example",
      "country_code": "example",
      "email": "example",
      "is_business": false,
      "name": "example",
      "organization": "example",
      "phone_number": "example",
      "postcode": "example",
      "state_code": "example",
      "street1": "example",
      "street2": "example",
      "suggested_address": {
        "city": "example",
        "country_code": "example",
        "postcode": "example",
        "state_code": "example",
        "street1": "example",
        "street2": "example"
      },
      "title": "MR",
      "warnings": []
    },
    "shipping_level": "MAIL",
    "tax_country": "example"
  }
}
```

### Get cover validation

Retrieve a single cover validation record.

**Inputs**

- Id (`id`, number, required): Id of the resource

**Outputs**

- `data` (object): The response from Lulu.

**Example output**

```json
{
  "data": {
    "errors": [],
    "id": 1,
    "source_url": "example",
    "status": "NORMALIZING"
  }
}
```

### Get interior validation

Retrieve a single file validation record.

**Inputs**

- Id (`id`, number, required): Id of the resource

**Outputs**

- `data` (object): The response from Lulu.

**Example output**

```json
{
  "data": {
    "errors": [],
    "id": 1,
    "page_count": "example",
    "source_url": "example",
    "status": "VALIDATING",
    "valid_pod_package_ids": []
  }
}
```

### Get print job

Retrieve a single Print-Job.

**Inputs**

- Id (`id`, text, required): Id of the resource

**Outputs**

- `data` (object): The response from Lulu.

**Example output**

```json
{
  "data": {
    "child_job_ids": [],
    "items": [],
    "line_items": [],
    "parent_job_id": 1.0
  }
}
```

### Get print job costs

Retrieve Print-Job Costs.

**Inputs**

- Id (`id`, text, required): Id of the resource

**Outputs**

- `data` (object): The response from Lulu.

**Example output**

```json
{
  "data": {
    "currency": "example",
    "fees": [],
    "fulfillment_cost": {
      "tax_rate": "example",
      "total_cost_excl_tax": "example",
      "total_cost_incl_tax": "example",
      "total_tax": "example"
    },
    "line_item_costs": [],
    "shipping_cost": {
      "tax_rate": "example",
      "total_cost_excl_tax": "example",
      "total_cost_incl_tax": "example",
      "total_tax": "example"
    },
    "total_cost_excl_tax": "example",
    "total_cost_incl_tax": "example",
    "total_discount_amount": "example",
    "total_tax": "example"
  }
}
```

### Get print job statistics

Retrieve the number of Print-Jobs in each status.

**Inputs**

- Page (`page`, number): Result page, default: 1
- Page size (`page_size`, number): The default is 100.
- Created after (`created_after`, text): Filter by creation timestamp after the given ([ISO 8601](https://www.w3.org/TR/NOTE-datetime)) timestamp.
- Created before (`created_before`, text): Filter by creation timestamp before the given ([ISO 8601](https://www.w3.org/TR/NOTE-datetime)) timestamp.
- Modified after (`modified_after`, text): Filter by modification timestamp after the given ([ISO 8601](https://www.w3.org/TR/NOTE-datetime)) timestamp.
- Modified before (`modified_before`, text): Filter by modification timestamp before the given ([ISO 8601](https://www.w3.org/TR/NOTE-datetime)) timestamp.
- Status (`status`, text): Filter by status
- Id (`id`, text): Filter by id
- Ordering (`ordering`, text): Which field to use when ordering the results.

**Outputs**

- `data` (object): The response from Lulu.

**Example output**

```json
{
  "data": {
    "count": 1.0,
    "status": "CREATED"
  }
}
```

### Get print job status

Retrieve Print-Job Status.

**Inputs**

- Id (`id`, text, required): Id of the resource

**Outputs**

- `data` (object): The response from Lulu.

**Example output**

```json
{
  "data": {
    "changed": "example",
    "message": "example",
    "name": "CREATED"
  }
}
```

### List print jobs

Retrieve a list of Print-Jobs.

**Inputs**

- Page (`page`, number): Result page, default: 1
- Page size (`page_size`, number): The default is 100.
- Created after (`created_after`, text): Filter by creation timestamp after the given ([ISO 8601](https://www.w3.org/TR/NOTE-datetime)) timestamp.
- Created before (`created_before`, text): Filter by creation timestamp before the given ([ISO 8601](https://www.w3.org/TR/NOTE-datetime)) timestamp.
- Modified after (`modified_after`, text): Filter by modification timestamp after the given ([ISO 8601](https://www.w3.org/TR/NOTE-datetime)) timestamp.
- Modified before (`modified_before`, text): Filter by modification timestamp before the given ([ISO 8601](https://www.w3.org/TR/NOTE-datetime)) timestamp.
- Status (`status`, text): Filter by status
- Id (`id`, text): Filter by id
- Order ID (`order_id`, text): Filter by order_id
- Exclude line items (`exclude_line_items`, true/false): Leave the list of line_items out of the Print-Jobs in the response.
- Search (`search`, text): Search across the fields `id`, `external_id`, `order_id`, `status`, `line_item_id`, `line_item_external_id`, `line_item_title`, `line_item_tracking_id` and `shipping_address`
- Ordering (`ordering`, text): Which field to use when ordering the results.

**Outputs**

- `data` (object): The response from Lulu.

**Example output**

```json
{
  "data": {
    "count": 1,
    "next": "example",
    "previous": "example",
    "results": []
  }
}
```

### List shipping options

Retrieve List of Shipping Options.

**Inputs**

- Currency (`currency`, text): Currency to base cost calculations on, defaults to USD. Available currencies are AUD, CAD, EUR, GBP, and USD.
- Line items (`line_items`, list, required): The line items that should be calculated
- Country (`country`, text, required): [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country code
- City (`city`, text): City.
- Is business (`is_business`, true/false): Only relevant for US addresses. Some US carriers don't deliver to business-addresses on Saturday. Default: `false`.
- Is postbox (`is_postbox`, true/false): Is postbox. Default: `false`.
- Name (`name`, text): Full name of the person, including first and last name.
- Organization (`organization`, text): Name of an organization. Required if no person name is given.
- Phone number (`phone_number`, text): Validation Regex Pattern: `^\+?[\d\s\-.\/()]{8,20}$`
- Postcode (`postcode`, text): Postcode.
- State (`state`, text): 2 or 3 letter state codes (officially called [ISO-3166-2 subdivision codes](https://en.wikipedia.org/wiki/ISO_3166-2)).
- Street1 (`street1`, text): First address line
- Street2 (`street2`, text): Second address line

**Outputs**

- `data` (list): The response from Lulu.

**Example output**

```json
{
  "data": []
}
```

### Validate cover PDF

Validate cover file.

**Inputs**

- Source url (`source_url`, text, required): Public url of the cover source file
- Pod package ID (`pod_package_id`, text, required): POD Package ID of the book.
- Interior page count (`interior_page_count`, number, required): Interior page count.

**Outputs**

- `data` (object): The response from Lulu.

**Example output**

```json
{
  "data": {
    "errors": [],
    "id": 1,
    "source_url": "example",
    "status": "NORMALIZING"
  }
}
```

### Validate interior PDF

Validate interior file.

**Inputs**

- Source url (`source_url`, text, required): Public url of the interior source file
- Pod package ID (`pod_package_id`, text): POD Package ID of the book. Required to run extended validation.

**Outputs**

- `data` (object): The response from Lulu.

**Example output**

```json
{
  "data": {
    "errors": [],
    "id": 1,
    "page_count": "example",
    "source_url": "example",
    "status": "VALIDATING",
    "valid_pod_package_ids": []
  }
}
```
