Lob.com Snap Packs API
The Snap Packs API from Lob.com — 2 operation(s) for snap packs.
The Snap Packs API from Lob.com — 2 operation(s) for snap packs.
openapi: 3.2.0
info:
title: Lob Snap Packs 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: Snap Packs
paths:
/snap_packs/{snap_pack_id}:
parameters:
- in: path
name: snap_pack_id
description: id of the snap_pack
required: true
schema:
$ref: '#/components/schemas/snap_pack_id'
get:
operationId: snap_pack_retrieve
summary: Retrieve
description: Retrieves the details of an existing snap_pack. You need to only supply the unique snap_pack identifier that was returned upon snap_pack creation.
tags:
- Snap Packs
responses:
'200':
description: Returns a snap_pack object
content:
$ref: '#/components/mediaTypes/snap_pack'
default:
$ref: '#/components/responses/mailpiece_error'
x-codeSamples:
- lang: Shell
source: "curl -X GET \"https://api.lob.com/v1/snap_packs/ord_0d6a16a3fff6318ac8f8008dc1\" \\\n -u REDACTED_LOB_KEY:\n"
label: CURL
- lang: typescript
source: "try {\n const snapPack = await new SnapPacksApi(config).get('ord_xxxx');\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: "Lob.snapPacks.retrieve('ord_0d6a16a3fff6318ac8f8008dc1', function (err, res) {\n console.log(err, res);\n});\n"
label: NODE
- lang: Ruby
source: "snapPackApi = SnapPacksApi.new(config)\n\nbegin\n retrievedSnapPack = snapPackApi.get(\"ord_0d6a16a3fff6318ac8f8008dc1\")\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Python
source: "with ApiClient(configuration) as api_client:\n api = SnapPacksApi(api_client)\n\ntry:\n snap_pack = api.get(\"ord_0d6a16a3fff6318ac8f8008dc1\")\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: PHP
source: "$apiInstance = new OpenAPI\\Client\\Api\\SnapPacksApi($config, new GuzzleHttp\\Client());\n\ntry {\n $result = $apiInstance->get(\"ord_0d6a16a3fff6318ac8f8008dc1\");\n} catch (Exception $e) {\n echo $e->getMessage(), PHP_EOL;\n}\n"
- lang: Java
source: "SnapPacksApi apiInstance = new SnapPacksApi(config);\n\ntry {\n SnapPack response = apiInstance.get(\"ord_0d6a16a3fff6318ac8f8008dc1\");\n} catch (ApiException e) {\n e.printStackTrace();\n}\n"
label: JAVA
- lang: Elixir
source: 'Lob.SnapPack.find("ord_0d6a16a3fff6318ac8f8008dc1")
'
label: ELIXIR
- lang: CSharp
source: "SnapPacksApi api = new SnapPacksApi(config);\n\ntry {\n SnapPack response = api.get(\"ord_0d6a16a3fff6318ac8f8008dc1\");\n} catch (ApiException e) {\n Console.WriteLine(e.ToString());\n}\n"
label: CSHARP
- lang: Go
source: "var context = context.Background()\ncontext = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv(\"<YOUR_API_KEY>\")})\n\nvar apiClient = *lob.NewAPIClient(configuration)\n\nfetchedSnapPack, _, err := apiClient.SnapPacksApi.Get(context,\"ord_0d6a16a3fff6318ac8f8008dc1\").Execute()\n\nif err != nil {\n return err\n}\n"
label: GO
delete:
operationId: snap_pack_delete
summary: Delete
description: Completely removes a snap pack from production. This can only be done if the snap pack's `send_date` has not yet passed. If the snap pack is successfully canceled, you will not be charged for it.
tags:
- Snap Packs
responses:
'200':
$ref: '#/components/responses/snap_pack_deleted'
default:
$ref: '#/components/responses/mailpiece_error'
x-codeSamples:
- lang: Shell
source: "curl -X DELETE https://api.lob.com/v1/snap_packs/ord_0d6a16a3fff6318ac8f8008dc1 \\\n -u REDACTED_LOB_KEY:\n"
label: CURL
- lang: typescript
source: "try {\n const deleteSnapPack = await new SnapPacksApi(config).delete('ord_xxxx');\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: "Lob.snapPacks.delete('ord_0d6a16a3fff6318ac8f8008dc1', function (err, res) {\n console.log(err, res);\n});\n"
label: NODE
- lang: Ruby
source: "snapPackApi = SnapPacksApi.new(config)\n\nbegin\n deletedSnapPack = snapPackApi.delete(\"ord_0d6a16a3fff6318ac8f8008dc1\")\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Python
source: "with ApiClient(configuration) as api_client:\n api = SnapPacksApi(api_client)\n\ntry:\n deleted_resource = api.delete(\"ord_0d6a16a3fff6318ac8f8008dc1\")\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: PHP
source: "$apiInstance = new OpenAPI\\Client\\Api\\SnapPacksApi($config, new GuzzleHttp\\Client());\n\ntry {\n $result = $apiInstance->delete(\"ord_0d6a16a3fff6318ac8f8008dc1\");\n} catch (Exception $e) {\n echo $e->getMessage(), PHP_EOL;\n}\n"
- lang: Java
source: "SnapPacksApi apiInstance = new SnapPacksApi(config);\n\ntry {\n SnapPackDeletion response = apiInstance.delete(\"ord_0d6a16a3fff6318ac8f8008dc1\");\n} catch (ApiException e) {\n e.printStackTrace();\n}\n"
label: JAVA
- lang: Elixir
source: 'Lob.SnapPack.destroy("ord_0d6a16a3fff6318ac8f8008dc1")
'
label: ELIXIR
- lang: CSharp
source: "SnapPacksApi api = new SnapPacksApi(config);\n\ntry {\n SnapPackDeletion response = api.delete(\"ord_0d6a16a3fff6318ac8f8008dc1\");\n} catch (ApiException e) {\n Console.WriteLine(e.ToString());\n}\n"
label: CSHARP
- lang: Go
source: "var context = context.Background()\ncontext = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv(\"<YOUR_API_KEY>\")})\n\nvar apiClient = *lob.NewAPIClient(configuration)\n\ndeletedSnapPack, _, err := apiClient.SnapPacksApi.Delete(context, \"ord_0d6a16a3fff6318ac8f8008dc1\").Execute()\n\nif err != nil {\n return err\n}\n"
label: GO
/snap_packs:
get:
operationId: snap_packs_list
summary: List
description: Returns a list of your snap_packs. The snap_packs are returned sorted by creation date, with the most recently created snap_packs appearing first.
tags:
- Snap Packs
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_snap_packs'
default:
$ref: '#/components/responses/mailpiece_error'
x-codeSamples:
- lang: Shell
source: "curl -X GET \"https://api.lob.com/v1/snap_packs?limit=2\" \\\n -u REDACTED_LOB_KEY:\n"
label: CURL
- lang: typescript
source: "try {\n const snapPacks = await new snapPacksApi(config).list(2);\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: "Lob.snapPacks.list({limit: 2}, function (err, res) {\n console.log(err, res);\n});\n"
label: NODE
- lang: Ruby
source: "snapPacksApi = SnapPacksApi.new(config)\n\nbegin\n snapPacks = snapPacksApi.list({ limit: 2 })\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Python
source: "with ApiClient(configuration) as api_client:\n api = SnapPacksApi(api_client)\n\ntry:\n snap_packs = api.list(limit=2)\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: PHP
source: "$apiInstance = new OpenAPI\\Client\\Api\\SnapPacksApi($config, new GuzzleHttp\\Client());\n\ntry {\n $result = $apiInstance->list(\n 2, // limit\n );\n} catch (Exception $e) {\n echo $e->getMessage(), PHP_EOL;\n}\n"
- lang: Java
source: "SnapPacksApi apiInstance = new SnapPacksApi(config);\n\ntry {\n SnapPackList response = apiInstance.list(\n 2, // limit\n null, // before\n null, // after\n null, // include\n null, // dateCreated\n null, // metadata\n null, // size\n null, // scheduled\n null, // sendDate\n null, // mailType\n null // sortBy\n );\n} catch (ApiException e) {\n e.printStackTrace();\n}\n"
label: JAVA
- lang: Elixir
source: 'Lob.SnapPack.list(%{limit: 2})
'
label: ELIXIR
- lang: CSharp
source: "SnapPacksApi api = new SnapPacksApi(config);\n\nList<string> includeList = new List<string>();\nincludeList.Add(\"total_count\");\nDictionary<String, String> metadata = new Dictionary<String, String>();\nmetadata.Add(\"name\", \"Harry\");\nDictionary<String, DateTime> dateCreated = new Dictionary<String, DateTime>();\nDateTime dateCreatedDate = DateTime.Today.AddMonths(-1);\ndateCreated.Add(\"lt\", dateCreatedDate);\nDictionary<String, String> sendDate = new Dictionary<String, String>();\nsendDate.Add(\"lt\", DateTime.Now.ToString(\"yyyy-MM-ddTHH\\\\:mm\\\\:ss.fffffffzzz\"));\nSortBy3 sortBy = new SortBy3(SortBy3.DateCreatedEnum.Asc);\n\ntry {\n SnapPackList response = api.list(\n 2, // limit\n null, // before\n null, // after\n includeList, // include\n dateCreated, // dateCreated\n metadata, // metadata\n null, // size\n true, // scheduled\n sendDate, // sendDate\n MailType.FirstClass, // mailType\n sortBy // sortBy\n );\n} catch (ApiException e) {\n Console.WriteLine(e.ToString());\n}\n"
label: CSHARP
- lang: Go
source: "var context = context.Background()\ncontext = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv(\"<YOUR_API_KEY>\")})\n\nvar apiClient = *lob.NewAPIClient(configuration)\nSnapPackList = apiClient.SnapPacksApi.List(context).Execute()\nif err != nil {\n return err\n}\n"
label: GO
post:
operationId: snap_pack_create
summary: Create
description: Creates a new snap_pack given information
tags:
- Snap Packs
parameters:
- $ref: '#/components/parameters/idem-header'
- $ref: '#/components/parameters/idem-query'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/snap_pack_editable'
example:
description: Demo Snap Pack Job
to: adr_bae820679f3f536b
from: adr_210a8d4b0b76d77b
inside: https://lob.com/snappackinside.pdf
outside: https://lob.com/snappackoutside.pdf
size: 8.5x11
metadata:
spiffy: 'true'
mail_type: usps_standard
merge_variables:
name: Harry
send_date: '2017-11-01T00:00:00.000Z'
use_type: marketing
print_speed: core
multipart/form-data:
schema:
$ref: '#/components/schemas/snap_pack_editable'
example:
description: Demo Snap Pack job
to: adr_bae820679f3f536b
from: adr_210a8d4b0b76d77b
inside: https://lob.com/snappackinside.pdf
outside: https://lob.com/snappackoutside.pdf
size: 8.5x11
metadata:
spiffy: 'true'
mail_type: usps_standard
merge_variables:
name: Harry
send_date: '2017-11-01T00:00:00.000Z'
use_type: marketing
print_speed: core
responses:
'200':
$ref: '#/components/responses/post_snap_pack'
default:
$ref: '#/components/responses/mailpiece_error'
x-codeSamples:
- lang: Shell
source: "curl https://api.lob.com/v1/snap_packs \\\n -u REDACTED_LOB_KEY: \\\n -d \"description=Demo Snap Pack job\" \\\n -d \"to[name]=Harry Zhang\" \\\n -d \"to[address_line1]=210 King St\" \\\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 -d \"use_type=marketing\" \\\n --data-urlencode \"inside=<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>\" \\\n --data-urlencode \"outside=<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>\" \\\n -d \"merge_variables[name]=Harry\" \\\n -d 'fsc=false' \\\n -d 'print_speed=core'\n"
label: CURL
- lang: Typescript
source: "const snapPackCreate = new SnapPackEditable({\n to: {\n name: 'Harry Zhang',\n address_line1: '210 King St',\n address_line2: '# 6100',\n address_city: 'San Francisco',\n address_state: 'CA',\n address_zip: '94107',\n},\n from: 'adr_xxxx',\n inside:\n 'https://s3.us-west-2.amazonaws.com/public.lob.com/assets/8.5x11_Snappack_template_address.pdf',\n outside:\n 'https://s3.us-west-2.amazonaws.com/public.lob.com/assets/8.5x11_Snappack_template_address.pdf',\n use_type: 'marketing'\n fsc: false,\n print_speed: 'core'\n});\n\ntry {\n const mySnapPack = await new SnapPacksApi(config).create(snapPackCreate);\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: "Lob.snapPacks.create({\n description: 'Demo Snap Packs job',\n to: {\n name: 'Harry Zhang',\n address_line1: '210 King St',\n address_city: 'San Francisco',\n address_state: 'CA',\n address_zip: '94107'\n },\n from: 'adr_210a8d4b0b76d77b',\n inside: '<html style=\"padding: 1in; font-size: 50;\">Inside HTML for {{name}}</html>',\n outside: '<html style=\"padding: 1in; font-size: 20;\">Outside HTML for {{name}}</html>',\n merge_variables: {\n name: 'Harry'\n },\n use_type: 'marketing'\n fsc: false,\n print_speed: 'core'\n}, function (err, res) {\n console.log(err, res);\n});\n"
label: NODE
- lang: Ruby
source: "snapPackCreate = SnapPackEditable.new({\n description: \"Demo Snap Pack job\",\n from: \"adr_210a8d4b0b76d77b\",\n inside: \"<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>\",\n outside: \"<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>\",\n to: AddressEditable.new({\n name: \"Harry Zhang\",\n address_line1: \"210 King St\",\n address_line2: \"# 6100\",\n address_city: \"San Francisco\",\n address_state: \"CA\",\n address_zip: \"94107\",\n }),\n merge_variables: {\n name: \"Harry\"\n },\n use_type: 'marketing',\n fsc: true,\n print_speed: \"core\"\n});\n\nsnapPackApi = SnapPacksApi.new(config)\n\nbegin\n createdSnapPack = snapPackApi.create(snapPackCreate)\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Python
source: "snap_pack_editable = SnapPackEditable(\n description = \"Demo Snap Pack job\",\n _from = \"adr_210a8d4b0b76d77b\",\n inside = \"<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>\",\n outside = \"<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>\",\n to = AddressEditable(\n name = \"Harry Zhang\",\n address_line1 = \"210 King St\",\n address_line2 = \"# 6100\",\n address_city = \"San Francisco\",\n address_state = \"CA\",\n address_zip = \"94107\",\n ),\n merge_variables = MergeVariables(\n name = \"Harry\",\n ),\n use_type = \"marketing\",\n fsc = true,\n print_speed = \"core\"\n)\n\nwith ApiClient(configuration) as api_client:\n api = SnapPacksApi(api_client)\n\ntry:\n created_snap_pack = api.create(snap_pack_editable)\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: PHP
source: "$to = new OpenAPI\\Client\\Model\\AddressEditable(\n array(\n \"name\" => \"Harry Zhang\",\n \"address_line1\" => \"210 King St\",\n \"address_line2\" => \"# 6100\",\n \"address_city\" => \"San Francisco\",\n \"address_state\" => \"CA\",\n \"address_zip\" => \"94107\",\n )\n);\n\n$merge_variables = new stdClass;\n$merge_variables->name = \"Harry\";\n\n$use_type = \"marketing\";\n$fsc = true;\n$print_speed = 'core';\n\n$apiInstance = new OpenAPI\\Client\\Api\\SnapPacksApi($config, new GuzzleHttp\\Client());\n$snap_pack_editable = new OpenAPI\\Client\\Model\\SnapPackEditable(\n array(\n \"description\" => \"Demo Snap Pack job\",\n \"from\" => \"adr_210a8d4b0b76d77b\",\n \"inside\" => \"<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>\",\n \"outside\" => \"<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>\",\n \"to\" => $to,\n \"merge_variables\" => $merge_variables,\n \"use_type\" => $use_type,\n \"fsc\" => $fsc,\n \"print_speed\" => \"core\"\n )\n);\n\ntry {\n $result = $apiInstance->create($snap_pack_editable);\n} catch (Exception $e) {\n echo $e->getMessage(), PHP_EOL;\n}\n"
- lang: Java
source: "Map<String, String> merge_variables = new HashMap<String, String>();\nmerge_variables.put(\"name\", \"Harry\");\n\nSnapPacksApi apiInstance = new SnapPacksApi(config);\n\nAddressEditable to = new AddressEditable();\nto.setName(\"Harry Zhang\");\nto.setAddressLine1(\"210 King St\");\nto.setAddressLine2(\"# 6100\");\nto.setAddressCity(\"San Francisco\");\nto.setAddressState(\"CA\");\nto.setAddressZip(\"94107\");\n\ntry {\n SnapPackEditable SnapPackEditable = new SnapPackEditable();\n SnapPackEditable.setDescription(\"Demo Snap Pack job\");\n SnapPackEditable.setFrom(\"adr_210a8d4b0b76d77b\");\n SnapPackEditable.setInside(\"<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>\");\n SnapPackEditable.setOutside(\"<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>\");\n SnapPackEditable.setTo(to);\n SnapPackEditable.setMergeVariables(merge_variables);\n SnapPackEditable.setUseType(\"marketing\");\n SnapPackEditable.setFsc(true);\n SnapPackEditable.setPrintSpeed(\"core\");\n\n\n SnapPack result = apiInstance.create(SnapPackEditable, null);\n} catch (ApiException e) {\n e.printStackTrace();\n}\n"
label: JAVA
- lang: Elixir
source: "Lob.SnapPack.create(%{\n description: \"Demo Snap Pack job\",\n to: %{\n name: \"Harry Zhang\",\n address_line1: \"210 King St\",\n address_city: \"San Francisco\",\n address_state: \"CA\",\n address_zip: \"94107\"\n },\n from: \"adr_210a8d4b0b76d77b\",\n inside: \"<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>\",\n outside: \"<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>\",\n merge_variables: %{\n name: \"Harry\"\n },\n use_type: \"marketing\",\n fsc: true,\n print_speed: 'core'\n})\n"
label: ELIXIR
- lang: CSharp
source: "Dictionary<string, string> mergeVariables = new Dictionary<string, string>();\nmergeVariables.Add(\"name\", \"Harry\");\n\nSnapPacksApi api = new SnapPacksApi(config);\n\nAddressEditable to = new AddressEditable(\n \"210 King St\", // addressLine1\n \"# 6100\", // addressLine2\n \"San Francisco\", // addressCity\n \"CA\", // addressState\n \"94107\", // addressZip\n default(CountryExtended), // addressCounty\n null, // description\n \"Harry Zhang\" // name\n);\n\nFsc fsc = new Fsc(true);\nPrintSpeed printSpeed = new PrintSpeed(\"core\");\n\nSnapPackEditable SnapPackEditable = new SnapPackEditable(\n to.ToJson(), // to\n \"adr_249af768103d2810\", // from\n default(SnapPacksize), // size\n \"Demo Snap Pack Job\", // description\n default(Dictionary<string, string>), // metadata\n default(MailType), // mailType\n mergeVariables, // mergeVariables\n default(DateTime), // sendDate\n \"<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>\", // inside\n \"<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>\", // outside\n \"marketing\", // use_type\n fsc,\n \"core\" // print_speed\n);\n\ntry {\n SnapPack result = api.create(SnapPackEditable, null);\n} catch (ApiException e) {\n Console.WriteLine(e.ToString());\n}\n"
label: CSHARP
- lang: Go
source: "var context = context.Background()\ncontext = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv(\"<YOUR_API_KEY>\")})\n\nvar apiClient = *lob.NewAPIClient(configuration)\n\nvar to = *lob.NewAddressEditable()\nto.SetAddressLine1(\"210 King St\")\nto.SetAddressLine2(\"# 6100\")\nto.SetAddressCity(\"San Francisco\")\nto.SetAddressState(\"CA\")\nto.SetAddressZip(\"94107\")\nto.SetAddressCountry(lob.COUNTRYEXTENDED_US)\nto.SetDescription(\"\")\nto.SetName(\"Harry Zhang\")\n\nvar SnapPackCreate = *lob.NewSnapPackEditable()\nSnapPackCreate.SetDescription(\"Demo Snap Pack job\")\nSnapPackCreate.SetFrom(\"adr_210a8d4b0b76d77b\")\nSnapPackCreate.SetInside(\"<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>\")\nSnapPackCreate.SetOutside(\"<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>\")\nSnapPackCreate.SetTo(to)\nSnapPackCreate.SetFsc(true)\nSnapPackCreate.SetPrintSpeed(\"core\")\n\n\ncreatedSnapPack, _, err := apiClient.SnapPacksApi.Create(context).SnapPackEditable(SnapPackCreate).Execute()\n\nif err != nil {\n return err\n}\n"
label: GO
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
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
snap_pack_size:
type: string
enum:
- 8.5x11
description: Specifies the size of the snap pack.
default: 8.5x11
snap_pack_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/snap_pack_id'
deleted:
$ref: '#/components/schemas/deleted'
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'
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 h
# --- truncated at 32 KB (97 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/lobcom/refs/heads/main/openapi/lobcom-snap-packs-api-openapi.yml