Lob.com Booklets API

The Booklets API from Lob.com — 2 operation(s) for booklets.

OpenAPI Specification

lobcom-booklets-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Lob Booklets API
  version: 1.22.0
  description: 'The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p>

    '
  license:
    name: MIT
    url: https://mit-license.org/
  contact:
    name: Lob Developer Experience
    url: https://support.lob.com/
    email: lob-openapi@lob.com
  termsOfService: https://www.lob.com/legal
servers:
- url: https://api.lob.com/v1
  description: production
security:
- basicAuth: []
tags:
- name: Booklets
paths:
  /booklets/{booklet_id}:
    parameters:
    - in: path
      name: booklet_id
      description: id of the booklet
      required: true
      schema:
        $ref: '#/components/schemas/booklet_id'
    get:
      operationId: booklet_retrieve
      summary: Retrieve
      description: Retrieves the details of an existing booklet. You need to only supply the unique booklet identifier that was returned upon booklet creation.
      tags:
      - Booklets
      responses:
        '200':
          description: Returns a booklet object
          content:
            $ref: '#/components/mediaTypes/booklet'
        default:
          $ref: '#/components/responses/mailpiece_error'
      x-codeSamples:
      - lang: Shell
        source: "curl -X GET \"https://api.lob.com/v1/booklets/ord_0d6a16a3fff6318ac8f8008dc1\" \\\n  -u REDACTED_LOB_KEY:\n"
        label: CURL
    delete:
      operationId: booklet_delete
      summary: Delete
      description: Completely removes a booklet from production. This can only be done if the booklet's `send_date` has not yet passed. If the booklet is successfully canceled, you will not be charged for it.
      tags:
      - Booklets
      responses:
        '200':
          $ref: '#/components/responses/booklet_deleted'
        default:
          $ref: '#/components/responses/mailpiece_error'
      x-codeSamples:
      - lang: Shell
        source: "curl -X DELETE https://api.lob.com/v1/booklets/ord_0d6a16a3fff6318ac8f8008dc1 \\\n  -u REDACTED_LOB_KEY:\n"
        label: CURL
  /booklets:
    get:
      operationId: booklets_list
      summary: List
      description: Returns a list of your booklets. The booklets are returned sorted by creation date, with the most recently created booklets appearing first.
      tags:
      - Booklets
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/before_after'
      - $ref: '#/components/parameters/include'
      - $ref: '#/components/parameters/date_created'
      - $ref: '#/components/parameters/metadata'
      - $ref: '#/components/parameters/send_date'
      - $ref: '#/components/parameters/mail_type'
      - $ref: '#/components/parameters/sort_by'
      - $ref: '#/components/parameters/campaign_id'
      - $ref: '#/components/parameters/status'
      responses:
        '200':
          $ref: '#/components/responses/all_booklets'
        default:
          $ref: '#/components/responses/mailpiece_error'
      x-codeSamples:
      - lang: Shell
        source: "curl -X GET \"https://api.lob.com/v1/booklets?limit=2\" \\\n  -u REDACTED_LOB_KEY:\n"
        label: CURL
    post:
      operationId: booklet_create
      summary: Create
      description: Creates a new booklet.
      tags:
      - Booklets
      parameters:
      - $ref: '#/components/parameters/idem-header'
      - $ref: '#/components/parameters/idem-query'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/booklet_editable'
            example:
              description: demo
              to:
                description: Harry - Office
                name: Harry Zhang
                company: Lob
                email: harry@lob.com
                phone: '5555555555'
                address_line1: 210 King St
                address_line2: '# 6100'
                address_city: San Francisco
                address_state: CA
                address_zip: '94107'
                address_country: US
              from:
                name: Harry
                address_line1: 210 King St
                address_line2: '# 6100'
                address_city: San Francisco
                address_state: CA
                address_zip: '94107'
              file: '<html style=''padding-top: 3in; margin: .5in;''>HTML Booklet for {{name}}</html>'
              mail_type: usps_first_class
              merge_variables:
                name: Harry
              metadata:
                spiffy: 'true'
              send_date: '2017-11-01T00:00:00.000Z'
              use_type: marketing
              qr_code:
                position: relative
                redirect_url: https://www.lob.com
                width: '2'
                top: '2'
                right: '2'
                pages: 1-2,4-5
              fsc: true
              size: 8.375x5.375
              print_speed: core
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/booklet_editable'
            example:
              description: demo
              to:
                description: Harry - Office
                name: Harry Zhang
                company: Lob
                email: harry@lob.com
                phone: '5555555555'
                address_line1: 210 King St
                address_line2: '# 6100'
                address_city: San Francisco
                address_state: CA
                address_zip: '94107'
                address_country: US
              from:
                name: Harry
                address_line1: 210 King St
                address_line2: '# 6100'
                address_city: San Francisco
                address_state: CA
                address_zip: '94107'
              file: '<html style=''padding-top: 3in; margin: .5in;''>HTML Booklet for {{name}}</html>'
              mail_type: usps_first_class
              merge_variables:
                name: Harry
              metadata:
                spiffy: 'true'
              send_date: '2017-11-01T00:00:00.000Z'
              use_type: marketing
              qr_code:
                position: relative
                redirect_url: https://www.lob.com
                width: '2'
                top: '2'
                right: '2'
                pages: 1-2,4-5
              fsc: true
              size: 8.375x5.375
              print_speed: core
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/booklet_editable'
            example:
              description: demo
              to:
                description: Harry - Office
                name: Harry Zhang
                company: Lob
                email: harry@lob.com
                phone: '5555555555'
                address_line1: 210 King St
                address_line2: '# 6100'
                address_city: San Francisco
                address_state: CA
                address_zip: '94107'
                address_country: US
              from:
                name: Harry
                address_line1: 210 King St
                address_line2: '# 6100'
                address_city: San Francisco
                address_state: CA
                address_zip: '94107'
              file: '<html style=''padding-top: 3in; margin: .5in;''>HTML Booklet for {{name}}</html>'
              mail_type: usps_first_class
              merge_variables:
                name: Harry
              metadata:
                spiffy: 'true'
              send_date: '2017-11-01T00:00:00.000Z'
              use_type: marketing
              qr_code:
                position: relative
                redirect_url: https://www.lob.com
                width: '2'
                top: '2'
                right: '2'
                pages: 1-2,4-5
              fsc: true
              size: 8.375x5.375
              print_speed: core
      responses:
        '200':
          $ref: '#/components/responses/post_booklet'
        default:
          $ref: '#/components/responses/mailpiece_error'
      x-codeSamples:
      - lang: Shell
        source: "curl https://api.lob.com/v1/booklets \\\n  -u YOUR_API_KEY \\\n  -d 'description=Demo Booklet' \\\n  -d 'to[name]=Harry Zhang' \\\n  -d 'to[address_line1]=210 King St' \\\n  -d 'to[address_line2]=# 6100' \\\n  -d 'to[address_city]=San Francisco' \\\n  -d 'to[address_state]=CA' \\\n  -d 'to[address_zip]=94107' \\\n  -d 'from=adr_210a8d4b0b76d77b' \\\n  --data-urlencode 'file=<html style=\"padding-top: 3in; margin: .5in;\">HTML Booklet for {{name}}</html>' \\\n  -d 'merge_variables[name]=Harry' \\\n  -d 'qr_code[position]=relative' \\\n  -d 'qr_code[redirect_url]=https://www.lob.com' \\\n  -d 'qr_code[width]=2' \\\n  -d 'qr_code[bottom]=2' \\\n  -d 'qr_code[left]=2' \\\n  -d 'qr_code[pages]=3,4-5' \\\n  -d 'fsc=true' \\\n  -d 'print_speed=core'\n"
        label: CURL
components:
  schemas:
    thumbnail:
      type: object
      properties:
        small:
          $ref: '#/components/schemas/signed_link'
        medium:
          $ref: '#/components/schemas/signed_link'
        large:
          $ref: '#/components/schemas/signed_link'
    mail_type:
      type: string
      enum:
      - usps_first_class
      - usps_standard
      description: 'A string designating the mail postage type:

        * `usps_first_class` - (default)

        * `usps_standard` - a <a href="https://lob.com/pricing/print-mail#compare" target="_blank">cheaper option</a> which is

        less predictable and takes longer to deliver. `usps_standard` cannot be used with `4x6`

        postcards or for any postcards sent outside of the United States.

        '
      default: usps_first_class
    metadata:
      type: object
      additionalProperties:
        type: string
      description: 'Use metadata to store custom information for tagging and labeling back to your internal systems. Must be an object with up to 20 key-value pairs. Keys must be at most 40 characters and values must be at most 500 characters. Neither can contain the characters `"` and `\`. i.e. ''{"customer_id" : "NEWYORK2015"}'' Nested objects are not supported.  See [Metadata](#section/Metadata) for more information.'
      maxLength: 500
      pattern: '[^"\\]{0,500}'
    inline_address_intl:
      allOf:
      - $ref: '#/components/schemas/address_editable_intl'
      - type: object
        required:
        - address_line1
        - address_country
      - type: object
        oneOf:
        - required:
          - address_city
          - address_state
        - required:
          - address_zip
    booklet:
      allOf:
      - type: object
        properties:
          tracking_events:
            description: An array of tracking events ordered by ascending `time`.
            type: array
            items:
              $ref: '#/components/schemas/tracking_event_normal'
          description:
            $ref: '#/components/schemas/resource_description'
          metadata:
            $ref: '#/components/schemas/metadata'
          merge_variables:
            $ref: '#/components/schemas/merge_variables'
          send_date:
            $ref: '#/components/schemas/send_date'
          mail_type:
            $ref: '#/components/schemas/mail_type'
      - $ref: '#/components/schemas/booklet_generated_base'
    booklet_deletion:
      description: Lob uses RESTful HTTP response codes to indicate success or failure of an API request. In general, 2xx indicates success, 4xx indicate an input error, and 5xx indicates an error on Lob's end.
      properties:
        id:
          $ref: '#/components/schemas/booklet_id'
        deleted:
          $ref: '#/components/schemas/deleted'
    print_speed:
      type:
      - string
      - 'null'
      enum:
      - core
      description: 'A string designating the mail speed type:

        * `core` - 2 production business days

        '
      default: core
    failure_reason_error:
      type: object
      description: Failure error details
      properties:
        url:
          type:
          - string
          - 'null'
          description: Failed URL of asset
        host:
          type:
          - string
          - 'null'
          description: URL host
        path:
          type:
          - string
          - 'null'
          description: URL path
        protocol:
          type:
          - string
          - 'null'
          description: Network protocol
        remediation:
          type:
          - string
          - 'null'
          description: Instructions on how to resolve the error
        error_type:
          type:
          - string
          - 'null'
          description: HTTP response status code message or service defined error
        status_code:
          type:
          - number
          - 'null'
          description: HTTP response status codes if the error is asset related
    address_editable_us:
      allOf:
      - $ref: '#/components/schemas/address_fields_us'
      - type: object
        anyOf:
        - title: address obj with `name` defined
          required:
          - name
        - title: address obj with `company` defined
          required:
          - company
        properties:
          description:
            $ref: '#/components/schemas/resource_description'
          name:
            type:
            - string
            - 'null'
            description: 'Either `name` or `company` is required, you may also add both. Must be no longer than 40 characters. If both `name` and `company` are provided, they will be printed on two separate lines above the rest of the address.

              '
            maxLength: 40
          company:
            $ref: '#/components/schemas/company'
          phone:
            type:
            - string
            - 'null'
            description: Must be no longer than 40 characters.
            maxLength: 40
          email:
            type:
            - string
            - 'null'
            description: Must be no longer than 100 characters.
            maxLength: 100
          address_country:
            type: string
            enum:
            - US
            default: US
          metadata:
            $ref: '#/components/schemas/metadata'
    adr_id:
      type: string
      description: Unique identifier prefixed with `adr_`.
      pattern: ^adr_[a-zA-Z0-9]+$
    tmpl_id:
      type: string
      description: Unique identifier prefixed with `tmpl_`. ID of a saved [HTML template](#section/HTML-Templates).
      pattern: ^tmpl_[a-zA-Z0-9]+$
    country_extended:
      type: string
      description: Must be a 2 letter country short-name code (ISO 3166). Does not accept `US`, `AS`, `PR`, `FM`, `GU`, `MH`, `MP`, `PW`, or `VI`. For these addresses, please use the US verification API. Also does not accept `PS`, which is not currently supported.
      enum:
      - AD
      - AE
      - AF
      - AG
      - AI
      - AL
      - AN
      - AO
      - AQ
      - AR
      - AT
      - AU
      - AW
      - AZ
      - BA
      - BB
      - BD
      - BE
      - BF
      - BG
      - BH
      - BI
      - BJ
      - BM
      - BN
      - BO
      - BQ
      - BR
      - BS
      - BT
      - BW
      - BY
      - BZ
      - CA
      - CD
      - CG
      - CH
      - CI
      - CK
      - CL
      - CM
      - CN
      - CO
      - CR
      - CS
      - CU
      - CV
      - CW
      - CY
      - CZ
      - DE
      - DJ
      - DK
      - DM
      - DO
      - DZ
      - EC
      - EE
      - EG
      - EH
      - ER
      - ES
      - ET
      - FI
      - FJ
      - FK
      - FO
      - FR
      - GA
      - GB
      - GD
      - GE
      - GH
      - GI
      - GL
      - GM
      - GN
      - GQ
      - GR
      - GS
      - GT
      - GW
      - GY
      - HK
      - HN
      - HR
      - HT
      - HU
      - ID
      - IE
      - IL
      - IN
      - IO
      - IQ
      - IR
      - IS
      - IT
      - JM
      - JO
      - JP
      - KE
      - KG
      - KH
      - KI
      - KM
      - KN
      - KP
      - KR
      - KW
      - KY
      - KZ
      - LA
      - LB
      - LC
      - LI
      - LK
      - LR
      - LS
      - LT
      - LU
      - LV
      - LY
      - MA
      - MC
      - MD
      - ME
      - MG
      - MK
      - ML
      - MM
      - MN
      - MO
      - MR
      - MS
      - MT
      - MU
      - MV
      - MW
      - MX
      - MY
      - MZ
      - NA
      - NE
      - NF
      - NG
      - NI
      - NL
      - 'NO'
      - NP
      - NR
      - NU
      - NZ
      - OM
      - PA
      - PE
      - PG
      - PH
      - PK
      - PL
      - PN
      - PT
      - PY
      - QA
      - RO
      - RS
      - RU
      - RW
      - SA
      - SB
      - SC
      - SD
      - SE
      - SG
      - SH
      - SI
      - SK
      - SL
      - SM
      - SN
      - SO
      - SR
      - SS
      - ST
      - SV
      - SX
      - SY
      - SZ
      - TC
      - TD
      - TG
      - TH
      - TJ
      - TK
      - TL
      - TM
      - TN
      - TO
      - TR
      - TT
      - TV
      - TW
      - TZ
      - UA
      - UG
      - UY
      - UZ
      - VA
      - VC
      - VE
      - VG
      - VN
      - VU
      - WS
      - YE
      - ZA
      - ZM
      - ZW
    tracking_event_base:
      type: object
      description: As mail pieces travel through the mail stream, USPS scans their unique barcodes, and Lob processes these mail scans to generate tracking events.
      required:
      - id
      - date_created
      - date_modified
      - object
      properties:
        id:
          $ref: '#/components/schemas/evnt_id'
        time:
          type: string
          format: date-time
          description: A timestamp in ISO 8601 format of the date USPS registered the event.
        date_created:
          $ref: '#/components/schemas/date_created'
        date_modified:
          $ref: '#/components/schemas/date_modified'
        object:
          allOf:
          - $ref: '#/components/schemas/object'
          - type: string
            enum:
            - tracking_event
            default: tracking_event
    booklet_pages:
      description: Pages specifies the total number of pages in a booklet, where four pages make up one sheet. Pages must always be in increments of four to maintain booklet integrity. For a booklet with dimensions of 8.375x5.375 inches, we allow for 8, 12, 16, 20, 24, 28, or 32 pages.
      type: integer
    lob_base:
      type: object
      required:
      - date_created
      - date_modified
      - object
      properties:
        date_created:
          $ref: '#/components/schemas/date_created'
        date_modified:
          $ref: '#/components/schemas/date_modified'
        deleted:
          $ref: '#/components/schemas/deleted'
        object:
          $ref: '#/components/schemas/object'
    remote_file_url:
      type: string
      description: 'The location of a remote file. Remote URLs have a 5 MB file size limit and must be downloaded within 40 seconds.

        '
      pattern: ^https://[-a-zA-Z0-9@:%._+~#=/]{1,256}.(html?|pdf|png|jpg)$
    inline_address:
      oneOf:
      - $ref: '#/components/schemas/inline_address_us'
      - $ref: '#/components/schemas/inline_address_intl'
    from:
      type: object
      properties:
        from:
          $ref: '#/components/schemas/address'
    billing_group_id:
      type: string
      description: An optional string with the billing group ID to tag your usage with. Is used for billing purposes. Requires special activation to use. See <a href="#tag/Billing-Groups">Billing Group API</a> for more information.
    input_to:
      type: object
      properties:
        to:
          description: 'Must either be an address ID or an inline object with correct address parameters. If an object is used, an address will be created, corrected, and standardized for free whenever possible using our US Address Verification engine (if it is a US address), and returned back with an ID. Depending on your <a href="https://dashboard.lob.com/#/settings/editions" target="_blank">Print & Mail Edition</a>, US addresses may also be run through <a href="#tag/National-Change-of-Address">National Change of Address Linkage(NCOALink)</a>. Non-US addresses will be standardized into uppercase only. If a US address used does not meet your account’s <a href="https://dashboard.lob.com/#/settings/account" target="_blank">US Mail strictness setting</a>, the request will fail. <a href="https://help.lob.com/print-and-mail/all-about-addresses" target="_blank">Lob Guide: Verification of Mailing Addresses</a>'
          oneOf:
          - $ref: '#/components/schemas/adr_id'
          - $ref: '#/components/schemas/inline_address'
    failure_reason:
      type: object
      description: An object describing the reason for failure if the resource failed to render.
      properties:
        remediation:
          type: string
          description: Instructions on how to resolve the error
        failure_reason:
          type: string
          description: Reason failure occurred
        errors:
          type:
          - array
          - 'null'
          items:
            $ref: '#/components/schemas/failure_reason_error'
    list:
      type: object
      description: Multiple items returned in order
      properties:
        object:
          $ref: '#/components/schemas/object'
        next_url:
          type:
          - string
          - 'null'
          description: Url of next page of items in list.
        previous_url:
          type:
          - string
          - 'null'
          description: Url of previous page of items in list.
        count:
          $ref: '#/components/schemas/count'
        total_count:
          type: integer
          description: Indicates the total number of records. Provided when the request specifies an "include" query parameter
    date_filter:
      type: object
      additionalProperties:
        type: string
      description: 'Filter by ISO-8601 date or datetime, e.g. `{ "gt": "2012-01-01", "lt": "2012-01-31T12:34:56Z" }` where `gt` is >, `lt` is <, `gte` is ≥, and `lte` is ≤.'
    booklet_file:
      description: 'Notes:

        - HTML merge variables should not include delimiting whitespace.

        - All pages of a supplied PDF file must be sized per the `size` attribute, while supplied HTML will be rendered and trimmed to as many `size` pages as necessary.

        - For design specifications, please see our <a href="https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/letter_template.pdf" target="_blank">PDF</a> and [HTML](#section/HTML-Examples) templates.

        See <a href="https://lob.com/pricing/print-mail#compare" target="_blank">pricing</a> for extra costs incurred.'
      oneOf:
      - $ref: '#/components/schemas/html_string'
      - $ref: '#/components/schemas/tmpl_id'
      - $ref: '#/components/schemas/remote_file_url'
      - type: string
        pattern: ^(?!https://)[a-zA-Z0-9@:%._+~#=/]{1,256}.(html?|pdf)$
    html_string:
      type: string
      description: An HTML string of under 10,000 characters.
      maxLength: 10000
      pattern: <
    booklet_source_material:
      type: string
      enum:
      - 60# Gloss Text
      description: Defines the material used to create the mail piece, specifically for booklets.  This property is directly tied to the size of the booklet, ensuring that the appropriate material is selected based on the booklet's dimensions. For booklets with `size` equal to `8.375x5.375` inches, the default source material is `60# Gloss Text`.
      default: 60# Gloss Text
    address_fields_intl:
      type: object
      required:
      - address_line1
      - address_country
      properties:
        address_line1:
          type: string
          description: The primary number, street name, and directional information.
          maxLength: 200
        address_line2:
          type:
          - string
          - 'null'
          description: An optional field containing any information which can't fit into line 1.
          maxLength: 200
        address_city:
          type:
          - string
          - 'null'
          maxLength: 200
        address_state:
          type:
          - string
          - 'null'
          maxLength: 200
        address_zip:
          type:
          - string
          - 'null'
          description: Optional postal code.
          maxLength: 40
    merge_variables:
      type:
      - object
      - 'null'
      description: 'You can input a merge variable payload object to your template or QR code redirect URLs to render dynamic content. For example, if you have a template like: `{{variable_name}}`, pass in `{"variable_name": "Harry"}` to render `Harry`. `merge_variables` must be an object. Any type of value is accepted as long as the object is valid JSON; you can use `strings`, `numbers`, `booleans`, `arrays`, `objects`, or `null`. The max length of the object is 25,000 characters. If you call `JSON.stringify` on your object, it can be no longer than 25,000 characters. Your variable names cannot contain any whitespace or any of the following special characters: `!`, `"`, `#`, `%`, `&`, `''`, `(`, `)`, `*`, `+`, `,`, `/`, `;`, `<`, `=`, `>`, `@`, `[`, `\`, `]`, `^`, `` ` ``, `{`, `|`, `}`, `~`. More instructions can be found in <a href="https://help.lob.com/print-and-mail/designing-mail-creatives/dynamic-personalization#using-html-and-merge-variables-10" target="_blank">our guide to using html and merge variables</a>. Depending on your <a href="https://dashboard.lob.com/#/settings/account" target="_blank">Merge Variable strictness</a> setting, if you define variables in your HTML but do not pass them here, you will either receive an error or the variable will render as an empty string. These settings only apply on HTML templates and not on QR code redirect URLs.'
      maxLength: 25000
    address:
      oneOf:
      - $ref: '#/components/schemas/address_us'
      - $ref: '#/components/schemas/address_intl'
    booklet_editable:
      allOf:
      - $ref: '#/components/schemas/input_to'
      - $ref: '#/components/schemas/input_from'
      - $ref: '#/components/schemas/editable'
      - type: object
        required:
        - to
        - from
        - file
        - use_type
        - pages
        - size
        properties:
          file:
            $ref: '#/components/schemas/booklet_file'
          mail_type:
            $ref: '#/components/schemas/mail_type'
          billing_group_id:
            $ref: '#/components/schemas/billing_group_id'
          qr_code:
            $ref: '#/components/schemas/qr_code'
          use_type:
            $ref: '#/components/schemas/booklet_use_type'
          fsc:
            type: boolean
            description: This is in beta. Contact support@lob.com or your account contact to learn more. Not available for `A4` and `us_legal` letter size.
            default: false
          size:
            $ref: '#/components/schemas/booklet_size'
          pages:
            $ref: '#/components/schemas/booklet_pages'
          source_material:
            $ref: '#/components/schemas/booklet_source_material'
          print_speed:
            $ref: '#/components/schemas/print_speed'
    vrsn_id:
      type: string
      description: Unique identifier prefixed with `vrsn_`.
      pattern: ^vrsn_[a-zA-Z0-9]+$
    booklet_use_type:
      description: The use type for each mailpiece. Can be one of marketing, operational, or null. Null use_type is only allowed if an account default use_type is selected in Account Settings. For more information on use_type, see our  [Help Center article](https://help.lob.com/print-and-mail/building-a-mail-strategy/managing-mail-settings/declaring-mail-use-type).
      type:
      - string
      - 'null'
      enum:
      - marketing
      - operational
      - null
    failure_status_code:
      type: integer
      enum:
      - 401
      - 403
      - 404
      - 413
      - 422
      - 429
      - 500
      description: "A conventional HTTP status code:\n  * `401` - Authorization error with your API key or account\n  * `403` - Forbidden error with your API key or account\n  * `404` - The requested item does not exist\n  * `413` - Payload too large\n  * `422` - The query or body parameters did not pass validation\n  * `429` - Too many requests have been sent with an API key in a given amount of time\n  * `500` - An internal server error occurred, please contact support@lob.com\n"
    generated:
      type: object
      required:
      - to
      - carrier
      properties:
        to:
          $ref: '#/components/schemas/address'
        carrier:
          type: string
          enum:
          - USPS
          default: USPS
        thumbnails:
          type: array
          items:
            $ref: '#/components/schemas/thumbnail'
        expected_delivery_date:
          $ref: '#/components/schemas/expected_delivery_date'
        date_created:
          $ref: '#/components/schemas/date_created'
        date_modified:
          $ref: '#/components/schemas/date_modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    inline_address_us:
      allOf:
      - $ref: '#/components/schemas/address_editable_us'
      - type: object
        required:
        - address_line1
        - address_city
        - address_state
        - address_zip
    status:
      type: string
      enum:
      - processed
      - rendered
      - failed
      description: 'A string describing the PDF render status:

        * `processed` - the rendering process is currently in progress.

        * `rendered` - a PDF has been successfully rendered of the mailpiece.

        * `failed` - one or more issues has caused the rendering process to fail.

        '
    evnt_id:
      type: string
      description: Unique identifier prefixed with `evnt_`.
      pattern: ^evnt_[a-zA-Z0-9]+$
    booklet_generated_base:
      allOf:
      - $ref: '#/components/schemas/generated'
      - $ref: '#/components/schemas/from'
      - type: object
        required:
        - id
        - from
        - use_type
        properties:
          url:
            $ref: '#/components/schemas/signed_link'
          id:
            $ref: '#/components/schemas/booklet_id'
          template_id:
            allOf:
            - description: The unique ID of the HTML template used for the booklet.
            - $ref: '#/components/schemas/tmpl_id'
          template_version_id:
            allOf:
            - description: The unique ID of the specific version of the HTML template used for the booklet.
              type: string
            - $ref: '#/components/schemas/vrsn_id'
          campaign_id:
            $ref: '#/components/schemas/campaign_id'
          use_type:
            $ref: '#/components/schemas/booklet_use_type'
          size:
            $ref: '#/components/schemas/booklet_size'
          pages:
            $ref: '#/components/schemas/booklet_pages'
          fsc:
            type: boolean
            description: This is in beta. Contact support@lob.com or your account contact to learn more.
            default: false
          status:
            $ref: '#/components/schemas/status'
          source_material:
            $ref: '#/components/schemas/booklet_source_material'
          failure_reason:
            type:
            - object
            - 'null'
            allOf:
            - $ref: '#/components/schemas/failure_reason'
          object:
            type: string
            description: Value is resource type.
            enum:
            - booklet
            default: booklet
    booklet_id:
      type: string
      description: Unique identifier prefixed with `ord_`.
      pattern: ^ord_[0-9a-f]{26}$
    input_from:
      type: object
      properties:
        from:
          description: Must either be an address ID or an inline object with correct address parameters. Must be a US address unless using a `custom_envelope`. All addresses will be standardized into uppercase without being modified by verification.
          oneOf:
          - $ref: '#/components/schemas/adr_id'
          - $ref: '#/components/schemas/inline_address'
    qr_code:
      type: object
      description: Customize and place a QR code on the creative at the required position.
      required:
      - position
      - redirect_url
      - width
      properties:
        position:
          type: string
          enum:
          - relative
          description: Sets how a QR code is being pos

# --- truncated at 32 KB (81 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/lobcom/refs/heads/main/openapi/lobcom-booklets-api-openapi.yml