From 09b6d00ba461d1b82fa1bb52769b5e4be29993ff Mon Sep 17 00:00:00 2001 From: Zach Reed Date: Wed, 5 Jun 2024 11:15:39 -0400 Subject: [PATCH] update pdf prep docs --- dist/lob-api-bundled.yml | 35308 ++++++++++++++++++++----------------- docs/index.html | 702 +- lob-api-public.yml | 14 +- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 19826 insertions(+), 16202 deletions(-) diff --git a/dist/lob-api-bundled.yml b/dist/lob-api-bundled.yml index 357ef0c4..99166c1c 100644 --- a/dist/lob-api-bundled.yml +++ b/dist/lob-api-bundled.yml @@ -1,9 +1,11 @@ openapi: 3.0.3 info: title: Lob - version: 1.19.31 - 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.

+ version: 1.19.33 + 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.

license: name: MIT url: https://mit-license.org/ @@ -15,29 +17,49 @@ info: servers: - url: https://api.lob.com/v1 description: production -security: - - basicAuth: [] tags: - name: Addresses - description: | - To add an address to your address book, you create a new address object. You can retrieve and delete individual - addresses as well as get a list of addresses. Addresses are identified by a unique random ID. -

back to top
+ description: > + To add an address to your address book, you create a new address object. + You can retrieve and delete individual + + addresses as well as get a list of addresses. Addresses are identified by + a unique random ID. + +
back to + top
- name: Authentication x-traitTag: true - description: | - Requests made to the API are protected with HTTP Basic authentication. - In order to properly authenticate with the API you must use your API key as the username - while leaving the password blank. Requests not properly authenticated will return a `401` + description: > + Requests made to the API are protected with HTTP Basic authentication. + + In order to properly authenticate with the API you must use your API key + as the username + + while leaving the password blank. Requests not properly authenticated will + return a `401` + [error code](#tag/Errors). You can find your account's API keys - in your Dashboard Settings. + + in your Dashboard Settings. + ### Example Request - curl uses the -u flag to pass basic auth credentials (adding a colon after your API key will prevent it from asking you for a - password). One of our test API keys has been filled into all the examples on the page, so you can test out any example right away. + + curl uses the -u flag to pass basic auth credentials (adding a colon after + your API key will prevent it from asking you for a + + password). One of our test API keys has been filled into all the examples + on the page, so you can test out any example right away. + ```bash + curl https://api.lob.com/v1/addresses \ -u test_0dc8dXXXXXXXXXXXXXXXXXXXXXX5b0cc: ``` + ## API Keys Lob authenticates your API requests using your account's API keys. If you do not include your key when making an API request, or use @@ -58,88 +80,175 @@ tags:

back to top
- name: Bank Accounts - description: | - Bank Accounts allow you to store your bank account securely in our system. The API provides - endpoints for creating bank accounts, deleting bank accounts, verifying bank accounts, - retrieving individual bank accounts, and retrieving a list of bank accounts. -
back to top
+ description: > + Bank Accounts allow you to store your bank account securely in our system. + The API provides + + endpoints for creating bank accounts, deleting bank accounts, verifying + bank accounts, + + retrieving individual bank accounts, and retrieving a list of bank + accounts. + +
back to + top
- name: Beta Program x-traitTag: true - description: | - At Lob, we pride ourselves on building high quality platform capabilities rapidly - and iteratively, so we can constantly be delivering additional value to our customers. - When evaluating a new product or feature from Lob, you may see that it has been released in Beta. - - Typically, something in Beta means that the feature is early in its lifecycle here at - Lob. While we fully stand behind the quality of everything we release in Beta, we do - anticipate receiving a higher level of customer feedback on Beta features, as well as a - faster pace of changes from our engineering team in response to that feedback. - - By participating in a Lob Beta program, you will have the opportunity to get early access - to a new product capability, as well as having a unique opportunity to influence the product's + description: > + At Lob, we pride ourselves on building high quality platform capabilities + rapidly + + and iteratively, so we can constantly be delivering additional value to + our customers. + + When evaluating a new product or feature from Lob, you may see that it has + been released in Beta. + + + Typically, something in Beta means that the feature is early in its + lifecycle here at + + Lob. While we fully stand behind the quality of everything we release in + Beta, we do + + anticipate receiving a higher level of customer feedback on Beta features, + as well as a + + faster pace of changes from our engineering team in response to that + feedback. + + + By participating in a Lob Beta program, you will have the opportunity to + get early access + + to a new product capability, as well as having a unique opportunity to + influence the product's + direction with your feedback. - You should also anticipate that features in Beta may have functional or design limitations, - and might change rapidly as we receive customer feedback and make improvements. In particular, - new APIs in Beta may also go through more frequent versioning and version deprecation cycles + + You should also anticipate that features in Beta may have functional or + design limitations, + + and might change rapidly as we receive customer feedback and make + improvements. In particular, + + new APIs in Beta may also go through more frequent versioning and version + deprecation cycles + than our more mature APIs. - If you are participating in a Beta program and want to provide feedback, please feel free to + + If you are participating in a Beta program and want to provide feedback, + please feel free to + contact us! -
back to top
+ +
back to + top
- name: Billing Groups - description: | - The Billing Groups API allows you to create and view labels that can be attached to certain consumption-based - usages of Letters, Checks, Postcards and Self-Mailers to customize your bill. Please check each - resource API section to learn more about how to access the Billing Groups API. -
back to top
+ description: > + The Billing Groups API allows you to create and view labels that can be + attached to certain consumption-based + + usages of Letters, Checks, Postcards and Self-Mailers to customize your + bill. Please check each + + resource API section to learn more about how to access the Billing Groups + API. + +
back to + top
- name: Buckslip Orders - description: | - The Buckslip Orders endpoint allows you to easily create buckslip orders for existing buckslips. - The API provides endpoints for creating buckslip orders and listing buckslip orders for a given buckslip. -
back to top
+ description: > + The Buckslip Orders endpoint allows you to easily create buckslip orders + for existing buckslips. + + The API provides endpoints for creating buckslip orders and listing + buckslip orders for a given buckslip. + +
back to + top
- name: Buckslips - description: | - The Buckslips endpoint allows you to easily create buckslips that can later be used as add-ons for Letters Campaigns. Note that a Letter Campaign with Buckslip add-on requires a minimum send quantity of 5,000 letters. - The API provides endpoints for creating buckslips, retrieving individual buckslips, creating buckslip orders, and retrieving a list of buckslips. -
back to top
+ description: > + The Buckslips endpoint allows you to easily create buckslips that can + later be used as add-ons for Letters Campaigns. Note that a Letter + Campaign with Buckslip add-on requires a minimum send quantity of 5,000 + letters. + + The API provides endpoints for creating buckslips, retrieving individual + buckslips, creating buckslip orders, and retrieving a list of buckslips. + +
back to + top
- name: Bulk Intl Verifications - description: | + description: > Verify a list of non-US addresses. -
back to top
+ +
back to + top
- name: Bulk US Verifications - description: | + description: > Verify a list of US addresses. -
back to top
+ +
back to + top
- name: Campaigns - description: | - The campaigns endpoint allows you to create and view campaigns that can be used to send multiple letters or postcards. - The API provides endpoints for creating campaigns, updating campaigns, retrieving individual campaigns, listing campaigns, and deleting + description: > + The campaigns endpoint allows you to create and view campaigns that can be + used to send multiple letters or postcards. + + The API provides endpoints for creating campaigns, updating campaigns, + retrieving individual campaigns, listing campaigns, and deleting + campaigns. - name: Card Orders - description: | - The card orders endpoint allows you to easily create card orders for existing cards. - The API provides endpoints for creating card orders and listing card orders for a given card. -
back to top
+ description: > + The card orders endpoint allows you to easily create card orders for + existing cards. + + The API provides endpoints for creating card orders and listing card + orders for a given card. + +
back to + top
- name: Cards - description: | - The cards endpoint allows you to easily create cards that can later be affixed to Letters. - The API provides endpoints for creating cards, retrieving individual cards, creating card orders, and retrieving a list of cards. -
back to top
+ description: > + The cards endpoint allows you to easily create cards that can later be + affixed to Letters. + + The API provides endpoints for creating cards, retrieving individual + cards, creating card orders, and retrieving a list of cards. + +
back to + top
- name: Checks - description: | - Checks allow you to send payments via physical checks. The API provides endpoints - for creating checks, retrieving individual checks, canceling checks, and retrieving a list of checks. -
back to top
+ description: > + Checks allow you to send payments via physical checks. The API provides + endpoints + + for creating checks, retrieving individual checks, canceling checks, and + retrieving a list of checks. + +
back to + top
- name: Creatives - description: | - The creatives endpoint allows you to create and view creatives. Creatives are used to create - reusable letter and postcard templates. The API provides endpoints for creating creatives, updating creatives, + description: > + The creatives endpoint allows you to create and view creatives. Creatives + are used to create + + reusable letter and postcard templates. The API provides endpoints for + creating creatives, updating creatives, + retrieving individual creatives, and deleting creatives. - name: Errors x-traitTag: true - description: | - Lob uses RESTful HTTP response codes to indicate success or failure of an API request - read below for more information. In general, 2xx indicates success, 4xx indicate an input error, and 5xx indicates an error on Lob's end. + description: > + Lob uses RESTful HTTP response codes to indicate success or failure of an + API request - read below for more information. In general, 2xx indicates + success, 4xx indicate an input error, and 5xx indicates an error on Lob's + end. + @@ -160,8 +269,10 @@ tags:
+ ### HTTP Status Code Summary + @@ -205,8 +316,10 @@ tags:
STATUS_CODE
+ ### Error Codes - Generic + @@ -270,8 +383,10 @@ tags:
STATUS_CODE
+ ### Error Codes - Authentication + @@ -475,14 +590,20 @@ tags:
STATUS_CODEThe provided PDF contains non-standard unembedded fonts. See description for details.
-
back to top
+ +
back to + top
- name: Events - description: | - When various notable things happen within the Lob architecture, Events will be created. To get these events sent to your server + description: > + When various notable things happen within the Lob architecture, Events + will be created. To get these events sent to your server + automatically when they occur, you can set up [Webhooks](#tag/Webhooks). +

Postcards

+ @@ -561,8 +682,10 @@ tags:
EVENT TYPE
+

Self Mailers

+ @@ -642,8 +765,10 @@ tags:
EVENT TYPE
+

Letters

+ @@ -799,8 +924,10 @@ tags:
EVENT TYPE
+

Checks

+ @@ -869,8 +996,10 @@ tags:
EVENT TYPE
+

Addresses

+ @@ -889,8 +1018,10 @@ tags:
EVENT TYPE
+

Bank Accounts

+ @@ -913,24 +1044,42 @@ tags:
EVENT TYPEA bank account is successfully verified.
-
back to top
+ +
back to + top
- name: Getting Started x-traitTag: true - description: | + description: > ### 1. Get Setup - * Create an account at Lob.com - * Obtain your API keys in the Lob dashboard settings - * You'll use the format, `test_*.` for your Test API key and `live_*.` for your Live API key. + + * Create an account at Lob.com + + * Obtain your API keys in the Lob dashboard settings + + * You'll use the format, `test_*.` for your Test API key and `live_*.` for + your Live API key. + ### 2. Explore + * Try out in Postman: +
+ + style="background:#0099d7;color: white;display: flex;justify-content: + center;align-items: center;"> Run in Postman
+ + * Launch your terminal and copy/paste a CURL command. + ```bash + curl https://api.lob.com/v1/addresses \ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: ``` - * Download a [Lob SDK](#tag/SDKs-and-Tools) into your favorite IDE (integrated development environment) + + * Download a [Lob SDK](#tag/SDKs-and-Tools) into your favorite IDE + (integrated development environment) + ### 3. Learn more + Try our quick start (TypeScript, Python, PHP, Java or Ruby): - * Send your first Postcards + + * Send your first Postcards + Use Case guides - * Mass Deletion Setup - * NCOA Restrictions - * Override Cancellation Window - * Visibility of Address Changes - * Ingesting Tracking Events with Webhooks -
back to top
+ + * Mass Deletion Setup + + * NCOA Restrictions + + * Override Cancellation Window + + * Visibility of Address Changes + + * Ingesting Tracking Events with Webhooks + +
back to + top
- name: Identity Validation - description: | + description: > Validates whether a given name is associated with an address. -
back to top
+ +
back to + top
- name: Intl Autocompletions - description: | - Address autocompletion for non-US addresses. Given partial address information, this endpoint returns up to 10 address suggestions. + description: > + Address autocompletion for non-US addresses. Given partial address + information, this endpoint returns up to 10 address suggestions. + ## Autocompletion Test Env - Your test API key does not autocomplete international addresses and is used to simulate - behavior. With your test API key, requests with specific values for `address_prefix` + + Your test API key does not autocomplete international addresses and is + used to simulate + + behavior. With your test API key, requests with specific values for + `address_prefix` + return predetermined values. When `address_prefix` is set to: + - `0 suggestions` - Returns no suggestions - - `[PRIMARY NUMBER] s[uggestion]` - Returns a maximum of ten predefined suggested addresses. + + - `[PRIMARY NUMBER] s[uggestion]` - Returns a maximum of ten predefined + suggested addresses. `[PRIMARY NUMBER]` does not have to be a valid primary number when sending a test request. Each additional letter in `suggestion` reduces the number of suggestions by one (e.g. `1 su` returns 9 suggested addresses). `[PRIMARY NUMBER]` does not affect the number of suggestions returned. Country is a required field. - City and state filters work as expected and filter the list of predetermined suggested addresses. - See the `test` request & response examples under [Autocomplete Examples](#operation/intl_autocompletions) within the "Autocomplete + + City and state filters work as expected and filter the list of + predetermined suggested addresses. + + See the `test` request & response examples under [Autocomplete + Examples](#operation/intl_autocompletions) within the "Autocomplete + a partial address" section in Intl Autocompletions. -
back to top
+ +
back to + top
- name: Intl Verifications - description: | + description: > Address verification for non-US addresses +
-
back to top
+ +
back to + top
+ ## Intl Verifications Test Env + When verifying international addresses, you'll likely want to test against + a wide array of addresses to ensure you're handling responses correctly. - With your test API key, requests that use specific values for `primary_line` + + With your test API key, requests that use specific values for + `primary_line` + let you explore the responses to many types of addresses: + @@ -1016,83 +1221,169 @@ tags:
DELIVERABILITY OF SAMPLE RESPONSE
- See the `test` request & response examples under [Intl Verification Examples](#operation/intl_verification) within the + + See the `test` request & response examples under [Intl Verification + Examples](#operation/intl_verification) within the + "Verify an international address section" in Intl Verifications. - You can rely on the response from these examples generally matching the response - you'd see in the live environment with an address of that type (excluding the `recipient` field). - The test API key does not perform any verification, automatic correction, or standardization - for addresses. If you wish to try these features out, use our live demo - or the free plan (see our pricing for details). -
back to top
+ You can rely on the response from these examples generally matching the + response + + you'd see in the live environment with an address of that type (excluding + the `recipient` field). + + + The test API key does not perform any verification, automatic correction, + or standardization + + for addresses. If you wish to try these features out, use our live demo + + or the free plan (see our + pricing for details). + +
back to + top
- name: Introduction x-traitTag: true - description: | - Lob’s Print & Mail and Address Verification APIs help companies transform outdated, - manual print-and-mail processes; save 1,000s of hours in processing time by sending mail much more + description: > + Lob’s Print & Mail and Address Verification APIs help companies transform + outdated, + + manual print-and-mail processes; save 1,000s of hours in processing time + by sending mail much more + quickly; and increase ROI on offline communications. - Automate direct mail by triggering on-demand postcards, letters, and checks directly from your + + Automate direct mail by triggering on-demand postcards, letters, and + checks directly from your + CRM or customer data systems. - Address Verification corrects, standardizes, and cleanses address data for assured delivery with + + Address Verification corrects, standardizes, and cleanses address data for + assured delivery with + instant verification across 240+ countries and territories. - Lob's print delivery network eliminates the hassle of vendor management with automated - production and postage across a global network of vetted commercial printers. - Tracking & Analytics gives you complete visibility of production and delivery for each piece of - mail you send to meet compliance requirements and measure campaign performance. + Lob's print delivery network eliminates the hassle of vendor management + with automated + + production and postage across a global network of vetted commercial + printers. + + + Tracking & Analytics gives you complete visibility of production and + delivery for each piece of + + mail you send to meet compliance requirements and measure campaign + performance. - name: Letters - description: | - The letters endpoint allows you to easily print and mail letters. The API provides endpoints for - creating letters, retrieving individual letters, canceling letters, and retrieving a list of letters. -
back to top
+ description: > + The letters endpoint allows you to easily print and mail letters. The API + provides endpoints for + + creating letters, retrieving individual letters, canceling letters, and + retrieving a list of letters. + +
back to + top
- name: Manage Mail x-traitTag: true - description: | + description: > ## Cancellation Windows - By default, all new accounts have a 5 minute cancellation window for postcards, + + By default, all new accounts have a 5 minute cancellation window for + postcards, + self mailers, letters, and checks. Within that timeframe, you can cancel + mailings from production, free of charge. Once the window has passed for a - postcard, self mailer, letter, or check, the mailing is no longer cancelable. + + postcard, self mailer, letter, or check, the mailing is no longer + cancelable. + In addition, certain customers can customize their cancellation windows by - product in their Dashboard Settings. Upgrade to - the appropriate Print & Mail Edition - to automatically gain access to this ability. For more details on this feature, - check out our Cancellation Guide. - If you schedule a postcard, self mailer, letter, or check for up to 180 days - in the future by supplying the `send_date` parameter, that will override any + product in their Dashboard Settings. Upgrade to + + the appropriate Print & Mail Edition + + to automatically gain access to this ability. For more details on this + feature, + + check out our Cancellation Guide. + + + If you schedule a postcard, self mailer, letter, or check for up to 180 + days + + in the future by supplying the `send_date` parameter, that will override + any + cancellation window you may have for that product. +
-
back to top
+ +
back to + top
+ ## Scheduled Mailings - Postcards, self mailers, letters, and checks can be scheduled to be sent up + + Postcards, self mailers, letters, and checks can be scheduled to be sent + up + to 180 days in advance. You can use this feature to: + - Create automated drip campaigns (e.g. send a postcard at 15, 30, and 60 + days) + - Schedule recurring sends + - Plan your mailing schedule ahead of time + Up until the time a mailing is scheduled for, it can also be canceled. + If you use this feature in conjunction with [a cancellation window]( - index.html#section/Cancellation-Windows), the `send_date` parameter will always + + index.html#section/Cancellation-Windows), the `send_date` parameter will + always + take precedence. + For implementation details, see documentation below for each respective - endpoint. For more help, see our Scheduled Mailings Guide. + + endpoint. For more help, see our Scheduled Mailings Guide. + This feature is exclusive to certain customers. Upgrade to the appropriate - Print & Mail Edition to + + Print & Mail Edition to + gain access. + ### Example Create Request using Send Date + ```bash curl https://api.lob.com/v1/postcards \ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ @@ -1104,87 +1395,196 @@ tags: -d "merge_variables[name]=Harry" \ -d "send_date=2021-07-26" ``` -
back to top
+ +
back to + top
- name: National Change of Address x-traitTag: true - description: | - National Change of Address Linkage (NCOALink) is a service offered by the USPS, which allows individuals - or businesses who have recently moved to have any mail forwarded from their previous address + description: > + National Change of Address Linkage (NCOALink) is a service offered by the + USPS, which allows individuals + + or businesses who have recently moved to have any mail forwarded from + their previous address + to their new address. - As a CASS-certified Address Verification Provider, Lob also offers NCOALink - functionality to our Print & Mail customers. With the Lob NCOALink feature enabled, Postcards, - Letters, Checks and Addresses can automatically be corrected to reflect an individual's or business's - new address in the case that they have moved (only if they have registered for NCOALink with the USPS). - Due to privacy concerns and USPS constraints, for customers with NCOALink enabled, our API responses - for a limited set of endpoints differ slightly in the case when an address has been changed through NCOALink. + As a CASS-certified Address Verification Provider, Lob also offers + NCOALink + + functionality to our Print & Mail customers. With the Lob NCOALink feature + enabled, Postcards, - **NOTE**: This feature is exclusive to certain customers. Upgrade to the appropriate Print & Mail Editions to gain access. + Letters, Checks and Addresses can automatically be corrected to reflect an + individual's or business's + + new address in the case that they have moved (only if they have registered + for NCOALink with the USPS). + + + Due to privacy concerns and USPS constraints, for customers with NCOALink + enabled, our API responses + + for a limited set of endpoints differ slightly in the case when an address + has been changed through NCOALink. + + + **NOTE**: This feature is exclusive to certain customers. Upgrade to the + appropriate Print & Mail Editions to gain access. + + + For more information, see our NCOALink guide. - For more information, see our NCOALink guide.
-
back to top
+ +
back to + top
+ ## NCOALink Live Environment - Though there are no changes to API requests, there are significant changes to our API responses, but - only in the event that an address has been changed through NCOALink. If an address has not been changed - through NCOALink, the response would be identical to our standard responses, except the addition of a + + Though there are no changes to API requests, there are significant changes + to our API responses, but + + only in the event that an address has been changed through NCOALink. If an + address has not been changed + + through NCOALink, the response would be identical to our standard + responses, except the addition of a + `recipient_moved` field, which is `false` for unchanged addresses. - If an address has been changed through NCOALink, we are required to suppress the following response + + If an address has been changed through NCOALink, we are required to + suppress the following response + fields for that address: + - `address_line1` + - `address_line2` + - The +4 portion of the ZIP+4 (5-digit ZIP code will still be present) - See the `ncoa_us_live` example under [Response samples](#operation/address_create) within the "Create an Address" section in Addresses + + See the `ncoa_us_live` example under [Response + samples](#operation/address_create) within the "Create an Address" section + in Addresses +
-
back to top
+ +
back to + top
+ ## NCOALink Test Environment - In addition to sending live requests, you may also want to simulate what an NCOALink response might - look like so that you can ensure your application behaves as expected. The behavior of NCOALink in - Lob's Test Environment is very similar to our [US Verifications Test Mode](#section/US-Verifications-Test-Env). - To simulate an NCOALink request, send a POST request to any of the four endpoints below with an `address_line1` field equal to `NCOA`: + In addition to sending live requests, you may also want to simulate what + an NCOALink response might + + look like so that you can ensure your application behaves as expected. The + behavior of NCOALink in + + Lob's Test Environment is very similar to our [US Verifications Test + Mode](#section/US-Verifications-Test-Env). + + + To simulate an NCOALink request, send a POST request to any of the four + endpoints below with an `address_line1` field equal to `NCOA`: + - `POST /v1/addresses` + - `POST /v1/checks` + - `POST /v1/letters` + - `POST /v1/postcards` + - `POST /v1/self_mailers` - A static address will always be returned, as documented in the `ncoa_us_test` example under [Response samples](#operation/address_create) within the "Create an Address" - section in Addresses (along with the corresponding request under "Request samples"). -
back to top
+ + A static address will always be returned, as documented in the + `ncoa_us_test` example under [Response samples](#operation/address_create) + within the "Create an Address" + + section in Addresses (along with the corresponding request under "Request + samples"). + +
back to + top
- name: Postcards - description: | - The postcards endpoint allows you to easily print and mail postcards. The API provides endpoints for creating postcards, - retrieving individual postcards, canceling postcards, and retrieving a list of postcards. -
back to top
+ description: > + The postcards endpoint allows you to easily print and mail postcards. The + API provides endpoints for creating postcards, + + retrieving individual postcards, canceling postcards, and retrieving a + list of postcards. + +
back to + top
- name: QR Codes - description: | + description: > + + Lob QR codes allow you to generate a QR code that is unique to each + mailpiece, thereby allowing each and every customers to receive a + personalized link. See the Create endpoint for Letters, Postcards or Self Mailers to + learn how to embed a QR code into your mail piece. + + + Webhooks can be used to integrate Lob QR code scans into your omni channel + marketing strategy. See the Webhooks section + of our documentation to learn how to enable the `letter.viewed`, + `postcard.viewed` and `self_mailer.viewed` event notifications for your + mail pieces. - Lob QR codes allow you to generate a QR code that is unique to each mailpiece, thereby allowing each and every customers to receive a personalized link. See the Create endpoint for Letters, Postcards or Self Mailers to learn how to embed a QR code into your mail piece. - Webhooks can be used to integrate Lob QR code scans into your omni channel marketing strategy. See the Webhooks section of our documentation to learn how to enable the `letter.viewed`, `postcard.viewed` and `self_mailer.viewed` event notifications for your mail pieces. + Furthermore, our QR code Analytics endpoint can be used to track the + impact and engagement rate of your mail sends. Lob can tell you exactly + which recipients opened your mailpiece. Our Analytics endpoint allows you + to see exactly which recipient scanned a mailpiece, when they scanned it, + and more! - Furthermore, our QR code Analytics endpoint can be used to track the impact and engagement rate of your mail sends. Lob can tell you exactly which recipients opened your mailpiece. Our Analytics endpoint allows you to see exactly which recipient scanned a mailpiece, when they scanned it, and more! -
back to top
+
back to + top
- name: Rate Limiting x-traitTag: true - description: |- - To prevent misuse, we enforce a rate limit on an API Key and endpoint basis, similar to the way many other APIs enforce rate limits. By default, all accounts and their corresponding Test and Live API Keys have a rate limit of 150 requests per 5 seconds per endpoint. The `POST /v1/us_verifications` and `POST /v1/us_autocompletions` endpoints have a limit of 300 requests per 5 seconds for all accounts. + description: >- + To prevent misuse, we enforce a rate limit on an API Key and endpoint + basis, similar to the way many other APIs enforce rate limits. By default, + all accounts and their corresponding Test and Live API Keys have a rate + limit of 150 requests per 5 seconds per endpoint. The `POST + /v1/us_verifications` and `POST /v1/us_autocompletions` endpoints have a + limit of 300 requests per 5 seconds for all accounts. + + + When your application exceeds the rate limit for a given API endpoint, the + Lob API will return an HTTP 429 "Too Many Requests" response code instead + of the variety of codes you would find across the other API endpoints. - When your application exceeds the rate limit for a given API endpoint, the Lob API will return an HTTP 429 "Too Many Requests" response code instead of the variety of codes you would find across the other API endpoints. **HTTP Headers** - HTTP headers are returned on each request to a rate limited endpoint. Ensure that you inspect these headers during your requests as they provide relevant data on how many more requests your application is allowed to make for the endpoint you just utilized. - While the headers are documented here in titlecase, HTTP headers are case insensitive and certain libraries may transform them to lowercase. Please inspect your headers carefully to see how they will be represented in your chosen development scenario. + HTTP headers are returned on each request to a rate limited endpoint. + Ensure that you inspect these headers during your requests as they provide + relevant data on how many more requests your application is allowed to + make for the endpoint you just utilized. + + + While the headers are documented here in titlecase, HTTP headers are case + insensitive and certain libraries may transform them to lowercase. Please + inspect your headers carefully to see how they will be represented in your + chosen development scenario. + @@ -1203,17 +1603,23 @@ tags:
+ ### Example HTTP Headers + ```bash X-Rate-Limit-Limit:150 X-Rate-Limit-Remaining:100 X-Rate-Limit-Reset:1528749846 ``` + ### Example Response - If you hit the rate limit on a given endpoint, this is the body of the HTTP 429 message that you will see: + + If you hit the rate limit on a given endpoint, this is the body of the + HTTP 429 message that you will see: + ```javascript { @@ -1223,54 +1629,97 @@ tags: "status_code": 429 } } - ```
back to top
+ ```
back to + top
- name: Requests and Responses x-traitTag: true - description: | + description: > ## Asset URLs + All asset URLs returned by the Lob API (postcards, letters, thumbnails, + etc) are signed links served over HTTPS. All links returned will expire in + 30 days to prevent mis-sharing. Each time a GET request is initiated, a + new signed URL will be generated. +
-
back to top
+ +
back to + top
+ ## Query Parameters - Query parameters which consist of lists of strings require that all elements of + + Query parameters which consist of lists of strings require that all + elements of + the list be double-quoted, as per query filter standards. +
-
back to top
+ +
back to + top
+ ## Idempotent Requests + Lob supports idempotency for safely retrying `POST` requests to create + postcards, self mailers, letters, and checks without accidentally creating + duplicates. + For example, if a request to create a check fails due to a network error, + you can safely retry the same request with the same idempotency key and + guarantee that only one check will ultimately be created and sent. When a + request is sent with an idempotency key for an already created resource, + the response object for the existing resource will be returned. + To perform an idempotent `POST` request to one of the mailpiece product - endpoints, provide an additional `Idempotency-Key` header or an `idempotency_key` + + endpoints, provide an additional `Idempotency-Key` header or an + `idempotency_key` + query parameter to the request. If multiple idempotency keys are provided, + the request will fail. How you create unique keys is up to you, but we - suggest using random values, such as V4 UUIDs. Idempotency keys are intended - to prevent issues over a short periods of time, therefore keys expire after + + suggest using random values, such as V4 UUIDs. Idempotency keys are + intended + + to prevent issues over a short periods of time, therefore keys expire + after + 24 hours. Keys are unique by mode (Test vs. Live) as well as by resource + (postcard vs. letter, etc.). + By default, all `GET` and `DELETE` requests are idempotent by nature, so + they do not require an additional idempotency key. + For more help integrating idempotency keys, refer to our - implementation guide. + + implementation guide. + **Headers** + @@ -1288,7 +1737,9 @@ tags:
+ **Query Parameters** + @@ -1306,8 +1757,10 @@ tags:
+ ### Example Request + ```bash curl https://api.lob.com/v1/postcards \ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ @@ -1318,21 +1771,37 @@ tags: --data-urlencode "back=Back HTML" \ -d "merge_variables[name]=Harry" ``` +
-
back to top
+ +
back to + top
+ ## Metadata - When creating any Lob object, you can include a metadata object with up to 20 key-value pairs of - custom data. You can use metadata to store information like `metadata[customer_id] = "987654"` or - `metadata[campaign] = "NEWYORK2015"`. This is especially useful for filtering and matching to internal + + When creating any Lob object, you can include a metadata object with up to + 20 key-value pairs of + + custom data. You can use metadata to store information like + `metadata[customer_id] = "987654"` or + + `metadata[campaign] = "NEWYORK2015"`. This is especially useful for + filtering and matching to internal + systems. - Each metadata key must be less than 40 characters long and values must be less than 500 characters. + + Each metadata key must be less than 40 characters long and values must be + less than 500 characters. + Metadata does not support nested objects. + ### Example Create Request with Metadata + ```bash curl https://api.lob.com/v1/postcards \ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ @@ -1345,49 +1814,85 @@ tags: -d "merge_variables[name]=Harry" ``` + ### Example List Request with Metadata Filter + ```bash curl -g "https://api.lob.com/v1/postcards?metadata[campaign]=NEWYORK2015&limit=2" \ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: ``` +
-
back to top
+ +
back to + top
+ ## Request Body + When manually sending a POST HTTP request directly to the Lob API, without + the use of a library, you may represent the body as either a Form URL + Encoded request, a JSON document, or a Multipart Form Data request. + However, if you're using one of our [SDKs](#tag/SDKs-and-Tools), - the generation of the request bodies is done for you automatically and you don't + + the generation of the request bodies is done for you automatically and you + don't + need to worry about the format. - For fields that are intended to accept only string values, submitting JSON objects in string format (stringified JSON objects) is not supported. - Our system automatically parses and validates incoming data according to their expected types. - As a result, providing a stringified JSON object in a field designated for string input can cause parsing errors or lead to unexpected validation results. + + For fields that are intended to accept only string values, submitting JSON + objects in string format (stringified JSON objects) is not supported. + + Our system automatically parses and validates incoming data according to + their expected types. + + As a result, providing a stringified JSON object in a field designated for + string input can cause parsing errors or lead to unexpected validation + results. + ### Form URL Encoded + This request body encoding is accompanied with the - `Content-Type: application/x-www-form-urlencoded` header. The content is an - example of what the [Verify a US address](index.html#operation/us_verification) - endpoint accepts. An example of a request body encoded in this format follows. + + `Content-Type: application/x-www-form-urlencoded` header. The content is + an + + example of what the [Verify a US + address](index.html#operation/us_verification) + + endpoint accepts. An example of a request body encoded in this format + follows. + ```javascript primary_line=210 King Street&city=San Francisco&state=CA&zip_code=94107 ``` + ### JSON - This request body encoding is accompanied with the `Content-Type: application/json` header. - The content is an example of what the [Verify a US address endpoint](index.html#operation/us_verification) + + This request body encoding is accompanied with the `Content-Type: + application/json` header. + + The content is an example of what the [Verify a US address + endpoint](index.html#operation/us_verification) + accepts. An example of a request body encoded in this format follows. + ```javascript { "primary_line": "210 King Street", @@ -1397,12 +1902,22 @@ tags: } ``` + ### Multipart Form Data - This request body encoding is accompanied with the `Content-Type: multipart/form-data` - header. This is the only format that can be used for uploading a file to the API. The - content is an example of what the [Create a check](index.html#operation/check_create) - endpoint accepts. An example of a request body encoded in this format follows. + + This request body encoding is accompanied with the `Content-Type: + multipart/form-data` + + header. This is the only format that can be used for uploading a file to + the API. The + + content is an example of what the [Create a + check](index.html#operation/check_create) + + endpoint accepts. An example of a request body encoded in this format + follows. + ```javascript @@ -1429,54 +1944,112 @@ tags: true --------------------------7015ebe79c0a5f8c-- ``` -
back to top
+ +
back to + top
- name: Reverse Geocode Lookups - description: | - Find a list of zip codes associated with a valid US location via latitude and longitude.
back to top
+ description: > + Find a list of zip codes associated with a valid US location via latitude + and longitude.
back to top
- name: SDKs and Tools x-traitTag: true - description: | - Please visit our Github for a list of our supported libraries. - - Typescript + description: > + Please visit our Github for a list of our supported libraries. + + - Typescript + - PHP + - Python + - Java - - Ruby + + - Ruby + - CSharp + - Elixir + - Go - - Node.js (legacy) - - Java (legacy) - - PHP (legacy) - - Python (Legacy) - - Ruby (Legacy) + + - Node.js + (legacy) + + - Java (legacy) + + - PHP (legacy) + + - Python (Legacy) + + - Ruby (Legacy) +

-
back to top
+ +
back to + top
- name: Self Mailers - description: | - The self mailer endpoint allows you to easily print and mail self mailers. The API provides endpoints - for creating self mailers, retrieving individual self mailers, canceling self mailers, and retrieving a list of self mailers. -
back to top
+ description: > + The self mailer endpoint allows you to easily print and mail self mailers. + The API provides endpoints + + for creating self mailers, retrieving individual self mailers, canceling + self mailers, and retrieving a list of self mailers. + +
back to + top
- name: Template Design x-traitTag: true - description: | + description: > ## HTML Templates - You can save commonly used HTML as templates within Lob to more easily manage them. You can reference - your saved templates in postcard, letter, and check requests instead of having to pass a long HTML - string on each request. Additionally, you can make changes to your HTML templates and update them - independently, without having to touch your API integration. Templates can be created, edited, - and viewed on your Dashboard. To use a template in a postcard, - letter, or check, see the documentation for each endpoint below. For help using templates, check out our - HTML Templates Guide or get started with a - pre-designed template from our gallery. In Live mode, you can only have + + You can save commonly used HTML as templates within Lob to more easily + manage them. You can reference + + your saved templates in postcard, letter, and check requests instead of + having to pass a long HTML + + string on each request. Additionally, you can make changes to your HTML + templates and update them + + independently, without having to touch your API integration. Templates can + be created, edited, + + and viewed on your Dashboard. To use a template in a postcard, + + letter, or check, see the documentation for each endpoint below. For help + using templates, check out our + + HTML Templates Guide or get started with a + + pre-designed + template from our gallery. In Live mode, you can only have + as many templates as allotted in your current - Print & Mail Edition. There is no limit in Test mode. - If you'd like to interact with templates programmatically, check out our Beta Program for API access + Print & Mail Edition. There is no limit in Test mode. + + + If you'd like to interact with templates programmatically, check out our + Beta Program for API access + to the [HTML Templates Endpoints](#tag/Templates). + ### Example Create Request using HTML Templates + ```bash curl https://api.lob.com/v1/postcards \ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ @@ -1487,83 +2060,180 @@ tags: -d "back=tmpl_01b0d396a10c268" \ -d "merge_variables[name]=Harry" ``` +
-
back to top
+ +
back to + top
+ ## HTML Examples - Use a pre-designed template from our gallery or follow these - basic guidelines as starting points for creating custom Postcards, + + Use a pre-designed template from our gallery or follow these + + basic guidelines as starting points for creating custom + Postcards, + Self Mailers, Letters, and Checks. + Please follow the standards used in these templates, such as: - - For any linked assets, you must use a performant file hosting provider with no rate limits such as Amazon + + - For any linked assets, you must use a performant file hosting provider + with no rate limits such as Amazon + S3. - - Use inline styles or an internal stylesheet, do not link to external stylesheets. - - Link to images that are 300DPI and sized at the final desired size on the physical mailing. For example, - for a photo that is desired to be 1in x 1in on the final postcard, the image asset should be sized at 1in + + - Use inline styles or an internal stylesheet, do not link to external + stylesheets. + + - Link to images that are 300DPI and sized at the final desired size on + the physical mailing. For example, + + for a photo that is desired to be 1in x 1in on the final postcard, the + image asset should be sized at 1in + x 1in at 300DPI (which equates to 300px by 300px). + - The sum of all linked assets should not exceed 5MB in file size. - - Use `-webkit` prefixes for CSS properties when recommended here. - Because different browsers have varying user-agent styles, the HTML you see in your browser will not - always look identical to what is produced through the API. It is **strongly** recommended that you test all - HTML requests by reviewing the final PDF files in your Test Environment, as these are the files that will be + - Use `-webkit` prefixes for CSS properties when recommended here. + + + Because different browsers have varying user-agent styles, the HTML you + see in your browser will not + + always look identical to what is produced through the API. It is + **strongly** recommended that you test all + + HTML requests by reviewing the final PDF files in your Test Environment, + as these are the files that will be + printed. +
-
back to top
+ +
back to + top
+ ## Image Prepping + Currently we support the following file types for all endpoints: + - PDF + - PNG + - JPEG + **Templates** - You can find pre-made templates that already adhere to all of these guidelines here: + + You can find pre-made templates that already adhere to all of these + guidelines here: + - [Postcards](#tag/Postcards) + - [Letters](#tag/Letters) + - [Checks](#tag/Checks) + - [Self Mailers](#tag/Self-Mailers) + **Prepping All Images** + The following guidelines apply to image types: - - Images should be 300 dpi or higher - PNG/JPEG files with less than 300 dpi will be rejected. - - Your artwork should include a 1/8" border around the final trim size. This means your final file size will be a total of 0.25" larger than your expected printed piece (ie, a 4"x6" postcard should be submitted as 4.25"x6.25"). There is no need to include crop marks in your submitted content. - - Include a safe zone – make sure no critical elements are within 1/8" from the edge of the final size. + + - Images should be 300 dpi or higher - PNG/JPEG files with less than 300 + dpi will be rejected. + + - Your artwork should include a 1/8" border around the final trim size. + This means your final file size will be a total of 0.25" larger than your + expected printed piece (ie, a 4"x6" postcard should be submitted as + 4.25"x6.25"). There is no need to include crop marks in your submitted + content. + + - Include a safe zone – make sure no critical elements are within 1/8" + from the edge of the final size. + - Do not include any additional postage marks or indicia. + - File sizes should be no larger than 5MB. + **Prepping PDFs** - To ensure that you are producing PDF's correctly please follow the guidelines below: - - [Make sure all non-standard fonts are embedded.](#section/Standard-PDF-Fonts) - - Generated PDF's need to be be PDF/A compliant. + + To ensure that you are producing PDF's correctly please follow the + guidelines [outlined in our help center + here](https://help.lob.com/print-and-mail/designing-mail-creatives/creative-formatting/pdf-preflight-checklist#requirements-for-static-pdfs) + **Prepping PNGs/JPEGs** - To ensure that you are producing PNG's/JPEG's correctly please follow the guidelines below: - - Minimum 300 dpi. The dpi is calculated as (width of image in pixels) / (width of product in inches) and (length of image in pixels) / (length of product in inches). For Example: 1275px x 1875px image used to create a 4.25" x 6.25" postcard has a dpi of 300. - - Submitted images must have the same length to width ratio as the chosen product. Images will not be cropped or stretched by the API. + To ensure that you are producing PNG's/JPEG's correctly please follow the + guidelines below: + + + - Minimum 300 dpi. The dpi is calculated as (width of image in pixels) / + (width of product in inches) and (length of image in pixels) / (length of + product in inches). For Example: 1275px x 1875px image used to create a + 4.25" x 6.25" postcard has a dpi of 300. + + - Submitted images must have the same length to width ratio as the chosen + product. Images will not be cropped or stretched by the API. +
-
back to top
+ +
back to + top
+ ## Standard PDF Fonts - Ideally, all fonts in provided PDFs should be embedded. Embedding a font in a PDF ensures that the final - printed product will look as it was designed. Fonts can vary greatly in size and shape, even within the - same family. If the exact font that was used to design the artwork is not used to print, the look and + + Ideally, all fonts in provided PDFs should be embedded. Embedding a font + in a PDF ensures that the final + + printed product will look as it was designed. Fonts can vary greatly in + size and shape, even within the + + same family. If the exact font that was used to design the artwork is not + used to print, the look and + placement of the text is not guaranteed to be the same. - In general, requests that provide PDFs with un-embedded fonts will be rejected. We make an exception for - "standard fonts", a set of fonts that we have identified as being common. PDFs that contain un-embedded - fonts that are found in the list, and match the accepted font type + + In general, requests that provide PDFs with un-embedded fonts will be + rejected. We make an exception for + + "standard fonts", a set of fonts that we have identified as being common. + PDFs that contain un-embedded + + fonts that are found in the list, and match the accepted font type + will be accepted. Otherwise, the request will be rejected. - Font embedding is an essential part of standard PDF workflows. Fonts should be embedded automatically by + + Font embedding is an essential part of standard PDF workflows. Fonts + should be embedded automatically by + PDF editing software that are compliant with PDF standards. + + Please note, only standard base14 fonts can be Type 1. + + @@ -1571,15 +2241,15 @@ tags: - + - + - + @@ -1742,55 +2412,94 @@ tags:
FONT NAME
ArialType 1, TrueType, CID TrueTypeTrueType, CID TrueType
Arial,BoldType 1, TrueType, CID TrueTypeTrueType, CID TrueType
Arial,BoldItalicType 1, TrueType, CID TrueTypeTrueType, CID TrueType
Arial,ItalicType 1
-
back to top
+ +
back to + top
- name: Template Versions - description: | - These API endpoints allow you to create, retrieve, update and delete versions of reusable HTML templates for use with the Print & Mail API. -
back to top
+ description: > + These API endpoints allow you to create, retrieve, update and delete + versions of reusable HTML templates for use with the Print & Mail API. + +
back to + top
- name: Templates - description: | - These API endpoints allow you to create, retrieve, update and delete reusable HTML templates for use with the Print & Mail API. -
back to top
+ description: > + These API endpoints allow you to create, retrieve, update and delete + reusable HTML templates for use with the Print & Mail API. + +
back to + top
- name: Test and Live Environments x-traitTag: true - description: | + description: > To make the API as explorable as possible, accounts have test and live + environment API keys. You're not charged any fees in the test environment, + so we encourage you to use it to try out services, perform quality + assurance, and run automated testing. Objects―addresses, letters, checks, + etc―in one environment cannot be manipulated by objects in the other. + In general, a payment method (either credit card or ACH account) must be + added to your account to make live API requests. However, a payment method + is not required for the first 300 live requests per month to the + `/v1/us_verifications` endpoint. After the first 300 requests, you will + begin receiving errors with status code `403`. + Requests made in the test environment always validate request arguments, + simulate live environment behavior, and enforce rate limits. _They never + print, mail nor, for verification services, verify addresses._ The US & + International verification services trigger behavior with specific + argument values, and, if you plan on using those, we recommend reading + [US Verification Test Environment](#tag/US-Verifications-Test-Environment) - and [Intl Verification Test Environment](#tag/Intl-Verifications-Test-Environment). + + and [Intl Verification Test + Environment](#tag/Intl-Verifications-Test-Environment). + To switch between environments, use the appropriate key for that + environment when performing a request. You can find each environment's API + key in your dashboard under Settings; test API keys are always prefixed + with `test_` and production API keys with `live_`. -
back to top
+ +
back to + top
- name: Tracking Events - description: | - As mailpieces travel through the mail stream, USPS scans their unique barcodes, and Lob processes these mail scans to generate tracking events. + description: > + As mailpieces travel through the mail stream, USPS scans their unique + barcodes, and Lob processes these mail scans to generate tracking events. +

Certified Tracking Event Details

+ Letters sent with USPS Certified Mail are fully tracked by USPS, and + therefore their [tracking events](#operation/tracking_event) have an + additional `details` object with more detailed information about the + tracking event. The following table shows the potential values for + the fields in the `details` object mapped to the tracking event `name`. + @@ -1961,42 +2670,79 @@ tags:
NAMEfalse
-
back to top
+ +
back to + top
- name: Uploads - description: | - The uploads endpoint allows you to upload audience files that are then associated with a given campaign. - At this time, only CSV files are allowed. The API provides endpoints for creating uploads, uploading audience files, - and marking uploaded files as ready for processing. The API also provides endpoints for downloading files that + description: > + The uploads endpoint allows you to upload audience files that are then + associated with a given campaign. + + At this time, only CSV files are allowed. The API provides endpoints for + creating uploads, uploading audience files, + + and marking uploaded files as ready for processing. The API also provides + endpoints for downloading files that + describe the results, both successful and not, of the processing. - name: URL Shortener - description: | - Lob's URL shortener allows you to generate unique short links, either with Lob's own domain or your own custom domains. Each custom link enables Lob to track mail individually and provide customers the relevant tracking data in their dashboard. + description: > + Lob's URL shortener allows you to generate unique short links, either with + Lob's own domain or your own custom domains. Each custom link enables Lob + to track mail individually and provide customers the relevant tracking + data in their dashboard. + + + Webhooks can be used to integrate Lob's URL Shortener scans into your omni + channel marketing stratergy. See the Webhooks + section of our documentation to learn how to enable the `letter.viewed`, + `postcard.viewed` and `self_mailer.viewed` event notifications for your + mail pieces. + - Webhooks can be used to integrate Lob's URL Shortener scans into your omni channel marketing stratergy. See the Webhooks section of our documentation to learn how to enable the `letter.viewed`, `postcard.viewed` and `self_mailer.viewed` event notifications for your mail pieces. + Furthermore, you can use our Retrieve endpoints to track the impact and + engagement rate of links created. - Furthermore, you can use our Retrieve endpoints to track the impact and engagement rate of links created. -
back to top
+
back to + top
- name: US Autocompletions - description: | - Given partial address information, this endpoint returns up to 10 address suggestions.
back to top
+ description: > + Given partial address information, this endpoint returns up to 10 address + suggestions.
back to top
+ ## Autocompletion Test Env - Your test API key does not autocomplete US addresses and is used to simulate behavior. With your test API key, requests with specific values for `address_prefix` return predetermined values. When `address_prefix` is set to: - - `0 suggestions` - Returns no suggestions - `[PRIMARY NUMBER] s[uggestion]` - Returns a maximum of ten predefined suggested addresses. + + Your test API key does not autocomplete US addresses and is used to + simulate behavior. With your test API key, requests with specific values + for `address_prefix` return predetermined values. When `address_prefix` is + set to: + + - `0 suggestions` - Returns no suggestions - `[PRIMARY NUMBER] + s[uggestion]` - Returns a maximum of ten predefined suggested addresses. `[PRIMARY NUMBER]` does not have to be a valid primary number when sending a test request. Each additional letter in `suggestion` reduces the number of suggestions by one (e.g. `1 su` returns 9 suggested addresses). `[PRIMARY NUMBER]` does not affect the number of suggestions returned. - City and state filters work as expected and filter the list of predetermined suggested addresses. - See the `test` request & response examples under [Autocomplete Examples](#operation/autocompletion) within the "Autocomplete a partial address" section in US Autocompletions.
back to top
+ City and state filters work as expected and filter the list of + predetermined suggested addresses. + + See the `test` request & response examples under [Autocomplete + Examples](#operation/autocompletion) within the "Autocomplete a partial + address" section in US Autocompletions.
back to top
- name: US Verification Types x-traitTag: true - description: | - These are detailed definitions for various fields in the [US verification object](#operation/us_verification). + description: > + These are detailed definitions for various fields in the [US verification + object](#operation/us_verification). +

ZIP Code Types - components[zip_code_type]

+ @@ -2022,8 +2768,10 @@ tags:
+

Record Types - components[record_type]

+ @@ -2057,8 +2805,10 @@ tags:
+

Carrier Route Types - components[carrier_route_type]

+ @@ -2088,7 +2838,10 @@ tags:
-

DPV Footnotes - deliverability_analysis[dpv_footnotes]

+ +

DPV Footnotes - + deliverability_analysis[dpv_footnotes]

+ @@ -2170,20 +2923,38 @@ tags:
-
back to top
+ +
back to + top
- name: US Verifications - description: | + description: > Validate, automatically correct, and standardize the addresses in your - address book based on USPS's Coding Accuracy Support System (CASS). + + address book based on USPS's Coding Accuracy Support System (CASS). +
-
back to top
+ +
back to + top
+ ## US Verifications Test Env - When verifying US addresses, you'll likely want to test against a wide array of addresses to - ensure you're handling responses correctly. With your test API key, requests that use specific - values for `address` or `primary_line` and (if using `primary_line`) an arbitrary five digit - number for `zip_code` (e.g. "11111") let you explore the responses to many types of addresses: + + When verifying US addresses, you'll likely want to test against a wide + array of addresses to + + ensure you're handling responses correctly. With your test API key, + requests that use specific + + values for `address` or `primary_line` and (if using `primary_line`) an + arbitrary five digit + + number for `zip_code` (e.g. "11111") let you explore the responses to many + types of addresses: + @@ -2263,12766 +3034,494 @@ tags:
- See the `test` request & response examples under [US Verification Examples](#operation/us_verification) within the + + See the `test` request & response examples under [US Verification + Examples](#operation/us_verification) within the + "Verify a US or US territory address" section in US Verifications. - You can rely on the response from these examples generally matching the response you'd see in the live environment with an + + You can rely on the response from these examples generally matching the + response you'd see in the live environment with an + address of that type (excluding the `recipient` field). - The test API key does not perform any verification, automatic correction, or standardization for addresses. If you wish to - try these features out, use our live demo or the free plan (see our pricing for details). -
back to top
+ + The test API key does not perform any verification, automatic correction, + or standardization for addresses. If you wish to + + try these features out, use our live demo + or the free plan (see our + pricing for details). + +
back to + top
- name: Versioning and Changelog x-traitTag: true - description: | + description: > ### API Versioning - When backwards-incompatible changes are made to the API, a new dated version + + When backwards-incompatible changes are made to the API, a new dated + version + is released. The latest version of the API is version **2024-01-01**. - All versions prior to, and inclusive of, 2019-02-11 have been sunsetted. You can + + All versions prior to, and inclusive of, 2019-02-11 have been sunsetted. + You can + view your version and upgrade to the latest version in your - Dashboard Settings. You will - only need to specify a version if you would like to test a newer version of + + Dashboard Settings. You will + + only need to specify a version if you would like to test a newer version + of + the API without doing a full upgrade. The API will return an error if a + version older than your current one is passed in. + ### Example Request + ```bash curl https://api.lob.com/v1/addresses \ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ -H "Lob-Version: 2024-01-01" ``` + ### Specification Versioning - You might be wondering why our API and specification use different versioning schemes. - Lob's API predates our specification and follows the Stripe versioning - approach. This works well to manage backwards-incompatible changes to our API. - For our API specification (used to create this documentation), we've chosen semantic + You might be wondering why our API and specification use different + versioning schemes. + + Lob's API predates our specification and follows the Stripe + versioning + + approach. This works well to manage backwards-incompatible changes to our + API. + + + For our API specification (used to create this documentation), we've + chosen semantic + versioning. This versioning reflects the backward-compatible + changes that do not require a versioning of Lob's API. - Lob's API specification will be used to generate artifacts like documentation, client SDKs, - and other developer tooling. Semantic versioning of our specification will inform how we - version those artifacts like SDKs. It is helpful to know the version of a specification - used to produce an artifact in order reference the specification release notes. + + Lob's API specification will be used to generate artifacts like + documentation, client SDKs, + + and other developer tooling. Semantic versioning of our specification will + inform how we + + version those artifacts like SDKs. It is helpful to know the version of a + specification + + used to produce an artifact in order reference the specification release + notes. + ### Changelog View our Changelog here. - name: Webhooks x-traitTag: true - description: | - Webhooks are an easy way to get notifications on events happening asynchronously - within Lob's architecture. For example, when a postcard gets a "Processed For - Delivery" tracking event, an event object of type `postcard.processed_for_delivery` - will be created. If you are subscribed to that event type in that Environment - (Test vs. Live), Lob will send that event to any URLs you've specified via an - HTTP POST request. In Live mode, you can only have as many webhooks as allotted - in your current Print & Mail Edition. + description: > + Webhooks are an easy way to get notifications on events happening + asynchronously + + within Lob's architecture. For example, when a postcard gets a "Processed + For + + Delivery" tracking event, an event object of type + `postcard.processed_for_delivery` + + will be created. If you are subscribed to that event type in that + Environment + + (Test vs. Live), Lob will send that event to any URLs you've specified via + an + + HTTP POST request. In Live mode, you can only have as many webhooks as + allotted + + in your current Print & Mail Edition. + There is no limit in Test mode. - You can view and create webhooks on the - Lob Dashboard, as well as view your events. - See our Webhooks Integration Guide for more - details on how to integrate. Please see the full list of event types available for + + You can view and create webhooks on the + + Lob Dashboard, as well as view your events. + + See our Webhooks Integration Guide for more + + details on how to integrate. Please see the full list of event types + available for + subscription here. -
back to top
+ +
back to + top
- name: Zip Lookups - description: | - Find a list of cities, states and associated information about a US ZIP code.
back to top
-paths: - /accounts: - get: - operationId: get_lob_credits_balance - summary: Get Lob Credits Balance - description: Returns the account's current balance of Lob Credits. - tags: - - Accounts - - Lob Credits - responses: - '200': - description: Returns a lob_credits_balance object. - content: - application/json: - schema: - $ref: '#/components/schemas/lob_credits_balance' - examples: - empty: - value: - balance: 0 - negative: - value: - balance: -1234.56 - positive: - value: - balance: 1000 - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/accounts/credits_balance \ - -u : - label: CURL - /addresses: - get: - operationId: addresses_list - summary: List - description: Returns a list of your addresses. The addresses are returned sorted by creation date, with the most recently created addresses appearing first. - tags: - - Addresses - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/before_after' - - $ref: '#/components/parameters/include' - - $ref: '#/components/parameters/date_created' - - $ref: '#/components/parameters/metadata' - responses: - '200': - $ref: '#/components/responses/all_addresses' - default: - $ref: '#/components/responses/address_error' - x-codeSamples: - - lang: Shell - source: | - curl -X GET "https://api.lob.com/v1/addresses?limit=2" \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: Typescript - source: | - try { - const addresses = await new AddressesApi(config).list(2); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.addresses.list({limit: 2}, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - addressesApi = AddressesApi.new(config) + description: > + Find a list of cities, states and associated information about a US ZIP + code. +x-tagGroups: + - name: Overview + tags: + - Introduction + - Authentication + - Getting Started + - SDKs and Tools + - name: Address Book + tags: + - Addresses + - National Change of Address + - name: Print and Mail API + tags: + - Postcards + - Self Mailers + - Letters + - Checks + - Snap Packs + - Bank Accounts + - Templates + - Template Versions + - Template Design + - Manage Mail + - name: Campaigns API (BETA) + tags: + - Campaigns + - Creatives + - Uploads + - name: Address Verification API + tags: + - US Verifications + - US Verification Types + - US Autocompletions + - Reverse Geocode Lookups + - Zip Lookups + - Identity Validation + - Intl Autocompletions + - Intl Verifications + - name: Webhooks + tags: + - Webhooks + - Events + - Tracking Events + - name: Special Features + tags: + - Billing Groups + - Buckslips + - Buckslip Orders + - Cards + - Card Orders + - QR Codes + - URL Shortener + - name: Appendix + tags: + - Beta Program + - Errors + - Rate Limiting + - Requests and Responses + - Test and Live Environments + - Versioning and Changelog +components: + securitySchemes: + basicAuth: + type: http + scheme: basic + schemas: + lob_credits_balance: + type: object + required: + - balance + properties: + balance: + type: number + description: >- + Account's current balance of Lob Credits. Can be positive, negative, + or zero. + example: 1000 + 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 ≤. + 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}' + failure_status_code: + type: integer + enum: + - 401 + - 403 + - 404 + - 413 + - 422 + - 429 + - 500 + description: | + A conventional HTTP status code: + * `401` - Authorization error with your API key or account + * `403` - Forbidden error with your API key or account + * `404` - The requested item does not exist + * `413` - Payload too large + * `422` - The query or body parameters did not pass validation + * `429` - Too many requests have been sent with an API key in a given amount of time + * `500` - An internal server error occurred, please contact support@lob.com + error: + type: object + 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. + required: + - error + properties: + error: + type: object + required: + - message + - status_code + - code + properties: + message: + type: string + description: A human-readable message with more details about the error + example: >- + Rate limit exceeded. Please wait 5 seconds and try your request + again. + status_code: + $ref: '#/components/schemas/failure_status_code' + code: + type: string + enum: + - bad_request + - conflict + - feature_limit_reached + - internal_server_error + - invalid + - not_deletable + - not_found + - request_timeout + - service_unavailable + - unrecognized_endpoint + - unsupported_lob_version + - address_length_exceeds_limit + - bank_account_already_verified + - bank_error + - billing_address_required + - custom_envelope_inventory_depleted + - deleted_bank_account + - failed_deliverability_strictness + - file_pages_below_min + - file_pages_exceed_max + - file_size_exceeds_limit + - foreign_return_address + - inconsistent_page_dimensions + - invalid_bank_account + - invalid_bank_account_verification + - invalid_check_international + - invalid_country_covid + - invalid_file + - invalid_file_dimensions + - invalid_file_download_time + - invalid_file_url + - invalid_image_dpi + - invalid_international_feature + - invalid_perforation_return_envelope + - invalid_template_html + - mail_use_type_can_not_be_null + - merge_variable_required + - merge_variable_whitespace + - payment_method_unverified + - pdf_encrypted + - special_characters_restricted + - unembedded_fonts + - email_required + - invalid_api_key + - publishable_key_not_allowed + - rate_limit_exceeded + - unauthorized + - unauthorized_token + description: > + A pre-defined string identifying an error. Error codes fall into + three categories: - begin - addresses = addressesApi.list({ limit: 2 }) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = AddressesApi(api_client) - try: - addresses = api.list(limit=2) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\AddressesApi($config, new GuzzleHttp\Client()); + **GENERIC** - try { - $result = $apiInstance->list( - 2, // limit - ); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - AddressesApi apiInstance = new AddressesApi(config); + * `bad_request` - 422: an invalid request was made. See error + message for details. - try { - AddressList response = apiInstance.list( - 2, // limit - null, // before - null, // after - null, // include - null, // dateCreated - null // metadata - ); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Address.list(%{limit: 2}) - label: ELIXIR - - lang: CSharp - source: | - AddressesApi api = new AddressesApi(config); + * `conflict` - 409/422: this operation would leave data in a + conflicted state. - List includeList = new List(); - includeList.Add("total_count"); - Dictionary metadata = new Dictionary(); - metadata.Add("name", "Harry"); - Dictionary dateCreated = new Dictionary(); - DateTime dateCreatedDate = DateTime.Today.AddMonths(-1); - dateCreated.Add("lt", dateCreatedDate); + * `feature_limit_reached` - 403: the account has reached its + resource limit and requires upgrading to add more. - try { - AddressList response = api.list( - 2, // limit - null, // before - null, // after - includeList, // include - dateCreated, // dateCreated - metadata // metadata - ); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) + * `internal_server_error` - 500: an error has occured on Lob's + servers. Please try request again. - var apiClient = *lob.NewAPIClient(configuration) - AddressList = apiClient.AddressesApi.List(context).Execute() - if err != nil { - return err - } - label: GO - post: - operationId: address_create - summary: Create - description: Creates a new address given information - tags: - - Addresses - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/address_editable' - examples: - full_us: - value: - 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 - ncoa_us_test: - value: - description: Harry - Office - name: Harry Zhang - company: Lob - email: harry@lob.com - phone: '5555555555' - address_line1: NCOA - address_line2: '#6100' - address_city: San Francisco - address_state: CA - address_zip: '94107' - address_country: US - full_intl: - value: - description: Harry - Office - name: Harry Zhang - company: Lob - email: harry@lob.com - phone: '5555555555' - address_line1: 370 WATER ST - address_line2: '' - address_city: SUMMERSIDE - address_state: PRINCE EDWARD ISLAND - address_zip: C1N 1C4 - address_country: CA - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/address_editable' - examples: - full_us: - value: - 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 - ncoa_us_test: - value: - description: Harry - Office - name: Harry Zhang - company: Lob - email: harry@lob.com - phone: '5555555555' - address_line1: NCOA - address_line2: '# 6100' - address_city: San Francisco - address_state: CA - address_zip: '94107' - address_country: US - full_intl: - value: - description: Harry - Office - name: Harry Zhang - company: Lob - email: harry@lob.com - phone: '5555555555' - address_line1: 370 WATER ST - address_line2: '' - address_city: SUMMERSIDE - address_state: PRINCE EDWARD ISLAND - address_zip: C1N 1C4 - address_country: CA - encoding: - metadata: - style: deepObject - explode: true - multipart/form-data: - schema: - $ref: '#/components/schemas/address_editable' - examples: - full_us: - value: - 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 - ncoa_us_test: - value: - description: Harry - Office - name: Harry Zhang - company: Lob - email: harry@lob.com - phone: '5555555555' - address_line1: NCOA - address_line2: '# 6100' - address_city: San Francisco - address_state: CA - address_zip: '94107' - address_country: US - full_intl: - value: - description: Harry - Office - name: Harry Zhang - company: Lob - email: harry@lob.com - phone: '5555555555' - address_line1: 370 WATER ST - address_line2: '' - address_city: SUMMERSIDE - address_state: PRINCE EDWARD ISLAND - address_zip: C1N 1C4 - address_country: CA - responses: - '200': - $ref: '#/components/responses/post_address' - default: - $ref: '#/components/responses/address_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/addresses \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ - -d "description=Harry - Office" \ - -d "name=Harry Zhang" \ - -d "company=Lob" \ - -d "email=harry@lob.com" \ - -d "phone=5555555555" \ - -d "address_line1=210 King St" \ - -d "address_line2=# 6100" \ - -d "address_city=San Francisco" \ - -d "address_state=CA" \ - -d "address_zip=94107" \ - -d "address_country=US" - label: CURL - - lang: Typescript - source: | - const addressCreate = new AddressEditable({ - 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' - }); + * `invalid` - 422: an invalid request was made. See error + message for details. - try { - const myAddress = await new AddressesApi(config).create(addressCreate); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.addresses.create({ - 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' - }, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - addressCreate = AddressEditable.new({ - 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", - }); + * `not_deletable` - 422: an attempt was made to delete a + resource, but the resource cannot be deleted. - addressApi = AddressesApi.new(config) + * `not_found` - 404: the requested resource was not found. - begin - createdAddress = addressApi.create(addressCreate) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - address_editable = AddressEditable( - 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 = CountryExtended("US"), - ) + * `request_timeout` - 408: the request took too long. Please try + again. - with ApiClient(configuration) as api_client: - api = AddressesApi(api_client) + * `service_unavailable` - 503: the Lob servers are temporarily + unavailable. Please try agian. - try: - created_address = api.create(address_editable) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\AddressesApi($config, new GuzzleHttp\Client()); + * `unrecognized_endpoint` - 404: the requested endpoint doesn't + exist. - $address_editable = new OpenAPI\Client\Model\AddressEditable( - array( - "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", - ) - ); + * `unsupported_lob_version` - 422: an unsupported Lob API + version was requested. - try { - $result = $apiInstance->create($address_editable); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - AddressesApi apiInstance = new AddressesApi(config); - try { - AddressEditable addressEditable = new AddressEditable(); - addressEditable.setDescription("Harry - Office"); - addressEditable.setName("Harry Zhang"); - addressEditable.setCompany("Lob"); - addressEditable.setEmail("harry@lob.com"); - addressEditable.setPhone("5555555555"); - addressEditable.setAddressLine1("210 King St"); - addressEditable.setAddressLine2("# 6100"); - addressEditable.setAddressCity("San Francisco"); - addressEditable.setAddressState("CA"); - addressEditable.setAddressZip("94107"); - addressEditable.setAddressCountry(CountryExtended.US); + **ADVANCED** - Address result = apiInstance.create(addressEditable); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Address.create(%{ - 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_country: "US", - address_zip: "94107" - }) - label: ELIXIR - - lang: CSharp - source: | - AddressesApi api = new AddressesApi(config); + * `address_length_exceeds_limit` - 422: the sum of + to.address_line1 and to.address_line2 cannot surpass 50 + characters. - AddressEditable addressEditable = new AddressEditable( - "210 King St", // addressLine1 - "# 6100", // addressLine2 - "San Francisco", // addressCity - "CA", // addressState - "94107", // addressZip - CountryExtended.US, // addressCountry - "Harry - Office", // description - "Harry Zhang", // name - "Lob", // company - "5555555555", // phone - "harry@lob.com" // email - ); + * `bank_account_already_verified` - 422: the bank account has + already been verified. - try { - Address result = api.create(addressEditable); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) + * `bank_error` - 422: there's an issue with the bank account. - var apiClient = *lob.NewAPIClient(configuration) + * `billing_address_required` - 403: in order to create a live + mail piece, your account needs to set up a billing address. + * `custom_envelope_inventory_depleted` - 422: custom envelope + inventory is depleted, and more will need to be ordered. - var addressCreate = *lob.NewAddressEditable() - addressCreate.SetDescription("Harry - Office") - addressCreate.SetName("Harry Zhang") - addressCreate.SetCompany("Lob") - addressCreate.SetEmail("harry@lob.com") - addressCreate.SetPhone("5555555555") - addressCreate.SetAddressLine1("210 King St") - addressCreate.SetAddressLine2("# 6100") - addressCreate.SetAddressCity("San Francisco") - addressCreate.SetAddressState("CA") - addressCreate.SetAddressZip("94107") - addressCreate.SetAddressCountry("US") + * `deleted_bank_account` - 404: checks cannot be created with a + deleted bank account. + * `failed_deliverability_strictness` - 422: the `to` address + doesn't meet strictness requirements. See Account Settings to configure strictness. + * `file_pages_below_min` - 422: not enough pages. - createdaddress, _, err := apiClient.AddressesApi.Create(context).AddressEditable(addressCreate).Execute() + * `file_pages_exceed_max` - 422: too many pages. - if err != nil { - return err - } - label: GO - /addresses/{adr_id}: - parameters: - - in: path - name: adr_id - description: id of the address - required: true - schema: - $ref: '#/components/schemas/adr_id' - get: - operationId: address_retrieve - summary: Retrieve - description: Retrieves the details of an existing address. You need only supply the unique identifier that was returned upon address creation. - tags: - - Addresses - responses: - '200': - $ref: '#/components/responses/address' - default: - $ref: '#/components/responses/address_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/addresses/adr_fa85158b26c3eb7c \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: Typescript - source: | - try { - const address = await new AddressesApi(config).get('adr_xxxx'); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.addresses.retrieve('adr_fa85158b26c3eb7c', function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - addressApi = AddressesApi.new(config) + * `file_size_exceeds_limit` - 422: the file size is too large. + See description for details. - begin - retrievedAddress = addressApi.get("adr_fa85158b26c3eb7c") - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = AddressesApi(api_client) + * `foreign_return_address` - 422: the `from` address must be a + US address. - try: - address = api.get("adr_fa85158b26c3eb7c") - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\AddressesApi($config, new GuzzleHttp\Client()); + * `inconsistent_page_dimensions` - 422: all pages of the input + file must have the same dimensions. - try { - $result = $apiInstance->get("adr_fa85158b26c3eb7c"); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - AddressesApi apiInstance = new AddressesApi(config); + * `invalid_bank_account` - 422: the provided bank routing number + is invalid. - try { - Address response = apiInstance.get("adr_fa85158b26c3eb7c"); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Address.retrieve("adr_fa85158b26c3eb7c") - label: ELIXIR - - lang: CSharp - source: | - AddressesApi api = new AddressesApi(config); + * `invalid_bank_account_verification` - 422: verification + amounts do not match. - try { - Address response = api.get("adr_fa85158b26c3eb7c"); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) + * `invalid_check_international` - 422: checks cannot be sent + internationally. - var apiClient = *lob.NewAPIClient(configuration) + * `invalid_country_covid` - 422: the postal service in the + specified country is currently unable to process the request due + to COVID-19 restrictions. - fetchedAddress, _, err := apiClient.AddressesApi.Get(context,"adr_fa85158b26c3eb7c").Execute() + * `invalid_file` - 422: the file is invalid. - if err != nil { - return err - } - label: GO - delete: - operationId: address_delete - summary: Delete - description: Deletes the details of an existing address. You need only supply the unique identifier that was returned upon address creation. - tags: - - Addresses - responses: - '200': - $ref: '#/components/responses/address_deleted' - default: - $ref: '#/components/responses/address_error' - x-codeSamples: - - lang: Shell - source: | - curl -X DELETE https://api.lob.com/v1/addresses/adr_43769b47aed248c2 \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: Typescript - source: | - try { - const deleteAddress = await new AddressesApi(config).delete('adr_xxxx'); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.addresses.delete('adr_43769b47aed248c2', function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - addressApi = AddressesApi.new(config) - - begin - deletedAddress = addressApi.delete("adr_43769b47aed248c2") - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = AddressesApi(api_client) - - try: - deleted_resource = api.delete("adr_43769b47aed248c2") - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\AddressesApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->delete("adr_43769b47aed248c2"); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - AddressesApi apiInstance = new AddressesApi(config); - - try { - AddressDeletion response = apiInstance.delete("adr_43769b47aed248c2"); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Address.delete("adr_43769b47aed248c2") - label: ELIXIR - - lang: CSharp - source: | - AddressesApi api = new AddressesApi(config); - - try { - AddressDeletion response = api.delete("adr_43769b47aed248c2"); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) + * `invalid_file_dimensions` - 422: file dimensions are incorrect + for the selected mail type. - var apiClient = *lob.NewAPIClient(configuration) + * `invalid_file_download_time` - 422: file download from remote + server took too long. - deletedAddress, _, err := apiClient.AddressesApi.Delete(context, "adr_43769b47aed248c2").Execute() + * `invalid_file_url` - 422: the file URL when creating a + resource is invalid. - if err != nil { - return err - } - label: GO - /bank_accounts/{bank_id}/verify: - parameters: - - in: path - name: bank_id - description: id of the bank account to be verified - required: true - schema: - $ref: '#/components/schemas/bank_id' - post: - operationId: bank_account_verify - summary: Verify - description: Verify a bank account in order to create a check. - tags: - - Bank Accounts - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/bank_account_verify' - example: - amounts: - - 1 - - 100 - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/bank_account_verify' - example: - amounts: - - 1 - - 100 - multipart/form-data: - schema: - $ref: '#/components/schemas/bank_account_verify' - example: - amounts: - - 1 - - 100 - responses: - '200': - $ref: '#/components/responses/post_bank_account' - default: - $ref: '#/components/responses/bank_account_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/bank_accounts/bank_dfceb4a2a05b57e/verify \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ - -d "amounts[]=25" \ - -d "amounts[]=63" - label: CURL - - lang: Typescript - source: | - const verificationData = new BankAccountVerify({ - amounts: [11, 35], - }); + * `invalid_image_dpi` - 422: DPI must be at least 300. - try { - const verifiedAccount = await new BankAccountsApi(config).verify('bank_xxxx', verificationData); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.bankAccounts.verify('bank_dfceb4a2a05b57e', { - amounts: [25, 63] - }, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - verificationData = BankAccountVerify.new({ - amounts: [ - 25, - 63, - ], - }) + * `invalid_international_feature` - 422: the specified product + cannot be sent to the destination. - bankAccountsApi = BankAccountsApi.new(config) + * `invalid_perforation_return_envelope` - 422: both + `return_envelope` and `perforation` must be used together. - begin - verifiedAccount = bankAccountsApi.verify("bank_dfceb4a2a05b57e", verificationData) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - verification_data = BankAccountVerify( - amounts = [ - 25, - 63, - ], - ) + * `invalid_template_html` - 422: the provided HTML is invalid. - with ApiClient(configuration) as api_client: - api = BankAccountsApi(api_client) + * `mail_use_type_can_not_be_null` - 422: use_type must be one of + "marketing" or "operational". Alternatively, an admin can set + the account default use type in Account Settings. - try: - verified_account = api.verify("bank_dfceb4a2a05b57e", verification_data) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\BankAccountsApi($config, new GuzzleHttp\Client()); + * `merge_variable_required` - 422: a required merge variable is + missing. - $bankVerify = new OpenAPI\Client\Model\BankAccountVerify(); - $bankVerify->setAmounts([ - 25, - 63, - ]); + * `merge_variable_whitespace` - 422: merge variable names cannot + contain whitespace. - try { - $result = $apiInstance->verify( - "bank_dfceb4a2a05b57e", $bankVerify - ); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - BankAccountVerify verification = new BankAccountVerify(); - verification.addAmountsItem(25); - verification.addAmountsItem(63); + * `payment_method_unverified` - 401: you must have a verified + bank account or credit card to submit live requests. - BankAccountsApi apiInstance = new BankAccountsApi(config); + * `pdf_encrypted` - 422: an encrypted PDF was provided. - try { - apiInstance.verify("bank_dfceb4a2a05b57e", verification); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.BankAccount.verify("bank_dfceb4a2a05b57e", %{amounts: [25, 63]}) - label: ELIXIR - - lang: CSharp - source: | - List amounts = new List(); - amounts.Add(25); - amounts.Add(63); + * `special_characters_restricted` - 422: cannot use special + characters for merge variable names. - BankAccountVerify verification = new BankAccountVerify(amounts); + * `unembedded_fonts` - 422: the provided PDF contains + non-standard unembedded fonts. See description for details. - BankAccountsApi api = new BankAccountsApi(config); - try { - BankAccount verified_account = api.verify("bank_dfceb4a2a05b57e", verification); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) + **AUTHENTICATION** - var apiClient = *lob.NewAPIClient(configuration) + * `email_required` - 401: account must have a verified email + address before creating live resources. - var bankAccountWritable = *lob.NewBankAccountWritable("322271627", "123456789", lob.BANKTYPEENUM_INDIVIDUAL, "Sinead Connor") + * `invalid_api_key` - 401/403: the API key is invalid. - createdBankAccount, _, _ := apiClient.BankAccountsApi.Create(context).BankAccountWritable(bankAccountWritable).Execute() + * `publishable_key_not_allowed` - 403: the requested operation + needs a secret key, not a publishable key. See [API + Keys](#section/API-Keys) for more information. - verifyAmounts := []int32{11, 35} - verify := *lob.NewBankAccountVerify(verifyAmounts) + * `rate_limit_exceeded` - 429: requests were sent too quickly + and must be slowed down. - verifiedAccount, _, err := apiClient.BankAccountsApi.Verify(context, createdBankAccount.Id).BankAccountVerify(verify).Execute() + * `unauthorized` - 401: the request isn't authorized. - if err != nil { - return err - } - label: GO - /bank_accounts/{bank_id}: - parameters: - - in: path - name: bank_id - description: id of the bank account - required: true - schema: - $ref: '#/components/schemas/bank_id' - get: - operationId: bank_account_retrieve - summary: Retrieve - description: Retrieves the details of an existing bank account. You need only supply the unique bank account identifier that was returned upon bank account creation. - tags: - - Bank Accounts - responses: - '200': - description: Returns a bank account object - content: - application/json: - schema: - $ref: '#/components/schemas/bank_account' - example: - id: bank_8cad8df5354d33f - signature_url: https://lob-assets.com/letters/asd_asdfghjklqwertyu.pdf?version=45&expires=1234567890&signature=a - description: Test Bank Account - metadata: {} - routing_number: '322271627' - fractional_routing_number: 25-3/440 - check_template: jpm - account_number: '123456789' - account_type: company - signatory: John Doe - bank_name: J.P. MORGAN CHASE BANK, N.A., - bank_city: Columbus - bank_state: OH - bank_zip: '43240' - verified: false - date_created: '2015-11-06T19:24:24.440Z' - date_modified: '2015-11-06T19:24:24.440Z' - object: bank_account - default: - $ref: '#/components/responses/bank_account_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/bank_accounts/bank_8cad8df5354d33f \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: Typescript - source: | - try { - const bankAccount = await new BankAccountsApi(config).get('bank_xxxx'); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.bankAccounts.retrieve('bank_8cad8df5354d33f', function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - bankAccountApi = BankAccountsApi.new(config) - - begin - retrievedBankAccount = bankAccountApi.get("bank_8cad8df5354d33f") - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = BankAccountsApi(api_client) - - try: - bank_account = api.get("bank_8cad8df5354d33f") - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\BankAccountsApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->get("bank_8cad8df5354d33f"); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - BankAccountsApi apiInstance = new BankAccountsApi(config); - - try { - BankAccount response = apiInstance.get("bank_8cad8df5354d33f"); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.BankAccount.find("bank_8cad8df5354d33f") - label: ELIXIR - - lang: CSharp - source: | - BankAccountsApi api = new BankAccountsApi(config); - - try { - BankAccount response = api.get("bank_8cad8df5354d33f"); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - fetchedBankAccount, _, err := apiClient.BankAccountsApi.Get(context,"bank_8cad8df5354d33f").Execute() - - if err != nil { - return err - } - label: GO - delete: - operationId: bank_account_delete - summary: Delete - description: Permanently deletes a bank account. It cannot be undone. - tags: - - Bank Accounts - responses: - '200': - $ref: '#/components/responses/bank_account_deleted' - default: - $ref: '#/components/responses/bank_account_error' - x-codeSamples: - - lang: Shell - source: | - curl -X DELETE https://api.lob.com/v1/bank_accounts/bank_3e64d9904356b20 \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: Typescript - source: | - try { - const deleteBankAccount = await new BankAccountsApi(config).delete('bank_xxxx'); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.bankAccounts.delete('bank_3e64d9904356b20', function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - bankAccountApi = BankAccountsApi.new(config) - - begin - deletedBankAccount = bankAccountApi.delete("bank_3e64d9904356b20") - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = BankAccountsApi(api_client) - - try: - deleted_resource = api.delete("bank_3e64d9904356b20") - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\BankAccountsApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->delete("bank_3e64d9904356b20"); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - BankAccountsApi apiInstance = new BankAccountsApi(config); - - try { - BankAccountDeletion response = apiInstance.delete("bank_3e64d9904356b20"); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.BankAccount.destroy("bank_3e64d9904356b20") - label: ELIXIR - - lang: CSharp - source: | - BankAccountsApi api = new BankAccountsApi(config); - - try { - BankAccountDeletion response = api.delete("bank_3e64d9904356b20"); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - deletedBankAccount, _, err := apiClient.BankAccountsApi.Delete(context, "bank_3e64d9904356b20").Execute() - - if err != nil { - return err - } - label: GO - /bank_accounts: - get: - operationId: bank_accounts_list - summary: List - description: Returns a list of your bank accounts. The bank accounts are returned sorted by creation date, with the most recently created bank accounts appearing first. - tags: - - Bank Accounts - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/before_after' - - $ref: '#/components/parameters/include' - - $ref: '#/components/parameters/date_created' - - $ref: '#/components/parameters/metadata' - responses: - '200': - $ref: '#/components/responses/all_bank_accounts' - default: - $ref: '#/components/responses/bank_account_error' - x-codeSamples: - - lang: Shell - source: | - curl -X GET "https://api.lob.com/v1/bank_accounts?limit=2" \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: Typescript - source: | - try { - const bankaccounts = await new BankaccountsApi(config).list(2); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.bankAccounts.list({limit: 2}, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - bankAccountsApi = BankAccountsApi.new(config) - - begin - bankAccounts = bankAccountsApi.list({ limit: 2 }) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = BankAccountsApi(api_client) - - try: - bank_accounts = api.list(limit=2) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\BankAccountsApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->list( - 2, // limit - ); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - BankAccountsApi apiInstance = new BankAccountsApi(config); - - try { - BankAccountList response = apiInstance.list( - 2, // limit - null, // before - null, // after - null, // include - null, // dateCreated - null // metadata - ); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.BankAccount.list(%{limit: 2}) - label: ELIXIR - - lang: CSharp - source: | - BankAccountsApi api = new BankAccountsApi(config); - - List includeList = new List(); - includeList.Add("total_count"); - Dictionary metadata = new Dictionary(); - metadata.Add("name", "Harry"); - Dictionary dateCreated = new Dictionary(); - DateTime dateCreatedDate = DateTime.Today.AddMonths(-1); - dateCreated.Add("lt", dateCreatedDate); - - try { - BankAccountList response = api.list( - 2, // limit - null, // before - null, // after - includeList, // include - dateCreated, // dateCreated - metadata // metadata - ); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - BankAccountList = apiClient.BankAccountsApi.List(context).Execute() - if err != nil { - return err - } - label: GO - post: - operationId: bank_account_create - summary: Create - description: Creates a new bank account with the provided properties. Bank accounts created in live mode will need to be verified via micro deposits before being able to send live checks. The deposits will appear in the bank account in 2-3 business days and have the description "VERIFICATION". - tags: - - Bank Accounts - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/bank_account_base' - example: - description: Test Bank Account - routing_number: '322271627' - account_number: '123456789' - signatory: Jane Doe - account_type: individual - metadata: - spiffy: 'true' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/bank_account_base' - example: - description: Test Bank Account - routing_number: '322271627' - account_number: '123456789' - signatory: Jane Doe - account_type: individual - metadata: - spiffy: 'true' - encoding: - metadata: - style: deepObject - explode: true - multipart/form-data: - schema: - $ref: '#/components/schemas/bank_account_base' - example: - description: Test Bank Account - routing_number: '322271627' - account_number: '123456789' - signatory: Jane Doe - account_type: individual - metadata: - spiffy: 'true' - responses: - '200': - $ref: '#/components/responses/post_bank_account' - default: - $ref: '#/components/responses/bank_account_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/bank_accounts \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ - -d "description=Test Bank Account" \ - -d "routing_number=322271627" \ - -d "account_number=123456789" \ - -d "signatory=John Doe" \ - -d "account_type=company" - label: CURL - - lang: Typescript - source: | - const bankAccountCreate = new BankAccountWritable({ - description: 'Test Bank Account', - routing_number: '322271627', - account_number: '123456789', - signatory: 'Gomez Addams', - account_type: BankTypeEnum.Individual - }); - - try { - const myBankAcount = await new BankAccountsApi(config).create(bankAccountCreate); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.bankAccounts.create({ - description: 'Test Bank Account', - routing_number: 322271627, - account_number: 123456789, - signatory: 'John Doe', - account_type: 'company' - }, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - bankAccountCreate = BankAccountWritable.new({ - description: "Test Bank Account", - routing_number: "322271627", - account_number: "123456789", - signatory: "John Doe", - account_type: BankTypeEnum::COMPANY, - }); - - bankAccountApi = BankAccountsApi.new(config) - - begin - createdBankAccount = bankAccountApi.create(bankAccountCreate) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - bank_account_writable = BankAccountWritable( - description = "Test Bank Account", - routing_number = "322271627", - account_number = "123456789", - signatory = "John Doe", - account_type = BankTypeEnum("company"), - ) - - with ApiClient(configuration) as api_client: - api = BankAccountsApi(api_client) - - try: - created_bank_account = api.create(bank_account_writable) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\BankAccountsApi($config, new GuzzleHttp\Client()); - $bank_account_writable = new OpenAPI\Client\Model\BankAccountWritable( - array( - "description" => "Test Bank Account", - "routing_number" => "322271627", - "account_number" => "123456789", - "signatory" => "John Doe", - "account_type" => "company", - ) - ); - - try { - $result = $apiInstance->create($bank_account_writable); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - BankAccountsApi apiInstance = new BankAccountsApi(config); - - try { - BankAccountWritable bankAccountWritable = new BankAccountWritable(); - bankAccountWritable.setDescription("Test Bank Account"); - bankAccountWritable.setRoutingNumber("322271627"); - bankAccountWritable.setAccountNumber("123456789"); - bankAccountWritable.setSignatory("John Doe"); - bankAccountWritable.setAccountType(BankTypeEnum.COMPANY); - - BankAccount result = apiInstance.create(bankAccountWritable); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.BankAccount.create(%{ - description: "Test Bank Account", - routing_number: "322271627", - account_number: "123456789", - signatory: "John Doe", - account_type: "company" - }) - label: ELIXIR - - lang: CSharp - source: | - BankAccountsApi api = new BankAccountsApi(config); - - BankAccountWritable bankAccountWritable = new BankAccountWritable( - "Test Bank Account", // description - "322271627", // routingNumber - "123456789", // accountNumber - BankTypeEnum.Company, // accountType - "John Doe" // signatory - ); - - try { - BankAccount result = api.create(bankAccountWritable); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - - var bankAccountCreate = *lob.NewBankAccountWritable() - bankAccountCreate.SetDescription("Test Bank Account") - bankAccountCreate.SetRoutingNumber("322271627") - bankAccountCreate.SetAccountNumber("123456789") - bankAccountCreate.SetSignatory("John Doe") - bankAccountCreate.SetAccountType("company") - - - - createdbankAccount, _, err := apiClient.BankAccountsApi.Create(context).BankAccountWritable(bankAccountCreate).Execute() - - if err != nil { - return err - } - label: GO - /billing_groups/{bg_id}: - parameters: - - in: path - name: bg_id - description: id of the billing_group - required: true - schema: - $ref: '#/components/schemas/bg_id' - get: - operationId: billing_group_retrieve - summary: Retrieve - description: Retrieves the details of an existing billing_group. You need only supply the unique billing_group identifier that was returned upon billing_group creation. - tags: - - Billing Groups - responses: - '200': - description: Returns a billing_group object. - content: - application/json: - schema: - $ref: '#/components/schemas/billing_group' - example: - id: bg_c94e83ca2cd5121 - name: Marketing Dept - description: Usage group used for the Marketing Dept resource sends - date_created: '2017-11-07T22:56:10.962Z' - date_modified: '2017-11-07T22:56:10.962Z' - object: billing_group - default: - $ref: '#/components/responses/billing_group_list_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/billing_groups/bg_4bb02b527a72667d0 \ - -u : - - lang: Ruby - source: | - billingGroupApi = BillingGroupsApi.new(config) - - begin - retrievedBillingGroup = billingGroupApi.get("bg_4bb02b527a72667d0") - rescue => err - p err.message - end - label: RUBY - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - fetchedBillingGroup, _, err := apiClient.BillingGroupsApi.Get(context,"bg_4bb02b527a72667d0").Execute() - - if err != nil { - return err - } - label: GO - post: - operationId: billing_group_update - summary: Update - description: Updates all editable attributes of the billing_group with the given id. - tags: - - Billing Groups - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/billing_group_base' - example: - name: Marketing Dept - description: Usage group used for the Marketing Dept resource sends - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/billing_group_base' - example: - name: Marketing Dept - description: Usage group used for the Marketing Dept resource sends - multipart/form-data: - schema: - $ref: '#/components/schemas/billing_group_base' - example: - name: Marketing Dept - description: Usage group used for the Marketing Dept resource sends - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/billing_groups/bg_759954f540a1bfdb5 \ - -u : \ - -d "description=demo replacement" \ - - lang: Ruby - source: | - billingGroupEditable = BillingGroupEditable.new({ - description: "demo replacement", - }) - - bgApi = BillingGroupsApi.new(config) - - begin - updatedBillingGroup = bgApi.update("bg_759954f540a1bfdb5", billingGroupEditable) - rescue => err - p err.message - end - label: RUBY - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - var bgEditable = *lob.NewBillingGroupEditable("Test Billing group") - createdBillingGroup, _, _ := apiClient.BillingGroupsApi.Create(context).BillingGroupEditable(suite.bgEditable).Execute() - - bgEditable.SetDescription("BG updated") - resp, _, err := suite.apiClient.BillingGroupsApi.Update(context, createdBillingGroup.Id).BillingGroupEditable(suite.bgEditable).Execute() - - if err != nil { - return err - } - label: GO - responses: - '200': - $ref: '#/components/responses/post_billing_group' - default: - $ref: '#/components/responses/billing_group_error' - /billing_groups: - get: - operationId: billing_groups_list - summary: List - description: Returns a list of your billing_groups. The billing_groups are returned sorted by creation date, with the most recently created billing_groups appearing first. - tags: - - Billing Groups - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/include' - - $ref: '#/components/parameters/date_created' - - $ref: '#/components/parameters/date_modified' - - in: query - name: sort_by - description: | - Sorts items by ascending or descending dates. Use either `date_created` or `date_modified`, not both. - schema: - allOf: - - type: object - properties: - date_created: - type: string - enum: - - asc - - desc - date_modified: - type: string - enum: - - asc - - desc - - oneOf: - - required: - - date_created - - required: - - date_modified - responses: - '200': - description: Returns a list of billing_groups. - content: - application/json: - schema: - allOf: - - $ref: '#/components/schemas/list' - - type: object - properties: - data: - type: array - description: list of billing_groups - items: - $ref: '#/components/schemas/billing_group' - example: - data: - - id: bg_d5a5a89da9106f8 - description: Test billing_group - metadata: {} - date_created: '2019-07-27T23:49:01.511Z' - date_modified: '2019-07-27T23:49:01.511Z' - object: billing_group - - id: bg_59b2150ae120887 - description: Test billing_group - metadata: {} - date_created: '2019-03-29T10:22:34.642Z' - date_modified: '2019-03-29T10:22:34.642Z' - object: billing_group - object: list - next_url: null - prev_url: null - count: 2 - default: - $ref: '#/components/responses/billing_group_list_error' - x-codeSamples: - - lang: Shell - source: | - curl -X GET "https://api.lob.com/v1/billing_groups?limit=2" \ - -u : - - lang: Ruby - source: | - billingGroupsApi = BillingGroupsApi.new(config) - - begin - billingGroups = billingGroupsApi.list({ limit: 2 }) - rescue => err - p err.message - end - label: RUBY - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - BillingGroupList = apiClient.BillingGroupsApi.List(context).Execute() - if err != nil { - return err - } - label: GO - post: - operationId: billing_group_create - summary: Create - description: Creates a new billing_group with the provided properties. - tags: - - Billing Groups - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/billing_group_editable' - example: - name: Marketing Dept - description: Usage group used for the Marketing Dept resource sends - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/billing_group_editable' - example: - name: Marketing Dept - description: Usage group used for the Marketing Dept resource sends - multipart/form-data: - schema: - $ref: '#/components/schemas/billing_group_editable' - example: - name: Marketing Dept - description: Usage group used for the Marketing Dept resource sends - responses: - '200': - $ref: '#/components/responses/post_billing_group' - default: - $ref: '#/components/responses/billing_group_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/billing_groups \ - -u : \ - -d "name=Marketing Department" \ - -d "description=Usage group used for the Marketing Department's resource sends" - - lang: Ruby - source: | - bgCreate = BillingGroupEditable.new({ - description: "Usage group used for the Marketing Department's resource sends", - name: "Marketing Department", - }); - - bgApi = BillingGroupsApi.new(config) - - begin - createdBillingGroup = bgApi.create(bgCreate) - rescue => err - p err.message - end - label: RUBY - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - - var bgCreate = *lob.NewBillingGroupEditable() - bgCreate.SetDescription("Usage group used for the Marketing Department's resource sends") - bgCreate.SetName("Marketing Department") - - - - createdbg, _, err := apiClient.BillingGroupsApi.Create(context).BillingGroupEditable(bgCreate).Execute() - - if err != nil { - return err - } - label: GO - /buckslips: - get: - operationId: buckslips_list - summary: List - description: Returns a list of your buckslips. The buckslips are returned sorted by creation date, with the most recently created buckslips appearing first. - tags: - - Buckslips - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/before_after' - - $ref: '#/components/parameters/include' - responses: - '200': - description: Returns a list of buckslip objects - content: - application/json: - schema: - allOf: - - $ref: '#/components/schemas/list' - - type: object - properties: - data: - type: array - description: list of buckslips - items: - $ref: '#/components/schemas/buckslip' - example: - data: - - id: bck_7a6d73c5c8457fc - account_id: fa9ea650fc7b31a89f92 - description: null - url: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA - size: 8.75x3.75 - has_front: true - has_back: true - auto_reorder: false - reorder_quantity: null - threshold_amount: 0 - raw_url: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - front_original_url: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - back_original_url: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - thumbnails: - - small: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg - medium: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA - large: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw - available_quantity: 0 - allocated_quantity: 0 - onhand_quantity: 0 - pending_quantity: 0 - projected_quantity: 0 - buckslip_orders: [] - stock: text - weight: 80# - finish: gloss - status: rendered - mode: test - date_created: '2021-03-24T22:51:42.838Z' - date_modified: '2021-03-24T22:51:42.838Z' - send_date: '2021-03-24T22:51:42.838Z' - object: buckslip - object: list - previous_url: null - next_url: null - count: 1 - default: - $ref: '#/components/responses/buckslip_error' - x-codeSamples: - - lang: Shell - source: | - curl -X GET "https://api.lob.com/v1/buckslips?limit=2" \ - -u : - label: CURL - post: - operationId: buckslip_create - summary: Create - description: Creates a new buckslip given information - tags: - - Buckslips - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/buckslip_editable' - example: - description: Test buckslip - front: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/buckslip.pdf - back: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/buckslip.pdf - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/buckslip_editable' - example: - description: Test buckslip - front: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/buckslip.pdf - back: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/buckslip.pdf - multipart/form-data: - schema: - $ref: '#/components/schemas/buckslip_editable' - example: - description: Test buckslip - front: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/buckslip.pdf - back: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/buckslip.pdf - responses: - '200': - description: Buckslip created successfully - content: - application/json: - schema: - $ref: '#/components/schemas/buckslip' - examples: - basic: - value: - id: bck_7a6d73c5c8457fc - account_id: fa9ea650fc7b31a89f92 - description: Test buckslip - url: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA - size: 8.75x3.755 - auto_reorder: false - reorder_quantity: null - threshold_amount: 0 - raw_url: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - front_original_url: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - back_original_url: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - thumbnails: - - small: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg - medium: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA - large: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw - - small: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_small_2.png?version=v1&expires=1636910992&signature=IWsmPa_ULlv2yyqjX564d_YfHHY_M7i9YxDnw-WXDr2jtOFcArmRZQbnHeE9g_rYxnddJbgosuv8-c2utiu7Cg - medium: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_medium_2.png?version=v1&expires=1636910992&signature=zxK7VKGiTvz5Ywrkaydd0v3GcYf58R7A08J4tNfI7-aiNODDcTF3l0MqY13n9Pyc8RXSdD0XVBY-OpbA1VM-Ag - large: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_large_2.png?version=v1&expires=1636910992&signature=r0OFUhh315ZwN0raMZdIwJd2oCIEYsz0BABaMxIuO1PKTD0ckGWrhcGdzk2dlWQ6vSvp0CUQ5k1RXGqkIIqkDw - available_quantity: 0 - allocated_quantity: 0 - onhand_quantity: 0 - pending_quantity: 0 - projected_quantity: 0 - buckslip_orders: [] - stock: text - weight: 80# - finish: gloss - status: rendered - mode: test - date_created: '2021-03-24T22:51:42.838Z' - date_modified: '2021-03-24T22:51:42.838Z' - send_date: '2021-03-24T22:51:42.838Z' - object: buckslip - default: - $ref: '#/components/responses/buckslip_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/buckslips \ - -u : \ - -d "description=Test buckslip" \ - -d "front=https://s3-us-west-2.amazonaws.com/public.lob.com/assets/buckslip.pdf" \ - -d "back=https://s3-us-west-2.amazonaws.com/public.lob.com/assets/buckslip.pdf" - label: CURL - /buckslips/{buckslip_id}: - parameters: - - in: path - name: buckslip_id - description: id of the buckslip - required: true - schema: - $ref: '#/components/schemas/buckslip_id' - get: - operationId: buckslip_retrieve - summary: Retrieve - description: Retrieves the details of an existing buckslip. You need only supply the unique customer identifier that was returned upon buckslip creation. - tags: - - Buckslips - responses: - '200': - description: Returns a buckslip object - content: - application/json: - schema: - $ref: '#/components/schemas/buckslip' - examples: - basic: - value: - id: bck_7a6d73c5c8457fc - account_id: fa9ea650fc7b31a89f92 - description: Test buckslip - url: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA - size: 8.75x3.755 - auto_reorder: false - reorder_quantity: null - threshold_amount: 0 - raw_url: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - front_original_url: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - back_original_url: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - thumbnails: - - small: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg - medium: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA - large: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw - - small: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_small_2.png?version=v1&expires=1636910992&signature=IWsmPa_ULlv2yyqjX564d_YfHHY_M7i9YxDnw-WXDr2jtOFcArmRZQbnHeE9g_rYxnddJbgosuv8-c2utiu7Cg - medium: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_medium_2.png?version=v1&expires=1636910992&signature=zxK7VKGiTvz5Ywrkaydd0v3GcYf58R7A08J4tNfI7-aiNODDcTF3l0MqY13n9Pyc8RXSdD0XVBY-OpbA1VM-Ag - large: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_large_2.png?version=v1&expires=1636910992&signature=r0OFUhh315ZwN0raMZdIwJd2oCIEYsz0BABaMxIuO1PKTD0ckGWrhcGdzk2dlWQ6vSvp0CUQ5k1RXGqkIIqkDw - available_quantity: 0 - allocated_quantity: 0 - onhand_quantity: 0 - pending_quantity: 0 - projected_quantity: 0 - buckslip_orders: [] - stock: text - weight: 80# - finish: gloss - status: rendered - mode: test - date_created: '2021-03-24T22:51:42.838Z' - date_modified: '2021-03-24T22:51:42.838Z' - send_date: '2021-03-24T22:51:42.838Z' - object: buckslip - default: - $ref: '#/components/responses/buckslip_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/buckslips/bck_7a6d73c5c8457fc \ - -u : - label: CURL - patch: - operationId: buckslip_update - summary: Update - description: Update the details of an existing buckslip. You need only supply the unique identifier that was returned upon buckslip creation. - tags: - - Buckslips - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/buckslip_updatable' - example: - description: Test buckslip - auto_reorder: true - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/buckslip_updatable' - example: - description: Test buckslip - auto_reorder: true - multipart/form-data: - schema: - $ref: '#/components/schemas/buckslip_updatable' - example: - description: Test buckslip - auto_reorder: true - responses: - '200': - description: Returns a buckslip object - content: - application/json: - schema: - $ref: '#/components/schemas/buckslip' - examples: - basic: - value: - id: bck_7a6d73c5c8457fc - account_id: fa9ea650fc7b31a89f92 - description: Test buckslip - url: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA - size: 8.75x3.755 - auto_reorder: false - reorder_quantity: null - threshold_amount: 0 - raw_url: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - front_original_url: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - back_original_url: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - thumbnails: - - small: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg - medium: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA - large: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw - - small: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_small_2.png?version=v1&expires=1636910992&signature=IWsmPa_ULlv2yyqjX564d_YfHHY_M7i9YxDnw-WXDr2jtOFcArmRZQbnHeE9g_rYxnddJbgosuv8-c2utiu7Cg - medium: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_medium_2.png?version=v1&expires=1636910992&signature=zxK7VKGiTvz5Ywrkaydd0v3GcYf58R7A08J4tNfI7-aiNODDcTF3l0MqY13n9Pyc8RXSdD0XVBY-OpbA1VM-Ag - large: https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_large_2.png?version=v1&expires=1636910992&signature=r0OFUhh315ZwN0raMZdIwJd2oCIEYsz0BABaMxIuO1PKTD0ckGWrhcGdzk2dlWQ6vSvp0CUQ5k1RXGqkIIqkDw - available_quantity: 0 - allocated_quantity: 0 - onhand_quantity: 0 - pending_quantity: 0 - projected_quantity: 0 - buckslip_orders: [] - stock: text - weight: 80# - finish: gloss - status: rendered - mode: test - date_created: '2021-03-24T22:51:42.838Z' - date_modified: '2021-03-24T22:51:42.838Z' - send_date: '2021-03-24T22:51:42.838Z' - object: buckslip - default: - $ref: '#/components/responses/buckslip_error' - x-codeSamples: - - lang: Shell - source: | - curl -X PATCH https://api.lob.com/v1/buckslips/bck_7a6d73c5c8457fc \ - -u : \ - -d "description=Awesome buckslip" \ - -d "auto_reorder=true" - label: CURL - delete: - operationId: buckslip_delete - summary: Delete - description: Delete an existing buckslip. You need only supply the unique identifier that was returned upon buckslip creation. - tags: - - Buckslips - responses: - '200': - $ref: '#/components/responses/buckslip_deleted' - default: - $ref: '#/components/responses/buckslip_error' - x-codeSamples: - - lang: Shell - source: | - curl -X DELETE https://api.lob.com/v1/buckslips/bck_7a6d73c5c8457fc \ - -u : - label: CURL - /buckslips/{buckslip_id}/orders: - parameters: - - in: path - name: buckslip_id - description: The ID of the buckslip to which the buckslip orders belong. - required: true - schema: - $ref: '#/components/schemas/buckslip_id' - get: - operationId: buckslip_orders_retrieve - summary: Retrieve - description: Retrieves the buckslip orders associated with the given buckslip id. - tags: - - Buckslip Orders - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - responses: - '200': - description: Returns the buckslip orders associated with the given buckslip id - content: - application/json: - schema: - allOf: - - $ref: '#/components/schemas/list' - - type: object - properties: - data: - type: array - description: List of buckslip orders - items: - $ref: '#/components/schemas/buckslip_order' - example: - data: - - id: bo_e0f8a0562a06bea7f - buckslip_id: bck_6afffd19045076c - status: available - quantity_ordered: 5000 - unit_price: 0.75 - cancelled_reason: No longer needed - availability_date: '2021-10-12T21:41:48.326Z' - expected_availability_date: '2021-11-04T21:03:18.871Z' - date_created: '2021-10-07T21:03:18.871Z' - date_modified: '2021-10-16T01:00:30.144Z' - object: buckslip_order - object: list - next_url: null - previous_url: null - count: 1 - default: - $ref: '#/components/responses/buckslip_order_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/buckslips/bck_6afffd19045076c/orders/ \ - -u : - label: CURL - post: - operationId: buckslip_order_create - summary: Create - description: Creates a new buckslip order given information - tags: - - Buckslip Orders - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/buckslip_order_editable' - example: - quantity: 10000 - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/buckslip_order_editable' - example: - quantity: 10000 - multipart/form-data: - schema: - $ref: '#/components/schemas/buckslip_order_editable' - example: - quantity: 10000 - responses: - '200': - description: Buckslip order created successfully - content: - application/json: - schema: - $ref: '#/components/schemas/buckslip_order' - examples: - basic: - value: - id: bo_e0f8a0562a06bea7f - buckslip_id: bck_6afffd19045076c - status: available - quantity_ordered: 10000 - unit_price: 0.75 - cancelled_reason: No longer needed - availability_date: '2021-10-12T21:41:48.326Z' - expected_availability_date: '2021-11-04T21:03:18.871Z' - date_created: '2021-10-07T21:03:18.871Z' - date_modified: '2021-10-16T01:00:30.144Z' - object: buckslip_order - default: - $ref: '#/components/responses/buckslip_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/buckslips/bck_6afffd19045076c/orders \ - -u : \ - -d "quantity=10000" - label: CURL - /bulk/us_verifications: - post: - operationId: bulk_us_verifications - summary: Bulk Verify - description: Verify a list of US or US territory addresses _with a live API key_. Requests to this endpoint with a test API key will return a dummy response based on the primary line you input. - tags: - - US Verifications - parameters: - - in: query - name: case - schema: - type: string - enum: - - upper - - proper - default: upper - description: Casing of the verified address. Possible values are `upper` and `proper` for uppercased (e.g. "PO BOX") and proper-cased (e.g. "PO Box"), respectively. Only affects `recipient`, `primary_line`, `secondary_line`, `urbanization`, and `last_line`. Default casing is `upper`. - required: false - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/multiple_components_list' - example: - addresses: - - primary_line: 210 King Street - city: San Francisco - state: CA - zip_code: '94107' - - recipient: Walgreens - primary_line: Ave Wilson Churchill 123 - secondary_line: '' - urbanization: URB FAIR OAKS - city: RIO PIEDRAS - state: PR - zip_code: '00926' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/multiple_components_list' - example: - addresses: - - primary_line: 210 King Street - city: San Francisco - state: CA - zip_code: '94107' - - recipient: Walgreens - primary_line: Ave Wilson Churchill 123 - secondary_line: '' - urbanization: URB FAIR OAKS - city: RIO PIEDRAS - state: PR - zip_code: '00926' - multipart/form-data: - schema: - $ref: '#/components/schemas/multiple_components_list' - example: - addresses: - - primary_line: 210 King Street - city: San Francisco - state: CA - zip_code: '94107' - - recipient: Walgreens - primary_line: Ave Wilson Churchill 123 - secondary_line: '' - urbanization: URB FAIR OAKS - city: RIO PIEDRAS - state: PR - zip_code: '00926' - responses: - '200': - $ref: '#/components/responses/bulk_us_verifications' - default: - $ref: '#/components/responses/us_verifications_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/bulk/us_verifications \ - -u : \ - --header 'Content-Type: application/x-www-form-urlencoded' \ - --data-urlencode 'addresses[0][primary_line]=210 King Street' \ - --data-urlencode 'addresses[0][city]=San Francisco' \ - --data-urlencode 'addresses[0][state]=CA' \ - --data-urlencode 'addresses[0][zip_code]=94017' - label: CURL - - lang: Typescript - source: | - const UsVerifications = new USVerificationsApi(av_config); - const verificationData1: UsVerificationsWritable = { - primary_line: '210 King St', - city: 'San Francisco', - state: 'CA', - zip_code: '94107' - }; - const verificationData2: UsVerificationsWritable = { - primary_line: '185 BERRY ST STE 6600', - city: 'SAN FRANCISCO', - state: 'CA', - zip_code: '94107' - }; - const addressList: MultipleComponentsList = { - addresses: [verificationData1, verificationData2], - }; - - try { - const bulkVerified = await UsVerifications.verifyBulk(addressList); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.bulkUSVerifications.verify({ - addresses: [{ - primary_line: '210 King St', - city: 'San Francisco', - state: 'CA', - zip_code: '94107' - }] - }), function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - usVerificationsApi = UsVerificationsApi.new(config) - - verificationData0 = MultipleComponents.new({ - primary_line: "210 King Street", - city: "San Francisco", - state: "CA", - zip_code: "94017", - }) - - verificationData1 = MultipleComponents.new({ - primary_line: "185 BERRY ST STE 6600", - city: "SAN FRANCISCO", - state: "CA", - zip_code: "94017", - }) - - - addressList = MultipleComponentsList.new({ - addresses: [ - verificationData0, - verificationData1, - ], - }) - - begin - bulkVerifiedAddrs = usVerificationsApi.verifyBulk(addressList) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = UsVerificationsApi(api_client) - - verification_data_0 = MultipleComponents( - primary_line = "210 King Street", - city = "San Francisco", - state = "CA", - zip_code = "94017", - ) - - verification_data_1 = MultipleComponents( - primary_line = "185 BERRY ST STE 6600", - city = "SAN FRANCISCO", - state = "CA", - zip_code = "94017", - ) - - - address_list = MultipleComponentsList( - addresses = [ - verification_data_0, - verification_data_1, - ], - ) - - try: - bulk_verified = api.verifyBulk(address_list) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $verificationData0 = new OpenAPI\Client\Model\MultipleComponents(array( - 'primary_line' => '210 King Street', - 'city' => 'San Francisco', - 'state' => 'CA', - 'zip_code' => '94017', - )); - - $verificationData1 = new OpenAPI\Client\Model\MultipleComponents(array( - 'primary_line' => '185 BERRY ST STE 6600', - 'city' => 'SAN FRANCISCO', - 'state' => 'CA', - 'zip_code' => '94017', - )); - - $addressList = new OpenAPI\Client\Model\MultipleComponentsList(array( - 'addresses' => [ - $verificationData0, - $verificationData1, - ] - )); - - try { - $result = $apiInstance->verifyBulk($addressList); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - MultipleComponentsList bulkVerify = new MultipleComponentsList(); - MultipleComponents bulkAddress0 = new MultipleComponents(); - bulkAddress0.setPrimaryLine("210 King Street"); - bulkAddress0.setCity("San Francisco"); - bulkAddress0.setState("CA"); - bulkAddress0.setZipCode("94017"); - bulkVerify.addAddressesItem(bulkAddress0); - - MultipleComponents bulkAddress1 = new MultipleComponents(); - bulkAddress1.setPrimaryLine("185 BERRY ST STE 6600"); - bulkAddress1.setCity("SAN FRANCISCO"); - bulkAddress1.setState("CA"); - bulkAddress1.setZipCode("94017"); - bulkVerify.addAddressesItem(bulkAddress1); - - UsVerificationsApi apiInstance = new UsVerificationsApi(config); - try { - UsVerifications bulkVerifyResponse = apiInstance.verifyBulk(bulkVerify, null); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.BulkUSVerification.verify.verify( - %{ - addresses:[ - { - primary_line: "210 King Street", - city: "San Francisco", - state: "CA", - zip_code: "94107" - } - ] - }) - label: ELIXIR - - lang: CSharp - source: | - List addresses = new List(); - MultipleComponents bulkAddress0 = new MultipleComponents( - null, // recipient - "210 King Street", // primaryLine - null, // secondaryLine - null, // urbanization - "San Francisco", // city - "CA", // state - "94017" // zipCode - ); - addresses.Add(bulkAddress0); - - MultipleComponents bulkAddress1 = new MultipleComponents( - null, // recipient - "185 BERRY ST STE 6600", // primaryLine - null, // secondaryLine - null, // urbanization - "San Francisco", // city - "CA", // state - "94017" // zipCode - ); - addresses.Add(bulkAddress1); - - MultipleComponentsList bulkVerify = new MultipleComponentsList(addresses); - - UsVerificationsApi api = new UsVerificationsApi(config); - try { - UsVerifications bulkVerifyResponse = api.verifyBulk(bulkVerify, null); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - /bulk/intl_verifications: - post: - operationId: bulk_intl_verifications - summary: Bulk Verify - description: Verify a list of international (except US or US territories) address _with a live API key_. Requests to this endpoint with a test API key will return a dummy response based on the primary line you input. - tags: - - Intl Verifications - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/intl_verifications_payload' - example: - addresses: - - recipient: John Doe - primary_line: 370 Water St - secondary_line: '' - city: Summerside - state: Prince Edwards Island - postal_code: C1N 1C4 - country: CA - - recipient: Jane Doe - primary_line: UL. DOLSKAYA 1 - secondary_line: '' - city: MOSCOW - state: MOSCOW G - postal_code: '115569' - country: RU - multipart/form-data: - schema: - $ref: '#/components/schemas/intl_verifications_payload' - example: - addresses: - - recipient: John Doe - primary_line: 370 Water St - secondary_line: '' - city: Summerside - state: Prince Edwards Island - postal_code: C1N 1C4 - country: CA - - recipient: Jane Doe - primary_line: UL. DOLSKAYA 1 - secondary_line: '' - city: MOSCOW - state: MOSCOW G - postal_code: '115569' - country: RU - responses: - '200': - $ref: '#/components/responses/bulk_intl_verifications' - default: - $ref: '#/components/responses/intl_verifications_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/bulk/intl_verifications \ - -u : \ - --header 'Content-Type: application/x-www-form-urlencoded' \ - --data-urlencode 'addresses[0][primary_line]=370 WATER ST' \ - --data-urlencode 'addresses[0][postal_code]=C1N 1C4' \ - --data-urlencode 'addresses[0][country]=CA' - label: CURL - - lang: Typescript - source: | - const IntlVerifications = new IntlVerificationsApi(av_config); - let verificationData1: IntlVerificationWritable = { - primary_line: '370 WATER ST', - postal_code: 'C1N 1C4', - country: CountryExtended.Ca - }; - const verificationData2: IntlVerificationWritable = { - primary_line: '012 PLACEHOLDER ST', - postal_code: 'F0O 8A2', - country: CountryExtended.Ca - }; - let addressList = new IntlVerificationsPayload({ - addresses: [verificationData1, verificationData2] - }); - - try { - const bulkVerified = await IntlVerifications.verifyBulk(addressList); - - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.bulkIntlVerifications.verify({ - addresses: [{ - primary_line: '370 Water St', - secondary_line: '', - city: 'Summerside', - state: 'Prince Edward Island', - postal_code: 'C1N 1C4', - country: 'CA' - }] - }), function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - intlVerificationsApi = IntlVerificationsApi.new(config) - - verificationData0 = MultipleComponentsIntl.new({ - primary_line: "35 Tower Hill", - city: "London", - postal_code: "EC3N 4DR", - country: "GB", - }) - - verificationData1 = MultipleComponentsIntl.new({ - primary_line: "370 Water St", - city: "Summerside", - state: "Prince Edward Island", - postal_code: "C1N 1C4", - country: "CA", - }) - - - addressList = IntlVerificationsPayload.new({ - addresses: [ - verificationData0, - verificationData1, - ], - }) - - begin - bulkVerifiedAddrs = intlVerificationsApi.verifyBulk(addressList) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = IntlVerificationsApi(api_client) - - verification_data_0 = MultipleComponentsIntl( - primary_line = "35 Tower Hill", - city = "London", - postal_code = "EC3N 4DR", - country = CountryExtended("GB"), - ) - - verification_data_1 = MultipleComponentsIntl( - primary_line = "370 Water St", - city = "Summerside", - state = "Prince Edward Island", - postal_code = "C1N 1C4", - country = CountryExtended("CA"), - ) - - - address_list = IntlVerificationsPayload( - addresses = [ - verification_data_0, - verification_data_1, - ], - ) - - try: - bulk_verified = api.verifyBulk(address_list) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $verificationData0 = new OpenAPI\Client\Model\MultipleComponentsIntl(array( - 'primary_line' => '35 Tower Hill', - 'city' => 'London', - 'postal_code' => 'EC3N 4DR', - 'country' => 'GB', - )); - - $verificationData1 = new OpenAPI\Client\Model\MultipleComponentsIntl(array( - 'primary_line' => '370 Water St', - 'city' => 'Summerside', - 'state' => 'Prince Edward Island', - 'postal_code' => 'C1N 1C4', - 'country' => 'CA', - )); - - $addressList = new OpenAPI\Client\Model\IntlVerificationsPayload(array( - 'addresses' => [ - $verificationData0, - $verificationData1, - ] - )); - - try { - $result = $apiInstance->verifyBulk($addressList); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - List addresses = new ArrayList(); - addresses.add(new IntlVerification.RequestBuilder() - .setPrimaryLine("370 Water St") - .setCity("Summerside") - .setState("Prince Edward Island") - .setPostalCode("C1N 1C4") - .setCountry("CA")); - LobResponse response = new BulkIntlVerification.RequestBuilder() - .setAddresses(addresses) - .verify(); - BulkIntlVerification bulkIntlVerification = response.getResponseBody(); - label: JAVA - - lang: Elixir - source: | - Lob.BulkIntlVerification.verify.verify( - %{addresses:[ - { - primary_line: '370 Water St', - secondary_line: '', - city: 'Summerside', - state: 'Prince Edward Island', - postal_code: 'C1N 1C4', - country: 'CA' - } - ] - }) - label: ELIXIR - - lang: CSharp - source: | - List addresses = new List(); - MultipleComponentsIntl bulkAddress0 = new MultipleComponentsIntl( - null, // recipient - "35 Tower Hill", // primaryLine - null, // secondaryLine - "London", // city - null, // state - "EC3N 4DR", // postalCode - CountryExtended.GB // country - ); - addresses.Add(bulkAddress0); - - MultipleComponentsIntl bulkAddress1 = new MultipleComponentsIntl( - null, // recipient - "370 Water St", // primaryLine - null, // secondaryLine - "Summerside", // city - "Prince Edward Island", // state - "C1N 1C4", // postalCode - CountryExtended.CA // country - ); - addresses.Add(bulkAddress1); - - IntlVerificationsPayload bulkVerify = new IntlVerificationsPayload(addresses); - - IntlVerificationsApi api = new IntlVerificationsApi(config); - - try { - IntlVerifications bulkVerifyResponse = api.verifyBulk(bulkVerify); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - /campaigns: - get: - operationId: campaigns_list - summary: List - description: Returns a list of your campaigns. The campaigns are returned sorted by creation date, with the most recently created campaigns appearing first. - tags: - - Campaigns - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/include' - - $ref: '#/components/parameters/before_after' - responses: - '200': - $ref: '#/components/responses/all_campaigns' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/campaigns \ - -u : - label: CURL - - lang: Ruby - source: | - campaignsApi = CampaignsApi.new(config) - - begin - campaigns = campaignsApi.list({ limit: 2 }) - rescue => err - p err.message - end - label: RUBY - post: - operationId: campaign_create - summary: Create - description: Creates a new campaign with the provided properties. See how to launch your first campaign [here](https://help.lob.com/print-and-mail/building-a-mail-strategy/campaign-or-triggered-sends/launch-your-first-campaign). - tags: - - Campaigns - parameters: - - $ref: '#/components/parameters/lang_spec' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/campaign_writable' - example: - name: My Demo Campaign - description: My Campaign's description - schedule_type: immediate - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/campaign_writable' - encoding: - example-prop: - style: deepObject - explode: true - example: - name: My Demo Campaign - description: My Campaign's description - schedule_type: immediate - multipart/form-data: - schema: - $ref: '#/components/schemas/campaign_writable' - example: - name: My Demo Campaign - description: My Campaign's description - schedule_type: immediate - responses: - '200': - description: Campaign created successfully - content: - application/json: - schema: - $ref: '#/components/schemas/campaign' - example: - id: cmp_e05ee61ff80764b - billing_group_id: bg_fe3079dcdd80e5ae - name: My Campaign - description: My Campaign's description - schedule_type: immediate - cancel_window_campaign_minutes: 60 - metadata: {} - use_type: marketing - is_draft: true - deleted: false - creatives: [] - uploads: [] - auto_cancel_if_ncoa: false - date_created: '2017-09-05T17:47:53.767Z' - date_modified: '2017-09-05T17:47:53.767Z' - object: campaign - default: - $ref: '#/components/responses/campaigns_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/campaigns \ - -u : \ - -d "name=My First Campaign" \ - -d "schedule_type=immediate" - label: CURL - - lang: Ruby - source: | - campaignCreate = CampaignWritable.new({ - name: "My First Campaign", - schedule_type: "immediate", - }); - - campaignApi = CampaignsApi.new(config) - - begin - createdCampaign = campaignApi.create(campaignCreate) - rescue => err - p err.message - end - label: RUBY - /campaigns/{cmp_id}: - parameters: - - in: path - name: cmp_id - description: id of the campaign - required: true - schema: - $ref: '#/components/schemas/cmp_id' - get: - operationId: campaign_retrieve - summary: Retrieve - description: Retrieves the details of an existing campaign. You need only supply the unique campaign identifier that was returned upon campaign creation. - tags: - - Campaigns - responses: - '200': - description: Returns a campaign object - content: - application/json: - schema: - $ref: '#/components/schemas/campaign' - example: - id: cmp_e05ee61ff80764b - billing_group_id: bg_fe3079dcdd80e5ae - name: My Campaign - description: My Campaign's description - schedule_type: immediate - cancel_window_campaign_minutes: 60 - metadata: {} - use_type: marketing - is_draft: true - deleted: false - creatives: [] - uploads: [] - auto_cancel_if_ncoa: false - date_created: '2017-09-05T17:47:53.767Z' - date_modified: '2017-09-05T17:47:53.767Z' - object: campaign - default: - $ref: '#/components/responses/campaigns_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/campaigns/cmp_e05ee61ff80764b \ - -u : - label: CURL - - lang: Ruby - source: | - campaignApi = CampaignsApi.new(config) - - begin - retrievedCampaign = campaignApi.get("cmp_e05ee61ff80764b") - rescue => err - p err.message - end - label: RUBY - patch: - operationId: campaign_update - summary: Update - description: Update the details of an existing campaign. You need only supply the unique identifier that was returned upon campaign creation. - tags: - - Campaigns - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/campaign_updatable' - example: - description: Test campaign - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/campaign_updatable' - example: - description: Test campaign - multipart/form-data: - schema: - $ref: '#/components/schemas/campaign_updatable' - example: - description: Test campaign - responses: - '200': - description: Returns a campaign object - content: - application/json: - schema: - $ref: '#/components/schemas/campaign' - example: - id: cmp_e05ee61ff80764b - billing_group_id: bg_fe3079dcdd80e5ae - name: My Campaign - description: My Campaign's description - schedule_type: immediate - cancel_window_campaign_minutes: 60 - metadata: {} - use_type: marketing - is_draft: true - deleted: false - creatives: [] - uploads: [] - auto_cancel_if_ncoa: false - date_created: '2017-09-05T17:47:53.767Z' - date_modified: '2017-09-05T17:47:53.767Z' - object: campaign - default: - $ref: '#/components/responses/campaigns_error' - x-codeSamples: - - lang: Shell - source: | - curl -X PATCH https://api.lob.com/v1/campaigns/cmp_e05ee61ff80764b \ - -u : \ - -d "description=Awesome campaign" - label: CURL - - lang: Python - source: | - campaign_updatable = CampaignUpdatable( - description = "Awesome campaign", - ) - - with ApiClient(configuration) as api_client: - api = CampaignsApi(api_client) - - try: - updated_campaign = api.update("cmp_e05ee61ff80764b", campaign_updatable) - except ApiException as e: - print(e) - label: PYTHON - - lang: Ruby - source: | - campaignUpdatable = CampaignUpdatable.new({ - description: "Awesome campaign", - }) - - campaignApi = CampaignsApi.new(config) - - begin - updatedCampaign = campaignApi.update("cmp_e05ee61ff80764b", campaignUpdatable) - rescue => err - p err.message - end - label: RUBY - delete: - operationId: campaign_delete - summary: Delete - description: Delete an existing campaign. You need only supply the unique identifier that was returned upon campaign creation. Deleting a campaign also deletes any associated mail pieces that have been created but not sent. A campaign's `send_date` matches its associated mail pieces' `send_date`s. - tags: - - Campaigns - responses: - '200': - $ref: '#/components/responses/campaign_deleted' - default: - $ref: '#/components/responses/campaigns_error' - x-codeSamples: - - lang: Shell - source: | - curl -X DELETE https://api.lob.com/v1/campaigns/cmp_e05ee61ff80764b \ - -u : - label: CURL - - lang: Ruby - source: | - campaignApi = CampaignsApi.new(config) - - begin - deletedCampaign = campaignApi.delete("cmp_e05ee61ff80764b") - rescue => err - p err.message - end - label: RUBY - /campaigns/{cmp_id}/send: - parameters: - - in: path - name: cmp_id - description: id of the campaign - required: true - schema: - $ref: '#/components/schemas/cmp_id' - post: - operationId: campaign_send - summary: Send Campaign - description: Sends a campaign. You need only supply the unique campaign identifier that was returned upon campaign creation. - tags: - - Campaigns - responses: - '200': - description: Returns a campaign object - content: - application/json: - schema: - $ref: '#/components/schemas/campaign' - example: - id: cmp_e05ee61ff80764b - billing_group_id: bg_fe3079dcdd80e5ae - name: My Campaign - description: My Campaign's description - schedule_type: immediate - cancel_window_campaign_minutes: 60 - metadata: {} - use_type: marketing - is_draft: true - deleted: false - creatives: [] - uploads: [] - auto_cancel_if_ncoa: false - date_created: '2017-09-05T17:47:53.767Z' - date_modified: '2017-09-05T17:47:53.767Z' - object: campaign - default: - $ref: '#/components/responses/campaigns_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/campaigns/cmp_e05ee61ff80764b/send \ - -u : - label: CURL - /cards: - get: - operationId: cards_list - summary: List - description: Returns a list of your cards. The cards are returned sorted by creation date, with the most recently created addresses appearing first. - tags: - - Cards - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/before_after' - - $ref: '#/components/parameters/include' - responses: - '200': - description: Returns a list of card objects - content: - application/json: - schema: - allOf: - - $ref: '#/components/schemas/list' - - type: object - properties: - data: - type: array - description: list of cards - items: - $ref: '#/components/schemas/card' - example: - data: - - id: card_7a6d73c5c8457fc - account_id: fa9ea650fc7b31a89f92 - description: null - url: https://lob-assets.com/cards/card_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA - size: 2.125x3.375 - auto_reorder: false - reorder_quantity: null - raw_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - front_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - back_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - thumbnails: - - small: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg - medium: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA - large: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw - available_quantity: 10000 - pending_quantity: 0 - countries: null - status: rendered - mode: test - orientation: horizontal - threshold_amount: 0 - date_created: '2021-03-24T22:51:42.838Z' - date_modified: '2021-03-24T22:51:42.838Z' - send_date: '2021-03-24T22:51:42.838Z' - object: card - object: list - previous_url: null - next_url: null - count: 1 - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl -X GET "https://api.lob.com/v1/cards?limit=2" \ - -u : - label: CURL - - lang: Typescript - source: | - try { - const cards = await new CardsApi(config).list(2); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.cards.list({limit: 2}, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = CardsApi(api_client) - - try: - cards = api.list(limit=2) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $lob->cards()->all(array( - 'limit' => 2 - )); - - lang: CSharp - source: | - CardsApi api = new CardsApi(config); - List includeList = new List(); - includeList.Add("total_count"); - - try { - CardList response = api.list( - 2, // limit - null, // before - null, // after - includeList // include - ); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Ruby - source: | - cardsApi = CardsApi.new(config) - - begin - cards = cardsApi.list({ limit: 2 }) - rescue => err - p err.message - end - label: RUBY - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - CardList = apiClient.CardsApi.List(context).Execute() - if err != nil { - return err - } - label: GO - post: - operationId: card_create - summary: Create - description: Creates a new card given information - tags: - - Cards - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/card_editable' - example: - description: Test card - front: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf - back: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf - size: 2.125x3.375 - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/card_editable' - example: - description: Test card - front: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf - back: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf - size: 2.125x3.375 - multipart/form-data: - schema: - $ref: '#/components/schemas/card_editable' - example: - description: Test card - front: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf - back: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf - size: 2.125x3.375 - responses: - '200': - description: Card created successfully - content: - application/json: - schema: - $ref: '#/components/schemas/card' - examples: - basic: - value: - id: card_7a6d73c5c8457fc - account_id: fa9ea650fc7b31a89f92 - description: Test card - url: https://lob-assets.com/cards/card_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA - size: 2.125x3.375 - auto_reorder: false - reorder_quantity: null - raw_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - front_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - back_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - thumbnails: - - small: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg - medium: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA - large: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw - - small: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_2.png?version=v1&expires=1636910992&signature=IWsmPa_ULlv2yyqjX564d_YfHHY_M7i9YxDnw-WXDr2jtOFcArmRZQbnHeE9g_rYxnddJbgosuv8-c2utiu7Cg - medium: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_2.png?version=v1&expires=1636910992&signature=zxK7VKGiTvz5Ywrkaydd0v3GcYf58R7A08J4tNfI7-aiNODDcTF3l0MqY13n9Pyc8RXSdD0XVBY-OpbA1VM-Ag - large: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_2.png?version=v1&expires=1636910992&signature=r0OFUhh315ZwN0raMZdIwJd2oCIEYsz0BABaMxIuO1PKTD0ckGWrhcGdzk2dlWQ6vSvp0CUQ5k1RXGqkIIqkDw - available_quantity: 10000 - pending_quantity: 0 - countries: null - status: rendered - mode: test - orientation: horizontal - threshold_amount: 0 - date_created: '2021-03-24T22:51:42.838Z' - date_modified: '2021-03-24T22:51:42.838Z' - send_date: '2021-03-24T22:51:42.838Z' - object: card - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/cards \ - -u : \ - -d "description=Test card" \ - -d "front=https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf" \ - -d "back=https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf" \ - -d "size=2.125x3.375" - label: CURL - - lang: Typescript - source: | - const cardsCreate = new CardEditable({ - front: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf', - back: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf', - size: CardEditableSizeEnum._2125x3375, - description: 'Test card' - }); - - try { - const myCard = await new CardsApi(config).create(cardsCreate); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.cards.create({ - description: 'Test card', - front: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf', - back: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf', - size: '2.125x3.375' - }, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Python - source: | - card_editable = CardEditable( - front = "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf", - back = "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf", - size = "2.125x3.375", - description = "Test Card", - ) - - with ApiClient(configuration) as api_client: - api = CardsApi(api_client) - - try: - created_card = api.create(card_editable) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $lob->cards()->create(array( - 'description' => 'Test card', - 'front' => 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf', - 'back' => 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf', - 'size' => => '2.125x3.375' - )); - label: PHP - - lang: CSharp - source: | - CardsApi api = new CardsApi(config); - - CardEditable cardEditable = new CardEditable( - "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf", // front - "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf", // back - CardEditable.SizeEnum._2125x3375, // size - "Test Card" // description - ); - - try { - Card result = api.create(cardEditable); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Ruby - source: | - cardCreate = CardEditable.new({ - front: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf", - back: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf", - size: "2.125x3.375", - description: "Test Card", - }); - - cardApi = CardsApi.new(config) - - begin - createdCard = cardApi.create(cardCreate) - rescue => err - p err.message - end - label: RUBY - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - - var cardCreate = *lob.NewCardEditable() - cardCreate.SetFront("https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf") - cardCreate.SetBack("https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf") - cardCreate.SetSize("2.125x3.375") - cardCreate.SetDescription("Test Card") - - - - createdcard, _, err := apiClient.CardsApi.Create(context).CardEditable(cardCreate).Execute() - - if err != nil { - return err - } - label: GO - /cards/{card_id}: - parameters: - - in: path - name: card_id - description: id of the card - required: true - schema: - $ref: '#/components/schemas/card_id' - get: - operationId: card_retrieve - summary: Retrieve - description: Retrieves the details of an existing card. You need only supply the unique customer identifier that was returned upon card creation. - tags: - - Cards - responses: - '200': - description: Returns a card object - content: - application/json: - schema: - $ref: '#/components/schemas/card' - examples: - basic: - value: - id: card_7a6d73c5c8457fc - account_id: fa9ea650fc7b31a89f92 - description: Test card - url: https://lob-assets.com/cards/card_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA - size: 2.125x3.375 - auto_reorder: false - reorder_quantity: null - raw_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - front_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - back_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - thumbnails: - - small: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg - medium: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA - large: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw - - small: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_2.png?version=v1&expires=1636910992&signature=IWsmPa_ULlv2yyqjX564d_YfHHY_M7i9YxDnw-WXDr2jtOFcArmRZQbnHeE9g_rYxnddJbgosuv8-c2utiu7Cg - medium: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_2.png?version=v1&expires=1636910992&signature=zxK7VKGiTvz5Ywrkaydd0v3GcYf58R7A08J4tNfI7-aiNODDcTF3l0MqY13n9Pyc8RXSdD0XVBY-OpbA1VM-Ag - large: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_2.png?version=v1&expires=1636910992&signature=r0OFUhh315ZwN0raMZdIwJd2oCIEYsz0BABaMxIuO1PKTD0ckGWrhcGdzk2dlWQ6vSvp0CUQ5k1RXGqkIIqkDw - available_quantity: 10000 - pending_quantity: 0 - countries: null - status: rendered - mode: test - orientation: horizontal - threshold_amount: 0 - date_created: '2021-03-24T22:51:42.838Z' - date_modified: '2021-03-24T22:51:42.838Z' - send_date: '2021-03-24T22:51:42.838Z' - object: card - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/cards/card_7a6d73c5c8457fc \ - -u : - label: CURL - - lang: Typescript - source: | - try { - const card = await new CardsApi(config).get('card_xxxx'); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.cards.retrieve('card_7a6d73c5c8457fc', function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = CardsApi(api_client) - - try: - card = api.get("card_7a6d73c5c8457fc") - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $lob->cards()->get('card_7a6d73c5c8457fc'); - label: PHP - - lang: CSharp - source: | - CardsApi api = new CardsApi(config); - - try { - Card response = api.get("card_7a6d73c5c8457fc"); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Ruby - source: | - cardApi = CardsApi.new(config) - - begin - retrievedCard = cardApi.get("card_7a6d73c5c8457fc") - rescue => err - p err.message - end - label: RUBY - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - fetchedCard, _, err := apiClient.CardsApi.Get(context,"card_7a6d73c5c8457fc").Execute() - - if err != nil { - return err - } - label: GO - post: - operationId: card_update - summary: Update - description: Update the details of an existing card. You need only supply the unique identifier that was returned upon card creation. - tags: - - Cards - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/card_updatable' - example: - description: Test card - auto_reorder: true - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/card_updatable' - example: - description: Test card - auto_reorder: true - multipart/form-data: - schema: - $ref: '#/components/schemas/card_updatable' - example: - description: Test card - auto_reorder: true - responses: - '200': - description: Returns a card object - content: - application/json: - schema: - $ref: '#/components/schemas/card' - examples: - basic: - value: - id: card_7a6d73c5c8457fc - account_id: fa9ea650fc7b31a89f92 - description: Test card - url: https://lob-assets.com/cards/card_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA - size: 2.125x3.375 - auto_reorder: false - reorder_quantity: null - raw_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - front_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - back_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - thumbnails: - - small: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg - medium: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA - large: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw - - small: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_2.png?version=v1&expires=1636910992&signature=IWsmPa_ULlv2yyqjX564d_YfHHY_M7i9YxDnw-WXDr2jtOFcArmRZQbnHeE9g_rYxnddJbgosuv8-c2utiu7Cg - medium: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_2.png?version=v1&expires=1636910992&signature=zxK7VKGiTvz5Ywrkaydd0v3GcYf58R7A08J4tNfI7-aiNODDcTF3l0MqY13n9Pyc8RXSdD0XVBY-OpbA1VM-Ag - large: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_2.png?version=v1&expires=1636910992&signature=r0OFUhh315ZwN0raMZdIwJd2oCIEYsz0BABaMxIuO1PKTD0ckGWrhcGdzk2dlWQ6vSvp0CUQ5k1RXGqkIIqkDw - available_quantity: 10000 - pending_quantity: 0 - countries: null - status: rendered - mode: test - orientation: horizontal - threshold_amount: 0 - date_created: '2021-03-24T22:51:42.838Z' - date_modified: '2021-03-24T22:51:42.838Z' - send_date: '2021-03-24T22:51:42.838Z' - object: card - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl -X POST https://api.lob.com/v1/cards/card_7a6d73c5c8457fc \ - -u : \ - -d "description=Awesome card" \ - -d "auto_reorder=true" - label: CURL - - lang: Typescript - source: | - const cardUpdatable = new CardEditable ({ - description: 'Awesome card', - auto_reorder: true - }); - - try { - await new CardsApi(config).update(cardUpdatable); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.cards.update('card_7a6d73c5c8457fc', { - description: 'Awesome card', - auto_reorder: true - }, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: CSharp - source: | - CardsApi api = new CardsApi(config); - CardUpdatable update = new CardUpdatable("Awesome card", true, 15000); - - try { - api.update("card_6afffd19045076c", update); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Python - source: | - card_updatable = CardUpdatable( - description = "Awesome card", - auto_reorder = True, - reorder_quantity = 10000, - ) - - with ApiClient(configuration) as api_client: - api = CardsApi(api_client) - - try: - updated_card = api.update("card_6afffd19045076c", card_updatable) - except ApiException as e: - print(e) - label: PYTHON - - lang: Ruby - source: | - cardUpdatable = CardUpdatable.new({ - description: "Awesome card", - auto_reorder: "true", - reorder_quantity: 10000, - }) - - cardApi = CardsApi.new(config) - - begin - updatedCard = cardApi.update("card_6afffd19045076c", cardUpdatable) - rescue => err - p err.message - end - label: RUBY - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - cardEditable = *lob.NewCardEditable("https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf()") - createdCard, _, _ := apiClient.CardsApi.Create(context).CardEditable(suite.cardEditable).Execute() - var updatedCard = *lob.NewCardUpdatable() - updatedCard.SetDescription("Card was updated") - - resp, _, err := suite.apiClient.CardsApi.Update(context, createdCard.Id).CardUpdatable(updatedCard).Execute() - - if err != nil { - return err - } - label: GO - delete: - operationId: card_delete - summary: Delete - description: Delete an existing card. You need only supply the unique identifier that was returned upon card creation. - tags: - - Cards - responses: - '200': - $ref: '#/components/responses/card_deleted' - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl -X DELETE https://api.lob.com/v1/cards/card_7a6d73c5c8457fc \ - -u : - label: CURL - - lang: Typescript - source: | - try { - const deleteCard = await new CardsApi(config).delete('card_xxxx'); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.cards.delete('card_7a6d73c5c8457fc', function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = CardsApi(api_client) - - try: - deleted_resource = api.delete("card_6afffd19045076c") - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $lob->cards()->delete('card_7a6d73c5c8457fc'); - label: PHP - - lang: CSharp - source: | - CardsApi api = new CardsApi(config); - - try { - CardDeletion response = api.delete("card_6afffd19045076c"); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Ruby - source: | - cardApi = CardsApi.new(config) - - begin - deletedCard = cardApi.delete("card_6afffd19045076c") - rescue => err - p err.message - end - label: RUBY - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - deletedCard, _, err := apiClient.CardsApi.Delete(context, "card_6afffd19045076c").Execute() - - if err != nil { - return err - } - label: GO - /cards/{card_id}/orders: - parameters: - - in: path - name: card_id - description: The ID of the card to which the card orders belong. - required: true - schema: - $ref: '#/components/schemas/card_id' - get: - operationId: card_orders_retrieve - summary: Retrieve - description: Retrieves the card orders associated with the given card id. - tags: - - Card Orders - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - responses: - '200': - description: Returns the card orders associated with the given card id - content: - application/json: - schema: - allOf: - - $ref: '#/components/schemas/list' - - type: object - properties: - data: - type: array - description: List of card orders - items: - $ref: '#/components/schemas/card_order' - example: - data: - - id: co_e0f8a0562a06bea7f - card_id: card_6afffd19045076c - status: available - inventory: 9500 - quantity_ordered: 10000 - unit_price: 0.75 - cancelled_reason: No longer needed - availability_date: '2021-10-12T21:41:48.326Z' - expected_availability_date: '2021-11-04T21:03:18.871Z' - date_created: '2021-10-07T21:03:18.871Z' - date_modified: '2021-10-16T01:00:30.144Z' - object: card_order - object: list - next_url: null - previous_url: null - count: 1 - default: - $ref: '#/components/responses/card_order_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/cards/card_6afffd19045076c/orders/ \ - -u : - label: CURL - - lang: Typescript - source: | - try { - const cardOrders = await new CardOrdersApi(cofig).get( 'co_xxxx' ); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.cardOrders.list('card_6afffd19045076c', function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = CardOrdersApi(api_client) - - try: - card_order = api.get("card_6afffd19045076c", limit = 2, offset = 1) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $lob->cardOrders('card_6afffd19045076c')->all(); - - lang: CSharp - source: | - CardOrdersApi api = new CardOrdersApi(config); - - try { - CardOrderList response = api.get("card_6afffd19045076c", 2, 1); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Ruby - source: | - cardOrderApi = CardOrdersApi.new(config) - - begin - retrievedCardOrderList = cardOrderApi.get("card_6afffd19045076c", { limit: 2, offset: 1 }) - rescue => err - p err.message - end - label: RUBY - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - fetchedCardOrderList, _, err := apiClient.CardOrdersApi.Get(context, "card_6afffd19045076c").Execute() - - if err != nil { - return err - } - label: GO - post: - operationId: card_order_create - summary: Create - description: Creates a new card order given information - tags: - - Card Orders - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/card_order_editable' - example: - quantity: 10000 - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/card_order_editable' - example: - quantity: 10000 - multipart/form-data: - schema: - $ref: '#/components/schemas/card_order_editable' - example: - quantity: 10000 - responses: - '200': - description: Card order created successfully - content: - application/json: - schema: - $ref: '#/components/schemas/card_order' - examples: - basic: - value: - id: co_e0f8a0562a06bea7f - card_id: card_6afffd19045076c - status: available - inventory: 9500 - quantity_ordered: 10000 - unit_price: 0.75 - cancelled_reason: No longer needed - availability_date: '2021-10-12T21:41:48.326Z' - expected_availability_date: '2021-11-04T21:03:18.871Z' - date_created: '2021-10-07T21:03:18.871Z' - date_modified: '2021-10-16T01:00:30.144Z' - object: card_order - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/cards/card_6afffd19045076c/orders \ - -u : \ - -d "quantity=10000" - label: CURL - - lang: Typescript - source: | - const cardForCreate = new CardOrderEditable({ - quantity: 200 - }); - - try { - const myCardOrder = await new CardOrdersApi(config).create('card_xxxx', cardForCreate); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.cardOrders.create('card_6afffd19045076c', { - quantity: 10000 - }, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Python - source: | - card_order_editable = CardOrderEditable( - quantity = 10000, - ) - - with ApiClient(configuration) as api_client: - api = CardOrdersApi(api_client) - - try: - created_card_order = api.create("card_6afffd19045076c", card_order_editable) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $lob->cardOrders('card_6afffd19045076c')->create(array( - 'quantity' => 10000 - )); - - lang: CSharp - source: | - CardOrdersApi api = new CardOrdersApi(config); - - CardOrderEditable cardOrderEditable = new CardOrderEditable( - 10000 // quantity - ); - - try { - CardOrder result = api.create("card_6afffd19045076c", cardOrderEditable); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Ruby - source: | - cardOrderCreate = CardOrderEditable.new({ - quantity: 10000, - }); - - cardOrderApi = CardOrdersApi.new(config) - - begin - createdCardOrder = cardOrderApi.create("card_6afffd19045076c", cardOrderCreate) - rescue => err - p err.message - end - label: RUBY - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - - var cardOrderCreate = *lob.NewCardOrderEditable() - cardOrderCreate.SetQuantity("10000") - - - - createdcardOrder, _, err := apiClient.CardOrdersApi.Create(context, "card_6afffd19045076c").CardOrderEditable(cardOrderCreate).Execute() - - if err != nil { - return err - } - label: GO - /checks: - get: - operationId: checks_list - summary: List - description: Returns a list of your checks. The checks are returned sorted by creation date, with the most recently created checks appearing first. - tags: - - Checks - 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/scheduled' - - $ref: '#/components/parameters/send_date' - - $ref: '#/components/parameters/mail_type' - - $ref: '#/components/parameters/sort_by' - - $ref: '#/components/parameters/status' - responses: - '200': - $ref: '#/components/responses/all_checks' - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl -X GET "https://api.lob.com/v1/checks?limit=2" \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: typescript - source: | - try { - const checks = await new ChecksApi(config).list(2); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.checks.list({limit: 2}, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - checksApi = ChecksApi.new(config) - - begin - checks = checksApi.list({ limit: 2 }) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = ChecksApi(api_client) - - try: - checks = api.list(limit=2) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\ChecksApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->list( - 2, // limit - ); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - ChecksApi apiInstance = new ChecksApi(config); - - try { - CheckList response = apiInstance.list( - 2, // limit - null, // before - null, // after - null, // include - null, // dateCreated - null, // metadata - null, // scheduled - null, // sendDate - null, // mailType - null // sortBy - ); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Check.list(%{limit: 2}) - label: ELIXIR - - lang: CSharp - source: | - ChecksApi api = new ChecksApi(config); - - List includeList = new List(); - includeList.Add("total_count"); - Dictionary metadata = new Dictionary(); - metadata.Add("name", "Harry"); - Dictionary dateCreated = new Dictionary(); - DateTime dateCreatedDate = DateTime.Today.AddMonths(-1); - dateCreated.Add("lt", dateCreatedDate); - Dictionary sendDate = new Dictionary(); - sendDate.Add("lt", DateTime.Now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz")); - SortBy3 sortBy = new SortBy3(SortBy3.DateCreatedEnum.Asc); - - try { - CheckList response = api.list( - 2, // limit - null, // before - null, // after - includeList, // include - dateCreated, // dateCreated - metadata, // metadata - true, // scheduled - sendDate, // sendDate - MailType.FirstClass, // mailType - sortBy // sortBy - ); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - CheckList = apiClient.ChecksApi.List(context).Execute() - if err != nil { - return err - } - label: GO - post: - operationId: check_create - summary: Create - description: Creates a new check with the provided properties. - tags: - - Checks - parameters: - - $ref: '#/components/parameters/idem-header' - - $ref: '#/components/parameters/idem-query' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/check_editable' - example: - description: Demo Check - 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: Leore Avidar - address_line1: 210 King St - address_line2: '# 6100' - address_city: San Francisco - address_state: CA - address_zip: 94107-1741 - bank_account: bank_8cad8df5354d33f - amount: 22.5 - memo: rent - logo: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png - check_bottom: tmpl_23668b406d5afef - merge_variables: - name: Harry - metadata: - memo: rafting trip - attachment: ./cool.pdf - send_date: '2017-11-01T00:00:00.000Z' - use_type: operational - mail_type: usps_first_class - check_number: 10001 - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/check_editable' - example: - description: Demo Check - 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: Leore Avidar - address_line1: 210 King St - address_line2: '# 6100' - address_city: San Francisco - address_state: CA - address_zip: 94107-1741 - bank_account: bank_8cad8df5354d33f - amount: 22.5 - memo: rent - logo: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png - check_bottom: tmpl_23668b406d5afef - merge_variables: - name: Harry - metadata: - memo: rafting trip - attachment: ./cool.pdf - send_date: '2017-11-01T00:00:00.000Z' - mail_type: usps_first_class - check_number: 10001 - encoding: - to: - style: deepObject - explode: true - from: - style: deepObject - explode: true - merge_variables: - style: deepObject - explode: true - metadata: - style: deepObject - explode: true - multipart/form-data: - schema: - $ref: '#/components/schemas/check_editable' - example: - description: Demo Check - 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: Leore Avidar - address_line1: 210 King St - address_line2: '# 6100' - address_city: San Francisco - address_state: CA - address_zip: 94107-1741 - bank_account: bank_8cad8df5354d33f - amount: 22.5 - memo: rent - logo: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png - check_bottom: tmpl_23668b406d5afef - merge_variables: - name: Harry - metadata: - memo: rafting trip - attachment: ./cool.pdf - send_date: '2017-11-01T00:00:00.000Z' - use_type: operational - mail_type: usps_first_class - check_number: 10001 - encoding: - logo: - contentType: image/png, image/jpeg - responses: - '200': - $ref: '#/components/responses/post_check' - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/checks \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ - -d 'description=Demo Check' \ - -d 'to[name]=Harry Zhang' \ - -d 'to[address_line1]=210 King St' \ - -d 'to[address_line2]=# 6100' \ - -d 'to[address_city]=San Francisco' \ - -d 'to[address_state]=CA' \ - -d 'to[address_zip]=94107' \ - -d 'from=adr_210a8d4b0b76d77b' \ - -d 'bank_account=bank_8cad8df5354d33f' \ - -d 'amount=22.50' \ - -d 'use_type=operational' \ - -d 'memo=rent' \ - --data-urlencode 'logo=https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png' \ - --data-urlencode 'check_bottom=

Demo Check for {{name}}

' \ - -d 'merge_variables[name]=Harry' - label: CURL - - lang: Typescript - source: | - const checkCreate = new CheckEditable({ - to: new AddressEditable({ - name: 'Harry Zhang', - address_line1: '210 King St', - address_line2: '# 6100', - address_city: 'San Francisco', - address_state: 'CA', - address_zip: '94107', - }), - from: 'adr_xxxx', - bank_account: 'bank_xxxx', - amount: 100, - use_type: 'operational' - }); - - try { - const myCheck = await new ChecksApi(config).create(checkCreate); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.checks.create({ - description: 'Demo Check', - bank_account: 'bank_8cad8df5354d33f', - to: { - name: 'Harry Zhang', - address_line1: '210 King St', - address_line2: '# 6100', - address_city: 'San Francisco', - address_state: 'CA', - address_zip: '94107' - }, - from: 'adr_210a8d4b0b76d77b', - amount: 22.50, - use_type: 'operational', - memo: 'rent', - logo: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png', - check_bottom: '

Demo Check for {{name}}

', - merge_variables: { - name: 'Harry' - } - }, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - checkCreate = CheckEditable.new({ - description: "Demo Check", - bank_account: "bank_8cad8df5354d33f", - amount: 22.5, - memo: "rent", - logo: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png", - check_bottom: "

Demo Check for {{name}}

", - from: "adr_210a8d4b0b76d77b", - to: AddressDomestic.new({ - name: "Harry Zhang", - address_line1: "210 King St", - address_line2: "# 6100", - address_city: "San Francisco", - address_state: "CA", - address_zip: "94107", - }), - merge_variables: { - name: "Harry" - }, - use_type: "operational" - }); - - checkApi = ChecksApi.new(config) - - begin - createdCheck = checkApi.create(checkCreate) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - check_editable = CheckEditable( - description = "Demo Check", - bank_account = "bank_8cad8df5354d33f", - amount = 22.5, - memo = "rent", - logo = "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png", - check_bottom = "

Demo Check for {{name}}

", - _from = "adr_210a8d4b0b76d77b", - to = AddressDomestic( - name = "Harry Zhang", - address_line1 = "210 King St", - address_line2 = "# 6100", - address_city = "San Francisco", - address_state = "CA", - address_zip = "94107", - ), - merge_variables = MergeVariables( - name = "Harry", - ), - use_type = "operational" - ) - - with ApiClient(configuration) as api_client: - api = ChecksApi(api_client) - - try: - created_check = api.create(check_editable) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $to = new OpenAPI\Client\Model\AddressEditable( - array( - "name" => "Harry Zhang", - "address_line1" => "210 King St", - "address_line2" => "# 6100", - "address_city" => "San Francisco", - "address_state" => "CA", - "address_zip" => "94107", - ) - ); - - $merge_variables = new stdClass; - $merge_variables->name = "Harry"; - - $use_type = "operational"; - - $apiInstance = new OpenAPI\Client\Api\ChecksApi($config, new GuzzleHttp\Client()); - $check_editable = new OpenAPI\Client\Model\CheckEditable( - array( - "description" => "Demo Check", - "bank_account" => "bank_8cad8df5354d33f", - "amount" => "22.5", - "memo" => "rent", - "logo" => "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png", - "check_bottom" => "

Demo Check for {{name}}

", - "from" => "adr_210a8d4b0b76d77b", - "to" => $to, - "merge_variables" => $merge_variables, - "use_type" => $use_type - ) - ); - - try { - $result = $apiInstance->create($check_editable); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - Map merge_variables = new HashMap(); - merge_variables.put("name", "Harry"); - - ChecksApi apiInstance = new ChecksApi(config); - - AddressEditable to = new AddressEditable(); - to.setName("Harry Zhang"); - to.setAddressLine1("210 King St"); - to.setAddressLine2("# 6100"); - to.setAddressCity("San Francisco"); - to.setAddressState("CA"); - to.setAddressZip("94107"); - - try { - CheckEditable checkEditable = new CheckEditable(); - checkEditable.setDescription("Demo Check"); - checkEditable.setBankAccount("bank_8cad8df5354d33f"); - checkEditable.setAmount(22.5f); - checkEditable.setMemo("rent"); - checkEditable.setLogo("https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png"); - checkEditable.setCheckBottom("

Demo Check for {{name}}

"); - checkEditable.setFrom("adr_210a8d4b0b76d77b"); - checkEditable.setTo(to); - checkEditable.setMergeVariables(merge_variables); - checkEditable.setUseType("operational"); - - Check result = apiInstance.create(checkEditable, null); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Check.create(%{ - description: 'Demo Check', - bank_account: 'bank_8cad8df5354d33f', - to: %{ - name: 'Harry Zhang', - address_line1: '210 King St', - address_line2: '# 6100', - address_city: 'San Francisco', - address_state: 'CA', - address_zip: '94107' - }, - from: 'adr_210a8d4b0b76d77b', - amount: 22.50, - memo: 'rent', - logo: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png', - check_bottom: '

Demo Check for {{name}}

', - merge_variables: %{ - name: 'Harry' - }, - use_type: 'operational' - }) - label: ELIXIR - - lang: CSharp - source: | - Dictionary mergeVariables = new Dictionary(); - mergeVariables.Add("name", "Harry"); - - ChecksApi api = new ChecksApi(config); - - AddressEditable to = new AddressEditable( - "210 King St", // addressLine1 - "# 6100", // addressLine2 - "San Francisco", // addressCity - "CA", // addressState - "94107", // addressZip - default(CountryExtended), // addressCounty - "", // description - "Harry Zhang" // name - ); - - CheckEditable checkEditable = new CheckEditable( - "adr_249af768103d2810", // from - to.ToJson(), // to - "bank_8cad8df5354d33f", // bank_account - 22.5f, // amount - "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png", // logo - "

Demo Check for {{name}}

", // checkBottom - default(string), // attachment - "Demo Check", // description - default(Dictionary), // metadata - mergeVariables, // mergeVariables - default(DateTime), // sendDate - CheckEditable.MailTypeEnum.UspsFirstClass, // mailType - "rent", // memo - "operational" // use_type - ); - - try { - Check result = api.create(checkEditable, null); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - var to = *lob.NewAddressEditable() - to.SetAddressLine1("210 King St") - to.SetAddressLine2("# 6100") - to.SetAddressCity("San Francisco") - to.SetAddressState("CA") - to.SetAddressZip("94107") - to.SetAddressCountry(lob.COUNTRYEXTENDED_US) - to.SetDescription("") - to.SetName("Harry Zhang") - - var checkCreate = *lob.NewCheckEditable() - checkCreate.SetDescription("Demo Check") - checkCreate.SetBankAccount("bank_8cad8df5354d33f") - checkCreate.SetAmount(22.5) - checkCreate.SetMemo("rent") - checkCreate.SetLogo("https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png") - checkCreate.SetCheckBottom("

Demo Check for {{name}}

") - checkCreate.SetFrom("adr_210a8d4b0b76d77b") - checkCreate.SetTo(to) - - - createdcheck, _, err := apiClient.ChecksApi.Create(context).CheckEditable(checkCreate).Execute() - - if err != nil { - return err - } - label: GO - /checks/{chk_id}: - parameters: - - in: path - name: chk_id - description: id of the check - required: true - schema: - $ref: '#/components/schemas/chk_id' - get: - operationId: check_retrieve - summary: Retrieve - description: Retrieves the details of an existing check. You need only supply the unique check identifier that was returned upon check creation. - tags: - - Checks - responses: - '200': - description: Returns a check object - content: - application/json: - schema: - $ref: '#/components/schemas/check' - example: - id: chk_534f10783683daa0 - description: Demo Check - metadata: {} - check_number: 10062 - memo: rent - amount: 22.5 - url: https://lob-assets.com/checks/chk_534f10783683daa0.pdf?expires=1540372221&signature=Ty3IV2bGPEoQfrdraYHlNYTaarnHLXb - to: - id: adr_bae820679f3f536b - description: Harry - Office - name: HARRY ZHANG - company: LOB - email: harry@lob.com - phone: '5555555555' - address_line1: 210 KING ST STE 6100 - address_line2: '' - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2018-12-08T03:08:43.446Z' - date_modified: '2018-12-08T03:08:43.446Z' - object: address - recipient_moved: false - from: - id: adr_b8fb5acf3a2b55db - name: LEORE AVIDAR - address_line1: 210 KING ST STE 6100 - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2017-09-05T17:47:53.767Z' - date_modified: '2017-09-05T17:47:53.767Z' - object: address - bank_account: - id: bank_8cad8df5354d33f - description: Test Bank Account - metadata: {} - routing_number: '322271627' - account_number: '123456789' - signatory: John Doe - bank_name: J.P. MORGAN CHASE BANK, N.A. - verified: true - account_type: company - date_created: '2015-11-06T19:24:24.440Z' - date_modified: '2015-11-06T19:41:28.312Z' - object: bank_account - signature_url: https://lob-assets.com/bank-accounts/asd_asdfghjkqwertyui.pdf?expires=1234567890&signature=aksdf - carrier: USPS - tracking_events: [] - thumbnails: - - small: https://lob-assets.com/checks/chk_534f10783683daa0_thumb_small_1.png?expires=1540372221&signature=ShhPpH74wYkNiAj7Il9B6q8ZKkzlGd4 - medium: https://lob-assets.com/checks/chk_534f10783683daa0_thumb_medium_1.png?expires=1540372221&signature=tmIOq6aAyKgzAECp7STj1rvJuMS5Svd - large: https://lob-assets.com/checks/chk_534f10783683daa0_thumb_large_1.png?expires=1540372221&signature=04nLEwE9d2qgQJNgJYWSOgPnU0FZbEv - merge_variables: - name: Harry - expected_delivery_date: '2017-09-12' - mail_type: usps_first_class - date_created: '2017-09-05T17:47:53.896Z' - date_modified: '2017-09-05T17:47:53.896Z' - send_date: '2017-09-05T17:47:53.896Z' - object: check - message: pancakes are good - check_bottom_template_id: tmpl_a - attachment_template_id: tmpl_a - check_bottom_template_version_id: vrsn_a - attachment_template_version_id: vrsn_a - use_type: operational - deleted: true - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/checks/chk_534f10783683daa0 \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: Typescript - source: | - try { - const check = await new ChecksApi(config).get('chk_xxxx'); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.checks.retrieve('chk_534f10783683daa0', function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - checkApi = ChecksApi.new(config) - - begin - retrievedCheck = checkApi.get("chk_534f10783683daa0") - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = ChecksApi(api_client) - - try: - check = api.get("chk_534f10783683daa0") - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\ChecksApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->get("chk_534f10783683daa0"); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - ChecksApi apiInstance = new ChecksApi(config); - - try { - Check response = apiInstance.get("chk_534f10783683daa0"); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Check.find("chk_534f10783683daa0") - label: ELIXIR - - lang: CSharp - source: | - ChecksApi api = new ChecksApi(config); - - try { - Check response = api.get("chk_534f10783683daa0"); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - fetchedCheck, _, err := apiClient.ChecksApi.Get(context,"chk_534f10783683daa0").Execute() - - if err != nil { - return err - } - label: GO - delete: - operationId: check_cancel - summary: Cancel - description: Completely removes a check from production. This can only be done if the check has a `send_date` and the `send_date` has not yet passed. If the check is successfully canceled, you will not be charged for it. Read more on [cancellation windows](#section/Cancellation-Windows) and [scheduling](#section/Scheduled-Mailings). Scheduling and cancellation is a premium feature. Upgrade to the appropriate Print & Mail Edition to gain access. - tags: - - Checks - responses: - '200': - $ref: '#/components/responses/check_canceled' - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl -X DELETE https://api.lob.com/v1/checks/chk_534f10783683daa0 \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: Typescript - source: | - try { - const deleteCheck = await new ChecksApi(config).delete('chk_xxxx'); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.checks.delete('chk_534f10783683daa0', function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - checkApi = ChecksApi.new(config) - - begin - deletedCheck = checkApi.cancel("chk_534f10783683daa0") - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = ChecksApi(api_client) - - try: - deleted_resource = api.cancel("chk_534f10783683daa0") - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\ChecksApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->cancel("chk_534f10783683daa0"); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - ChecksApi apiInstance = new ChecksApi(config); - - try { - CheckDeletion response = apiInstance.cancel("chk_534f10783683daa0"); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Check.destroy("chk_534f10783683daa0") - label: ELIXIR - - lang: CSharp - source: | - ChecksApi api = new ChecksApi(config); - - try { - CheckDeletion response = api.cancel("chk_534f10783683daa0"); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - deletedCheck, _, err := apiClient.ChecksApi.Cancel(context, "chk_534f10783683daa0").Execute() - - if err != nil { - return err - } - label: GO - /creatives: - post: - operationId: creative_create - summary: Create - description: Creates a new creative with the provided properties - tags: - - Creatives - parameters: - - $ref: '#/components/parameters/lang_spec' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/creative_writable' - example: - campaign_id: cmp_e05ee61ff80764b - resource_type: postcard - description: Our 4x6 postcard creative - details: {} - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/creative_writable' - encoding: - example-prop: - style: deepObject - explode: true - example: - campaign_id: cmp_e05ee61ff80764b - resource_type: postcard - description: Our 4x6 postcard creative - details: {} - multipart/form-data: - schema: - $ref: '#/components/schemas/creative_writable' - example: - campaign_id: cmp_e05ee61ff80764b - resource_type: postcard - description: Our 4x6 postcard creative - details: {} - responses: - '200': - description: Creative created successfully - content: - application/json: - schema: - $ref: '#/components/schemas/creative' - example: - id: crv_2a3b096c409b32c - description: Our 4x6 postcard creative - from: adr_210a8d4b0b76d77b - resource_type: postcard - details: {} - metadata: {} - template_preview_urls: {} - template_previews: [] - campaigns: [] - date_created: '2017-09-05T17:47:53.767Z' - date_modified: '2017-09-05T17:47:53.767Z' - object: creative - default: - $ref: '#/components/responses/creatives_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/creatives \ - -u : \ - -d "campaign_id=cmp_e05ee61ff80764b" \ - -d "resource_type=postcard" \ - -d "details={}" - - lang: Ruby - source: | - creativeCreate = CreativeWritable.new({ - campaign_id: "cmp_e05ee61ff80764b", - resource_type: "postcard", - description: "Our 4x6 postcard creative", - from: "adr_210a8d4b0b76d77b", - front: "tmpl_4aa14648113e45b", - back: "tmpl_4aa14648113e45b", - details: PostcardDetailsWritable.new({ - mail_type: "usps_first_class", - }), - }); - - creativeApi = CreativesApi.new(config) - - begin - createdCreative = creativeApi.create(creativeCreate) - rescue => err - p err.message - end - label: RUBY - /creatives/{crv_id}: - parameters: - - in: path - name: crv_id - description: id of the creative - required: true - schema: - $ref: '#/components/schemas/crv_id' - get: - operationId: creative_retrieve - summary: Retrieve - description: Retrieves the details of an existing creative. You need only supply the unique creative identifier that was returned upon creative creation. - tags: - - Creatives - responses: - '200': - description: Returns a creative object - content: - application/json: - schema: - $ref: '#/components/schemas/creative' - example: - id: crv_2a3b096c409b32c - description: Our 4x6 postcard creative - from: adr_210a8d4b0b76d77b - resource_type: postcard - details: {} - metadata: {} - template_preview_urls: {} - template_previews: [] - campaigns: [] - date_created: '2017-09-05T17:47:53.767Z' - date_modified: '2017-09-05T17:47:53.767Z' - object: creative - default: - $ref: '#/components/responses/creatives_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/creatives/crv_2a3b096c409b32c \ - -u : - label: CURL - - lang: Ruby - source: | - creativeApi = CreativesApi.new(config) - - begin - retrievedCreative = creativeApi.get("crv_2a3b096c409b32c") - rescue => err - p err.message - end - label: RUBY - patch: - operationId: creative_update - summary: Update - description: Update the details of an existing creative. You need only supply the unique identifier that was returned upon creative creation. - tags: - - Creatives - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/creative_base' - example: - description: Test creative - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/creative_base' - example: - description: Test creative - multipart/form-data: - schema: - $ref: '#/components/schemas/creative_base' - example: - description: Test creative - responses: - '200': - description: Returns a creative object - content: - application/json: - schema: - $ref: '#/components/schemas/creative' - example: - id: crv_2a3b096c409b32c - description: Our 4x6 postcard creative - from: adr_210a8d4b0b76d77b - resource_type: postcard - details: {} - metadata: {} - template_preview_urls: {} - template_previews: [] - campaigns: [] - date_created: '2017-09-05T17:47:53.767Z' - date_modified: '2017-09-05T17:47:53.767Z' - object: creative - default: - $ref: '#/components/responses/creatives_error' - x-codeSamples: - - lang: Shell - source: | - curl -X PATCH https://api.lob.com/v1/creatives/crv_2a3b096c409b32c \ - -u : \ - -d "description=Our updated 4x6 postcard creative" - label: CURL - - lang: Python - source: | - creative_patch = CreativePatch( - description = "Our updated 4x6 postcard creative", - ) - - with ApiClient(configuration) as api_client: - api = CreativesApi(api_client) - - try: - updated_creative = api.update("crv_2a3b096c409b32c", creative_patch) - except ApiException as e: - print(e) - label: PYTHON - - lang: Ruby - source: | - creativePatch = CreativePatch.new({ - description: "Our updated 4x6 postcard creative", - }) - - creativeApi = CreativesApi.new(config) - - begin - updatedCreative = creativeApi.update("crv_2a3b096c409b32c", creativePatch) - rescue => err - p err.message - end - label: RUBY - /identity_validation: - post: - operationId: identity_validation - summary: Identity Validation - description: Validates whether a given name is associated with an address. - tags: - - Identity Validation - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/identity_validation_writable' - example: - recipient: Larry Lobster - primary_line: 210 King St. - secondary_line: '' - city: San Francisco - state: CA - zip_code: '94107' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/identity_validation_writable' - example: - recipient: Larry Lobster - primary_line: 210 King St. - secondary_line: '' - city: San Francisco - state: CA - zip_code: '94107' - multipart/form-data: - schema: - $ref: '#/components/schemas/identity_validation_writable' - example: - recipient: Larry Lobster - primary_line: 210 King St. - secondary_line: '' - city: San Francisco - state: CA - zip_code: '94107' - responses: - '200': - $ref: '#/components/responses/identity_validation' - default: - $ref: '#/components/responses/identity_validation_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/identity_validation \ - -u : \ - -d "recipient=Larry Lobster" \ - -d "primary_line=210 King St" \ - -d "secondary_line=" \ - -d "urbanization=" \ - -d "city=San Francsico" \ - -d "state=CA" \ - -d "zip_code=94107" \ - label: CURL - /intl_autocompletions: - post: - operationId: intl_autocompletions - summary: Autocomplete - description: Given an address prefix consisting of a partial primary line and country, as well as optional input of city, state, and zip code, this functionality returns up to 10 full International address suggestions. Not all of them will turn out to be valid addresses; they'll need to be [verified](#operation/intl_verification). - tags: - - Intl Autocompletions - parameters: - - $ref: '#/components/parameters/lang_spec' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/intl_autocompletions_writable' - examples: - basic: - value: - address_prefix: 340 Wat - city: Summerside - state: Prince Edward Island - zip_code: C1N 1C4 - country: CA - geo_ip_sort: false - test: - value: - address_prefix: 1 sugg - country: CA - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/intl_autocompletions_writable' - examples: - basic: - value: - address_prefix: 340 Wat - city: Summerside - state: Prince Edward Island - zip_code: C1N 1C4 - country: CA - geo_ip_sort: false - test: - value: - address_prefix: 1 sugg - country: CA - multipart/form-data: - schema: - $ref: '#/components/schemas/intl_autocompletions_writable' - examples: - basic: - value: - address_prefix: 340 Wat - city: Summerside - state: Prince Edward Island - zip_code: C1N 1C4 - country: CA - geo_ip_sort: false - test: - value: - address_prefix: 1 sugg - country: CA - responses: - '200': - $ref: '#/components/responses/intl_autocompletions' - default: - $ref: '#/components/responses/intl_autocompletions_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/intl_autocompletions \ - -u : \ - -d "address_prefix=340 Wat" \ - -d "city=Summerside" \ - -d "state=Prince Edward Island" \ - -d "zip_code=C1N 1C4" \ - -d "country=CA" - label: CURL - - lang: Typescript - source: | - const IntlAutocompletions = new IntlAutocompletionsApi(av_config); - const autoCompletionData = new IntlAutocompletionsWritable({ - address_prefix: "340 Wat", - city: "Summerside", - state: "Prince Edward Island", - zip_code: "C1N 1C4", - country: "CA", - }); - - try { - const autocompletedAddresses = await IntlAutocompletions.autocomplete(autocompletionData); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - This feature is not currently supported by this library. - label: NODE - - lang: Ruby - source: | - intlAutocompletionsApi = IntlAutocompletionsApi.new(config) - - autocompletionData = IntlAutocompletionsWritable.new({ - address_prefix: "340 Wat", - city: "Summerside", - state: "Prince Edward Island", - zip_code: "C1N 1C4", - country: CountryExtended::CA, - }) - - begin - autocompletedAddr = intlAutocompletionsApi.autocomplete(autocompletionData) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = IntlAutocompletionsApi(api_client) - - autocompletion_data = IntlAutocompletionsWritable( - address_prefix = "340 Wat", - city = "Summerside", - state = "Prince Edward Island", - zip_code = "C1N 1C4", - country = CountryExtended("CA"), - ) - - try: - autocompleted_addresses = api.autocomplete(autocompletion_data) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\IntlAutocompletionsApi($config, new GuzzleHttp\Client()); - - $autoCompletionData = new OpenAPI\Client\Model\IntlAutocompletionsWritable(array( - "address_prefix" => "340 Wat", - "city" => "Summerside", - "state" => "Prince Edward Island", - "zip_code" => "C1N 1C4", - "country" => "CA", - )); - - try { - $result = $apiInstance->autocomplete($autoCompletionData); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - This feature is not currently supported by this library. - label: JAVA - - lang: Elixir - source: | - This feature is not currently supported by this library. - label: ELIXIR - - lang: CSharp - source: | - IntlAutocompletionsApi api = new IntlAutocompletionsApi(config); - - IntlAutocompletionsWritable autocompletionData = new IntlAutocompletionsWritable( - "340 Wat", - "Summerside", - "Prince Edward Island", - "C1N 1C4", - CountryExtended.CA - ); - - try { - IntlAutocompletions autocompletedAddresses = api.autocomplete(autocompletionData); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(context, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - resp, _, err := suite.apiClient.IntlAutocompletionsApi.Autocomplete(context).IntlAutocompletionsWritable(suite.intlAutocomplationsWritable).Execute() - - if err != nil { - return err - } - label: GO - /intl_verifications: - post: - operationId: intl_verification - summary: Single Verify - description: Verify an international (except US or US territories) address _with a live API key_. Requests to this endpoint with a test API key will return a dummy response based on the primary line you input. - tags: - - Intl Verifications - parameters: - - $ref: '#/components/parameters/lang_spec' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/intl_verification_writable' - examples: - basic: - value: - recipient: Harry Zhang - primary_line: 370 Water St - secondary_line: '' - city: Summerside - state: Prince Edward Island - postal code: C1N 1C4 - country: CA - full_payload: - value: - recipient: Harry Zhang - primary_line: 370 Water St - secondary_line: '' - city: Summerside - state: Prince Edward Island - postal code: C1N 1C4 - country: CA - single_line: - value: - address: 370 Water St C1N 1C4 - country: CA - test: - value: - primary_line: deliverable - country: CA - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/intl_verification_writable' - examples: - basic: - value: - recipient: Harry Zhang - primary_line: 370 Water St - secondary_line: '' - city: Summerside - state: Prince Edward Island - postal code: C1N 1C4 - country: CA - full_payload: - value: - recipient: Harry Zhang - primary_line: 370 Water St - secondary_line: '' - city: Summerside - state: Prince Edward Island - postal code: C1N 1C4 - country: CA - single_line: - value: - address: 370 Water St C1N 1C4 - country: CA - test: - value: - primary_line: deliverable - country: CA - multipart/form-data: - schema: - $ref: '#/components/schemas/intl_verification_writable' - examples: - basic: - value: - recipient: Harry Zhang - primary_line: 370 Water St - secondary_line: '' - city: Summerside - state: Prince Edward Island - postal code: C1N 1C4 - country: CA - full_payload: - value: - recipient: Harry Zhang - primary_line: 370 Water St - secondary_line: '' - city: Summerside - state: Prince Edward Island - postal code: C1N 1C4 - country: CA - single_line: - value: - address: 370 Water St C1N 1C4 - country: CA - test: - value: - primary_line: deliverable - country: CA - responses: - '200': - $ref: '#/components/responses/intl_verifications' - default: - $ref: '#/components/responses/intl_verifications_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/intl_verifications \ - -u : \ - -d "primary_line=370 Water St" \ - -d "city=Summerside" \ - -d "state=Prince Edward Island" \ - -d "postal_code=C1N 1C4" \ - -d "country=CA" - label: CURL - - lang: Typescript - source: | - const IntlVerifications = new IntlVerificationsApi(av_config); - let verificationData1: IntlVerificationWritable = { - primary_line: '370 WATER ST', - postal_code: 'C1N 1C4', - country: CountryExtended.Ca - }; - - try { - const singleVerified = await IntlVerifications.verifySingle(verificationData1); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.intlVerifications.verify({ - primary_line: '370 Water St', - city: 'Summerside', - state: 'Prince Edward Island', - postal_code: 'C1N 1C4', - country: 'CA' - }, function (err, res) { - console.log (err, res); - }); - label: NODE - - lang: Ruby - source: | - intlVerificationsApi = IntlVerificationsApi.new(config) - - verificationData = IntlVerificationWritable.new({ - primary_line: "370 Water St", - city: "Summerside", - state: "Prince Edward Island", - postal_code: "C1N 1C4", - country: CountryExtended::CA, - }) - - begin - verifiedAddr = intlVerificationsApi.verifySingle(verificationData) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = IntlVerificationsApi(api_client) - verification_data_1 = IntlVerificationWritable( - primary_line = "370 Water St", - city = "Summerside", - state = "Prince Edward Island", - postal_code = "C1N 1C4", - country = CountryExtended("CA"), - ) - - try: - single_verified = api.verifySingle(verification_data_1) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\IntlVerificationsApi($config, new GuzzleHttp\Client()); - - $verificationData = new OpenAPI\Client\Model\IntlVerificationWritable(array( - 'primary_line' => '370 Water St', - 'city' => 'Summerside', - 'state' => 'Prince Edward Island', - 'postal_code' => 'C1N 1C4', - 'country' => 'CA', - )); - - try { - $result = $apiInstance->verifySingle($verificationData); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - LobResponse response = new IntlVerification.RequestBuilder() - .setPrimaryLine("370 Water St") - .setCity("Summerside") - .setState("Prince Edward Island") - .setPostalCode("C1N 1C4") - .setCountry("CA") - .verify(); - - IntlVerification intlVerification = response.getResponseBody(); - label: JAVA - - lang: Elixir - source: | - Lob.IntlVerification.verify(%{ - primary_line: "370 Water St", - city: "Summerside", - state: "Prince Edward Island", - postal_code: "C1N 1C4", - country: "CA" - }) - label: ELIXIR - - lang: CSharp - source: | - IntlVerificationWritable singleVerify = new IntlVerificationWritable( - null, - "370 Water St", - null, - "Summerside", - "Prince Edward Island", - "C1N 1C4", - CountryExtended.CA - ); - - IntlVerificationsApi api = new IntlVerificationsApi(config); - - try { - api.verifySingle(singleVerify, null); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - /letters/{ltr_id}: - parameters: - - in: path - name: ltr_id - description: id of the letter - required: true - schema: - $ref: '#/components/schemas/ltr_id' - get: - operationId: letter_retrieve - summary: Retrieve - description: Retrieves the details of an existing letter. You need only supply the unique letter identifier that was returned upon letter creation. - tags: - - Letters - responses: - '200': - description: Returns a letter object - content: - application/json: - schema: - $ref: '#/components/schemas/letter' - example: - id: ltr_4868c3b754655f90 - description: Demo Letter - metadata: {} - to: - id: adr_d3489cd64c791ab5 - description: null - name: HARRY ZHANG - company: null - phone: null - email: null - address_line1: 210 KING ST STE 6100 - address_line2: null - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2017-09-05T15:54:53.264Z' - date_modified: '2017-09-05T15:54:53.264Z' - deleted: true - object: address - from: - id: adr_b8fb5acf3a2b55db - description: null - name: LEORE AVIDAR - company: null - phone: null - email: null - address_line1: 210 KING ST STE 6100 - address_line2: null - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2017-09-05T15:54:53.264Z' - date_modified: '2017-09-05T15:54:53.264Z' - deleted: true - object: address - color: true - double_sided: true - address_placement: top_first_page - return_envelope: false - perforated_page: null - custom_envelope: null - extra_service: null - mail_type: usps_first_class - url: https://lob-assets.com/letters/ltr_4868c3b754655f90.pdf?expires=1540372221&signature=8r94fse8uam7wGWmW5baxXulU88X2CA - carrier: USPS - tracking_number: null - tracking_events: [] - thumbnails: - - small: https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_small_1.png?expires=1540372221&signature=a5fRBJ22ZA78Vgpg34M9UfmHWTS3eha - medium: https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_medium_1.png?expires=1540372221&signature=bAzL8sv935PY09FWSkpDpWKkyvGSWYF - large: https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_large_1.png?expires=1540372221&signature=gsKvxXgrm4v4iZD3bOibK7jApNkEMdW - merge_variables: - name: Harry - expected_delivery_date: '2017-09-12' - date_created: '2017-09-05T15:54:53.346Z' - date_modified: '2017-09-05T15:54:53.346Z' - send_date: '2017-09-05T15:54:53.346Z' - cards: - - id: card_c51ae96f5cebf3e - account_id: fa9ea650fc7b31a89f92 - description: null - url: https://lob-assets.com/cards/card_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA - size: 2.125x3.375 - auto_reorder: false - reorder_quantity: null - raw_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - front_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - back_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - thumbnails: - - small: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg - medium: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA - large: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw - - small: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_2.png?version=v1&expires=1636910992&signature=IWsmPa_ULlv2yyqjX564d_YfHHY_M7i9YxDnw-WXDr2jtOFcArmRZQbnHeE9g_rYxnddJbgosuv8-c2utiu7Cg - medium: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_2.png?version=v1&expires=1636910992&signature=zxK7VKGiTvz5Ywrkaydd0v3GcYf58R7A08J4tNfI7-aiNODDcTF3l0MqY13n9Pyc8RXSdD0XVBY-OpbA1VM-Ag - large: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_2.png?version=v1&expires=1636910992&signature=r0OFUhh315ZwN0raMZdIwJd2oCIEYsz0BABaMxIuO1PKTD0ckGWrhcGdzk2dlWQ6vSvp0CUQ5k1RXGqkIIqkDw - available_quantity: 10000 - pending_quantity: 0 - countries: null - status: rendered - mode: test - orientation: horizontal - threshold_amount: 0 - date_created: '2017-08-05T15:54:53.346Z' - date_modified: '2017-08-05T15:54:53.346Z' - object: card - use_type: marketing - fsc: false - object: letter - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/letters/ltr_4868c3b754655f90 \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: Typescript - source: | - try { - const letter= await new LettersApi(config).get('ltr_xxxx'); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.letters.retrieve('ltr_4868c3b754655f90', function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - letterApi = LettersApi.new(config) - - begin - retrievedLetter = letterApi.get("ltr_4868c3b754655f90") - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = LettersApi(api_client) - - try: - letter = api.get("ltr_4868c3b754655f90") - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\LettersApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->get("ltr_4868c3b754655f90"); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - LettersApi apiInstance = new LettersApi(config); - - try { - Letter response = apiInstance.get("ltr_4868c3b754655f90"); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Letter.find("ltr_4868c3b754655f90") - label: ELIXIR - - lang: CSharp - source: | - LettersApi api = new LettersApi(config); - - try { - Letter response = api.get("ltr_4868c3b754655f90"); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - fetchedLetter, _, err := apiClient.LettersApi.Get(context,"ltr_4868c3b754655f90").Execute() - - if err != nil { - return err - } - label: GO - delete: - operationId: letter_cancel - summary: Cancel - description: Completely removes a letter from production. This can only be done if the letter has a `send_date` and the `send_date` has not yet passed. If the letter is successfully canceled, you will not be charged for it. Read more on [cancellation windows](#section/Cancellation-Windows) and [scheduling](#section/Scheduled-Mailings). Scheduling and cancellation is a premium feature. Upgrade to the appropriate Print & Mail Edition to gain access. - tags: - - Letters - responses: - '200': - $ref: '#/components/responses/letter_deleted' - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl -X DELETE https://api.lob.com/v1/letters/ltr_4868c3b754655f90 \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: Typescript - source: | - try { - const deleteLetter = await new LettersApi(config).delete('ltr_xxxx') - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.letters.delete('ltr_4868c3b754655f90', function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - letterApi = LettersApi.new(config) - - begin - deletedLetter = letterApi.cancel("ltr_4868c3b754655f90") - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = LettersApi(api_client) - - try: - deleted_resource = api.cancel("ltr_4868c3b754655f90") - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\LettersApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->cancel("ltr_4868c3b754655f90"); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - LettersApi apiInstance = new LettersApi(config); - - try { - LetterDeletion response = apiInstance.cancel("ltr_4868c3b754655f90"); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Letter.destroy("ltr_4868c3b754655f90") - label: ELIXIR - - lang: CSharp - source: | - LettersApi api = new LettersApi(config); - - try { - LetterDeletion response = api.cancel("ltr_4868c3b754655f90"); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - deletedLetter, _, err := apiClient.LettersApi.Cancel(context, "ltr_4868c3b754655f90").Execute() - - if err != nil { - return err - } - label: GO - /letters: - get: - operationId: letters_list - summary: List - description: Returns a list of your letters. The letters are returned sorted by creation date, with the most recently created letters appearing first. - tags: - - Letters - 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/campaign_id' - - $ref: '#/components/parameters/status' - - in: query - name: color - description: Set to `true` to return only color letters. Set to `false` to return only black & white letters. - schema: - type: boolean - - $ref: '#/components/parameters/scheduled' - - $ref: '#/components/parameters/send_date' - - $ref: '#/components/parameters/mail_type' - - $ref: '#/components/parameters/sort_by' - responses: - '200': - $ref: '#/components/responses/all_letters' - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl -X GET "https://api.lob.com/v1/letters?limit=2" \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: typescript - source: | - try { - const letters = await new LettersApi(config).list(2); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.letters.list({limit: 2}, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - lettersApi = LettersApi.new(config) - - begin - letters = lettersApi.list({ limit: 2 }) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = LettersApi(api_client) - - try: - letters = api.list(limit=2) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\LettersApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->list( - 2, // limit - ); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - LettersApi apiInstance = new LettersApi(config); - - try { - LetterList response = apiInstance.list( - 2, // limit - null, // before - null, // after - null, // include - null, // dateCreated - null, // metadata - null, // color - null, // scheduled - null, // sendDate - null, // mailType - null // sortBy - ); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Letter.list(%{limit: 2}) - label: ELIXIR - - lang: CSharp - source: | - LettersApi api = new LettersApi(config); - - List includeList = new List(); - includeList.Add("total_count"); - Dictionary metadata = new Dictionary(); - metadata.Add("name", "Harry"); - Dictionary dateCreated = new Dictionary(); - DateTime dateCreatedDate = DateTime.Today.AddMonths(-1); - dateCreated.Add("lt", dateCreatedDate); - Dictionary sendDate = new Dictionary(); - sendDate.Add("lt", DateTime.Now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz")); - SortBy3 sortBy = new SortBy3(SortBy3.DateCreatedEnum.Asc); - - try { - LetterList response = api.list( - 2, // limit - null, // before - null, // after - includeList, // include - dateCreated, // dateCreated - metadata, // metadata - true, // color - true, // scheduled - sendDate, // sendDate - MailType.FirstClass, // mailType - sortBy // sortBy - ); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - LetterList = apiClient.LettersApi.List(context).Execute() - if err != nil { - return err - } - label: GO - post: - operationId: letter_create - summary: Create - description: Creates a new letter given information - tags: - - Letters - parameters: - - $ref: '#/components/parameters/idem-header' - - $ref: '#/components/parameters/idem-query' - - $ref: '#/components/parameters/lob-version' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/letter_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 Letter for {{name}}' - color: true - cards: - - card_c51ae96f5cebf3e - double_sided: false - address_placement: bottom_first_page - mail_type: usps_first_class - return_envelope: true - perforated_page: 1 - merge_variables: - name: Harry - metadata: - spiffy: 'true' - send_date: '2017-11-01T00:00:00.000Z' - extra_service: registered - custom_envelope: null - 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 - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/letter_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 Letter for {{name}}' - color: true - cards: - - card_c51ae96f5cebf3e - double_sided: false - address_placement: top_first_page - mail_type: usps_first_class - return_envelope: true - perforated_page: 1 - merge_variables: - name: Harry - metadata: - spiffy: 'true' - send_date: '2017-11-01T00:00:00.000Z' - extra_service: registered - custom_envelope: null - use_type: marketing - qr_code: - position: relative - redirect_url: https://www.lob.com - width: '2' - bottom: '2' - right: '2' - pages: 1,4 - fsc: true - encoding: - to: - style: deepObject - explode: true - from: - style: deepObject - explode: true - merge_variables: - style: deepObject - explode: true - metadata: - style: deepObject - explode: true - multipart/form-data: - schema: - $ref: '#/components/schemas/letter_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 Letter for {{name}}' - color: true - cards: - - card_c51ae96f5cebf3e - double_sided: false - address_placement: top_first_page - mail_type: usps_first_class - return_envelope: true - perforated_page: 1 - merge_variables: - name: Harry - metadata: - spiffy: 'true' - send_date: '2017-11-01T00:00:00.000Z' - extra_service: registered - custom_envelope: null - use_type: marketing - qr_code: - position: relative - redirect_url: https://www.lob.com - width: '2' - bottom: '2' - left: '2' - pages: 1,3-5 - fsc: true - responses: - '200': - $ref: '#/components/responses/post_letter' - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/letters \ - -u YOUR_API_KEY \ - -d 'description=Demo Letter' \ - -d 'to[name]=Harry Zhang' \ - -d 'to[address_line1]=210 King St' \ - -d 'to[address_line2]=# 6100' \ - -d 'to[address_city]=San Francisco' \ - -d 'to[address_state]=CA' \ - -d 'to[address_zip]=94107' \ - -d 'from=adr_210a8d4b0b76d77b' \ - --data-urlencode 'file=HTML Letter for {{name}}' \ - -d 'merge_variables[name]=Harry' \ - -d 'color=true' \ - -d 'cards[]=card_c51ae96f5cebf3e' \ - -d 'qr_code[position]=relative' \ - -d 'qr_code[redirect_url]=https://www.lob.com' \ - -d 'qr_code[width]=2' \ - -d 'qr_code[bottom]=2' \ - -d 'qr_code[left]=2' \ - -d 'qr_code[pages]=3,4-5' \ - -d 'fsc=true' - label: CURL - - lang: Typescript - source: | - const letterCreate = new LetterEditable({ - to: { - name: 'Harry Zhang', - address_line1: '210 King St', - address_line2: '# 6100', - address_city: 'San Francisco', - address_state: 'CA', - address_zip: '94107' - }, - from: 'adr_xxxx', - color: true, - extra_service: LetterEditableExtraServiceEnum.Certified, - file: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/us_letter_1pg.pdf', - use_type: 'marketing', - qr_code : { - position: 'relative', - redirect_url: 'https://www.lob.com', - width: '2', - bottom: '2', - left: '2', - pages: '2,5' - }, - fsc: true - }); - - try { - const myLetter = await new LettersApi(config).create(letterCreate); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.letters.create({ - description: 'Demo Letter', - to: { - name: 'Harry Zhang', - address_line1: '210 King St', - address_line2: '# 6100', - address_city: 'San Francisco', - address_state: 'CA', - address_zip: '94107' - }, - from: 'adr_210a8d4b0b76d77b', - file: 'HTML Letter for {{name}}', - merge_variables: { - name: 'Harry' - }, - color: true, - cards: ['card_c51ae96f5cebf3e'], - use_type: 'marketing', - qr_code : { - position: 'relative', - redirect_url: 'https://www.lob.com', - width: '2', - bottom: '2', - left: '2', - pages: '2,4-5' - }, - fsc: true - }, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - letterCreate = LetterEditable.new({ - description: "Demo Letter", - from: "adr_210a8d4b0b76d77b", - file: "HTML Letter for {{name}}", - color: "true", - to: AddressEditable.new({ - name: "Harry Zhang", - address_line1: "210 King St", - address_line2: "# 6100", - address_city: "San Francisco", - address_state: "CA", - address_zip: "94107", - }), - merge_variables: { - name: "Harry" - }, - cards: [ - "card_c51ae96f5cebf3e", - ], - use_type: "marketing", - fsc: true - }); - - letterApi = LettersApi.new(config) - - begin - createdLetter = letterApi.create(letterCreate) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - letter_editable = LetterEditable( - description = "Demo Letter", - _from = "adr_210a8d4b0b76d77b", - file = "HTML Letter for {{name}}", - color = True, - to = AddressEditable( - name = "Harry Zhang", - address_line1 = "210 King St", - address_line2 = "# 6100", - address_city = "San Francisco", - address_state = "CA", - address_zip = "94107", - ), - merge_variables = MergeVariables( - name = "Harry", - ), - cards = [ - "card_c51ae96f5cebf3e", - ], - use_type = "marketing", - qr_code = { - "position" : "relative", - "redirect_url" : "https://www.lob.com", - "width" : "2", - "bottom" : "2", - "left" : "2", - "pages" : "1,3" - }, - fsc = true - ) - - with ApiClient(configuration) as api_client: - api = LettersApi(api_client) - - try: - created_letter = api.create(letter_editable) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $to = new OpenAPI\Client\Model\AddressEditable( - array( - "name" => "Harry Zhang", - "address_line1" => "210 King St", - "address_line2" => "# 6100", - "address_city" => "San Francisco", - "address_state" => "CA", - "address_zip" => "94107", - ) - ); - - $qr_code = new OpenAPI\Client\Model\QRCode( - array( - "position" => "relative", - "redirect_url" => "https://www.lob.com", - "width" => "2", - "bottom" => "2", - "left" => "2", - "pages" => "1,3,5", - ) - ); - - $merge_variables = new stdClass; - $merge_variables->name = "Harry"; - - $use_type = "marketing"; - $fsc = true; - - $apiInstance = new OpenAPI\Client\Api\LettersApi($config, new GuzzleHttp\Client()); - $letter_editable = new OpenAPI\Client\Model\LetterEditable( - array( - "description" => "Demo Letter", - "from" => "adr_210a8d4b0b76d77b", - "file" => "HTML Letter for {{name}}", - "color" => "true", - "to" => $to, - "merge_variables" => $merge_variables, - "cards" => array( - "card_c51ae96f5cebf3e", - "card_thingy", - ), - "use_type" => $use_type; - "qr_code" => $qr_code, - "fsc" => $fsc, - ) - ); - - try { - $result = $apiInstance->create($letter_editable); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - Map merge_variables = new HashMap(); - merge_variables.put("name", "Harry"); - - LettersApi apiInstance = new LettersApi(config); - - AddressEditable to = new AddressEditable(); - to.setName("Harry Zhang"); - to.setAddressLine1("210 King St"); - to.setAddressLine2("# 6100"); - to.setAddressCity("San Francisco"); - to.setAddressState("CA"); - to.setAddressZip("94107"); - - QRCode qrCode = new QRCode(); - qrCode.setPosition("relative"); - qrCode.setRedirectUrl("https://www.lob.com"); - qrCode.setWidth("2"); - qrCode.setLeft("2"); - qrCode.setBottom("2"); - qrCode.setPages("1,3,5"); - - List cards = new ArrayList(); - cards.add("card_c51ae96f5cebf3e"); - cards.add("card_thingy"); - - try { - LetterEditable letterEditable = new LetterEditable(); - letterEditable.setDescription("Demo Letter"); - letterEditable.setFrom("adr_210a8d4b0b76d77b"); - letterEditable.setFile("HTML Letter for {{name}}"); - letterEditable.setColor(true); - letterEditable.setTo(to); - letterEditable.setMergeVariables(merge_variables); - letterEditable.setCards(cards); - letterEditable.setUseType("operational"); - letterEditable.setQRCode(qrCode); - letterEditable.setFsc(true); - - Letter result = apiInstance.create(letterEditable, null); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Letter.create(%{ - description: 'Demo Letter', - to: %{ - name: 'Harry Zhang', - address_line1: '210 King St', - address_line2: '# 6100', - address_city: 'San Francisco', - address_state: 'CA', - address_zip: '94107' - }, - from: 'adr_210a8d4b0b76d77b', - file: 'HTML Letter for {{name}}', - merge_variables: %{ - name: 'Harry' - }, - color: true, - cards: ['card_c51ae96f5cebf3e'], - use_type: 'marketing', - qr_code: %{ - position: 'relative', - redirect_url: 'https://www.lob.com', - width: '2', - bottom: '2', - left: '2', - pages: '1-2,5' - }, - fsc: true - }) - label: ELIXIR - - lang: CSharp - source: | - Dictionary mergeVariables = new Dictionary(); - mergeVariables.Add("name", "Harry"); - - LettersApi api = new LettersApi(config); - - AddressEditable to = new AddressEditable( - "210 King St", // addressLine1 - "# 6100", // addressLine2 - "San Francisco", // addressCity - "CA", // addressState - "94107", // addressZip - default(CountryExtended), // addressCounty - null, // description - "Harry Zhang" // name - ); - - UseType usetype = new UseType("marketing"); - - QRCode qrCode = new QRCode( - "relative", //position, - "https://www.lob.com", //redirect_url - "2", //width - "2", //left - "2", //bottom - "1-2,5", //pages - ); - - Fsc fsc = new Fsc(true); - - List cards = new List(); - cards.Add("card_c51ae96f5cebf3e"); - - LetterEditable letterEditable = new LetterEditable( - "Demo Letter", // description - default(Dictionary), // metadata - default(MailType), // mailType - mergeVariables, // mergeVariables - default(DateTime), // sendDate - true, // color - true, // doubleSided - LetterEditable.AddressPlacementEnum.TopFirstPage, // addressPlacement - default(Object), // returnEnvelope - default(int?), // perforatedPage - default(LetterEditableCustomEnvelope), // customEnvelope - to.ToJson(), // to - "adr_249af768103d2810", // from - "HTML Letter for {{name}}", // file - default(LetterEditable.ExtraServiceEnum?), // extraService - cards, // cards - usetype, - qrCode, - fsc - ); - - try { - Letter result = api.create(letterEditable, null); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - var to = *lob.NewAddressEditable() - to.SetAddressLine1("210 King St") - to.SetAddressLine2("# 6100") - to.SetAddressCity("San Francisco") - to.SetAddressState("CA") - to.SetAddressZip("94107") - to.SetAddressCountry(lob.COUNTRYEXTENDED_US) - to.SetDescription("") - to.SetName("Harry Zhang") - - var letterCreate = *lob.NewLetterEditable() - letterCreate.SetDescription("Demo Letter") - letterCreate.SetFrom("adr_210a8d4b0b76d77b") - letterCreate.SetFile("HTML Letter for {{name}}") - letterCreate.SetColor("true") - letterCreate.SetTo(to) - letterCreate.SetFsc(true) - - - createdletter, _, err := apiClient.LettersApi.Create(context).LetterEditable(letterCreate).Execute() - - if err != nil { - return err - } - label: GO - /postcards/{psc_id}: - parameters: - - in: path - name: psc_id - description: id of the postcard - required: true - schema: - $ref: '#/components/schemas/psc_id' - get: - operationId: postcard_retrieve - summary: Retrieve - description: Retrieves the details of an existing postcard. You need only supply the unique customer identifier that was returned upon postcard creation. - tags: - - Postcards - responses: - '200': - description: Returns a postcard object - content: - application/json: - schema: - $ref: '#/components/schemas/postcard' - examples: - basic: - value: - id: psc_208e45e48d271294 - description: null - metadata: {} - to: - id: adr_210a8d4b0b76d77b - description: null - name: null - company: LOB - phone: null - email: null - address_line1: 210 KING ST STE 6100 - address_line2: null - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2018-12-08T03:01:07.651Z' - date_modified: '2018-12-08T03:01:07.651Z' - object: address - url: https://lob-assets.com/postcards/psc_208e45e48d271294.pdf?version=v1&expires=1619218302&signature=NfHHLBSr5tOHA_Z4kij4dKqZG8f3vMDtwvuFVeeF9pV_lylcjLsVVODhNCE5hR6-2slUr6t9WMNsi429Pj7_DA - carrier: USPS - front_template_id: null - back_template_id: null - date_created: '2021-03-24T22:51:42.838Z' - date_modified: '2021-03-24T22:51:42.838Z' - send_date: '2021-03-24T22:51:42.838Z' - use_type: marketing - fsc: false - object: postcard - full: - value: - id: psc_0e03d1ad7d31f151 - description: null - metadata: {} - to: - id: adr_c7cb63d68f8d6 - description: null - name: JANE DOE - company: LOB - phone: '5555555555' - email: jane.doe@lob.com - address_line1: 370 WATER ST - address_line2: '' - address_city: SUMMERSIDE - address_state: PE - address_zip: C1N 1C4 - address_country: CANADA - metadata: {} - date_created: '2018-12-08T03:01:07.651Z' - date_modified: '2018-12-08T03:01:07.651Z' - object: address - recipient_moved: false - from: - id: adr_210a8d4b0b76d77b - description: null - name: LEORE AVIDAR - company: null - phone: null - email: null - address_line1: 210 KING ST STE 6100 - address_line2: null - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2018-12-08T03:01:07.651Z' - date_modified: '2018-12-08T03:01:07.651Z' - object: address - url: https://lob-assets.com/postcards/psc_208e45e48d271294.pdf?version=v1&expires=1619218302&signature=NfHHLBSr5tOHA_Z4kij4dKqZG8f3vMDtwvuFVeeF9pV_lylcjLsVVODhNCE5hR6-2slUr6t9WMNsi429Pj7_DA - carrier: USPS - front_template_id: tmpl_93c369f06171958 - back_template_id: tmpl_93c369f06171958 - front_template_version_id: vrsn_a83e044941c393b - back_template_version_id: vrsn_a83e044941c393b - tracking_events: [] - size: 6x11 - mail_type: usps_first_class - merge_variables: {} - thumbnails: - - small: https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_small_1.png?expires=1540372221&signature=a5fRBJ22ZA78Vgpg34M9UfmHWTS3eha - medium: https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_medium_1.png?expires=1540372221&signature=bAzL8sv935PY09FWSkpDpWKkyvGSWYF - large: https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_large_1.png?expires=1540372221&signature=gsKvxXgrm4v4iZD3bOibK7jApNkEMdW - expected_delivery_date: '2021-03-30' - date_created: '2021-03-24T22:51:42.838Z' - date_modified: '2021-03-24T22:51:42.838Z' - send_date: '2021-03-24T22:51:42.838Z' - use_type: marketing - fsc: false - object: postcard - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/postcards/psc_5c002b86ce47537a \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: Typescript - source: | - try { - const postcard = await new PostCardsApi(config).get('psc_xxxx'); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.postcards.retrieve('psc_5c002b86ce47537a', function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - letterApi = LettersApi.new(config) - - begin - retrievedLetter = letterApi.get("ltr_4868c3b754655f90") - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = PostcardsApi(api_client) - - try: - postcard = api.get("psc_5c002b86ce47537a") - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\PostcardsApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->get("psc_5c002b86ce47537a"); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - PostcardsApi apiInstance = new PostcardsApi(config); - - try { - Postcard response = apiInstance.get("psc_5c002b86ce47537a"); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Postcard.find("psc_5c002b86ce47537a") - label: ELIXIR - - lang: CSharp - source: | - PostcardsApi api = new PostcardsApi(config); - - try { - Postcard response = api.get("psc_5c002b86ce47537a"); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - fetchedPostcard, _, err := apiClient.PostcardsApi.Get(context,"psc_5c002b86ce47537a").Execute() - - if err != nil { - return err - } - label: GO - delete: - operationId: postcard_delete - summary: Cancel - description: Completely removes a postcard from production. This can only be done if the postcard has a `send_date` and the `send_date` has not yet passed. If the postcard is successfully canceled, you will not be charged for it. Read more on [cancellation windows](#section/Cancellation-Windows) and [scheduling](#section/Scheduled-Mailings). Scheduling and cancellation is a premium feature. Upgrade to the appropriate Print & Mail Edition to gain access. - tags: - - Postcards - responses: - '200': - $ref: '#/components/responses/postcard_deleted' - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl -X DELETE https://api.lob.com/v1/postcards/psc_5c002b86ce47537a \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: Typescript - source: | - try { - const deletePostcard = await new PostcardsApi(config).delete('psc_xxxx'); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.postcards.delete('psc_5c002b86ce47537a', function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - letterApi = LettersApi.new(config) - - begin - deletedLetter = letterApi.cancel("ltr_4868c3b754655f90") - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = PostcardsApi(api_client) - - try: - deleted_resource = api.cancel("psc_5c002b86ce47537a") - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\PostcardsApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->cancel("psc_5c002b86ce47537a"); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - PostcardsApi apiInstance = new PostcardsApi(config); - - try { - PostcardDeletion response = apiInstance.cancel("psc_5c002b86ce47537a"); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Postcard.destroy("psc_5c002b86ce47537a") - label: ELIXIR - - lang: CSharp - source: | - PostcardsApi api = new PostcardsApi(config); - - try { - PostcardDeletion response = api.delete("psc_5c002b86ce47537a"); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - deletedPostcard, _, err := apiClient.PostcardsApi.Delete(context, "psc_5c002b86ce47537a").Execute() - - if err != nil { - return err - } - label: GO - /postcards: - get: - operationId: postcards_list - summary: List - description: Returns a list of your postcards. The addresses are returned sorted by creation date, with the most recently created addresses appearing first. - tags: - - Postcards - 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/campaign_id' - - $ref: '#/components/parameters/status' - - in: query - name: size - description: Specifies the size of the postcard. Only `4x6` postcards can be sent to international destinations. - schema: - type: array - items: - $ref: '#/components/schemas/postcard_size' - - $ref: '#/components/parameters/scheduled' - - $ref: '#/components/parameters/send_date' - - $ref: '#/components/parameters/mail_type' - - $ref: '#/components/parameters/sort_by' - responses: - '200': - $ref: '#/components/responses/all_postcards' - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl -X GET "https://api.lob.com/v1/postcards?limit=2" \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: typescript - source: | - try { - const postcards = await new PostcardsApi(config).list(2); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.postcards.list({limit: 2}, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - postcardsApi = PostcardsApi.new(config) - - begin - postcards = postcardsApi.list({ limit: 2 }) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = PostcardsApi(api_client) - - try: - postcards = api.list(limit=2) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\PostcardsApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->list( - 2, // limit - ); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - PostcardsApi apiInstance = new PostcardsApi(config); - - try { - PostcardList response = apiInstance.list( - 2, // limit - null, // before - null, // after - null, // include - null, // dateCreated - null, // metadata - null, // size - null, // scheduled - null, // sendDate - null, // mailType - null // sortBy - ); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Postcard.list(%{limit: 2}) - label: ELIXIR - - lang: CSharp - source: | - PostcardsApi api = new PostcardsApi(config); - - List includeList = new List(); - includeList.Add("total_count"); - Dictionary metadata = new Dictionary(); - metadata.Add("name", "Harry"); - Dictionary dateCreated = new Dictionary(); - DateTime dateCreatedDate = DateTime.Today.AddMonths(-1); - dateCreated.Add("lt", dateCreatedDate); - Dictionary sendDate = new Dictionary(); - sendDate.Add("lt", DateTime.Now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz")); - SortBy3 sortBy = new SortBy3(SortBy3.DateCreatedEnum.Asc); - List sizeArray = new List(); - sizeArray.Add(PostcardSize._4x6); - - try { - PostcardList response = api.list( - 2, // limit - null, // before - null, // after - includeList, // include - dateCreated, // dateCreated - metadata, // metadata - sizeArray, // size - true, // scheduled - sendDate, // sendDate - MailType.FirstClass, // mailType - sortBy // sortBy - ); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - PostcardList = apiClient.PostcardsApi.List(context).Execute() - if err != nil { - return err - } - label: GO - post: - operationId: postcard_create - summary: Create - description: Creates a new postcard given information - tags: - - Postcards - parameters: - - $ref: '#/components/parameters/idem-header' - - $ref: '#/components/parameters/idem-query' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/postcard_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: - 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 - front: tmpl_a1234dddg - back: tmpl_a1234dddg - size: 6x9 - 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.5' - top: '2.5' - right: '2.5' - pages: front,back - fsc: true - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/postcard_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: - 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 - front: tmpl_c94e83ca2cd5121 - back: tmpl_c94e83ca2cd5121 - size: 6x9 - 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.5' - bottom: '2.5' - right: '2.5' - pages: back - fsc: true - encoding: - to: - style: deepObject - explode: true - from: - style: deepObject - explode: true - merge_variables: - style: deepObject - explode: true - metadata: - style: deepObject - explode: true - multipart/form-data: - schema: - $ref: '#/components/schemas/postcard_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: - 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 - front: tmpl_a1234dddg - back: tmpl_a1234dddg - size: 6x9 - 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.5' - bottom: '2.5' - left: '2.5' - pages: front - fsc: true - responses: - '200': - $ref: '#/components/responses/post_postcard' - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/postcards \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ - -d 'description=Demo Postcard job' \ - -d 'to[name]=Harry Zhang' \ - -d 'to[address_line1]=210 King St' \ - -d 'to[address_line2]=# 6100' \ - -d 'to[address_city]=San Francisco' \ - -d 'to[address_state]=CA' \ - -d 'to[address_zip]=94107' \ - -d 'from=adr_210a8d4b0b76d77b' \ - --data-urlencode 'front=Front HTML for {{name}}' \ - --data-urlencode 'back=Back HTML for {{name}}' \ - -d 'merge_variables[name]=Harry' \ - -d 'use_type=marketing' \ - -d 'qr_code[position]=relative' \ - -d 'qr_code[redirect_url]=https://www.lob.com' \ - -d 'qr_code[width]=2.5' \ - -d 'qr_code[bottom]=2.5' \ - -d 'qr_code[left]=2.5' \ - -d 'qr_code[pages]=front,back' \ - -d 'fsc=true' - label: CURL - - lang: Typescript - source: | - const postcardCreate = new PostcardEditable({ - to: new AddressEditable({ - name: 'Harry Zhang', - address_line1: '210 King St', - address_line2: '# 6100', - address_city: 'San Francisco', - address_state: 'CA', - address_zip: '94107' - }), - from: 'adr_xxxx', - front: - 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/4x6_pc_template.pdf', - back: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/4x6_pc_template.pdf', - use_type: 'marketing', - qr_code : { - position: 'relative', - redirect_url: 'https://www.lob.com', - width: '2.5', - bottom: '2.5', - left: '2.5', - pages: 'front' - }, - fsc: true - }); - - try { - const myPostcard = await new PostcardsApi(config).create(postcardCreate); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.postcards.create({ - description: 'Demo Postcard job', - to: { - name: 'Harry Zhang', - address_line1: '210 King St', - address_line2: '# 6100', - address_city: 'San Francisco', - address_state: 'CA', - address_zip: '94107' - }, - from: 'adr_210a8d4b0b76d77b', - front: 'Front HTML for {{name}}', - back: 'Back HTML for {{name}}', - merge_variables: { - name: 'Harry' - }, - use_type: 'marketing' - qr_code : { - position: 'relative', - redirect_url: 'https://www.lob.com', - width: '2.5', - bottom: '2.5', - left: '2.5', - pages: 'back' - }, - fsc: true - }, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - postcardCreate = PostcardEditable.new({ - description: "Demo Postcard job", - from: "adr_210a8d4b0b76d77b", - front: "Front HTML for {{name}}", - back: "Back HTML for {{name}}", - to: AddressEditable.new({ - name: "Harry Zhang", - address_line1: "210 King St", - address_line2: "# 6100", - address_city: "San Francisco", - address_state: "CA", - address_zip: "94107", - }), - merge_variables: { - name: "Harry" - }, - fsc: true - }); - - postcardApi = PostcardsApi.new(config) - - begin - createdPostcard = postcardApi.create(postcardCreate) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - postcard_editable = PostcardEditable( - description = "Demo Postcard job", - _from = "adr_210a8d4b0b76d77b", - front = "Front HTML for {{name}}", - back = "Back HTML for {{name}}", - to = AddressEditable( - name = "Harry Zhang", - address_line1 = "210 King St", - address_line2 = "# 6100", - address_city = "San Francisco", - address_state = "CA", - address_zip = "94107", - ), - merge_variables = MergeVariables( - name = "Harry", - ), - use_type = "marketing", - qr_code = { - "position" : "relative", - "redirect_url" : "https://www.lob.com", - "width" : "2.5", - "bottom" : "2.5", - "left" : "2.5", - "pages" : "front" - }, - fsc = true - ) - - with ApiClient(configuration) as api_client: - api = PostcardsApi(api_client) - - try: - created_postcard = api.create(postcard_editable) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $to = new OpenAPI\Client\Model\AddressEditable( - array( - "name" => "Harry Zhang", - "address_line1" => "210 King St", - "address_line2" => "# 6100", - "address_city" => "San Francisco", - "address_state" => "CA", - "address_zip" => "94107", - ) - ); - - $merge_variables = new stdClass; - $merge_variables->name = "Harry"; - $use_type = "marketing"; - - $qr_code = new OpenAPI\Client\Model\QRCode( - array( - "position" => "relative", - "redirect_url" => "https://www.lob.com", - "width" => "2", - "bottom" => "2", - "left" => "2", - "pages" => "front,back" - ) - ); - - $fsc = true; - - $apiInstance = new OpenAPI\Client\Api\PostcardsApi($config, new GuzzleHttp\Client()); - $postcard_editable = new OpenAPI\Client\Model\PostcardEditable( - array( - "description" => "Demo Postcard job", - "from" => "adr_210a8d4b0b76d77b", - "front" => "Front HTML for {{name}}", - "back" => "Back HTML for {{name}}", - "to" => $to, - "merge_variables" => $merge_variables, - "use_type" => $use_type, - "qr_code" => $qr_code, - "fsc" => $fsc - ) - ); - - try { - $result = $apiInstance->create($postcard_editable); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - Map merge_variables = new HashMap(); - merge_variables.put("name", "Harry"); - - PostcardsApi apiInstance = new PostcardsApi(config); - - AddressEditable to = new AddressEditable(); - to.setName("Harry Zhang"); - to.setAddressLine1("210 King St"); - to.setAddressLine2("# 6100"); - to.setAddressCity("San Francisco"); - to.setAddressState("CA"); - to.setAddressZip("94107"); - - QRCode qrCode = new QRCode(); - qrCode.setPosition("relative"); - qrCode.setRedirectUrl("https://www.lob.com"); - qrCode.setWidth("2"); - qrCode.setLeft("2"); - qrCode.setBottom("2"); - qrCode.setPages("back"); - - try { - PostcardEditable postcardEditable = new PostcardEditable(); - postcardEditable.setDescription("Demo Postcard job"); - postcardEditable.setFrom("adr_210a8d4b0b76d77b"); - postcardEditable.setFront("Front HTML for {{name}}"); - postcardEditable.setBack("Back HTML for {{name}}"); - postcardEditable.setTo(to); - postcardEditable.setMergeVariables(merge_variables); - postcardEditable.setUseType("operational"); - postcardEditable.setQRCode(qrCode); - postcardEditable.setFsc(true); - - Postcard result = apiInstance.create(postcardEditable, null); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Postcard.create(%{ - description: 'Demo Postcard job', - to: %{ - name: 'Harry Zhang', - address_line1: '210 King St', - address_line2: '# 6100', - address_city: 'San Francisco', - address_state: 'CA', - address_zip: '94107' - }, - from: 'adr_210a8d4b0b76d77b', - front: 'Front HTML for {{name}}', - back: 'Back HTML for {{name}}', - merge_variables: %{ - name: 'Harry' - }, - use_type: 'marketing' - qr_code: %{ - position: 'relative', - redirect_url: 'https://www.lob.com', - width: '2', - bottom: '2', - left: '2', - pages: 'front,back' - }, - fsc: true - }) - label: ELIXIR - - lang: CSharp - source: | - Dictionary mergeVariables = new Dictionary(); - mergeVariables.Add("name", "Harry"); - - PostcardsApi api = new PostcardsApi(config); - - AddressEditable to = new AddressEditable( - "210 King St", // addressLine1 - "# 6100", // addressLine2 - "San Francisco", // addressCity - "CA", // addressState - "94107", // addressZip - CountryExtended.US, // addressCounty - null, // description - "Harry Zhang" // name - ); - - UseType usetype = new UseType('marketing'); - - QRCode qrCode = new QRCode( - "relative", //position, - "https://www.lob.com", //redirect_url - "2", //width - "2", //left - "2", //bottom - "front", //pages - ); - - Fsc fsc = new Fsc(true); - - PostcardEditable postcardEditable = new PostcardEditable( - to.ToJson(), // to - "adr_249af768103d2810", // from - default(PostcardSize), // size - "Demo Postcard Job", // description - null, // metadata - default(MailType), // mailType - mergeVariables, // mergeVariables - default(DateTime), // sendDate - "Back HTML for {{name}}", // front - "Back HTML for {{name}}", // back - usetype, - qrCode, - fsc - ); - - try { - Postcard result = api.create(postcardEditable, null); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - var to = *lob.NewAddressEditable() - to.SetAddressLine1("210 King St") - to.SetAddressLine2("# 6100") - to.SetAddressCity("San Francisco") - to.SetAddressState("CA") - to.SetAddressZip("94107") - to.SetAddressCountry(lob.COUNTRYEXTENDED_US) - to.SetDescription("") - to.SetName("Harry Zhang") - - var postcardCreate = *lob.NewPostcardEditable() - postcardCreate.SetDescription("Demo Postcard job") - postcardCreate.SetFrom("adr_210a8d4b0b76d77b") - postcardCreate.SetFront("Front HTML for {{name}}") - postcardCreate.SetBack("Back HTML for {{name}}") - postcardCreate.SetTo(to) - postcardCreate.SetFsc(true) - - - createdpostcard, _, err := apiClient.PostcardsApi.Create(context).PostcardEditable(postcardCreate).Execute() - - if err != nil { - return err - } - label: GO - /qr_code_analytics: - get: - operationId: qr_codes_list - summary: List - description: Returns a list of your QR codes. The QR codes are returned sorted by scan date, with the most recently scanned QR codes appearing first. - tags: - - QR Codes - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/include' - - $ref: '#/components/parameters/date_created' - - in: query - name: scanned - description: Filter list of responses to only include QR codes with at least one scan event. - schema: - type: boolean - - in: query - name: resource_ids - description: Filter by the resource ID. - schema: - type: array - maxItems: 100 - default: [] - responses: - '200': - description: Returns a list of QR Codes and their analytics. - content: - application/json: - schema: - allOf: - - type: object - properties: - object: - $ref: '#/components/schemas/object' - 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 - scanned_count: - type: integer - description: Indicates the number of QR Codes out of `count` that were scanned atleast once. - data: - type: array - description: List of QR code analytics - items: - $ref: '#/components/schemas/qr_code_scans' - example: - data: - - resource_id: ltr_d5a5a89da9106f8 - date_created: '2019-07-27T23:49:01.511Z' - number_of_scans: 2 - scans: - - ip_location: 127.0.0.1 - scan_date: '2022-07-27T23:49:01.511Z' - - ip_location: 127.0.0.1 - scan_date: '2022-07-29T23:45:00.436Z' - - resource_id: psc_d5a5a89da9106f8 - date_created: '2022-09-27T23:49:01.511Z' - number_of_scans: 1 - scans: - - ip_location: 127.0.0.1 - scan_date: '2022-09-27T23:49:01.511Z' - object: list - count: 2 - scanned_count: 2 - total_count: 2 - x-codeSamples: - - lang: Shell - source: | - curl -X GET "https://api.lob.com/v1/qr_code_analytics?limit=2&scanned=true" \ - -u : - /domains/{domain_id}: - parameters: - - in: path - name: domain_id - required: true - description: Unique identifier for a domain. - schema: - type: string - get: - operationId: domain_get - summary: Retrieve a domain - description: Retrieve details for a single domain. - tags: - - URL Shortener - responses: - '200': - description: Returns domain related details. - content: - application/json: - schema: - $ref: '#/components/schemas/domain_response' - default: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - x-codeSamples: - - lang: Shell - source: | - curl -X GET "https://api.lob.com/v1/domains/{domain_id}" \ - -u : - label: CURL - - lang: Typescript - source: | - try { - const domain = await new DomainsApi(config).get('xxxxxx'); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.domains.retrieve('xxxxxx', function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - domainsAPI = DomainsApi.new(config) - - begin - retrievedDomain = domainsAPI.get("xxxxxx") - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = DomainsApi(api_client) - - try: - domain = api.get("xxxxxx") - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\DomainsApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->get("xxxxxx"); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - DomainsApi apiInstance = new DomainsApi(config); - - try { - Domain response = apiInstance.get("xxxxxx"); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Domain.retrieve("xxxxxx") - label: ELIXIR - - lang: CSharp - source: | - DomainsApi api = new DomainsApi(config); - - try { - Domain response = api.get("xxxxxx"); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - fetchedDomain, _, err := apiClient.DomainsApi.Get(context,"xxxxxx").Execute() - - if err != nil { - return err - } - label: GO - delete: - operationId: domain_delete - summary: Delete a Domain - description: Delete a registered domain. This operation can only be performed if all associated links with the domain are deleted. - tags: - - URL Shortener - responses: - '200': - description: Returns the deleted link object. - content: - application/json: - schema: - $ref: '#/components/schemas/domain_response' - default: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /domains: - post: - operationId: domain_create - summary: Create Domain - description: Add a new custom domain that can be used to create custom links. - tags: - - URL Shortener - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/domains' - examples: - basic: - value: - domain: lob.st - test: - value: - domain: lob.st - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/domains' - examples: - basic: - value: - domain: lob.st - test: - value: - domain: lob.st - multipart/form-data: - schema: - $ref: '#/components/schemas/domains' - examples: - basic: - value: - domain: lob.st - test: - value: - domain: lob.st - responses: - '200': - description: Returns a domain object with details. - content: - application/json: - schema: - $ref: '#/components/schemas/domain_response' - default: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - example: - error: - code: invalid - message: domain is required - status_code: 422 - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/domains \ - -u : \ - -d "domain=lob.st" - label: CURL - - lang: Typescript - source: | - const domainApi = await new DomainsApi(config); - const domainData: DomainsWritable = { - domain: 'lob.st' - } - try { - const createdDomain = await domainApi.createDomain(domainData); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.domains.create({ - domain: 'lob.st' - }, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - domainsAPI = DomainsApi.new(config) - - domainsData = DomainsWritable.new({ - domain: "lob.st" - }) - - begin - createdDomain = domainsAPI.create(domainsData) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = DomainsApi(api_client) - - domains_data = DomainsWritable( - domain: "lob.st" - ) - - try: - domain = api.create(domains_data) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\DomainsApi($config, new GuzzleHttp\Client()); - - $domainsData = new OpenAPI\Client\Model\DomainsWritable(array( - 'domain' => 'lob.st', - )); - - try { - $result = $apiInstance->create($domainsData); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - DomainsWritable domain = new DomainsWritable(); - domain.setDomain("lob.st"); - - DomainsApi apiInstance = new DomainsApi(config); - - try { - apiInstance.create(domain); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Domain.create(%{ - domain: "lob.st" - }) - label: ELIXIR - - lang: CSharp - source: | - DomainsWritable domain = new DomainsWritable( - "lob.st" - ) - - DomainsApi api = new DomainsApi(config); - - try { - api.create(domain, null); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - get: - operationId: domain_list - summary: List all domains - description: Retrieve a list of all created domains. - tags: - - URL Shortener - responses: - '200': - description: Returns a list of all domains. - content: - application/json: - schema: - $ref: '#/components/schemas/domains_response' - default: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - x-codeSamples: - - lang: Shell - source: | - curl -X GET "https://api.lob.com/v1/domains?limit=2" \ - -u : - label: CURL - - lang: Typescript - source: | - try { - const domains = await new DomainsApi(config).list(2); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.domains.list({limit: 2}, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - domainsApi = DomainsApi.new(config) - - begin - domains = domainsApi.list({ limit: 2 }) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = DomainsApi(api_client) - - try: - domains = api.list(limit=2) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\DomainsApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->list( - 2, // limit - ); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - DomainsApi apiInstance = new DomainsApi(config); - - try { - DomainsList response = apiInstance.list( - 2, // limit - null, // before - null, // after - null, // include - null, // dateCreated - ); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Domains.list(%{limit: 2}) - label: ELIXIR - - lang: CSharp - source: | - DomainsApi api = new DomainsApi(config); - - try { - DomainsList response = api.list( - 2, // limit - null, // before - null, // after - null, // include - null, // dateCreated - ); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - DomainsList = apiClient.DomainsApi.List(context).Execute() - if err != nil { - return err - } - label: GO - /domains/{domain_id}/links: - parameters: - - in: path - name: domain_id - required: true - description: Unique identifier for a domain. - schema: - type: string - delete: - operationId: domain_delete_links - summary: Delete all links for a domain - description: Delete all associated links for a domain - tags: - - URL Shortener - responses: - '200': - description: Returns the deleted objects. - content: - application/json: - schema: - $ref: '#/components/schemas/domains_response' - default: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /links: - get: - operationId: links_list - summary: Retrieve all shortened links - description: Retrieves a list of shortened links. The list is sorted by creation date, with the most recently created appearing first. - tags: - - URL Shortener - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/include' - - $ref: '#/components/parameters/date_created' - - $ref: '#/components/parameters/metadata' - - in: query - name: campaign_id - description: Filter the links generated for a particular campaign using its campaign id. - schema: - $ref: '#/components/schemas/cmp_id' - - in: query - name: clicked - description: Retrieve the list of links that have been opened. - schema: - type: boolean - - in: query - name: billing_group_id - description: Filter the links generated for a particular billing group id. - schema: - $ref: '#/components/schemas/billing_group_id' - responses: - '200': - description: Returns the deleted link object. - content: - application/json: - schema: - $ref: '#/components/schemas/links_response' - default: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - x-codeSamples: - - lang: Shell - source: | - curl -X GET "https://api.lob.com/v1/links/?limit=2" \ - -u : - label: CURL - - lang: Typescript - source: | - try { - const links = await new LinksApi(config).list(2); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.links.list({limit: 2}, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - linksApi = LinksApi.new(config) - - begin - links = linksApi.list({ limit: 2 }) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = LinksApi(api_client) - - try: - links = api.list(limit=2) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\LinksApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->list( - 2, // limit - ); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - LinksApi apiInstance = new LinksApi(config); - - try { - LinksList response = apiInstance.list( - 2, // limit - null, // before - null, // after - null, // include - null, // dateCreated - ); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.Links.list(%{limit: 2}) - label: ELIXIR - - lang: CSharp - source: | - LinksApi api = new LinksApi(config); - - try { - LinksList response = api.list( - 2, // limit - null, // before - null, // after - null, // include - null, // dateCreated - ); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - LinksList = apiClient.LinksApi.List(context).Execute() - if err != nil { - return err - } - label: GO - /links/{link_id}: - parameters: - - in: path - name: link_id - required: true - description: Unique identifier for a link. - schema: - type: string - get: - operationId: links_get - summary: Retrieve a link - description: Retrievs a single shortened link. - tags: - - URL Shortener - responses: - '200': - description: Returns a single link. - content: - application/json: - schema: - $ref: '#/components/schemas/link_response' - default: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - x-codeSamples: - - lang: Shell - source: | - curl -X GET "https://api.lob.com/v1/links/" \ - -u : - label: CURL - patch: - operationId: link_update - summary: Update a Link - description: Update any of the properties of a shortened link. - tags: - - URL Shortener - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/link_single' - examples: - basic: - value: - resource_id: ltr_133 - test: - value: - redirect_link: ltr_133 - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/link_single' - examples: - basic: - value: - resource_id: ltr_133 - test: - value: - resource_id: ltr_133 - multipart/form-data: - schema: - $ref: '#/components/schemas/link_single' - examples: - basic: - value: - resource_id: ltr_133 - test: - value: - resource_id: ltr_133 - responses: - '200': - description: Returns the updated link. - content: - application/json: - schema: - $ref: '#/components/schemas/link_response' - default: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - example: - error: - code: invalid - message: redirect_link is required - status_code: 422 - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/links/ \ - -u : \ - -d "redirect_link=https://www.lob.com" - label: CURL - delete: - operationId: links_delete - summary: Delete Link - description: Delete the shortened link. - tags: - - URL Shortener - responses: - '200': - description: Returns the deleted short link object - content: - application/json: - schema: - $ref: '#/components/schemas/link_response' - default: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /links/shorten: - post: - operationId: link_create - summary: Create Link - description: Given a long URL, shorten your URL either by using a custom domain or Lob's own short domain. - tags: - - URL Shortener - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/link_single' - examples: - basic: - value: - redirect_link: https://www.lob.com - slug: a1b2c3 - test: - value: - redirect_link: https://www.lob.com - slug: a1b2c3 - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/link_single' - examples: - basic: - value: - redirect_link: https://www.lob.com - domain: lob.st - test: - value: - redirect_link: https://www.lob.com - domain: lob.st - multipart/form-data: - schema: - $ref: '#/components/schemas/link_single' - examples: - basic: - value: - redirect_link: https://www.lob.com - test: - value: - redirect_link: https://www.lob.com - responses: - '200': - description: Returns a successfully created link. - content: - application/json: - schema: - $ref: '#/components/schemas/link_response' - default: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - example: - error: - code: invalid - message: redirect_link is required - status_code: 422 - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/links/shorten \ - -u : \ - -d "redirect_link=https://www.lob.com" - label: CURL - /links/shorten/bulk: - post: - operationId: link_bulk_create - summary: Bulk Create Links - description: Shortens a list of links in a single request. - tags: - - URL Shortener - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/link_list' - example: - links: - - redirect_link: https://www.lob.com - slug: a1b2c3 - - redirect_link: https://www.lob.com - slug: a1b2c3 - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/link_list' - example: - links: - - redirect_link: https://www.lob.com - slug: a1b2c3 - - redirect_link: https://www.lob.com - slug: a1b2c3 - multipart/form-data: - schema: - $ref: '#/components/schemas/link_list' - example: - links: - - redirect_link: https://www.lob.com - slug: a1b2c3 - - redirect_link: https://www.lob.com - slug: a1b2c3 - responses: - '200': - description: Returns all successfully created links - content: - application/json: - schema: - $ref: '#/components/schemas/links_response' - default: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - example: - error: - code: invalid - message: redirect_link is required - status_code: 422 - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/links/shorten/bulk \ - -u : \ - --header 'Content-Type: application/x-www-form-urlencoded' \ - --data-urlencode 'links[0][redirect_link]=https://www.lob.com' - label: CURL - /self_mailers/{sfm_id}: - parameters: - - in: path - name: sfm_id - description: id of the self_mailer - required: true - schema: - $ref: '#/components/schemas/sfm_id' - get: - operationId: self_mailer_retrieve - summary: Retrieve - description: Retrieves the details of an existing self_mailer. You need only supply the unique self_mailer identifier that was returned upon self_mailer creation. - tags: - - Self Mailers - responses: - '200': - description: Returns a self_mailer object - content: - application/json: - schema: - $ref: '#/components/schemas/self_mailer' - example: - id: sfm_8ffbe811dea49dcf - description: April Campaign - metadata: {} - to: - id: adr_bae820679f3f536b - description: null - name: HARRY ZHANG - company: null - phone: null - email: null - address_line1: 210 KING ST STE 6100 - address_line2: null - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2017-09-05T17:47:53.767Z' - date_modified: '2017-09-05T17:47:53.767Z' - deleted: true - object: address - from: - id: adr_210a8d4b0b76d77b - description: null - name: LEORE AVIDAR - company: null - phone: null - email: null - address_line1: 210 KING ST STE 6100 - address_line2: null - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2017-09-05T17:47:53.767Z' - date_modified: '2017-09-05T17:47:53.767Z' - deleted: true - object: address - url: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf.pdf?version=v1&expires=1618512040&signature=qvyCqXI1ndBvc4AjvG8FlirqLXEcfmYo4sDrRtabaXMOsX88to9G3K49uIk_aqevvZXe8HoRYD_nWydbQHqaCA - outside_template_id: tmpl_a3cb937f26d7eec - inside_template_id: tmpl_a3cb937f26d7eec - inside_template_version_id: vrsn_bfdf70893b00a85 - outside_template_version_id: vrsn_bfdf70893b00a85 - carrier: USPS - tracking_events: [] - thumbnails: - - small: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_small_1.png?version=v1&expires=1618512040&signature=-bipeUHP-hAMcCBSrWM0ZH1VwRdSPNVGGZN9hAZKr6Lh4ly6uxvratVd5LXJCK_zOEMYk_mTWASt0ge7OY6SDA - medium: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_medium_1.png?version=v1&expires=1618512040&signature=ryxN7bsXGtw_GRFSP3Cs3A3IYjxZi3cW9BHDCNgMt6p3nobVmsc_iFHt2e-S7ndAXhhN7nP-MQVov3bt3r37BQ - large: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_large_1.png?version=v1&expires=1618512040&signature=kBrm00xkyCkJNJRHxH8HshFaebtOxnzjVWOs1VVmGMuw8H6OBNcMAMxt9s49K0jlpHoh3Nr9uSncEZMQaaNjAg - - small: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_small_2.png?version=v1&expires=1618512040&signature=3gTgU7Fd3KoT_vNlQnTGptRps5ZgnkhSnPrAwk7L98higIzSwfKoLvuu_DIpMM48dHbxckKT9waR8euJ4KSDBQ - medium: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_medium_2.png?version=v1&expires=1618512040&signature=Ue1lw5CMj7KRx6cMQL8xPeazaHCdJzWcACd1w3acuYPnWkVIpSt62OIO7hAtpAQK9xm1dhhlFj0rqRZMdRMMBA - large: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_large_2.png?version=v1&expires=1618512040&signature=cICc7HEm1xG_eyM4a_wtvPk2FqoLRmtgGa29kJisWnMIYBL0OkyzG4ZCYGMhp-5cZpJlSpXfTgGKh_Qmeo1TDw - merge_variables: - name: null - size: 6x18_bifold - mail_type: usps_first_class - expected_delivery_date: '2021-03-24' - date_created: '2021-03-16T18:40:40.504Z' - date_modified: '2021-03-16T18:40:40.504Z' - send_date: '2021-03-16T18:45:40.493Z' - use_type: marketing - fsc: false - object: self_mailer - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl -X GET "https://api.lob.com/v1/self_mailers/sfm_8ffbe811dea49dcf" \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: typescript - source: | - try { - const selfMailer = await new SelfMailersApi(config).get('sfm_xxxx'); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.selfMailers.retrieve('sfm_8ffbe811dea49dcf', function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - selfMailerApi = SelfMailersApi.new(config) - - begin - retrievedSelfMailer = selfMailerApi.get("sfm_8ffbe811dea49dcf") - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = SelfMailersApi(api_client) - - try: - self_mailer = api.get("sfm_8ffbe811dea49dcf") - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\SelfMailersApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->get("sfm_8ffbe811dea49dcf"); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - SelfMailersApi apiInstance = new SelfMailersApi(config); - - try { - SelfMailer response = apiInstance.get("sfm_8ffbe811dea49dcf"); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.SelfMailer.find("sfm_8ffbe811dea49dcf") - label: ELIXIR - - lang: CSharp - source: | - SelfMailersApi api = new SelfMailersApi(config); - - try { - SelfMailer response = api.get("sfm_8ffbe811dea49dcf"); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - fetchedSelfMailer, _, err := apiClient.SelfMailersApi.Get(context,"sfm_8ffbe811dea49dcf").Execute() - - if err != nil { - return err - } - label: GO - delete: - operationId: self_mailer_delete - summary: Delete - description: Completely removes a self mailer from production. This can only be done if the self mailer's `send_date` has not yet passed. If the self mailer is successfully canceled, you will not be charged for it. This feature is exclusive to certain customers. Upgrade to the appropriate Print & Mail Edition to gain access. - tags: - - Self Mailers - responses: - '200': - $ref: '#/components/responses/self_mailer_deleted' - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl -X DELETE https://api.lob.com/v1/self_mailers/sfm_8ffbe811dea49dcf \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: typescript - source: | - try { - const deleteSelfMailer = await new SelfMailersApi(config).delete('sfm_xxxx'); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.selfMailers.delete('sfm_8ffbe811dea49dcf', function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - selfMailerApi = SelfMailersApi.new(config) - - begin - deletedSelfMailer = selfMailerApi.delete("sfm_8ffbe811dea49dcf") - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = SelfMailersApi(api_client) - - try: - deleted_resource = api.delete("sfm_8ffbe811dea49dcf") - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\SelfMailersApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->delete("sfm_8ffbe811dea49dcf"); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - SelfMailersApi apiInstance = new SelfMailersApi(config); - - try { - SelfMailerDeletion response = apiInstance.delete("sfm_8ffbe811dea49dcf"); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.SelfMailer.destroy("sfm_8ffbe811dea49dcf") - label: ELIXIR - - lang: CSharp - source: | - SelfMailersApi api = new SelfMailersApi(config); - - try { - SelfMailerDeletion response = api.delete("sfm_8ffbe811dea49dcf"); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - deletedSelfMailer, _, err := apiClient.SelfMailersApi.Delete(context, "sfm_8ffbe811dea49dcf").Execute() - - if err != nil { - return err - } - label: GO - /self_mailers: - get: - operationId: self_mailers_list - summary: List - description: Returns a list of your self_mailers. The self_mailers are returned sorted by creation date, with the most recently created self_mailers appearing first. - tags: - - Self Mailers - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/before_after' - - $ref: '#/components/parameters/include' - - $ref: '#/components/parameters/date_created' - - $ref: '#/components/parameters/metadata' - - in: query - name: size - description: The self mailer sizes to be returned. - schema: - type: array - items: - $ref: '#/components/schemas/self_mailer_size' - - $ref: '#/components/parameters/scheduled' - - $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_self_mailers' - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl -X GET "https://api.lob.com/v1/self_mailers?limit=2" \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: typescript - source: | - try { - const selfMailers = await new selfMailersApi(config).list(2); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.selfMailers.list({limit: 2}, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - selfMailersApi = SelfMailersApi.new(config) - - begin - selfMailers = selfMailersApi.list({ limit: 2 }) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = SelfMailersApi(api_client) - - try: - self_mailers = api.list(limit=2) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\SelfMailersApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->list( - 2, // limit - ); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - SelfMailersApi apiInstance = new SelfMailersApi(config); - - try { - SelfMailerList response = apiInstance.list( - 2, // limit - null, // before - null, // after - null, // include - null, // dateCreated - null, // metadata - null, // size - null, // scheduled - null, // sendDate - null, // mailType - null // sortBy - ); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.SelfMailer.list(%{limit: 2}) - label: ELIXIR - - lang: CSharp - source: | - SelfMailersApi api = new SelfMailersApi(config); - - List includeList = new List(); - includeList.Add("total_count"); - Dictionary metadata = new Dictionary(); - metadata.Add("name", "Harry"); - Dictionary dateCreated = new Dictionary(); - DateTime dateCreatedDate = DateTime.Today.AddMonths(-1); - dateCreated.Add("lt", dateCreatedDate); - Dictionary sendDate = new Dictionary(); - sendDate.Add("lt", DateTime.Now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz")); - SortBy3 sortBy = new SortBy3(SortBy3.DateCreatedEnum.Asc); - - try { - SelfMailerList response = api.list( - 2, // limit - null, // before - null, // after - includeList, // include - dateCreated, // dateCreated - metadata, // metadata - null, // size - true, // scheduled - sendDate, // sendDate - MailType.FirstClass, // mailType - sortBy // sortBy - ); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - SelfMailerList = apiClient.SelfMailersApi.List(context).Execute() - if err != nil { - return err - } - label: GO - post: - operationId: self_mailer_create - summary: Create - description: Creates a new self_mailer given information - tags: - - Self Mailers - parameters: - - $ref: '#/components/parameters/idem-header' - - $ref: '#/components/parameters/idem-query' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/self_mailer_editable' - example: - description: Demo Self Mailer job - to: adr_bae820679f3f536b - from: adr_210a8d4b0b76d77b - inside: https://lob.com/selfmailerinside.pdf - outside: https://lob.com/selfmaileroutside.pdf - size: 12x9_bifold - metadata: - spiffy: 'true' - mail_type: usps_standard - merge_variables: - name: Harry - send_date: '2017-11-01T00:00:00.000Z' - use_type: marketing - qr_code: - position: relative - redirect_url: https://www.lob.com - width: '2.5' - top: '2.5' - right: '2.5' - pages: inside,outside - fsc: true - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/self_mailer_editable' - example: - description: Demo Self Mailer job - to: adr_bae820679f3f536b - from: adr_210a8d4b0b76d77b - inside: https://lob.com/selfmailerinside.pdf - outside: https://lob.com/selfmaileroutside.pdf - size: 12x9_bifold - metadata: - spiffy: 'true' - mail_type: usps_standard - merge_variables: - name: Harry - send_date: '2017-11-01T00:00:00.000Z' - use_type: marketing - qr_code: - position: relative - redirect_url: https://www.lob.com - width: '2.5' - top: '2.5' - right: '2.5' - pages: inside,outside - fsc: true - encoding: - merge_variables: - style: deepObject - explode: true - metadata: - style: deepObject - explode: true - multipart/form-data: - schema: - $ref: '#/components/schemas/self_mailer_editable' - example: - description: Demo Self Mailer job - to: adr_bae820679f3f536b - from: adr_210a8d4b0b76d77b - inside: https://lob.com/selfmailerinside.pdf - outside: https://lob.com/selfmaileroutside.pdf - size: 12x9_bifold - metadata: - spiffy: 'true' - mail_type: usps_standard - merge_variables: - name: Harry - send_date: '2017-11-01T00:00:00.000Z' - use_type: marketing - qr_code: - position: relative - redirect_url: https://www.lob.com - width: '2.5' - top: '2.5' - right: '2.5' - pages: inside,outside - fsc: true - responses: - '200': - $ref: '#/components/responses/post_self_mailer' - default: - $ref: '#/components/responses/mailpiece_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/self_mailers \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ - -d "description=Demo Self Mailer job" \ - -d "to[name]=Harry Zhang" \ - -d "to[address_line1]=210 King St" \ - -d "to[address_city]=San Francisco" \ - -d "to[address_state]=CA" \ - -d "to[address_zip]=94107" \ - -d "from=adr_210a8d4b0b76d77b" \ - -d "use_type=marketing" \ - -d 'qr_code[position]=relative' \ - -d 'qr_code[redirect_url]=https://www.lob.com' \ - -d 'qr_code[width]=2.5' \ - -d 'qr_code[bottom]=2.5' \ - -d 'qr_code[left]=2.5' \ - -d 'qr_code[pages]=inside,outside' - --data-urlencode "inside=Inside HTML for {{name}}" \ - --data-urlencode "outside=Outside HTML for {{name}}" \ - -d "merge_variables[name]=Harry" \ - -d 'fsc=true' - label: CURL - - lang: Typescript - source: | - const selfMailerCreate = new SelfMailerEditable({ - to: { - name: 'Harry Zhang', - address_line1: '210 King St', - address_line2: '# 6100', - address_city: 'San Francisco', - address_state: 'CA', - address_zip: '94107', - }, - from: 'adr_xxxx', - inside: - 'https://s3.us-west-2.amazonaws.com/public.lob.com/assets/templates/self_mailers/6x18_sfm_inside.pdf', - outside: - 'https://s3.us-west-2.amazonaws.com/public.lob.com/assets/templates/self_mailers/6x18_sfm_outside.pdf', - use_type: 'marketing' - qr_code : { - position: 'relative', - redirect_url: 'https://www.lob.com', - width: '2.5', - bottom: '2.5', - left: '2.5', - pages: 'inside' - }, - fsc: true - }); - - try { - const mySelfMailer = await new SelfMailersApi(config).create(selfMailerCreate); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.selfMailers.create({ - description: 'Demo Self Mailer job', - to: { - name: 'Harry Zhang', - address_line1: '210 King St', - address_city: 'San Francisco', - address_state: 'CA', - address_zip: '94107' - }, - from: 'adr_210a8d4b0b76d77b', - inside: 'Inside HTML for {{name}}', - outside: 'Outside HTML for {{name}}', - merge_variables: { - name: 'Harry' - }, - use_type: 'marketing' - qr_code : { - position: 'relative', - redirect_url: 'https://www.lob.com', - width: '2.5', - bottom: '2.5', - left: '2.5', - pages: 'inside' - }, - fsc: true - }, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - selfMailerCreate = SelfMailerEditable.new({ - description: "Demo Self Mailer job", - from: "adr_210a8d4b0b76d77b", - inside: "Inside HTML for {{name}}", - outside: "Outside HTML for {{name}}", - to: AddressEditable.new({ - name: "Harry Zhang", - address_line1: "210 King St", - address_line2: "# 6100", - address_city: "San Francisco", - address_state: "CA", - address_zip: "94107", - }), - merge_variables: { - name: "Harry" - }, - use_type: 'marketing' - qr_code : { - position: 'relative', - redirect_url: 'https://www.lob.com', - width: '2.5', - bottom: '2.5', - left: '2.5', - pages: 'inside' - }, - fsc: true - }); - - selfMailerApi = SelfMailersApi.new(config) - - begin - createdSelfMailer = selfMailerApi.create(selfMailerCreate) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - self_mailer_editable = SelfMailerEditable( - description = "Demo Self Mailer job", - _from = "adr_210a8d4b0b76d77b", - inside = "Inside HTML for {{name}}", - outside = "Outside HTML for {{name}}", - to = AddressEditable( - name = "Harry Zhang", - address_line1 = "210 King St", - address_line2 = "# 6100", - address_city = "San Francisco", - address_state = "CA", - address_zip = "94107", - ), - merge_variables = MergeVariables( - name = "Harry", - ), - use_type = "marketing" - qr_code = { - position: "relative", - redirect_url: "https://www.lob.com", - width: "2.5", - bottom: "2.5", - left: "2.5", - pages: "inside" - }, - fsc = true - ) - - with ApiClient(configuration) as api_client: - api = SelfMailersApi(api_client) - - try: - created_self_mailer = api.create(self_mailer_editable) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $to = new OpenAPI\Client\Model\AddressEditable( - array( - "name" => "Harry Zhang", - "address_line1" => "210 King St", - "address_line2" => "# 6100", - "address_city" => "San Francisco", - "address_state" => "CA", - "address_zip" => "94107", - ) - ); - - $merge_variables = new stdClass; - $merge_variables->name = "Harry"; - - $use_type = "marketing"; - $fsc = true; - - $qr_code = new OpenAPI\Client\Model\QRCode( - array( - "position" => "relative", - "redirect_url" => "https://www.lob.com", - "width" => "2", - "bottom" => "2", - "left" => "2", - "pages" => "inside,outside" - ) - ); - - $apiInstance = new OpenAPI\Client\Api\SelfMailersApi($config, new GuzzleHttp\Client()); - $self_mailer_editable = new OpenAPI\Client\Model\SelfMailerEditable( - array( - "description" => "Demo Self Mailer job", - "from" => "adr_210a8d4b0b76d77b", - "inside" => "Inside HTML for {{name}}", - "outside" => "Outside HTML for {{name}}", - "to" => $to, - "merge_variables" => $merge_variables, - "use_type" => $use_type, - "qr_code" => $qr_code, - "fsc" => $fsc - ) - ); - - try { - $result = $apiInstance->create($self_mailer_editable); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - Map merge_variables = new HashMap(); - merge_variables.put("name", "Harry"); - - SelfMailersApi apiInstance = new SelfMailersApi(config); - - AddressEditable to = new AddressEditable(); - to.setName("Harry Zhang"); - to.setAddressLine1("210 King St"); - to.setAddressLine2("# 6100"); - to.setAddressCity("San Francisco"); - to.setAddressState("CA"); - to.setAddressZip("94107"); - - QRCode qrCode = new QRCode(); - qrCode.setPosition("relative"); - qrCode.setRedirectUrl("https://www.lob.com"); - qrCode.setWidth("2"); - qrCode.setLeft("2"); - qrCode.setBottom("2"); - qrCode.setPages("outside"); - - try { - SelfMailerEditable selfMailerEditable = new SelfMailerEditable(); - selfMailerEditable.setDescription("Demo Self Mailer job"); - selfMailerEditable.setFrom("adr_210a8d4b0b76d77b"); - selfMailerEditable.setInside("Inside HTML for {{name}}"); - selfMailerEditable.setOutside("Outside HTML for {{name}}"); - selfMailerEditable.setTo(to); - selfMailerEditable.setMergeVariables(merge_variables); - selfMailerEditable.setUseType("marketing"); - selfMailerEditable.setQRCode(qrCode); - selfMailerEditable.setFsc(true); - - - SelfMailer result = apiInstance.create(selfMailerEditable, null); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.SelfMailer.create(%{ - description: "Demo Self Mailer job", - to: %{ - name: "Harry Zhang", - address_line1: "210 King St", - address_city: "San Francisco", - address_state: "CA", - address_zip: "94107" - }, - from: "adr_210a8d4b0b76d77b", - inside: "Inside HTML for {{name}}", - outside: "Outside HTML for {{name}}", - merge_variables: %{ - name: "Harry" - }, - use_type: "marketing" - qr_code: %{ - position: 'relative', - redirect_url: 'https://www.lob.com', - width: '2', - bottom: '2', - left: '2', - pages: 'inside,outside' - }, - fsc: true - }) - label: ELIXIR - - lang: CSharp - source: | - Dictionary mergeVariables = new Dictionary(); - mergeVariables.Add("name", "Harry"); - - SelfMailersApi api = new SelfMailersApi(config); - - AddressEditable to = new AddressEditable( - "210 King St", // addressLine1 - "# 6100", // addressLine2 - "San Francisco", // addressCity - "CA", // addressState - "94107", // addressZip - default(CountryExtended), // addressCounty - null, // description - "Harry Zhang" // name - ); - - QRCode qrCode = new QRCode( - "relative", //position, - "https://www.lob.com", //redirect_url - "2", //width - "2", //left - "2", //bottom - "inside", //pages - ); - - Fsc fsc = new Fsc(true); - - SelfMailerEditable selfMailerEditable = new SelfMailerEditable( - to.ToJson(), // to - "adr_249af768103d2810", // from - default(SelfMailerSize), // size - "Demo Self Mailer Job", // description - default(Dictionary), // metadata - default(MailType), // mailType - mergeVariables, // mergeVariables - default(DateTime), // sendDate - "Inside HTML for {{name}}", // inside - "Outside HTML for {{name}}", // outside - "marketing", // use_type - qrCode, - fsc - ); - - try { - SelfMailer result = api.create(selfMailerEditable, null); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - var to = *lob.NewAddressEditable() - to.SetAddressLine1("210 King St") - to.SetAddressLine2("# 6100") - to.SetAddressCity("San Francisco") - to.SetAddressState("CA") - to.SetAddressZip("94107") - to.SetAddressCountry(lob.COUNTRYEXTENDED_US) - to.SetDescription("") - to.SetName("Harry Zhang") - - var selfMailerCreate = *lob.NewSelfMailerEditable() - selfMailerCreate.SetDescription("Demo Self Mailer job") - selfMailerCreate.SetFrom("adr_210a8d4b0b76d77b") - selfMailerCreate.SetInside("Inside HTML for {{name}}") - selfMailerCreate.SetOutside("Outside HTML for {{name}}") - selfMailerCreate.SetTo(to) - selfMailerCreate.SetFsc(true) - - - createdselfMailer, _, err := apiClient.SelfMailersApi.Create(context).SelfMailerEditable(selfMailerCreate).Execute() - - if err != nil { - return err - } - label: GO - /snap_packs: - 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 - 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 - 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 \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ - -d "description=Demo Snap Pack job" \ - -d "to[name]=Harry Zhang" \ - -d "to[address_line1]=210 King St" \ - -d "to[address_city]=San Francisco" \ - -d "to[address_state]=CA" \ - -d "to[address_zip]=94107" \ - -d "from=adr_210a8d4b0b76d77b" \ - -d "use_type=marketing" \ - --data-urlencode "inside=Inside HTML for {{name}}" \ - --data-urlencode "outside=Outside HTML for {{name}}" \ - -d "merge_variables[name]=Harry" \ - -d 'fsc=false' - label: CURL - - lang: Typescript - source: | - const snapPackCreate = new SnapPackEditable({ - to: { - name: 'Harry Zhang', - address_line1: '210 King St', - address_line2: '# 6100', - address_city: 'San Francisco', - address_state: 'CA', - address_zip: '94107', - }, - from: 'adr_xxxx', - inside: - 'https://s3.us-west-2.amazonaws.com/public.lob.com/assets/8.5x11_Snappack_template_address.pdf', - outside: - 'https://s3.us-west-2.amazonaws.com/public.lob.com/assets/8.5x11_Snappack_template_address.pdf', - use_type: 'marketing' - fsc: false - }); - - try { - const mySnapPack = await new SnapPacksApi(config).create(snapPackCreate); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.snapPacks.create({ - description: 'Demo Snap Packs job', - to: { - name: 'Harry Zhang', - address_line1: '210 King St', - address_city: 'San Francisco', - address_state: 'CA', - address_zip: '94107' - }, - from: 'adr_210a8d4b0b76d77b', - inside: 'Inside HTML for {{name}}', - outside: 'Outside HTML for {{name}}', - merge_variables: { - name: 'Harry' - }, - use_type: 'marketing' - fsc: false - }, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - snapPackCreate = SnapPackEditable.new({ - description: "Demo Snap Pack job", - from: "adr_210a8d4b0b76d77b", - inside: "Inside HTML for {{name}}", - outside: "Outside HTML for {{name}}", - to: AddressEditable.new({ - name: "Harry Zhang", - address_line1: "210 King St", - address_line2: "# 6100", - address_city: "San Francisco", - address_state: "CA", - address_zip: "94107", - }), - merge_variables: { - name: "Harry" - }, - use_type: 'marketing', - fsc: true - }); - - snapPackApi = SnapPacksApi.new(config) - - begin - createdSnapPack = snapPackApi.create(snapPackCreate) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - snap_pack_editable = SnapPackEditable( - description = "Demo Snap Pack job", - _from = "adr_210a8d4b0b76d77b", - inside = "Inside HTML for {{name}}", - outside = "Outside HTML for {{name}}", - to = AddressEditable( - name = "Harry Zhang", - address_line1 = "210 King St", - address_line2 = "# 6100", - address_city = "San Francisco", - address_state = "CA", - address_zip = "94107", - ), - merge_variables = MergeVariables( - name = "Harry", - ), - use_type = "marketing", - fsc = true - ) - - with ApiClient(configuration) as api_client: - api = SnapPacksApi(api_client) - - try: - created_snap_pack = api.create(snap_pack_editable) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $to = new OpenAPI\Client\Model\AddressEditable( - array( - "name" => "Harry Zhang", - "address_line1" => "210 King St", - "address_line2" => "# 6100", - "address_city" => "San Francisco", - "address_state" => "CA", - "address_zip" => "94107", - ) - ); - - $merge_variables = new stdClass; - $merge_variables->name = "Harry"; - - $use_type = "marketing"; - $fsc = true; - - $apiInstance = new OpenAPI\Client\Api\SnapPacksApi($config, new GuzzleHttp\Client()); - $snap_pack_editable = new OpenAPI\Client\Model\SnapPackEditable( - array( - "description" => "Demo Snap Pack job", - "from" => "adr_210a8d4b0b76d77b", - "inside" => "Inside HTML for {{name}}", - "outside" => "Outside HTML for {{name}}", - "to" => $to, - "merge_variables" => $merge_variables, - "use_type" => $use_type, - "fsc" => $fsc - ) - ); - - try { - $result = $apiInstance->create($snap_pack_editable); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - Map merge_variables = new HashMap(); - merge_variables.put("name", "Harry"); - - SnapPacksApi apiInstance = new SnapPacksApi(config); - - AddressEditable to = new AddressEditable(); - to.setName("Harry Zhang"); - to.setAddressLine1("210 King St"); - to.setAddressLine2("# 6100"); - to.setAddressCity("San Francisco"); - to.setAddressState("CA"); - to.setAddressZip("94107"); - - try { - SnapPackEditable SnapPackEditable = new SnapPackEditable(); - SnapPackEditable.setDescription("Demo Snap Pack job"); - SnapPackEditable.setFrom("adr_210a8d4b0b76d77b"); - SnapPackEditable.setInside("Inside HTML for {{name}}"); - SnapPackEditable.setOutside("Outside HTML for {{name}}"); - SnapPackEditable.setTo(to); - SnapPackEditable.setMergeVariables(merge_variables); - SnapPackEditable.setUseType("marketing"); - SnapPackEditable.setFsc(true); - - - SnapPack result = apiInstance.create(SnapPackEditable, null); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.SnapPack.create(%{ - description: "Demo Snap Pack job", - to: %{ - name: "Harry Zhang", - address_line1: "210 King St", - address_city: "San Francisco", - address_state: "CA", - address_zip: "94107" - }, - from: "adr_210a8d4b0b76d77b", - inside: "Inside HTML for {{name}}", - outside: "Outside HTML for {{name}}", - merge_variables: %{ - name: "Harry" - }, - use_type: "marketing", - fsc: true - }) - label: ELIXIR - - lang: CSharp - source: | - Dictionary mergeVariables = new Dictionary(); - mergeVariables.Add("name", "Harry"); - - SnapPacksApi api = new SnapPacksApi(config); - - AddressEditable to = new AddressEditable( - "210 King St", // addressLine1 - "# 6100", // addressLine2 - "San Francisco", // addressCity - "CA", // addressState - "94107", // addressZip - default(CountryExtended), // addressCounty - null, // description - "Harry Zhang" // name - ); - - Fsc fsc = new Fsc(true); - - SnapPackEditable SnapPackEditable = new SnapPackEditable( - to.ToJson(), // to - "adr_249af768103d2810", // from - default(SnapPacksize), // size - "Demo Snap Pack Job", // description - default(Dictionary), // metadata - default(MailType), // mailType - mergeVariables, // mergeVariables - default(DateTime), // sendDate - "Inside HTML for {{name}}", // inside - "Outside HTML for {{name}}", // outside - "marketing", // use_type - fsc - ); - - try { - SnapPack result = api.create(SnapPackEditable, null); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - var to = *lob.NewAddressEditable() - to.SetAddressLine1("210 King St") - to.SetAddressLine2("# 6100") - to.SetAddressCity("San Francisco") - to.SetAddressState("CA") - to.SetAddressZip("94107") - to.SetAddressCountry(lob.COUNTRYEXTENDED_US) - to.SetDescription("") - to.SetName("Harry Zhang") - - var SnapPackCreate = *lob.NewSnapPackEditable() - SnapPackCreate.SetDescription("Demo Snap Pack job") - SnapPackCreate.SetFrom("adr_210a8d4b0b76d77b") - SnapPackCreate.SetInside("Inside HTML for {{name}}") - SnapPackCreate.SetOutside("Outside HTML for {{name}}") - SnapPackCreate.SetTo(to) - SnapPackCreate.SetFsc(true) - - - createdSnapPack, _, err := apiClient.SnapPacksApi.Create(context).SnapPackEditable(SnapPackCreate).Execute() - - if err != nil { - return err - } - label: GO - /templates/{tmpl_id}/versions/{vrsn_id}: - parameters: - - in: path - name: tmpl_id - description: The ID of the template to which the version belongs. - required: true - schema: - $ref: '#/components/schemas/tmpl_id' - - in: path - name: vrsn_id - description: id of the template_version - required: true - schema: - $ref: '#/components/schemas/vrsn_id' - get: - operationId: template_version_retrieve - summary: Retrieve - description: Retrieves the template version with the given template and version ids. - tags: - - Template Versions - responses: - '200': - description: Returns the template version with the given template and version ids. - content: - application/json: - schema: - $ref: '#/components/schemas/template_version' - example: - id: vrsn_534e339882d2282 - description: Second Version - html: Second HTML for {{name}} - date_created: '2017-11-09T04:49:38.016Z' - date_modified: '2017-11-09T04:49:38.016Z' - object: version - default: - $ref: '#/components/responses/template_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/templates/tmpl_c94e83ca2cd5121/versions/vrsn_534e339882d2282 \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: Typescript - source: | - try { - const templateVersion = await new TemplateVersionsApi(config).get('tmpl_xxxx', 'vrsn_xxxx'); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - This feature is not currently supported by this library. - label: NODE - - lang: Ruby - source: | - templateVersionApi = TemplateVersionsApi.new(config) - - begin - retrievedTemplateVersion = templateVersionApi.get("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282") - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = TemplateVersionsApi(api_client) - - try: - template_version = api.get("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282") - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\TemplateVersionsApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->get("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282"); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - TemplateVersionsApi apiInstance = new TemplateVersionsApi(config); - - try { - TemplateVersion response = apiInstance.get("vrsn_534e339882d2282"); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - This feature is not currently supported by this library. - label: ELIXIR - - lang: CSharp - source: | - TemplateVersionsApi api = new TemplateVersionsApi(config); - - try { - TemplateVersion response = api.get("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282"); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - fetchedTemplateVersion, _, err := apiClient.TemplateVersionsApi.Get(context,"tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282").Execute() - - if err != nil { - return err - } - label: GO - post: - operationId: template_version_update - summary: Update - description: Updates the template version with the given template and version ids. - tags: - - Template Versions - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/template_version_updatable' - example: - description: Some description - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/template_version_updatable' - example: - description: Some description - multipart/form-data: - schema: - $ref: '#/components/schemas/template_version_updatable' - example: - description: Some description - responses: - '200': - $ref: '#/components/responses/post_template_version' - default: - $ref: '#/components/responses/template_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/templates/tmpl_c94e83ca2cd5121/versions/vrsn_534e339882d2282 \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ - -d "description=Updated description" - label: CURL - - lang: Typescript - source: | - const TemplateVersions = new TemplateVersionsApi(config); - - try { - const updateData = new TemplateVersionUpdatable({ - description: 'updated template' - }); - const updateTemplateVersion = await TemplateVersions.update('vrsn_xxxx', updateData); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - This feature is not currently supported by this library. - label: NODE - - lang: Ruby - source: | - templateVersionUpdatable = TemplateUpdate.new({ - description: "updated template version", - }) - - templateVersionApi = TemplateVersionsApi.new(config) - - begin - updatedTemplateVersion = templateVersionApi.update("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282", templateVersionUpdatable) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = TemplateVersionsApi(api_client) - - update_data = TemplateVersionUpdatable( - description = "updated template" - ) - - try: - update_template_version = api.update("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282", update_data) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\TemplateVersionsApi($config, new GuzzleHttp\Client()); - - $templateVersionUpdate = new OpenAPI\Client\Model\TemplateUpdate(array( - "description" => "Updated template version" - )); - - try { - $result = $apiInstance->update("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282", $templateVersionUpdate); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - This feature is not currently supported by this library. - label: JAVA - - lang: Elixir - source: | - This feature is not currently supported by this library. - label: ELIXIR - - lang: CSharp - source: | - TemplateVersionsApi api = new TemplateVersionsApi(config); - TemplateVersionUpdatable update = new TemplateVersionUpdatable("update template", EngineHtml.Handlebars); - - try { - api.update("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282", update); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - var templateWritable = *lob.NewTemplateWritable("Updated HTML for Template 1/html>") - var templateVersionWritable = *lob.NewTemplateVersionWritable("Updated HTML for Template 1/html>") - createdTemplate, _, _ := apiClient.TemplatesApi.Create(context).TemplateWritable(templateWritable).Execute() - - createdTemplateVersion, _, err := apiClient.TemplateVersionsApi.Create(context, createdTemplate.Id).TemplateVersionWritable(templateVersionWritable).Execute() - createdTemplateVersion.SetDescription("New Template Version") - resp, _, err := apiClient.TemplatesApi.Update(context, createdTemplate.Id, createdTemplateVersion.Id).TemplateVersionWritable(templateVersionWritable).Execute() - - if err != nil { - return err - } - label: GO - delete: - operationId: template_version_delete - summary: Delete - description: Permanently deletes a template version. A template's `published_version` can not be deleted. - tags: - - Template Versions - responses: - '200': - $ref: '#/components/responses/template_version_deleted' - default: - $ref: '#/components/responses/template_error' - x-codeSamples: - - lang: Shell - source: | - curl -X DELETE https://api.lob.com/v1/templates/tmpl_4aa14648113e45b/versions/vrsn_534e339882d2282 \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: Typescript - source: | - try { - const deleteTemplateVersion = await new TemplateVersionsApi(config).delete("tmpl_xxxx","vrsn_xxxx"); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - This feature is not currently supported by this library. - label: NODE - - lang: Ruby - source: | - templateVersionApi = TemplateVersionsApi.new(config) - - begin - deletedTemplateVersion = templateVersionApi.delete("tmpl_4aa14648113e45b", "vrsn_534e339882d2282") - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = TemplateVersionsApi(api_client) - - try: - deleted_resource = api.delete("tmpl_4aa14648113e45b", "vrsn_534e339882d2282") - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - This feature is not currently supported by this library. - - lang: Java - source: | - This feature is not currently supported by this library. - label: JAVA - - lang: Elixir - source: | - This feature is not currently supported by this library. - label: ELIXIR - - lang: CSharp - source: | - TemplateVersionsApi api = new TemplateVersionsApi(config); - - try { - TemplateVersionDeletion response = api.delete("tmpl_xxx", "vrsn_xxx"); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - deletedTemplateVersion, _, err := apiClient.TemplateVersionsApi.Delete(context, "tmpl_4aa14648113e45b", "vrsn_534e339882d2282").Execute() - - if err != nil { - return err - } - label: GO - /templates/{tmpl_id}/versions: - get: - operationId: template_versions_list - summary: List - description: | - Returns a list of template versions for the given template ID. The template versions are sorted by creation date, with the most recently created appearing first. - tags: - - Template Versions - parameters: - - in: path - name: tmpl_id - description: The ID of the template associated with the retrieved versions - required: true - schema: - $ref: '#/components/schemas/tmpl_id' - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/before_after' - - $ref: '#/components/parameters/include' - - $ref: '#/components/parameters/date_created' - responses: - '200': - $ref: '#/components/responses/all_template_versions' - default: - $ref: '#/components/responses/template_error' - x-codeSamples: - - lang: Shell - source: | - curl -X GET "https://api.lob.com/v1/templates/tmpl_ea6e6a1abf01703/versions?limit=2" \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: Typescript - source: | - try { - const templateVersions = await new TemplateVersionsApi(config).list(tmpl_xxxx); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - This feature is not currently supported by this library. - label: NODE - - lang: Ruby - source: | - templateVersionsApi = TemplateVersionsApi.new(config) - - begin - templateVersions = templateVersionsApi.list("tmpl_dadaaf7b76c9f25", { limit: 2 }) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = TemplateVersionsApi(api_client) - - try: - template_versions = api.list("tmpl_dadaaf7b76c9f25", limit=2) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\TemplateVersionsApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->list( - tmpl_dadaaf7b76c9f25, // tmplId - 2, // limit - ); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - TemplateVersionsApi apiInstance = new TemplateVersionsApi(config); - - try { - List response = apiInstance.list( - "tmpl_dadaaf7b76c9f25", // tmplId - 2, // limit - null, // before - null, // after - null, // include - null // dateCreated - ); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - This feature is not currently supported by this library. - label: ELIXIR - - lang: CSharp - source: | - TemplateVersionsApi api = new TemplateVersionsApi(config); - - List includeList = new List(); - includeList.Add("total_count"); - Dictionary dateCreated = new Dictionary(); - DateTime dateCreatedDate = DateTime.Today.AddMonths(-1); - dateCreated.Add("lt", dateCreatedDate); - - try { - TemplateVersionList response = api.list( - "tmpl_dadaaf7b76c9f25", // tmplId - 2, // limit - null, // before - null, // after - includeList, // include - dateCreated // dateCreated - ); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - TemplateVersionList = apiClient.TemplateVersionsApi.List(context, "tmpl_4aa14648113e45b").Execute() - if err != nil { - return err - } - label: GO - post: - operationId: create_template_version - summary: Create - description: Creates a new template version attached to the specified template. - tags: - - Template Versions - parameters: - - in: path - name: tmpl_id - description: The ID of the template the new version will be attached to - required: true - schema: - $ref: '#/components/schemas/tmpl_id' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/template_version_writable' - example: - description: Some Description - html: HTML for {{name}} - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/template_version_writable' - example: - description: Some Description - html: HTML for {{name}} - multipart/form-data: - schema: - $ref: '#/components/schemas/template_version_writable' - example: - description: Some Description - html: HTML for {{name}} - responses: - '200': - $ref: '#/components/responses/post_template_version' - default: - $ref: '#/components/responses/template_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/templates/tmpl_4aa14648113e45b/versions \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ - -d "description=Second Version" \ - --data-urlencode "html=Second HTML for {{name}}" - label: CURL - - lang: Typescript - source: | - const templateVersionCreate = new TemplateVersionWritable({ - description: 'Newer Template', - html: 'Updated HTML for {{name}}' - }); - - try { - const myTemplateVersion = await new TemplateVersionsApi(config).create('tmpl_xxxx', templateVersionCreate); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - This feature is not currently supported by this library. - label: NODE - - lang: Ruby - source: | - templateVersionCreate = TemplateVersionWritable.new({ - description: "Second Version", - html: "Second HTML for {{name}}", - }); - - templateVersionApi = TemplateVersionsApi.new(config) - - begin - createdTemplateVersion = templateVersionApi.create("tmpl_4aa14648113e45b", templateVersionCreate) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - template_version_writable = TemplateVersionWritable( - description = "Second Version", - html = "Second HTML for {{name}}", - ) - - with ApiClient(configuration) as api_client: - api = TemplateVersionsApi(api_client) - - try: - created_template_version = api.create("tmpl_4aa14648113e45b", template_version_writable) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\TemplateVersionsApi($config, new GuzzleHttp\Client()); - $template_version_writable = new OpenAPI\Client\Model\TemplateVersionWritable( - array( - "description" => "Second Version", - "html" => "Second HTML for {{name}}", - ) - ); - - try { - $result = $apiInstance->create("tmpl_4aa14648113e45b", $template_version_writable); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - TemplateVersionsApi apiInstance = new TemplateVersionsApi(config); - - try { - TemplateVersionWritable = new TemplateVersionWritable(); - .set("Second Version"); - .set("Second HTML for {{name}}"); - - TemplateVersion result = apiInstance.create(); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - This feature is not currently supported by this library. - label: ELIXIR - - lang: CSharp - source: | - TemplateVersionsApi api = new TemplateVersionsApi(config); - - TemplateVersionWritable templateVersionWritable = new TemplateVersionWritable( - "Second Version", // description - "Second HTML for {{name}}" // html - ); - - try { - TemplateVersion result = api.create("tmpl_4aa14648113e45b", templateVersionWritable); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - - var templateVersionCreate = *lob.NewTemplateVersionWritable() - templateVersionCreate.SetDescription("Second Version") - templateVersionCreate.SetHtml("Second HTML for {{name}}") - - - - createdtemplateVersion, _, err := apiClient.TemplateVersionsApi.Create(context, "tmpl_4aa14648113e45b").TemplateVersionWritable(templateVersionCreate).Execute() - - if err != nil { - return err - } - label: GO - /templates/{tmpl_id}: - parameters: - - in: path - name: tmpl_id - description: id of the template - required: true - schema: - $ref: '#/components/schemas/tmpl_id' - get: - operationId: template_retrieve - summary: Retrieve - description: Retrieves the details of an existing template. You need only supply the unique template identifier that was returned upon template creation. - tags: - - Templates - responses: - '200': - description: Returns a template object - content: - application/json: - schema: - $ref: '#/components/schemas/template' - example: - id: tmpl_c94e83ca2cd5121 - description: Test Template - versions: - - id: vrsn_362184d96d9b0c9 - suggest_json_editor: true - description: Test Template - engine: legacy - html: HTML for {{name}} - date_created: '2017-11-07T22:56:10.962Z' - date_modified: '2017-11-07T22:56:10.962Z' - object: version - published_version: - id: vrsn_362184d96d9b0c9 - suggest_json_editor: false - description: Test Template - engine: handlebars - html: HTML for {{name}} - date_created: '2017-11-07T22:56:10.962Z' - date_modified: '2017-11-07T22:56:10.962Z' - object: version - metadata: {} - date_created: '2017-11-07T22:56:10.962Z' - date_modified: '2017-11-07T22:56:10.962Z' - object: template - default: - $ref: '#/components/responses/template_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/templates/tmpl_c94e83ca2cd5121 \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: Typescript - source: | - try { - const Template = await new TemplatesApi(config).get('tmpl_xxxx'); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - This feature is not currently supported by this library. - label: NODE - - lang: Ruby - source: | - templateApi = TemplatesApi.new(config) - - begin - retrievedTemplate = templateApi.get("tmpl_c94e83ca2cd5121") - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = TemplatesApi(api_client) - - try: - template = api.get("tmpl_c94e83ca2cd5121") - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\TemplatesApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->get("tmpl_c94e83ca2cd5121"); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - TemplatesApi apiInstance = new TemplatesApi(config); - - try { - Template response = apiInstance.get("tmpl_c94e83ca2cd5121"); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - This feature is not currently supported by this library. - label: ELIXIR - - lang: CSharp - source: | - TemplatesApi api = new TemplatesApi(config); - - try { - Template response = api.get("tmpl_c94e83ca2cd5121"); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - fetchedTemplate, _, err := apiClient.TemplatesApi.Get(context,"tmpl_c94e83ca2cd5121").Execute() - - if err != nil { - return err - } - label: GO - post: - operationId: template_update - summary: Update - description: Updates the description and/or published version of the template with the given id. To update the template's html, create a new version of the template. - tags: - - Templates - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/template_update' - example: - description: Updated Example - published_version: vrsn_a - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/template_update' - example: - description: Updated Example - published_version: vrsn_a - multipart/form-data: - schema: - $ref: '#/components/schemas/template_update' - example: - description: Updated Example - published_version: vrsn_a - responses: - '200': - description: Returns the updated template object - headers: - ratelimit-limit: - $ref: '#/components/headers/ratelimit-limit' - ratelimit-remaining: - $ref: '#/components/headers/ratelimit-remaining' - ratelimit-reset: - $ref: '#/components/headers/ratelimit-reset' - content: - application/json: - schema: - $ref: '#/components/schemas/template' - example: - id: tmpl_c94e83ca2cd5121 - description: Test Template - versions: - - id: vrsn_362184d96d9b0c9 - suggest_json_editor: true - description: Test Template - engine: legacy - html: HTML for {{name}} - date_created: '2017-11-07T22:56:10.962Z' - date_modified: '2017-11-07T22:56:10.962Z' - object: version - published_version: - id: vrsn_362184d96d9b0c9 - suggest_json_editor: false - description: Test Template - engine: handlebars - html: HTML for {{name}} - date_created: '2017-11-07T22:56:10.962Z' - date_modified: '2017-11-07T22:56:10.962Z' - object: version - metadata: {} - date_created: '2017-11-07T22:56:10.962Z' - date_modified: '2017-11-07T22:56:10.962Z' - object: template - default: - $ref: '#/components/responses/template_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/templates/tmpl_c94e83ca2cd5121 \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ - -d "description=Updated description" \ - -d "published_version=vrsn_362184d96d9b0c9" - label: CURL - - lang: Typescript - source: | - const Templates = new TemplatesApi(config); - - try { - const updateData = new TemplateUpdate ({ - description: 'updated template', - published_version: 'vrsn_xxxx' - }); - const updateTemplate = await Templates.update('tmpl_xxxx', updateData); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - This feature is not currently supported by this library. - label: NODE - - lang: Ruby - source: | - templateUpdate = TemplateUpdate.new({ - description: "updated template", - published_version: "vrsn_362184d96d9b0c9", - }) - - templateApi = TemplatesApi.new(config) - - begin - updatedTemplate = templateApi.update("tmpl_c94e83ca2cd5121", templateUpdate) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = TemplatesApi(api_client) - - update_data = TemplateUpdate( - description = "updated template", - published_version = "vrsn_362184d96d9b0c9" - ) - - try: - update_template = api.update("tmpl_c94e83ca2cd5121", update_data) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\TemplatesApi($config, new GuzzleHttp\Client()); - - $templateUpdate = new OpenAPI\Client\Model\TemplateUpdate(array( - "description" => "Updated description", - "published_version" => "vrsn_362184d96d9b0c9" - )); - - try { - $result = $apiInstance->update("tmpl_c94e83ca2cd5121", $templateUpdate); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - TemplatesApi apiInstance = new TemplatesApi(config); - TemplateUpdate update = new TemplateUpdate(); - - update.setDescription("update template"); - update.setPublishedVersion("vrsn_362184d96d9b0c9"; - - try { - apiInstance.update("tmpl_c94e83ca2cd5121", update); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - This feature is not currently supported by this library. - label: ELIXIR - - lang: CSharp - source: | - TemplatesApi api = new TemplatesApi(config); - TemplateUpdate update = new TemplateUpdate("update template", "vrsn_362184d96d9b0c9"); - - try { - api.update("tmpl_c94e83ca2cd5121", update); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - var templateWritable = *lob.NewTemplateWritable("Updated HTML for Template 1/html>") - createdTemplate, _, _ := apiClient.TemplatesApi.Create(context).TemplateWritable(templateWritable).Execute() - - templateWritable.SetDescription("Template updated") - resp, _, err := apiClient.TemplatesApi.Update(context, createdTemplate.Id).TemplateWritable(templateWritable).Execute() - - if err != nil { - return err - } - label: GO - delete: - operationId: template_delete - summary: Delete - description: Permanently deletes a template. Deleting a template also deletes its associated versions. Deleted templates can not be used to create postcard, letter, or check resources. - tags: - - Templates - responses: - '200': - $ref: '#/components/responses/template_deleted' - default: - $ref: '#/components/responses/template_error' - x-codeSamples: - - lang: Shell - source: | - curl -X DELETE https://api.lob.com/v1/templates/tmpl_df934eeda694203 \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: Typescript - source: | - try { - const deleteTemplate = await new TemplatesApi(config).delete('tmpl_xxxx'); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - This feature is not currently supported by this library. - label: NODE - - lang: Ruby - source: | - templateApi = TemplatesApi.new(config) - - begin - deletedTemplate = templateApi.delete("tmpl_df934eeda694203") - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = TemplatesApi(api_client) - - try: - deleted_resource = api.delete("tmpl_df934eeda694203") - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\TemplatesApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->delete("tmpl_df934eeda694203"); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - TemplatesApi apiInstance = new TemplatesApi(config); - - try { - TemplateDeletion response = apiInstance.delete("tmpl_df934eeda694203"); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - This feature is not currently supported by this library. - label: ELIXIR - - lang: CSharp - source: | - TemplatesApi api = new TemplatesApi(config); - - try { - TemplateDeletion response = api.delete("tmpl_df934eeda694203"); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - deletedTemplate, _, err := apiClient.TemplatesApi.Delete(context, "tmpl_df934eeda694203").Execute() - - if err != nil { - return err - } - label: GO - /templates: - get: - operationId: templates_list - summary: List - description: Returns a list of your templates. The templates are returned sorted by creation date, with the most recently created templates appearing first. - tags: - - Templates - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/before_after' - - $ref: '#/components/parameters/include' - - $ref: '#/components/parameters/date_created' - - $ref: '#/components/parameters/metadata' - responses: - '200': - $ref: '#/components/responses/all_templates' - default: - $ref: '#/components/responses/template_error' - x-codeSamples: - - lang: Shell - source: | - curl -X GET "https://api.lob.com/v1/templates?limit=2" \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: - label: CURL - - lang: Typescript - source: | - try { - const templates = await new TemplatesApi(config).list(2); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - This feature is not currently supported by this library. - label: NODE - - lang: Ruby - source: | - templatesApi = TemplatesApi.new(config) - - begin - templates = templatesApi.list({ limit: 2 }) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = TemplatesApi(api_client) - - try: - templates = api.list(limit=2) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\TemplatesApi($config, new GuzzleHttp\Client()); - - try { - $result = $apiInstance->list( - 2, // limit - ); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - TemplatesApi apiInstance = new TemplatesApi(config); - - try { - List response = apiInstance.list( - 2, // limit - null, // before - null, // after - null, // include - null, // dateCreated - null, // metadata - null // size - ); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - This feature is not currently supported by this library. - label: ELIXIR - - lang: CSharp - source: | - TemplatesApi api = new TemplatesApi(config); - - List includeList = new List(); - includeList.Add("total_count"); - Dictionary metadata = new Dictionary(); - metadata.Add("name", "Harry"); - Dictionary dateCreated = new Dictionary(); - DateTime dateCreatedDate = DateTime.Today.AddMonths(-1); - dateCreated.Add("lt", dateCreatedDate); - - try { - TemplateList response = api.list( - 2, // limit - null, // before - null, // after - includeList, // include - dateCreated, // dateCreated - metadata // metadata - ); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - TemplateList = apiClient.TemplatesApi.List(context).Execute() - if err != nil { - return err - } - label: GO - post: - operationId: create_template - summary: Create - description: Creates a new template for use with the Print & Mail API. In Live mode, you can only have as many non-deleted templates as allotted in your current Print & Mail Edition. If you attempt to create a template past your limit, you will receive a `403` error. There is no limit in Test mode. - tags: - - Templates - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/template_writable' - example: - description: demo - html: HTML for {{name}} - metadata: - spiffy: 'true' - engine: handlebars - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/template_writable' - example: - description: demo - html: HTML for {{name}} - metadata: - spiffy: 'true' - engine: handlebars - multipart/form-data: - schema: - $ref: '#/components/schemas/template_writable' - example: - description: demo - html: HTML for {{name}} - metadata: - spiffy: 'true' - engine: handlebars - responses: - '200': - description: Returns a template object - headers: - ratelimit-limit: - $ref: '#/components/headers/ratelimit-limit' - ratelimit-remaining: - $ref: '#/components/headers/ratelimit-remaining' - ratelimit-reset: - $ref: '#/components/headers/ratelimit-reset' - content: - application/json: - schema: - $ref: '#/components/schemas/template' - example: - id: tmpl_c94e83ca2cd5121 - description: Test Template - versions: - - id: vrsn_362184d96d9b0c9 - suggest_json_editor: true - description: Test Template - engine: legacy - html: HTML for {{name}} - date_created: '2017-11-07T22:56:10.962Z' - date_modified: '2017-11-07T22:56:10.962Z' - object: version - published_version: - id: vrsn_362184d96d9b0c9 - suggest_json_editor: false - description: Test Template - engine: handlebars - html: HTML for {{name}} - date_created: '2017-11-07T22:56:10.962Z' - date_modified: '2017-11-07T22:56:10.962Z' - object: version - metadata: {} - date_created: '2017-11-07T22:56:10.962Z' - date_modified: '2017-11-07T22:56:10.962Z' - object: template - default: - $ref: '#/components/responses/template_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/templates \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ - -d "description=Test Template" \ - --data-urlencode "html=HTML for {{name}}" - label: CURL - - lang: Typescript - source: | - const templateCreate = new TemplateWritable({ - description: 'Newer Template', - html: 'Updated HTML for {{name}}' - }); - - try { - const myTemplate = await new TemplatesApi(config).create(templateCreate); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - This feature is not currently supported by this library. - label: NODE - - lang: Ruby - source: | - templateCreate = TemplateWritable.new({ - description: "Test Template", - html: "HTML for {{name}}", - }); - - templateApi = TemplatesApi.new(config) - - begin - createdTemplate = templateApi.create(templateCreate) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - template_writable = TemplateWritable( - description = "Test Template", - html = "HTML for {{name}}", - ) - - with ApiClient(configuration) as api_client: - api = TemplatesApi(api_client) - - try: - created_template = api.create(template_writable) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\TemplatesApi($config, new GuzzleHttp\Client()); - $template_writable = new OpenAPI\Client\Model\TemplateWritable( - array( - "description" => "Test Template", - "html" => "HTML for {{name}}", - ) - ); - - try { - $result = $apiInstance->create($template_writable); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - TemplatesApi apiInstance = new TemplatesApi(config); - - try { - TemplateWritable = new TemplateWritable(); - .set("Test Template"); - .set("HTML for {{name}}"); - - Template result = apiInstance.create(); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - This feature is not currently supported by this library. - label: ELIXIR - - lang: CSharp - source: | - TemplatesApi api = new TemplatesApi(config); - - TemplateWritable templateWritable = new TemplateWritable( - "Test Template", // description - "HTML for {{name}}" // html - ); - - try { - Template result = api.create(templateWritable); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - - var templateCreate = *lob.NewTemplateWritable() - templateCreate.SetDescription("Test Template") - templateCreate.SetHtml("HTML for {{name}}") - - - - createdtemplate, _, err := apiClient.TemplatesApi.Create(context).TemplateWritable(templateCreate).Execute() - - if err != nil { - return err - } - label: GO - /uploads: - get: - operationId: uploads_list - summary: List - description: Returns a list of your uploads. Optionally, filter uploads by campaign. - tags: - - Uploads - parameters: - - required: false - schema: - $ref: '#/components/schemas/cmp_id' - name: campaignId - description: id of the campaign - in: query - responses: - '200': - $ref: '#/components/responses/all_uploads' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/uploads \ - -u : - label: CURL - - lang: Ruby - source: | - uploadsApi = UploadsApi.new(config) - - begin - uploads = uploadsApi.list_upload({ campaign_id: "cmp_e05ee61ff80764b" }) - rescue => err - p err.message - end - label: RUBY - post: - operationId: upload_create - summary: Create - description: Creates a new upload with the provided properties. - tags: - - Uploads - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/upload_writable' - responses: - '201': - description: Upload created successfully - content: - application/json: - schema: - $ref: '#/components/schemas/upload' - example: - id: upl_71be866e430b11e9 - accountId: fa9ea650fc7b31a89f92 - campaignId: cmp_1933ad629bae1408 - mode: live - failuresUrl: http://www.example.com - originalFilename: my_audience.csv - state: Draft - totalMailpieces: 100 - failedMailpieces: 5 - validatedMailpieces: 95 - bytesProcessed: 17628 - dateCreated: '2017-09-05T17:47:53.767Z' - dateModified: '2017-09-05T17:47:53.767Z' - requiredAddressColumnMapping: - name: null - address_line1: null - address_city: null - address_state: null - address_zip: null - optionalAddressColumnMapping: - address_line2: null - company: null - address_country: null - mergeVariableColumnMapping: null - metadata: - columns: [] - '422': - $ref: '#/components/responses/upload_validation_error' - x-codeSamples: - - lang: Shell - source: | - curl --location --request POST 'https://api.lob.com/v1/uploads' \ - --header 'Content-Type: application/json' \ - -u YOUR_KEY_HERE: \ - --data-raw '{ - "campaignId": "cmp_f33809b18b6f3ea8" - }' - label: CURL - - lang: Ruby - source: | - uploadCreate = UploadWritable.new({ - campaign_id: "cmp_e05ee61ff80764b", - }); - - uploadApi = UploadsApi.new(config) - - begin - createdUpload = uploadApi.create_upload(uploadCreate) - rescue => err - p err.message - end - label: RUBY - /uploads/{upl_id}: - parameters: - - in: path - name: upl_id - description: id of the upload - required: true - schema: - $ref: '#/components/schemas/upl_id' - get: - operationId: upload_retrieve - summary: Retrieve - description: Retrieves the details of an existing upload. You need only supply the unique upload identifier that was returned upon upload creation. - tags: - - Uploads - responses: - '200': - description: Returns an upload object - content: - application/json: - schema: - $ref: '#/components/schemas/upload' - example: - id: upl_71be866e430b11e9 - accountId: fa9ea650fc7b31a89f92 - campaignId: cmp_1933ad629bae1408 - mode: live - failuresUrl: http://www.example.com - originalFilename: my_audience.csv - state: Draft - totalMailpieces: 100 - failedMailpieces: 5 - validatedMailpieces: 95 - bytesProcessed: 17628 - dateCreated: '2017-09-05T17:47:53.767Z' - dateModified: '2017-09-05T17:47:53.767Z' - requiredAddressColumnMapping: - name: null - address_line1: null - address_city: null - address_state: null - address_zip: null - optionalAddressColumnMapping: - address_line2: null - company: null - address_country: null - mergeVariableColumnMapping: null - metadata: - columns: [] - '404': - $ref: '#/components/responses/upload_not_found' - '422': - $ref: '#/components/responses/upload_validation_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/uploads/upl_71be866e430b11e9 \ - -u : \ - label: CURL - - lang: Ruby - source: | - uploadApi = UploadsApi.new(config) - - begin - retrievedUpload = uploadApi.get_upload("upl_71be866e430b11e9") - rescue => err - p err.message - end - label: RUBY - patch: - operationId: upload_update - summary: Update - description: Update the details of an existing upload. You need only supply the unique identifier that was returned upon upload creation. - tags: - - Uploads - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/upload_updatable' - responses: - '200': - description: Returns an upload object - content: - application/json: - schema: - $ref: '#/components/schemas/upload' - example: - id: upl_71be866e430b11e9 - accountId: fa9ea650fc7b31a89f92 - campaignId: cmp_1933ad629bae1408 - mode: live - failuresUrl: http://www.example.com - originalFilename: my_audience.csv - state: Draft - totalMailpieces: 100 - failedMailpieces: 5 - validatedMailpieces: 95 - bytesProcessed: 17628 - dateCreated: '2017-09-05T17:47:53.767Z' - dateModified: '2017-09-05T17:47:53.767Z' - requiredAddressColumnMapping: - name: null - address_line1: null - address_city: null - address_state: null - address_zip: null - optionalAddressColumnMapping: - address_line2: null - company: null - address_country: null - mergeVariableColumnMapping: null - metadata: - columns: [] - '404': - $ref: '#/components/responses/upload_not_found' - '422': - $ref: '#/components/responses/upload_validation_error' - x-codeSamples: - - lang: Shell - source: | - curl -X PATCH https://api.lob.com/v1/uploads/upl_71be866e430b11e9 \ - -u : \ - -d "state=Ready for Validation" - label: CURL - - lang: Python - source: | - upload_updatable = UploadUpdatable( - state = UploadState("Ready for Validation"), - ) - - with ApiClient(configuration) as api_client: - api = UploadsApi(api_client) - - try: - updated_upload = api.update_upload("upl_71be866e430b11e9", upload_updatable) - except ApiException as e: - print(e) - label: PYTHON - - lang: Ruby - source: | - uploadUpdatable = UploadUpdatable.new({ - required_address_column_mapping: RequiredAddressColumnMapping.new({ - name: "recipient", - address_line1: "primary line", - address_city: "city", - address_state: "state", - address_zip: "zip_code", - }), - }) - - uploadApi = UploadsApi.new(config) - - begin - updatedUpload = uploadApi.update_upload("upl_71be866e430b11e9", uploadUpdatable) - rescue => err - p err.message - end - label: RUBY - delete: - operationId: upload_delete - summary: Delete - description: Delete an existing upload. You need only supply the unique identifier that was returned upon upload creation. - tags: - - Uploads - responses: - '204': - description: Successful Response - x-codeSamples: - - lang: Shell - source: | - curl -X DELETE https://api.lob.com/v1/uploads/upl_71be866e430b11e9 \ - -u : - label: CURL - - lang: Ruby - source: | - uploadApi = UploadsApi.new(config) - - begin - deletedUpload = uploadApi.delete_upload("upl_71be866e430b11e9") - rescue => err - p err.message - end - label: RUBY - /uploads/{upl_id}/file: - parameters: - - in: path - name: upl_id - description: ID of the upload - required: true - schema: - $ref: '#/components/schemas/upl_id' - post: - operationId: upload_file - summary: Upload file - description: Upload an [audience file](https://help.lob.com/print-and-mail/building-a-mail-strategy/campaign-or-triggered-sends/campaign-audience-guide) and associate it with an upload. - tags: - - Uploads - requestBody: - required: true - content: - multipart/form-data: - schema: - type: object - properties: - file: - type: string - format: binary - responses: - '202': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/upload_file' - '422': - $ref: '#/components/responses/upload_validation_error' - x-codeSamples: - - lang: Shell - source: | - curl -X POST https://api.lob.com/v1/uploads/upl_71be866e430b11e9/file \ - -u : \ - -F file=@ - label: CURL - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = UploadsApi(api_client) - - try: - res = api.upload_file("upl_71be866e430b11e9", open("", "rb")) - except ApiException as e: - print(e) - label: PYTHON - /uploads/{upl_id}/exports: - parameters: - - in: path - name: upl_id - description: ID of the upload - required: true - schema: - $ref: '#/components/schemas/upl_id' - post: - operationId: upload_export_create - summary: Create Export - description: |- - Campaign Exports can help you understand exactly which records in a campaign could not be created. By initiating and retrieving an export, you will get row-by-row errors for your campaign. For a step-by-step walkthrough of creating a campaign and exporting failures, see our [Campaigns Guide](https://help.lob.com/print-and-mail/building-a-mail-strategy/campaign-or-triggered-sends/launch-your-first-campaign). - - Create an export file associated with an upload. - tags: - - Uploads - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - type: - type: string - enum: - - all - - failures - - successes - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/upload_create_export' - 4XX: - $ref: '#/components/responses/upload_export_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/uploads/upl_71be866e430b11e9/exports \ - -u : \ - -d "type=failures" \ - label: CURL - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = UploadsApi(api_client) - - export_model = ExportModel( - type = "all" - ) - - try: - created_export = api.create_export("upl_71be866e430b11e9", export_model) - except ApiException as e: - print(e) - label: PYTHON - - lang: Ruby - source: | - exportModel = ExportModel.new({ - type: "all" - }) - - uploadsApi = UploadsApi.new(config) - - begin - createdExport = uploadsApi.create_export("upl_71be866e430b11e9", exportModel) - rescue => err - p err.message - end - label: RUBY - /uploads/{upl_id}/report: - parameters: - - in: path - name: upl_id - description: ID of the upload - required: true - schema: - $ref: '#/components/schemas/upl_id' - - in: query - required: false - name: status - description: The status of line items to filter and retrieve. By default all line items are returned. - schema: - enum: - - Validated - - Failed - - Processing - type: string - - in: query - required: false - name: limit - description: How many results to return. - schema: - type: integer - minimum: 1 - default: 100 - maximum: 100 - example: 10 - - $ref: '#/components/parameters/offset' - get: - operationId: report_retrieve - summary: Retrieve Line Item Report - description: 'Retrieves the line item data for each row from the csv file associated with the upload id record. NOTE: This endpoint is currently feature flagged. Please reach out to Lob''s support team if you would like access to this API endpoint.' - tags: - - Uploads - responses: - '200': - description: Returns an report object - content: - application/json: - schema: - type: object - required: - - data - - count - - offset - - total_count - properties: - data: - type: array - items: - properties: - rowNumber: - title: Row Number - type: number - description: The row number of the csv file containing this data. - status: - type: string - description: The processing status of line item. - enum: - - Validated - - Failed - - Processing - errorMessage: - type: string - nullable: true - description: The error message detailing the reason why processing the line item failed. - mailpieceId: - type: string - nullable: true - description: The mailpiece id created from the line item when it was validated. - originalData: - type: object - description: Key-value pairs where each key is the column header and each value is the value of the column for the row. - next_url: - type: string - description: Url of next page of items in list. - nullable: true - prev_url: - type: string - description: Url of previous page of items in list. - nullable: true - 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 - example: - id: ex_6a94fe68fd151e0f8 - dateCreated: '2021-07-06T22:51:42.838Z' - dateModified: '2022-07-06T22:51:42.838Z' - deleted: false - s3Url: null - state: in_progress - type: failures - uploadId: upl_71be866e430b11e9 - '403': - $ref: '#/components/responses/feature_flag_disabled' - '404': - $ref: '#/components/responses/upload_not_found' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/uploads/upl_71be866e430b11e9/report \ - -u : - label: CURL - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = UploadsApi(api_client) - - try: - retrieved_report = api.get_report("upl_71be866e430b11e9") - except ApiException as e: - print(e) - label: PYTHON - - lang: Ruby - source: | - uploadsApi = UploadsApi.new(config) - - begin - retrievedreport = uploadsApi.get_report("upl_71be866e430b11e9") - rescue => err - p err.message - end - label: RUBY - /uploads/{upl_id}/exports/{ex_id}: - parameters: - - in: path - name: upl_id - description: ID of the upload - required: true - schema: - $ref: '#/components/schemas/upl_id' - - in: path - name: ex_id - description: ID of the export - required: true - schema: - $ref: '#/components/schemas/ex_id' - get: - operationId: export_retrieve - summary: Retrieve Export - description: Retrieves the details of an existing export. You need only supply the unique export identifier that was returned upon export creation. If you try retrieving an export immediately after creating one (i.e., before we're done processing the export), you will get back an export object with `state = in_progress`. - tags: - - Uploads - responses: - '200': - description: Returns an export object - content: - application/json: - schema: - type: object - required: - - id - - dateCreated - - dateModified - - deleted - - s3Url - - state - - type - - uploadId - properties: - id: - $ref: '#/components/schemas/ex_id' - dateCreated: - type: string - format: date-time - description: A timestamp in ISO 8601 format of the date the export was created - dateModified: - type: string - format: date-time - description: A timestamp in ISO 8601 format of the date the export was last modified - deleted: - type: boolean - description: Returns as `true` if the resource has been successfully deleted. - s3Url: - type: string - description: The URL for the generated export file. - state: - type: string - enum: - - in_progress - - failed - - succeeded - description: The state of the export file, which can be `in_progress`, `failed` or `succeeded`. - type: - type: string - enum: - - all - - failures - - successes - description: The export file type, which can be `all`, `failures` or `successes`. - uploadId: - $ref: '#/components/schemas/upl_id' - example: - id: ex_6a94fe68fd151e0f8 - dateCreated: '2021-07-06T22:51:42.838Z' - dateModified: '2022-07-06T22:51:42.838Z' - deleted: false - s3Url: null - state: in_progress - type: failures - uploadId: upl_71be866e430b11e9 - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/uploads/upl_71be866e430b11e9/exports/ex_6a94fe68fd151e0f8 \ - -u : - label: CURL - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = UploadsApi(api_client) - - try: - retrieved_export = api.get_export("upl_71be866e430b11e9", "ex_6a94fe68fd151e0f8") - except ApiException as e: - print(e) - label: PYTHON - - lang: Ruby - source: | - uploadsApi = UploadsApi.new(config) - - begin - retrievedExport = uploadsApi.get_export("upl_71be866e430b11e9", "ex_6a94fe68fd151e0f8") - rescue => err - p err.message - end - label: RUBY - /us_autocompletions: - post: - operationId: autocompletion - summary: Autocomplete - description: Given an address prefix consisting of a partial primary line, as well as optional input of city, state, and zip code, this functionality returns up to 10 full US address suggestions. Not all of them will turn out to be valid addresses; they'll need to be [verified](#operation/verification_us). - tags: - - US Autocompletions - parameters: - - in: query - name: case - schema: - type: string - enum: - - upper - - proper - default: upper - description: Casing of the verified address. Possible values are `upper` and `proper` for uppercased (e.g. "PO BOX") and proper-cased (e.g. "PO Box"), respectively. Only affects `primary_line`, `city`, and `state`. Default casing is `upper`. - required: false - - in: query - name: valid_addresses - schema: - type: boolean - enum: - - true - - false - default: false - description: Possible values are `true` and `false`. If false, not all of the suggestions in the response will be valid addresses; they'll need to be verified in order to determine the deliverability. The valid_addresses flag will greatly reduce the number of keystrokes needed before reaching an intended address. - required: false - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/us_autocompletions_writable' - examples: - basic: - value: - address_prefix: 185 B - city: San Francisco - state: CA - zip_code: '94107' - geo_ip_sort: false - test: - value: - address_prefix: 1 sugg - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/us_autocompletions_writable' - examples: - basic: - value: - address_prefix: 185 B - city: San Francisco - state: CA - zip_code: '94107' - geo_ip_sort: false - test: - value: - address_prefix: 1 sugg - multipart/form-data: - schema: - $ref: '#/components/schemas/us_autocompletions_writable' - examples: - basic: - value: - address_prefix: 185 B - city: San Francisco - state: CA - zip_code: '94107' - geo_ip_sort: false - test: - value: - address_prefix: 1 sugg - responses: - '200': - $ref: '#/components/responses/us_autocompletions' - default: - $ref: '#/components/responses/us_autocompletions_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/us_autocompletions \ - -u : \ - -d "address_prefix=185 B" \ - -d "city=San Francisco" \ - -d "state=CA" - -d "zip_code=94107" - label: CURL - - lang: Typescript - source: | - const UsAutocompletions = new USAutocompletionsApi(av_config); - const autocompletionData: UsAutocompletionsWritable = { - address_prefix: '185 B', - city: 'SAN FRANCISCO' - }; - - try { - const autocompletedAddresses = await UsAutocompletions.autocomplete(autocompletionData); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.usAutocompletions.autocomplete({ - address_prefix: '185 B', - city: 'San Francisco', - state: 'CA', - zip_code: '94107', - }, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - usAutocompletionsApi = UsAutocompletionsApi.new(config) - - autocompletionData = UsAutocompletionsWritable.new({ - address_prefix: "185 B", - city: "San Francisco", - state: "CA", - zip_code: "94017", - }) - - begin - autocompletedAddress = usAutocompletionsApi.autocomplete(autocompletionData) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = UsAutocompletionsApi(api_client) - - autocompletion_data = UsAutocompletionsWritable( - address_prefix = "185 B", - city = "San Francisco", - state = "CA", - zip_code = "94017", - ) - - try: - autocompleted_addresses = api.autocomplete(autocompletion_data) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\UsAutocompletionsApi($config, new GuzzleHttp\Client()); - - $autocompletionData = new OpenAPI\Client\Model\UsAutocompletionsWritable(array( - "address_prefix" => "185 B", - "city" => "San Francisco", - "state" => "CA", - "zip_code" => "94017", - )); - - try { - $result = $apiInstance->autocomplete($autocompletionData); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - UsAutocompletionsApi apiInstance = new UsAutocompletionsApi(config); - UsAutocompletionsWritable autoCompletionWritable = new UsAutocompletionsWritable(); - autoCompletionWritable.setAddressPrefix("185 B"); - autoCompletionWritable.setCity("San Francisco"); - autoCompletionWritable.setState("CA"); - autoCompletionWritable.setZipCode("94017"); - - try { - UsAutocompletions usAutocompletion = apiInstance.autocomplete(autoCompletionWritable); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.USAutocompletion.autocomplete(%{ - address_prefix: "185 B", - city: "San Francisco", - state: "CA", - zip_code: "94107" - }) - label: ELIXIR - - lang: CSharp - source: | - UsAutocompletionsApi api = new UsAutocompletionsApi(config); - UsAutocompletionsWritable autoCompletionWritable = new UsAutocompletionsWritable( - "185 B", // address_prefix - "San Francisco", // city - "CA", // state - "94017" // zip_code - ); - - try { - UsAutocompletions usAutocompletion = api.autocomplete(autoCompletionWritable); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(context, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - var usAutocomplationsWritable = *lob.NewUsAutocompletionsWritable("340 Wat") - - resp, _, err := suite.apiClient.UsAutocompletionsApi.Autocomplete(suite.ctx).UsAutocompletionsWritable(suite.usAutocomplationsWritable).Execute() - - if err != nil { - return err - } - label: GO - /us_reverse_geocode_lookups: - post: - operationId: reverse_geocode_lookup - summary: Reverse Geocode Lookup - description: Reverse geocode a valid US location with a live API key. - tags: - - Reverse Geocode Lookups - parameters: - - in: query - name: size - schema: - type: integer - minimum: 1 - default: 5 - maximum: 50 - example: 5 - description: Determines the number of locations returned. Possible values are between 1 and 50 and any number higher will be rounded down to 50. Default size is a list of 5 reverse geocoded locations. - required: false - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/location' - example: - latitude: 37.7749 - longitude: 122.4194 - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/location' - example: - latitude: 37.7749 - longitude: 122.4194 - multipart/form-data: - schema: - $ref: '#/components/schemas/location' - example: - latitude: 37.7749 - longitude: 122.4194 - responses: - '200': - $ref: '#/components/responses/reverse_geocode_lookups' - default: - $ref: '#/components/responses/reverse_geocode_lookups_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/us_reverse_geocode_lookups \ - -u : \ - -d "latitude=37.7749" \ - -d "longitude=122.4194" \ - label: CURL - - lang: Typescript - source: | - const ReverseGeocodeLookup = new ReverseGeocodeLookupsApi(av_config); - const coordinates = new Location({ - latitude: 37.777456, - longitude: -122.393039 - }); - try { - const geocode = await ReverseGeocodeLookup.lookup(coordinates); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.reverseGeocodeLookups.lookup({ - latitude: 37.7749, - longitude: 122.4194 - }, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - reverseGeocodeLookupsApi = ReverseGeocodeLookupsApi.new(config) - - coordinates = Location.new({ - latitude: 37.777456, - longitude: -122.393039, - }) - - begin - geocode = reverseGeocodeLookupsApi.lookup(coordinates) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = ReverseGeocodeLookupsApi(api_client) - - coordinates = Location( - latitude = 37.777456, - longitude = -122.393039, - ) - - try: - geocode = api.lookup(coordinates) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\ReverseGeocodeLookupsApi($config, new GuzzleHttp\Client()); - - $coordinates = new OpenAPI\Client\Model\Location(array( - "latitude" => "37.777456", - "longitude" => "-122.393039", - )); - - try { - $result = $apiInstance->lookup($coordinates); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - label: PHP - - lang: Java - source: | - ReverseGeocodeLookupsApi apiInstance = new ReverseGeocodeLookupsApi(config); - - Location location = new Location(); - location.setlatitude(37.777456f); - location.setlongitude(-122.393039f); - - try { - apiInstance.lookup(location, null); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.ReverseGeocodeLookup.lookup(%{ - latitude: 37.7749, - longitude: 122.4194 - }) - label: ELIXIR - - lang: CSharp - source: | - ReverseGeocodeLookupsApi api = new ReverseGeocodeLookupsApi(config); - - Location location = new Location( - 37.777456f, - -122.393039f - ); - - try { - api.lookup(location, null); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(context, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - var location = *lob.NewLocationWithDefaults() - location.SetLatitude(37.777456) - location.SetLongitude(122.393039) - - resp, _, err := apiClient.ReverseGeocodeLookupsApi.Lookup(context).Location(location).Execute() - - if err != nil { - return err - } - label: GO - /us_verifications: - post: - operationId: us_verification - summary: Single Verify - description: Verify a US or US territory address _with a live API key_. The address can be in components (e.g. `primary_line` is "210 King Street", `zip_code` is "94107") or as a single string (e.g. "210 King Street 94107"), but not as both. Requests using a test API key validate required fields but return empty values unless specific `primary_line` values are provided. See the [US Verifications Test Environment](#section/US-Verifications-Test-Env) for details. - tags: - - US Verifications - parameters: - - in: query - name: case - schema: - type: string - enum: - - upper - - proper - default: upper - description: Casing of the verified address. Possible values are `upper` and `proper` for uppercased (e.g. "PO BOX") and proper-cased (e.g. "PO Box"), respectively. Only affects `recipient`, `primary_line`, `secondary_line`, `urbanization`, and `last_line`. Default casing is `upper`. - required: false - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/us_verifications_writable' - examples: - basic: - value: - primary_line: 210 King Street - city: San Francisco - state: CA - zip_code: '94107' - full_payload: - value: - recipient: Walgreens - primary_line: Ave Wilson Churchill 123 - secondary_line: '' - urbanization: URB FAIR OAKS - city: RIO PIEDRAS - state: PR - zip_code: '00926' - single_line: - value: - address: 210 King Street 94107 - test: - value: - primary_line: po box - zip_code: '11111' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/us_verifications_writable' - examples: - basic: - value: - primary_line: 210 King Street - city: San Francisco - state: CA - zip_code: '94107' - full_payload: - value: - recipient: Walgreens - primary_line: Ave Wilson Churchill 123 - secondary_line: '' - urbanization: URB FAIR OAKS - city: RIO PIEDRAS - state: PR - zip_code: '00926' - single_line: - value: - address: 210 King Street 94107 - test: - value: - primary_line: po box - zip_code: '11111' - multipart/form-data: - schema: - $ref: '#/components/schemas/us_verifications_writable' - examples: - basic: - value: - primary_line: 210 King Street - city: San Francisco - state: CA - zip_code: '94107' - full_payload: - value: - recipient: Walgreens - primary_line: Ave Wilson Churchill 123 - secondary_line: '' - urbanization: URB FAIR OAKS - city: RIO PIEDRAS - state: PR - zip_code: '00926' - single_line: - value: - address: 210 King Street 94107 - test: - value: - primary_line: po box - zip_code: '11111' - responses: - '200': - $ref: '#/components/responses/us_verifications' - default: - $ref: '#/components/responses/us_verifications_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/us_verifications \ - -u : \ - -d "primary_line=210 King Street" \ - -d "city=San Francisco" \ - -d "state=CA" \ - -d "zip_code=94107" - label: CURL - - lang: Typescript - source: | - const UsVerification = new USVerificationsApi(av_config); - const verificationData1: UsVerificationsWritable = { - primary_line: '210 King Street', - city: 'San Francisco', - state: 'CA', - zip_code: '94107' - }; - - try { - const singleVerified = await UsVerification.verifySingle(verificationData1); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.usVerifications.verify({ - primary_line: '210 King Street', - city: 'San Francisco', - state: 'CA', - zip_code: '94107' - }, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - usVerificationsApi = UsVerificationsApi.new(config) - - verificationData = UsVerificationsWritable.new({ - primary_line: "210 King Street", - city: "San Francisco", - state: "CA", - zip_code: "94017", - }) - - begin - singleVerifiedAddr = usVerificationsApi.verifySingle(verificationData) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = UsVerificationsApi(api_client) - verification_data_1 = UsVerificationsWritable( - primary_line = "210 King Street", - city = "San Francisco", - state = "CA", - zip_code = "94017", - ) - - try: - single_verified = api.verifySingle(verification_data_1) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\UsVerificationsApi($config, new GuzzleHttp\Client()); - - $verificationData = new OpenAPI\Client\Model\UsVerificationsWritable(array( - 'primary_line' => '210 King Street', - 'city' => 'San Francisco', - 'state' => 'CA', - 'zip_code' => '94017', - )); - - try { - $result = $apiInstance->verifySingle($verificationData); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - - lang: Java - source: | - UsVerificationsWritable singleVerify = new UsVerificationsWritable(); - singleVerify.setPrimaryLine("210 King Street"); - singleVerify.setCity("San Francisco"); - singleVerify.setState("CA"); - singleVerify.setZipCode("94017"); - - UsVerificationsApi apiInstance = new UsVerificationsApi(config); - try { - apiInstance.verifySingle(singleVerify, null); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.USVerification.verify(%{ - primary_line: "210 King Street", - city: "San Francisco", - state: "CA", - zip_code: "94107" - }) - label: ELIXIR - - lang: CSharp - source: | - UsVerificationsWritable singleVerify = new UsVerificationsWritable( - null, - null, - "210 King Street", - null, - null, - "San Francisco", - "CA", - "94017" - ); - - UsVerificationsApi api = new UsVerificationsApi(config); - - try { - api.verifySingle(singleVerify, null); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - /us_zip_lookups: - post: - operationId: zip_lookup - summary: Lookups - description: Returns information about a ZIP code - tags: - - Zip Lookups - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/zip5' - example: - zip_code: '94107' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/zip5' - example: - zip_code: '94107' - multipart/form-data: - schema: - $ref: '#/components/schemas/zip5' - example: - zip_code: '94107' - responses: - '200': - $ref: '#/components/responses/zip_lookups' - default: - $ref: '#/components/responses/zip_lookups_error' - x-codeSamples: - - lang: Shell - source: | - curl https://api.lob.com/v1/us_zip_lookups \ - -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ - -d "zip_code=94107" - label: CURL - - lang: Typescript - source: | - const ZipLookup = new ZipLookupsApi(av_config); - const zipRequest : ZipEditable = { - zip_code: '07090' - } - try { - const zipLookup : Zip = await ZipLookup.lookup(zipRequest); - } catch (err: any) { - console.error(err); - } - label: TYPESCRIPT - - lang: Javascript - source: | - Lob.usZipLookups.lookup({ - zip_code: '94107' - }, function (err, res) { - console.log(err, res); - }); - label: NODE - - lang: Ruby - source: | - zipLookupsApi = ZipLookupsApi.new(config) - - zipRequest = ZipEditable.new({ - zip_code: "94107" - }) - - begin - zipLookup = zipLookupsApi.lookup(zipRequest) - rescue => err - p err.message - end - label: RUBY - - lang: Python - source: | - with ApiClient(configuration) as api_client: - api = ZipLookupsApi(api_client) - - zip_request = ZipEditable( - zip_code = "94107" - ) - - try: - zip_lookup = api.lookup(zip_request) - except ApiException as e: - print(e) - label: PYTHON - - lang: PHP - source: | - $apiInstance = new OpenAPI\Client\Api\ZipLookupsApi($config, new GuzzleHttp\Client()); - - $zipRequest = new OpenAPI\Client\Model\ZipEditable(array( - "zip_code" => '94107' - )); - - try { - $result = $apiInstance->lookup($zipRequest); - } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; - } - label: PHP - - lang: Java - source: | - ZipEditable zipEditable = new ZipEditable(); - zipEditable.setZipCode("94107"); - - ZipLookupsApi apiInstance = new ZipLookupsApi(config); - try { - Zip response = apiInstance.lookup(zipEditable); - } catch (ApiException e) { - e.printStackTrace(); - } - label: JAVA - - lang: Elixir - source: | - Lob.USZipLookup.lookup(%{ - zip_code: "94107" - }) - label: ELIXIR - - lang: CSharp - source: | - ZipEditable zipEditable = new ZipEditable("94107"); - - ZipLookupsApi api = new ZipLookupsApi(config); - - try { - Zip response = api.lookup(zipEditable); - } catch (ApiException e) { - Console.WriteLine(e.ToString()); - } - label: CSHARP - - lang: Go - source: | - var context = context.Background() - context = context.WithValue(context, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv("")}) - - var apiClient = *lob.NewAPIClient(configuration) - - var zipEditable = *lob.NewZipEditable() - zipEditable.SetZipCode("94107") - - resp, _, err := apiClient.ZipLookupsApi.Lookup(context).ZipEditable(zipEditable).Execute() - - if err != nil { - return err - } - label: GO -x-webhooks: - events: - post: - summary: Events - description: Information about an event - operationId: event - tags: - - Events - responses: - '200': - $ref: '#/components/responses/events' - tracking_events: - post: - summary: Tracking Events - description: Information about tracking events - operationId: tracking_event - tags: - - Tracking Events - responses: - '200': - $ref: '#/components/responses/tracking_events' -components: - securitySchemes: - basicAuth: - type: http - scheme: basic - schemas: - lob_credits_balance: - type: object - required: - - balance - properties: - balance: - type: number - description: Account's current balance of Lob Credits. Can be positive, negative, or zero. - example: 1000 - 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 ≤.' - 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}' - failure_status_code: - type: integer - enum: - - 401 - - 403 - - 404 - - 413 - - 422 - - 429 - - 500 - description: | - A conventional HTTP status code: - * `401` - Authorization error with your API key or account - * `403` - Forbidden error with your API key or account - * `404` - The requested item does not exist - * `413` - Payload too large - * `422` - The query or body parameters did not pass validation - * `429` - Too many requests have been sent with an API key in a given amount of time - * `500` - An internal server error occurred, please contact support@lob.com - error: - type: object - 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. - required: - - error - properties: - error: - type: object - required: - - message - - status_code - - code - properties: - message: - type: string - description: A human-readable message with more details about the error - example: Rate limit exceeded. Please wait 5 seconds and try your request again. - status_code: - $ref: '#/components/schemas/failure_status_code' - code: - type: string - enum: - - bad_request - - conflict - - feature_limit_reached - - internal_server_error - - invalid - - not_deletable - - not_found - - request_timeout - - service_unavailable - - unrecognized_endpoint - - unsupported_lob_version - - address_length_exceeds_limit - - bank_account_already_verified - - bank_error - - billing_address_required - - custom_envelope_inventory_depleted - - deleted_bank_account - - failed_deliverability_strictness - - file_pages_below_min - - file_pages_exceed_max - - file_size_exceeds_limit - - foreign_return_address - - inconsistent_page_dimensions - - invalid_bank_account - - invalid_bank_account_verification - - invalid_check_international - - invalid_country_covid - - invalid_file - - invalid_file_dimensions - - invalid_file_download_time - - invalid_file_url - - invalid_image_dpi - - invalid_international_feature - - invalid_perforation_return_envelope - - invalid_template_html - - mail_use_type_can_not_be_null - - merge_variable_required - - merge_variable_whitespace - - payment_method_unverified - - pdf_encrypted - - special_characters_restricted - - unembedded_fonts - - email_required - - invalid_api_key - - publishable_key_not_allowed - - rate_limit_exceeded - - unauthorized - - unauthorized_token - description: | - A pre-defined string identifying an error. Error codes fall into three categories: - - **GENERIC** - * `bad_request` - 422: an invalid request was made. See error message for details. - * `conflict` - 409/422: this operation would leave data in a conflicted state. - * `feature_limit_reached` - 403: the account has reached its resource limit and requires upgrading to add more. - * `internal_server_error` - 500: an error has occured on Lob's servers. Please try request again. - * `invalid` - 422: an invalid request was made. See error message for details. - * `not_deletable` - 422: an attempt was made to delete a resource, but the resource cannot be deleted. - * `not_found` - 404: the requested resource was not found. - * `request_timeout` - 408: the request took too long. Please try again. - * `service_unavailable` - 503: the Lob servers are temporarily unavailable. Please try agian. - * `unrecognized_endpoint` - 404: the requested endpoint doesn't exist. - * `unsupported_lob_version` - 422: an unsupported Lob API version was requested. - - **ADVANCED** - * `address_length_exceeds_limit` - 422: the sum of to.address_line1 and to.address_line2 cannot surpass 50 characters. - * `bank_account_already_verified` - 422: the bank account has already been verified. - * `bank_error` - 422: there's an issue with the bank account. - * `billing_address_required` - 403: in order to create a live mail piece, your account needs to set up a billing address. - * `custom_envelope_inventory_depleted` - 422: custom envelope inventory is depleted, and more will need to be ordered. - * `deleted_bank_account` - 404: checks cannot be created with a deleted bank account. - * `failed_deliverability_strictness` - 422: the `to` address doesn't meet strictness requirements. See Account Settings to configure strictness. - * `file_pages_below_min` - 422: not enough pages. - * `file_pages_exceed_max` - 422: too many pages. - * `file_size_exceeds_limit` - 422: the file size is too large. See description for details. - * `foreign_return_address` - 422: the `from` address must be a US address. - * `inconsistent_page_dimensions` - 422: all pages of the input file must have the same dimensions. - * `invalid_bank_account` - 422: the provided bank routing number is invalid. - * `invalid_bank_account_verification` - 422: verification amounts do not match. - * `invalid_check_international` - 422: checks cannot be sent internationally. - * `invalid_country_covid` - 422: the postal service in the specified country is currently unable to process the request due to COVID-19 restrictions. - * `invalid_file` - 422: the file is invalid. - * `invalid_file_dimensions` - 422: file dimensions are incorrect for the selected mail type. - * `invalid_file_download_time` - 422: file download from remote server took too long. - * `invalid_file_url` - 422: the file URL when creating a resource is invalid. - * `invalid_image_dpi` - 422: DPI must be at least 300. - * `invalid_international_feature` - 422: the specified product cannot be sent to the destination. - * `invalid_perforation_return_envelope` - 422: both `return_envelope` and `perforation` must be used together. - * `invalid_template_html` - 422: the provided HTML is invalid. - * `mail_use_type_can_not_be_null` - 422: use_type must be one of "marketing" or "operational". Alternatively, an admin can set the account default use type in Account Settings. - * `merge_variable_required` - 422: a required merge variable is missing. - * `merge_variable_whitespace` - 422: merge variable names cannot contain whitespace. - * `payment_method_unverified` - 401: you must have a verified bank account or credit card to submit live requests. - * `pdf_encrypted` - 422: an encrypted PDF was provided. - * `special_characters_restricted` - 422: cannot use special characters for merge variable names. - * `unembedded_fonts` - 422: the provided PDF contains non-standard unembedded fonts. See description for details. - - **AUTHENTICATION** - * `email_required` - 401: account must have a verified email address before creating live resources. - * `invalid_api_key` - 401/403: the API key is invalid. - * `publishable_key_not_allowed` - 403: the requested operation needs a secret key, not a publishable key. See [API Keys](#section/API-Keys) for more information. - * `rate_limit_exceeded` - 429: requests were sent too quickly and must be slowed down. - * `unauthorized` - 401: the request isn't authorized. * `unauthorized_token` - 401: token isn't authorized. object: type: string @@ -15048,7 +3547,9 @@ components: $ref: '#/components/schemas/count' total_count: type: integer - description: Indicates the total number of records. Provided when the request specifies an "include" query parameter + description: >- + Indicates the total number of records. Provided when the request + specifies an "include" query parameter date_created: type: string format: date-time @@ -15056,7 +3557,9 @@ components: date_modified: type: string format: date-time - description: A timestamp in ISO 8601 format of the date the resource was last modified. + description: >- + A timestamp in ISO 8601 format of the date the resource was last + modified. deleted: type: boolean description: Only returned if the resource has been successfully deleted. @@ -15081,8 +3584,9 @@ components: pattern: ^adr_[a-zA-Z0-9]+$ resource_description: type: string - description: | - An internal description that identifies this resource. Must be no longer than 255 characters. + description: > + An internal description that identifies this resource. Must be no longer + than 255 characters. maxLength: 255 nullable: true address_us: @@ -15115,14 +3619,23 @@ components: $ref: '#/components/schemas/resource_description' name: type: string - 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. + 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 nullable: true company: type: string - 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. This field can be used for any secondary recipient information which is not part of the actual mailing address (Company Name, Department, Attention Line, etc). + 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. This field can be used for + any secondary recipient information which is not part of the + actual mailing address (Company Name, Department, Attention + Line, etc). maxLength: 40 nullable: true phone: @@ -15141,7 +3654,9 @@ components: maxLength: 64 address_line2: type: string - description: An optional field containing any information which can't fit into line 1. + description: >- + An optional field containing any information which can't fit + into line 1. maxLength: 64 nullable: true address_city: @@ -15153,8 +3668,9 @@ components: pattern: ^[a-zA-Z]{2}$ address_zip: type: string - description: | - Must follow the ZIP format of `12345` or ZIP+4 format of `12345-1234`. + description: > + Must follow the ZIP format of `12345` or ZIP+4 format of + `12345-1234`. pattern: ^\d{5}(-\d{4})?$ address_country: type: string @@ -15167,8 +3683,18 @@ components: $ref: '#/components/schemas/metadata' recipient_moved: type: boolean - description: | - Only returned for accounts on certain Print & Mail Editions. Value is `true` if the address was altered because the recipient filed for a National Change of Address Linkage (NCOALink), `false` if the NCOALink check was run but no altered address was found, and `null` if the NCOALink check was not run. The NCOALink check does not happen for non-US addresses, for non-deliverable US addresses, or for addresses created before the NCOALink feature was added to your account. + description: > + Only returned for accounts on certain Print & Mail Editions. Value is `true` + if the address was altered because the recipient filed for a National Change of + Address Linkage (NCOALink), `false` if the NCOALink check + was run but no altered address was found, and `null` if the + NCOALink check was not run. The NCOALink check does not happen + for non-US addresses, for non-deliverable US addresses, or for + addresses created before the NCOALink feature was added to your + account. nullable: true example: id: adr_e68217bd744d65c8 @@ -15190,8 +3716,13 @@ components: object: address company: type: string - 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. This field can be used for any secondary recipient information which is not part of the actual mailing address (Company Name, Department, Attention Line, etc). + 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. This field can be used for any secondary recipient information + which is not part of the actual mailing address (Company Name, + Department, Attention Line, etc). maxLength: 40 nullable: true address_intl: @@ -15216,8 +3747,11 @@ components: $ref: '#/components/schemas/resource_description' name: type: string - 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. + 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 nullable: true company: @@ -15516,7 +4050,9 @@ components: maxLength: 64 address_line2: type: string - description: An optional field containing any information which can't fit into line 1. + description: >- + An optional field containing any information which can't fit into + line 1. maxLength: 64 nullable: true address_city: @@ -15528,8 +4064,9 @@ components: pattern: ^[a-zA-Z]{2}$ address_zip: type: string - description: | - Must follow the ZIP format of `12345` or ZIP+4 format of `12345-1234`. + description: > + Must follow the ZIP format of `12345` or ZIP+4 format of + `12345-1234`. pattern: ^\d{5}(-\d{4})?$ address_editable_us: allOf: @@ -15547,8 +4084,11 @@ components: $ref: '#/components/schemas/resource_description' name: type: string - 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. + 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 nullable: true company: @@ -15582,7 +4122,9 @@ components: maxLength: 200 address_line2: type: string - description: An optional field containing any information which can't fit into line 1. + description: >- + An optional field containing any information which can't fit into + line 1. maxLength: 200 nullable: true address_city: @@ -15600,7 +4142,11 @@ components: nullable: true 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. + 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 @@ -15835,8 +4381,11 @@ components: $ref: '#/components/schemas/resource_description' name: type: string - 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. + 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 nullable: true company: @@ -15860,7 +4409,10 @@ components: - $ref: '#/components/schemas/address_editable_us' - $ref: '#/components/schemas/address_editable_intl' address_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. + 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/adr_id' @@ -15884,7 +4436,10 @@ components: - amounts properties: amounts: - description: In live mode, an array containing the two micro deposits (in cents) placed in the bank account. In test mode, no micro deposits will be placed, so any two integers between `1` and `100` will work. + description: >- + In live mode, an array containing the two micro deposits (in cents) + placed in the bank account. In test mode, no micro deposits will be + placed, so any two integers between `1` and `100` will work. type: array minItems: 2 maxItems: 2 @@ -15901,7 +4456,9 @@ components: description: $ref: '#/components/schemas/resource_description' routing_number: - description: Must be a valid US routing number. + description: >- + Must be a valid US routing number. type: string minLength: 9 maxLength: 9 @@ -15915,7 +4472,13 @@ components: - individual description: The type of entity that holds the account. signatory: - description: The signatory associated with your account. This name will be printed on checks created with this bank account. If you prefer to use a custom signature image on your checks instead, please create your bank account from the Dashboard. + description: >- + The signatory associated with your account. This name will be + printed on checks created with this bank account. If you prefer to + use a custom signature image on your checks instead, please create + your bank account from the Dashboard. type: string maxLength: 30 check_template: @@ -15923,25 +4486,48 @@ components: enum: - common - jpm - description: The check template used for printing. The defualt value is `common`. If you bank with JP Morgan Chase and wish to use Positive Pay use the `jpm` template. `jpm` requires additional information to be provided. + description: >- + The check template used for printing. The defualt value is `common`. + If you bank with JP Morgan Chase and wish to use Positive Pay use + the `jpm` template. `jpm` requires additional information to be + provided. fractional_routing_number: type: string - description: The fractional routing number for your home bank account. Required for the `jpm` check template only. Please contact a bank representative if you do not know the fractional routing number associated with your home bank institution. + description: >- + The fractional routing number for your home bank account. Required + for the `jpm` check template only. Please contact a bank + representative if you do not know the fractional routing number + associated with your home bank institution. city: type: string - description: The city associated with your home bank account. Required for the `jpm` check template only. Please contact a bank representative if you do not know the city associated with your home bank institution. + description: >- + The city associated with your home bank account. Required for the + `jpm` check template only. Please contact a bank representative if + you do not know the city associated with your home bank institution. state: type: string - description: The state associated with your home bank account. Required for the `jpm` check template only. Please contact a bank representative if you do not know the state associated with your home bank institution. + description: >- + The state associated with your home bank account. Required for the + `jpm` check template only. Please contact a bank representative if + you do not know the state associated with your home bank + institution. zipcode: type: string - description: The zipcode associated with your home bank account. Required for the `jpm` check template only. Please contact a bank representative if you do not know the zipcode associated with your home bank institution. + description: >- + The zipcode associated with your home bank account. Required for the + `jpm` check template only. Please contact a bank representative if + you do not know the zipcode associated with your home bank + institution. metadata: $ref: '#/components/schemas/metadata' signed_link: type: string - description: A [signed link](#section/Asset-URLs) served over HTTPS. The link returned will expire in 30 days to prevent mis-sharing. Each time a GET request is initiated, a new signed URL will be generated. - pattern: ^https://lob-assets.com/(letters|postcards|bank-accounts|checks|self-mailers|cards|order-creatives)/([a-z]{3,4}_[a-z0-9]{15,16}|[a-z]{3}_[a-z0-9]{26}_[a-z]{4}_[a-z0-9]{26})('|_signature)(.pdf|_thumb_[a-z]+_[0-9]+.png|.png)?(version=[a-z0-9]*&)expires=[0-9]{10}&signature=[a-zA-Z0-9-_]+ + description: >- + A [signed link](#section/Asset-URLs) served over HTTPS. The link + returned will expire in 30 days to prevent mis-sharing. Each time a GET + request is initiated, a new signed URL will be generated. + pattern: >- + ^https://lob-assets.com/(letters|postcards|bank-accounts|checks|self-mailers|cards|order-creatives)/([a-z]{3,4}_[a-z0-9]{15,16}|[a-z]{3}_[a-z0-9]{26}_[a-z]{4}_[a-z0-9]{26})('|_signature)(.pdf|_thumb_[a-z]+_[0-9]+.png|.png)?(version=[a-z0-9]*&)expires=[0-9]{10}&signature=[a-zA-Z0-9-_]+ bank_account: allOf: - $ref: '#/components/schemas/bank_account_base' @@ -15959,10 +4545,14 @@ components: description: A [signed link](#section/Asset-URLs) to the signature image. - $ref: '#/components/schemas/signed_link' bank_name: - description: The name of the bank based on the provided routing number, e.g. `JPMORGAN CHASE BANK`. + description: >- + The name of the bank based on the provided routing number, e.g. + `JPMORGAN CHASE BANK`. type: string verified: - description: A bank account must be verified before a check can be created. More info [here](#operation/bank_account_verify). + description: >- + A bank account must be verified before a check can be created. + More info [here](#operation/bank_account_verify). type: boolean default: false object: @@ -15973,7 +4563,8 @@ components: default: bank_account example: id: bank_a - signature_url: https://lob-assets.com/bank-accounts/asd_asdfghjkqwertyui.pdf?expires=1234567890&signature=aksdf + signature_url: >- + https://lob-assets.com/bank-accounts/asd_asdfghjkqwertyui.pdf?expires=1234567890&signature=aksdf bank_name: JPMORGAN CHASE BANK verified: true object: bank_account @@ -15987,7 +4578,10 @@ components: date_created: '2019-08-08T19:34:47.571Z' date_modified: '2019-08-08T19:34:47.571Z' bank_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. + 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/bank_id' @@ -16103,7 +4697,9 @@ components: availability_date: type: string format: date-time - description: A timestamp in ISO 8601 format of the date the resource was created. + description: >- + A timestamp in ISO 8601 format of the date the resource was + created. expected_availability_date: type: string format: date-time @@ -16200,7 +4796,9 @@ components: type: number default: 0 buckslip_orders: - description: An array of buckslip orders that are associated with the buckslip. + description: >- + An array of buckslip orders that are associated with the + buckslip. type: array items: $ref: '#/components/schemas/buckslip_order' @@ -16237,8 +4835,9 @@ components: default: buckslip remote_file_url: type: string - description: | - The location of a remote file. Remote URLs have a 20 MB file size limit and must be downloaded within 40 seconds. + description: > + The location of a remote file. Remote URLs have a 20 MB file size limit + and must be downloaded within 40 seconds. pattern: ^https://[-a-zA-Z0-9@:%._+~#=/]{1,256}.(html?|pdf|png|jpg)$ local_file_path: type: string @@ -16262,7 +4861,10 @@ components: - $ref: '#/components/schemas/remote_file_url' - $ref: '#/components/schemas/local_file_path' buckslip_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. + 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/buckslip_id' @@ -16277,7 +4879,9 @@ components: description: Allows for auto reordering type: boolean reorder_quantity: - description: The quantity of items to be reordered (only required when auto_reorder is true). + description: >- + The quantity of items to be reordered (only required when + auto_reorder is true). type: number minimum: 5000 maximum: 10000000 @@ -16313,13 +4917,17 @@ components: maxLength: 200 secondary_line: type: string - description: | - The secondary delivery line of the address. This field is typically empty but may contain information if `primary_line` is too long. + description: > + The secondary delivery line of the address. This field is typically + empty but may contain information if `primary_line` is too long. maxLength: 200 urbanization: type: string - description: | - Only present for addresses in Puerto Rico. An urbanization refers to an area, sector, or development within a city. See USPS documentation for clarification. + description: > + Only present for addresses in Puerto Rico. An urbanization refers to an + area, sector, or development within a city. See USPS documentation for clarification. maxLength: 200 city_no_description: type: string @@ -16353,14 +4961,23 @@ components: allOf: - $ref: '#/components/schemas/city_no_description' - type: string - description: The name of the city. `city` and `state` are required if no `zip_code` is passed. + description: >- + The name of the city. `city` and `state` are required if no + `zip_code` is passed. state: type: string - description: The ISO 3166-2 two letter code or subdivision name for the state. `city` and `state` are required if no `zip_code` is passed. + description: >- + The ISO 3166-2 two letter code or subdivision + name for the state. `city` and `state` are required if no + `zip_code` is passed. maxLength: 50 zip_code: allOf: - - description: Required if `city` and `state` are not passed in. If included, must be formatted as a US ZIP or ZIP+4 (e.g. `94107`, `941072282`, `94107-2282`). + - description: >- + Required if `city` and `state` are not passed in. If + included, must be formatted as a US ZIP or ZIP+4 (e.g. + `94107`, `941072282`, `94107-2282`). - $ref: '#/components/schemas/zip_code' multiple_components_list: type: object @@ -16379,7 +4996,9 @@ components: pattern: ^us_ver_[a-zA-Z0-9_]+$ primary_number: type: string - description: The numeric or alphanumeric part of an address preceding the street name. Often the house, building, or PO Box number. + description: >- + The numeric or alphanumeric part of an address preceding the street + name. Often the house, building, or PO Box number. street_name: type: string description: The name of the street. @@ -16390,8 +5009,9 @@ components: description: The name of the city. state: type: string - description: | - The ISO 3166-2 two letter code for the state. + description: > + The ISO 3166-2 two letter code for the state. maxLength: 2 zip_code_plus_4: type: string @@ -16404,16 +5024,21 @@ components: - unique - military - '' - description: | + description: > A description of the ZIP code type. For more detailed information about - each ZIP code type, see [US Verification Details](#tag/US-Verification-Types). + + each ZIP code type, see [US Verification + Details](#tag/US-Verification-Types). county: type: string description: County name of the address city. county_fips: type: string - description: | - A 5-digit FIPS county code which uniquely identifies `components[county]`. It consists of a 2-digit state code and a 3-digit county code. + description: > + A 5-digit FIPS county code which uniquely identifies + `components[county]`. It consists of a 2-digit state code and a 3-digit + county code. pattern: \d{5} us_components: type: object @@ -16459,14 +5084,16 @@ components: - SE - NW - '' - description: | - Geographic direction preceding a street name (`N`, `S`, `E`, `W`, `NE`, `SW`, `SE`, `NW`). + description: > + Geographic direction preceding a street name (`N`, `S`, `E`, `W`, + `NE`, `SW`, `SE`, `NW`). street_name: $ref: '#/components/schemas/street_name' street_suffix: type: string - description: | - The standard USPS abbreviation for the street suffix (`ST`, `AVE`, `BLVD`, etc). + description: > + The standard USPS abbreviation for the street suffix (`ST`, `AVE`, + `BLVD`, etc). street_postdirection: type: string enum: @@ -16479,32 +5106,40 @@ components: - SE - NW - '' - description: | - Geographic direction following a street name (`N`, `S`, `E`, `W`, `NE`, `SW`, `SE`, `NW`). + description: > + Geographic direction following a street name (`N`, `S`, `E`, `W`, + `NE`, `SW`, `SE`, `NW`). secondary_designator: type: string - description: | - The standard USPS abbreviation describing the `components[secondary_number]` (`STE`, `APT`, `BLDG`, etc). + description: > + The standard USPS abbreviation describing the + `components[secondary_number]` (`STE`, `APT`, `BLDG`, etc). secondary_number: type: string description: | Number of the apartment/unit/etc. pmb_designator: type: string - description: | - Designator of a CMRA-authorized private mailbox. + description: > + Designator of a CMRA-authorized private mailbox. pmb_number: type: string - description: | - Number of a CMRA-authorized private mailbox. + description: > + Number of a CMRA-authorized private mailbox. extra_secondary_designator: type: string - description: | - An extra (often unnecessary) secondary designator provided with the input address. + description: > + An extra (often unnecessary) secondary designator provided with the + input address. extra_secondary_number: type: string - description: | - An extra (often unnecessary) secondary number provided with the input address. + description: > + An extra (often unnecessary) secondary number provided with the + input address. city: $ref: '#/components/schemas/city' state: @@ -16521,20 +5156,31 @@ components: $ref: '#/components/schemas/zip_code_type' delivery_point_barcode: type: string - description: | - A 12-digit identifier that uniquely identifies a delivery point (location where mail can be sent and received). It consists of the 5-digit ZIP code (`zip_code`), 4-digit ZIP+4 add-on (`zip_code_plus_4`), 2-digit delivery point, and 1-digit delivery point check digit. + description: > + A 12-digit identifier that uniquely identifies a delivery point + (location where mail can be sent and received). It consists of the + 5-digit ZIP code (`zip_code`), 4-digit ZIP+4 add-on + (`zip_code_plus_4`), 2-digit delivery point, and 1-digit delivery + point check digit. address_type: type: string enum: - residential - commercial - '' - description: | - Uses USPS's Residential Delivery Indicator (RDI) to identify + description: > + Uses USPS's Residential Delivery Indicator (RDI) to identify + whether an address is classified as residential or + business. Possible values are: + * `residential` –– The address is residential or a PO Box. + * `commercial` –– The address is commercial. + * `''` –– Not enough information provided to be determined. record_type: type: string @@ -16546,22 +5192,28 @@ components: - rural_route - general_delivery - '' - description: | - A description of the type of address. Populated if a DPV match is made (`deliverability_analysis[dpv_confirmation]` - is `Y`, `S`, or `D`). For more detailed information about each record type, see + description: > + A description of the type of address. Populated if a DPV match is + made (`deliverability_analysis[dpv_confirmation]` + + is `Y`, `S`, or `D`). For more detailed information about each + record type, see + [US Verification Details](#tag/US-Verification-Types). default_building_address: type: boolean - description: | - Designates whether or not the address is the default address for a building containing multiple delivery points. + description: > + Designates whether or not the address is the default address for a + building containing multiple delivery points. county: $ref: '#/components/schemas/county' county_fips: $ref: '#/components/schemas/county_fips' carrier_route: type: string - description: | - A 4-character code assigned to a mail delivery route within a ZIP code. + description: > + A 4-character code assigned to a mail delivery route within a ZIP + code. carrier_route_type: type: string enum: @@ -16570,28 +5222,40 @@ components: - highway_contract - po_box - general_delivery - description: | - The type of `components[carrier_route]`. For more detailed information about - each carrier route type, see [US Verification Details](#tag/US-Verification-Types). + description: > + The type of `components[carrier_route]`. For more detailed + information about + + each carrier route type, see [US Verification + Details](#tag/US-Verification-Types). po_box_only_flag: type: string enum: - 'Y' - 'N' - '' - description: | - Indicates the mailing facility for an address only supports PO Box deliveries and other forms of mail delivery are not available. + description: > + Indicates the mailing facility for an address only supports PO Box + deliveries and other forms of mail delivery are not available. latitude: type: number format: float - description: | - A positive or negative decimal indicating the geographic latitude of the address, specifying the north-to-south position of a location. This should be used with `longitude` to pinpoint locations on a map. Will not be returned for undeliverable addresses or military addresses (state is `AA`, `AE`, or `AP`). + description: > + A positive or negative decimal indicating the geographic latitude of + the address, specifying the north-to-south position of a location. + This should be used with `longitude` to pinpoint locations on a map. + Will not be returned for undeliverable addresses or military + addresses (state is `AA`, `AE`, or `AP`). nullable: true longitude: type: number format: float - description: | - A positive or negative decimal indicating the geographic longitude of the address, specifying the north-to-south position of a location. This should be used with `latitude` to pinpoint locations on a map. Will not be returned for undeliverable addresses or military addresses (state is `AA`, `AE`, or `AP`). + description: > + A positive or negative decimal indicating the geographic longitude + of the address, specifying the north-to-south position of a + location. This should be used with `latitude` to pinpoint locations + on a map. Will not be returned for undeliverable addresses or + military addresses (state is `AA`, `AE`, or `AP`). nullable: true dpv_footnote: type: string @@ -16614,7 +5278,9 @@ components: example: AA deliverability_analysis: type: object - description: A nested object containing a breakdown of the deliverability of an address. + description: >- + A nested object containing a breakdown of the deliverability of an + address. required: - dpv_confirmation - dpv_cmra @@ -16640,14 +5306,24 @@ components: - D - 'N' - '' - description: | - Result of Delivery Point Validation (DPV), which determines whether or not the address is deliverable by the USPS. Possible values are: + description: > + Result of Delivery Point Validation (DPV), which determines whether + or not the address is deliverable by the USPS. Possible values are: + * `Y` –– The address is deliverable by the USPS. - * `S` –– The address is deliverable by removing the provided secondary unit designator. This information may be incorrect or unnecessary. - * `D` –– The address is deliverable to the building's default address but is missing a secondary unit designator and/or number. + + * `S` –– The address is deliverable by removing the provided + secondary unit designator. This information may be incorrect or + unnecessary. + + * `D` –– The address is deliverable to the building's default + address but is missing a secondary unit designator and/or number. There is a chance the mail will not reach the intended recipient. - * `N` –– The address is not deliverable according to the USPS, but parts of the address are valid (such as the street and ZIP code). - * `''` –– This address is not deliverable. No matching street could be found within the city or ZIP code. + * `N` –– The address is not deliverable according to the USPS, but + parts of the address are valid (such as the street and ZIP code). + + * `''` –– This address is not deliverable. No matching street could + be found within the city or ZIP code. example: 'Y' dpv_cmra: type: string @@ -16655,11 +5331,18 @@ components: - 'Y' - 'N' - '' - description: | - Indicates whether or not the address is CMRA-authorized. Possible values are: + description: > + Indicates whether or not the address is CMRA-authorized. Possible values are: + * `Y` –– Address is CMRA-authorized. + * `N` –– Address is not CMRA-authorized. - * `''` –– A DPV match is not made (`deliverability_analysis[dpv_confirmation]` is `N` or an empty string). + + * `''` –– A DPV match is not made + (`deliverability_analysis[dpv_confirmation]` is `N` or an empty + string). example: 'N' dpv_vacant: type: string @@ -16667,11 +5350,17 @@ components: - 'Y' - 'N' - '' - description: | - Indicates that an address was once deliverable, but has become vacant and is no longer receiving deliveries. Possible values are: + description: > + Indicates that an address was once deliverable, but has become + vacant and is no longer receiving deliveries. Possible values are: + * `Y` –– Address is vacant. + * `N` –– Address is not vacant. - * `''` –– A DPV match is not made (`deliverability_analysis[dpv_confirmation]` is `N` or an empty string). + + * `''` –– A DPV match is not made + (`deliverability_analysis[dpv_confirmation]` is `N` or an empty + string). example: 'N' dpv_active: type: string @@ -16679,11 +5368,19 @@ components: - 'Y' - 'N' - '' - description: | - Corresponds to the USPS field `dpv_no_stat`. Indicates that an address has been vacated in the recent past, and is no longer receiving deliveries. If it's been unoccupied for 90+ days, or temporarily vacant, this will be flagged. Possible values are: + description: > + Corresponds to the USPS field `dpv_no_stat`. Indicates that an + address has been vacated in the recent past, and is no longer + receiving deliveries. If it's been unoccupied for 90+ days, or + temporarily vacant, this will be flagged. Possible values are: + * `Y` –– Address is active. + * `N` –– Address is not active. - * `''` –– A DPV match is not made (`deliverability_analysis[dpv_confirmation]` is `N` or an empty string). + + * `''` –– A DPV match is not made + (`deliverability_analysis[dpv_confirmation]` is `N` or an empty + string). example: 'Y' dpv_inactive_reason: type: string @@ -16695,14 +5392,25 @@ components: - '05' - '06' - '' - description: | - Indicates the reason why an address is vacant or no longer receiving deliveries. Possible values are: - * `01` –– Address does not receive mail from the USPS directly, but is serviced by a drop address. + description: > + Indicates the reason why an address is vacant or no longer receiving + deliveries. Possible values are: + + * `01` –– Address does not receive mail from the USPS directly, but + is serviced by a drop address. + * `02` –– Address not yet deliverable. - * `03` –– A DPV match is not made (`deliverability_analysis[dpv_confirmation]` is `N` or an empty string). + + * `03` –– A DPV match is not made + (`deliverability_analysis[dpv_confirmation]` is `N` or an empty + string). + * `04` –– Address is a College, Military Zone, or other type. + * `05` –– Address no longer receives deliveries. + * `06` –– Address is missing required secondary information. + * `''` –– A DPV match is not made or the address is active. example: '06' dpv_throwback: @@ -16711,11 +5419,17 @@ components: - 'Y' - 'N' - '' - description: | - Indicates a street address for which mail is delivered to a PO Box. Possible values are: + description: > + Indicates a street address for which mail is delivered to a PO Box. + Possible values are: + * `Y` –– Address is a PO Box throwback delivery point. + * `N` –– Address is not a PO Box throwback delivery point. - * `''` –– A DPV match is not made (`deliverability_analysis[dpv_confirmation]` is `N` or an empty string). + + * `''` –– A DPV match is not made + (`deliverability_analysis[dpv_confirmation]` is `N` or an empty + string). example: 'N' dpv_non_delivery_day_flag: type: string @@ -16723,19 +5437,33 @@ components: - 'Y' - 'N' - '' - description: | - Indicates whether deliveries are not performed on one or more days of the week at an address. Possible values are: + description: > + Indicates whether deliveries are not performed on one or more days + of the week at an address. Possible values are: + * `Y` –– Mail delivery does not occur on some days of the week. + * `N` –– Mail delivery occurs every day of the week. - * `''` –– A DPV match is not made (`deliverability_analysis[dpv_confirmation]` is `N` or an empty string). + + * `''` –– A DPV match is not made + (`deliverability_analysis[dpv_confirmation]` is `N` or an empty + string). example: 'N' dpv_non_delivery_day_values: type: string - description: | - Indicates days of the week (starting on Sunday) deliveries are not performed at an address. For example: + description: > + Indicates days of the week (starting on Sunday) deliveries are not + performed at an address. For example: + * `YNNNNNN` –– Mail delivery does not occur on Sunday's. + * `NYNNNYN` –– Mail delivery does not occur on Monday's or Friday's. - * `''` –– A DPV match is not made (`deliverability_analysis[dpv_confirmation]` is `N` or an empty string) or address receives mail every day of the week (`deliverability_analysis[dpv_non_delivery_day_flag]` is `N` or an empty string). + + * `''` –– A DPV match is not made + (`deliverability_analysis[dpv_confirmation]` is `N` or an empty + string) or address receives mail every day of the week + (`deliverability_analysis[dpv_non_delivery_day_flag]` is `N` or an + empty string). example: YNNNNNN dpv_no_secure_location: type: string @@ -16743,11 +5471,17 @@ components: - 'Y' - 'N' - '' - description: | - Indicates packages to this address will not be left due to security concerns. Possible values are: + description: > + Indicates packages to this address will not be left due to security + concerns. Possible values are: + * `Y` –– Address does not have a secure mailbox. + * `N` –– Address has a secure mailbox. - * `''` –– A DPV match is not made (`deliverability_analysis[dpv_confirmation]` is `N` or an empty string). + + * `''` –– A DPV match is not made + (`deliverability_analysis[dpv_confirmation]` is `N` or an empty + string). example: 'N' dpv_door_not_accessible: type: string @@ -16755,16 +5489,25 @@ components: - 'Y' - 'N' - '' - description: | - Indicates the door of the address is not accessible for mail delivery. Possible values are: + description: > + Indicates the door of the address is not accessible for mail + delivery. Possible values are: + * `Y` –– Door is not accessible. + * `N` –– Door is accessible. - * `''` –– A DPV match is not made (`deliverability_analysis[dpv_confirmation]` is `N` or an empty string). + + * `''` –– A DPV match is not made + (`deliverability_analysis[dpv_confirmation]` is `N` or an empty + string). example: 'N' dpv_footnotes: type: array - description: | - An array of 2-character strings that gives more insight into how `deliverability_analysis[dpv_confirmation]` was determined. Will always include at least 1 string, and can include up to 3. For details, see [US Verification Details](#tag/US-Verification-Types). + description: > + An array of 2-character strings that gives more insight into how + `deliverability_analysis[dpv_confirmation]` was determined. Will + always include at least 1 string, and can include up to 3. For + details, see [US Verification Details](#tag/US-Verification-Types). items: $ref: '#/components/schemas/dpv_footnote' example: @@ -16772,8 +5515,12 @@ components: - BB ews_match: type: boolean - description: | - Indicates whether or not an address has been flagged in the Early Warning System, meaning the address is under development and not yet ready to receive mail. However, it should become available in a few months. + description: > + Indicates whether or not an address has been flagged in the Early Warning System, meaning the address is + under development and not yet ready to receive mail. However, it + should become available in a few months. example: false lacs_indicator: type: string @@ -16781,24 +5528,47 @@ components: - 'Y' - 'N' - '' - description: | + description: > Indicates whether this address has been converted by - LACSLink. - LACSLink corrects outdated addresses into their modern counterparts. + + LACSLink. + + LACSLink corrects outdated addresses into their modern + counterparts. + Possible values are: - * `Y` –– New address produced with a matching record in LACSLink. - * `N` –– New address could not be produced with a matching record in LACSLink. - * `''` –– A DPV match is not made (`deliverability_analysis[dpv_confirmation]` is `N` or an empty string). + + * `Y` –– New address produced with a matching record in + LACSLink. + + * `N` –– New address could not be produced with a matching record in + LACSLink. + + * `''` –– A DPV match is not made + (`deliverability_analysis[dpv_confirmation]` is `N` or an empty + string). example: '' lacs_return_code: type: string - description: | - A code indicating how `deliverability_analysis[lacs_indicator]` was determined. + description: > + A code indicating how `deliverability_analysis[lacs_indicator]` was + determined. + Possible values are: - * `A` — A new address was produced because a match was found in LACSLink. - * `92` — A LACSLink record was matched after dropping secondary information. - * `14` — A match was found in LACSLink, but could not be converted to a deliverable address. - * `00` — A match was not found in LACSLink, and no new address was produced. + + * `A` — A new address was produced because a match was found in + LACSLink. + + * `92` — A LACSLink record was matched after dropping + secondary information. + + * `14` — A match was found in LACSLink, but could not be + converted to a deliverable address. + + * `00` — A match was not found in LACSLink, and no new + address was produced. + * `''` — LACSLink was not attempted. example: '' suite_return_code: @@ -16807,18 +5577,33 @@ components: - A - '00' - '' - description: | - A return code that indicates whether the address was matched and corrected by - SuiteLink. - SuiteLink attempts to provide secondary information to business addresses. + description: > + A return code that indicates whether the address was matched and + corrected by + + SuiteLink. + + SuiteLink attempts to provide secondary information to + business addresses. + Possible values are: - * `A` –– A SuiteLink match was found and secondary information was added. - * `00` –– A SuiteLink match could not be found and no secondary information was added. + + * `A` –– A SuiteLink match was found and secondary + information was added. + + * `00` –– A SuiteLink match could not be found and no + secondary information was added. + * `''` –– SuiteLink lookup was not attempted. example: '' lob_confidence_score: type: object - description: Lob Confidence Score is a nested object that provides a numerical value between 0-100 of the likelihood that an address is deliverable based on Lob’s mail delivery data to over half of US households. + description: >- + Lob Confidence Score is a nested object that provides a numerical value + between 0-100 of the likelihood that an address is deliverable based on + Lob’s mail delivery data to over half of US households. required: - score - level @@ -16827,8 +5612,11 @@ components: type: number nullable: true format: float - description: | - A numerical score between 0 and 100 that represents the percentage of mailpieces Lob has sent to this addresses that have been delivered successfully over the past 2 years. Will be `null` if no tracking data exists for this address. + description: > + A numerical score between 0 and 100 that represents the percentage + of mailpieces Lob has sent to this addresses that have been + delivered successfully over the past 2 years. Will be `null` if no + tracking data exists for this address. default: null minimum: 0 maximum: 100 @@ -16839,8 +5627,9 @@ components: - medium - low - '' - description: | - Indicates the likelihood that the address is a valid, mail-receiving address. Possible values are: + description: > + Indicates the likelihood that the address is a valid, mail-receiving + address. Possible values are: - `high` — Over 70% of mailpieces Lob has sent to this address were delivered successfully and recent mailings were also successful. - `medium` — Between 40% and 70% of mailpieces Lob has sent to this address were delivered successfully. - `low` — Less than 40% of mailpieces Lob has sent to this address were delivered successfully and recent mailings weren't successful. @@ -16874,22 +5663,43 @@ components: - deliverable_incorrect_unit - deliverable_missing_unit - undeliverable - description: | + description: > Summarizes the deliverability of the `us_verification` object. - For full details, see the `deliverability_analysis` field. Possible values are: + + For full details, see the `deliverability_analysis` field. Possible + values are: + * `deliverable` – The address is deliverable by the USPS. - * `deliverable_unnecessary_unit` – The address is deliverable, but the secondary unit information is unnecessary. - * `deliverable_incorrect_unit` – The address is deliverable to the building's default address but the secondary unit provided may not exist. There is a chance the mail will not reach the intended recipient. - * `deliverable_missing_unit` – The address is deliverable to the building's default address but is missing secondary unit information. There is a chance the mail will not reach the intended recipient. - * `undeliverable` – The address is not deliverable according to the USPS. + + * `deliverable_unnecessary_unit` – The address is deliverable, but + the secondary unit information is unnecessary. + + * `deliverable_incorrect_unit` – The address is deliverable to the + building's default address but the secondary unit provided may not + exist. There is a chance the mail will not reach the intended + recipient. + + * `deliverable_missing_unit` – The address is deliverable to the + building's default address but is missing secondary unit + information. There is a chance the mail will not reach the intended + recipient. + + * `undeliverable` – The address is not deliverable according to the + USPS. valid_address: type: boolean enum: - true - false - description: | - This field indicates whether an address was found in a more comprehensive address dataset that includes sources from the USPS, open source mapping data, and our proprietary mail delivery data. - This field can be interpreted as a representation of whether an address is a real location or not. Additionally a valid address may contradict the deliverability field since an address can be a real valid location but the USPS may not deliver to that address. + description: > + This field indicates whether an address was found in a more + comprehensive address dataset that includes sources from the USPS, + open source mapping data, and our proprietary mail delivery data. + + This field can be interpreted as a representation of whether an + address is a real location or not. Additionally a valid address may + contradict the deliverability field since an address can be a real + valid location but the USPS may not deliver to that address. components: $ref: '#/components/schemas/us_components' deliverability_analysis: @@ -16915,7 +5725,9 @@ components: - $ref: '#/components/schemas/us_verification' - $ref: '#/components/schemas/error' errors: - description: Indicates whether any errors occurred during the verification process. + description: >- + Indicates whether any errors occurred during the verification + process. type: boolean primary_line: type: string @@ -16969,7 +5781,9 @@ components: pattern: ^intl_ver_[a-zA-Z0-9]+$ country_short: type: string - description: The country of the address. Will be returned as a 2 letter country short-name code (ISO 3166). + description: >- + The country of the address. Will be returned as a 2 letter country + short-name code (ISO 3166). example: CA intl_components: type: object @@ -17010,15 +5824,30 @@ components: - STREET - LOCALITY - SPARSE - description: | - The coverage level for the country. This represents the maximum level of + description: > + The coverage level for the country. This represents the maximum + level of + accuracy an input address can be verified to. - * `SUBBUILDING` - Coverage down to unit numbers. For example, in an apartment or a large building - * `HOUSENUMBER/BUILDING` - Coverage down to house number. For example, the address where a house or building may be located - * `STREET` - Coverage down to street. This means that we can verify that an street exists in a city, state, country - * `LOCALITY` - Coverage down to city, state, or village or province. This means that we can verify that a city, village, province, or state exists in a country. Countries differ in how they define what is a province, state, city, village, etc. This attempts to group eveyrthing together. - * `SPARSE` - Some addresses for this country exist in our databases + + * `SUBBUILDING` - Coverage down to unit numbers. For example, in + an apartment or a large building + + * `HOUSENUMBER/BUILDING` - Coverage down to house number. For + example, the address where a house or building may be located + + * `STREET` - Coverage down to street. This means that we can + verify that an street exists in a city, state, country + + * `LOCALITY` - Coverage down to city, state, or village or + province. This means that we can verify that a city, village, + province, or state exists in a country. Countries differ in how + they define what is a province, state, city, village, etc. This + attempts to group eveyrthing together. + + * `SPARSE` - Some addresses for this country exist in our + databases deliverability: type: string enum: @@ -17026,12 +5855,21 @@ components: - deliverable_missing_info - undeliverable - no_match - description: | - Summarizes the deliverability of the `intl_verification` object. Possible values are: + description: > + Summarizes the deliverability of the `intl_verification` object. + Possible values are: + * `deliverable` — The address is deliverable. - * `deliverable_missing_info` — The address is missing some information, but is most likely deliverable. - * `undeliverable` — The address is most likely not deliverable. Some components of the address (such as city or postal code) may have been found. - * `no_match` — This address is not deliverable. No matching street could be found within the city or postal code. + + * `deliverable_missing_info` — The address is missing some + information, but is most likely deliverable. + + * `undeliverable` — The address is most likely not deliverable. + Some components of the address (such as city or postal code) may + have been found. + + * `no_match` — This address is not deliverable. No matching + street could be found within the city or postal code. status: type: string enum: @@ -17047,22 +5885,51 @@ components: - LM3 - LM2 - LU1 - description: | - The status level for the country. This represents the maximum level of + description: > + The status level for the country. This represents the maximum + level of + accuracy an input address can be verified to. - * `LV4` - Verified. The input data is correct. All input data was able to match in databases. - * `LV3` - Verified. The input data is correct. All input data was able to match in databases after some or all elements were standarized. The input data may also be using outdated city, state, or country names. - * `LV2` - Verified. The input data is correct although some input data is unverifiable due to incomplete data. - * `LV1` - Verified. The input data is acceptable but in an attempt to standarize user input, errors were introduced. - * `LF4` - Fixed. The input data is matched and fixed. (Example: Brighon, UK -> Brighton, UK) - * `LF3` - Fixed. The input data is matched and fixed but some elements such as Subbuilding number and house number cannot be checked. - * `LF2` - Fixed. The input data is matched but some elements such as Street cannot be checked. - * `LF1` - Fixed. The input data is acceptable but in an attempt to standarize user input, errors were introduced. - * `LM4` - Missing Info. The input data cannot be corrected completely. - * `LM3` - Missing Info. The input data cannot be corrected completely and there were multiple matches found in databases. - * `LM2` - Missing Info. The input data cannot be corrected completely and only some elements were found. - * `LU1` - Unverified. The input data cannot be corrected or matched. + + * `LV4` - Verified. The input data is correct. All input data + was able to match in databases. + + * `LV3` - Verified. The input data is correct. All input data + was able to match in databases after some or all + elements were standarized. The input data may also be using + outdated city, state, or country names. + + * `LV2` - Verified. The input data is correct although some + input data is unverifiable due to incomplete data. + + * `LV1` - Verified. The input data is acceptable but in an + attempt to standarize user input, errors were introduced. + + * `LF4` - Fixed. The input data is matched and fixed. (Example: + Brighon, UK -> Brighton, UK) + + * `LF3` - Fixed. The input data is matched and fixed but some + elements such as Subbuilding number and house number cannot be + checked. + + * `LF2` - Fixed. The input data is matched but some elements + such as Street cannot be checked. + + * `LF1` - Fixed. The input data is acceptable but in an attempt + to standarize user input, errors were introduced. + + * `LM4` - Missing Info. The input data cannot be corrected + completely. + + * `LM3` - Missing Info. The input data cannot be corrected + completely and there were multiple matches found in databases. + + * `LM2` - Missing Info. The input data cannot be corrected + completely and only some elements were found. + + * `LU1` - Unverified. The input data cannot be corrected or + matched. components: $ref: '#/components/schemas/intl_components' object: @@ -17084,15 +5951,24 @@ components: - $ref: '#/components/schemas/intl_verification' - $ref: '#/components/schemas/error' errors: - description: Indicates whether any errors occurred during the verification process. + description: >- + Indicates whether any errors occurred during the verification + process. type: boolean cmp_schedule_type: - description: How the campaign should be scheduled. Only value available today is `immediate`. + description: >- + How the campaign should be scheduled. Only value available today is + `immediate`. type: string enum: - immediate cmp_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). + 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 enum: - marketing @@ -17119,12 +5995,16 @@ components: schedule_type: $ref: '#/components/schemas/cmp_schedule_type' target_delivery_date: - description: If `schedule_type` is `target_delivery_date`, provide a targeted delivery date for mail pieces in this campaign. + description: >- + If `schedule_type` is `target_delivery_date`, provide a targeted + delivery date for mail pieces in this campaign. type: string format: date-time nullable: true send_date: - description: If `schedule_type` is `scheduled_send_date`, provide a date to send this campaign. + description: >- + If `schedule_type` is `scheduled_send_date`, provide a date to send + this campaign. type: string format: date-time nullable: true @@ -17137,7 +6017,9 @@ components: use_type: $ref: '#/components/schemas/cmp_use_type' auto_cancel_if_ncoa: - description: Whether or not a mail piece should be automatically canceled and not sent if the address is updated via NCOA. + description: >- + Whether or not a mail piece should be automatically canceled and not + sent if the address is updated via NCOA. type: boolean cmp_id: type: string @@ -17149,11 +6031,18 @@ components: enum: - usps_first_class - usps_standard - description: | + description: > A string designating the mail postage type: + * `usps_first_class` - (default) - * `usps_standard` - a cheaper option which is - less predictable and takes longer to deliver. `usps_standard` cannot be used with `4x6` + + * `usps_standard` - a cheaper option 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 postcard_size: @@ -17162,11 +6051,14 @@ components: - 4x6 - 6x9 - 6x11 - description: | - Specifies the size of the postcard. Only `4x6` postcards can be sent to international destinations. + description: > + Specifies the size of the postcard. Only `4x6` postcards can be sent to + international destinations. default: 4x6 returned: - description: Properties that the postcards in your Creative should have. See the `qr_code` attribute below to add a QR code to your creative. + description: >- + Properties that the postcards in your Creative should have. See the + `qr_code` attribute below to add a QR code to your creative. properties: mail_type: $ref: '#/components/schemas/mail_type' @@ -17195,7 +6087,10 @@ components: - address_zip from_attribute: title: From - description: Must either be an address ID or an inline object with correct address parameters. All addresses will be standardized into uppercase without being modified by verification. + description: >- + Must either be an address ID or an inline object with correct address + parameters. All addresses will be standardized into uppercase without + being modified by verification. oneOf: - $ref: '#/components/schemas/adr_id' - $ref: '#/components/schemas/inline_address_us' @@ -17215,9 +6110,14 @@ components: - insert_blank_page - bottom_first_page_center - bottom_first_page - description: | - Specifies the location of the address information that will show through the double-window envelope. To see how this will impact your letter design, view our letter template. - Some values are exclusive to certain customers. Upgrade to the appropriate Print & Mail Edition to gain access. + description: > + Specifies the location of the address information that will show through + the double-window envelope. To see how this will impact your letter + design, view our letter template. + + Some values are exclusive to certain customers. Upgrade to the + appropriate Print & Mail Edition to gain access. * `top_first_page` - (default) print address information at the top of your provided first page * `insert_blank_page` - insert a blank address page at the beginning of your file (you will be charged for the extra page) * `bottom_first_page_center` - **(exclusive, deprecation planned within a few months)** print address information at the bottom center of your provided first page @@ -17229,7 +6129,9 @@ components: pattern: ^card_[a-zA-Z0-9]+$ custom_envelope_returned: type: object - description: A nested custom envelope object containing more information about the custom envelope used or `null` if a custom envelope was not used. + description: >- + A nested custom envelope object containing more information about the + custom envelope used or `null` if a custom envelope was not used. required: - id - url @@ -17250,10 +6152,14 @@ components: nullable: true color: type: boolean - description: Set this key to `true` if you would like to print in color. Set to `false` if you would like to print in black and white. + description: >- + Set this key to `true` if you would like to print in color. Set to + `false` if you would like to print in black and white. double_sided: type: boolean - description: Set this attribute to `true` for double sided printing, or `false` for for single sided printing. Defaults to `true`. + description: >- + Set this attribute to `true` for double sided printing, or `false` for + for single sided printing. Defaults to `true`. default: true extra_service: type: string @@ -17262,8 +6168,11 @@ components: - certified_return_receipt - registered - null - description: | - Add an extra service to your letter. Can only be non-`null` if `mail_type` isn't `usps_standard`. See pricing for extra costs incurred. + description: > + Add an extra service to your letter. Can only be non-`null` if + `mail_type` isn't `usps_standard`. See pricing for extra costs incurred. * `certified` - track and confirm delivery for domestic destinations. An extra sheet (1 PDF page single-sided or 2 PDF pages double-sided) is added to the beginning of your letter for address and barcode information. See here for templates: #10 envelope and flat envelope (used for letters over 6 pages single-sided or 12 pages double-sided). You will not be charged for this extra sheet. * `certified_return_receipt` - request an electronic copy of the recipient's signature to prove delivery of your certified letter * `registered` - provides tracking and confirmation for international addresses @@ -17271,12 +6180,16 @@ components: Not available for `us_legal` letter size. nullable: true letter_details_returned: - description: Properties that the letters in your Creative should have. See the `qr_code` attribute below to add a QR code to your creative. + description: >- + Properties that the letters in your Creative should have. See the + `qr_code` attribute below to add a QR code to your creative. properties: address_placement: $ref: '#/components/schemas/address_placement' buckslips: - description: A single-element array containing an existing buckslip id in a string format. See [buckslips](#tag/Buckslips) for more information. + description: >- + A single-element array containing an existing buckslip id in a + string format. See [buckslips](#tag/Buckslips) for more information. type: array items: $ref: '#/components/schemas/buckslip_id' @@ -17284,7 +6197,9 @@ components: maxItems: 1 nullable: true cards: - description: A single-element array containing an existing card id in a string format. See [cards](#tag/Cards) for more information. + description: >- + A single-element array containing an existing card id in a string + format. See [cards](#tag/Cards) for more information. type: array items: $ref: '#/components/schemas/card_id' @@ -17311,10 +6226,14 @@ components: - 11x9_bifold - 12x9_bifold - 17.75x9_trifold - description: Specifies the size of the self mailer. The `17.75x9_trifold` size is in beta. Contact support@lob.com or your account contact to learn more. + description: >- + Specifies the size of the self mailer. The `17.75x9_trifold` size is in + beta. Contact support@lob.com or your account contact to learn more. default: 6x18_bifold self_mailer_details_returned: - description: Properties that the self mailers in your Creative should have. See the `qr_code` attribute below to add a QR code to your creative. + description: >- + Properties that the self mailers in your Creative should have. See the + `qr_code` attribute below to add a QR code to your creative. properties: mail_type: $ref: '#/components/schemas/mail_type' @@ -17407,10 +6326,14 @@ components: type: boolean default: true creatives: - description: An array of creatives that have been associated with this campaign. + description: >- + An array of creatives that have been associated with this + campaign. type: array uploads: - description: A single-element array containing the upload object that is assocated with this campaign. + description: >- + A single-element array containing the upload object that is + assocated with this campaign. type: array minItems: 0 maxItems: 1 @@ -17477,13 +6400,19 @@ components: template_preview_urls: title: Template Preview URLs type: object - description: Preview URLs associated with a creative's artwork asset(s) if the creative uses HTML templates as assets. An empty object will be returned if no `template_preview`s have been generated. + description: >- + Preview URLs associated with a creative's artwork asset(s) if + the creative uses HTML templates as assets. An empty object will + be returned if no `template_preview`s have been generated. template_previews: title: Template Previews type: array items: type: object - description: A list of template preview objects if the creative uses HTML template(s) as artwork asset(s). An empty array will be returned if no `template_preview`s have been generated for the creative. + description: >- + A list of template preview objects if the creative uses HTML + template(s) as artwork asset(s). An empty array will be returned + if no `template_preview`s have been generated for the creative. campaigns: $ref: '#/components/schemas/campaign_list' object: @@ -17506,34 +6435,48 @@ components: type: string nullable: true default: null - description: The column header from the csv file that should be mapped to the required field `name` + description: >- + The column header from the csv file that should be mapped to the + required field `name` address_line1: type: string nullable: true default: null - description: The column header from the csv file that should be mapped to the required field `address_line1` + description: >- + The column header from the csv file that should be mapped to the + required field `address_line1` address_city: type: string nullable: true default: null - description: The column header from the csv file that should be mapped to the required field `address_city` + description: >- + The column header from the csv file that should be mapped to the + required field `address_city` address_state: type: string nullable: true default: null - description: The column header from the csv file that should be mapped to the required field `address_state` + description: >- + The column header from the csv file that should be mapped to the + required field `address_state` address_zip: type: string nullable: true default: null - description: The column header from the csv file that should be mapped to the required field `address_zip` + description: >- + The column header from the csv file that should be mapped to the + required field `address_zip` example: name: recipient_name address_line1: primary_line address_city: city address_state: state address_zip: zip_code - description: The mapping of column headers in your file to Lob-required fields for the resource created. See our Campaign Audience Guide for additional details. + description: >- + The mapping of column headers in your file to Lob-required fields for + the resource created. See our Campaign Audience Guide for additional details. optional_address_column_mapping: title: Optional Address Columns type: object @@ -17546,22 +6489,32 @@ components: type: string nullable: true default: null - description: The column header from the csv file that should be mapped to the optional field "address_line2" + description: >- + The column header from the csv file that should be mapped to the + optional field "address_line2" company: type: string nullable: true default: null - description: The column header from the csv file that should be mapped to the optional field "company" + description: >- + The column header from the csv file that should be mapped to the + optional field "company" address_country: type: string nullable: true default: null - description: The column header from the csv file that should be mapped to the optional field "address_country" + description: >- + The column header from the csv file that should be mapped to the + optional field "address_country" example: address_line2: secondary_line company: company address_country: country, - description: The mapping of column headers in your file to Lob-optional fields for the resource created. See our Campaign Audience Guide for additional details. + description: >- + The mapping of column headers in your file to Lob-optional fields for + the resource created. See our Campaign Audience Guide for additional details. uploads_metadata: title: Metadata type: object @@ -17570,7 +6523,9 @@ components: properties: columns: type: array - description: The list of column names from the csv file which you want associated with each of your mailpieces + description: >- + The list of column names from the csv file which you want associated + with each of your mailpieces default: [] items: type: string @@ -17579,7 +6534,11 @@ components: example: columns: - recipient_name - description: The list of column headers in your file as an array that you want as metadata associated with each mailpiece. See our Campaign Audience Guide for additional details. + description: >- + The list of column headers in your file as an array that you want as + metadata associated with each mailpiece. See our Campaign Audience Guide for additional details. merge_variable_column_mapping: title: Merge Variable Mapping type: object @@ -17589,7 +6548,21 @@ components: name: recipient_name gift_code: code qr_code_redirect_url: redirect_url - description: The mapping of column headers in your file to the merge variables present in your creative. See our Campaign Audience Guide for additional details.
If a merge variable has the same "name" as a "key" in the `requiredAddressColumnMapping` or `optionalAddressColumnMapping` objects, then they **CANNOT** have a different value in this object. If a different value is provided, then when the campaign is processing it will get overwritten with the mapped value present in the `requiredAddressColumnMapping` or `optionalAddressColumnMapping` objects. The redirect URLs for QR codes can also be customized using this mapping. If the URL has a variable and the variable mapping existsing here, then data from the respective column in the audience file will be merged into the URL template. + description: >- + The mapping of column headers in your file to the merge variables + present in your creative. See our Campaign Audience Guide for additional details.
If a merge variable has the same "name" as a "key" in the + `requiredAddressColumnMapping` or `optionalAddressColumnMapping` + objects, then they **CANNOT** have a different value in this object. If + a different value is provided, then when the campaign is processing it + will get overwritten with the mapped value present in the + `requiredAddressColumnMapping` or `optionalAddressColumnMapping` + objects. The redirect URLs for QR codes can also be customized using + this mapping. If the URL has a variable and the variable mapping + existsing here, then data from the respective column in the audience + file will be merged into the URL template. upload_writable: type: object required: @@ -17626,7 +6599,11 @@ components: - Errored default: Draft type: string - description: The `state` property on the `upload` object. As the file is processed, the `state` will change from `Ready for Validation` to `Validating` and then will be either `Scheduled` (successfully processed) or `Errored` (Unsuccessfully processed). + description: >- + The `state` property on the `upload` object. As the file is processed, + the `state` will change from `Ready for Validation` to `Validating` and + then will be either `Scheduled` (successfully processed) or `Errored` + (Unsuccessfully processed). upload: allOf: - $ref: '#/components/schemas/upload_writable' @@ -17660,7 +6637,9 @@ components: - test - live type: string - description: The environment in which the mailpieces were created. Today, will only be `live`. + description: >- + The environment in which the mailpieces were created. Today, + will only be `live`. failuresUrl: title: Failures URL type: string @@ -17697,12 +6676,16 @@ components: title: Date Created type: string format: date-time - description: A timestamp in ISO 8601 format of the date the upload was created + description: >- + A timestamp in ISO 8601 format of the date the upload was + created dateModified: title: Date Modified type: string format: date-time - description: A timestamp in ISO 8601 format of the date the upload was last modified + description: >- + A timestamp in ISO 8601 format of the date the upload was last + modified campaign: allOf: - $ref: '#/components/schemas/lob_base' @@ -17729,13 +6712,17 @@ components: type: boolean default: true creatives: - description: An array of creatives that have been associated with this campaign. + description: >- + An array of creatives that have been associated with this + campaign. type: array items: $ref: '#/components/schemas/creative' minItems: 0 uploads: - description: A single-element array containing the upload object that is assocated with this campaign. + description: >- + A single-element array containing the upload object that is + assocated with this campaign. type: array items: $ref: '#/components/schemas/upload' @@ -17760,11 +6747,15 @@ components: schedule_type: $ref: '#/components/schemas/cmp_schedule_type' target_delivery_date: - description: If `schedule_type` is `target_delivery_date`, provide a targeted delivery date for mail pieces in this campaign. + description: >- + If `schedule_type` is `target_delivery_date`, provide a targeted + delivery date for mail pieces in this campaign. type: string format: date-time send_date: - description: If `schedule_type` is `scheduled_send_date`, provide a date to send this campaign. + description: >- + If `schedule_type` is `scheduled_send_date`, provide a date to send + this campaign. type: string format: date-time cancel_window_campaign_minutes: @@ -17773,12 +6764,16 @@ components: metadata: $ref: '#/components/schemas/metadata' is_draft: - description: Whether or not the campaign is still a draft. Can either be excluded or `false`. + description: >- + Whether or not the campaign is still a draft. Can either be excluded + or `false`. type: boolean use_type: $ref: '#/components/schemas/cmp_use_type' auto_cancel_if_ncoa: - description: Whether or not a mail piece should be automatically canceled and not sent if the address is updated via NCOA. + description: >- + Whether or not a mail piece should be automatically canceled and not + sent if the address is updated via NCOA. type: boolean card_description: type: string @@ -17906,7 +6901,8 @@ components: oneOf: - $ref: '#/components/schemas/remote_file_url' - $ref: '#/components/schemas/local_file_path' - default: https://s3.us-west-2.amazonaws.com/public.lob.com/assets/card_blank_horizontal.pdf + default: >- + https://s3.us-west-2.amazonaws.com/public.lob.com/assets/card_blank_horizontal.pdf card_updatable: type: object properties: @@ -17916,12 +6912,17 @@ components: description: Allows for auto reordering type: boolean reorder_quantity: - description: The quantity of items to be reordered (only required when auto_reorder is true). + description: >- + The quantity of items to be reordered (only required when + auto_reorder is true). type: number minimum: 10000 maximum: 10000000 card_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. + 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/card_id' @@ -17967,7 +6968,9 @@ components: availability_date: type: string format: date-time - description: A timestamp in ISO 8601 format of the date the resource was created. + description: >- + A timestamp in ISO 8601 format of the date the resource was + created. expected_availability_date: type: string format: date-time @@ -17984,7 +6987,17 @@ components: maximum: 10000000 send_date: type: string - description: A timestamp in ISO 8601 format which specifies a date after the current time and up to 180 days in the future to send the letter off for production. Setting a send date overrides the default [cancellation window](#section/Cancellation-Windows) applied to the mailpiece. Until the `send_date` has passed, the mailpiece can be canceled. If a date in the format `2017-11-01` is passed, it will evaluate to midnight UTC of that date (`2017-11-01T00:00:00.000Z`). If a datetime is passed, that exact time will be used. A `send_date` passed with no time zone will default to UTC, while a `send_date` passed with a time zone will be converted to UTC. + description: >- + A timestamp in ISO 8601 format which specifies a date after the current + time and up to 180 days in the future to send the letter off for + production. Setting a send date overrides the default [cancellation + window](#section/Cancellation-Windows) applied to the mailpiece. Until + the `send_date` has passed, the mailpiece can be canceled. If a date in + the format `2017-11-01` is passed, it will evaluate to midnight UTC of + that date (`2017-11-01T00:00:00.000Z`). If a datetime is passed, that + exact time will be used. A `send_date` passed with no time zone will + default to UTC, while a `send_date` passed with a time zone will be + converted to UTC. anyOf: - format: date-time - format: date @@ -17994,14 +7007,37 @@ components: - processed - rendered - failed - description: | + 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. + + * `failed` - one or more issues has caused the rendering process to + fail. merge_variables: type: object - 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 our guide to using html and merge variables. Depending on your Merge Variable strictness 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.' + 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 our guide to using html and merge variables. + Depending on your Merge Variable strictness 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 nullable: true editable_no_mailtype: @@ -18016,7 +7052,12 @@ components: send_date: $ref: '#/components/schemas/send_date' chk_use_type: - description: TThe 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). + description: >- + TThe 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 enum: - marketing @@ -18040,15 +7081,23 @@ components: maxLength: 40 nullable: true check_number: - description: |- + description: >- An integer that designates the check number. - If `check_number` is not provided, checks created from a new `bank_account` will start at `10000` and increment with each check created with the `bank_account`. - A provided `check_number` overrides the defaults. Subsequent checks created with the same `bank_account` will increment from the provided check number. + + If `check_number` is not provided, checks created from a new + `bank_account` will start at `10000` and increment with each + check created with the `bank_account`. + + A provided `check_number` overrides the defaults. Subsequent + checks created with the same `bank_account` will increment from + the provided check number. type: integer minimum: 1 maximum: 500000000 message: - description: Max of 400 characters to be included at the bottom of the check page. + description: >- + Max of 400 characters to be included at the bottom of the check + page. type: string maxLength: 400 use_type: @@ -18064,7 +7113,9 @@ components: pattern: ^chk_[a-zA-Z0-9]+$ tmpl_id: type: string - description: Unique identifier prefixed with `tmpl_`. ID of a saved [HTML template](#section/HTML-Templates). + description: >- + Unique identifier prefixed with `tmpl_`. ID of a saved [HTML + template](#section/HTML-Templates). pattern: ^tmpl_[a-zA-Z0-9]+$ vrsn_id: type: string @@ -18100,14 +7151,23 @@ components: $ref: '#/components/schemas/resource_description' name: type: string - 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. + 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 nullable: true company: type: string - 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. This field can be used for any secondary recipient information which is not part of the actual mailing address (Company Name, Department, Attention Line, etc). + 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. This field can be used for + any secondary recipient information which is not part of the + actual mailing address (Company Name, Department, Attention + Line, etc). maxLength: 40 nullable: true phone: @@ -18126,7 +7186,9 @@ components: maxLength: 50 address_line2: type: string - description: An optional field containing any information which can't fit into line 1. + description: >- + An optional field containing any information which can't fit + into line 1. maxLength: 50 nullable: true address_city: @@ -18138,8 +7200,9 @@ components: pattern: ^[a-zA-Z]{2}$ address_zip: type: string - description: | - Must follow the ZIP format of `12345` or ZIP+4 format of `12345-1234`. + description: > + Must follow the ZIP format of `12345` or ZIP+4 format of + `12345-1234`. pattern: ^\d{5}(-\d{4})?$ address_country: type: string @@ -18152,8 +7215,18 @@ components: $ref: '#/components/schemas/metadata' recipient_moved: type: boolean - description: | - Only returned for accounts on certain Print & Mail Editions. Value is `true` if the address was altered because the recipient filed for a National Change of Address Linkage (NCOALink), `false` if the NCOALink check was run but no altered address was found, and `null` if the NCOALink check was not run. The NCOALink check does not happen for non-US addresses, for non-deliverable US addresses, or for addresses created before the NCOALink feature was added to your account. + description: > + Only returned for accounts on certain Print & Mail Editions. Value is `true` + if the address was altered because the recipient filed for a National Change of + Address Linkage (NCOALink), `false` if the NCOALink check + was run but no altered address was found, and `null` if the + NCOALink check was not run. The NCOALink check does not happen + for non-US addresses, for non-deliverable US addresses, or for + addresses created before the NCOALink feature was added to your + account. nullable: true example: id: adr_e68217bd744d65c8 @@ -18175,7 +7248,9 @@ components: object: address expected_delivery_date: type: string - description: A date in YYYY-MM-DD format of the mailpiece's expected delivery date based on its `send_date`. + description: >- + A date in YYYY-MM-DD format of the mailpiece's expected delivery date + based on its `send_date`. format: date evnt_id: type: string @@ -18183,7 +7258,10 @@ components: pattern: ^evnt_[a-zA-Z0-9]+$ 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. + 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 @@ -18195,7 +7273,9 @@ components: time: type: string format: date-time - description: A timestamp in ISO 8601 format of the date USPS registered the event. + description: >- + A timestamp in ISO 8601 format of the date USPS registered the + event. date_created: $ref: '#/components/schemas/date_created' date_modified: @@ -18216,7 +7296,9 @@ components: - name properties: type: - description: non-Certified postcards, self mailers, letters, checks and snap packs + description: >- + non-Certified postcards, self mailers, letters, checks and snap + packs type: string enum: - normal @@ -18231,8 +7313,9 @@ components: - Re-Routed - Returned to Sender - International Exit - description: | - Name of tracking event (for normal postcards, self mailers, letters, checks and snap packs): + description: > + Name of tracking event (for normal postcards, self mailers, + letters, checks and snap packs): * `Mailed` - The mailpiece has been handed off to and accepted by USPS and is en route. More about @@ -18266,7 +7349,9 @@ components: scan a US-originated international mail piece will receive from the USPS. - More about tracking + More about tracking details: description: Will be `null` for `type=normal` events type: object @@ -18275,8 +7360,9 @@ components: nullable: true location: type: string - description: | - The zip code in which the scan event occurred. Null for `Mailed` events. + description: > + The zip code in which the scan event occurred. Null for `Mailed` + events. nullable: true failure_reason_error: type: object @@ -18312,7 +7398,9 @@ components: nullable: true failure_reason: type: object - description: An object describing the reason for failure if the resource failed to render. + description: >- + An object describing the reason for failure if the resource failed to + render. properties: remediation: type: string @@ -18353,7 +7441,9 @@ components: $ref: '#/components/schemas/bank_account' check_bottom_template_id: allOf: - - description: The unique ID of the HTML template used for the check bottom. + - description: >- + The unique ID of the HTML template used for the check + bottom. - $ref: '#/components/schemas/tmpl_id' attachment_template_id: allOf: @@ -18361,12 +7451,16 @@ components: - $ref: '#/components/schemas/tmpl_id' check_bottom_template_version_id: allOf: - - description: The unique ID of the specific version of the HTML template used for the check bottom. + - description: >- + The unique ID of the specific version of the HTML template + used for the check bottom. type: string - $ref: '#/components/schemas/vrsn_id' attachment_template_version_id: allOf: - - description: The unique ID of the specific version of the HTML template used for the attachment. + - description: >- + The unique ID of the specific version of the HTML template + used for the attachment. type: string - $ref: '#/components/schemas/vrsn_id' url: @@ -18385,7 +7479,9 @@ components: expected_delivery_date: $ref: '#/components/schemas/expected_delivery_date' tracking_events: - description: An array of tracking_event objects ordered by ascending `time`. Will not be populated for checks created in test mode. + description: >- + An array of tracking_event objects ordered by ascending `time`. + Will not be populated for checks created in test mode. type: array items: $ref: '#/components/schemas/tracking_event_normal' @@ -18430,8 +7526,11 @@ components: $ref: '#/components/schemas/resource_description' name: type: string - 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. + 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 nullable: true company: @@ -18442,7 +7541,9 @@ components: maxLength: 50 address_line2: type: string - description: An optional field for address unit information. Total string sum of this plus `address_line1` may not exceed 50 characters. + description: >- + An optional field for address unit information. Total string sum + of this plus `address_line1` may not exceed 50 characters. maxLength: 50 nullable: true address_city: @@ -18454,8 +7555,9 @@ components: pattern: ^[a-zA-Z]{2}$ address_zip: type: string - description: | - Must follow the ZIP format of `12345` or ZIP+4 format of `12345-1234`. + description: > + Must follow the ZIP format of `12345` or ZIP+4 format of + `12345-1234`. pattern: ^\d{5}(-\d{4})?$ phone: type: string @@ -18478,7 +7580,25 @@ components: type: object properties: to: - description: Must either be an address ID or an inline object with correct address parameters. Checks cannot be sent internationally (`address_country` must be `US`). The total string of the sum of `address_line1` and `address_line2` must be no longer than 50 characters combined. If an object is used, an address will be created, corrected, and standardized for free whenever possible using our US Address Verification engine, and returned back with an ID. Depending on your Print & Mail Edition, addresses may also be run through [National Change of Address (NCOALink)](#tag/National-Change-of-Address). If an address used does not meet your account’s US Mail Strictness Setting, the request will fail. More about verification of mailing addresses + description: >- + Must either be an address ID or an inline object with correct + address parameters. Checks cannot be sent internationally + (`address_country` must be `US`). The total string of the sum of + `address_line1` and `address_line2` must be no longer than 50 + characters combined. If an object is used, an address will be + created, corrected, and standardized for free whenever possible + using our US Address Verification engine, and returned back with an + ID. Depending on your Print & Mail Edition, addresses may also be run + through [National Change of Address + (NCOALink)](#tag/National-Change-of-Address). If an address used + does not meet your account’s US Mail Strictness Setting, the request will + fail. More about verification of mailing addresses oneOf: - $ref: '#/components/schemas/adr_id' - $ref: '#/components/schemas/inline_address_us_chk' @@ -18488,14 +7608,23 @@ components: maxLength: 10000 pattern: < check_bottom: - description: |- + description: >- The artwork to use on the bottom of the check page. + Notes: + - HTML merge variables should not include delimiting whitespace. - - PDF, PNG, and JPGs must be sized at 8.5"x11" at 300 DPI, while supplied HTML will be rendered and trimmed to fit on a 8.5"x11" page. + + - PDF, PNG, and JPGs must be sized at 8.5"x11" at 300 DPI, while + supplied HTML will be rendered and trimmed to fit on a 8.5"x11" page. + - The check bottom will always be printed in black & white. - - Must conform to this template. + + - Must conform to this template. + Need more help? Consult our [HTML examples](#section/HTML-Examples). oneOf: @@ -18505,7 +7634,10 @@ components: - $ref: '#/components/schemas/local_file_path' 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 Billing Group API for more information. + 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 Billing Group API for more information. check_editable_props: allOf: - $ref: '#/components/schemas/check_base' @@ -18519,7 +7651,12 @@ components: - use_type properties: from: - description: Must either be an address ID or an inline object with correct address parameters. Must either be an address ID or an inline object with correct address parameters. All addresses will be standardized into uppercase without being modified by verification. + description: >- + Must either be an address ID or an inline object with correct + address parameters. Must either be an address ID or an inline + object with correct address parameters. All addresses will be + standardized into uppercase without being modified by + verification. oneOf: - $ref: '#/components/schemas/adr_id' - $ref: '#/components/schemas/inline_address_us' @@ -18529,13 +7666,17 @@ components: - type: string description: The id for a verified bank account. amount: - description: The payment amount to be sent in US dollars. Amounts will be rounded to two decimal places. + description: >- + The payment amount to be sent in US dollars. Amounts will be + rounded to two decimal places. type: number format: float maximum: 999999.99 logo: - description: |- - Accepts a remote URL or local file upload to an image to print (in grayscale) in the upper-left corner of your check. Image requirements: + description: >- + Accepts a remote URL or local file upload to an image to print + (in grayscale) in the upper-left corner of your check. Image + requirements: * RGB or CMYK @@ -18554,17 +7695,31 @@ components: check_bottom: $ref: '#/components/schemas/check_bottom' attachment: - description: |- + description: >- A document to include with the check. + Notes: + - HTML merge variables should not include delimiting whitespace. - - All pages of PDF, PNG, and JPGs must be sized at 8.5"x11" at 300 DPI, while supplied HTML will be rendered and trimmed to as many 8.5"x11" pages as necessary. + + - All pages of PDF, PNG, and JPGs must be sized at 8.5"x11" at + 300 DPI, while supplied HTML will be rendered and trimmed to as + many 8.5"x11" pages as necessary. + - If a PDF is provided, it must be 6 pages or fewer. - - The attachment will be printed double-sided in black & white and will be included in the envelope after the check page. - - Please follow these design guidelines. - See pricing for extra costs incurred. Need more help? Consult our [HTML examples](#section/HTML-Examples). + - The attachment will be printed double-sided in black & white + and will be included in the envelope after the check page. + + - Please follow these design guidelines. + + + See pricing for extra costs incurred. Need more + help? Consult our [HTML examples](#section/HTML-Examples). oneOf: - $ref: '#/components/schemas/html_string' - $ref: '#/components/schemas/tmpl_id' @@ -18587,32 +7742,48 @@ components: - check_bottom - $ref: '#/components/schemas/check_editable_props' check_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. + 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/chk_id' deleted: $ref: '#/components/schemas/deleted' crv_front: - description: | + description: > The artwork to use as the front of your postcard. + Notes: + - HTML merge variables should not include delimiting whitespace. - - PDF, PNG, and JPGs must be sized at 4.25"x6.25", 6.25"x9.25", or 6.25"x11.25" at 300 DPI, while supplied HTML template will be rendered to the specified `size`. + + - PDF, PNG, and JPGs must be sized at 4.25"x6.25", 6.25"x9.25", or + 6.25"x11.25" at 300 DPI, while supplied HTML template will be rendered + to the specified `size`. + See [here](#section/HTML-Examples) for HTML examples. oneOf: - $ref: '#/components/schemas/tmpl_id' - $ref: '#/components/schemas/local_file_path' crv_back: - description: | + description: > The artwork to use as the back of your postcard creative. + Notes: + - HTML merge variables should not include delimiting whitespace. - - PDF, PNG, and JPGs must be sized at 4.25"x6.25", 6.25"x9.25", or 6.25"x11.25" at 300 DPI, while supplied HTML template will be rendered to the specified `size`. - - Be sure to leave room for address and postage information by following the templates provided here: + + - PDF, PNG, and JPGs must be sized at 4.25"x6.25", 6.25"x9.25", or + 6.25"x11.25" at 300 DPI, while supplied HTML template will be rendered + to the specified `size`. + + - Be sure to leave room for address and postage information by following + the templates provided here: - 4x6 template - 6x9 template - 6x11 template @@ -18624,7 +7795,14 @@ components: - $ref: '#/components/schemas/local_file_path' qr_code_campaigns: type: object - description: Customize and place a QR code on all the postcards, letters or self mailers in a campaign. Redirect URLs are fully customizable i.e. they can be standard single URLs for the whole campaign, or variables can be used to customize them for each recipient. More details on customizing redirect URLs can be found in our help center. + description: >- + Customize and place a QR code on all the postcards, letters or self + mailers in a campaign. Redirect URLs are fully customizable i.e. they + can be standard single URLs for the whole campaign, or variables can be + used to customize them for each recipient. More details on customizing + redirect URLs can be found in our help center. required: - position - width @@ -18633,31 +7811,74 @@ components: type: string enum: - relative - description: Sets how a QR code is being positioned in the document. Together with this, you should provide one of 'top' or 'bottom', and one of 'left' or 'right'. + description: >- + Sets how a QR code is being positioned in the document. Together + with this, you should provide one of 'top' or 'bottom', and one of + 'left' or 'right'. top: type: string - description: Vertical distance (in inches) to place QR code from the top. Only allowed if "bottom" isn't provided. + description: >- + Vertical distance (in inches) to place QR code from the top. Only + allowed if "bottom" isn't provided. right: type: string - description: Horizontal distance (in inches) to place QR code from the right. Only allowed if "left" isn't provided. + description: >- + Horizontal distance (in inches) to place QR code from the right. + Only allowed if "left" isn't provided. left: type: string - description: Horizontal distance (in inches) to place QR code from the left. Only allowed if "right" isn't provided. + description: >- + Horizontal distance (in inches) to place QR code from the left. Only + allowed if "right" isn't provided. bottom: type: string - description: Vertical distance (in inches) to place QR code from the bottom. Only allowed if "top" isn't provided. + description: >- + Vertical distance (in inches) to place QR code from the bottom. Only + allowed if "top" isn't provided. redirect_url: - description: | - The url to redirect the user when a QR code is scanned. The URL can be a standard URL for all recipients in the campaign or customized per recipient. To customize for each recipient, use a mustache style template with merge variables enclosed in curly braces(for example, `https://www.example.com` or `{{name}}` or `https://www.example.com?q={{name}}`). If a merge variable is used in the URL, a mapping to that merge variable should be provided in the `mergeVariableColumnMapping` property when creating an upload. If the variable is not provided/does not exist, then the templated URL will be used. More details on customizing redirect URLs can be found in our help center.. - Note: Please use unique variable names between HTML templates and Redirect URLs to avoid conflicts. For example, if you are using `{{name}}` in the HTML template, use `{{name_redirect}}` in the Redirect URL. They can still be mapped to the same column in the audience file. Failing to set or map the redirect URL when using QR codes may lead to errors in generating mail pieces. + description: > + The url to redirect the user when a QR code is scanned. The URL can + be a standard URL for all recipients in the campaign or customized + per recipient. To customize for each recipient, use a mustache style + template with merge variables enclosed in curly braces(for example, + `https://www.example.com` or `{{name}}` or + `https://www.example.com?q={{name}}`). If a merge variable is used + in the URL, a mapping to that merge variable should be provided in + the `mergeVariableColumnMapping` property when creating an upload. + If the variable is not provided/does not exist, then the templated + URL will be used. More details on customizing redirect URLs can be + found in our help center.. + + Note: Please use unique variable names between HTML templates and + Redirect URLs to avoid conflicts. For example, if you are using + `{{name}}` in the HTML template, use `{{name_redirect}}` in the + Redirect URL. They can still be mapped to the same column in the + audience file. Failing to set or map the redirect URL when using QR + codes may lead to errors in generating mail pieces. width: type: string - description: The size (in inches) of the QR code with a minimum of 1 inch. All QR codes are generated as a square. + description: >- + The size (in inches) of the QR code with a minimum of 1 inch. All QR + codes are generated as a square. pages: type: string - description: Specify the pages where the QR code should be stamped in a comma separated format. Your QR code can be printed in the same position on multiple pages. For postcards, the values should either be "front", "back" (for either front or back) or "front,back" (for the QR code to be printed on both sides). For self-mailers, the values should either be "inside", "outside" (for either inside or outside) or "inside,outside" (for the QR code to be printed on both sides). For letters, the values can be specific page numbers ("1", "3"), page number ranges such as "1-3", or a comma separated combination of both ("1,3,5-7"). + description: >- + Specify the pages where the QR code should be stamped in a comma + separated format. Your QR code can be printed in the same position + on multiple pages. For postcards, the values should either be + "front", "back" (for either front or back) or "front,back" (for the + QR code to be printed on both sides). For self-mailers, the values + should either be "inside", "outside" (for either inside or outside) + or "inside,outside" (for the QR code to be printed on both sides). + For letters, the values can be specific page numbers ("1", "3"), + page number ranges such as "1-3", or a comma separated combination + of both ("1,3,5-7"). writable: - description: Properties that the postcards in your Creative should have. See the `qr_code` attribute below to add a QR code to your creative. + description: >- + Properties that the postcards in your Creative should have. See the + `qr_code` attribute below to add a QR code to your creative. required: - color properties: @@ -18675,11 +7896,21 @@ components: - custom_envelope user_provided: type: string - description: Accepts an envelope ID for any customized envelope with available inventory. If no inventory is available for the specified ID, the letter will not be sent, and an error will be returned. If the letter has more than 6 sheets, it will be sent in a blank flat envelope. Custom envelopes may be created and ordered from the dashboard. This feature is exclusive to certain customers. Upgrade to the appropriate Print & Mail Edition to gain access. + description: >- + Accepts an envelope ID for any customized envelope with available + inventory. If no inventory is available for the specified ID, the letter + will not be sent, and an error will be returned. If the letter has more + than 6 sheets, it will be sent in a blank flat envelope. Custom + envelopes may be created and ordered from the dashboard. This feature is + exclusive to certain customers. Upgrade to the appropriate Print & Mail Edition to gain access. nullable: true pattern: ^env_[a-zA-Z0-9]+$ letter_details_writable: - description: Properties that the letters in your Creative should have. See the `qr_code` attribute below to add a QR code to your creative. + description: >- + Properties that the letters in your Creative should have. See the + `qr_code` attribute below to add a QR code to your creative. required: - color properties: @@ -18694,7 +7925,11 @@ components: maxItems: 3 nullable: true buckslips: - description: A single-element array containing an existing buckslip id in a string format. See [buckslips](#tag/Buckslips) for more information. Note that buckslip letter campaigns require a minimum send quantity of 5,000 letters per campaign. + description: >- + A single-element array containing an existing buckslip id in a + string format. See [buckslips](#tag/Buckslips) for more information. + Note that buckslip letter campaigns require a minimum send quantity + of 5,000 letters per campaign. type: array items: $ref: '#/components/schemas/buckslip_id' @@ -18702,7 +7937,9 @@ components: maxItems: 1 nullable: true cards: - description: A single-element array containing an existing card id in a string format. See [cards](#tag/Cards) for more information. + description: >- + A single-element array containing an existing card id in a string + format. See [cards](#tag/Cards) for more information. type: array items: $ref: '#/components/schemas/card_id' @@ -18722,26 +7959,55 @@ components: qr_code: $ref: '#/components/schemas/qr_code_campaigns' crv_file: - description: |- + description: >- Notes: + - HTML merge variables should not include delimiting whitespace. - - All pages of a supplied PDF file must be sized at 8.5"x11", while supplied HTML will be rendered and trimmed to as many 8.5"x11" pages as necessary. - - For design specifications, please see our PDF and [HTML](#section/HTML-Examples) templates. - - If a `custom_envelope` is used, follow this template. - - For domestic destinations, the file limit is 60 pages single-sided or 120 pages double-sided. For international destinations, the file limit is 6 pages single-sided or 12 pages double-sided. PDFs that surpass the file limit will error, while HTML that renders more pages than the file limit will be trimmed. - - Any letters over 6 pages single-sided or 12 pages double-sided will be placed in a flat envelope instead of the standard double window envelope. - See pricing for extra costs incurred. + - All pages of a supplied PDF file must be sized at 8.5"x11", while + supplied HTML will be rendered and trimmed to as many 8.5"x11" pages as + necessary. + + - For design specifications, please see our PDF and [HTML](#section/HTML-Examples) templates. + + - If a `custom_envelope` is used, follow this template. + + - For domestic destinations, the file limit is 60 pages single-sided or + 120 pages double-sided. For international destinations, the file limit + is 6 pages single-sided or 12 pages double-sided. PDFs that surpass the + file limit will error, while HTML that renders more pages than the file + limit will be trimmed. + + - Any letters over 6 pages single-sided or 12 pages double-sided will be + placed in a flat envelope instead of the standard double window + envelope. + + + See pricing for extra costs incurred. oneOf: - $ref: '#/components/schemas/tmpl_id' - $ref: '#/components/schemas/local_file_path' crv_inside: - description: | + description: > The artwork to use as the inside of your self mailer creative. + Notes: + - HTML merge variables should not include delimiting whitespace. - - PDF, PNG, and JPGs must be sized at 6.25"x18.25", 12.25"x9.25" or 11.25"x9.25" at 300 DPI, while supplied HTML template will be rendered to the specified `size`. - - Be sure to leave room for address and postage information by following the templates provided here: + + - PDF, PNG, and JPGs must be sized at 6.25"x18.25", 12.25"x9.25" or + 11.25"x9.25" at 300 DPI, while supplied HTML template will be rendered + to the specified `size`. + + - Be sure to leave room for address and postage information by following + the templates provided here: - 6x18 bifold template - 11x9 bifold template - 12x9 bifold template @@ -18752,12 +8018,19 @@ components: - $ref: '#/components/schemas/tmpl_id' - $ref: '#/components/schemas/local_file_path' crv_outside: - description: | + description: > The artwork to use as the outside of your self mailer creative. + Notes: + - HTML merge variables should not include delimiting whitespace. - - PDF, PNG, and JPGs must be sized at 6.25"x18.25", 12.25"x9.25" or 11.25"x9.25" at 300 DPI, while supplied HTML template will be rendered to the specified `size`. - - Be sure to leave room for address and postage information by following the templates provided here: + + - PDF, PNG, and JPGs must be sized at 6.25"x18.25", 12.25"x9.25" or + 11.25"x9.25" at 300 DPI, while supplied HTML template will be rendered + to the specified `size`. + + - Be sure to leave room for address and postage information by following + the templates provided here: - 6x18 bifold template - 11x9 bifold template - 12x9 bifold template @@ -18768,7 +8041,9 @@ components: - $ref: '#/components/schemas/tmpl_id' - $ref: '#/components/schemas/local_file_path' self_mailer_details_writable: - description: Properties that the self mailers in your Creative should have. See the `qr_code` attribute below to add a QR code to your creative. + description: >- + Properties that the self mailers in your Creative should have. See the + `qr_code` attribute below to add a QR code to your creative. required: - color properties: @@ -18874,14 +8149,23 @@ components: allOf: - $ref: '#/components/schemas/city_no_description' - type: string - description: The name of the city. `city` and `state` are required if no `zip_code` is passed. + description: >- + The name of the city. `city` and `state` are required if no + `zip_code` is passed. state: type: string - description: The ISO 3166-2 two letter code or subdivision name for the state. `city` and `state` are required if no `zip_code` is passed. + description: >- + The ISO 3166-2 two letter code or subdivision + name for the state. `city` and `state` are required if no + `zip_code` is passed. maxLength: 50 zip_code: allOf: - - description: Required if `city` and `state` are not passed in. If included, must be formatted as a US ZIP or ZIP+4 (e.g. `94107`, `941072282`, `94107-2282`). + - description: >- + Required if `city` and `state` are not passed in. If + included, must be formatted as a US ZIP or ZIP+4 (e.g. + `94107`, `941072282`, `94107-2282`). - $ref: '#/components/schemas/zip_code' identity_validation_company: type: string @@ -18915,15 +8199,24 @@ components: allOf: - $ref: '#/components/schemas/city_no_description' - type: string - description: The name of the city. `city` and `state` are required if no `zip_code` is passed. + description: >- + The name of the city. `city` and `state` are required if no + `zip_code` is passed. state: type: string - description: The ISO 3166-2 two letter code or subdivision name for the state. `city` and `state` are required if no `zip_code` is passed. + description: >- + The ISO 3166-2 two letter code or subdivision + name for the state. `city` and `state` are required if no + `zip_code` is passed. maxLength: 50 zip_code: allOf: - type: string - description: Required if `city` and `state` are not passed in. If included, must be formatted as a US ZIP or ZIP+4 (e.g. `94107`, `941072282`, `94107-2282`). + description: >- + Required if `city` and `state` are not passed in. If + included, must be formatted as a US ZIP or ZIP+4 (e.g. + `94107`, `941072282`, `94107-2282`). - $ref: '#/components/schemas/zip_code' identity_validation_writable: oneOf: @@ -18963,8 +8256,9 @@ components: type: number nullable: true format: float - description: | - A numerical score between 0 and 100 that represents the likelihood the provided name is associated with a physical address. + description: > + A numerical score between 0 and 100 that represents the likelihood + the provided name is associated with a physical address. default: null minimum: 0 maximum: 100 @@ -18975,11 +8269,16 @@ components: - medium - low - '' - description: | - Indicates the likelihood the recipient name and address match based on our custom internal calculation. Possible values are: + description: > + Indicates the likelihood the recipient name and address match based + on our custom internal calculation. Possible values are: + - `high` — Has a Lob confidence score greater than 70. + - `medium` — Has a Lob confidence score between 40 and 70. + - `low` — Has a Lob confidence score less than 40. + - `""` — No tracking data exists for this address. object: type: string @@ -19012,8 +8311,9 @@ components: type: number nullable: true format: float - description: | - A numerical score between 0 and 100 that represents the likelihood the provided name is associated with a physical address. + description: > + A numerical score between 0 and 100 that represents the likelihood + the provided name is associated with a physical address. default: null minimum: 0 maximum: 100 @@ -19024,11 +8324,16 @@ components: - medium - low - '' - description: | - Indicates the likelihood the recipient name and address match based on our custom internal calculation. Possible values are: + description: > + Indicates the likelihood the recipient name and address match based + on our custom internal calculation. Possible values are: + - `high` — Has a Lob confidence score greater than 70. + - `medium` — Has a Lob confidence score between 40 and 70. + - `low` — Has a Lob confidence score less than 40. + - `""` — No tracking data exists for this address. object: type: string @@ -19052,22 +8357,26 @@ components: Only accepts numbers and street names in an alphanumeric format. city: type: string - description: | - An optional city input used to filter suggestions. Case insensitive and does not match partial abbreviations. + description: > + An optional city input used to filter suggestions. Case insensitive + and does not match partial abbreviations. state: type: string - description: | - An optional state input used to filter suggestions. Case insensitive and does not match partial abbreviations. + description: > + An optional state input used to filter suggestions. Case insensitive + and does not match partial abbreviations. zip_code: type: string - description: | - An optional Zip Code input used to filter suggestions. Matches partial entries. + description: > + An optional Zip Code input used to filter suggestions. Matches + partial entries. country: $ref: '#/components/schemas/country_extended' geo_ip_sort: type: boolean - description: | - If `true`, sort suggestions by proximity to the IP set in the `X-Forwarded-For` header. + description: > + If `true`, sort suggestions by proximity to the IP set in the + `X-Forwarded-For` header. intl_auto_id: type: string description: Unique identifier prefixed with `intl_auto_`. @@ -19084,22 +8393,36 @@ components: properties: primary_number_range: type: string - description: | - The primary number range of the address that identifies a building at street level. + description: > + The primary number range of the address that identifies a building + at street level. primary_line: type: string - description: | - The primary delivery line (usually the street address) of the address. - Combination of the following applicable `components` (primary number & + description: > + The primary delivery line (usually the street address) of the + address. + + Combination of the following applicable `components` (primary number + & + secondary information may be missing or inaccurate): + * `primary_number` + * `street_predirection` + * `street_name` + * `street_suffix` + * `street_postdirection` + * `secondary_designator` + * `secondary_number` + * `pmb_designator` + * `pmb_number` city: $ref: '#/components/schemas/city' @@ -19162,7 +8485,11 @@ components: - $ref: '#/components/schemas/inline_address_us' - $ref: '#/components/schemas/inline_address_intl' return_address: - description: Specifies the address the return envelope will be sent back to. This is an optional argument that is available if an account is signed up for the return envelope tracking beta, and has `return_envelope`, and `perforated_page` fields populated in the API request. + description: >- + Specifies the address the return envelope will be sent back to. This is + an optional argument that is available if an account is signed up for + the return envelope tracking beta, and has `return_envelope`, and + `perforated_page` fields populated in the API request. oneOf: - $ref: '#/components/schemas/adr_id' - $ref: '#/components/schemas/inline_address' @@ -19215,12 +8542,20 @@ components: $ref: '#/components/schemas/address' campaign_id: title: campaign_id - description: Denotes resources created by the provided campaign id, prefixed with `cmp_`. In the case of snap packs and letters with size `us_legal`, the campaign id is prefixed with `camp_` instead of `cmp_`. + description: >- + Denotes resources created by the provided campaign id, prefixed with + `cmp_`. In the case of snap packs and letters with size `us_legal`, the + campaign id is prefixed with `camp_` instead of `cmp_`. type: string pattern: ^(cmp|camp)_[a-zA-Z0-9]+$ nullable: true ltr_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). + 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 enum: - marketing @@ -19247,7 +8582,9 @@ components: - $ref: '#/components/schemas/tmpl_id' template_version_id: allOf: - - description: The unique ID of the specific version of the HTML template used for the letter. + - description: >- + The unique ID of the specific version of the HTML template + used for the letter. type: string - $ref: '#/components/schemas/vrsn_id' campaign_id: @@ -19256,7 +8593,9 @@ components: $ref: '#/components/schemas/ltr_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` letter size. + description: >- + This is in beta. Contact support@lob.com or your account contact + to learn more. Not available for `A4` letter size. default: false status: $ref: '#/components/schemas/status' @@ -19315,7 +8654,15 @@ components: $ref: '#/components/schemas/return_envelope_returned' perforated_page: type: integer - description: Required if `return_envelope` is `true`. The number of the page that should be perforated for use with the return envelope. Must be greater than or equal to `1`. The blank page added by `address_placement=insert_blank_page` will be ignored when considering the perforated page number. To see how perforation will impact your letter design, view our perforation guide. + description: >- + Required if `return_envelope` is `true`. The number of the page + that should be perforated for use with the return envelope. Must + be greater than or equal to `1`. The blank page added by + `address_placement=insert_blank_page` will be ignored when + considering the perforated page number. To see how perforation + will impact your letter design, view our perforation guide. nullable: true custom_envelope: $ref: '#/components/schemas/custom_envelope_returned' @@ -19331,8 +8678,10 @@ components: type: string enum: - registered - description: | - Add an extra service to your letter. See pricing for extra costs incurred. + description: > + Add an extra service to your letter. See pricing for extra costs incurred. * registered - provides tracking and confirmation for international addresses tracking_number: type: string @@ -19368,7 +8717,15 @@ components: $ref: '#/components/schemas/return_envelope_returned' perforated_page: type: integer - description: Required if `return_envelope` is `true`. The number of the page that should be perforated for use with the return envelope. Must be greater than or equal to `1`. The blank page added by `address_placement=insert_blank_page` will be ignored when considering the perforated page number. To see how perforation will impact your letter design, view our perforation guide. + description: >- + Required if `return_envelope` is `true`. The number of the page + that should be perforated for use with the return envelope. Must + be greater than or equal to `1`. The blank page added by + `address_placement=insert_blank_page` will be ignored when + considering the perforated page number. To see how perforation + will impact your letter design, view our perforation guide. nullable: true custom_envelope: $ref: '#/components/schemas/custom_envelope_returned' @@ -19410,34 +8767,76 @@ components: - package_undeliverable - reschedule_delivery - other - description: | - Find the full table [here](#tag/Tracking-Events). A detailed substatus about the event: - * `package_accepted` - Package has been accepted into the carrier network for delivery. - * `package_arrived` - Package has arrived at an intermediate location in the carrier network. - * `package_departed` - Package has departed from an intermediate location in the carrier network. - * `package_processing` - Package is processing at an intermediate location in the carrier network. - * `package_processed` - Package has been processed at an intermediate location. - * `package_in_local_area` - Package is at a location near the end destination. + description: > + Find the full table [here](#tag/Tracking-Events). A detailed + substatus about the event: + + * `package_accepted` - Package has been accepted into the carrier + network for delivery. + + * `package_arrived` - Package has arrived at an intermediate + location in the carrier network. + + * `package_departed` - Package has departed from an intermediate + location in the carrier network. + + * `package_processing` - Package is processing at an intermediate + location in the carrier network. + + * `package_processed` - Package has been processed at an + intermediate location. + + * `package_in_local_area` - Package is at a location near the end + destination. + * `delivery_scheduled` - Package is scheduled for delivery. + * `out_for_delivery` - Package is out for delivery. - * `pickup_available` - Package is available for pickup at carrier location. + + * `pickup_available` - Package is available for pickup at carrier + location. + * `delivered` - Package has been delivered. + * `package_forwarded` - Package has been forwarded. + * `returned_to_sender` - Package is to be returned to sender. - * `address_issue` - Address information is incorrect. Contact carrier to ensure delivery. + + * `address_issue` - Address information is incorrect. Contact + carrier to ensure delivery. + * `contact_carrier` - Contact the carrier for more information. + * `delayed` - Delivery of package is delayed. - * `delivery_attempted` - Delivery of package has been attempted. Contact carrier to ensure delivery. + + * `delivery_attempted` - Delivery of package has been attempted. + Contact carrier to ensure delivery. + * `delivery_rescheduled` - Delivery of package has been rescheduled. - * `location_inaccessible` - Delivery location inaccessible to carrier. Contact carrier to ensure delivery. - * `notice_left` - Carrier left notice during attempted delivery. Follow carrier instructions on notice. - * `package_damaged` - Package has been damaged. Contact carrier for more details. + + * `location_inaccessible` - Delivery location inaccessible to + carrier. Contact carrier to ensure delivery. + + * `notice_left` - Carrier left notice during attempted delivery. + Follow carrier instructions on notice. + + * `package_damaged` - Package has been damaged. Contact carrier for + more details. + * `package_disposed` - Package has been disposed. - * `package_held` - Package held at carrier location. Contact carrier for more details. - * `package_lost` - Package has been lost. Contact carrier for more details. + + * `package_held` - Package held at carrier location. Contact carrier + for more details. + + * `package_lost` - Package has been lost. Contact carrier for more + details. + * `package_unclaimed` - Package is unclaimed. + * `package_undeliverable` - Package is not able to be delivered. + * `reschedule_delivery` - Contact carrier to reschedule delivery. + * `other` - Unrecognized carrier status. description: type: string @@ -19447,8 +8846,9 @@ components: description: Event-specific notes from USPS about the tracking event. action_required: type: boolean - description: | - `true` if action is required by the end recipient, `false` otherwise. + description: > + `true` if action is required by the end recipient, `false` + otherwise. tracking_event_certified: allOf: - $ref: '#/components/schemas/tracking_event_base' @@ -19474,8 +8874,14 @@ components: - Re-Routed - Returned to Sender - Issue - description: | - Name of tracking event for Certified letters. Letters sent with USPS Certified Mail are fully tracked by USPS, therefore their tracking events have an additional details object with more detailed information about the tracking event. Some certified tracking event names have multiple meanings, noted in the list here. See the description of the details object for the full set of combined certified tracking event name meanings. + description: > + Name of tracking event for Certified letters. Letters sent with + USPS Certified Mail are fully tracked by USPS, therefore their + tracking events have an additional details object with more + detailed information about the tracking event. Some certified + tracking event names have multiple meanings, noted in the list + here. See the description of the details object for the full set + of combined certified tracking event name meanings. * `Mailed` - Package has been accepted into the carrier network for delivery. @@ -19498,8 +8904,10 @@ components: $ref: '#/components/schemas/tracking_event_details' location: type: string - description: | - The zip code in which the event occurred if it exists, otherwise will be the name of a Regional Distribution Center if it exists, otherwise will be null. + description: > + The zip code in which the event occurred if it exists, otherwise + will be the name of a Regional Distribution Center if it exists, + otherwise will be null. nullable: true certified: allOf: @@ -19514,8 +8922,10 @@ components: enum: - certified - certified_return_receipt - description: | - Add an extra service to your letter. See pricing for extra costs incurred. + description: > + Add an extra service to your letter. See pricing for extra costs incurred. * `certified` - track and confirm delivery for domestic destinations. An extra sheet (1 PDF page single-sided or 2 PDF pages double-sided) is added to the beginning of your letter for address and barcode information. See here for templates: #10 envelope and flat envelope (used for letters over 6 pages single-sided or 12 pages double-sided). You will not be charged for this extra sheet. * `certified_return_receipt` - request an electronic copy of the recipient's signature to prove delivery of your certified letter tracking_number: @@ -19525,7 +8935,9 @@ components: Dummy tracking numbers are created in test mode. nullable: true tracking_events: - description: An array of certified tracking events ordered by ascending `time`. Not populated in test mode. + description: >- + An array of certified tracking events ordered by ascending + `time`. Not populated in test mode. type: array items: $ref: '#/components/schemas/tracking_event_certified' @@ -19551,7 +8963,15 @@ components: $ref: '#/components/schemas/return_envelope_returned' perforated_page: type: integer - description: Required if `return_envelope` is `true`. The number of the page that should be perforated for use with the return envelope. Must be greater than or equal to `1`. The blank page added by `address_placement=insert_blank_page` will be ignored when considering the perforated page number. To see how perforation will impact your letter design, view our perforation guide. + description: >- + Required if `return_envelope` is `true`. The number of the page + that should be perforated for use with the return envelope. Must + be greater than or equal to `1`. The blank page added by + `address_placement=insert_blank_page` will be ignored when + considering the perforated page number. To see how perforation + will impact your letter design, view our perforation guide. nullable: true custom_envelope: $ref: '#/components/schemas/custom_envelope_returned' @@ -19568,7 +8988,10 @@ components: - title: certified - $ref: '#/components/schemas/certified' letter_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. + 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/ltr_id' @@ -19578,7 +9001,23 @@ components: 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 Print & Mail Edition, US addresses may also be run through National Change of Address Linkage(NCOALink). Non-US addresses will be standardized into uppercase only. If a US address used does not meet your account’s US Mail strictness setting, the request will fail. Lob Guide: Verification of Mailing Addresses' + 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 Print & Mail Edition, US addresses may also be + run through National + Change of Address Linkage(NCOALink). Non-US addresses will be + standardized into uppercase only. If a US address used does not meet + your account’s US Mail strictness setting, the request will + fail. Lob Guide: Verification of Mailing Addresses oneOf: - $ref: '#/components/schemas/adr_id' - $ref: '#/components/schemas/inline_address' @@ -19586,7 +9025,11 @@ components: 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. + 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' @@ -19604,16 +9047,38 @@ components: send_date: $ref: '#/components/schemas/send_date' ltr_file: - description: |- + description: >- Notes: + - HTML merge variables should not include delimiting whitespace. - - All pages of a supplied PDF file must be sized at 8.5"x11", while supplied HTML will be rendered and trimmed to as many 8.5"x11" pages as necessary. - - For design specifications, please see our PDF and [HTML](#section/HTML-Examples) templates. - - If a `custom_envelope` is used, follow this template. - - For domestic destinations, the file limit is 60 pages single-sided or 120 pages double-sided. For international destinations, the file limit is 6 pages single-sided or 12 pages double-sided. PDFs that surpass the file limit will error, while HTML that renders more pages than the file limit will be trimmed. - - Any letters over 6 pages single-sided or 12 pages double-sided will be placed in a flat envelope instead of the standard double window envelope. - See pricing for extra costs incurred. + - All pages of a supplied PDF file must be sized at 8.5"x11", while + supplied HTML will be rendered and trimmed to as many 8.5"x11" pages as + necessary. + + - For design specifications, please see our PDF and [HTML](#section/HTML-Examples) templates. + + - If a `custom_envelope` is used, follow this template. + + - For domestic destinations, the file limit is 60 pages single-sided or + 120 pages double-sided. For international destinations, the file limit + is 6 pages single-sided or 12 pages double-sided. PDFs that surpass the + file limit will error, while HTML that renders more pages than the file + limit will be trimmed. + + - Any letters over 6 pages single-sided or 12 pages double-sided will be + placed in a flat envelope instead of the standard double window + envelope. + + + See pricing for extra costs incurred. oneOf: - $ref: '#/components/schemas/html_string' - $ref: '#/components/schemas/tmpl_id' @@ -19624,14 +9089,22 @@ components: oneOf: - type: boolean - type: string - description: |- - Indicates if a return envelope is requested for the letter. The value corresponding to this field is by default a boolean. But if the account is signed up for custom return envelopes, the value is of type string and is `no_9_single_window` for a standard return envelope and a custom `return_envelope_id` for non-standard return envelopes. - - To include a return envelope with your letter, set to `true` and specify the `perforated_page`. See pricing for extra costs incurred. + description: >- + Indicates if a return envelope is requested for the letter. The value + corresponding to this field is by default a boolean. But if the account + is signed up for custom return envelopes, the value is of type string + and is `no_9_single_window` for a standard return envelope and a custom + `return_envelope_id` for non-standard return envelopes. + + + To include a return envelope with your letter, set to `true` and specify + the `perforated_page`. See pricing for extra costs incurred. default: false qr_code: type: object - description: Customize and place a QR code on the creative at the required position. Not available for `us_legal` letter size and snap packs. + description: Customize and place a QR code on the creative at the required position. required: - position - redirect_url @@ -19641,35 +9114,74 @@ components: type: string enum: - relative - description: Sets how a QR code is being positioned in the document. Together with this, you should provide one of 'top' or 'bottom', and one of 'left' or 'right'. + description: >- + Sets how a QR code is being positioned in the document. Together + with this, you should provide one of 'top' or 'bottom', and one of + 'left' or 'right'. top: type: number - description: Vertical distance (in inches) to place QR code from the top. Only allowed if "bottom" isn't provided. + description: >- + Vertical distance (in inches) to place QR code from the top. Only + allowed if "bottom" isn't provided. right: type: number - description: Horizontal distance (in inches) to place QR code from the right. Only allowed if "left" isn't provided. + description: >- + Horizontal distance (in inches) to place QR code from the right. + Only allowed if "left" isn't provided. left: type: number - description: Horizontal distance (in inches) to place QR code from the left. Only allowed if "right" isn't provided. + description: >- + Horizontal distance (in inches) to place QR code from the left. Only + allowed if "right" isn't provided. bottom: type: number - description: Vertical distance (in inches) to place QR code from the bottom. Only allowed if "top" isn't provided. + description: >- + Vertical distance (in inches) to place QR code from the bottom. Only + allowed if "top" isn't provided. redirect_url: type: string - description: The url to redirect the user when a QR code is scanned. The URL can be a literal URL, a template URL containing merge variables, or consist entirely of merge variables. For example, `https://www.example.com` or `https://www.example.com?q={{name}}` or `{{name}}`, respectively. When a merge variable exists in the URL, it is replaced with data from merge_variables. If the variable does not exist, then nothing with be replaced and the destination URL will be the same as the input URL. More details on merge variables can be found in our help center. + description: >- + The url to redirect the user when a QR code is scanned. The URL can + be a literal URL, a template URL containing merge variables, or + consist entirely of merge variables. For example, + `https://www.example.com` or `https://www.example.com?q={{name}}` or + `{{name}}`, respectively. When a merge variable exists in the URL, + it is replaced with data from merge_variables. If the variable does + not exist, then nothing with be replaced and the destination URL + will be the same as the input URL. More details on merge variables + can be found in our help center. width: type: number - description: The size (in inches) of the QR code with a minimum of 1 inch. All QR codes are generated as a square. + description: >- + The size (in inches) of the QR code with a minimum of 1 inch. All QR + codes are generated as a square. pages: type: string - description: Specify the pages where the QR code should be stamped in a comma separated format. Your QR code can be printed in the same position on multiple pages. For postcards, the values should either be "front", "back" (for either front or back) or "front,back" (for the QR code to be printed on both sides). For self-mailers, the values should either be "inside", "outside" (for either inside or outside) or "inside,outside" (for the QR code to be printed on both sides). For letters, the values can be specific page numbers ("1", "3"), page number ranges such as "1-3", or a comma separated combination of both ("1,3,5-7"). + description: >- + Specify the pages where the QR code should be stamped in a comma + separated format. Your QR code can be printed in the same position + on multiple pages. For postcards, the values should either be + "front", "back" (for either front or back) or "front,back" (for the + QR code to be printed on both sides). For self-mailers, the values + should either be "inside", "outside" (for either inside or outside) + or "inside,outside" (for the QR code to be printed on both sides). + For letters, the values can be specific page numbers ("1", "3"), + page number ranges such as "1-3", or a comma separated combination + of both ("1,3,5-7"). logo: type: object - description: Allows specifying a logo to be placed over the center of the QR code. Logos must be in PNG or JPEG format and have a maximum file size of 1 MB. + description: >- + Allows specifying a logo to be placed over the center of the QR + code. Logos must be in PNG or JPEG format and have a maximum file + size of 1 MB. properties: url: type: string - description: The public URL of the logo image to be retrieved and placed over the center of the QR code. + description: >- + The public URL of the logo image to be retrieved and placed over + the center of the QR code. pattern: ^https://[-a-zA-Z0-9@:%._+~#=/]{1,256}.(png|jpe?g)$ style: type: object @@ -19677,21 +9189,32 @@ components: properties: background_color: type: string - description: The background color of the QR code in hexadecimal format. For example, `#000000` is black and `#FFFFFF` is white. + description: >- + The background color of the QR code in hexadecimal format. For + example, `#000000` is black and `#FFFFFF` is white. pattern: ^#[A-Fa-f0-9]{6}$ foreground_color: type: string - description: The foreground color of the QR code in hexadecimal format. For example, `#000000` is black and `#FFFFFF` is white. + description: >- + The foreground color of the QR code in hexadecimal format. For + example, `#000000` is black and `#FFFFFF` is white. pattern: ^#[A-Fa-f0-9]{6}$ ltr_size: type: string enum: - us_letter - us_legal - description: | - Specifies the size of the letter. It accepts two values `us_letter` and `us_legal`. If the [Lob-Version header](#tag/Versioning-and-Changelog) in the request is set to `2024-01-01` and above, the `size` property is automatically included with the default value of `us_letter`, unless explicitly specified. + description: > + Specifies the size of the letter. It accepts two values `us_letter` and + `us_legal`. If the [Lob-Version header](#tag/Versioning-and-Changelog) + in the request is set to `2024-01-01` and above, the `size` property is + automatically included with the default value of `us_letter`, unless + explicitly specified. - Please note that attempting to include the `size` property in the request with the `Lob-Version` header predating to `2024-01-01` will result in an error. + + Please note that attempting to include the `size` property in the + request with the `Lob-Version` header predating to `2024-01-01` will + result in an error. default: us_letter letter_editable: allOf: @@ -19711,7 +9234,10 @@ components: extra_service: $ref: '#/components/schemas/extra_service' cards: - description: A single-element array containing an existing card id in a string format. See [cards](#tag/Cards) for more information. Not available for `us_legal` letter size. + description: >- + A single-element array containing an existing card id in a + string format. See [cards](#tag/Cards) for more information. Not + available for `us_legal` letter size. type: array items: $ref: '#/components/schemas/card_id' @@ -19732,7 +9258,15 @@ components: $ref: '#/components/schemas/return_envelope_user_provided' perforated_page: type: integer - description: Required if `return_envelope` is `true`. The number of the page that should be perforated for use with the return envelope. Must be greater than or equal to `1`. The blank page added by `address_placement=insert_blank_page` will be ignored when considering the perforated page number. To see how perforation will impact your letter design, view our perforation guide. + description: >- + Required if `return_envelope` is `true`. The number of the page + that should be perforated for use with the return envelope. Must + be greater than or equal to `1`. The blank page added by + `address_placement=insert_blank_page` will be ignored when + considering the perforated page number. To see how perforation + will impact your letter design, view our perforation guide. nullable: true custom_envelope: $ref: '#/components/schemas/user_provided' @@ -19744,7 +9278,10 @@ components: $ref: '#/components/schemas/ltr_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. + 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/ltr_size' @@ -19760,7 +9297,12 @@ components: size: $ref: '#/components/schemas/postcard_size' psc_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). + 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 enum: - marketing @@ -19783,26 +9325,40 @@ components: $ref: '#/components/schemas/psc_id' front_template_id: type: string - description: The unique ID of the HTML template used for the front of the postcard. Only filled out when the request contains a valid postcard template ID. + description: >- + The unique ID of the HTML template used for the front of the + postcard. Only filled out when the request contains a valid + postcard template ID. pattern: ^tmpl_[a-zA-Z0-9]+$ nullable: true back_template_id: type: string - description: The unique ID of the HTML template used for the back of the postcard. Only filled out when the request contains a valid postcard template ID. + description: >- + The unique ID of the HTML template used for the back of the + postcard. Only filled out when the request contains a valid + postcard template ID. pattern: ^tmpl_[a-zA-Z0-9]+$ nullable: true front_template_version_id: type: string - description: The unique ID of the specific version of the HTML template used for the front of the postcard. Only filled out when the request contains a valid postcard template ID. + description: >- + The unique ID of the specific version of the HTML template used + for the front of the postcard. Only filled out when the request + contains a valid postcard template ID. pattern: ^vrsn_[a-zA-Z0-9]+$ nullable: true back_template_version_id: type: string - description: The unique ID of the specific version of the HTML template used for the back of the postcard. Only filled out when the request contains a valid postcard template ID. + description: >- + The unique ID of the specific version of the HTML template used + for the back of the postcard. Only filled out when the request + contains a valid postcard template ID. pattern: ^vrsn_[a-zA-Z0-9]+$ nullable: true tracking_events: - description: An array of tracking_event objects ordered by ascending `time`. Will not be populated for postcards created in test mode. + description: >- + An array of tracking_event objects ordered by ascending `time`. + Will not be populated for postcards created in test mode. type: array items: $ref: '#/components/schemas/tracking_event_normal' @@ -19815,7 +9371,9 @@ components: $ref: '#/components/schemas/psc_use_type' fsc: type: boolean - description: This is in beta. Contact support@lob.com or your account contact to learn more. Not available for `4x6` or `A5` postcard sizes. + description: >- + This is in beta. Contact support@lob.com or your account contact + to learn more. Not available for `4x6` or `A5` postcard sizes. default: false status: $ref: '#/components/schemas/status' @@ -19830,7 +9388,10 @@ components: - postcard default: postcard postcard_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. + 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/psc_id' @@ -19840,17 +9401,28 @@ components: type: object properties: from: - description: '*Required* if `to` address is international. Must either be an address ID or an inline object with correct address parameters. Must either be an address ID or an inline object with correct address parameters. All addresses will be standardized into uppercase without being modified by verification.' + description: >- + *Required* if `to` address is international. Must either be an + address ID or an inline object with correct address parameters. Must + either be an address ID or an inline object with correct address + parameters. All addresses will be standardized into uppercase + without being modified by verification. oneOf: - $ref: '#/components/schemas/adr_id' - $ref: '#/components/schemas/inline_address_us' psc_front: - description: | + description: > The artwork to use as the front of your postcard. + Notes: + - HTML merge variables should not include delimiting whitespace. - - PDF, PNG, and JPGs must be sized at 4.25"x6.25", 6.25"x9.25", or 6.25"x11.25" at 300 DPI, while supplied HTML will be rendered to the specified `size`. + + - PDF, PNG, and JPGs must be sized at 4.25"x6.25", 6.25"x9.25", or + 6.25"x11.25" at 300 DPI, while supplied HTML will be rendered to the + specified `size`. + See [here](#section/HTML-Examples) for HTML examples. oneOf: @@ -19859,13 +9431,20 @@ components: - $ref: '#/components/schemas/remote_file_url' - $ref: '#/components/schemas/local_file_path' psc_back: - description: | + description: > The artwork to use as the back of your postcard. + Notes: + - HTML merge variables should not include delimiting whitespace. - - PDF, PNG, and JPGs must be sized at 4.25"x6.25", 6.25"x9.25", or 6.25"x11.25" at 300 DPI, while supplied HTML will be rendered to the specified `size`. - - Be sure to leave room for address and postage information by following the templates provided here: + + - PDF, PNG, and JPGs must be sized at 4.25"x6.25", 6.25"x9.25", or + 6.25"x11.25" at 300 DPI, while supplied HTML will be rendered to the + specified `size`. + + - Be sure to leave room for address and postage information by following + the templates provided here: - 4x6 template - 6x9 template - 6x11 template @@ -19901,7 +9480,9 @@ components: $ref: '#/components/schemas/psc_use_type' fsc: type: boolean - description: This is in beta. Contact support@lob.com or your account contact to learn more. Not available for `4x6` or `A5` postcard sizes. + description: >- + This is in beta. Contact support@lob.com or your account contact + to learn more. Not available for `4x6` or `A5` postcard sizes. default: false scans: type: object @@ -19921,7 +9502,9 @@ components: $ref: '#/components/schemas/date_created' number_of_scans: type: number - description: Number of times the QR Code associated with this mail piece was scanned. + description: >- + Number of times the QR Code associated with this mail piece was + scanned. scans: type: array description: Detailed scan information associated with each mail piece. @@ -19937,7 +9520,9 @@ components: description: The registered domain/hostname. type: string account_id: - description: Unique identifier associated with the account the domain is registered for. + description: >- + Unique identifier associated with the account the domain is + registered for. type: string domains_response: type: object @@ -19994,7 +9579,9 @@ components: description: How many results to return. offset: type: integer - description: An integer that designates the offset at which to begin returning results. Defaults to 0. + description: >- + An integer that designates the offset at which to begin returning + results. Defaults to 0. data: type: array description: | @@ -20012,7 +9599,9 @@ components: description: The registered domain to be used for the short URL. type: string slug: - description: The unique path for the shortened URL, if empty a unique path will be used. + description: >- + The unique path for the shortened URL, if empty a unique path will + be used. type: string metadata_tag: $ref: '#/components/schemas/metadata' @@ -20037,7 +9626,12 @@ components: size: $ref: '#/components/schemas/self_mailer_size' sfm_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). + 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 enum: - marketing @@ -20058,25 +9652,33 @@ components: id: $ref: '#/components/schemas/sfm_id' outside_template_id: - description: The unique ID of the HTML template used for the outside of the self mailer. + description: >- + The unique ID of the HTML template used for the outside of the + self mailer. allOf: - $ref: '#/components/schemas/tmpl_id' - type: string nullable: true inside_template_id: - description: The unique ID of the HTML template used for the inside of the self mailer. + description: >- + The unique ID of the HTML template used for the inside of the + self mailer. allOf: - $ref: '#/components/schemas/tmpl_id' - type: string nullable: true outside_template_version_id: - description: The unique ID of the specific version of the HTML template used for the outside of the self mailer. + description: >- + The unique ID of the specific version of the HTML template used + for the outside of the self mailer. allOf: - $ref: '#/components/schemas/vrsn_id' - type: string nullable: true inside_template_version_id: - description: The unique ID of the specific version of the HTML template used for the inside of the self mailer. + description: >- + The unique ID of the specific version of the HTML template used + for the inside of the self mailer. allOf: - $ref: '#/components/schemas/vrsn_id' - type: string @@ -20088,7 +9690,9 @@ components: - self_mailer default: self_mailer tracking_events: - description: An array of certified tracking events ordered by ascending `time`. Not populated in test mode. + description: >- + An array of certified tracking events ordered by ascending + `time`. Not populated in test mode. type: array items: $ref: '#/components/schemas/tracking_event_certified' @@ -20098,7 +9702,9 @@ components: $ref: '#/components/schemas/signed_link' fsc: type: boolean - description: This is in beta. Contact support@lob.com or your account contact to learn more. Not available for `11x9_bifold` self-mailer size. + description: >- + This is in beta. Contact support@lob.com or your account contact + to learn more. Not available for `11x9_bifold` self-mailer size. default: false status: $ref: '#/components/schemas/status' @@ -20109,7 +9715,10 @@ components: - $ref: '#/components/schemas/failure_reason' - nullable: true self_mailer_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. + 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/sfm_id' @@ -20128,13 +9737,19 @@ components: - use_type properties: inside: - description: | + description: > The artwork to use as the inside of your self mailer. + Notes: + - HTML merge variables should not include delimiting whitespace. - - PDF, PNG, and JPGs must be sized at 6"x18" at 300 DPI, while supplied HTML will be rendered to the specified `size`. - - Be sure to leave room for address and postage information by following the templates provided here: + + - PDF, PNG, and JPGs must be sized at 6"x18" at 300 DPI, while + supplied HTML will be rendered to the specified `size`. + + - Be sure to leave room for address and postage information by + following the templates provided here: - 6x18 bifold template - 12x9 bifold template - 17.75x9 trifold template @@ -20147,12 +9762,17 @@ components: - $ref: '#/components/schemas/remote_file_url' - $ref: '#/components/schemas/local_file_path' outside: - description: | + description: > The artwork to use as the outside of your self mailer. + Notes: + - HTML merge variables should not include delimiting whitespace. - - PDF, PNG, and JPGs must be sized at 6"x18" at 300 DPI, while supplied HTML will be rendered to the specified `size`. + + - PDF, PNG, and JPGs must be sized at 6"x18" at 300 DPI, while + supplied HTML will be rendered to the specified `size`. + See [here](#section/HTML-Examples) for HTML examples. oneOf: @@ -20168,7 +9788,9 @@ components: $ref: '#/components/schemas/sfm_use_type' fsc: type: boolean - description: This is in beta. Contact support@lob.com or your account contact to learn more. Not available for `11x9_bifold` self-mailer size. + description: >- + This is in beta. Contact support@lob.com or your account contact + to learn more. Not available for `11x9_bifold` self-mailer size. default: false snap_pack_size: type: string @@ -20184,7 +9806,12 @@ components: size: $ref: '#/components/schemas/snap_pack_size' snap_pack_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). + 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 enum: - marketing @@ -20204,13 +9831,19 @@ components: - use_type properties: inside: - description: | + description: > The artwork to use as the inside of your snap pack. + Notes: + - HTML merge variables should not include delimiting whitespace. - - PDF, PNG, and JPGs must be sized at 8.5"x11" at 300 DPI, while supplied HTML will be rendered to the specified `size`. - - Be sure to leave room for address and postage information by following the template provided here: + + - PDF, PNG, and JPGs must be sized at 8.5"x11" at 300 DPI, while + supplied HTML will be rendered to the specified `size`. + + - Be sure to leave room for address and postage information by + following the template provided here: - 8.5x11 snap pack template @@ -20221,12 +9854,17 @@ components: - $ref: '#/components/schemas/remote_file_url' - $ref: '#/components/schemas/local_file_path' outside: - description: | + description: > The artwork to use as the outside of your snap pack. + Notes: + - HTML merge variables should not include delimiting whitespace. - - PDF, PNG, and JPGs must be sized at 6"x18" at 300 DPI, while supplied HTML will be rendered to the specified `size`. + + - PDF, PNG, and JPGs must be sized at 6"x18" at 300 DPI, while + supplied HTML will be rendered to the specified `size`. + See [here](#section/HTML-Examples) for HTML examples. oneOf: @@ -20242,6 +9880,8 @@ components: allOf: - $ref: '#/components/schemas/color' - default: false + qr_code: + $ref: '#/components/schemas/qr_code' snap_pack_id: type: string description: Unique identifier prefixed with `ord_`. @@ -20260,25 +9900,33 @@ components: id: $ref: '#/components/schemas/snap_pack_id' outside_template_id: - description: The unique ID of the HTML template used for the outside of the snap pack. + description: >- + The unique ID of the HTML template used for the outside of the + snap pack. allOf: - $ref: '#/components/schemas/tmpl_id' - type: string nullable: true inside_template_id: - description: The unique ID of the HTML template used for the inside of the snap pack. + description: >- + The unique ID of the HTML template used for the inside of the + snap pack. allOf: - $ref: '#/components/schemas/tmpl_id' - type: string nullable: true outside_template_version_id: - description: The unique ID of the specific version of the HTML template used for the outside of the snap pack. + description: >- + The unique ID of the specific version of the HTML template used + for the outside of the snap pack. allOf: - $ref: '#/components/schemas/vrsn_id' - type: string nullable: true inside_template_version_id: - description: The unique ID of the specific version of the HTML template used for the inside of the snap pack. + description: >- + The unique ID of the specific version of the HTML template used + for the inside of the snap pack. allOf: - $ref: '#/components/schemas/vrsn_id' - type: string @@ -20290,7 +9938,9 @@ components: - snap_pack default: snap_pack tracking_events: - description: An array of tracking events ordered by ascending `time`. Not populated in test mode. + description: >- + An array of tracking events ordered by ascending `time`. Not + populated in test mode. type: array items: $ref: '#/components/schemas/tracking_event_normal' @@ -20300,7 +9950,9 @@ components: $ref: '#/components/schemas/signed_link' fsc: type: boolean - description: Contact support@lob.com or your account contact to learn more. Not available for snap_pack currently. + description: >- + Contact support@lob.com or your account contact to learn more. + Not available for snap_pack currently. default: false status: $ref: '#/components/schemas/status' @@ -20314,15 +9966,26 @@ components: $ref: '#/components/schemas/color' template_html: type: string - description: | - An HTML string of less than 100,000 characters to be used as the `published_version` of this template. See [here](#section/HTML-Examples) for guidance on designing HTML templates. Please see endpoint specific documentation for any other product-specific HTML details: + description: > + An HTML string of less than 100,000 characters to be used as the + `published_version` of this template. See [here](#section/HTML-Examples) + for guidance on designing HTML templates. Please see endpoint specific + documentation for any other product-specific HTML details: + - [Postcards](#operation/postcard_create) - `front` and `back` + - [Self Mailers](#operation/self_mailer_create) - `inside` and `outside` + - [Letters](#operation/letter_create) - `file` + - [Checks](#operation/check_create) - `check_bottom` and `attachment` + - [Cards](#operation/card_create) - `front` and `back` - If there is a syntax error with your variable names within your HTML, then an error will be thrown, e.g. using a `{{#users}}` opening tag without the corresponding closing tag `{{/users}}`. + + If there is a syntax error with your variable names within your HTML, + then an error will be thrown, e.g. using a `{{#users}}` opening tag + without the corresponding closing tag `{{/users}}`. maxLength: 100000 engine: type: string @@ -20339,8 +10002,9 @@ components: type: array items: type: string - description: | - An array of required variables to be used in a template. Only available for `handlebars` templates. + description: > + An array of required variables to be used in a template. Only available + for `handlebars` templates. template_version_writable: type: object required: @@ -20370,8 +10034,10 @@ components: Used by frontend, true if the template uses advanced features. merge_variables: type: object - description: | - Object representing the keys of every merge variable present in the template. It has one key named 'keys', and its value is an array of strings. + description: > + Object representing the keys of every merge variable present in + the template. It has one key named 'keys', and its value is an + array of strings. object: type: string description: Value is resource type. @@ -20388,7 +10054,10 @@ components: required_vars: $ref: '#/components/schemas/template_required_vars' template_version_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. + 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/vrsn_id' @@ -20407,12 +10076,17 @@ components: $ref: '#/components/schemas/tmpl_id' versions: type: array - description: An array of all non-deleted [version objects](#tag/Template-Versions) associated with the template. + description: >- + An array of all non-deleted [version + objects](#tag/Template-Versions) associated with the template. items: $ref: '#/components/schemas/template_version' published_version: allOf: - - description: The template's currently published version. This version will be used in any Print & Mail API requests that reference the specified template. + - description: >- + The template's currently published version. This version will be + used in any Print & Mail API requests that reference the + specified template. - $ref: '#/components/schemas/template_version' object: type: string @@ -20435,11 +10109,19 @@ components: $ref: '#/components/schemas/resource_description' published_version: allOf: - - description: The ID of the published version of a template you'd like to update. The published version is the one that will be used in any Print & Mail API requests that reference the specified template. Will err if the referenced `published_version` has been deleted or does not exist. + - description: >- + The ID of the published version of a template you'd like to + update. The published version is the one that will be used in + any Print & Mail API requests that reference the specified + template. Will err if the referenced `published_version` has + been deleted or does not exist. type: string - $ref: '#/components/schemas/vrsn_id' template_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. + 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/tmpl_id' @@ -20521,20 +10203,24 @@ components: Only accepts numbers and street names in an alphanumeric format. city: type: string - description: | - An optional city input used to filter suggestions. Case insensitive and does not match partial abbreviations. + description: > + An optional city input used to filter suggestions. Case insensitive + and does not match partial abbreviations. state: type: string - description: | - An optional state input used to filter suggestions. Case insensitive and does not match partial abbreviations. + description: > + An optional state input used to filter suggestions. Case insensitive + and does not match partial abbreviations. zip_code: type: string - description: | - An optional ZIP Code input used to filter suggestions. Matches partial entries. + description: > + An optional ZIP Code input used to filter suggestions. Matches + partial entries. geo_ip_sort: type: boolean - description: | - If `true`, sort suggestions by proximity to the IP set in the `X-Forwarded-For` header. + description: > + If `true`, sort suggestions by proximity to the IP set in the + `X-Forwarded-For` header. us_auto_id: type: string description: Unique identifier prefixed with `us_auto_`. @@ -20549,18 +10235,31 @@ components: properties: primary_line: type: string - description: | - The primary delivery line (usually the street address) of the address. - Combination of the following applicable `components` (primary number & + description: > + The primary delivery line (usually the street address) of the + address. + + Combination of the following applicable `components` (primary number + & + secondary information may be missing or inaccurate): + * `primary_number` + * `street_predirection` + * `street_name` + * `street_suffix` + * `street_postdirection` + * `secondary_designator` + * `secondary_number` + * `pmb_designator` + * `pmb_number` city: $ref: '#/components/schemas/city' @@ -20568,8 +10267,9 @@ components: $ref: '#/components/schemas/state' zip_code: allOf: - - description: | - Must be formatted as a US ZIP or ZIP+4 (e.g. `94107`, `941072282`, `94107-2282`). + - description: > + Must be formatted as a US ZIP or ZIP+4 (e.g. `94107`, + `941072282`, `94107-2282`). - $ref: '#/components/schemas/zip_code' object: type: string @@ -20607,16 +10307,22 @@ components: minimum: -90 maximum: 90 format: float - description: | - A positive or negative decimal indicating the geographic latitude of the address, specifying the north-to-south position of a location. This should be input with `longitude` to pinpoint locations on a map. + description: > + A positive or negative decimal indicating the geographic latitude of + the address, specifying the north-to-south position of a location. + This should be input with `longitude` to pinpoint locations on a + map. nullable: true longitude: type: number minimum: -180 maximum: 180 format: float - description: | - A positive or negative decimal indicating the geographic longitude of the address, specifying the north-to-south position of a location. This should be input with `latitude` to pinpoint locations on a map. + description: > + A positive or negative decimal indicating the geographic longitude + of the address, specifying the north-to-south position of a + location. This should be input with `latitude` to pinpoint locations + on a map. nullable: true reverse_geocode_id: type: string @@ -20624,7 +10330,9 @@ components: pattern: ^us_reverse_geocode_[a-zA-Z0-9_]+$ components: type: object - description: A nested object containing a breakdown of each component of a reverse geocoded response. + description: >- + A nested object containing a breakdown of each component of a reverse + geocoded response. required: - zip_code - zip_code_plus_4 @@ -20639,7 +10347,9 @@ components: - $ref: '#/components/schemas/zip_code_plus_4' location_analysis: type: object - description: A nested object containing a breakdown of the analysis of a reverse geocoded location. + description: >- + A nested object containing a breakdown of the analysis of a reverse + geocoded location. required: - latitude - longitude @@ -20650,22 +10360,31 @@ components: minimum: -90 maximum: 90 format: float - description: | - A positive or negative decimal indicating the geographic latitude of the address, specifying the north-to-south position of a location. This should be used with `longitude` to pinpoint locations on a map. Will not be returned for undeliverable addresses or military addresses (state is `AA`, `AE`, or `AP`). + description: > + A positive or negative decimal indicating the geographic latitude of + the address, specifying the north-to-south position of a location. + This should be used with `longitude` to pinpoint locations on a map. + Will not be returned for undeliverable addresses or military + addresses (state is `AA`, `AE`, or `AP`). nullable: true longitude: type: number minimum: -180 maximum: 180 format: float - description: | - A positive or negative decimal indicating the geographic longitude of the address, specifying the north-to-south position of a location. This should be used with `latitude` to pinpoint locations on a map. Will not be returned for undeliverable addresses or military addresses (state is `AA`, `AE`, or `AP`). + description: > + A positive or negative decimal indicating the geographic longitude + of the address, specifying the north-to-south position of a + location. This should be used with `latitude` to pinpoint locations + on a map. Will not be returned for undeliverable addresses or + military addresses (state is `AA`, `AE`, or `AP`). nullable: true distance: type: number format: float - description: | - The distance from the input location to this exact zip code in miles. + description: > + The distance from the input location to this exact zip code in + miles. addresses: type: object properties: @@ -20697,8 +10416,10 @@ components: properties: address: type: string - description: | - The entire address in one string (e.g., "210 King Street 94107"). _Does not support a recipient and will error when other payload parameters are provided._ + description: > + The entire address in one string (e.g., "210 King Street 94107"). + _Does not support a recipient and will error when other payload + parameters are provided._ maxLength: 500 us_verifications_writable: oneOf: @@ -20737,8 +10458,12 @@ components: $ref: '#/components/schemas/county_fips' preferred: type: boolean - description: | - Indicates whether or not the city is the USPS default city (preferred city) of a ZIP code. There is only one preferred city per ZIP code, which will always be in position 0 in the array of cities. + description: > + Indicates whether or not the city is the USPS default city (preferred city) of a ZIP + code. There is only one preferred city per ZIP code, which will + always be in position 0 in the array of cities. example: true zip: allOf: @@ -20756,8 +10481,10 @@ components: type: array items: $ref: '#/components/schemas/zip_lookup_city' - description: | - An array of city objects containing valid cities for the `zip_code`. Multiple cities will be returned if more than one city is associated with the input ZIP code. + description: > + An array of city objects containing valid cities for the + `zip_code`. Multiple cities will be returned if more than one + city is associated with the input ZIP code. zip_code_type: $ref: '#/components/schemas/zip_code_type' object: @@ -20885,7 +10612,10 @@ components: - $ref: '#/components/schemas/bank_account_types' enabled_for_test: type: boolean - description: Value is `true` if the event type is enabled in both the test and live environments and `false` if it is only enabled in the live environment. + description: >- + Value is `true` if the event type is enabled in both the test and + live environments and `false` if it is only enabled in the live + environment. resource: type: string enum: @@ -20917,7 +10647,16 @@ components: pattern: ^evt_[a-zA-Z0-9_]+$ body: type: object - description: The body of the associated resource as they were at the time of the event, i.e. the [postcard object](#operation/postcard_retrieve), [the letter object](#operation/letter_retrieve), [the check object](#operation/check_retrieve), [the address object](#operation/address_retrieve), or [the bank account object](#operation/bank_account_retrieve). For `.deleted` events, the body matches the response for the corresponding delete endpoint for that resource (e.g. the [postcard delete response](#operation/postcard_delete)). + description: >- + The body of the associated resource as they were at the time of the + event, i.e. the [postcard object](#operation/postcard_retrieve), + [the letter object](#operation/letter_retrieve), [the check + object](#operation/check_retrieve), [the address + object](#operation/address_retrieve), or [the bank account + object](#operation/bank_account_retrieve). For `.deleted` events, + the body matches the response for the corresponding delete endpoint + for that resource (e.g. the [postcard delete + response](#operation/postcard_delete)). reference_id: description: Unique identifier of the related resource for the event. type: string @@ -20947,20 +10686,25 @@ components: in: query name: before/after required: false - description: | - `before` and `after` are both optional but only one of them can be in the query at a time. + description: > + `before` and `after` are both optional but only one of them can be in + the query at a time. schema: allOf: - type: object properties: before: type: string - description: | - A reference to a list entry used for paginating to the previous set of entries. This field is pre-populated in the `previous_url` field in the return response. + description: > + A reference to a list entry used for paginating to the + previous set of entries. This field is pre-populated in the + `previous_url` field in the return response. after: type: string - description: | - A reference to a list entry used for paginating to the next set of entries. This field is pre-populated in the `next_url` field in the return response. + description: > + A reference to a list entry used for paginating to the next + set of entries. This field is pre-populated in the `next_url` + field in the return response. - oneOf: - required: - before @@ -20969,8 +10713,9 @@ components: include: in: query name: include - description: | - Request that the response include the total count by specifying `include=["total_count"]`. + description: > + Request that the response include the total count by specifying + `include=["total_count"]`. schema: type: array items: @@ -20979,7 +10724,10 @@ components: date_created: in: query name: date_created - description: 'Filter by date created. Accepted formats are 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 ≤.' + description: >- + Filter by date created. Accepted formats are 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 ≤. schema: $ref: '#/components/schemas/date_filter' style: deepObject @@ -20996,14 +10744,19 @@ components: in: query name: offset required: false - description: An integer that designates the offset at which to begin returning results. Defaults to 0. + description: >- + An integer that designates the offset at which to begin returning + results. Defaults to 0. schema: type: integer default: 0 date_modified: in: query name: date_modified - description: 'Filter by date modified. Accepted formats are 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 ≤.' + description: >- + Filter by date modified. Accepted formats are 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 ≤. schema: $ref: '#/components/schemas/date_filter' style: deepObject @@ -21012,10 +10765,13 @@ components: in: header name: x-lang-output required: false - description: | - * `native` - Translate response to the native language of the country in the request + description: > + * `native` - Translate response to the native language of the country in + the request + * `match` - match the response to the language in the request + Default response is in English. schema: type: string @@ -21025,31 +10781,42 @@ components: scheduled: in: query name: scheduled - description: | + description: > * `true` - only return orders (past or future) where `send_date` is + greater than `date_created` - * `false` - only return orders where `send_date` is equal to `date_created` + + * `false` - only return orders where `send_date` is equal to + `date_created` schema: type: boolean send_date: in: query name: send_date - 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 ≤. + 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 ≤. schema: $ref: '#/components/schemas/send_date' mail_type: in: query name: mail_type - description: | - A string designating the mail postage type: * `usps_first_class` - (default) * `usps_standard` - a cheaper option 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. + description: > + A string designating the mail postage type: * `usps_first_class` - + (default) * `usps_standard` - a cheaper option 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. schema: $ref: '#/components/schemas/mail_type' sort_by: in: query name: sort_by - description: | - Sorts items by ascending or descending dates. Use either `date_created` or `send_date`, not both. + description: > + Sorts items by ascending or descending dates. Use either `date_created` + or `send_date`, not both. schema: allOf: - type: object @@ -21083,8 +10850,11 @@ components: in: header name: Idempotency-Key required: false - description: | - A string of no longer than 256 characters that uniquely identifies this resource. For more help integrating idempotency keys, refer to our implementation guide. + description: > + A string of no longer than 256 characters that uniquely identifies this + resource. For more help integrating idempotency keys, refer to our implementation guide. schema: type: string maxLength: 256 @@ -21093,8 +10863,11 @@ components: in: query name: idempotency_key required: false - description: | - A string of no longer than 256 characters that uniquely identifies this resource. For more help integrating idempotency keys, refer to our implementation guide. + description: > + A string of no longer than 256 characters that uniquely identifies this + resource. For more help integrating idempotency keys, refer to our implementation guide. schema: type: string maxLength: 256 @@ -21103,15 +10876,19 @@ components: in: query name: campaign_id required: false - description: Filters resources created by the provided campaign id, prefixed with `cmp_`. + description: >- + Filters resources created by the provided campaign id, prefixed with + `cmp_`. schema: $ref: '#/components/schemas/campaign_id' lob-version: in: header name: Lob-Version required: false - description: | - A string representing the version of the API being used. For more information on versioning, refer to our [Versioning and Changelog](#tag/Versioning-and-Changelog) documentation. + description: > + A string representing the version of the API being used. For more + information on versioning, refer to our [Versioning and + Changelog](#tag/Versioning-and-Changelog) documentation. schema: type: string example: '2024-01-01' @@ -21122,14 +10899,1666 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/error' + example: + error: + code: not_found + message: address not found + status_code: 404 + all_addresses: + description: >- + A dictionary with a data property that contains an array of up to + `limit` addresses. Each entry in the array is a separate address object. + The previous and next page of address entries can be retrieved by + calling the endpoint contained in the `previous_url` and `next_url` + fields in the API response respectively.
If no more addresses are + available beyond the current set of returned results, the `next_url` + field will be empty. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/list' + - type: object + properties: + data: + type: array + description: list of addresses + items: + $ref: '#/components/schemas/address' + example: + data: + - id: adr_e68217bd744d65c8 + description: Harry - Office + name: HARRY ZHANG + company: LOB + phone: '5555555555' + email: harry@lob.com + address_line1: 210 KING ST STE 6100 + address_line2: null + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2019-08-12T00:16:00.361Z' + date_modified: '2019-08-12T00:16:00.361Z' + object: address + - id: adr_asdi2y3riuasasoi + description: Harry - Office + name: Harry Zhang + company: Lob + phone: '5555555555' + email: harry@lob.com + metadata: {} + address_line1: 370 WATER ST + address_line2: '' + address_city: SUMMERSIDE + address_state: PRINCE EDWARD ISLAND + address_zip: C1N 1C4 + address_country: CANADA + date_created: '2019-09-20T00:14:00.361Z' + date_modified: '2019-09-20T00:14:00.361Z' + object: address + object: list + next_url: >- + https://api.lob.com/v1/addresses?limit=2&after=eyJkYXRlT2Zmc2V0IjoiMjAxOS0wOC0wN1QyMTo1OTo0Ni43NjRaIiwiaWRPZmZzZXQiOiJhZHJfODMwYmYwZWFiZGFhYTQwOSJ9 + previous_url: null + count: 2 + post_address: + description: Echos the writable fields of a newly created address object. + headers: + ratelimit-limit: + $ref: '#/components/headers/ratelimit-limit' + ratelimit-remaining: + $ref: '#/components/headers/ratelimit-remaining' + ratelimit-reset: + $ref: '#/components/headers/ratelimit-reset' + content: + application/json: + schema: + $ref: '#/components/schemas/address' + examples: + full_us: + value: + id: adr_d3489cd64c791ab5 + description: Harry - Office + name: HARRY ZHANG + company: LOB + phone: '5555555555' + email: harry@lob.com + address_line1: 210 KING ST STE 6100 + address_city: SAN FRANCISCO + address_state: CA + address_zip: '94107' + address_country: UNITED STATES + metadata: {} + date_created: '2017-09-05T17:47:53.767Z' + date_modified: '2017-09-05T17:47:53.767Z' + object: address + full_intl: + value: + id: adr_b9f49f464c836203 + description: Harry - Office + name: HARRY ZHANG + company: LOB + phone: '5555555555' + email: harry@lob.com + address_line1: 370 WATER ST + address_city: SUMMERSIDE + address_state: PRINCE EDWARD ISLAND + address_zip: C1N 1C4 + address_country: CANADA + metadata: {} + date_created: '2021-11-29T20:55:46.843Z' + date_modified: '2021-11-29T20:56:46.843Z' + object: address + ncoa_us_live: + value: + id: adr_d3489cd64c791ab5 + description: Harry - Office + name: HARRY ZHANG + company: LOB + phone: '5555555555' + email: harry@lob.com + address_line1: ████ + address_line2: ████ + address_city: SAN FRANCISCO + address_state: CA + address_zip: '94107' + address_country: UNITED STATES + metadata: {} + date_created: '2017-09-05T17:47:53.767Z' + date_modified: '2017-09-05T17:47:53.767Z' + recipient_moved: true + inline: false + object: address + ncoa_us_test: + value: + id: adr_e463565030210e12 + description: null + name: TEST KEYS DO NOT VERIFY ADDRESSES + company: null + phone: null + email: null + address_line1: ████ + address_line2: ████ + address_city: SAN FRANCISCO + address_state: CA + address_zip: '94107' + address_country: UNITED STATES + metadata: {} + date_created: '2019-12-05T19:39:19.932Z' + date_modified: '2019-12-05T19:39:19.932Z' + recipient_moved: true + inline: false + object: address + address: + description: Returns an address object if a valid identifier was provided. + content: + application/json: + schema: + $ref: '#/components/schemas/address' + address_deleted: + description: Deleted + content: + application/json: + schema: + $ref: '#/components/schemas/address_deletion' + example: + id: adr_123456789 + deleted: true + bank_account_error: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + example: + error: + code: invalid + message: routing_number is required + status_code: 422 + post_bank_account: + description: Returns a bank_account object + headers: + ratelimit-limit: + $ref: '#/components/headers/ratelimit-limit' + ratelimit-remaining: + $ref: '#/components/headers/ratelimit-remaining' + ratelimit-reset: + $ref: '#/components/headers/ratelimit-reset' + content: + application/json: + schema: + $ref: '#/components/schemas/bank_account' + example: + id: bank_8cad8df5354d33f + signature_url: >- + https://lob-assets.com/letters/asd_asdfghjklqwertyu.pdf?version=45&expires=1234567890&signature=a + description: Test Bank Account + metadata: {} + routing_number: '322271627' + fractional_routing_number: 25-3/440 + check_template: jpm + account_number: '123456789' + account_type: company + signatory: John Doe + bank_name: J.P. MORGAN CHASE BANK, N.A., + bank_city: Columbus + bank_state: OH + bank_zip: '43240' + verified: false + date_created: '2015-11-06T19:24:24.440Z' + date_modified: '2015-11-06T19:24:24.440Z' + object: bank_account + bank_account_deleted: + description: Deleted + content: + application/json: + schema: + $ref: '#/components/schemas/bank_deletion' + example: + id: bank_123456789 + deleted: true + all_bank_accounts: + description: >- + A dictionary with a data property that contains an array of up to + `limit` bank_accounts. Each entry in the array is a separate + bank_account. The previous and next page of bank_accounts can be + retrieved by calling the endpoint contained in the `previous_url` and + `next_url` fields in the API response respectively.
If no more + bank_accounts are available beyond the current set of returned results, + the `next_url` field will be empty. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/list' + - type: object + properties: + data: + type: array + description: list of bank_accounts + items: + $ref: '#/components/schemas/bank_account' + example: + data: + - id: bank_0e3fb07eba0b35b + signature_url: >- + https://lob-assets.com/letters/asd_asdfghjklqwertyu.pdf?version=45&expires=1234567890&signature=a + description: Example bank account + metadata: {} + routing_number: '122100024' + account_number: '1234564789' + account_type: company + signatory: John Doe + bank_name: JPMORGAN CHASE BANK, NA + verified: true + date_created: '2019-03-30T13:13:22.200Z' + date_modified: '2019-03-30T13:13:23.385Z' + object: bank_account + - id: bank_eba93f7de3c02d9 + description: Example bank account + metadata: {} + routing_number: '122100024' + account_number: '1234564789' + account_type: company + signatory: John Doe + bank_name: JPMORGAN CHASE BANK, NA + verified: true + date_created: '2019-03-30T13:11:06.809Z' + date_modified: '2019-03-30T13:11:07.872Z' + object: bank_account + object: list + next_url: >- + https://api.lob.com/v1/bank_accounts?limit=2&after=eyJkYXRlT2Zmc2V0IjoiMjAxOS0wMy0zMFQxMzoxMTowNi44MDlaIiwiaWRPZmZzZXQiOiJiYW5rX2ViYTkzZjdkZTNjMDJkOSJ9 + previous_url: null + count: 2 + billing_group_list_error: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + example: + error: + code: not_found + message: billing_group not found + status_code: 404 + billing_group_error: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + example: + error: + code: invalid + message: message about incorrect parameter + status_code: 422 + post_billing_group: + description: Returns a billing group object + headers: + ratelimit-limit: + $ref: '#/components/headers/ratelimit-limit' + ratelimit-remaining: + $ref: '#/components/headers/ratelimit-remaining' + ratelimit-reset: + $ref: '#/components/headers/ratelimit-reset' + content: + application/json: + schema: + $ref: '#/components/schemas/billing_group' + example: + id: bg_c94e83ca2cd5121 + name: Marketing Dept + description: Usage group used for the Marketing Dept resource sends + date_created: '2017-11-07T22:56:10.962Z' + date_modified: '2017-11-07T22:56:10.962Z' + object: billing_group + buckslip_error: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + example: + error: + code: invalid + message: message about incorrect parameter + status_code: 422 + buckslip_deleted: + description: Deleted the buckslip + content: + application/json: + schema: + $ref: '#/components/schemas/buckslip_deletion' + example: + id: buckslip_123456789 + deleted: true + buckslip_order_error: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + example: + error: + code: not_found + message: buckslip not found + status_code: 404 + us_verifications_error: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + example: + error: + code: invalid + message: primary_line is required or address is required + status_code: 422 + bulk_us_verifications: + description: Returns a list of US verification objects. + headers: + ratelimit-limit: + $ref: '#/components/headers/ratelimit-limit' + ratelimit-remaining: + $ref: '#/components/headers/ratelimit-remaining' + ratelimit-reset: + $ref: '#/components/headers/ratelimit-reset' + content: + application/json: + schema: + $ref: '#/components/schemas/us_verifications' + example: + addresses: + - id: us_ver_c7cb63d68f8d6 + recipient: LOB.COM + primary_line: 210 KING ST + secondary_line: '' + urbanization: '' + last_line: SAN FRANCISCO CA 94107-1702 + deliverability: deliverable + valid_address: true + components: + primary_number: '210' + street_predirection: '' + street_name: KING + street_suffix: ST + street_postdirection: '' + secondary_designator: '' + secondary_number: '' + pmb_designator: '' + pmb_number: '' + extra_secondary_designator: '' + extra_secondary_number: '' + city: SAN FRANCISCO + state: CA + zip_code: '94107' + zip_code_plus_4: '1702' + zip_code_type: standard + delivery_point_barcode: '941071728506' + address_type: commercial + record_type: street + default_building_address: false + county: SAN FRANCISCO + county_fips: '06075' + carrier_route: C032 + carrier_route_type: city_delivery + po_box_only_flag: 'N' + latitude: 37.77597542841264 + longitude: -122.3929557343685 + deliverability_analysis: + dpv_confirmation: 'Y' + dpv_cmra: 'N' + dpv_vacant: 'N' + dpv_active: 'Y' + dpv_inactive_reason: '' + dpv_throwback: 'N' + dpv_non_delivery_day_flag: 'N' + dpv_non_delivery_day_values: '' + dpv_no_secure_location: 'N' + dpv_door_not_accessible: 'N' + dpv_footnotes: + - AA + - BB + ews_match: false + lacs_indicator: '' + lacs_return_code: '' + suite_return_code: '' + lob_confidence_score: + score: 100 + level: high + object: us_verification + errors: false + intl_verifications_error: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + example: + error: + code: invalid + message: country is required + status_code: 422 + bulk_intl_verifications: + description: Returns an array of international verification objects. + headers: + ratelimit-limit: + $ref: '#/components/headers/ratelimit-limit' + ratelimit-remaining: + $ref: '#/components/headers/ratelimit-remaining' + ratelimit-reset: + $ref: '#/components/headers/ratelimit-reset' + content: + application/json: + schema: + $ref: '#/components/schemas/intl_verifications' + example: + addresses: + - id: intl_ver_c7cb63d68f8d6 + recipient: null + primary_line: 370 WATER ST + secondary_line: '' + last_line: SUMMERSIDE PE C1N 1C4 + country: CA + coverage: SUBBUILDING + deliverability: deliverable + status: LV4 + components: + primary_number: '370' + street_name: WATER ST + city: SUMMERSIDE + state: PE + postal_code: C1N 1C4 + object: intl_verification + errors: false + all_campaigns: + description: >- + A dictionary with a data property that contains an array of up to + `limit` campaigns. Each entry in the array is a separate campaign. The + previous and next page of campaigns can be retrieved by calling the + endpoint contained in the `previous_url` and `next_url` fields in the + API response respectively.
If no more campaigns are available beyond + the current set of returned results, the `next_url` field will be empty. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/list' + - type: object + properties: + data: + type: array + description: list of campaigns + items: + $ref: '#/components/schemas/campaign' + example: + data: + - id: cmp_e05ee61ff80764b + billing_group_id: bg_fe3079dcdd80e5ae + name: My Campaign + description: My Campaign's description + schedule_type: immediate + send_date: null + target_delivery_date: null + cancel_window_campaign_minutes: 60 + metadata: {} + use_type: marketing + is_draft: true + deleted: false + creatives: [] + uploads: [] + auto_cancel_if_ncoa: false + date_created: '2017-09-05T17:47:53.767Z' + date_modified: '2017-09-05T17:47:53.767Z' + object: campaign + object: list + previous_url: null + next_url: null + count: 1 + campaigns_error: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + example: + error: + code: not_found + message: campaign not found + status_code: 404 + campaign_deleted: + description: Deleted the campaign. + content: + application/json: + schema: + 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/cmp_id' + deleted: + type: boolean + description: True if the resource has been successfully deleted. + example: + id: cmp_e05ee61ff80764b + deleted: true + mailpiece_error: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + example: + error: + code: not_found + message: to address not found + status_code: 404 + card_deleted: + description: Deleted the card + content: + application/json: + schema: + $ref: '#/components/schemas/card_deletion' + example: + id: card_123456789 + deleted: true + card_order_error: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + example: + error: + code: not_found + message: card not found + status_code: 404 + all_checks: + description: >- + A dictionary with a data property that contains an array of up to + `limit` checks. Each entry in the array is a separate check. The + previous and next page of checks can be retrieved by calling the + endpoint contained in the `previous_url` and `next_url` fields in the + API response respectively.
If no more checks are available beyond the + current set of returned results, the `next_url` field will be empty. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/list' + - type: object + properties: + data: + type: array + description: list of checks + items: + $ref: '#/components/schemas/check' + example: + data: + - id: chk_0176bf6197100185 + description: Demo Check + metadata: {} + check_number: 12559 + memo: rent + amount: 22.5 + url: >- + https://lob-assets.com/checks/chk_0176bf6197100185.pdf?version=v1&expires=1568239682&signature=aqKV5lmg_ktxzyl-qEwIf8-7DbvcguLO0LrfFcyMrUDDt6hxX_da0MEEpElxKR876VUaZrpHq_i_ayDWrsK3BA + to: + id: adr_bae820679f3f536b + description: Harry - Office + name: HARRY ZHANG + company: LOB + email: harry@lob.com + phone: '5555555555' + address_line1: 210 KING ST STE 6100 + address_line2: '' + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2018-12-08T03:08:43.446Z' + date_modified: '2018-12-08T03:08:43.446Z' + object: address + recipient_moved: false + from: + id: adr_210a8d4b0b76d77b + name: LEORE AVIDAR + address_line1: 210 KING ST STE 6100 + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2018-12-08T03:01:07.651Z' + date_modified: '2018-12-08T03:01:07.651Z' + object: address + bank_account: + id: bank_8cad8df5354d33f + description: Test Bank Account + metadata: {} + routing_number: '322271627' + account_number: '123456789' + account_type: individual + signatory: John Doe + bank_name: J.P. MORGAN CHASE BANK, N.A. + verified: true + date_created: '2015-11-06T19:24:24.440Z' + date_modified: '2015-11-06T19:41:28.312Z' + object: bank_account + signature_url: >- + https://lob-assets.com/bank-accounts/asd_asdfghjkqwertyui.pdf?expires=1234567890&signature=aksdf + carrier: USPS + tracking_events: [] + thumbnails: + - small: >- + https://lob-assets.com/checks/chk_0176bf6197100185_thumb_small_1.png?version=v1&expires=1568239682&signature=T8DfMm_mxJJzIPgm8I0lvYY4Z6I8aFjsGsrEAicEqw8Ei_FaOtiGQKGeY16rdugAt8lmS_iX0lveBoG2RgWDDw + medium: >- + https://lob-assets.com/checks/chk_0176bf6197100185_thumb_medium_1.png?version=v1&expires=1568239682&signature=-iJD7C58xOCD8eQ01StqSlw9WbDymL0Ygze9twfTs9s17zQppr2Zx363_Z4bP3ATHNhF3osjHuAxIasI2Wf6DQ + large: >- + https://lob-assets.com/checks/chk_0176bf6197100185_thumb_large_1.png?version=v1&expires=1568239682&signature=VJlOkVDPKZThstdd632r3Grm2WhoyPkC-pffpcePTw1i1NkpAObDSRaItKMOQgeWkAcUud3SH0tYcVOadaNiCw + - small: >- + https://lob-assets.com/checks/chk_0176bf6197100185_thumb_small_2.png?version=v1&expires=1568239682&signature=XpCkOjy2zIKXkuc0s-UAYGNwpD_pgt7c9FKTDUCYbyqXupAg1MV1l2tdqevr0L0LT5FJqrGZH9khD5QRMQTkAA + medium: >- + https://lob-assets.com/checks/chk_0176bf6197100185_thumb_medium_2.png?version=v1&expires=1568239682&signature=sdgnJMzusEfndu7dNmk37eKc0AV7Hmqev6TQAqkCESs5pg7j6dDTsp7v4pnDvhsj8d7SIMcahl1aGiysoom0CA + large: >- + https://lob-assets.com/checks/chk_0176bf6197100185_thumb_large_2.png?version=v1&expires=1568239682&signature=ybe8ovBh8Gf-AWKGRs4CB4XkU-erPVbY66umXARhTiJG2Dg1QlyCb9WmBXWt0tBCwD5NGMl20mHeAgHwecLxBA + expected_delivery_date: '2019-08-16' + mail_type: usps_first_class + date_created: '2019-08-08T19:34:47.571Z' + date_modified: '2019-08-08T19:34:49.612Z' + send_date: '2019-08-08' + message: pancakes are good + object: check + check_bottom_template_id: tmpl_a + attachment_template_id: tmpl_a + check_bottom_template_version_id: vrsn_a + attachment_template_version_id: vrsn_a + merge_variables: {} + use_type: operational + deleted: true + - id: chk_92b9a6714bc0557c + description: Demo Check + metadata: {} + check_number: 12558 + memo: rent + amount: 22.5 + url: >- + https://lob-assets.com/checks/chk_92b9a6714bc0557c.pdf?version=v1&expires=1568239682&signature=jCct5PvzU58Iz2pSo58nf6rgsMRcJfMbUWThmm6lztFl5Vn2Y204b9h7gvw0vJvkDK2ThfaYqaUbWc0KzTpvAg + to: + id: adr_bae820679f3f536b + name: HARRY ZHANG + address_line1: 210 KING ST STE 6100 + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2018-12-08T03:08:43.446Z' + date_modified: '2018-12-08T03:08:43.446Z' + object: address + from: + id: adr_210a8d4b0b76d77b + name: LEORE AVIDAR + address_line1: 210 KING ST STE 6100 + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2018-12-08T03:01:07.651Z' + date_modified: '2018-12-08T03:01:07.651Z' + object: address + bank_account: + id: bank_8cad8df5354d33f + description: Test Bank Account + metadata: {} + routing_number: '322271627' + account_number: '123456789' + account_type: individual + signatory: John Doe + bank_name: J.P. MORGAN CHASE BANK, N.A. + verified: true + date_created: '2015-11-06T19:24:24.440Z' + date_modified: '2015-11-06T19:41:28.312Z' + object: bank_account + carrier: USPS + tracking_events: [] + thumbnails: + - small: >- + https://lob-assets.com/checks/chk_92b9a6714bc0557c_thumb_small_1.png?version=v1&expires=1568239682&signature=ublquO_xAdvAkAwGJuOjgZQwcz7c3Ao4NHWHeDVTBEBjcrQr8LavxWEwUc1KU105Zex3SajRQLd6hqJOrDl0Bw + medium: >- + https://lob-assets.com/checks/chk_92b9a6714bc0557c_thumb_medium_1.png?version=v1&expires=1568239682&signature=vHyuOtsanX4HnY_0LNft6ZJ8C67JnbI8ZVCjA2d9nR0Rd6lCl0Nk1s6BAhefbBkzecX9Yp0B8NWN9Q5v1Z4ICw + large: >- + https://lob-assets.com/checks/chk_92b9a6714bc0557c_thumb_large_1.png?version=v1&expires=1568239682&signature=SzCLKJ5m_TKJPLlL9PMw-zW9wo5mVYEK1jCtHwWRwwEaNU2v4Aehy-YHtus3TFJIt8RD2M-0Y3MtCxHwhqSABg + - small: >- + https://lob-assets.com/checks/chk_92b9a6714bc0557c_thumb_small_2.png?version=v1&expires=1568239682&signature=iElagODaOCkF_lCUxIw-lK50GhEU1ar_odmslCazZqD4Fsd_rQLx3M4Q5HzYWp4evfzuCoFvk4oAQVuIAaguAw + medium: >- + https://lob-assets.com/checks/chk_92b9a6714bc0557c_thumb_medium_2.png?version=v1&expires=1568239682&signature=2vwvm_QsfmdtkAa-_F4uk-0yeUPRascyhfwOr-OX1ya9i_8gdFQAxMTrP-FfNBVSYFXeknFm6IUPJHggfgeiBg + large: >- + https://lob-assets.com/checks/chk_92b9a6714bc0557c_thumb_large_2.png?version=v1&expires=1568239682&signature=NQf7tP9F4rP66S16hQ8duFpZSbTjaGBGK61Sr3H5D4CWtRyaPdoQlIpT2Jw-eKRcuYRkDEtQse_oWtL5gPqXDQ + - small: >- + https://lob-assets.com/checks/chk_92b9a6714bc0557c_thumb_small_3.png?version=v1&expires=1568239682&signature=dbjFd44H9TyZsc3d0fqKon5e0GqZ6GA1dT26MH6WnoX8lrQor2CA6sZJ5qmu0Z4SAFlMKAzb-twqN7faLjEbDQ + medium: >- + https://lob-assets.com/checks/chk_92b9a6714bc0557c_thumb_medium_3.png?version=v1&expires=1568239682&signature=vSgwVs7T9E6KKBK7XU-6jRL9i0jvgTqvNxkdRARFf0UNlryJFm8l_t_x5mPH0sCTFZcLp7ouRaR5hhdHC6vZBQ + large: >- + https://lob-assets.com/checks/chk_92b9a6714bc0557c_thumb_large_3.png?version=v1&expires=1568239682&signature=If4tXlN13WYy7JDPpFkWw0HAQpYNJHqi2UstiPHxUA_8IAj6vXORb-22acI124Pd1bR1QSjBHAW1gbiJ0kjiAQ + merge_variables: null + expected_delivery_date: '2019-08-16' + mail_type: usps_first_class + date_created: '2019-08-08T19:34:27.802Z' + date_modified: '2019-08-08T19:34:30.582Z' + send_date: '2019-08-08T19:34:27.802Z' + use_type: operational + object: check + object: list + next_url: >- + https://api.lob.com/v1/checks?limit=2&after=eyJkYXRlT2Zmc2V0IjoiMjAxOS0wOC0wOFQxOTozNDoyNy44MDJaIiwiaWRPZmZzZXQiOiJjaGtfOTJiOWE2NzE0YmMwNTU3YyJ9 + previous_url: null + count: 2 + post_check: + description: Returns a check object + headers: + ratelimit-limit: + $ref: '#/components/headers/ratelimit-limit' + ratelimit-remaining: + $ref: '#/components/headers/ratelimit-remaining' + ratelimit-reset: + $ref: '#/components/headers/ratelimit-reset' + content: + application/json: + schema: + $ref: '#/components/schemas/check' + example: + id: chk_534f10783683daa0 + description: Demo Check + metadata: {} + check_number: 10062 + memo: rent + amount: 22.5 + url: >- + https://lob-assets.com/checks/chk_534f10783683daa0.pdf?expires=1540372221&signature=Ty3IV2bGPEoQfrdraYHlNYTaarnHLXb + to: + id: adr_bae820679f3f536b + description: Harry - Office + name: HARRY ZHANG + company: LOB + email: harry@lob.com + phone: '5555555555' + address_line1: 210 KING ST STE 6100 + address_line2: '' + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2018-12-08T03:08:43.446Z' + date_modified: '2018-12-08T03:08:43.446Z' + object: address + recipient_moved: false + from: + id: adr_b8fb5acf3a2b55db + name: LEORE AVIDAR + address_line1: 210 KING ST STE 6100 + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2017-09-05T17:47:53.767Z' + date_modified: '2017-09-05T17:47:53.767Z' + object: address + bank_account: + id: bank_8cad8df5354d33f + description: Test Bank Account + metadata: {} + routing_number: '322271627' + account_number: '123456789' + signatory: John Doe + bank_name: J.P. MORGAN CHASE BANK, N.A. + verified: true + account_type: company + date_created: '2015-11-06T19:24:24.440Z' + date_modified: '2015-11-06T19:41:28.312Z' + object: bank_account + signature_url: >- + https://lob-assets.com/bank-accounts/asd_asdfghjkqwertyui.pdf?expires=1234567890&signature=aksdf + carrier: USPS + tracking_events: [] + thumbnails: + - small: >- + https://lob-assets.com/checks/chk_534f10783683daa0_thumb_small_1.png?expires=1540372221&signature=ShhPpH74wYkNiAj7Il9B6q8ZKkzlGd4 + medium: >- + https://lob-assets.com/checks/chk_534f10783683daa0_thumb_medium_1.png?expires=1540372221&signature=tmIOq6aAyKgzAECp7STj1rvJuMS5Svd + large: >- + https://lob-assets.com/checks/chk_534f10783683daa0_thumb_large_1.png?expires=1540372221&signature=04nLEwE9d2qgQJNgJYWSOgPnU0FZbEv + merge_variables: + name: Harry + expected_delivery_date: '2017-09-12' + mail_type: usps_first_class + date_created: '2017-09-05T17:47:53.896Z' + date_modified: '2017-09-05T17:47:53.896Z' + send_date: '2017-09-05T17:47:53.896Z' + object: check + message: pancakes are good + check_bottom_template_id: tmpl_a + attachment_template_id: tmpl_a + check_bottom_template_version_id: vrsn_a + attachment_template_version_id: vrsn_a + use_type: operational + deleted: true + check_canceled: + description: Deleted + content: + application/json: + schema: + $ref: '#/components/schemas/check_deletion' + example: + id: chk_123456789 + deleted: true + creatives_error: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + example: + error: + code: not_found + message: creative not found + status_code: 404 + identity_validation_error: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + example: + error: + code: invalid + message: recipient is required + status_code: 422 + identity_validation: + description: Returns the likelihood a given name is associated with an address. + headers: + ratelimit-limit: + $ref: '#/components/headers/ratelimit-limit' + ratelimit-remaining: + $ref: '#/components/headers/ratelimit-remaining' + ratelimit-reset: + $ref: '#/components/headers/ratelimit-reset' + content: + application/json: + schema: + $ref: '#/components/schemas/identity_validation' + example: + id: id_validation_8a013f3e + recipient: LARRY LOBSTER + primary_line: 210 KING ST. + secondary_line: '' + urbanization: '' + last_line: SAN FRANCISCO CA 94107-1728 + score: 100 + confidence: high + object: id_validation + intl_autocompletions_error: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + example: + error: + code: invalid + message: address_prefix is required + status_code: 422 + intl_autocompletions: + description: Returns an international autocompletions object. + headers: + ratelimit-limit: + $ref: '#/components/headers/ratelimit-limit' + ratelimit-remaining: + $ref: '#/components/headers/ratelimit-remaining' + ratelimit-reset: + $ref: '#/components/headers/ratelimit-reset' + content: + application/json: + schema: + $ref: '#/components/schemas/intl_autocompletions' + examples: + basic: + value: + id: intl_auto_a3ac97bcfbb2460ab20c + suggestions: + - primary_number_range: '' + primary_line: 340 WATERSTONE PL SE + city: AIRDRIE + state: AB + country: CA + zip_code: T4B 2G7 + - primary_number_range: '' + primary_line: 340 WATT BLVD SW + city: EDMONTON + state: AB + country: CA + zip_code: T6X 1R7 + - primary_number_range: '' + primary_line: 340 WATROUS ST + city: PRINCE GEORGE + state: BC + country: CA + zip_code: V2M 2B6 + - primary_number_range: '' + primary_line: 340 WATERS RD + city: QUALICUM BEACH + state: BC + country: CA + zip_code: V9K 2B8 + - primary_number_range: '' + primary_line: SUITE 340, 1510 WATT DR SW + city: EDMONTON + state: AB + country: CA + zip_code: T6X 2E6 + - primary_number_range: '' + primary_line: WATERFRONT POINTE WEST SUITE 340, 5212 25 AVE NW + city: EDMONTON + state: AB + country: CA + zip_code: T6L 6R7 + - primary_number_range: '' + primary_line: WATERFRONT POINTE EAST SUITE 340, 2520 52 ST NW + city: EDMONTON + state: AB + country: CA + zip_code: T6L 6S2 + - primary_number_range: '' + primary_line: WATERSTONE SUITE 340, 6079 MAYNARD WAY NW + city: EDMONTON + state: AB + country: CA + zip_code: T6R 0S4 + - primary_number_range: '' + primary_line: WATSON APTS. SUITE 340, 5207 39 ST + city: RED DEER + state: AB + country: CA + zip_code: T4N 0Z9 + - primary_number_range: '' + primary_line: WATERS EDGE SUITE 3400..3409, 2600 FERGUSON RD + city: SAANICHTON + state: BC + country: CA + zip_code: V8M 2C1 + object: intl_autocompletion + test: + value: + id: intl_auto_a3ac97bcfbb2460ab20c + suggestions: + - primary_number_range: '' + primary_line: 1 TWIN OAKS CT + city: GREENVILLE + state: SC + country: CA + zip_code: '29615' + - primary_number_range: '' + primary_line: 1 TEVA DR + city: STAR CITY + state: CA + country: CA + zip_code: '91355' + - primary_number_range: '' + primary_line: 1 TELEGRAM AVE + city: ELMONT + state: NY + country: CA + zip_code: '11003' + - primary_number_range: '' + primary_line: 1 TELEGRAM AVE + city: GARDEN CITY + state: KS + country: CA + zip_code: '67846' + - primary_number_range: '' + primary_line: 1 TELEGRAPH HILL RD + city: HOLMDEL + state: NJ + country: CA + zip_code: '07733' + - primary_number_range: '' + primary_line: 1 TELEGRAPH HILL RD S + city: HOLMDEL + state: NJ + country: CA + zip_code: '07733' + - primary_number_range: '' + primary_line: 1 TELEGRAPH HILL BLVD + city: SAN FRANCISCO + state: CA + country: CA + zip_code: '94133' + object: intl_autocompletion + intl_verifications: + description: Returns an international verification object. + headers: + ratelimit-limit: + $ref: '#/components/headers/ratelimit-limit' + ratelimit-remaining: + $ref: '#/components/headers/ratelimit-remaining' + ratelimit-reset: + $ref: '#/components/headers/ratelimit-reset' + content: + application/json: + schema: + $ref: '#/components/schemas/intl_verification' + examples: + full: + value: + id: intl_ver_c7cb63d68f8d6 + recipient: null + primary_line: 370 WATER ST + secondary_line: '' + last_line: SUMMERSIDE PE C1N 1C4 + country: CA + coverage: SUBBUILDING + deliverability: deliverable + status: LV4 + components: + primary_number: '370' + street_name: WATER ST + city: SUMMERSIDE + state: PE + postal_code: C1N 1C4 + object: intl_verification + test: + value: + id: intl_ver_c7cb63d68f8d6 + recipient: TEST KEYS DO NOT VERIFY ADDRESSES + primary_line: 370 WATER ST + secondary_line: '' + last_line: SUMMERSIDE PE C1N 1C4 + country: CA + coverage: SUBBUILDING + deliverability: deliverable + status: LV4 + components: + primary_number: '370' + street_name: WATER ST + city: SUMMERSIDE + state: PE + postal_code: C1N 1C4 + object: intl_verification + letter_deleted: + description: Deleted + content: + application/json: + schema: + $ref: '#/components/schemas/letter_deletion' + example: + id: ltr_123456789 + deleted: true + all_letters: + description: >- + A dictionary with a data property that contains an array of up to + `limit` letters. Each entry in the array is a separate letter. The + previous and next page of letters can be retrieved by calling the + endpoint contained in the `previous_url` and `next_url` fields in the + API response respectively. If no more letters are available beyond the + current set of returned results, the `next_url` field will be empty. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/list' + - type: object + properties: + data: + type: array + description: list of letters + items: + $ref: '#/components/schemas/letter' + example: + data: + - id: ltr_5ba44b462c79f07c + description: Demo Letter + metadata: {} + to: + id: adr_asdi2y3riuasasoi + description: Harry - Office + name: Harry Zhang + company: Lob + phone: '5555555555' + email: harry@lob.com + metadata: {} + address_line1: 370 WATER ST + address_line2: '' + address_city: SUMMERSIDE + address_state: PRINCE EDWARD ISLAND + address_zip: C1N 1C4 + address_country: CANADA + recipient_moved: false + date_created: '2019-09-20T00:14:00.361Z' + date_modified: '2019-09-20T00:14:00.361Z' + object: address + from: + id: adr_210a8d4b0b76d77b + description: null + name: LEORE AVIDAR + company: null + phone: null + email: null + address_line1: 210 KING ST STE 6100 + address_line2: null + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2018-12-08T03:01:07.651Z' + date_modified: '2018-12-08T03:01:07.651Z' + object: address + color: true + double_sided: false + address_placement: top_first_page + return_envelope: false + perforated_page: null + extra_service: certified + custom_envelope: null + template_id: tmpl_a + template_version_id: vrsn_a + mail_type: usps_first_class + url: >- + https://lob-assets.com/letters/ltr_5ba44b462c79f07c.pdf?version=v1&expires=1568239830&signature=Ob-DUPLJLM4scWQeCDNadPJ4j33MZw16pykOxwv2us-bA7utTYi6oZ8WrEtBYDBBo09XkapR3gdJf0NEr90xAA + merge_variables: null + carrier: USPS + tracking_number: '92071902358909000011275538' + tracking_events: + - id: evnt_9e84094c9368cfb + type: certified + name: Delivered + details: + event: delivered + description: Package has been delivered. + notes: Delivered, Front Desk/Reception/Mail Room + action_required: false + location: '33408' + time: '2019-10-08T19:41:00Z' + date_created: '2019-10-08T19:41:00Z' + date_modified: '2019-10-08T19:41:00Z' + object: tracking_event + thumbnails: + - small: >- + https://lob-assets.com/letters/ltr_5ba44b462c79f07c_thumb_small_1.png?version=v1&expires=1568239830&signature=xZUmE8rq8wSECHPEb9c37cUDZBzGUO3XK5LsIPZhI6dOXgm6zJEn8_7tKuZ3JWBmvNJNXdTl_ufkNu4avjQUDw + medium: >- + https://lob-assets.com/letters/ltr_5ba44b462c79f07c_thumb_medium_1.png?version=v1&expires=1568239830&signature=H7354Qpcm9S4aXbrMsBe6QJ6lSNi9IWPgMJtLWLi4Kyx9tHF8Mp9YEc_IL9x89Jfw4-yRzKDXA410X4W0PssBQ + large: >- + https://lob-assets.com/letters/ltr_5ba44b462c79f07c_thumb_large_1.png?version=v1&expires=1568239830&signature=54LUIDKZyItA9pnC87d1pJVAuw8bhKLCsMpNWkB3LgdVWxPxxb_c1IyIWAbSR-dyOYEOlDBCc40J4Kns-O_mAg + expected_delivery_date: '2019-08-16' + date_created: '2019-08-08T17:09:14.514Z' + date_modified: '2019-08-08T17:09:16.850Z' + send_date: '2019-08-08' + use_type: marketing + fsc: false + object: letter + - id: ltr_da8267c6a6545cd6 + description: Demo Letter + metadata: {} + to: + id: adr_210a8d4b0b76d77b + description: null + name: LEORE AVIDAR + company: null + phone: null + email: null + address_line1: 210 KING ST STE 6100 + address_line2: null + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2018-12-08T03:01:07.651Z' + date_modified: '2018-12-08T03:01:07.651Z' + object: address + from: + id: adr_210a8d4b0b76d77b + description: null + name: LEORE AVIDAR + company: null + phone: null + email: null + address_line1: 210 KING ST STE 6100 + address_line2: null + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2018-12-08T03:01:07.651Z' + date_modified: '2018-12-08T03:01:07.651Z' + object: address + color: true + double_sided: false + address_placement: top_first_page + return_envelope: false + perforated_page: null + extra_service: null + custom_envelope: null + mail_type: usps_first_class + url: >- + https://lob-assets.com/letters/ltr_da8267c6a6545cd6.pdf?version=v1&expires=1568239830&signature=HH-5RnbD4x0eJcnEC9HhqKSvQGsbkjovzvqSKgBijUHKIXwEKQJ4CbYhKs_U2q2A1k20Xefcaw7bfdPKozuqCQ + merge_variables: null + carrier: USPS + tracking_number: null + tracking_events: [] + thumbnails: + - small: >- + https://lob-assets.com/letters/ltr_da8267c6a6545cd6_thumb_small_1.png?version=v1&expires=1568239830&signature=C1Rs83187HpWGhsg_pJIOhDIKlDtC_IgBBxHiocCEzJ8CncJwqrq5yHke-p97Dv7o81G_pfhFmirai589O6DCw + medium: >- + https://lob-assets.com/letters/ltr_da8267c6a6545cd6_thumb_medium_1.png?version=v1&expires=1568239830&signature=gz63l0yi3sK_sXjYfIVdLSvkknJFr_O5TWRulo_iKIgS-PosIl6J0tDR6bx_Tv5Ab_w7DABg3qdKZ846MZ7TCw + large: >- + https://lob-assets.com/letters/ltr_da8267c6a6545cd6_thumb_large_1.png?version=v1&expires=1568239830&signature=4Y1OIymaWkSO3aBIHCeshFAVnF-pDcF2FFqkx_jovaUFuk4FT1SI24L7_POwTRXQHlETMGlzkP_CGgqselRUAA + expected_delivery_date: '2019-08-16' + date_created: '2019-08-08T17:08:12.224Z' + date_modified: '2019-08-08T17:08:13.990Z' + send_date: '2019-08-08T17:08:12.224Z' + cards: null + use_type: marketing + fsc: true + object: letter + object: list + next_url: >- + https://api.lob.com/v1/letters?limit=2&after=eyJkYXRlT2Zmc2V0IjoiMjAxOS0wOC0wOFQxNzowODoxMi4yMjRaIiwiaWRPZmZzZXQiOiJsdHJfZGE4MjY3YzZhNjU0NWNkNiJ9 + previous_url: null + count: 2 + post_letter: + description: Returns a letter object + headers: + ratelimit-limit: + $ref: '#/components/headers/ratelimit-limit' + ratelimit-remaining: + $ref: '#/components/headers/ratelimit-remaining' + ratelimit-reset: + $ref: '#/components/headers/ratelimit-reset' + content: + application/json: + schema: + $ref: '#/components/schemas/letter' + example: + id: ltr_4868c3b754655f90 + description: Demo Letter + metadata: {} + to: + id: adr_d3489cd64c791ab5 + description: null + name: HARRY ZHANG + company: null + phone: null + email: null + address_line1: 210 KING ST STE 6100 + address_line2: null + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2017-09-05T15:54:53.264Z' + date_modified: '2017-09-05T15:54:53.264Z' + deleted: true + object: address + from: + id: adr_b8fb5acf3a2b55db + description: null + name: LEORE AVIDAR + company: null + phone: null + email: null + address_line1: 210 KING ST STE 6100 + address_line2: null + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2017-09-05T15:54:53.264Z' + date_modified: '2017-09-05T15:54:53.264Z' + deleted: true + object: address + color: true + double_sided: true + address_placement: top_first_page + return_envelope: false + perforated_page: null + custom_envelope: null + extra_service: null + mail_type: usps_first_class + url: >- + https://lob-assets.com/letters/ltr_4868c3b754655f90.pdf?expires=1540372221&signature=8r94fse8uam7wGWmW5baxXulU88X2CA + carrier: USPS + tracking_number: null + tracking_events: [] + thumbnails: + - small: >- + https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_small_1.png?expires=1540372221&signature=a5fRBJ22ZA78Vgpg34M9UfmHWTS3eha + medium: >- + https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_medium_1.png?expires=1540372221&signature=bAzL8sv935PY09FWSkpDpWKkyvGSWYF + large: >- + https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_large_1.png?expires=1540372221&signature=gsKvxXgrm4v4iZD3bOibK7jApNkEMdW + merge_variables: + name: Harry + expected_delivery_date: '2017-09-12' + date_created: '2017-09-05T15:54:53.346Z' + date_modified: '2017-09-05T15:54:53.346Z' + send_date: '2017-09-05T15:54:53.346Z' + cards: + - id: card_c51ae96f5cebf3e + account_id: fa9ea650fc7b31a89f92 + description: null + url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA + size: 2.125x3.375 + auto_reorder: false + reorder_quantity: null + raw_url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + front_original_url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + back_original_url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + thumbnails: + - small: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg + medium: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA + large: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw + - small: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_2.png?version=v1&expires=1636910992&signature=IWsmPa_ULlv2yyqjX564d_YfHHY_M7i9YxDnw-WXDr2jtOFcArmRZQbnHeE9g_rYxnddJbgosuv8-c2utiu7Cg + medium: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_2.png?version=v1&expires=1636910992&signature=zxK7VKGiTvz5Ywrkaydd0v3GcYf58R7A08J4tNfI7-aiNODDcTF3l0MqY13n9Pyc8RXSdD0XVBY-OpbA1VM-Ag + large: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_2.png?version=v1&expires=1636910992&signature=r0OFUhh315ZwN0raMZdIwJd2oCIEYsz0BABaMxIuO1PKTD0ckGWrhcGdzk2dlWQ6vSvp0CUQ5k1RXGqkIIqkDw + available_quantity: 10000 + pending_quantity: 0 + countries: null + status: rendered + mode: test + orientation: horizontal + threshold_amount: 0 + date_created: '2017-08-05T15:54:53.346Z' + date_modified: '2017-08-05T15:54:53.346Z' + object: card + use_type: marketing + fsc: false + object: letter + postcard_deleted: + description: Deleted + content: + application/json: + schema: + $ref: '#/components/schemas/postcard_deletion' example: - error: - code: not_found - message: address not found - status_code: 404 - all_addresses: - description: A dictionary with a data property that contains an array of up to `limit` addresses. Each entry in the array is a separate address object. The previous and next page of address entries can be retrieved by calling the endpoint contained in the `previous_url` and `next_url` fields in the API response respectively.
If no more addresses are available beyond the current set of returned results, the `next_url` field will be empty. + id: psc_123456789 + deleted: true + all_postcards: + description: >- + A dictionary with a data property that contains an array of up to + `limit` postcards. Each entry in the array is a separate postcard. The + previous and next page of postcards can be retrieved by calling the + endpoint contained in the `previous_url` and `next_url` fields in the + API response respectively.
If no more postcards are available beyond + the current set of returned results, the `next_url` field will be empty. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/list' + - type: object + properties: + data: + type: array + description: list of postcards + items: + $ref: '#/components/schemas/postcard' + example: + data: + - id: psc_208e45e48d271294 + description: null + metadata: {} + to: + id: adr_210a8d4b0b76d77b + description: null + name: LEORE AVIDAR + company: null + phone: null + email: null + address_line1: 210 KING ST STE 6100 + address_line2: null + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2018-12-08T03:01:07.651Z' + date_modified: '2018-12-08T03:01:07.651Z' + object: address + url: >- + https://lob-assets.com/postcards/psc_208e45e48d271294.pdf?version=v1&expires=1619218302&signature=NfHHLBSr5tOHA_Z4kij4dKqZG8f3vMDtwvuFVeeF9pV_lylcjLsVVODhNCE5hR6-2slUr6t9WMNsi429Pj7_DA + carrier: USPS + front_template_id: null + back_template_id: null + front_template_version_id: null + back_template_version_id: null + date_created: '2021-03-24T22:51:42.838Z' + date_modified: '2021-03-24T22:51:42.838Z' + send_date: '2021-03-24T22:51:42.838Z' + use_type: marketing + fsc: false + object: postcard + - id: psc_0e03d1ad7d31f151 + description: null + metadata: {} + to: + id: adr_c7cb63d68f8d6 + description: null + name: JANE DOE + company: LOB + phone: '5555555555' + email: jane.doe@lob.com + address_line1: 370 WATER ST + address_line2: '' + address_city: SUMMERSIDE + address_state: PE + address_zip: C1N 1C4 + address_country: CANADA + metadata: {} + date_created: '2018-12-08T03:01:07.651Z' + date_modified: '2018-12-08T03:01:07.651Z' + object: address + recipient_moved: false + from: + id: adr_210a8d4b0b76d77b + description: null + name: LEORE AVIDAR + company: null + phone: null + email: null + address_line1: 210 KING ST STE 6100 + address_line2: null + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2018-12-08T03:01:07.651Z' + date_modified: '2018-12-08T03:01:07.651Z' + object: address + url: >- + https://lob-assets.com/postcards/psc_208e45e48d271294.pdf?version=v1&expires=1619218302&signature=NfHHLBSr5tOHA_Z4kij4dKqZG8f3vMDtwvuFVeeF9pV_lylcjLsVVODhNCE5hR6-2slUr6t9WMNsi429Pj7_DA + carrier: USPS + front_template_id: null + back_template_id: null + front_template_version_id: null + back_template_version_id: null + tracking_events: [] + size: 6x11 + mail_type: usps_first_class + merge_variables: {} + thumbnails: + - small: >- + https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_small_1.png?expires=1540372221&signature=a5fRBJ22ZA78Vgpg34M9UfmHWTS3eha + medium: >- + https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_medium_1.png?expires=1540372221&signature=bAzL8sv935PY09FWSkpDpWKkyvGSWYF + large: >- + https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_large_1.png?expires=1540372221&signature=gsKvxXgrm4v4iZD3bOibK7jApNkEMdW + expected_delivery_date: '2021-03-30' + date_created: '2021-03-24T22:51:42.838Z' + date_modified: '2021-03-24T22:51:42.838Z' + send_date: '2021-03-24T22:51:42.838Z' + use_type: marketing + fsc: false + object: postcard + object: list + previous_url: null + next_url: null + count: 2 + post_postcard: + description: Returns a postcard object + headers: + ratelimit-limit: + $ref: '#/components/headers/ratelimit-limit' + ratelimit-remaining: + $ref: '#/components/headers/ratelimit-remaining' + ratelimit-reset: + $ref: '#/components/headers/ratelimit-reset' + content: + application/json: + schema: + $ref: '#/components/schemas/postcard' + examples: + basic: + value: + id: psc_208e45e48d271294 + description: null + metadata: {} + to: + id: adr_210a8d4b0b76d77b + description: null + name: null + company: LOB + phone: null + email: null + address_line1: 210 KING ST STE 6100 + address_line2: null + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2018-12-08T03:01:07.651Z' + date_modified: '2018-12-08T03:01:07.651Z' + object: address + url: >- + https://lob-assets.com/postcards/psc_208e45e48d271294.pdf?version=v1&expires=1619218302&signature=NfHHLBSr5tOHA_Z4kij4dKqZG8f3vMDtwvuFVeeF9pV_lylcjLsVVODhNCE5hR6-2slUr6t9WMNsi429Pj7_DA + carrier: USPS + front_template_id: null + back_template_id: null + date_created: '2021-03-24T22:51:42.838Z' + date_modified: '2021-03-24T22:51:42.838Z' + send_date: '2021-03-24T22:51:42.838Z' + use_type: marketing + fsc: false + object: postcard + full: + value: + id: psc_0e03d1ad7d31f151 + description: null + metadata: {} + to: + id: adr_c7cb63d68f8d6 + description: null + name: JANE DOE + company: LOB + phone: '5555555555' + email: jane.doe@lob.com + address_line1: 370 WATER ST + address_line2: '' + address_city: SUMMERSIDE + address_state: PE + address_zip: C1N 1C4 + address_country: CANADA + metadata: {} + date_created: '2018-12-08T03:01:07.651Z' + date_modified: '2018-12-08T03:01:07.651Z' + object: address + recipient_moved: false + from: + id: adr_210a8d4b0b76d77b + description: null + name: LEORE AVIDAR + company: null + phone: null + email: null + address_line1: 210 KING ST STE 6100 + address_line2: null + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2018-12-08T03:01:07.651Z' + date_modified: '2018-12-08T03:01:07.651Z' + object: address + url: >- + https://lob-assets.com/postcards/psc_208e45e48d271294.pdf?version=v1&expires=1619218302&signature=NfHHLBSr5tOHA_Z4kij4dKqZG8f3vMDtwvuFVeeF9pV_lylcjLsVVODhNCE5hR6-2slUr6t9WMNsi429Pj7_DA + carrier: USPS + front_template_id: tmpl_93c369f06171958 + back_template_id: tmpl_93c369f06171958 + front_template_version_id: vrsn_a83e044941c393b + back_template_version_id: vrsn_a83e044941c393b + tracking_events: [] + size: 6x11 + mail_type: usps_first_class + merge_variables: {} + thumbnails: + - small: >- + https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_small_1.png?expires=1540372221&signature=a5fRBJ22ZA78Vgpg34M9UfmHWTS3eha + medium: >- + https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_medium_1.png?expires=1540372221&signature=bAzL8sv935PY09FWSkpDpWKkyvGSWYF + large: >- + https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_large_1.png?expires=1540372221&signature=gsKvxXgrm4v4iZD3bOibK7jApNkEMdW + expected_delivery_date: '2021-03-30' + date_created: '2021-03-24T22:51:42.838Z' + date_modified: '2021-03-24T22:51:42.838Z' + send_date: '2021-03-24T22:51:42.838Z' + use_type: marketing + fsc: false + object: postcard + self_mailer_deleted: + description: Deleted + content: + application/json: + schema: + $ref: '#/components/schemas/self_mailer_deletion' + example: + id: sfm_123456789 + deleted: true + all_self_mailers: + description: >- + A dictionary with a data property that contains an array of up to + `limit` self_mailers. Each entry in the array is a separate self_mailer. + The previous and next page of self_mailers can be retrieved by calling + the endpoint contained in the `previous_url` and `next_url` fields in + the API response respectively.
If no more self_mailers are available + beyond the current set of returned results, the `next_url` field will be + empty. content: application/json: schema: @@ -21139,49 +12568,159 @@ components: properties: data: type: array - description: list of addresses + description: list of self_mailers items: - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/self_mailer' example: data: - - id: adr_e68217bd744d65c8 - description: Harry - Office - name: HARRY ZHANG - company: LOB - phone: '5555555555' - email: harry@lob.com - address_line1: 210 KING ST STE 6100 - address_line2: null - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES + - id: sfm_7239rhwqkrfaskas + description: April Campaign metadata: {} - date_created: '2019-08-12T00:16:00.361Z' - date_modified: '2019-08-12T00:16:00.361Z' - object: address - - id: adr_asdi2y3riuasasoi - description: Harry - Office - name: Harry Zhang - company: Lob - phone: '5555555555' - email: harry@lob.com + to: + id: adr_asdi2y3riuasasoi + description: Harry - Office + name: Harry Zhang + company: Lob + phone: '5555555555' + email: harry@lob.com + metadata: {} + address_line1: 370 WATER ST + address_line2: '' + address_city: SUMMERSIDE + address_state: PRINCE EDWARD ISLAND + address_zip: C1N 1C4 + address_country: CANADA + recipient_moved: false + date_created: '2019-09-20T00:14:00.361Z' + date_modified: '2019-09-20T00:14:00.361Z' + object: address + from: + id: adr_210a8d4b0b76d77b + description: null + name: null + company: LOB + phone: null + email: null + address_line1: 210 KING ST STE 6100 + address_line2: null + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2018-12-08T03:01:07.651Z' + date_modified: '2018-12-08T03:01:07.651Z' + object: address + url: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf.pdf?version=v1&expires=1618781264&signature=YP_bCwrgVA2lz1Gr1YVCJN1f-WspUGsH0aJp2ihjfLXU7lDUV12_xRv4uPch0mfWeOOxEqpyP8hGpgvjmQKNAw + outside_template_id: tmpl_a3cb937f26d7eec + inside_template_id: tmpl_a3cb937f26d7eec + inside_template_version_id: vrsn_bfdf70893b00a85 + outside_template_version_id: vrsn_bfdf70893b00a85 + carrier: USPS + tracking_events: [] + thumbnails: + - small: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_small_1.png?version=v1&expires=1618781264&signature=A7q5HbRO53sUYYnwGlmP5mTS6ylLE7kS2mYhfcEOdexjyqG7UseK0MD26DppE4Q0aE4u2msDVMxd5ukjMerYCg + medium: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_medium_1.png?version=v1&expires=1618781264&signature=b9pynuawVpU_vrhnT_mTpksdE-FLF_ZjdIBOFR_ltIzEGlx-VKD4VvZrqP98lG2D8V7UKQ7SdRr2nUAk4LxvCg + large: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_large_1.png?version=v1&expires=1618781264&signature=g2jifhCselPqIj8au6lsbJMNFN8ZX3aM6GkLoAXiHBCS8X5mF9nhVbmO0odpnmwNlV1CWIp-MXVsZkC3NmxqBQ + - small: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_small_2.png?version=v1&expires=1618781264&signature=biJY4-ZbNNRydPYg3cZkq7wxjILbPBK_nIVyoyQsg5X5q4jlsa-2fzeMa48V9jprUetsC6WEuYvasHosRfG_DQ + medium: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_medium_2.png?version=v1&expires=1618781264&signature=xEAX7bURyc8fSphacuo5yb7iVIpT8Xvq05KgMaNQS4r3aCpx0z1p42wbPmW758B5Ae0li1YDYvVyzS7qJIoWAw + large: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_large_2.png?version=v1&expires=1618781264&signature=NieHDnoQ7STZUvofHrFt7S987CzIkUJWpaSgpVQPZw-C3_wwTPsIrvxYdXEuFrr6ciTUcxRBFPlE0lurmMkyCA + merge_variables: + name: null + size: 6x18_bifold + mail_type: usps_first_class + expected_delivery_date: '2021-03-24' + date_created: '2021-03-16T18:40:40.504Z' + date_modified: '2021-03-16T18:41:06.691Z' + send_date: '2021-03-16T18:45:40.493Z' + deleted: true + use_type: marketing + fsc: false + object: self_mailer + - id: sfm_8ffbe811dea49dcf + description: April Campaign metadata: {} - address_line1: 370 WATER ST - address_line2: '' - address_city: SUMMERSIDE - address_state: PRINCE EDWARD ISLAND - address_zip: C1N 1C4 - address_country: CANADA - date_created: '2019-09-20T00:14:00.361Z' - date_modified: '2019-09-20T00:14:00.361Z' - object: address + to: + id: adr_f9228b743884ff98 + description: null + name: AYA + company: null + phone: null + email: null + address_line1: 2812 PARK RD + address_line2: null + address_city: CHARLOTTE + address_state: NC + address_zip: 28209-1314 + address_country: UNITED STATES + metadata: {} + date_created: '2021-03-16T18:40:40.410Z' + date_modified: '2021-03-16T18:40:40.410Z' + deleted: true + object: address + from: + id: adr_210a8d4b0b76d77b + description: null + name: null + company: LOB + phone: null + email: null + address_line1: 210 KING ST STE 6100 + address_line2: null + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2018-12-08T03:01:07.651Z' + date_modified: '2018-12-08T03:01:07.651Z' + object: address + url: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf.pdf?version=v1&expires=1618781264&signature=YP_bCwrgVA2lz1Gr1YVCJN1f-WspUGsH0aJp2ihjfLXU7lDUV12_xRv4uPch0mfWeOOxEqpyP8hGpgvjmQKNAw + outside_template_id: tmpl_a3cb937f26d7eec + inside_template_id: tmpl_a3cb937f26d7eec + inside_template_version_id: vrsn_bfdf70893b00a85 + outside_template_version_id: vrsn_bfdf70893b00a85 + carrier: USPS + tracking_events: [] + thumbnails: + - small: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_small_1.png?version=v1&expires=1618781264&signature=A7q5HbRO53sUYYnwGlmP5mTS6ylLE7kS2mYhfcEOdexjyqG7UseK0MD26DppE4Q0aE4u2msDVMxd5ukjMerYCg + medium: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_medium_1.png?version=v1&expires=1618781264&signature=b9pynuawVpU_vrhnT_mTpksdE-FLF_ZjdIBOFR_ltIzEGlx-VKD4VvZrqP98lG2D8V7UKQ7SdRr2nUAk4LxvCg + large: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_large_1.png?version=v1&expires=1618781264&signature=g2jifhCselPqIj8au6lsbJMNFN8ZX3aM6GkLoAXiHBCS8X5mF9nhVbmO0odpnmwNlV1CWIp-MXVsZkC3NmxqBQ + - small: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_small_2.png?version=v1&expires=1618781264&signature=biJY4-ZbNNRydPYg3cZkq7wxjILbPBK_nIVyoyQsg5X5q4jlsa-2fzeMa48V9jprUetsC6WEuYvasHosRfG_DQ + medium: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_medium_2.png?version=v1&expires=1618781264&signature=xEAX7bURyc8fSphacuo5yb7iVIpT8Xvq05KgMaNQS4r3aCpx0z1p42wbPmW758B5Ae0li1YDYvVyzS7qJIoWAw + large: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_large_2.png?version=v1&expires=1618781264&signature=NieHDnoQ7STZUvofHrFt7S987CzIkUJWpaSgpVQPZw-C3_wwTPsIrvxYdXEuFrr6ciTUcxRBFPlE0lurmMkyCA + merge_variables: + name: null + size: 6x18_bifold + mail_type: usps_first_class + expected_delivery_date: '2021-03-24' + date_created: '2021-03-16T18:40:40.504Z' + date_modified: '2021-03-16T18:41:06.691Z' + send_date: '2021-03-16T18:45:40.493Z' + deleted: true + use_type: marketing + fsc: true + object: self_mailer object: list - next_url: https://api.lob.com/v1/addresses?limit=2&after=eyJkYXRlT2Zmc2V0IjoiMjAxOS0wOC0wN1QyMTo1OTo0Ni43NjRaIiwiaWRPZmZzZXQiOiJhZHJfODMwYmYwZWFiZGFhYTQwOSJ9 + next_url: null previous_url: null count: 2 - post_address: - description: Echos the writable fields of a newly created address object. + post_self_mailer: + description: Returns a self_mailer object headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' @@ -21192,98 +12731,165 @@ components: content: application/json: schema: - $ref: '#/components/schemas/address' - examples: - full_us: - value: - id: adr_d3489cd64c791ab5 - description: Harry - Office - name: HARRY ZHANG - company: LOB - phone: '5555555555' - email: harry@lob.com - address_line1: 210 KING ST STE 6100 - address_city: SAN FRANCISCO - address_state: CA - address_zip: '94107' - address_country: UNITED STATES - metadata: {} - date_created: '2017-09-05T17:47:53.767Z' - date_modified: '2017-09-05T17:47:53.767Z' - object: address - full_intl: - value: - id: adr_b9f49f464c836203 - description: Harry - Office - name: HARRY ZHANG - company: LOB - phone: '5555555555' - email: harry@lob.com - address_line1: 370 WATER ST - address_city: SUMMERSIDE - address_state: PRINCE EDWARD ISLAND - address_zip: C1N 1C4 - address_country: CANADA - metadata: {} - date_created: '2021-11-29T20:55:46.843Z' - date_modified: '2021-11-29T20:56:46.843Z' - object: address - ncoa_us_live: - value: - id: adr_d3489cd64c791ab5 - description: Harry - Office - name: HARRY ZHANG - company: LOB - phone: '5555555555' - email: harry@lob.com - address_line1: ████ - address_line2: ████ - address_city: SAN FRANCISCO - address_state: CA - address_zip: '94107' - address_country: UNITED STATES - metadata: {} - date_created: '2017-09-05T17:47:53.767Z' - date_modified: '2017-09-05T17:47:53.767Z' - recipient_moved: true - inline: false - object: address - ncoa_us_test: - value: - id: adr_e463565030210e12 - description: null - name: TEST KEYS DO NOT VERIFY ADDRESSES - company: null - phone: null - email: null - address_line1: ████ - address_line2: ████ - address_city: SAN FRANCISCO - address_state: CA - address_zip: '94107' - address_country: UNITED STATES - metadata: {} - date_created: '2019-12-05T19:39:19.932Z' - date_modified: '2019-12-05T19:39:19.932Z' - recipient_moved: true - inline: false - object: address - address: - description: Returns an address object if a valid identifier was provided. - content: - application/json: - schema: - $ref: '#/components/schemas/address' - address_deleted: - description: Deleted + $ref: '#/components/schemas/self_mailer' + example: + id: sfm_8ffbe811dea49dcf + description: April Campaign + metadata: {} + to: + id: adr_bae820679f3f536b + description: null + name: HARRY ZHANG + company: null + phone: null + email: null + address_line1: 210 KING ST STE 6100 + address_line2: null + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2017-09-05T17:47:53.767Z' + date_modified: '2017-09-05T17:47:53.767Z' + deleted: true + object: address + from: + id: adr_210a8d4b0b76d77b + description: null + name: LEORE AVIDAR + company: null + phone: null + email: null + address_line1: 210 KING ST STE 6100 + address_line2: null + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2017-09-05T17:47:53.767Z' + date_modified: '2017-09-05T17:47:53.767Z' + deleted: true + object: address + url: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf.pdf?version=v1&expires=1618512040&signature=qvyCqXI1ndBvc4AjvG8FlirqLXEcfmYo4sDrRtabaXMOsX88to9G3K49uIk_aqevvZXe8HoRYD_nWydbQHqaCA + outside_template_id: tmpl_a3cb937f26d7eec + inside_template_id: tmpl_a3cb937f26d7eec + inside_template_version_id: vrsn_bfdf70893b00a85 + outside_template_version_id: vrsn_bfdf70893b00a85 + carrier: USPS + tracking_events: [] + thumbnails: + - small: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_small_1.png?version=v1&expires=1618512040&signature=-bipeUHP-hAMcCBSrWM0ZH1VwRdSPNVGGZN9hAZKr6Lh4ly6uxvratVd5LXJCK_zOEMYk_mTWASt0ge7OY6SDA + medium: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_medium_1.png?version=v1&expires=1618512040&signature=ryxN7bsXGtw_GRFSP3Cs3A3IYjxZi3cW9BHDCNgMt6p3nobVmsc_iFHt2e-S7ndAXhhN7nP-MQVov3bt3r37BQ + large: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_large_1.png?version=v1&expires=1618512040&signature=kBrm00xkyCkJNJRHxH8HshFaebtOxnzjVWOs1VVmGMuw8H6OBNcMAMxt9s49K0jlpHoh3Nr9uSncEZMQaaNjAg + - small: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_small_2.png?version=v1&expires=1618512040&signature=3gTgU7Fd3KoT_vNlQnTGptRps5ZgnkhSnPrAwk7L98higIzSwfKoLvuu_DIpMM48dHbxckKT9waR8euJ4KSDBQ + medium: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_medium_2.png?version=v1&expires=1618512040&signature=Ue1lw5CMj7KRx6cMQL8xPeazaHCdJzWcACd1w3acuYPnWkVIpSt62OIO7hAtpAQK9xm1dhhlFj0rqRZMdRMMBA + large: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_large_2.png?version=v1&expires=1618512040&signature=cICc7HEm1xG_eyM4a_wtvPk2FqoLRmtgGa29kJisWnMIYBL0OkyzG4ZCYGMhp-5cZpJlSpXfTgGKh_Qmeo1TDw + merge_variables: + name: null + size: 6x18_bifold + mail_type: usps_first_class + expected_delivery_date: '2021-03-24' + date_created: '2021-03-16T18:40:40.504Z' + date_modified: '2021-03-16T18:40:40.504Z' + send_date: '2021-03-16T18:45:40.493Z' + use_type: marketing + fsc: false + object: self_mailer + post_snap_pack: + description: Returns a snap_pack object + headers: + ratelimit-limit: + $ref: '#/components/headers/ratelimit-limit' + ratelimit-remaining: + $ref: '#/components/headers/ratelimit-remaining' + ratelimit-reset: + $ref: '#/components/headers/ratelimit-reset' content: application/json: schema: - $ref: '#/components/schemas/address_deletion' + $ref: '#/components/schemas/snap_pack' example: - id: adr_123456789 - deleted: true - bank_account_error: + id: ord_0d6a16a3fff6318ac8f8008dc1 + description: April Campaign + to: + id: adr_bae820679f3f536b + description: null + name: HARRY ZHANG + company: null + phone: null + email: null + address_line1: 210 KING ST STE 6100 + address_line2: null + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2017-09-05T17:47:53.767Z' + date_modified: '2017-09-05T17:47:53.767Z' + deleted: true + object: address + from: + id: adr_210a8d4b0b76d77b + description: null + name: LEORE AVIDAR + company: null + phone: null + email: null + address_line1: 210 KING ST STE 6100 + address_line2: null + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2017-09-05T17:47:53.767Z' + date_modified: '2017-09-05T17:47:53.767Z' + deleted: true + object: address + url: >- + https://lob-assets.com/order-creatives/ord_0d6a16a3fff6318ac8f8008dc1_comp_a20fd48ba4efda76ee827400d.pdf?version=v1&expires=1618512040&signature=qvyCqXI1ndBvc4AjvG8FlirqLXEcfmYo4sDrRtabaXMOsX88to9G3K49uIk_aqevvZXe8HoRYD_nWydbQHqaCA + outside_template_id: tmpl_a3cb937f26d7eec + inside_template_id: tmpl_a3cb937f26d7eec + inside_template_version_id: vrsn_bfdf70893b00a85 + outside_template_version_id: vrsn_bfdf70893b00a85 + carrier: USPS + tracking_events: [] + thumbnails: + - small: >- + https://lob-assets.com/order-creatives/ord_0d6a16a3fff6318ac8f8008dc1_comp_a20fd48ba4efda76ee827400d_thumb_small_1.png?version=v1&expires=1618512040&signature=-bipeUHP-hAMcCBSrWM0ZH1VwRdSPNVGGZN9hAZKr6Lh4ly6uxvratVd5LXJCK_zOEMYk_mTWASt0ge7OY6SDA + medium: >- + https://lob-assets.com/order-creatives/ord_0d6a16a3fff6318ac8f8008dc1_comp_a20fd48ba4efda76ee827400d_thumb_medium_1.png?version=v1&expires=1618512040&signature=ryxN7bsXGtw_GRFSP3Cs3A3IYjxZi3cW9BHDCNgMt6p3nobVmsc_iFHt2e-S7ndAXhhN7nP-MQVov3bt3r37BQ + large: >- + https://lob-assets.com/order-creatives/ord_0d6a16a3fff6318ac8f8008dc1_comp_a20fd48ba4efda76ee827400d_thumb_large_1.png?version=v1&expires=1618512040&signature=kBrm00xkyCkJNJRHxH8HshFaebtOxnzjVWOs1VVmGMuw8H6OBNcMAMxt9s49K0jlpHoh3Nr9uSncEZMQaaNjAg + - small: >- + https://lob-assets.com/order-creatives/ord_0d6a16a3fff6318ac8f8008dc1_comp_a20fd48ba4efda76ee827400d_thumb_small_2.png?version=v1&expires=1618512040&signature=3gTgU7Fd3KoT_vNlQnTGptRps5ZgnkhSnPrAwk7L98higIzSwfKoLvuu_DIpMM48dHbxckKT9waR8euJ4KSDBQ + medium: >- + https://lob-assets.com/order-creatives/ord_0d6a16a3fff6318ac8f8008dc1_comp_a20fd48ba4efda76ee827400d_thumb_medium_2.png?version=v1&expires=1618512040&signature=Ue1lw5CMj7KRx6cMQL8xPeazaHCdJzWcACd1w3acuYPnWkVIpSt62OIO7hAtpAQK9xm1dhhlFj0rqRZMdRMMBA + large: >- + https://lob-assets.com/order-creatives/ord_0d6a16a3fff6318ac8f8008dc1_comp_a20fd48ba4efda76ee827400d_thumb_large_2.png?version=v1&expires=1618512040&signature=cICc7HEm1xG_eyM4a_wtvPk2FqoLRmtgGa29kJisWnMIYBL0OkyzG4ZCYGMhp-5cZpJlSpXfTgGKh_Qmeo1TDw + merge_variables: + name: null + size: 8.5x11 + mail_type: usps_first_class + expected_delivery_date: '2021-03-24' + date_created: '2021-03-16T18:40:40.504Z' + date_modified: '2021-03-16T18:40:40.504Z' + send_date: '2021-03-16T18:45:40.493Z' + use_type: marketing + fsc: false + color: false + object: snap_pack + template_error: description: Error content: application/json: @@ -21292,10 +12898,10 @@ components: example: error: code: invalid - message: routing_number is required + message: html is required status_code: 422 - post_bank_account: - description: Returns a bank_account object + post_template_version: + description: Returns the template version with the given template and version ids. headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' @@ -21306,37 +12912,33 @@ components: content: application/json: schema: - $ref: '#/components/schemas/bank_account' + $ref: '#/components/schemas/template_version' example: - id: bank_8cad8df5354d33f - signature_url: https://lob-assets.com/letters/asd_asdfghjklqwertyu.pdf?version=45&expires=1234567890&signature=a - description: Test Bank Account - metadata: {} - routing_number: '322271627' - fractional_routing_number: 25-3/440 - check_template: jpm - account_number: '123456789' - account_type: company - signatory: John Doe - bank_name: J.P. MORGAN CHASE BANK, N.A., - bank_city: Columbus - bank_state: OH - bank_zip: '43240' - verified: false - date_created: '2015-11-06T19:24:24.440Z' - date_modified: '2015-11-06T19:24:24.440Z' - object: bank_account - bank_account_deleted: + id: vrsn_534e339882d2282 + description: Second Version + html: Second HTML for {{name}} + date_created: '2017-11-09T04:49:38.016Z' + date_modified: '2017-11-09T04:49:38.016Z' + object: version + template_version_deleted: description: Deleted content: application/json: schema: - $ref: '#/components/schemas/bank_deletion' + $ref: '#/components/schemas/template_version_deletion' example: - id: bank_123456789 - deleted: true - all_bank_accounts: - description: A dictionary with a data property that contains an array of up to `limit` bank_accounts. Each entry in the array is a separate bank_account. The previous and next page of bank_accounts can be retrieved by calling the endpoint contained in the `previous_url` and `next_url` fields in the API response respectively.
If no more bank_accounts are available beyond the current set of returned results, the `next_url` field will be empty. + value: + id: vrsn_123456789 + deleted: true + all_template_versions: + description: >- + A dictionary with a data property that contains an array of up to + `limit` template versions. Each entry in the array is a separate + template version object. The previous and next page of template versions + can be retrieved by calling the endpoint contained in the `previous_url` + and `next_url` fields in the API response respectively.
If no more + template versions are available beyond the current set of returned + results, the `next_url` field will be empty. content: application/json: schema: @@ -21346,42 +12948,180 @@ components: properties: data: type: array - description: list of bank_accounts + description: list of template versions items: - $ref: '#/components/schemas/bank_account' + $ref: '#/components/schemas/template_version' example: data: - - id: bank_0e3fb07eba0b35b - signature_url: https://lob-assets.com/letters/asd_asdfghjklqwertyu.pdf?version=45&expires=1234567890&signature=a - description: Example bank account - metadata: {} - routing_number: '122100024' - account_number: '1234564789' - account_type: company - signatory: John Doe - bank_name: JPMORGAN CHASE BANK, NA - verified: true - date_created: '2019-03-30T13:13:22.200Z' - date_modified: '2019-03-30T13:13:23.385Z' - object: bank_account - - id: bank_eba93f7de3c02d9 - description: Example bank account + - id: vrsn_4d6ff5d868bf630 + description: Second Version + html: 'Second HTML for ' + date_created: '2017-11-09T05:09:03.665Z' + date_modified: '2018-05-22T22:01:10.479Z' + object: version + - id: vrsn_2a17159c1911919 + description: Test Template + html: 'HTML for ' + date_created: '2017-11-09T05:08:40.004Z' + date_modified: '2018-05-22T22:01:11.309Z' + object: version + object: list + count: 2 + template_deleted: + description: Deleted + content: + application/json: + schema: + $ref: '#/components/schemas/template_deletion' + example: + value: + id: tmpl_123456789 + deleted: true + all_templates: + description: >- + A dictionary with a data property that contains an array of up to + `limit` templates. Each entry in the array is a separate template. The + previous and next page of templates can be retrieved by calling the + endpoint contained in the `previous_url` and `next_url` fields in the + API response respectively.
If no more templates are available beyond + the current set of returned results, the `next_url` field will be empty. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/list' + - type: object + properties: + data: + type: array + description: list of templates + items: + $ref: '#/components/schemas/template' + example: + data: + - id: tmpl_d5a5a89da9106f8 + description: Test Template + versions: + - id: vrsn_232a02fb8224791 + suggest_json_editor: true + description: Test Template + engine: legacy + html: 'HTML for ' + date_created: '2019-07-27T23:49:01.512Z' + date_modified: '2019-07-27T23:49:01.512Z' + object: version + published_version: + id: vrsn_232a02fb8224791 + suggest_json_editor: false + description: Test Template + engine: handlebars + html: 'HTML for ' + date_created: '2019-07-27T23:49:01.512Z' + date_modified: '2019-07-27T23:49:01.512Z' + object: version metadata: {} - routing_number: '122100024' - account_number: '1234564789' - account_type: company - signatory: John Doe - bank_name: JPMORGAN CHASE BANK, NA - verified: true - date_created: '2019-03-30T13:11:06.809Z' - date_modified: '2019-03-30T13:11:07.872Z' - object: bank_account + date_created: '2019-07-27T23:49:01.511Z' + date_modified: '2019-07-27T23:49:01.511Z' + object: template + - id: tmpl_59b2150ae120887 + description: Test Template + versions: + - id: vrsn_2a7eb63ccb795b9 + description: Test Template + html: 'HTML for ' + date_created: '2019-03-29T10:22:34.643Z' + date_modified: '2019-03-29T10:22:34.643Z' + object: version + published_version: + id: vrsn_2a7eb63ccb795b9 + description: Test Template + html: 'HTML for ' + date_created: '2019-03-29T10:22:34.643Z' + date_modified: '2019-03-29T10:22:34.643Z' + object: version + metadata: {} + date_created: '2019-03-29T10:22:34.642Z' + date_modified: '2019-03-29T10:22:34.642Z' + object: template object: list - next_url: https://api.lob.com/v1/bank_accounts?limit=2&after=eyJkYXRlT2Zmc2V0IjoiMjAxOS0wMy0zMFQxMzoxMTowNi44MDlaIiwiaWRPZmZzZXQiOiJiYW5rX2ViYTkzZjdkZTNjMDJkOSJ9 previous_url: null + next_url: >- + https://api.lob.com/v1/templates?limit=2&after=eyJkYXRlT2Zmc2V0IjoiMjAxOS0wMy0yOVQxMDoyMjozNC42NDJaIiwiaWRPZmZzZXQiOiJ0bXBsXzU5YjIxNTBhZTEyMDg4NyJ9 count: 2 - billing_group_list_error: - description: Error + all_uploads: + description: >- + An array of matching uploads. Each entry in the array is a separate + upload. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/upload' + example: + - id: upl_71be866e430b11e9 + accountId: fa9ea650fc7b31a89f92 + campaignId: cmp_1933ad629bae1408 + mode: test + failuresUrl: https://www.example.com + originalFilename: my_audience.csv + state: Draft + totalMailpieces: 100 + failedMailpieces: 5 + validatedMailpieces: 95 + bytesProcessed: 17268 + dateCreated: '2017-09-05T17:47:53.767Z' + dateModified: '2017-09-05T17:47:53.767Z' + requiredAddressColumnMapping: + name: recipient_name + address_line1: primary_line + address_city: city + address_state: state + address_zip: zip_code + optionalAddressColumnMapping: + address_line2: secondary_line + company: company + address_country: country + mergeVariableColumnMapping: + gift_code: code + metadata: + columns: + - recipient_name + - zip_code + upload_validation_error: + description: Validation Error + content: + application/json: + schema: + title: HTTPValidationError + type: object + properties: + detail: + title: Detail + type: array + items: + title: ValidationError + required: + - loc + - msg + - type + type: object + properties: + loc: + title: Location + type: array + items: + anyOf: + - type: string + - type: integer + msg: + title: Message + type: string + type: + title: Error Type + type: string + upload_not_found: + description: Not Found Error content: application/json: schema: @@ -21389,40 +13129,57 @@ components: example: error: code: not_found - message: billing_group not found + message: upload not found status_code: 404 - billing_group_error: - description: Error + upload_export_error: + description: Create Export Error content: application/json: schema: - $ref: '#/components/schemas/error' - example: - error: - code: invalid - message: message about incorrect parameter - status_code: 422 - post_billing_group: - description: Returns a billing group object - headers: - ratelimit-limit: - $ref: '#/components/headers/ratelimit-limit' - ratelimit-remaining: - $ref: '#/components/headers/ratelimit-remaining' - ratelimit-reset: - $ref: '#/components/headers/ratelimit-reset' + type: object + required: + - code + - message + - errors + properties: + code: + description: A conventional HTTP status code + type: number + enum: + - 400 + - 404 + message: + description: A human-readable message with more details about the error + type: string + errors: + description: An array of pre-defined strings that identify an error + type: array + items: + type: string + example: + code: 400 + message: Invalid body, check 'errors' property for more info. + errors: + - type must be a string + feature_flag_disabled: + description: Forbidden Error content: application/json: schema: - $ref: '#/components/schemas/billing_group' + type: object + properties: + code: + description: The error code + type: number + message: + type: string + description: >- + Details of the error message with the feature flagged + mentioned. example: - id: bg_c94e83ca2cd5121 - name: Marketing Dept - description: Usage group used for the Marketing Dept resource sends - date_created: '2017-11-07T22:56:10.962Z' - date_modified: '2017-11-07T22:56:10.962Z' - object: billing_group - buckslip_error: + message: 'This feature is not enabled for this account: access_upload_report' + code: 403 + us_autocompletions_error: description: Error content: application/json: @@ -21431,29 +13188,89 @@ components: example: error: code: invalid - message: message about incorrect parameter + message: address_prefix is required status_code: 422 - buckslip_deleted: - description: Deleted the buckslip - content: - application/json: - schema: - $ref: '#/components/schemas/buckslip_deletion' - example: - id: buckslip_123456789 - deleted: true - buckslip_order_error: - description: Error + us_autocompletions: + description: Returns a US autocompletion object. + headers: + ratelimit-limit: + $ref: '#/components/headers/ratelimit-limit' + ratelimit-remaining: + $ref: '#/components/headers/ratelimit-remaining' + ratelimit-reset: + $ref: '#/components/headers/ratelimit-reset' content: application/json: schema: - $ref: '#/components/schemas/error' - example: - error: - code: not_found - message: buckslip not found - status_code: 404 - us_verifications_error: + $ref: '#/components/schemas/us_autocompletions' + examples: + basic: + value: + id: us_auto_a3ac97bcfbb2460ab20c + suggestions: + - primary_line: 185 BAYSIDE VILLAGE PL + city: SAN FRANCISCO + state: CA + zip_code: '94107' + - primary_line: 185 BRANNAN ST + city: SAN FRANCISCO + state: CA + zip_code: '94107' + - primary_line: 185 BONIFACIO ST + city: SAN FRANCISCO + state: CA + zip_code: '94107' + - primary_line: 185 BLAIR TER + city: SAN FRANCISCO + state: CA + zip_code: '94107' + - primary_line: 185 BLUXOME ST + city: SAN FRANCISCO + state: CA + zip_code: '94107' + - primary_line: 210 KING ST + city: SAN FRANCISCO + state: CA + zip_code: '94107' + - primary_line: 185 BRYANT ST + city: SAN FRANCISCO + state: CA + zip_code: '94107' + object: us_autocompletion + test: + value: + id: us_auto_a3ac97bcfbb2460ab20c + suggestions: + - primary_line: 1 TELEPHONE RD + city: OXFORD + state: AR + zip_code: '72565' + - primary_line: 1 TELEGA PL + city: PALMDALE + state: CA + zip_code: '93550' + - primary_line: 1 TELEGRAM AVE + city: ELMONT + state: NY + zip_code: '11003' + - primary_line: 1 TELEGRAM AVE + city: GARDEN CITY + state: KS + zip_code: '67846' + - primary_line: 1 TELEGRAPH HILL RD + city: HOLMDEL + state: NJ + zip_code: '07733' + - primary_line: 1 TELEGRAPH HILL RD S + city: HOLMDEL + state: NJ + zip_code: '07733' + - primary_line: 1 TELEGRAPH HILL BLVD + city: SAN FRANCISCO + state: CA + zip_code: '94133' + object: us_autocompletion + reverse_geocode_lookups_error: description: Error content: application/json: @@ -21462,10 +13279,40 @@ components: example: error: code: invalid - message: primary_line is required or address is required + message: latitude is required status_code: 422 - bulk_us_verifications: - description: Returns a list of US verification objects. + reverse_geocode_lookups: + description: Returns a zip lookup object if a valid zip was provided. + headers: + ratelimit-limit: + $ref: '#/components/headers/ratelimit-limit' + ratelimit-remaining: + $ref: '#/components/headers/ratelimit-remaining' + ratelimit-reset: + $ref: '#/components/headers/ratelimit-reset' + content: + application/json: + schema: + $ref: '#/components/schemas/reverse_geocode' + example: + id: us_reverse_geocode_8a013f3e + addresses: + - components: + zip_code: '94107' + zip_code_plus_4: '1702' + location_analysis: + latitude: 37.78271 + longitude: -122.416202 + distance: 1.32 + - components: + zip_code: '94107' + zip_code_plus_4: '1702' + location_analysis: + latitude: 37.782917 + longitude: -122.416131 + distance: 1.33 + us_verifications: + description: Returns a US verification object. headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' @@ -21476,10 +13323,11 @@ components: content: application/json: schema: - $ref: '#/components/schemas/us_verifications' - example: - addresses: - - id: us_ver_c7cb63d68f8d6 + $ref: '#/components/schemas/us_verification' + examples: + basic: + value: + id: us_ver_c7cb63d68f8d6 recipient: LOB.COM primary_line: 210 KING ST secondary_line: '' @@ -21504,7 +13352,7 @@ components: zip_code: '94107' zip_code_plus_4: '1702' zip_code_type: standard - delivery_point_barcode: '941071728506' + delivery_point_barcode: '941071702108' address_type: commercial record_type: street default_building_address: false @@ -21537,8 +13385,64 @@ components: score: 100 level: high object: us_verification - errors: false - intl_verifications_error: + test: + value: + id: us_ver_po_box + recipient: TEST KEYS DO NOT VERIFY ADDRESSES + primary_line: PO BOX 720114 + secondary_line: '' + urbanization: '' + last_line: SAN FRANCISCO CA 94172-0114 + deliverability: deliverable + valid_address: true + components: + primary_number: '720114' + street_predirection: '' + street_name: PO BOX + street_suffix: '' + street_postdirection: '' + secondary_designator: '' + secondary_number: '' + pmb_designator: '' + pmb_number: '' + extra_secondary_designator: '' + extra_secondary_number: '' + city: SAN FRANCISCO + state: CA + zip_code: '94172' + zip_code_plus_4: '0114' + zip_code_type: po_box + delivery_point_barcode: '941720114146' + address_type: residential + record_type: po_box + default_building_address: false + county: SAN FRANCISCO + county_fips: '06075' + carrier_route: BOO2 + carrier_route_type: po_box + po_box_only_flag: '' + latitude: 37.75971500260575 + longitude: -122.69397561170017 + deliverability_analysis: + dpv_confirmation: 'Y' + dpv_cmra: 'N' + dpv_vacant: 'N' + dpv_active: 'Y' + dpv_inactive_reason: '' + dpv_throwback: '' + dpv_non_delivery_day_flag: '' + dpv_non_delivery_day_values: '' + dpv_no_secure_location: '' + dpv_door_not_accessible: '' + dpv_footnotes: + - AA + - BB + ews_match: false + lacs_indicator: '' + lacs_return_code: '' + suite_return_code: '' + object: us_verification + zip_lookups_error: description: Error content: application/json: @@ -21547,10 +13451,10 @@ components: example: error: code: invalid - message: country is required + message: zip_code is required status_code: 422 - bulk_intl_verifications: - description: Returns an array of international verification objects. + zip_lookups: + description: Returns a zip lookup object if a valid zip was provided. headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' @@ -21561,912 +13465,6337 @@ components: content: application/json: schema: - $ref: '#/components/schemas/intl_verifications' + $ref: '#/components/schemas/zip' example: - addresses: - - id: intl_ver_c7cb63d68f8d6 - recipient: null - primary_line: 370 WATER ST - secondary_line: '' - last_line: SUMMERSIDE PE C1N 1C4 - country: CA - coverage: SUBBUILDING - deliverability: deliverable - status: LV4 - components: - primary_number: '370' - street_name: WATER ST - city: SUMMERSIDE - state: PE - postal_code: C1N 1C4 - object: intl_verification - errors: false - all_campaigns: - description: A dictionary with a data property that contains an array of up to `limit` campaigns. Each entry in the array is a separate campaign. The previous and next page of campaigns can be retrieved by calling the endpoint contained in the `previous_url` and `next_url` fields in the API response respectively.
If no more campaigns are available beyond the current set of returned results, the `next_url` field will be empty. + id: us_zip_c7cb63d68f8d6 + cities: + - city: SAN FRANCISCO + state: CA + county: SAN FRANCISCO + county_fips: '06075' + preferred: true + zip_code_type: standard + object: us_zip_lookup + zip_code: '94107' + events: + description: Returns an `event` object to the specified server. content: application/json: schema: - allOf: - - $ref: '#/components/schemas/list' - - type: object - properties: - data: - type: array - description: list of campaigns - items: - $ref: '#/components/schemas/campaign' + $ref: '#/components/schemas/events' example: - data: - - id: cmp_e05ee61ff80764b - billing_group_id: bg_fe3079dcdd80e5ae - name: My Campaign - description: My Campaign's description - schedule_type: immediate - send_date: null - target_delivery_date: null - cancel_window_campaign_minutes: 60 + event_type: + resource: postcards + enabled_for_test: true + id: postcard.created + object: event_type + reference_id: psc_d2d10a2e9cba991c + id: evt_d95ff8ffd2b5cfb4 + date_created: '2016-12-04T22:50:08.180Z' + body: + id: psc_d2d10a2e9cba991c + description: Test Postcard + metadata: {} + to: + id: adr_8e783523dd7f0e70 + description: Test Recipient Address + name: Harry Zhang + company: LOB + phone: null + email: null + address_line1: 123 TEST ST + address_line2: UNIT 1 + address_city: SAN FRANCISCO + address_state: CA + address_zip: '94107' + address_country: UNITED STATES metadata: {} - use_type: marketing - is_draft: true - deleted: false - creatives: [] - uploads: [] - auto_cancel_if_ncoa: false - date_created: '2017-09-05T17:47:53.767Z' - date_modified: '2017-09-05T17:47:53.767Z' - object: campaign - object: list - previous_url: null - next_url: null - count: 1 - campaigns_error: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - example: - error: - code: not_found - message: campaign not found - status_code: 404 - campaign_deleted: - description: Deleted the campaign. - content: - application/json: - schema: - 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/cmp_id' - deleted: - type: boolean - description: True if the resource has been successfully deleted. - example: - id: cmp_e05ee61ff80764b - deleted: true - mailpiece_error: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - example: - error: - code: not_found - message: to address not found - status_code: 404 - card_deleted: - description: Deleted the card - content: - application/json: - schema: - $ref: '#/components/schemas/card_deletion' - example: - id: card_123456789 - deleted: true - card_order_error: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - example: - error: - code: not_found - message: card not found - status_code: 404 - all_checks: - description: A dictionary with a data property that contains an array of up to `limit` checks. Each entry in the array is a separate check. The previous and next page of checks can be retrieved by calling the endpoint contained in the `previous_url` and `next_url` fields in the API response respectively.
If no more checks are available beyond the current set of returned results, the `next_url` field will be empty. + date_created: '2016-12-04T10:51:51.844Z' + date_modified: '2016-12-04T10:51:51.844Z' + object: address + from: + id: adr_d2e26faf793ed422 + description: Test Sender Address + name: Harry Zhang + company: LOB + phone: null + email: null + address_line1: 123 TEST ST + address_line2: UNIT 1 + address_city: SAN FRANCISCO + address_state: CA + address_zip: '94107' + address_country: UNITED STATES + metadata: {} + date_created: '2016-12-04T10:51:51.845Z' + date_modified: '2016-12-04T10:51:51.845Z' + object: address + url: >- + https://lob-assets.com/postcards/psc_d2d10a2e9cba991c.pdf?expires=1540372221&signature=dNE8OtbDymujUxBIMYle4H1cv1aZNFk + front_template_id: null + back_template_id: null + carrier: USPS + tracking_events: [] + thumbnails: + - small: >- + https://lob-assets.com/postcards/psc_d2d10a2e9cba991c_thumb_small_1.png?expires=1540372221&signature=McmqScxPgbe7yQY5X31U3vhU8VUlfA1 + medium: >- + https://lob-assets.com/postcards/psc_d2d10a2e9cba991c_thumb_medium_1.png?expires=1540372221&signature=VBClptOuCcj9Ybay6gE5aetT5j3C7KS + large: >- + https://lob-assets.com/postcards/psc_d2d10a2e9cba991c_thumb_large_1.png?expires=1540372221&signature=RAHpIwoYKYM17f0bbaoOiamCkjpzYfH + - small: >- + https://lob-assets.com/postcards/psc_d2d10a2e9cba991c_thumb_small_1.png?expires=1540372221&signature=5biHoaCmkphQaGJymOZxmTF0hHdiH4N + medium: >- + https://lob-assets.com/postcards/psc_d2d10a2e9cba991c_thumb_medium_1.png?expires=1540372221&signature=1ApGx0kn5EO4qQKGJzCe6zEPnQpzpRY + large: >- + https://lob-assets.com/postcards/psc_d2d10a2e9cba991c_thumb_large_1.png?expires=1540372221&signature=z80p90RBak6T26IAfg5yg7a6qKF53a8 + merge_variables: null + mail_type: usps_first_class + size: 4x6 + expected_delivery_date: '2016-12-09' + date_created: '2016-12-04T10:51:51.843Z' + date_modified: '2016-12-04T10:51:51.843Z' + send_date: '2016-12-04T10:56:51.843Z' + object: postcard + object: event + tracking_events: + description: Returns a `tracking_event` object to the specified server. content: application/json: schema: - allOf: - - $ref: '#/components/schemas/list' - - type: object - properties: - data: - type: array - description: list of checks - items: - $ref: '#/components/schemas/check' - example: - data: - - id: chk_0176bf6197100185 - description: Demo Check - metadata: {} - check_number: 12559 - memo: rent - amount: 22.5 - url: https://lob-assets.com/checks/chk_0176bf6197100185.pdf?version=v1&expires=1568239682&signature=aqKV5lmg_ktxzyl-qEwIf8-7DbvcguLO0LrfFcyMrUDDt6hxX_da0MEEpElxKR876VUaZrpHq_i_ayDWrsK3BA - to: - id: adr_bae820679f3f536b + oneOf: + - $ref: '#/components/schemas/tracking_event_normal' + - $ref: '#/components/schemas/tracking_event_certified' + examples: + normal: + value: + id: evnt_9e84094c9368cfb + type: normal + name: In Local Area + details: null + location: '72231' + time: '2016-06-30T15:51:41.000Z' + date_created: '2016-06-30T17:41:59.771Z' + date_modified: '2016-06-30T17:41:59.771Z' + object: tracking_event + certified: + value: + id: evnt_9e84094c9368cfb + type: certified + name: Delivered + details: + event: delivered + description: Package has been delivered. + notes: Delivered, Front Desk/Reception/Mail Room + action_required: false + location: '33408' + time: '2019-10-08T19:41:00Z' + date_created: '2019-10-08T19:41:00Z' + date_modified: '2019-10-08T19:41:00Z' + object: tracking_event + headers: + ratelimit-limit: + description: The rate limit for a given endpoint. + schema: + type: integer + example: 150 + ratelimit-remaining: + description: The number of requests remaining in the current window. + schema: + type: integer + example: 100 + ratelimit-reset: + description: > + The time at which the rate limit window resets in UTC epoch + seconds + schema: + type: integer + example: 1528749846 +security: + - basicAuth: [] +x-webhooks: + events: + post: + summary: Events + description: Information about an event + operationId: event + tags: + - Events + responses: + '200': + $ref: '#/components/responses/events' + tracking_events: + post: + summary: Tracking Events + description: Information about tracking events + operationId: tracking_event + tags: + - Tracking Events + responses: + '200': + $ref: '#/components/responses/tracking_events' +paths: + /accounts: + get: + operationId: get_lob_credits_balance + summary: Get Lob Credits Balance + description: Returns the account's current balance of Lob Credits. + tags: + - Accounts + - Lob Credits + responses: + '200': + description: Returns a lob_credits_balance object. + content: + application/json: + schema: + $ref: '#/components/schemas/lob_credits_balance' + examples: + empty: + value: + balance: 0 + negative: + value: + balance: -1234.56 + positive: + value: + balance: 1000 + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/accounts/credits_balance \ + -u : + label: CURL + /addresses: + get: + operationId: addresses_list + summary: List + description: >- + Returns a list of your addresses. The addresses are returned sorted by + creation date, with the most recently created addresses appearing first. + tags: + - Addresses + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/before_after' + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/date_created' + - $ref: '#/components/parameters/metadata' + responses: + '200': + $ref: '#/components/responses/all_addresses' + default: + $ref: '#/components/responses/address_error' + x-codeSamples: + - lang: Shell + source: | + curl -X GET "https://api.lob.com/v1/addresses?limit=2" \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: Typescript + source: | + try { + const addresses = await new AddressesApi(config).list(2); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.addresses.list({limit: 2}, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + addressesApi = AddressesApi.new(config) + + begin + addresses = addressesApi.list({ limit: 2 }) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = AddressesApi(api_client) + + try: + addresses = api.list(limit=2) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\AddressesApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->list( + 2, // limit + ); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + AddressesApi apiInstance = new AddressesApi(config); + + try { + AddressList response = apiInstance.list( + 2, // limit + null, // before + null, // after + null, // include + null, // dateCreated + null // metadata + ); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Address.list(%{limit: 2}) + label: ELIXIR + - lang: CSharp + source: > + AddressesApi api = new AddressesApi(config); + + + List includeList = new List(); + + includeList.Add("total_count"); + + Dictionary metadata = new Dictionary(); + + metadata.Add("name", "Harry"); + + Dictionary dateCreated = new Dictionary(); + + DateTime dateCreatedDate = DateTime.Today.AddMonths(-1); + + dateCreated.Add("lt", dateCreatedDate); + + + try { + AddressList response = api.list( + 2, // limit + null, // before + null, // after + includeList, // include + dateCreated, // dateCreated + metadata // metadata + ); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + AddressList = apiClient.AddressesApi.List(context).Execute() + + if err != nil { + return err + } + label: GO + post: + operationId: address_create + summary: Create + description: Creates a new address given information + tags: + - Addresses + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/address_editable' + examples: + full_us: + value: description: Harry - Office - name: HARRY ZHANG - company: LOB + name: Harry Zhang + company: Lob email: harry@lob.com phone: '5555555555' - address_line1: 210 KING ST STE 6100 + address_line1: 210 King St + address_line2: '# 6100' + address_city: San Francisco + address_state: CA + address_zip: '94107' + address_country: US + ncoa_us_test: + value: + description: Harry - Office + name: Harry Zhang + company: Lob + email: harry@lob.com + phone: '5555555555' + address_line1: NCOA + address_line2: '#6100' + address_city: San Francisco + address_state: CA + address_zip: '94107' + address_country: US + full_intl: + value: + description: Harry - Office + name: Harry Zhang + company: Lob + email: harry@lob.com + phone: '5555555555' + address_line1: 370 WATER ST address_line2: '' - address_city: SAN FRANCISCO + address_city: SUMMERSIDE + address_state: PRINCE EDWARD ISLAND + address_zip: C1N 1C4 + address_country: CA + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/address_editable' + examples: + full_us: + value: + 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-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2018-12-08T03:08:43.446Z' - date_modified: '2018-12-08T03:08:43.446Z' - object: address - recipient_moved: false - from: - id: adr_210a8d4b0b76d77b - name: LEORE AVIDAR - address_line1: 210 KING ST STE 6100 - address_city: SAN FRANCISCO + address_zip: '94107' + address_country: US + ncoa_us_test: + value: + description: Harry - Office + name: Harry Zhang + company: Lob + email: harry@lob.com + phone: '5555555555' + address_line1: NCOA + address_line2: '# 6100' + address_city: San Francisco address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2018-12-08T03:01:07.651Z' - date_modified: '2018-12-08T03:01:07.651Z' - object: address - bank_account: - id: bank_8cad8df5354d33f - description: Test Bank Account - metadata: {} - routing_number: '322271627' - account_number: '123456789' - account_type: individual - signatory: John Doe - bank_name: J.P. MORGAN CHASE BANK, N.A. - verified: true - date_created: '2015-11-06T19:24:24.440Z' - date_modified: '2015-11-06T19:41:28.312Z' - object: bank_account - signature_url: https://lob-assets.com/bank-accounts/asd_asdfghjkqwertyui.pdf?expires=1234567890&signature=aksdf - carrier: USPS - tracking_events: [] - thumbnails: - - small: https://lob-assets.com/checks/chk_0176bf6197100185_thumb_small_1.png?version=v1&expires=1568239682&signature=T8DfMm_mxJJzIPgm8I0lvYY4Z6I8aFjsGsrEAicEqw8Ei_FaOtiGQKGeY16rdugAt8lmS_iX0lveBoG2RgWDDw - medium: https://lob-assets.com/checks/chk_0176bf6197100185_thumb_medium_1.png?version=v1&expires=1568239682&signature=-iJD7C58xOCD8eQ01StqSlw9WbDymL0Ygze9twfTs9s17zQppr2Zx363_Z4bP3ATHNhF3osjHuAxIasI2Wf6DQ - large: https://lob-assets.com/checks/chk_0176bf6197100185_thumb_large_1.png?version=v1&expires=1568239682&signature=VJlOkVDPKZThstdd632r3Grm2WhoyPkC-pffpcePTw1i1NkpAObDSRaItKMOQgeWkAcUud3SH0tYcVOadaNiCw - - small: https://lob-assets.com/checks/chk_0176bf6197100185_thumb_small_2.png?version=v1&expires=1568239682&signature=XpCkOjy2zIKXkuc0s-UAYGNwpD_pgt7c9FKTDUCYbyqXupAg1MV1l2tdqevr0L0LT5FJqrGZH9khD5QRMQTkAA - medium: https://lob-assets.com/checks/chk_0176bf6197100185_thumb_medium_2.png?version=v1&expires=1568239682&signature=sdgnJMzusEfndu7dNmk37eKc0AV7Hmqev6TQAqkCESs5pg7j6dDTsp7v4pnDvhsj8d7SIMcahl1aGiysoom0CA - large: https://lob-assets.com/checks/chk_0176bf6197100185_thumb_large_2.png?version=v1&expires=1568239682&signature=ybe8ovBh8Gf-AWKGRs4CB4XkU-erPVbY66umXARhTiJG2Dg1QlyCb9WmBXWt0tBCwD5NGMl20mHeAgHwecLxBA - expected_delivery_date: '2019-08-16' - mail_type: usps_first_class - date_created: '2019-08-08T19:34:47.571Z' - date_modified: '2019-08-08T19:34:49.612Z' - send_date: '2019-08-08' - message: pancakes are good - object: check - check_bottom_template_id: tmpl_a - attachment_template_id: tmpl_a - check_bottom_template_version_id: vrsn_a - attachment_template_version_id: vrsn_a - merge_variables: {} - use_type: operational - deleted: true - - id: chk_92b9a6714bc0557c - description: Demo Check + address_zip: '94107' + address_country: US + full_intl: + value: + description: Harry - Office + name: Harry Zhang + company: Lob + email: harry@lob.com + phone: '5555555555' + address_line1: 370 WATER ST + address_line2: '' + address_city: SUMMERSIDE + address_state: PRINCE EDWARD ISLAND + address_zip: C1N 1C4 + address_country: CA + encoding: + metadata: + style: deepObject + explode: true + multipart/form-data: + schema: + $ref: '#/components/schemas/address_editable' + examples: + full_us: + value: + 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 + ncoa_us_test: + value: + description: Harry - Office + name: Harry Zhang + company: Lob + email: harry@lob.com + phone: '5555555555' + address_line1: NCOA + address_line2: '# 6100' + address_city: San Francisco + address_state: CA + address_zip: '94107' + address_country: US + full_intl: + value: + description: Harry - Office + name: Harry Zhang + company: Lob + email: harry@lob.com + phone: '5555555555' + address_line1: 370 WATER ST + address_line2: '' + address_city: SUMMERSIDE + address_state: PRINCE EDWARD ISLAND + address_zip: C1N 1C4 + address_country: CA + responses: + '200': + $ref: '#/components/responses/post_address' + default: + $ref: '#/components/responses/address_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/addresses \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ + -d "description=Harry - Office" \ + -d "name=Harry Zhang" \ + -d "company=Lob" \ + -d "email=harry@lob.com" \ + -d "phone=5555555555" \ + -d "address_line1=210 King St" \ + -d "address_line2=# 6100" \ + -d "address_city=San Francisco" \ + -d "address_state=CA" \ + -d "address_zip=94107" \ + -d "address_country=US" + label: CURL + - lang: Typescript + source: | + const addressCreate = new AddressEditable({ + 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' + }); + + try { + const myAddress = await new AddressesApi(config).create(addressCreate); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.addresses.create({ + 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' + }, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + addressCreate = AddressEditable.new({ + 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", + }); + + addressApi = AddressesApi.new(config) + + begin + createdAddress = addressApi.create(addressCreate) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + address_editable = AddressEditable( + 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 = CountryExtended("US"), + ) + + with ApiClient(configuration) as api_client: + api = AddressesApi(api_client) + + try: + created_address = api.create(address_editable) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\AddressesApi($config, new + GuzzleHttp\Client()); + + + $address_editable = new OpenAPI\Client\Model\AddressEditable( + array( + "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", + ) + ); + + + try { + $result = $apiInstance->create($address_editable); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + AddressesApi apiInstance = new AddressesApi(config); + + try { + AddressEditable addressEditable = new AddressEditable(); + addressEditable.setDescription("Harry - Office"); + addressEditable.setName("Harry Zhang"); + addressEditable.setCompany("Lob"); + addressEditable.setEmail("harry@lob.com"); + addressEditable.setPhone("5555555555"); + addressEditable.setAddressLine1("210 King St"); + addressEditable.setAddressLine2("# 6100"); + addressEditable.setAddressCity("San Francisco"); + addressEditable.setAddressState("CA"); + addressEditable.setAddressZip("94107"); + addressEditable.setAddressCountry(CountryExtended.US); + + Address result = apiInstance.create(addressEditable); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Address.create(%{ + 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_country: "US", + address_zip: "94107" + }) + label: ELIXIR + - lang: CSharp + source: | + AddressesApi api = new AddressesApi(config); + + AddressEditable addressEditable = new AddressEditable( + "210 King St", // addressLine1 + "# 6100", // addressLine2 + "San Francisco", // addressCity + "CA", // addressState + "94107", // addressZip + CountryExtended.US, // addressCountry + "Harry - Office", // description + "Harry Zhang", // name + "Lob", // company + "5555555555", // phone + "harry@lob.com" // email + ); + + try { + Address result = api.create(addressEditable); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + + var addressCreate = *lob.NewAddressEditable() + + addressCreate.SetDescription("Harry - Office") + + addressCreate.SetName("Harry Zhang") + + addressCreate.SetCompany("Lob") + + addressCreate.SetEmail("harry@lob.com") + + addressCreate.SetPhone("5555555555") + + addressCreate.SetAddressLine1("210 King St") + + addressCreate.SetAddressLine2("# 6100") + + addressCreate.SetAddressCity("San Francisco") + + addressCreate.SetAddressState("CA") + + addressCreate.SetAddressZip("94107") + + addressCreate.SetAddressCountry("US") + + + + + createdaddress, _, err := + apiClient.AddressesApi.Create(context).AddressEditable(addressCreate).Execute() + + + if err != nil { + return err + } + label: GO + /addresses/{adr_id}: + parameters: + - in: path + name: adr_id + description: id of the address + required: true + schema: + $ref: '#/components/schemas/adr_id' + get: + operationId: address_retrieve + summary: Retrieve + description: >- + Retrieves the details of an existing address. You need only supply the + unique identifier that was returned upon address creation. + tags: + - Addresses + responses: + '200': + $ref: '#/components/responses/address' + default: + $ref: '#/components/responses/address_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/addresses/adr_fa85158b26c3eb7c \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: Typescript + source: | + try { + const address = await new AddressesApi(config).get('adr_xxxx'); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.addresses.retrieve('adr_fa85158b26c3eb7c', function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + addressApi = AddressesApi.new(config) + + begin + retrievedAddress = addressApi.get("adr_fa85158b26c3eb7c") + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = AddressesApi(api_client) + + try: + address = api.get("adr_fa85158b26c3eb7c") + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\AddressesApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->get("adr_fa85158b26c3eb7c"); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + AddressesApi apiInstance = new AddressesApi(config); + + try { + Address response = apiInstance.get("adr_fa85158b26c3eb7c"); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Address.retrieve("adr_fa85158b26c3eb7c") + label: ELIXIR + - lang: CSharp + source: | + AddressesApi api = new AddressesApi(config); + + try { + Address response = api.get("adr_fa85158b26c3eb7c"); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + fetchedAddress, _, err := + apiClient.AddressesApi.Get(context,"adr_fa85158b26c3eb7c").Execute() + + + if err != nil { + return err + } + label: GO + delete: + operationId: address_delete + summary: Delete + description: >- + Deletes the details of an existing address. You need only supply the + unique identifier that was returned upon address creation. + tags: + - Addresses + responses: + '200': + $ref: '#/components/responses/address_deleted' + default: + $ref: '#/components/responses/address_error' + x-codeSamples: + - lang: Shell + source: > + curl -X DELETE https://api.lob.com/v1/addresses/adr_43769b47aed248c2 + \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: Typescript + source: | + try { + const deleteAddress = await new AddressesApi(config).delete('adr_xxxx'); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.addresses.delete('adr_43769b47aed248c2', function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + addressApi = AddressesApi.new(config) + + begin + deletedAddress = addressApi.delete("adr_43769b47aed248c2") + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = AddressesApi(api_client) + + try: + deleted_resource = api.delete("adr_43769b47aed248c2") + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\AddressesApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->delete("adr_43769b47aed248c2"); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + AddressesApi apiInstance = new AddressesApi(config); + + try { + AddressDeletion response = apiInstance.delete("adr_43769b47aed248c2"); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Address.delete("adr_43769b47aed248c2") + label: ELIXIR + - lang: CSharp + source: | + AddressesApi api = new AddressesApi(config); + + try { + AddressDeletion response = api.delete("adr_43769b47aed248c2"); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + deletedAddress, _, err := apiClient.AddressesApi.Delete(context, + "adr_43769b47aed248c2").Execute() + + + if err != nil { + return err + } + label: GO + /bank_accounts/{bank_id}/verify: + parameters: + - in: path + name: bank_id + description: id of the bank account to be verified + required: true + schema: + $ref: '#/components/schemas/bank_id' + post: + operationId: bank_account_verify + summary: Verify + description: Verify a bank account in order to create a check. + tags: + - Bank Accounts + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/bank_account_verify' + example: + amounts: + - 1 + - 100 + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/bank_account_verify' + example: + amounts: + - 1 + - 100 + multipart/form-data: + schema: + $ref: '#/components/schemas/bank_account_verify' + example: + amounts: + - 1 + - 100 + responses: + '200': + $ref: '#/components/responses/post_bank_account' + default: + $ref: '#/components/responses/bank_account_error' + x-codeSamples: + - lang: Shell + source: > + curl + https://api.lob.com/v1/bank_accounts/bank_dfceb4a2a05b57e/verify \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ + -d "amounts[]=25" \ + -d "amounts[]=63" + label: CURL + - lang: Typescript + source: | + const verificationData = new BankAccountVerify({ + amounts: [11, 35], + }); + + try { + const verifiedAccount = await new BankAccountsApi(config).verify('bank_xxxx', verificationData); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.bankAccounts.verify('bank_dfceb4a2a05b57e', { + amounts: [25, 63] + }, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + verificationData = BankAccountVerify.new({ + amounts: [ + 25, + 63, + ], + }) + + bankAccountsApi = BankAccountsApi.new(config) + + begin + verifiedAccount = bankAccountsApi.verify("bank_dfceb4a2a05b57e", verificationData) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + verification_data = BankAccountVerify( + amounts = [ + 25, + 63, + ], + ) + + with ApiClient(configuration) as api_client: + api = BankAccountsApi(api_client) + + try: + verified_account = api.verify("bank_dfceb4a2a05b57e", verification_data) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\BankAccountsApi($config, new + GuzzleHttp\Client()); + + + $bankVerify = new OpenAPI\Client\Model\BankAccountVerify(); + + $bankVerify->setAmounts([ + 25, + 63, + ]); + + + try { + $result = $apiInstance->verify( + "bank_dfceb4a2a05b57e", $bankVerify + ); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + BankAccountVerify verification = new BankAccountVerify(); + verification.addAmountsItem(25); + verification.addAmountsItem(63); + + BankAccountsApi apiInstance = new BankAccountsApi(config); + + try { + apiInstance.verify("bank_dfceb4a2a05b57e", verification); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.BankAccount.verify("bank_dfceb4a2a05b57e", %{amounts: [25, 63]}) + label: ELIXIR + - lang: CSharp + source: | + List amounts = new List(); + amounts.Add(25); + amounts.Add(63); + + BankAccountVerify verification = new BankAccountVerify(amounts); + + BankAccountsApi api = new BankAccountsApi(config); + + try { + BankAccount verified_account = api.verify("bank_dfceb4a2a05b57e", verification); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + var bankAccountWritable = *lob.NewBankAccountWritable("322271627", + "123456789", lob.BANKTYPEENUM_INDIVIDUAL, "Sinead Connor") + + + createdBankAccount, _, _ := + apiClient.BankAccountsApi.Create(context).BankAccountWritable(bankAccountWritable).Execute() + + + verifyAmounts := []int32{11, 35} + + verify := *lob.NewBankAccountVerify(verifyAmounts) + + + verifiedAccount, _, err := apiClient.BankAccountsApi.Verify(context, + createdBankAccount.Id).BankAccountVerify(verify).Execute() + + + if err != nil { + return err + } + label: GO + /bank_accounts/{bank_id}: + parameters: + - in: path + name: bank_id + description: id of the bank account + required: true + schema: + $ref: '#/components/schemas/bank_id' + get: + operationId: bank_account_retrieve + summary: Retrieve + description: >- + Retrieves the details of an existing bank account. You need only supply + the unique bank account identifier that was returned upon bank account + creation. + tags: + - Bank Accounts + responses: + '200': + description: Returns a bank account object + content: + application/json: + schema: + $ref: '#/components/schemas/bank_account' + example: + id: bank_8cad8df5354d33f + signature_url: >- + https://lob-assets.com/letters/asd_asdfghjklqwertyu.pdf?version=45&expires=1234567890&signature=a + description: Test Bank Account metadata: {} - check_number: 12558 - memo: rent - amount: 22.5 - url: https://lob-assets.com/checks/chk_92b9a6714bc0557c.pdf?version=v1&expires=1568239682&signature=jCct5PvzU58Iz2pSo58nf6rgsMRcJfMbUWThmm6lztFl5Vn2Y204b9h7gvw0vJvkDK2ThfaYqaUbWc0KzTpvAg - to: - id: adr_bae820679f3f536b - name: HARRY ZHANG - address_line1: 210 KING ST STE 6100 - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2018-12-08T03:08:43.446Z' - date_modified: '2018-12-08T03:08:43.446Z' - object: address - from: - id: adr_210a8d4b0b76d77b - name: LEORE AVIDAR - address_line1: 210 KING ST STE 6100 - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2018-12-08T03:01:07.651Z' - date_modified: '2018-12-08T03:01:07.651Z' - object: address - bank_account: - id: bank_8cad8df5354d33f - description: Test Bank Account - metadata: {} - routing_number: '322271627' - account_number: '123456789' - account_type: individual - signatory: John Doe - bank_name: J.P. MORGAN CHASE BANK, N.A. - verified: true - date_created: '2015-11-06T19:24:24.440Z' - date_modified: '2015-11-06T19:41:28.312Z' - object: bank_account - carrier: USPS - tracking_events: [] - thumbnails: - - small: https://lob-assets.com/checks/chk_92b9a6714bc0557c_thumb_small_1.png?version=v1&expires=1568239682&signature=ublquO_xAdvAkAwGJuOjgZQwcz7c3Ao4NHWHeDVTBEBjcrQr8LavxWEwUc1KU105Zex3SajRQLd6hqJOrDl0Bw - medium: https://lob-assets.com/checks/chk_92b9a6714bc0557c_thumb_medium_1.png?version=v1&expires=1568239682&signature=vHyuOtsanX4HnY_0LNft6ZJ8C67JnbI8ZVCjA2d9nR0Rd6lCl0Nk1s6BAhefbBkzecX9Yp0B8NWN9Q5v1Z4ICw - large: https://lob-assets.com/checks/chk_92b9a6714bc0557c_thumb_large_1.png?version=v1&expires=1568239682&signature=SzCLKJ5m_TKJPLlL9PMw-zW9wo5mVYEK1jCtHwWRwwEaNU2v4Aehy-YHtus3TFJIt8RD2M-0Y3MtCxHwhqSABg - - small: https://lob-assets.com/checks/chk_92b9a6714bc0557c_thumb_small_2.png?version=v1&expires=1568239682&signature=iElagODaOCkF_lCUxIw-lK50GhEU1ar_odmslCazZqD4Fsd_rQLx3M4Q5HzYWp4evfzuCoFvk4oAQVuIAaguAw - medium: https://lob-assets.com/checks/chk_92b9a6714bc0557c_thumb_medium_2.png?version=v1&expires=1568239682&signature=2vwvm_QsfmdtkAa-_F4uk-0yeUPRascyhfwOr-OX1ya9i_8gdFQAxMTrP-FfNBVSYFXeknFm6IUPJHggfgeiBg - large: https://lob-assets.com/checks/chk_92b9a6714bc0557c_thumb_large_2.png?version=v1&expires=1568239682&signature=NQf7tP9F4rP66S16hQ8duFpZSbTjaGBGK61Sr3H5D4CWtRyaPdoQlIpT2Jw-eKRcuYRkDEtQse_oWtL5gPqXDQ - - small: https://lob-assets.com/checks/chk_92b9a6714bc0557c_thumb_small_3.png?version=v1&expires=1568239682&signature=dbjFd44H9TyZsc3d0fqKon5e0GqZ6GA1dT26MH6WnoX8lrQor2CA6sZJ5qmu0Z4SAFlMKAzb-twqN7faLjEbDQ - medium: https://lob-assets.com/checks/chk_92b9a6714bc0557c_thumb_medium_3.png?version=v1&expires=1568239682&signature=vSgwVs7T9E6KKBK7XU-6jRL9i0jvgTqvNxkdRARFf0UNlryJFm8l_t_x5mPH0sCTFZcLp7ouRaR5hhdHC6vZBQ - large: https://lob-assets.com/checks/chk_92b9a6714bc0557c_thumb_large_3.png?version=v1&expires=1568239682&signature=If4tXlN13WYy7JDPpFkWw0HAQpYNJHqi2UstiPHxUA_8IAj6vXORb-22acI124Pd1bR1QSjBHAW1gbiJ0kjiAQ - merge_variables: null - expected_delivery_date: '2019-08-16' - mail_type: usps_first_class - date_created: '2019-08-08T19:34:27.802Z' - date_modified: '2019-08-08T19:34:30.582Z' - send_date: '2019-08-08T19:34:27.802Z' - use_type: operational - object: check - object: list - next_url: https://api.lob.com/v1/checks?limit=2&after=eyJkYXRlT2Zmc2V0IjoiMjAxOS0wOC0wOFQxOTozNDoyNy44MDJaIiwiaWRPZmZzZXQiOiJjaGtfOTJiOWE2NzE0YmMwNTU3YyJ9 - previous_url: null - count: 2 - post_check: - description: Returns a check object - headers: - ratelimit-limit: - $ref: '#/components/headers/ratelimit-limit' - ratelimit-remaining: - $ref: '#/components/headers/ratelimit-remaining' - ratelimit-reset: - $ref: '#/components/headers/ratelimit-reset' - content: - application/json: - schema: - $ref: '#/components/schemas/check' - example: - id: chk_534f10783683daa0 - description: Demo Check - metadata: {} - check_number: 10062 - memo: rent - amount: 22.5 - url: https://lob-assets.com/checks/chk_534f10783683daa0.pdf?expires=1540372221&signature=Ty3IV2bGPEoQfrdraYHlNYTaarnHLXb - to: - id: adr_bae820679f3f536b - description: Harry - Office - name: HARRY ZHANG - company: LOB - email: harry@lob.com - phone: '5555555555' - address_line1: 210 KING ST STE 6100 - address_line2: '' - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2018-12-08T03:08:43.446Z' - date_modified: '2018-12-08T03:08:43.446Z' - object: address - recipient_moved: false - from: - id: adr_b8fb5acf3a2b55db - name: LEORE AVIDAR - address_line1: 210 KING ST STE 6100 - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2017-09-05T17:47:53.767Z' - date_modified: '2017-09-05T17:47:53.767Z' - object: address - bank_account: - id: bank_8cad8df5354d33f + routing_number: '322271627' + fractional_routing_number: 25-3/440 + check_template: jpm + account_number: '123456789' + account_type: company + signatory: John Doe + bank_name: J.P. MORGAN CHASE BANK, N.A., + bank_city: Columbus + bank_state: OH + bank_zip: '43240' + verified: false + date_created: '2015-11-06T19:24:24.440Z' + date_modified: '2015-11-06T19:24:24.440Z' + object: bank_account + default: + $ref: '#/components/responses/bank_account_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/bank_accounts/bank_8cad8df5354d33f \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: Typescript + source: | + try { + const bankAccount = await new BankAccountsApi(config).get('bank_xxxx'); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: > + Lob.bankAccounts.retrieve('bank_8cad8df5354d33f', function (err, + res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + bankAccountApi = BankAccountsApi.new(config) + + begin + retrievedBankAccount = bankAccountApi.get("bank_8cad8df5354d33f") + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = BankAccountsApi(api_client) + + try: + bank_account = api.get("bank_8cad8df5354d33f") + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\BankAccountsApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->get("bank_8cad8df5354d33f"); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + BankAccountsApi apiInstance = new BankAccountsApi(config); + + try { + BankAccount response = apiInstance.get("bank_8cad8df5354d33f"); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.BankAccount.find("bank_8cad8df5354d33f") + label: ELIXIR + - lang: CSharp + source: | + BankAccountsApi api = new BankAccountsApi(config); + + try { + BankAccount response = api.get("bank_8cad8df5354d33f"); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + fetchedBankAccount, _, err := + apiClient.BankAccountsApi.Get(context,"bank_8cad8df5354d33f").Execute() + + + if err != nil { + return err + } + label: GO + delete: + operationId: bank_account_delete + summary: Delete + description: Permanently deletes a bank account. It cannot be undone. + tags: + - Bank Accounts + responses: + '200': + $ref: '#/components/responses/bank_account_deleted' + default: + $ref: '#/components/responses/bank_account_error' + x-codeSamples: + - lang: Shell + source: > + curl -X DELETE + https://api.lob.com/v1/bank_accounts/bank_3e64d9904356b20 \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: Typescript + source: | + try { + const deleteBankAccount = await new BankAccountsApi(config).delete('bank_xxxx'); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: > + Lob.bankAccounts.delete('bank_3e64d9904356b20', function (err, res) + { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + bankAccountApi = BankAccountsApi.new(config) + + begin + deletedBankAccount = bankAccountApi.delete("bank_3e64d9904356b20") + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = BankAccountsApi(api_client) + + try: + deleted_resource = api.delete("bank_3e64d9904356b20") + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\BankAccountsApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->delete("bank_3e64d9904356b20"); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + BankAccountsApi apiInstance = new BankAccountsApi(config); + + try { + BankAccountDeletion response = apiInstance.delete("bank_3e64d9904356b20"); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.BankAccount.destroy("bank_3e64d9904356b20") + label: ELIXIR + - lang: CSharp + source: | + BankAccountsApi api = new BankAccountsApi(config); + + try { + BankAccountDeletion response = api.delete("bank_3e64d9904356b20"); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + deletedBankAccount, _, err := + apiClient.BankAccountsApi.Delete(context, + "bank_3e64d9904356b20").Execute() + + + if err != nil { + return err + } + label: GO + /bank_accounts: + get: + operationId: bank_accounts_list + summary: List + description: >- + Returns a list of your bank accounts. The bank accounts are returned + sorted by creation date, with the most recently created bank accounts + appearing first. + tags: + - Bank Accounts + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/before_after' + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/date_created' + - $ref: '#/components/parameters/metadata' + responses: + '200': + $ref: '#/components/responses/all_bank_accounts' + default: + $ref: '#/components/responses/bank_account_error' + x-codeSamples: + - lang: Shell + source: | + curl -X GET "https://api.lob.com/v1/bank_accounts?limit=2" \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: Typescript + source: | + try { + const bankaccounts = await new BankaccountsApi(config).list(2); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.bankAccounts.list({limit: 2}, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + bankAccountsApi = BankAccountsApi.new(config) + + begin + bankAccounts = bankAccountsApi.list({ limit: 2 }) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = BankAccountsApi(api_client) + + try: + bank_accounts = api.list(limit=2) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\BankAccountsApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->list( + 2, // limit + ); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + BankAccountsApi apiInstance = new BankAccountsApi(config); + + try { + BankAccountList response = apiInstance.list( + 2, // limit + null, // before + null, // after + null, // include + null, // dateCreated + null // metadata + ); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.BankAccount.list(%{limit: 2}) + label: ELIXIR + - lang: CSharp + source: > + BankAccountsApi api = new BankAccountsApi(config); + + + List includeList = new List(); + + includeList.Add("total_count"); + + Dictionary metadata = new Dictionary(); + + metadata.Add("name", "Harry"); + + Dictionary dateCreated = new Dictionary(); + + DateTime dateCreatedDate = DateTime.Today.AddMonths(-1); + + dateCreated.Add("lt", dateCreatedDate); + + + try { + BankAccountList response = api.list( + 2, // limit + null, // before + null, // after + includeList, // include + dateCreated, // dateCreated + metadata // metadata + ); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + BankAccountList = apiClient.BankAccountsApi.List(context).Execute() + + if err != nil { + return err + } + label: GO + post: + operationId: bank_account_create + summary: Create + description: >- + Creates a new bank account with the provided properties. Bank accounts + created in live mode will need to be verified via micro deposits before + being able to send live checks. The deposits will appear in the bank + account in 2-3 business days and have the description "VERIFICATION". + tags: + - Bank Accounts + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/bank_account_base' + example: description: Test Bank Account - metadata: {} routing_number: '322271627' account_number: '123456789' - signatory: John Doe - bank_name: J.P. MORGAN CHASE BANK, N.A. - verified: true - account_type: company - date_created: '2015-11-06T19:24:24.440Z' - date_modified: '2015-11-06T19:41:28.312Z' - object: bank_account - signature_url: https://lob-assets.com/bank-accounts/asd_asdfghjkqwertyui.pdf?expires=1234567890&signature=aksdf - carrier: USPS - tracking_events: [] - thumbnails: - - small: https://lob-assets.com/checks/chk_534f10783683daa0_thumb_small_1.png?expires=1540372221&signature=ShhPpH74wYkNiAj7Il9B6q8ZKkzlGd4 - medium: https://lob-assets.com/checks/chk_534f10783683daa0_thumb_medium_1.png?expires=1540372221&signature=tmIOq6aAyKgzAECp7STj1rvJuMS5Svd - large: https://lob-assets.com/checks/chk_534f10783683daa0_thumb_large_1.png?expires=1540372221&signature=04nLEwE9d2qgQJNgJYWSOgPnU0FZbEv - merge_variables: - name: Harry - expected_delivery_date: '2017-09-12' - mail_type: usps_first_class - date_created: '2017-09-05T17:47:53.896Z' - date_modified: '2017-09-05T17:47:53.896Z' - send_date: '2017-09-05T17:47:53.896Z' - object: check - message: pancakes are good - check_bottom_template_id: tmpl_a - attachment_template_id: tmpl_a - check_bottom_template_version_id: vrsn_a - attachment_template_version_id: vrsn_a - use_type: operational - deleted: true - check_canceled: - description: Deleted - content: - application/json: - schema: - $ref: '#/components/schemas/check_deletion' - example: - id: chk_123456789 - deleted: true - creatives_error: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - example: - error: - code: not_found - message: creative not found - status_code: 404 - identity_validation_error: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - example: - error: - code: invalid - message: recipient is required - status_code: 422 - identity_validation: - description: Returns the likelihood a given name is associated with an address. - headers: - ratelimit-limit: - $ref: '#/components/headers/ratelimit-limit' - ratelimit-remaining: - $ref: '#/components/headers/ratelimit-remaining' - ratelimit-reset: - $ref: '#/components/headers/ratelimit-reset' - content: - application/json: - schema: - $ref: '#/components/schemas/identity_validation' - example: - id: id_validation_8a013f3e - recipient: LARRY LOBSTER - primary_line: 210 KING ST. - secondary_line: '' - urbanization: '' - last_line: SAN FRANCISCO CA 94107-1728 - score: 100 - confidence: high - object: id_validation - intl_autocompletions_error: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - example: - error: - code: invalid - message: address_prefix is required - status_code: 422 - intl_autocompletions: - description: Returns an international autocompletions object. - headers: - ratelimit-limit: - $ref: '#/components/headers/ratelimit-limit' - ratelimit-remaining: - $ref: '#/components/headers/ratelimit-remaining' - ratelimit-reset: - $ref: '#/components/headers/ratelimit-reset' - content: - application/json: - schema: - $ref: '#/components/schemas/intl_autocompletions' - examples: - basic: - value: - id: intl_auto_a3ac97bcfbb2460ab20c - suggestions: - - primary_number_range: '' - primary_line: 340 WATERSTONE PL SE - city: AIRDRIE - state: AB - country: CA - zip_code: T4B 2G7 - - primary_number_range: '' - primary_line: 340 WATT BLVD SW - city: EDMONTON - state: AB - country: CA - zip_code: T6X 1R7 - - primary_number_range: '' - primary_line: 340 WATROUS ST - city: PRINCE GEORGE - state: BC - country: CA - zip_code: V2M 2B6 - - primary_number_range: '' - primary_line: 340 WATERS RD - city: QUALICUM BEACH - state: BC - country: CA - zip_code: V9K 2B8 - - primary_number_range: '' - primary_line: SUITE 340, 1510 WATT DR SW - city: EDMONTON - state: AB - country: CA - zip_code: T6X 2E6 - - primary_number_range: '' - primary_line: WATERFRONT POINTE WEST SUITE 340, 5212 25 AVE NW - city: EDMONTON - state: AB - country: CA - zip_code: T6L 6R7 - - primary_number_range: '' - primary_line: WATERFRONT POINTE EAST SUITE 340, 2520 52 ST NW - city: EDMONTON - state: AB - country: CA - zip_code: T6L 6S2 - - primary_number_range: '' - primary_line: WATERSTONE SUITE 340, 6079 MAYNARD WAY NW - city: EDMONTON - state: AB - country: CA - zip_code: T6R 0S4 - - primary_number_range: '' - primary_line: WATSON APTS. SUITE 340, 5207 39 ST - city: RED DEER - state: AB - country: CA - zip_code: T4N 0Z9 - - primary_number_range: '' - primary_line: WATERS EDGE SUITE 3400..3409, 2600 FERGUSON RD - city: SAANICHTON - state: BC - country: CA - zip_code: V8M 2C1 - object: intl_autocompletion - test: - value: - id: intl_auto_a3ac97bcfbb2460ab20c - suggestions: - - primary_number_range: '' - primary_line: 1 TWIN OAKS CT - city: GREENVILLE - state: SC - country: CA - zip_code: '29615' - - primary_number_range: '' - primary_line: 1 TEVA DR - city: STAR CITY - state: CA - country: CA - zip_code: '91355' - - primary_number_range: '' - primary_line: 1 TELEGRAM AVE - city: ELMONT - state: NY - country: CA - zip_code: '11003' - - primary_number_range: '' - primary_line: 1 TELEGRAM AVE - city: GARDEN CITY - state: KS - country: CA - zip_code: '67846' - - primary_number_range: '' - primary_line: 1 TELEGRAPH HILL RD - city: HOLMDEL - state: NJ - country: CA - zip_code: '07733' - - primary_number_range: '' - primary_line: 1 TELEGRAPH HILL RD S - city: HOLMDEL - state: NJ - country: CA - zip_code: '07733' - - primary_number_range: '' - primary_line: 1 TELEGRAPH HILL BLVD - city: SAN FRANCISCO - state: CA - country: CA - zip_code: '94133' - object: intl_autocompletion - intl_verifications: - description: Returns an international verification object. - headers: - ratelimit-limit: - $ref: '#/components/headers/ratelimit-limit' - ratelimit-remaining: - $ref: '#/components/headers/ratelimit-remaining' - ratelimit-reset: - $ref: '#/components/headers/ratelimit-reset' - content: - application/json: + signatory: Jane Doe + account_type: individual + metadata: + spiffy: 'true' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/bank_account_base' + example: + description: Test Bank Account + routing_number: '322271627' + account_number: '123456789' + signatory: Jane Doe + account_type: individual + metadata: + spiffy: 'true' + encoding: + metadata: + style: deepObject + explode: true + multipart/form-data: + schema: + $ref: '#/components/schemas/bank_account_base' + example: + description: Test Bank Account + routing_number: '322271627' + account_number: '123456789' + signatory: Jane Doe + account_type: individual + metadata: + spiffy: 'true' + responses: + '200': + $ref: '#/components/responses/post_bank_account' + default: + $ref: '#/components/responses/bank_account_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/bank_accounts \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ + -d "description=Test Bank Account" \ + -d "routing_number=322271627" \ + -d "account_number=123456789" \ + -d "signatory=John Doe" \ + -d "account_type=company" + label: CURL + - lang: Typescript + source: | + const bankAccountCreate = new BankAccountWritable({ + description: 'Test Bank Account', + routing_number: '322271627', + account_number: '123456789', + signatory: 'Gomez Addams', + account_type: BankTypeEnum.Individual + }); + + try { + const myBankAcount = await new BankAccountsApi(config).create(bankAccountCreate); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.bankAccounts.create({ + description: 'Test Bank Account', + routing_number: 322271627, + account_number: 123456789, + signatory: 'John Doe', + account_type: 'company' + }, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + bankAccountCreate = BankAccountWritable.new({ + description: "Test Bank Account", + routing_number: "322271627", + account_number: "123456789", + signatory: "John Doe", + account_type: BankTypeEnum::COMPANY, + }); + + bankAccountApi = BankAccountsApi.new(config) + + begin + createdBankAccount = bankAccountApi.create(bankAccountCreate) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + bank_account_writable = BankAccountWritable( + description = "Test Bank Account", + routing_number = "322271627", + account_number = "123456789", + signatory = "John Doe", + account_type = BankTypeEnum("company"), + ) + + with ApiClient(configuration) as api_client: + api = BankAccountsApi(api_client) + + try: + created_bank_account = api.create(bank_account_writable) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\BankAccountsApi($config, new + GuzzleHttp\Client()); + + $bank_account_writable = new + OpenAPI\Client\Model\BankAccountWritable( + array( + "description" => "Test Bank Account", + "routing_number" => "322271627", + "account_number" => "123456789", + "signatory" => "John Doe", + "account_type" => "company", + ) + ); + + + try { + $result = $apiInstance->create($bank_account_writable); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + BankAccountsApi apiInstance = new BankAccountsApi(config); + + try { + BankAccountWritable bankAccountWritable = new BankAccountWritable(); + bankAccountWritable.setDescription("Test Bank Account"); + bankAccountWritable.setRoutingNumber("322271627"); + bankAccountWritable.setAccountNumber("123456789"); + bankAccountWritable.setSignatory("John Doe"); + bankAccountWritable.setAccountType(BankTypeEnum.COMPANY); + + BankAccount result = apiInstance.create(bankAccountWritable); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.BankAccount.create(%{ + description: "Test Bank Account", + routing_number: "322271627", + account_number: "123456789", + signatory: "John Doe", + account_type: "company" + }) + label: ELIXIR + - lang: CSharp + source: | + BankAccountsApi api = new BankAccountsApi(config); + + BankAccountWritable bankAccountWritable = new BankAccountWritable( + "Test Bank Account", // description + "322271627", // routingNumber + "123456789", // accountNumber + BankTypeEnum.Company, // accountType + "John Doe" // signatory + ); + + try { + BankAccount result = api.create(bankAccountWritable); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + + var bankAccountCreate = *lob.NewBankAccountWritable() + + bankAccountCreate.SetDescription("Test Bank Account") + + bankAccountCreate.SetRoutingNumber("322271627") + + bankAccountCreate.SetAccountNumber("123456789") + + bankAccountCreate.SetSignatory("John Doe") + + bankAccountCreate.SetAccountType("company") + + + + + createdbankAccount, _, err := + apiClient.BankAccountsApi.Create(context).BankAccountWritable(bankAccountCreate).Execute() + + + if err != nil { + return err + } + label: GO + /billing_groups/{bg_id}: + parameters: + - in: path + name: bg_id + description: id of the billing_group + required: true + schema: + $ref: '#/components/schemas/bg_id' + get: + operationId: billing_group_retrieve + summary: Retrieve + description: >- + Retrieves the details of an existing billing_group. You need only supply + the unique billing_group identifier that was returned upon billing_group + creation. + tags: + - Billing Groups + responses: + '200': + description: Returns a billing_group object. + content: + application/json: + schema: + $ref: '#/components/schemas/billing_group' + example: + id: bg_c94e83ca2cd5121 + name: Marketing Dept + description: Usage group used for the Marketing Dept resource sends + date_created: '2017-11-07T22:56:10.962Z' + date_modified: '2017-11-07T22:56:10.962Z' + object: billing_group + default: + $ref: '#/components/responses/billing_group_list_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/billing_groups/bg_4bb02b527a72667d0 \ + -u : + - lang: Ruby + source: | + billingGroupApi = BillingGroupsApi.new(config) + + begin + retrievedBillingGroup = billingGroupApi.get("bg_4bb02b527a72667d0") + rescue => err + p err.message + end + label: RUBY + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + fetchedBillingGroup, _, err := + apiClient.BillingGroupsApi.Get(context,"bg_4bb02b527a72667d0").Execute() + + + if err != nil { + return err + } + label: GO + post: + operationId: billing_group_update + summary: Update + description: Updates all editable attributes of the billing_group with the given id. + tags: + - Billing Groups + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/billing_group_base' + example: + name: Marketing Dept + description: Usage group used for the Marketing Dept resource sends + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/billing_group_base' + example: + name: Marketing Dept + description: Usage group used for the Marketing Dept resource sends + multipart/form-data: + schema: + $ref: '#/components/schemas/billing_group_base' + example: + name: Marketing Dept + description: Usage group used for the Marketing Dept resource sends + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/billing_groups/bg_759954f540a1bfdb5 \ + -u : \ + -d "description=demo replacement" \ + - lang: Ruby + source: | + billingGroupEditable = BillingGroupEditable.new({ + description: "demo replacement", + }) + + bgApi = BillingGroupsApi.new(config) + + begin + updatedBillingGroup = bgApi.update("bg_759954f540a1bfdb5", billingGroupEditable) + rescue => err + p err.message + end + label: RUBY + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + var bgEditable = *lob.NewBillingGroupEditable("Test Billing group") + + createdBillingGroup, _, _ := + apiClient.BillingGroupsApi.Create(context).BillingGroupEditable(suite.bgEditable).Execute() + + + bgEditable.SetDescription("BG updated") + + resp, _, err := suite.apiClient.BillingGroupsApi.Update(context, + createdBillingGroup.Id).BillingGroupEditable(suite.bgEditable).Execute() + + + if err != nil { + return err + } + label: GO + responses: + '200': + $ref: '#/components/responses/post_billing_group' + default: + $ref: '#/components/responses/billing_group_error' + /billing_groups: + get: + operationId: billing_groups_list + summary: List + description: >- + Returns a list of your billing_groups. The billing_groups are returned + sorted by creation date, with the most recently created billing_groups + appearing first. + tags: + - Billing Groups + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/date_created' + - $ref: '#/components/parameters/date_modified' + - in: query + name: sort_by + description: > + Sorts items by ascending or descending dates. Use either + `date_created` or `date_modified`, not both. + schema: + allOf: + - type: object + properties: + date_created: + type: string + enum: + - asc + - desc + date_modified: + type: string + enum: + - asc + - desc + - oneOf: + - required: + - date_created + - required: + - date_modified + responses: + '200': + description: Returns a list of billing_groups. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/list' + - type: object + properties: + data: + type: array + description: list of billing_groups + items: + $ref: '#/components/schemas/billing_group' + example: + data: + - id: bg_d5a5a89da9106f8 + description: Test billing_group + metadata: {} + date_created: '2019-07-27T23:49:01.511Z' + date_modified: '2019-07-27T23:49:01.511Z' + object: billing_group + - id: bg_59b2150ae120887 + description: Test billing_group + metadata: {} + date_created: '2019-03-29T10:22:34.642Z' + date_modified: '2019-03-29T10:22:34.642Z' + object: billing_group + object: list + next_url: null + prev_url: null + count: 2 + default: + $ref: '#/components/responses/billing_group_list_error' + x-codeSamples: + - lang: Shell + source: | + curl -X GET "https://api.lob.com/v1/billing_groups?limit=2" \ + -u : + - lang: Ruby + source: | + billingGroupsApi = BillingGroupsApi.new(config) + + begin + billingGroups = billingGroupsApi.list({ limit: 2 }) + rescue => err + p err.message + end + label: RUBY + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + BillingGroupList = + apiClient.BillingGroupsApi.List(context).Execute() + + if err != nil { + return err + } + label: GO + post: + operationId: billing_group_create + summary: Create + description: Creates a new billing_group with the provided properties. + tags: + - Billing Groups + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/billing_group_editable' + example: + name: Marketing Dept + description: Usage group used for the Marketing Dept resource sends + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/billing_group_editable' + example: + name: Marketing Dept + description: Usage group used for the Marketing Dept resource sends + multipart/form-data: + schema: + $ref: '#/components/schemas/billing_group_editable' + example: + name: Marketing Dept + description: Usage group used for the Marketing Dept resource sends + responses: + '200': + $ref: '#/components/responses/post_billing_group' + default: + $ref: '#/components/responses/billing_group_error' + x-codeSamples: + - lang: Shell + source: > + curl https://api.lob.com/v1/billing_groups \ + + -u : \ + + -d "name=Marketing Department" \ + + -d "description=Usage group used for the Marketing Department's + resource sends" + - lang: Ruby + source: | + bgCreate = BillingGroupEditable.new({ + description: "Usage group used for the Marketing Department's resource sends", + name: "Marketing Department", + }); + + bgApi = BillingGroupsApi.new(config) + + begin + createdBillingGroup = bgApi.create(bgCreate) + rescue => err + p err.message + end + label: RUBY + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + + var bgCreate = *lob.NewBillingGroupEditable() + + bgCreate.SetDescription("Usage group used for the Marketing + Department's resource sends") + + bgCreate.SetName("Marketing Department") + + + + + createdbg, _, err := + apiClient.BillingGroupsApi.Create(context).BillingGroupEditable(bgCreate).Execute() + + + if err != nil { + return err + } + label: GO + /buckslips: + get: + operationId: buckslips_list + summary: List + description: >- + Returns a list of your buckslips. The buckslips are returned sorted by + creation date, with the most recently created buckslips appearing first. + tags: + - Buckslips + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/before_after' + - $ref: '#/components/parameters/include' + responses: + '200': + description: Returns a list of buckslip objects + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/list' + - type: object + properties: + data: + type: array + description: list of buckslips + items: + $ref: '#/components/schemas/buckslip' + example: + data: + - id: bck_7a6d73c5c8457fc + account_id: fa9ea650fc7b31a89f92 + description: null + url: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA + size: 8.75x3.75 + has_front: true + has_back: true + auto_reorder: false + reorder_quantity: null + threshold_amount: 0 + raw_url: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + front_original_url: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + back_original_url: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + thumbnails: + - small: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg + medium: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA + large: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw + available_quantity: 0 + allocated_quantity: 0 + onhand_quantity: 0 + pending_quantity: 0 + projected_quantity: 0 + buckslip_orders: [] + stock: text + weight: 80# + finish: gloss + status: rendered + mode: test + date_created: '2021-03-24T22:51:42.838Z' + date_modified: '2021-03-24T22:51:42.838Z' + send_date: '2021-03-24T22:51:42.838Z' + object: buckslip + object: list + previous_url: null + next_url: null + count: 1 + default: + $ref: '#/components/responses/buckslip_error' + x-codeSamples: + - lang: Shell + source: | + curl -X GET "https://api.lob.com/v1/buckslips?limit=2" \ + -u : + label: CURL + post: + operationId: buckslip_create + summary: Create + description: Creates a new buckslip given information + tags: + - Buckslips + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/buckslip_editable' + example: + description: Test buckslip + front: >- + https://s3-us-west-2.amazonaws.com/public.lob.com/assets/buckslip.pdf + back: >- + https://s3-us-west-2.amazonaws.com/public.lob.com/assets/buckslip.pdf + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/buckslip_editable' + example: + description: Test buckslip + front: >- + https://s3-us-west-2.amazonaws.com/public.lob.com/assets/buckslip.pdf + back: >- + https://s3-us-west-2.amazonaws.com/public.lob.com/assets/buckslip.pdf + multipart/form-data: + schema: + $ref: '#/components/schemas/buckslip_editable' + example: + description: Test buckslip + front: >- + https://s3-us-west-2.amazonaws.com/public.lob.com/assets/buckslip.pdf + back: >- + https://s3-us-west-2.amazonaws.com/public.lob.com/assets/buckslip.pdf + responses: + '200': + description: Buckslip created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/buckslip' + examples: + basic: + value: + id: bck_7a6d73c5c8457fc + account_id: fa9ea650fc7b31a89f92 + description: Test buckslip + url: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA + size: 8.75x3.755 + auto_reorder: false + reorder_quantity: null + threshold_amount: 0 + raw_url: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + front_original_url: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + back_original_url: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + thumbnails: + - small: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg + medium: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA + large: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw + - small: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_small_2.png?version=v1&expires=1636910992&signature=IWsmPa_ULlv2yyqjX564d_YfHHY_M7i9YxDnw-WXDr2jtOFcArmRZQbnHeE9g_rYxnddJbgosuv8-c2utiu7Cg + medium: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_medium_2.png?version=v1&expires=1636910992&signature=zxK7VKGiTvz5Ywrkaydd0v3GcYf58R7A08J4tNfI7-aiNODDcTF3l0MqY13n9Pyc8RXSdD0XVBY-OpbA1VM-Ag + large: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_large_2.png?version=v1&expires=1636910992&signature=r0OFUhh315ZwN0raMZdIwJd2oCIEYsz0BABaMxIuO1PKTD0ckGWrhcGdzk2dlWQ6vSvp0CUQ5k1RXGqkIIqkDw + available_quantity: 0 + allocated_quantity: 0 + onhand_quantity: 0 + pending_quantity: 0 + projected_quantity: 0 + buckslip_orders: [] + stock: text + weight: 80# + finish: gloss + status: rendered + mode: test + date_created: '2021-03-24T22:51:42.838Z' + date_modified: '2021-03-24T22:51:42.838Z' + send_date: '2021-03-24T22:51:42.838Z' + object: buckslip + default: + $ref: '#/components/responses/buckslip_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/buckslips \ + -u : \ + -d "description=Test buckslip" \ + -d "front=https://s3-us-west-2.amazonaws.com/public.lob.com/assets/buckslip.pdf" \ + -d "back=https://s3-us-west-2.amazonaws.com/public.lob.com/assets/buckslip.pdf" + label: CURL + /buckslips/{buckslip_id}: + parameters: + - in: path + name: buckslip_id + description: id of the buckslip + required: true + schema: + $ref: '#/components/schemas/buckslip_id' + get: + operationId: buckslip_retrieve + summary: Retrieve + description: >- + Retrieves the details of an existing buckslip. You need only supply the + unique customer identifier that was returned upon buckslip creation. + tags: + - Buckslips + responses: + '200': + description: Returns a buckslip object + content: + application/json: + schema: + $ref: '#/components/schemas/buckslip' + examples: + basic: + value: + id: bck_7a6d73c5c8457fc + account_id: fa9ea650fc7b31a89f92 + description: Test buckslip + url: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA + size: 8.75x3.755 + auto_reorder: false + reorder_quantity: null + threshold_amount: 0 + raw_url: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + front_original_url: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + back_original_url: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + thumbnails: + - small: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg + medium: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA + large: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw + - small: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_small_2.png?version=v1&expires=1636910992&signature=IWsmPa_ULlv2yyqjX564d_YfHHY_M7i9YxDnw-WXDr2jtOFcArmRZQbnHeE9g_rYxnddJbgosuv8-c2utiu7Cg + medium: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_medium_2.png?version=v1&expires=1636910992&signature=zxK7VKGiTvz5Ywrkaydd0v3GcYf58R7A08J4tNfI7-aiNODDcTF3l0MqY13n9Pyc8RXSdD0XVBY-OpbA1VM-Ag + large: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_large_2.png?version=v1&expires=1636910992&signature=r0OFUhh315ZwN0raMZdIwJd2oCIEYsz0BABaMxIuO1PKTD0ckGWrhcGdzk2dlWQ6vSvp0CUQ5k1RXGqkIIqkDw + available_quantity: 0 + allocated_quantity: 0 + onhand_quantity: 0 + pending_quantity: 0 + projected_quantity: 0 + buckslip_orders: [] + stock: text + weight: 80# + finish: gloss + status: rendered + mode: test + date_created: '2021-03-24T22:51:42.838Z' + date_modified: '2021-03-24T22:51:42.838Z' + send_date: '2021-03-24T22:51:42.838Z' + object: buckslip + default: + $ref: '#/components/responses/buckslip_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/buckslips/bck_7a6d73c5c8457fc \ + -u : + label: CURL + patch: + operationId: buckslip_update + summary: Update + description: >- + Update the details of an existing buckslip. You need only supply the + unique identifier that was returned upon buckslip creation. + tags: + - Buckslips + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/buckslip_updatable' + example: + description: Test buckslip + auto_reorder: true + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/buckslip_updatable' + example: + description: Test buckslip + auto_reorder: true + multipart/form-data: + schema: + $ref: '#/components/schemas/buckslip_updatable' + example: + description: Test buckslip + auto_reorder: true + responses: + '200': + description: Returns a buckslip object + content: + application/json: + schema: + $ref: '#/components/schemas/buckslip' + examples: + basic: + value: + id: bck_7a6d73c5c8457fc + account_id: fa9ea650fc7b31a89f92 + description: Test buckslip + url: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA + size: 8.75x3.755 + auto_reorder: false + reorder_quantity: null + threshold_amount: 0 + raw_url: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + front_original_url: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + back_original_url: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + thumbnails: + - small: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg + medium: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA + large: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw + - small: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_small_2.png?version=v1&expires=1636910992&signature=IWsmPa_ULlv2yyqjX564d_YfHHY_M7i9YxDnw-WXDr2jtOFcArmRZQbnHeE9g_rYxnddJbgosuv8-c2utiu7Cg + medium: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_medium_2.png?version=v1&expires=1636910992&signature=zxK7VKGiTvz5Ywrkaydd0v3GcYf58R7A08J4tNfI7-aiNODDcTF3l0MqY13n9Pyc8RXSdD0XVBY-OpbA1VM-Ag + large: >- + https://lob-assets.com/buckslips/bck_c51ae96f5cebf3e_thumb_large_2.png?version=v1&expires=1636910992&signature=r0OFUhh315ZwN0raMZdIwJd2oCIEYsz0BABaMxIuO1PKTD0ckGWrhcGdzk2dlWQ6vSvp0CUQ5k1RXGqkIIqkDw + available_quantity: 0 + allocated_quantity: 0 + onhand_quantity: 0 + pending_quantity: 0 + projected_quantity: 0 + buckslip_orders: [] + stock: text + weight: 80# + finish: gloss + status: rendered + mode: test + date_created: '2021-03-24T22:51:42.838Z' + date_modified: '2021-03-24T22:51:42.838Z' + send_date: '2021-03-24T22:51:42.838Z' + object: buckslip + default: + $ref: '#/components/responses/buckslip_error' + x-codeSamples: + - lang: Shell + source: | + curl -X PATCH https://api.lob.com/v1/buckslips/bck_7a6d73c5c8457fc \ + -u : \ + -d "description=Awesome buckslip" \ + -d "auto_reorder=true" + label: CURL + delete: + operationId: buckslip_delete + summary: Delete + description: >- + Delete an existing buckslip. You need only supply the unique identifier + that was returned upon buckslip creation. + tags: + - Buckslips + responses: + '200': + $ref: '#/components/responses/buckslip_deleted' + default: + $ref: '#/components/responses/buckslip_error' + x-codeSamples: + - lang: Shell + source: > + curl -X DELETE https://api.lob.com/v1/buckslips/bck_7a6d73c5c8457fc + \ + -u : + label: CURL + /buckslips/{buckslip_id}/orders: + parameters: + - in: path + name: buckslip_id + description: The ID of the buckslip to which the buckslip orders belong. + required: true + schema: + $ref: '#/components/schemas/buckslip_id' + get: + operationId: buckslip_orders_retrieve + summary: Retrieve + description: Retrieves the buckslip orders associated with the given buckslip id. + tags: + - Buckslip Orders + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: Returns the buckslip orders associated with the given buckslip id + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/list' + - type: object + properties: + data: + type: array + description: List of buckslip orders + items: + $ref: '#/components/schemas/buckslip_order' + example: + data: + - id: bo_e0f8a0562a06bea7f + buckslip_id: bck_6afffd19045076c + status: available + quantity_ordered: 5000 + unit_price: 0.75 + cancelled_reason: No longer needed + availability_date: '2021-10-12T21:41:48.326Z' + expected_availability_date: '2021-11-04T21:03:18.871Z' + date_created: '2021-10-07T21:03:18.871Z' + date_modified: '2021-10-16T01:00:30.144Z' + object: buckslip_order + object: list + next_url: null + previous_url: null + count: 1 + default: + $ref: '#/components/responses/buckslip_order_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/buckslips/bck_6afffd19045076c/orders/ \ + -u : + label: CURL + post: + operationId: buckslip_order_create + summary: Create + description: Creates a new buckslip order given information + tags: + - Buckslip Orders + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/buckslip_order_editable' + example: + quantity: 10000 + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/buckslip_order_editable' + example: + quantity: 10000 + multipart/form-data: + schema: + $ref: '#/components/schemas/buckslip_order_editable' + example: + quantity: 10000 + responses: + '200': + description: Buckslip order created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/buckslip_order' + examples: + basic: + value: + id: bo_e0f8a0562a06bea7f + buckslip_id: bck_6afffd19045076c + status: available + quantity_ordered: 10000 + unit_price: 0.75 + cancelled_reason: No longer needed + availability_date: '2021-10-12T21:41:48.326Z' + expected_availability_date: '2021-11-04T21:03:18.871Z' + date_created: '2021-10-07T21:03:18.871Z' + date_modified: '2021-10-16T01:00:30.144Z' + object: buckslip_order + default: + $ref: '#/components/responses/buckslip_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/buckslips/bck_6afffd19045076c/orders \ + -u : \ + -d "quantity=10000" + label: CURL + /bulk/us_verifications: + post: + operationId: bulk_us_verifications + summary: Bulk Verify + description: >- + Verify a list of US or US territory addresses _with a live API key_. + Requests to this endpoint with a test API key will return a dummy + response based on the primary line you input. + tags: + - US Verifications + parameters: + - in: query + name: case schema: - $ref: '#/components/schemas/intl_verification' - examples: - full: - value: - id: intl_ver_c7cb63d68f8d6 - recipient: null - primary_line: 370 WATER ST - secondary_line: '' - last_line: SUMMERSIDE PE C1N 1C4 - country: CA - coverage: SUBBUILDING - deliverability: deliverable - status: LV4 - components: - primary_number: '370' - street_name: WATER ST - city: SUMMERSIDE - state: PE + type: string + enum: + - upper + - proper + default: upper + description: >- + Casing of the verified address. Possible values are `upper` and + `proper` for uppercased (e.g. "PO BOX") and proper-cased (e.g. "PO + Box"), respectively. Only affects `recipient`, `primary_line`, + `secondary_line`, `urbanization`, and `last_line`. Default casing is + `upper`. + required: false + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/multiple_components_list' + example: + addresses: + - primary_line: 210 King Street + city: San Francisco + state: CA + zip_code: '94107' + - recipient: Walgreens + primary_line: Ave Wilson Churchill 123 + secondary_line: '' + urbanization: URB FAIR OAKS + city: RIO PIEDRAS + state: PR + zip_code: '00926' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/multiple_components_list' + example: + addresses: + - primary_line: 210 King Street + city: San Francisco + state: CA + zip_code: '94107' + - recipient: Walgreens + primary_line: Ave Wilson Churchill 123 + secondary_line: '' + urbanization: URB FAIR OAKS + city: RIO PIEDRAS + state: PR + zip_code: '00926' + multipart/form-data: + schema: + $ref: '#/components/schemas/multiple_components_list' + example: + addresses: + - primary_line: 210 King Street + city: San Francisco + state: CA + zip_code: '94107' + - recipient: Walgreens + primary_line: Ave Wilson Churchill 123 + secondary_line: '' + urbanization: URB FAIR OAKS + city: RIO PIEDRAS + state: PR + zip_code: '00926' + responses: + '200': + $ref: '#/components/responses/bulk_us_verifications' + default: + $ref: '#/components/responses/us_verifications_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/bulk/us_verifications \ + -u : \ + --header 'Content-Type: application/x-www-form-urlencoded' \ + --data-urlencode 'addresses[0][primary_line]=210 King Street' \ + --data-urlencode 'addresses[0][city]=San Francisco' \ + --data-urlencode 'addresses[0][state]=CA' \ + --data-urlencode 'addresses[0][zip_code]=94017' + label: CURL + - lang: Typescript + source: | + const UsVerifications = new USVerificationsApi(av_config); + const verificationData1: UsVerificationsWritable = { + primary_line: '210 King St', + city: 'San Francisco', + state: 'CA', + zip_code: '94107' + }; + const verificationData2: UsVerificationsWritable = { + primary_line: '185 BERRY ST STE 6600', + city: 'SAN FRANCISCO', + state: 'CA', + zip_code: '94107' + }; + const addressList: MultipleComponentsList = { + addresses: [verificationData1, verificationData2], + }; + + try { + const bulkVerified = await UsVerifications.verifyBulk(addressList); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.bulkUSVerifications.verify({ + addresses: [{ + primary_line: '210 King St', + city: 'San Francisco', + state: 'CA', + zip_code: '94107' + }] + }), function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + usVerificationsApi = UsVerificationsApi.new(config) + + verificationData0 = MultipleComponents.new({ + primary_line: "210 King Street", + city: "San Francisco", + state: "CA", + zip_code: "94017", + }) + + verificationData1 = MultipleComponents.new({ + primary_line: "185 BERRY ST STE 6600", + city: "SAN FRANCISCO", + state: "CA", + zip_code: "94017", + }) + + + addressList = MultipleComponentsList.new({ + addresses: [ + verificationData0, + verificationData1, + ], + }) + + begin + bulkVerifiedAddrs = usVerificationsApi.verifyBulk(addressList) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = UsVerificationsApi(api_client) + + verification_data_0 = MultipleComponents( + primary_line = "210 King Street", + city = "San Francisco", + state = "CA", + zip_code = "94017", + ) + + verification_data_1 = MultipleComponents( + primary_line = "185 BERRY ST STE 6600", + city = "SAN FRANCISCO", + state = "CA", + zip_code = "94017", + ) + + + address_list = MultipleComponentsList( + addresses = [ + verification_data_0, + verification_data_1, + ], + ) + + try: + bulk_verified = api.verifyBulk(address_list) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $verificationData0 = new + OpenAPI\Client\Model\MultipleComponents(array( + 'primary_line' => '210 King Street', + 'city' => 'San Francisco', + 'state' => 'CA', + 'zip_code' => '94017', + )); + + + $verificationData1 = new + OpenAPI\Client\Model\MultipleComponents(array( + 'primary_line' => '185 BERRY ST STE 6600', + 'city' => 'SAN FRANCISCO', + 'state' => 'CA', + 'zip_code' => '94017', + )); + + + $addressList = new + OpenAPI\Client\Model\MultipleComponentsList(array( + 'addresses' => [ + $verificationData0, + $verificationData1, + ] + )); + + + try { + $result = $apiInstance->verifyBulk($addressList); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + MultipleComponentsList bulkVerify = new MultipleComponentsList(); + MultipleComponents bulkAddress0 = new MultipleComponents(); + bulkAddress0.setPrimaryLine("210 King Street"); + bulkAddress0.setCity("San Francisco"); + bulkAddress0.setState("CA"); + bulkAddress0.setZipCode("94017"); + bulkVerify.addAddressesItem(bulkAddress0); + + MultipleComponents bulkAddress1 = new MultipleComponents(); + bulkAddress1.setPrimaryLine("185 BERRY ST STE 6600"); + bulkAddress1.setCity("SAN FRANCISCO"); + bulkAddress1.setState("CA"); + bulkAddress1.setZipCode("94017"); + bulkVerify.addAddressesItem(bulkAddress1); + + UsVerificationsApi apiInstance = new UsVerificationsApi(config); + try { + UsVerifications bulkVerifyResponse = apiInstance.verifyBulk(bulkVerify, null); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.BulkUSVerification.verify.verify( + %{ + addresses:[ + { + primary_line: "210 King Street", + city: "San Francisco", + state: "CA", + zip_code: "94107" + } + ] + }) + label: ELIXIR + - lang: CSharp + source: > + List addresses = new List(); + + MultipleComponents bulkAddress0 = new MultipleComponents( + null, // recipient + "210 King Street", // primaryLine + null, // secondaryLine + null, // urbanization + "San Francisco", // city + "CA", // state + "94017" // zipCode + ); + + addresses.Add(bulkAddress0); + + + MultipleComponents bulkAddress1 = new MultipleComponents( + null, // recipient + "185 BERRY ST STE 6600", // primaryLine + null, // secondaryLine + null, // urbanization + "San Francisco", // city + "CA", // state + "94017" // zipCode + ); + + addresses.Add(bulkAddress1); + + + MultipleComponentsList bulkVerify = new + MultipleComponentsList(addresses); + + + UsVerificationsApi api = new UsVerificationsApi(config); + + try { + UsVerifications bulkVerifyResponse = api.verifyBulk(bulkVerify, null); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + /bulk/intl_verifications: + post: + operationId: bulk_intl_verifications + summary: Bulk Verify + description: >- + Verify a list of international (except US or US territories) address + _with a live API key_. Requests to this endpoint with a test API key + will return a dummy response based on the primary line you input. + tags: + - Intl Verifications + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/intl_verifications_payload' + example: + addresses: + - recipient: John Doe + primary_line: 370 Water St + secondary_line: '' + city: Summerside + state: Prince Edwards Island postal_code: C1N 1C4 - object: intl_verification - test: - value: - id: intl_ver_c7cb63d68f8d6 - recipient: TEST KEYS DO NOT VERIFY ADDRESSES - primary_line: 370 WATER ST - secondary_line: '' - last_line: SUMMERSIDE PE C1N 1C4 - country: CA - coverage: SUBBUILDING - deliverability: deliverable - status: LV4 - components: - primary_number: '370' - street_name: WATER ST - city: SUMMERSIDE - state: PE + country: CA + - recipient: Jane Doe + primary_line: UL. DOLSKAYA 1 + secondary_line: '' + city: MOSCOW + state: MOSCOW G + postal_code: '115569' + country: RU + multipart/form-data: + schema: + $ref: '#/components/schemas/intl_verifications_payload' + example: + addresses: + - recipient: John Doe + primary_line: 370 Water St + secondary_line: '' + city: Summerside + state: Prince Edwards Island postal_code: C1N 1C4 - object: intl_verification - letter_deleted: - description: Deleted - content: - application/json: - schema: - $ref: '#/components/schemas/letter_deletion' - example: - id: ltr_123456789 - deleted: true - all_letters: - description: A dictionary with a data property that contains an array of up to `limit` letters. Each entry in the array is a separate letter. The previous and next page of letters can be retrieved by calling the endpoint contained in the `previous_url` and `next_url` fields in the API response respectively. If no more letters are available beyond the current set of returned results, the `next_url` field will be empty. - content: - application/json: - schema: - allOf: - - $ref: '#/components/schemas/list' - - type: object - properties: - data: - type: array - description: list of letters - items: - $ref: '#/components/schemas/letter' - example: - data: - - id: ltr_5ba44b462c79f07c - description: Demo Letter + country: CA + - recipient: Jane Doe + primary_line: UL. DOLSKAYA 1 + secondary_line: '' + city: MOSCOW + state: MOSCOW G + postal_code: '115569' + country: RU + responses: + '200': + $ref: '#/components/responses/bulk_intl_verifications' + default: + $ref: '#/components/responses/intl_verifications_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/bulk/intl_verifications \ + -u : \ + --header 'Content-Type: application/x-www-form-urlencoded' \ + --data-urlencode 'addresses[0][primary_line]=370 WATER ST' \ + --data-urlencode 'addresses[0][postal_code]=C1N 1C4' \ + --data-urlencode 'addresses[0][country]=CA' + label: CURL + - lang: Typescript + source: | + const IntlVerifications = new IntlVerificationsApi(av_config); + let verificationData1: IntlVerificationWritable = { + primary_line: '370 WATER ST', + postal_code: 'C1N 1C4', + country: CountryExtended.Ca + }; + const verificationData2: IntlVerificationWritable = { + primary_line: '012 PLACEHOLDER ST', + postal_code: 'F0O 8A2', + country: CountryExtended.Ca + }; + let addressList = new IntlVerificationsPayload({ + addresses: [verificationData1, verificationData2] + }); + + try { + const bulkVerified = await IntlVerifications.verifyBulk(addressList); + + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.bulkIntlVerifications.verify({ + addresses: [{ + primary_line: '370 Water St', + secondary_line: '', + city: 'Summerside', + state: 'Prince Edward Island', + postal_code: 'C1N 1C4', + country: 'CA' + }] + }), function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + intlVerificationsApi = IntlVerificationsApi.new(config) + + verificationData0 = MultipleComponentsIntl.new({ + primary_line: "35 Tower Hill", + city: "London", + postal_code: "EC3N 4DR", + country: "GB", + }) + + verificationData1 = MultipleComponentsIntl.new({ + primary_line: "370 Water St", + city: "Summerside", + state: "Prince Edward Island", + postal_code: "C1N 1C4", + country: "CA", + }) + + + addressList = IntlVerificationsPayload.new({ + addresses: [ + verificationData0, + verificationData1, + ], + }) + + begin + bulkVerifiedAddrs = intlVerificationsApi.verifyBulk(addressList) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = IntlVerificationsApi(api_client) + + verification_data_0 = MultipleComponentsIntl( + primary_line = "35 Tower Hill", + city = "London", + postal_code = "EC3N 4DR", + country = CountryExtended("GB"), + ) + + verification_data_1 = MultipleComponentsIntl( + primary_line = "370 Water St", + city = "Summerside", + state = "Prince Edward Island", + postal_code = "C1N 1C4", + country = CountryExtended("CA"), + ) + + + address_list = IntlVerificationsPayload( + addresses = [ + verification_data_0, + verification_data_1, + ], + ) + + try: + bulk_verified = api.verifyBulk(address_list) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $verificationData0 = new + OpenAPI\Client\Model\MultipleComponentsIntl(array( + 'primary_line' => '35 Tower Hill', + 'city' => 'London', + 'postal_code' => 'EC3N 4DR', + 'country' => 'GB', + )); + + + $verificationData1 = new + OpenAPI\Client\Model\MultipleComponentsIntl(array( + 'primary_line' => '370 Water St', + 'city' => 'Summerside', + 'state' => 'Prince Edward Island', + 'postal_code' => 'C1N 1C4', + 'country' => 'CA', + )); + + + $addressList = new + OpenAPI\Client\Model\IntlVerificationsPayload(array( + 'addresses' => [ + $verificationData0, + $verificationData1, + ] + )); + + + try { + $result = $apiInstance->verifyBulk($addressList); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: > + List addresses = new + ArrayList(); + + addresses.add(new IntlVerification.RequestBuilder() + .setPrimaryLine("370 Water St") + .setCity("Summerside") + .setState("Prince Edward Island") + .setPostalCode("C1N 1C4") + .setCountry("CA")); + LobResponse response = new + BulkIntlVerification.RequestBuilder() + .setAddresses(addresses) + .verify(); + BulkIntlVerification bulkIntlVerification = + response.getResponseBody(); + label: JAVA + - lang: Elixir + source: | + Lob.BulkIntlVerification.verify.verify( + %{addresses:[ + { + primary_line: '370 Water St', + secondary_line: '', + city: 'Summerside', + state: 'Prince Edward Island', + postal_code: 'C1N 1C4', + country: 'CA' + } + ] + }) + label: ELIXIR + - lang: CSharp + source: > + List addresses = new + List(); + + MultipleComponentsIntl bulkAddress0 = new MultipleComponentsIntl( + null, // recipient + "35 Tower Hill", // primaryLine + null, // secondaryLine + "London", // city + null, // state + "EC3N 4DR", // postalCode + CountryExtended.GB // country + ); + + addresses.Add(bulkAddress0); + + + MultipleComponentsIntl bulkAddress1 = new MultipleComponentsIntl( + null, // recipient + "370 Water St", // primaryLine + null, // secondaryLine + "Summerside", // city + "Prince Edward Island", // state + "C1N 1C4", // postalCode + CountryExtended.CA // country + ); + + addresses.Add(bulkAddress1); + + + IntlVerificationsPayload bulkVerify = new + IntlVerificationsPayload(addresses); + + + IntlVerificationsApi api = new IntlVerificationsApi(config); + + + try { + IntlVerifications bulkVerifyResponse = api.verifyBulk(bulkVerify); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + /campaigns: + get: + operationId: campaigns_list + summary: List + description: >- + Returns a list of your campaigns. The campaigns are returned sorted by + creation date, with the most recently created campaigns appearing first. + tags: + - Campaigns + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/before_after' + responses: + '200': + $ref: '#/components/responses/all_campaigns' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/campaigns \ + -u : + label: CURL + - lang: Ruby + source: | + campaignsApi = CampaignsApi.new(config) + + begin + campaigns = campaignsApi.list({ limit: 2 }) + rescue => err + p err.message + end + label: RUBY + post: + operationId: campaign_create + summary: Create + description: >- + Creates a new campaign with the provided properties. See how to launch + your first campaign + [here](https://help.lob.com/print-and-mail/building-a-mail-strategy/campaign-or-triggered-sends/launch-your-first-campaign). + tags: + - Campaigns + parameters: + - $ref: '#/components/parameters/lang_spec' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/campaign_writable' + example: + name: My Demo Campaign + description: My Campaign's description + schedule_type: immediate + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/campaign_writable' + encoding: + example-prop: + style: deepObject + explode: true + example: + name: My Demo Campaign + description: My Campaign's description + schedule_type: immediate + multipart/form-data: + schema: + $ref: '#/components/schemas/campaign_writable' + example: + name: My Demo Campaign + description: My Campaign's description + schedule_type: immediate + responses: + '200': + description: Campaign created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/campaign' + example: + id: cmp_e05ee61ff80764b + billing_group_id: bg_fe3079dcdd80e5ae + name: My Campaign + description: My Campaign's description + schedule_type: immediate + cancel_window_campaign_minutes: 60 + metadata: {} + use_type: marketing + is_draft: true + deleted: false + creatives: [] + uploads: [] + auto_cancel_if_ncoa: false + date_created: '2017-09-05T17:47:53.767Z' + date_modified: '2017-09-05T17:47:53.767Z' + object: campaign + default: + $ref: '#/components/responses/campaigns_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/campaigns \ + -u : \ + -d "name=My First Campaign" \ + -d "schedule_type=immediate" + label: CURL + - lang: Ruby + source: | + campaignCreate = CampaignWritable.new({ + name: "My First Campaign", + schedule_type: "immediate", + }); + + campaignApi = CampaignsApi.new(config) + + begin + createdCampaign = campaignApi.create(campaignCreate) + rescue => err + p err.message + end + label: RUBY + /campaigns/{cmp_id}: + parameters: + - in: path + name: cmp_id + description: id of the campaign + required: true + schema: + $ref: '#/components/schemas/cmp_id' + get: + operationId: campaign_retrieve + summary: Retrieve + description: >- + Retrieves the details of an existing campaign. You need only supply the + unique campaign identifier that was returned upon campaign creation. + tags: + - Campaigns + responses: + '200': + description: Returns a campaign object + content: + application/json: + schema: + $ref: '#/components/schemas/campaign' + example: + id: cmp_e05ee61ff80764b + billing_group_id: bg_fe3079dcdd80e5ae + name: My Campaign + description: My Campaign's description + schedule_type: immediate + cancel_window_campaign_minutes: 60 + metadata: {} + use_type: marketing + is_draft: true + deleted: false + creatives: [] + uploads: [] + auto_cancel_if_ncoa: false + date_created: '2017-09-05T17:47:53.767Z' + date_modified: '2017-09-05T17:47:53.767Z' + object: campaign + default: + $ref: '#/components/responses/campaigns_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/campaigns/cmp_e05ee61ff80764b \ + -u : + label: CURL + - lang: Ruby + source: | + campaignApi = CampaignsApi.new(config) + + begin + retrievedCampaign = campaignApi.get("cmp_e05ee61ff80764b") + rescue => err + p err.message + end + label: RUBY + patch: + operationId: campaign_update + summary: Update + description: >- + Update the details of an existing campaign. You need only supply the + unique identifier that was returned upon campaign creation. + tags: + - Campaigns + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/campaign_updatable' + example: + description: Test campaign + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/campaign_updatable' + example: + description: Test campaign + multipart/form-data: + schema: + $ref: '#/components/schemas/campaign_updatable' + example: + description: Test campaign + responses: + '200': + description: Returns a campaign object + content: + application/json: + schema: + $ref: '#/components/schemas/campaign' + example: + id: cmp_e05ee61ff80764b + billing_group_id: bg_fe3079dcdd80e5ae + name: My Campaign + description: My Campaign's description + schedule_type: immediate + cancel_window_campaign_minutes: 60 + metadata: {} + use_type: marketing + is_draft: true + deleted: false + creatives: [] + uploads: [] + auto_cancel_if_ncoa: false + date_created: '2017-09-05T17:47:53.767Z' + date_modified: '2017-09-05T17:47:53.767Z' + object: campaign + default: + $ref: '#/components/responses/campaigns_error' + x-codeSamples: + - lang: Shell + source: | + curl -X PATCH https://api.lob.com/v1/campaigns/cmp_e05ee61ff80764b \ + -u : \ + -d "description=Awesome campaign" + label: CURL + - lang: Python + source: | + campaign_updatable = CampaignUpdatable( + description = "Awesome campaign", + ) + + with ApiClient(configuration) as api_client: + api = CampaignsApi(api_client) + + try: + updated_campaign = api.update("cmp_e05ee61ff80764b", campaign_updatable) + except ApiException as e: + print(e) + label: PYTHON + - lang: Ruby + source: | + campaignUpdatable = CampaignUpdatable.new({ + description: "Awesome campaign", + }) + + campaignApi = CampaignsApi.new(config) + + begin + updatedCampaign = campaignApi.update("cmp_e05ee61ff80764b", campaignUpdatable) + rescue => err + p err.message + end + label: RUBY + delete: + operationId: campaign_delete + summary: Delete + description: >- + Delete an existing campaign. You need only supply the unique identifier + that was returned upon campaign creation. Deleting a campaign also + deletes any associated mail pieces that have been created but not sent. + A campaign's `send_date` matches its associated mail pieces' + `send_date`s. + tags: + - Campaigns + responses: + '200': + $ref: '#/components/responses/campaign_deleted' + default: + $ref: '#/components/responses/campaigns_error' + x-codeSamples: + - lang: Shell + source: > + curl -X DELETE https://api.lob.com/v1/campaigns/cmp_e05ee61ff80764b + \ + -u : + label: CURL + - lang: Ruby + source: | + campaignApi = CampaignsApi.new(config) + + begin + deletedCampaign = campaignApi.delete("cmp_e05ee61ff80764b") + rescue => err + p err.message + end + label: RUBY + /campaigns/{cmp_id}/send: + parameters: + - in: path + name: cmp_id + description: id of the campaign + required: true + schema: + $ref: '#/components/schemas/cmp_id' + post: + operationId: campaign_send + summary: Send Campaign + description: >- + Sends a campaign. You need only supply the unique campaign identifier + that was returned upon campaign creation. + tags: + - Campaigns + responses: + '200': + description: Returns a campaign object + content: + application/json: + schema: + $ref: '#/components/schemas/campaign' + example: + id: cmp_e05ee61ff80764b + billing_group_id: bg_fe3079dcdd80e5ae + name: My Campaign + description: My Campaign's description + schedule_type: immediate + cancel_window_campaign_minutes: 60 + metadata: {} + use_type: marketing + is_draft: true + deleted: false + creatives: [] + uploads: [] + auto_cancel_if_ncoa: false + date_created: '2017-09-05T17:47:53.767Z' + date_modified: '2017-09-05T17:47:53.767Z' + object: campaign + default: + $ref: '#/components/responses/campaigns_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/campaigns/cmp_e05ee61ff80764b/send \ + -u : + label: CURL + /cards: + get: + operationId: cards_list + summary: List + description: >- + Returns a list of your cards. The cards are returned sorted by creation + date, with the most recently created addresses appearing first. + tags: + - Cards + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/before_after' + - $ref: '#/components/parameters/include' + responses: + '200': + description: Returns a list of card objects + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/list' + - type: object + properties: + data: + type: array + description: list of cards + items: + $ref: '#/components/schemas/card' + example: + data: + - id: card_7a6d73c5c8457fc + account_id: fa9ea650fc7b31a89f92 + description: null + url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA + size: 2.125x3.375 + auto_reorder: false + reorder_quantity: null + raw_url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + front_original_url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + back_original_url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + thumbnails: + - small: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg + medium: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA + large: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw + available_quantity: 10000 + pending_quantity: 0 + countries: null + status: rendered + mode: test + orientation: horizontal + threshold_amount: 0 + date_created: '2021-03-24T22:51:42.838Z' + date_modified: '2021-03-24T22:51:42.838Z' + send_date: '2021-03-24T22:51:42.838Z' + object: card + object: list + previous_url: null + next_url: null + count: 1 + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: | + curl -X GET "https://api.lob.com/v1/cards?limit=2" \ + -u : + label: CURL + - lang: Typescript + source: | + try { + const cards = await new CardsApi(config).list(2); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.cards.list({limit: 2}, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = CardsApi(api_client) + + try: + cards = api.list(limit=2) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: | + $lob->cards()->all(array( + 'limit' => 2 + )); + - lang: CSharp + source: | + CardsApi api = new CardsApi(config); + List includeList = new List(); + includeList.Add("total_count"); + + try { + CardList response = api.list( + 2, // limit + null, // before + null, // after + includeList // include + ); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Ruby + source: | + cardsApi = CardsApi.new(config) + + begin + cards = cardsApi.list({ limit: 2 }) + rescue => err + p err.message + end + label: RUBY + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + CardList = apiClient.CardsApi.List(context).Execute() + + if err != nil { + return err + } + label: GO + post: + operationId: card_create + summary: Create + description: Creates a new card given information + tags: + - Cards + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/card_editable' + example: + description: Test card + front: >- + https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf + back: >- + https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf + size: 2.125x3.375 + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/card_editable' + example: + description: Test card + front: >- + https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf + back: >- + https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf + size: 2.125x3.375 + multipart/form-data: + schema: + $ref: '#/components/schemas/card_editable' + example: + description: Test card + front: >- + https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf + back: >- + https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf + size: 2.125x3.375 + responses: + '200': + description: Card created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/card' + examples: + basic: + value: + id: card_7a6d73c5c8457fc + account_id: fa9ea650fc7b31a89f92 + description: Test card + url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA + size: 2.125x3.375 + auto_reorder: false + reorder_quantity: null + raw_url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + front_original_url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + back_original_url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + thumbnails: + - small: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg + medium: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA + large: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw + - small: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_2.png?version=v1&expires=1636910992&signature=IWsmPa_ULlv2yyqjX564d_YfHHY_M7i9YxDnw-WXDr2jtOFcArmRZQbnHeE9g_rYxnddJbgosuv8-c2utiu7Cg + medium: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_2.png?version=v1&expires=1636910992&signature=zxK7VKGiTvz5Ywrkaydd0v3GcYf58R7A08J4tNfI7-aiNODDcTF3l0MqY13n9Pyc8RXSdD0XVBY-OpbA1VM-Ag + large: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_2.png?version=v1&expires=1636910992&signature=r0OFUhh315ZwN0raMZdIwJd2oCIEYsz0BABaMxIuO1PKTD0ckGWrhcGdzk2dlWQ6vSvp0CUQ5k1RXGqkIIqkDw + available_quantity: 10000 + pending_quantity: 0 + countries: null + status: rendered + mode: test + orientation: horizontal + threshold_amount: 0 + date_created: '2021-03-24T22:51:42.838Z' + date_modified: '2021-03-24T22:51:42.838Z' + send_date: '2021-03-24T22:51:42.838Z' + object: card + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/cards \ + -u : \ + -d "description=Test card" \ + -d "front=https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf" \ + -d "back=https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf" \ + -d "size=2.125x3.375" + label: CURL + - lang: Typescript + source: | + const cardsCreate = new CardEditable({ + front: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf', + back: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf', + size: CardEditableSizeEnum._2125x3375, + description: 'Test card' + }); + + try { + const myCard = await new CardsApi(config).create(cardsCreate); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.cards.create({ + description: 'Test card', + front: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf', + back: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf', + size: '2.125x3.375' + }, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Python + source: | + card_editable = CardEditable( + front = "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf", + back = "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf", + size = "2.125x3.375", + description = "Test Card", + ) + + with ApiClient(configuration) as api_client: + api = CardsApi(api_client) + + try: + created_card = api.create(card_editable) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: | + $lob->cards()->create(array( + 'description' => 'Test card', + 'front' => 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf', + 'back' => 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf', + 'size' => => '2.125x3.375' + )); + label: PHP + - lang: CSharp + source: | + CardsApi api = new CardsApi(config); + + CardEditable cardEditable = new CardEditable( + "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf", // front + "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf", // back + CardEditable.SizeEnum._2125x3375, // size + "Test Card" // description + ); + + try { + Card result = api.create(cardEditable); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Ruby + source: | + cardCreate = CardEditable.new({ + front: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf", + back: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf", + size: "2.125x3.375", + description: "Test Card", + }); + + cardApi = CardsApi.new(config) + + begin + createdCard = cardApi.create(cardCreate) + rescue => err + p err.message + end + label: RUBY + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + + var cardCreate = *lob.NewCardEditable() + + cardCreate.SetFront("https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf") + + cardCreate.SetBack("https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf") + + cardCreate.SetSize("2.125x3.375") + + cardCreate.SetDescription("Test Card") + + + + + createdcard, _, err := + apiClient.CardsApi.Create(context).CardEditable(cardCreate).Execute() + + + if err != nil { + return err + } + label: GO + /cards/{card_id}: + parameters: + - in: path + name: card_id + description: id of the card + required: true + schema: + $ref: '#/components/schemas/card_id' + get: + operationId: card_retrieve + summary: Retrieve + description: >- + Retrieves the details of an existing card. You need only supply the + unique customer identifier that was returned upon card creation. + tags: + - Cards + responses: + '200': + description: Returns a card object + content: + application/json: + schema: + $ref: '#/components/schemas/card' + examples: + basic: + value: + id: card_7a6d73c5c8457fc + account_id: fa9ea650fc7b31a89f92 + description: Test card + url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA + size: 2.125x3.375 + auto_reorder: false + reorder_quantity: null + raw_url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + front_original_url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + back_original_url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + thumbnails: + - small: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg + medium: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA + large: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw + - small: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_2.png?version=v1&expires=1636910992&signature=IWsmPa_ULlv2yyqjX564d_YfHHY_M7i9YxDnw-WXDr2jtOFcArmRZQbnHeE9g_rYxnddJbgosuv8-c2utiu7Cg + medium: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_2.png?version=v1&expires=1636910992&signature=zxK7VKGiTvz5Ywrkaydd0v3GcYf58R7A08J4tNfI7-aiNODDcTF3l0MqY13n9Pyc8RXSdD0XVBY-OpbA1VM-Ag + large: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_2.png?version=v1&expires=1636910992&signature=r0OFUhh315ZwN0raMZdIwJd2oCIEYsz0BABaMxIuO1PKTD0ckGWrhcGdzk2dlWQ6vSvp0CUQ5k1RXGqkIIqkDw + available_quantity: 10000 + pending_quantity: 0 + countries: null + status: rendered + mode: test + orientation: horizontal + threshold_amount: 0 + date_created: '2021-03-24T22:51:42.838Z' + date_modified: '2021-03-24T22:51:42.838Z' + send_date: '2021-03-24T22:51:42.838Z' + object: card + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/cards/card_7a6d73c5c8457fc \ + -u : + label: CURL + - lang: Typescript + source: | + try { + const card = await new CardsApi(config).get('card_xxxx'); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.cards.retrieve('card_7a6d73c5c8457fc', function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = CardsApi(api_client) + + try: + card = api.get("card_7a6d73c5c8457fc") + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: | + $lob->cards()->get('card_7a6d73c5c8457fc'); + label: PHP + - lang: CSharp + source: | + CardsApi api = new CardsApi(config); + + try { + Card response = api.get("card_7a6d73c5c8457fc"); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Ruby + source: | + cardApi = CardsApi.new(config) + + begin + retrievedCard = cardApi.get("card_7a6d73c5c8457fc") + rescue => err + p err.message + end + label: RUBY + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + fetchedCard, _, err := + apiClient.CardsApi.Get(context,"card_7a6d73c5c8457fc").Execute() + + + if err != nil { + return err + } + label: GO + post: + operationId: card_update + summary: Update + description: >- + Update the details of an existing card. You need only supply the unique + identifier that was returned upon card creation. + tags: + - Cards + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/card_updatable' + example: + description: Test card + auto_reorder: true + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/card_updatable' + example: + description: Test card + auto_reorder: true + multipart/form-data: + schema: + $ref: '#/components/schemas/card_updatable' + example: + description: Test card + auto_reorder: true + responses: + '200': + description: Returns a card object + content: + application/json: + schema: + $ref: '#/components/schemas/card' + examples: + basic: + value: + id: card_7a6d73c5c8457fc + account_id: fa9ea650fc7b31a89f92 + description: Test card + url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA + size: 2.125x3.375 + auto_reorder: false + reorder_quantity: null + raw_url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + front_original_url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + back_original_url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + thumbnails: + - small: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg + medium: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA + large: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw + - small: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_2.png?version=v1&expires=1636910992&signature=IWsmPa_ULlv2yyqjX564d_YfHHY_M7i9YxDnw-WXDr2jtOFcArmRZQbnHeE9g_rYxnddJbgosuv8-c2utiu7Cg + medium: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_2.png?version=v1&expires=1636910992&signature=zxK7VKGiTvz5Ywrkaydd0v3GcYf58R7A08J4tNfI7-aiNODDcTF3l0MqY13n9Pyc8RXSdD0XVBY-OpbA1VM-Ag + large: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_2.png?version=v1&expires=1636910992&signature=r0OFUhh315ZwN0raMZdIwJd2oCIEYsz0BABaMxIuO1PKTD0ckGWrhcGdzk2dlWQ6vSvp0CUQ5k1RXGqkIIqkDw + available_quantity: 10000 + pending_quantity: 0 + countries: null + status: rendered + mode: test + orientation: horizontal + threshold_amount: 0 + date_created: '2021-03-24T22:51:42.838Z' + date_modified: '2021-03-24T22:51:42.838Z' + send_date: '2021-03-24T22:51:42.838Z' + object: card + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: | + curl -X POST https://api.lob.com/v1/cards/card_7a6d73c5c8457fc \ + -u : \ + -d "description=Awesome card" \ + -d "auto_reorder=true" + label: CURL + - lang: Typescript + source: | + const cardUpdatable = new CardEditable ({ + description: 'Awesome card', + auto_reorder: true + }); + + try { + await new CardsApi(config).update(cardUpdatable); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.cards.update('card_7a6d73c5c8457fc', { + description: 'Awesome card', + auto_reorder: true + }, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: CSharp + source: > + CardsApi api = new CardsApi(config); + + CardUpdatable update = new CardUpdatable("Awesome card", true, + 15000); + + + try { + api.update("card_6afffd19045076c", update); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Python + source: | + card_updatable = CardUpdatable( + description = "Awesome card", + auto_reorder = True, + reorder_quantity = 10000, + ) + + with ApiClient(configuration) as api_client: + api = CardsApi(api_client) + + try: + updated_card = api.update("card_6afffd19045076c", card_updatable) + except ApiException as e: + print(e) + label: PYTHON + - lang: Ruby + source: | + cardUpdatable = CardUpdatable.new({ + description: "Awesome card", + auto_reorder: "true", + reorder_quantity: 10000, + }) + + cardApi = CardsApi.new(config) + + begin + updatedCard = cardApi.update("card_6afffd19045076c", cardUpdatable) + rescue => err + p err.message + end + label: RUBY + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + cardEditable = + *lob.NewCardEditable("https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf()") + + createdCard, _, _ := + apiClient.CardsApi.Create(context).CardEditable(suite.cardEditable).Execute() + + var updatedCard = *lob.NewCardUpdatable() + + updatedCard.SetDescription("Card was updated") + + + resp, _, err := suite.apiClient.CardsApi.Update(context, + createdCard.Id).CardUpdatable(updatedCard).Execute() + + + if err != nil { + return err + } + label: GO + delete: + operationId: card_delete + summary: Delete + description: >- + Delete an existing card. You need only supply the unique identifier that + was returned upon card creation. + tags: + - Cards + responses: + '200': + $ref: '#/components/responses/card_deleted' + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: | + curl -X DELETE https://api.lob.com/v1/cards/card_7a6d73c5c8457fc \ + -u : + label: CURL + - lang: Typescript + source: | + try { + const deleteCard = await new CardsApi(config).delete('card_xxxx'); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.cards.delete('card_7a6d73c5c8457fc', function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = CardsApi(api_client) + + try: + deleted_resource = api.delete("card_6afffd19045076c") + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: | + $lob->cards()->delete('card_7a6d73c5c8457fc'); + label: PHP + - lang: CSharp + source: | + CardsApi api = new CardsApi(config); + + try { + CardDeletion response = api.delete("card_6afffd19045076c"); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Ruby + source: | + cardApi = CardsApi.new(config) + + begin + deletedCard = cardApi.delete("card_6afffd19045076c") + rescue => err + p err.message + end + label: RUBY + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + deletedCard, _, err := apiClient.CardsApi.Delete(context, + "card_6afffd19045076c").Execute() + + + if err != nil { + return err + } + label: GO + /cards/{card_id}/orders: + parameters: + - in: path + name: card_id + description: The ID of the card to which the card orders belong. + required: true + schema: + $ref: '#/components/schemas/card_id' + get: + operationId: card_orders_retrieve + summary: Retrieve + description: Retrieves the card orders associated with the given card id. + tags: + - Card Orders + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: Returns the card orders associated with the given card id + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/list' + - type: object + properties: + data: + type: array + description: List of card orders + items: + $ref: '#/components/schemas/card_order' + example: + data: + - id: co_e0f8a0562a06bea7f + card_id: card_6afffd19045076c + status: available + inventory: 9500 + quantity_ordered: 10000 + unit_price: 0.75 + cancelled_reason: No longer needed + availability_date: '2021-10-12T21:41:48.326Z' + expected_availability_date: '2021-11-04T21:03:18.871Z' + date_created: '2021-10-07T21:03:18.871Z' + date_modified: '2021-10-16T01:00:30.144Z' + object: card_order + object: list + next_url: null + previous_url: null + count: 1 + default: + $ref: '#/components/responses/card_order_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/cards/card_6afffd19045076c/orders/ \ + -u : + label: CURL + - lang: Typescript + source: | + try { + const cardOrders = await new CardOrdersApi(cofig).get( 'co_xxxx' ); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.cardOrders.list('card_6afffd19045076c', function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = CardOrdersApi(api_client) + + try: + card_order = api.get("card_6afffd19045076c", limit = 2, offset = 1) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: | + $lob->cardOrders('card_6afffd19045076c')->all(); + - lang: CSharp + source: | + CardOrdersApi api = new CardOrdersApi(config); + + try { + CardOrderList response = api.get("card_6afffd19045076c", 2, 1); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Ruby + source: | + cardOrderApi = CardOrdersApi.new(config) + + begin + retrievedCardOrderList = cardOrderApi.get("card_6afffd19045076c", { limit: 2, offset: 1 }) + rescue => err + p err.message + end + label: RUBY + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + fetchedCardOrderList, _, err := apiClient.CardOrdersApi.Get(context, + "card_6afffd19045076c").Execute() + + + if err != nil { + return err + } + label: GO + post: + operationId: card_order_create + summary: Create + description: Creates a new card order given information + tags: + - Card Orders + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/card_order_editable' + example: + quantity: 10000 + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/card_order_editable' + example: + quantity: 10000 + multipart/form-data: + schema: + $ref: '#/components/schemas/card_order_editable' + example: + quantity: 10000 + responses: + '200': + description: Card order created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/card_order' + examples: + basic: + value: + id: co_e0f8a0562a06bea7f + card_id: card_6afffd19045076c + status: available + inventory: 9500 + quantity_ordered: 10000 + unit_price: 0.75 + cancelled_reason: No longer needed + availability_date: '2021-10-12T21:41:48.326Z' + expected_availability_date: '2021-11-04T21:03:18.871Z' + date_created: '2021-10-07T21:03:18.871Z' + date_modified: '2021-10-16T01:00:30.144Z' + object: card_order + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/cards/card_6afffd19045076c/orders \ + -u : \ + -d "quantity=10000" + label: CURL + - lang: Typescript + source: | + const cardForCreate = new CardOrderEditable({ + quantity: 200 + }); + + try { + const myCardOrder = await new CardOrdersApi(config).create('card_xxxx', cardForCreate); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.cardOrders.create('card_6afffd19045076c', { + quantity: 10000 + }, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Python + source: | + card_order_editable = CardOrderEditable( + quantity = 10000, + ) + + with ApiClient(configuration) as api_client: + api = CardOrdersApi(api_client) + + try: + created_card_order = api.create("card_6afffd19045076c", card_order_editable) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: | + $lob->cardOrders('card_6afffd19045076c')->create(array( + 'quantity' => 10000 + )); + - lang: CSharp + source: | + CardOrdersApi api = new CardOrdersApi(config); + + CardOrderEditable cardOrderEditable = new CardOrderEditable( + 10000 // quantity + ); + + try { + CardOrder result = api.create("card_6afffd19045076c", cardOrderEditable); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Ruby + source: | + cardOrderCreate = CardOrderEditable.new({ + quantity: 10000, + }); + + cardOrderApi = CardOrdersApi.new(config) + + begin + createdCardOrder = cardOrderApi.create("card_6afffd19045076c", cardOrderCreate) + rescue => err + p err.message + end + label: RUBY + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + + var cardOrderCreate = *lob.NewCardOrderEditable() + + cardOrderCreate.SetQuantity("10000") + + + + + createdcardOrder, _, err := apiClient.CardOrdersApi.Create(context, + "card_6afffd19045076c").CardOrderEditable(cardOrderCreate).Execute() + + + if err != nil { + return err + } + label: GO + /checks: + get: + operationId: checks_list + summary: List + description: >- + Returns a list of your checks. The checks are returned sorted by + creation date, with the most recently created checks appearing first. + tags: + - Checks + 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/scheduled' + - $ref: '#/components/parameters/send_date' + - $ref: '#/components/parameters/mail_type' + - $ref: '#/components/parameters/sort_by' + - $ref: '#/components/parameters/status' + responses: + '200': + $ref: '#/components/responses/all_checks' + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: | + curl -X GET "https://api.lob.com/v1/checks?limit=2" \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: typescript + source: | + try { + const checks = await new ChecksApi(config).list(2); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.checks.list({limit: 2}, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + checksApi = ChecksApi.new(config) + + begin + checks = checksApi.list({ limit: 2 }) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = ChecksApi(api_client) + + try: + checks = api.list(limit=2) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\ChecksApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->list( + 2, // limit + ); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + ChecksApi apiInstance = new ChecksApi(config); + + try { + CheckList response = apiInstance.list( + 2, // limit + null, // before + null, // after + null, // include + null, // dateCreated + null, // metadata + null, // scheduled + null, // sendDate + null, // mailType + null // sortBy + ); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Check.list(%{limit: 2}) + label: ELIXIR + - lang: CSharp + source: > + ChecksApi api = new ChecksApi(config); + + + List includeList = new List(); + + includeList.Add("total_count"); + + Dictionary metadata = new Dictionary(); + + metadata.Add("name", "Harry"); + + Dictionary dateCreated = new Dictionary(); + + DateTime dateCreatedDate = DateTime.Today.AddMonths(-1); + + dateCreated.Add("lt", dateCreatedDate); + + Dictionary sendDate = new Dictionary(); + + sendDate.Add("lt", + DateTime.Now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz")); + + SortBy3 sortBy = new SortBy3(SortBy3.DateCreatedEnum.Asc); + + + try { + CheckList response = api.list( + 2, // limit + null, // before + null, // after + includeList, // include + dateCreated, // dateCreated + metadata, // metadata + true, // scheduled + sendDate, // sendDate + MailType.FirstClass, // mailType + sortBy // sortBy + ); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + CheckList = apiClient.ChecksApi.List(context).Execute() + + if err != nil { + return err + } + label: GO + post: + operationId: check_create + summary: Create + description: Creates a new check with the provided properties. + tags: + - Checks + parameters: + - $ref: '#/components/parameters/idem-header' + - $ref: '#/components/parameters/idem-query' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/check_editable' + example: + description: Demo Check + 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: Leore Avidar + address_line1: 210 King St + address_line2: '# 6100' + address_city: San Francisco + address_state: CA + address_zip: 94107-1741 + bank_account: bank_8cad8df5354d33f + amount: 22.5 + memo: rent + logo: >- + https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png + check_bottom: tmpl_23668b406d5afef + merge_variables: + name: Harry + metadata: + memo: rafting trip + attachment: ./cool.pdf + send_date: '2017-11-01T00:00:00.000Z' + use_type: operational + mail_type: usps_first_class + check_number: 10001 + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/check_editable' + example: + description: Demo Check + 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: Leore Avidar + address_line1: 210 King St + address_line2: '# 6100' + address_city: San Francisco + address_state: CA + address_zip: 94107-1741 + bank_account: bank_8cad8df5354d33f + amount: 22.5 + memo: rent + logo: >- + https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png + check_bottom: tmpl_23668b406d5afef + merge_variables: + name: Harry + metadata: + memo: rafting trip + attachment: ./cool.pdf + send_date: '2017-11-01T00:00:00.000Z' + mail_type: usps_first_class + check_number: 10001 + encoding: + to: + style: deepObject + explode: true + from: + style: deepObject + explode: true + merge_variables: + style: deepObject + explode: true + metadata: + style: deepObject + explode: true + multipart/form-data: + schema: + $ref: '#/components/schemas/check_editable' + example: + description: Demo Check + 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: Leore Avidar + address_line1: 210 King St + address_line2: '# 6100' + address_city: San Francisco + address_state: CA + address_zip: 94107-1741 + bank_account: bank_8cad8df5354d33f + amount: 22.5 + memo: rent + logo: >- + https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png + check_bottom: tmpl_23668b406d5afef + merge_variables: + name: Harry + metadata: + memo: rafting trip + attachment: ./cool.pdf + send_date: '2017-11-01T00:00:00.000Z' + use_type: operational + mail_type: usps_first_class + check_number: 10001 + encoding: + logo: + contentType: image/png, image/jpeg + responses: + '200': + $ref: '#/components/responses/post_check' + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/checks \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ + -d 'description=Demo Check' \ + -d 'to[name]=Harry Zhang' \ + -d 'to[address_line1]=210 King St' \ + -d 'to[address_line2]=# 6100' \ + -d 'to[address_city]=San Francisco' \ + -d 'to[address_state]=CA' \ + -d 'to[address_zip]=94107' \ + -d 'from=adr_210a8d4b0b76d77b' \ + -d 'bank_account=bank_8cad8df5354d33f' \ + -d 'amount=22.50' \ + -d 'use_type=operational' \ + -d 'memo=rent' \ + --data-urlencode 'logo=https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png' \ + --data-urlencode 'check_bottom=

Demo Check for {{name}}

' \ + -d 'merge_variables[name]=Harry' + label: CURL + - lang: Typescript + source: | + const checkCreate = new CheckEditable({ + to: new AddressEditable({ + name: 'Harry Zhang', + address_line1: '210 King St', + address_line2: '# 6100', + address_city: 'San Francisco', + address_state: 'CA', + address_zip: '94107', + }), + from: 'adr_xxxx', + bank_account: 'bank_xxxx', + amount: 100, + use_type: 'operational' + }); + + try { + const myCheck = await new ChecksApi(config).create(checkCreate); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.checks.create({ + description: 'Demo Check', + bank_account: 'bank_8cad8df5354d33f', + to: { + name: 'Harry Zhang', + address_line1: '210 King St', + address_line2: '# 6100', + address_city: 'San Francisco', + address_state: 'CA', + address_zip: '94107' + }, + from: 'adr_210a8d4b0b76d77b', + amount: 22.50, + use_type: 'operational', + memo: 'rent', + logo: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png', + check_bottom: '

Demo Check for {{name}}

', + merge_variables: { + name: 'Harry' + } + }, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + checkCreate = CheckEditable.new({ + description: "Demo Check", + bank_account: "bank_8cad8df5354d33f", + amount: 22.5, + memo: "rent", + logo: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png", + check_bottom: "

Demo Check for {{name}}

", + from: "adr_210a8d4b0b76d77b", + to: AddressDomestic.new({ + name: "Harry Zhang", + address_line1: "210 King St", + address_line2: "# 6100", + address_city: "San Francisco", + address_state: "CA", + address_zip: "94107", + }), + merge_variables: { + name: "Harry" + }, + use_type: "operational" + }); + + checkApi = ChecksApi.new(config) + + begin + createdCheck = checkApi.create(checkCreate) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + check_editable = CheckEditable( + description = "Demo Check", + bank_account = "bank_8cad8df5354d33f", + amount = 22.5, + memo = "rent", + logo = "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png", + check_bottom = "

Demo Check for {{name}}

", + _from = "adr_210a8d4b0b76d77b", + to = AddressDomestic( + name = "Harry Zhang", + address_line1 = "210 King St", + address_line2 = "# 6100", + address_city = "San Francisco", + address_state = "CA", + address_zip = "94107", + ), + merge_variables = MergeVariables( + name = "Harry", + ), + use_type = "operational" + ) + + with ApiClient(configuration) as api_client: + api = ChecksApi(api_client) + + try: + created_check = api.create(check_editable) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $to = new OpenAPI\Client\Model\AddressEditable( + array( + "name" => "Harry Zhang", + "address_line1" => "210 King St", + "address_line2" => "# 6100", + "address_city" => "San Francisco", + "address_state" => "CA", + "address_zip" => "94107", + ) + ); + + + $merge_variables = new stdClass; + + $merge_variables->name = "Harry"; + + + $use_type = "operational"; + + + $apiInstance = new OpenAPI\Client\Api\ChecksApi($config, new + GuzzleHttp\Client()); + + $check_editable = new OpenAPI\Client\Model\CheckEditable( + array( + "description" => "Demo Check", + "bank_account" => "bank_8cad8df5354d33f", + "amount" => "22.5", + "memo" => "rent", + "logo" => "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png", + "check_bottom" => "

Demo Check for {{name}}

", + "from" => "adr_210a8d4b0b76d77b", + "to" => $to, + "merge_variables" => $merge_variables, + "use_type" => $use_type + ) + ); + + + try { + $result = $apiInstance->create($check_editable); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + Map merge_variables = new HashMap(); + merge_variables.put("name", "Harry"); + + ChecksApi apiInstance = new ChecksApi(config); + + AddressEditable to = new AddressEditable(); + to.setName("Harry Zhang"); + to.setAddressLine1("210 King St"); + to.setAddressLine2("# 6100"); + to.setAddressCity("San Francisco"); + to.setAddressState("CA"); + to.setAddressZip("94107"); + + try { + CheckEditable checkEditable = new CheckEditable(); + checkEditable.setDescription("Demo Check"); + checkEditable.setBankAccount("bank_8cad8df5354d33f"); + checkEditable.setAmount(22.5f); + checkEditable.setMemo("rent"); + checkEditable.setLogo("https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png"); + checkEditable.setCheckBottom("

Demo Check for {{name}}

"); + checkEditable.setFrom("adr_210a8d4b0b76d77b"); + checkEditable.setTo(to); + checkEditable.setMergeVariables(merge_variables); + checkEditable.setUseType("operational"); + + Check result = apiInstance.create(checkEditable, null); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Check.create(%{ + description: 'Demo Check', + bank_account: 'bank_8cad8df5354d33f', + to: %{ + name: 'Harry Zhang', + address_line1: '210 King St', + address_line2: '# 6100', + address_city: 'San Francisco', + address_state: 'CA', + address_zip: '94107' + }, + from: 'adr_210a8d4b0b76d77b', + amount: 22.50, + memo: 'rent', + logo: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png', + check_bottom: '

Demo Check for {{name}}

', + merge_variables: %{ + name: 'Harry' + }, + use_type: 'operational' + }) + label: ELIXIR + - lang: CSharp + source: > + Dictionary mergeVariables = new Dictionary(); + + mergeVariables.Add("name", "Harry"); + + + ChecksApi api = new ChecksApi(config); + + + AddressEditable to = new AddressEditable( + "210 King St", // addressLine1 + "# 6100", // addressLine2 + "San Francisco", // addressCity + "CA", // addressState + "94107", // addressZip + default(CountryExtended), // addressCounty + "", // description + "Harry Zhang" // name + ); + + + CheckEditable checkEditable = new CheckEditable( + "adr_249af768103d2810", // from + to.ToJson(), // to + "bank_8cad8df5354d33f", // bank_account + 22.5f, // amount + "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png", // logo + "

Demo Check for {{name}}

", // checkBottom + default(string), // attachment + "Demo Check", // description + default(Dictionary), // metadata + mergeVariables, // mergeVariables + default(DateTime), // sendDate + CheckEditable.MailTypeEnum.UspsFirstClass, // mailType + "rent", // memo + "operational" // use_type + ); + + + try { + Check result = api.create(checkEditable, null); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + var to = *lob.NewAddressEditable() + + to.SetAddressLine1("210 King St") + + to.SetAddressLine2("# 6100") + + to.SetAddressCity("San Francisco") + + to.SetAddressState("CA") + + to.SetAddressZip("94107") + + to.SetAddressCountry(lob.COUNTRYEXTENDED_US) + + to.SetDescription("") + + to.SetName("Harry Zhang") + + + var checkCreate = *lob.NewCheckEditable() + + checkCreate.SetDescription("Demo Check") + + checkCreate.SetBankAccount("bank_8cad8df5354d33f") + + checkCreate.SetAmount(22.5) + + checkCreate.SetMemo("rent") + + checkCreate.SetLogo("https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png") + + checkCreate.SetCheckBottom("

Demo Check + for {{name}}

") + + checkCreate.SetFrom("adr_210a8d4b0b76d77b") + + checkCreate.SetTo(to) + + + + createdcheck, _, err := + apiClient.ChecksApi.Create(context).CheckEditable(checkCreate).Execute() + + + if err != nil { + return err + } + label: GO + /checks/{chk_id}: + parameters: + - in: path + name: chk_id + description: id of the check + required: true + schema: + $ref: '#/components/schemas/chk_id' + get: + operationId: check_retrieve + summary: Retrieve + description: >- + Retrieves the details of an existing check. You need only supply the + unique check identifier that was returned upon check creation. + tags: + - Checks + responses: + '200': + description: Returns a check object + content: + application/json: + schema: + $ref: '#/components/schemas/check' + example: + id: chk_534f10783683daa0 + description: Demo Check + metadata: {} + check_number: 10062 + memo: rent + amount: 22.5 + url: >- + https://lob-assets.com/checks/chk_534f10783683daa0.pdf?expires=1540372221&signature=Ty3IV2bGPEoQfrdraYHlNYTaarnHLXb + to: + id: adr_bae820679f3f536b + description: Harry - Office + name: HARRY ZHANG + company: LOB + email: harry@lob.com + phone: '5555555555' + address_line1: 210 KING ST STE 6100 + address_line2: '' + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2018-12-08T03:08:43.446Z' + date_modified: '2018-12-08T03:08:43.446Z' + object: address + recipient_moved: false + from: + id: adr_b8fb5acf3a2b55db + name: LEORE AVIDAR + address_line1: 210 KING ST STE 6100 + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2017-09-05T17:47:53.767Z' + date_modified: '2017-09-05T17:47:53.767Z' + object: address + bank_account: + id: bank_8cad8df5354d33f + description: Test Bank Account + metadata: {} + routing_number: '322271627' + account_number: '123456789' + signatory: John Doe + bank_name: J.P. MORGAN CHASE BANK, N.A. + verified: true + account_type: company + date_created: '2015-11-06T19:24:24.440Z' + date_modified: '2015-11-06T19:41:28.312Z' + object: bank_account + signature_url: >- + https://lob-assets.com/bank-accounts/asd_asdfghjkqwertyui.pdf?expires=1234567890&signature=aksdf + carrier: USPS + tracking_events: [] + thumbnails: + - small: >- + https://lob-assets.com/checks/chk_534f10783683daa0_thumb_small_1.png?expires=1540372221&signature=ShhPpH74wYkNiAj7Il9B6q8ZKkzlGd4 + medium: >- + https://lob-assets.com/checks/chk_534f10783683daa0_thumb_medium_1.png?expires=1540372221&signature=tmIOq6aAyKgzAECp7STj1rvJuMS5Svd + large: >- + https://lob-assets.com/checks/chk_534f10783683daa0_thumb_large_1.png?expires=1540372221&signature=04nLEwE9d2qgQJNgJYWSOgPnU0FZbEv + merge_variables: + name: Harry + expected_delivery_date: '2017-09-12' + mail_type: usps_first_class + date_created: '2017-09-05T17:47:53.896Z' + date_modified: '2017-09-05T17:47:53.896Z' + send_date: '2017-09-05T17:47:53.896Z' + object: check + message: pancakes are good + check_bottom_template_id: tmpl_a + attachment_template_id: tmpl_a + check_bottom_template_version_id: vrsn_a + attachment_template_version_id: vrsn_a + use_type: operational + deleted: true + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/checks/chk_534f10783683daa0 \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: Typescript + source: | + try { + const check = await new ChecksApi(config).get('chk_xxxx'); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.checks.retrieve('chk_534f10783683daa0', function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + checkApi = ChecksApi.new(config) + + begin + retrievedCheck = checkApi.get("chk_534f10783683daa0") + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = ChecksApi(api_client) + + try: + check = api.get("chk_534f10783683daa0") + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\ChecksApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->get("chk_534f10783683daa0"); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + ChecksApi apiInstance = new ChecksApi(config); + + try { + Check response = apiInstance.get("chk_534f10783683daa0"); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Check.find("chk_534f10783683daa0") + label: ELIXIR + - lang: CSharp + source: | + ChecksApi api = new ChecksApi(config); + + try { + Check response = api.get("chk_534f10783683daa0"); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + fetchedCheck, _, err := + apiClient.ChecksApi.Get(context,"chk_534f10783683daa0").Execute() + + + if err != nil { + return err + } + label: GO + delete: + operationId: check_cancel + summary: Cancel + description: >- + Completely removes a check from production. This can only be done if the + check has a `send_date` and the `send_date` has not yet passed. If the + check is successfully canceled, you will not be charged for it. Read + more on [cancellation windows](#section/Cancellation-Windows) and + [scheduling](#section/Scheduled-Mailings). Scheduling and cancellation + is a premium feature. Upgrade to the appropriate Print & Mail Edition to gain access. + tags: + - Checks + responses: + '200': + $ref: '#/components/responses/check_canceled' + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: | + curl -X DELETE https://api.lob.com/v1/checks/chk_534f10783683daa0 \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: Typescript + source: | + try { + const deleteCheck = await new ChecksApi(config).delete('chk_xxxx'); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.checks.delete('chk_534f10783683daa0', function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + checkApi = ChecksApi.new(config) + + begin + deletedCheck = checkApi.cancel("chk_534f10783683daa0") + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = ChecksApi(api_client) + + try: + deleted_resource = api.cancel("chk_534f10783683daa0") + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\ChecksApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->cancel("chk_534f10783683daa0"); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + ChecksApi apiInstance = new ChecksApi(config); + + try { + CheckDeletion response = apiInstance.cancel("chk_534f10783683daa0"); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Check.destroy("chk_534f10783683daa0") + label: ELIXIR + - lang: CSharp + source: | + ChecksApi api = new ChecksApi(config); + + try { + CheckDeletion response = api.cancel("chk_534f10783683daa0"); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + deletedCheck, _, err := apiClient.ChecksApi.Cancel(context, + "chk_534f10783683daa0").Execute() + + + if err != nil { + return err + } + label: GO + /creatives: + post: + operationId: creative_create + summary: Create + description: Creates a new creative with the provided properties + tags: + - Creatives + parameters: + - $ref: '#/components/parameters/lang_spec' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/creative_writable' + example: + campaign_id: cmp_e05ee61ff80764b + resource_type: postcard + description: Our 4x6 postcard creative + details: {} + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/creative_writable' + encoding: + example-prop: + style: deepObject + explode: true + example: + campaign_id: cmp_e05ee61ff80764b + resource_type: postcard + description: Our 4x6 postcard creative + details: {} + multipart/form-data: + schema: + $ref: '#/components/schemas/creative_writable' + example: + campaign_id: cmp_e05ee61ff80764b + resource_type: postcard + description: Our 4x6 postcard creative + details: {} + responses: + '200': + description: Creative created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/creative' + example: + id: crv_2a3b096c409b32c + description: Our 4x6 postcard creative + from: adr_210a8d4b0b76d77b + resource_type: postcard + details: {} metadata: {} - to: - id: adr_asdi2y3riuasasoi - description: Harry - Office - name: Harry Zhang - company: Lob - phone: '5555555555' - email: harry@lob.com - metadata: {} - address_line1: 370 WATER ST - address_line2: '' - address_city: SUMMERSIDE - address_state: PRINCE EDWARD ISLAND - address_zip: C1N 1C4 - address_country: CANADA - recipient_moved: false - date_created: '2019-09-20T00:14:00.361Z' - date_modified: '2019-09-20T00:14:00.361Z' - object: address - from: - id: adr_210a8d4b0b76d77b - description: null - name: LEORE AVIDAR - company: null - phone: null - email: null - address_line1: 210 KING ST STE 6100 - address_line2: null - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2018-12-08T03:01:07.651Z' - date_modified: '2018-12-08T03:01:07.651Z' - object: address - color: true - double_sided: false - address_placement: top_first_page - return_envelope: false - perforated_page: null - extra_service: certified - custom_envelope: null - template_id: tmpl_a - template_version_id: vrsn_a - mail_type: usps_first_class - url: https://lob-assets.com/letters/ltr_5ba44b462c79f07c.pdf?version=v1&expires=1568239830&signature=Ob-DUPLJLM4scWQeCDNadPJ4j33MZw16pykOxwv2us-bA7utTYi6oZ8WrEtBYDBBo09XkapR3gdJf0NEr90xAA - merge_variables: null - carrier: USPS - tracking_number: '92071902358909000011275538' - tracking_events: - - id: evnt_9e84094c9368cfb - type: certified - name: Delivered - details: - event: delivered - description: Package has been delivered. - notes: Delivered, Front Desk/Reception/Mail Room - action_required: false - location: '33408' - time: '2019-10-08T19:41:00Z' - date_created: '2019-10-08T19:41:00Z' - date_modified: '2019-10-08T19:41:00Z' - object: tracking_event - thumbnails: - - small: https://lob-assets.com/letters/ltr_5ba44b462c79f07c_thumb_small_1.png?version=v1&expires=1568239830&signature=xZUmE8rq8wSECHPEb9c37cUDZBzGUO3XK5LsIPZhI6dOXgm6zJEn8_7tKuZ3JWBmvNJNXdTl_ufkNu4avjQUDw - medium: https://lob-assets.com/letters/ltr_5ba44b462c79f07c_thumb_medium_1.png?version=v1&expires=1568239830&signature=H7354Qpcm9S4aXbrMsBe6QJ6lSNi9IWPgMJtLWLi4Kyx9tHF8Mp9YEc_IL9x89Jfw4-yRzKDXA410X4W0PssBQ - large: https://lob-assets.com/letters/ltr_5ba44b462c79f07c_thumb_large_1.png?version=v1&expires=1568239830&signature=54LUIDKZyItA9pnC87d1pJVAuw8bhKLCsMpNWkB3LgdVWxPxxb_c1IyIWAbSR-dyOYEOlDBCc40J4Kns-O_mAg - expected_delivery_date: '2019-08-16' - date_created: '2019-08-08T17:09:14.514Z' - date_modified: '2019-08-08T17:09:16.850Z' - send_date: '2019-08-08' - use_type: marketing - fsc: false - object: letter - - id: ltr_da8267c6a6545cd6 + template_preview_urls: {} + template_previews: [] + campaigns: [] + date_created: '2017-09-05T17:47:53.767Z' + date_modified: '2017-09-05T17:47:53.767Z' + object: creative + default: + $ref: '#/components/responses/creatives_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/creatives \ + -u : \ + -d "campaign_id=cmp_e05ee61ff80764b" \ + -d "resource_type=postcard" \ + -d "details={}" + - lang: Ruby + source: | + creativeCreate = CreativeWritable.new({ + campaign_id: "cmp_e05ee61ff80764b", + resource_type: "postcard", + description: "Our 4x6 postcard creative", + from: "adr_210a8d4b0b76d77b", + front: "tmpl_4aa14648113e45b", + back: "tmpl_4aa14648113e45b", + details: PostcardDetailsWritable.new({ + mail_type: "usps_first_class", + }), + }); + + creativeApi = CreativesApi.new(config) + + begin + createdCreative = creativeApi.create(creativeCreate) + rescue => err + p err.message + end + label: RUBY + /creatives/{crv_id}: + parameters: + - in: path + name: crv_id + description: id of the creative + required: true + schema: + $ref: '#/components/schemas/crv_id' + get: + operationId: creative_retrieve + summary: Retrieve + description: >- + Retrieves the details of an existing creative. You need only supply the + unique creative identifier that was returned upon creative creation. + tags: + - Creatives + responses: + '200': + description: Returns a creative object + content: + application/json: + schema: + $ref: '#/components/schemas/creative' + example: + id: crv_2a3b096c409b32c + description: Our 4x6 postcard creative + from: adr_210a8d4b0b76d77b + resource_type: postcard + details: {} + metadata: {} + template_preview_urls: {} + template_previews: [] + campaigns: [] + date_created: '2017-09-05T17:47:53.767Z' + date_modified: '2017-09-05T17:47:53.767Z' + object: creative + default: + $ref: '#/components/responses/creatives_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/creatives/crv_2a3b096c409b32c \ + -u : + label: CURL + - lang: Ruby + source: | + creativeApi = CreativesApi.new(config) + + begin + retrievedCreative = creativeApi.get("crv_2a3b096c409b32c") + rescue => err + p err.message + end + label: RUBY + patch: + operationId: creative_update + summary: Update + description: >- + Update the details of an existing creative. You need only supply the + unique identifier that was returned upon creative creation. + tags: + - Creatives + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/creative_base' + example: + description: Test creative + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/creative_base' + example: + description: Test creative + multipart/form-data: + schema: + $ref: '#/components/schemas/creative_base' + example: + description: Test creative + responses: + '200': + description: Returns a creative object + content: + application/json: + schema: + $ref: '#/components/schemas/creative' + example: + id: crv_2a3b096c409b32c + description: Our 4x6 postcard creative + from: adr_210a8d4b0b76d77b + resource_type: postcard + details: {} + metadata: {} + template_preview_urls: {} + template_previews: [] + campaigns: [] + date_created: '2017-09-05T17:47:53.767Z' + date_modified: '2017-09-05T17:47:53.767Z' + object: creative + default: + $ref: '#/components/responses/creatives_error' + x-codeSamples: + - lang: Shell + source: | + curl -X PATCH https://api.lob.com/v1/creatives/crv_2a3b096c409b32c \ + -u : \ + -d "description=Our updated 4x6 postcard creative" + label: CURL + - lang: Python + source: | + creative_patch = CreativePatch( + description = "Our updated 4x6 postcard creative", + ) + + with ApiClient(configuration) as api_client: + api = CreativesApi(api_client) + + try: + updated_creative = api.update("crv_2a3b096c409b32c", creative_patch) + except ApiException as e: + print(e) + label: PYTHON + - lang: Ruby + source: | + creativePatch = CreativePatch.new({ + description: "Our updated 4x6 postcard creative", + }) + + creativeApi = CreativesApi.new(config) + + begin + updatedCreative = creativeApi.update("crv_2a3b096c409b32c", creativePatch) + rescue => err + p err.message + end + label: RUBY + /identity_validation: + post: + operationId: identity_validation + summary: Identity Validation + description: Validates whether a given name is associated with an address. + tags: + - Identity Validation + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/identity_validation_writable' + example: + recipient: Larry Lobster + primary_line: 210 King St. + secondary_line: '' + city: San Francisco + state: CA + zip_code: '94107' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/identity_validation_writable' + example: + recipient: Larry Lobster + primary_line: 210 King St. + secondary_line: '' + city: San Francisco + state: CA + zip_code: '94107' + multipart/form-data: + schema: + $ref: '#/components/schemas/identity_validation_writable' + example: + recipient: Larry Lobster + primary_line: 210 King St. + secondary_line: '' + city: San Francisco + state: CA + zip_code: '94107' + responses: + '200': + $ref: '#/components/responses/identity_validation' + default: + $ref: '#/components/responses/identity_validation_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/identity_validation \ + -u : \ + -d "recipient=Larry Lobster" \ + -d "primary_line=210 King St" \ + -d "secondary_line=" \ + -d "urbanization=" \ + -d "city=San Francsico" \ + -d "state=CA" \ + -d "zip_code=94107" \ + label: CURL + /intl_autocompletions: + post: + operationId: intl_autocompletions + summary: Autocomplete + description: >- + Given an address prefix consisting of a partial primary line and + country, as well as optional input of city, state, and zip code, this + functionality returns up to 10 full International address suggestions. + Not all of them will turn out to be valid addresses; they'll need to be + [verified](#operation/intl_verification). + tags: + - Intl Autocompletions + parameters: + - $ref: '#/components/parameters/lang_spec' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/intl_autocompletions_writable' + examples: + basic: + value: + address_prefix: 340 Wat + city: Summerside + state: Prince Edward Island + zip_code: C1N 1C4 + country: CA + geo_ip_sort: false + test: + value: + address_prefix: 1 sugg + country: CA + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/intl_autocompletions_writable' + examples: + basic: + value: + address_prefix: 340 Wat + city: Summerside + state: Prince Edward Island + zip_code: C1N 1C4 + country: CA + geo_ip_sort: false + test: + value: + address_prefix: 1 sugg + country: CA + multipart/form-data: + schema: + $ref: '#/components/schemas/intl_autocompletions_writable' + examples: + basic: + value: + address_prefix: 340 Wat + city: Summerside + state: Prince Edward Island + zip_code: C1N 1C4 + country: CA + geo_ip_sort: false + test: + value: + address_prefix: 1 sugg + country: CA + responses: + '200': + $ref: '#/components/responses/intl_autocompletions' + default: + $ref: '#/components/responses/intl_autocompletions_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/intl_autocompletions \ + -u : \ + -d "address_prefix=340 Wat" \ + -d "city=Summerside" \ + -d "state=Prince Edward Island" \ + -d "zip_code=C1N 1C4" \ + -d "country=CA" + label: CURL + - lang: Typescript + source: | + const IntlAutocompletions = new IntlAutocompletionsApi(av_config); + const autoCompletionData = new IntlAutocompletionsWritable({ + address_prefix: "340 Wat", + city: "Summerside", + state: "Prince Edward Island", + zip_code: "C1N 1C4", + country: "CA", + }); + + try { + const autocompletedAddresses = await IntlAutocompletions.autocomplete(autocompletionData); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + This feature is not currently supported by this library. + label: NODE + - lang: Ruby + source: | + intlAutocompletionsApi = IntlAutocompletionsApi.new(config) + + autocompletionData = IntlAutocompletionsWritable.new({ + address_prefix: "340 Wat", + city: "Summerside", + state: "Prince Edward Island", + zip_code: "C1N 1C4", + country: CountryExtended::CA, + }) + + begin + autocompletedAddr = intlAutocompletionsApi.autocomplete(autocompletionData) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = IntlAutocompletionsApi(api_client) + + autocompletion_data = IntlAutocompletionsWritable( + address_prefix = "340 Wat", + city = "Summerside", + state = "Prince Edward Island", + zip_code = "C1N 1C4", + country = CountryExtended("CA"), + ) + + try: + autocompleted_addresses = api.autocomplete(autocompletion_data) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new + OpenAPI\Client\Api\IntlAutocompletionsApi($config, new + GuzzleHttp\Client()); + + + $autoCompletionData = new + OpenAPI\Client\Model\IntlAutocompletionsWritable(array( + "address_prefix" => "340 Wat", + "city" => "Summerside", + "state" => "Prince Edward Island", + "zip_code" => "C1N 1C4", + "country" => "CA", + )); + + + try { + $result = $apiInstance->autocomplete($autoCompletionData); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + This feature is not currently supported by this library. + label: JAVA + - lang: Elixir + source: | + This feature is not currently supported by this library. + label: ELIXIR + - lang: CSharp + source: > + IntlAutocompletionsApi api = new IntlAutocompletionsApi(config); + + + IntlAutocompletionsWritable autocompletionData = new + IntlAutocompletionsWritable( + "340 Wat", + "Summerside", + "Prince Edward Island", + "C1N 1C4", + CountryExtended.CA + ); + + + try { + IntlAutocompletions autocompletedAddresses = api.autocomplete(autocompletionData); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(context, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + resp, _, err := + suite.apiClient.IntlAutocompletionsApi.Autocomplete(context).IntlAutocompletionsWritable(suite.intlAutocomplationsWritable).Execute() + + + if err != nil { + return err + } + label: GO + /intl_verifications: + post: + operationId: intl_verification + summary: Single Verify + description: >- + Verify an international (except US or US territories) address _with a + live API key_. Requests to this endpoint with a test API key will return + a dummy response based on the primary line you input. + tags: + - Intl Verifications + parameters: + - $ref: '#/components/parameters/lang_spec' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/intl_verification_writable' + examples: + basic: + value: + recipient: Harry Zhang + primary_line: 370 Water St + secondary_line: '' + city: Summerside + state: Prince Edward Island + postal code: C1N 1C4 + country: CA + full_payload: + value: + recipient: Harry Zhang + primary_line: 370 Water St + secondary_line: '' + city: Summerside + state: Prince Edward Island + postal code: C1N 1C4 + country: CA + single_line: + value: + address: 370 Water St C1N 1C4 + country: CA + test: + value: + primary_line: deliverable + country: CA + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/intl_verification_writable' + examples: + basic: + value: + recipient: Harry Zhang + primary_line: 370 Water St + secondary_line: '' + city: Summerside + state: Prince Edward Island + postal code: C1N 1C4 + country: CA + full_payload: + value: + recipient: Harry Zhang + primary_line: 370 Water St + secondary_line: '' + city: Summerside + state: Prince Edward Island + postal code: C1N 1C4 + country: CA + single_line: + value: + address: 370 Water St C1N 1C4 + country: CA + test: + value: + primary_line: deliverable + country: CA + multipart/form-data: + schema: + $ref: '#/components/schemas/intl_verification_writable' + examples: + basic: + value: + recipient: Harry Zhang + primary_line: 370 Water St + secondary_line: '' + city: Summerside + state: Prince Edward Island + postal code: C1N 1C4 + country: CA + full_payload: + value: + recipient: Harry Zhang + primary_line: 370 Water St + secondary_line: '' + city: Summerside + state: Prince Edward Island + postal code: C1N 1C4 + country: CA + single_line: + value: + address: 370 Water St C1N 1C4 + country: CA + test: + value: + primary_line: deliverable + country: CA + responses: + '200': + $ref: '#/components/responses/intl_verifications' + default: + $ref: '#/components/responses/intl_verifications_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/intl_verifications \ + -u : \ + -d "primary_line=370 Water St" \ + -d "city=Summerside" \ + -d "state=Prince Edward Island" \ + -d "postal_code=C1N 1C4" \ + -d "country=CA" + label: CURL + - lang: Typescript + source: | + const IntlVerifications = new IntlVerificationsApi(av_config); + let verificationData1: IntlVerificationWritable = { + primary_line: '370 WATER ST', + postal_code: 'C1N 1C4', + country: CountryExtended.Ca + }; + + try { + const singleVerified = await IntlVerifications.verifySingle(verificationData1); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.intlVerifications.verify({ + primary_line: '370 Water St', + city: 'Summerside', + state: 'Prince Edward Island', + postal_code: 'C1N 1C4', + country: 'CA' + }, function (err, res) { + console.log (err, res); + }); + label: NODE + - lang: Ruby + source: | + intlVerificationsApi = IntlVerificationsApi.new(config) + + verificationData = IntlVerificationWritable.new({ + primary_line: "370 Water St", + city: "Summerside", + state: "Prince Edward Island", + postal_code: "C1N 1C4", + country: CountryExtended::CA, + }) + + begin + verifiedAddr = intlVerificationsApi.verifySingle(verificationData) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = IntlVerificationsApi(api_client) + verification_data_1 = IntlVerificationWritable( + primary_line = "370 Water St", + city = "Summerside", + state = "Prince Edward Island", + postal_code = "C1N 1C4", + country = CountryExtended("CA"), + ) + + try: + single_verified = api.verifySingle(verification_data_1) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\IntlVerificationsApi($config, + new GuzzleHttp\Client()); + + + $verificationData = new + OpenAPI\Client\Model\IntlVerificationWritable(array( + 'primary_line' => '370 Water St', + 'city' => 'Summerside', + 'state' => 'Prince Edward Island', + 'postal_code' => 'C1N 1C4', + 'country' => 'CA', + )); + + + try { + $result = $apiInstance->verifySingle($verificationData); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: > + LobResponse response = new + IntlVerification.RequestBuilder() + .setPrimaryLine("370 Water St") + .setCity("Summerside") + .setState("Prince Edward Island") + .setPostalCode("C1N 1C4") + .setCountry("CA") + .verify(); + + IntlVerification intlVerification = response.getResponseBody(); + label: JAVA + - lang: Elixir + source: | + Lob.IntlVerification.verify(%{ + primary_line: "370 Water St", + city: "Summerside", + state: "Prince Edward Island", + postal_code: "C1N 1C4", + country: "CA" + }) + label: ELIXIR + - lang: CSharp + source: > + IntlVerificationWritable singleVerify = new + IntlVerificationWritable( + null, + "370 Water St", + null, + "Summerside", + "Prince Edward Island", + "C1N 1C4", + CountryExtended.CA + ); + + + IntlVerificationsApi api = new IntlVerificationsApi(config); + + + try { + api.verifySingle(singleVerify, null); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + /letters/{ltr_id}: + parameters: + - in: path + name: ltr_id + description: id of the letter + required: true + schema: + $ref: '#/components/schemas/ltr_id' + get: + operationId: letter_retrieve + summary: Retrieve + description: >- + Retrieves the details of an existing letter. You need only supply the + unique letter identifier that was returned upon letter creation. + tags: + - Letters + responses: + '200': + description: Returns a letter object + content: + application/json: + schema: + $ref: '#/components/schemas/letter' + example: + id: ltr_4868c3b754655f90 description: Demo Letter metadata: {} to: - id: adr_210a8d4b0b76d77b - description: null - name: LEORE AVIDAR - company: null - phone: null - email: null - address_line1: 210 KING ST STE 6100 - address_line2: null - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2018-12-08T03:01:07.651Z' - date_modified: '2018-12-08T03:01:07.651Z' - object: address - from: - id: adr_210a8d4b0b76d77b - description: null - name: LEORE AVIDAR - company: null - phone: null - email: null - address_line1: 210 KING ST STE 6100 - address_line2: null - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2018-12-08T03:01:07.651Z' - date_modified: '2018-12-08T03:01:07.651Z' - object: address - color: true - double_sided: false - address_placement: top_first_page - return_envelope: false - perforated_page: null - extra_service: null - custom_envelope: null - mail_type: usps_first_class - url: https://lob-assets.com/letters/ltr_da8267c6a6545cd6.pdf?version=v1&expires=1568239830&signature=HH-5RnbD4x0eJcnEC9HhqKSvQGsbkjovzvqSKgBijUHKIXwEKQJ4CbYhKs_U2q2A1k20Xefcaw7bfdPKozuqCQ - merge_variables: null - carrier: USPS - tracking_number: null - tracking_events: [] - thumbnails: - - small: https://lob-assets.com/letters/ltr_da8267c6a6545cd6_thumb_small_1.png?version=v1&expires=1568239830&signature=C1Rs83187HpWGhsg_pJIOhDIKlDtC_IgBBxHiocCEzJ8CncJwqrq5yHke-p97Dv7o81G_pfhFmirai589O6DCw - medium: https://lob-assets.com/letters/ltr_da8267c6a6545cd6_thumb_medium_1.png?version=v1&expires=1568239830&signature=gz63l0yi3sK_sXjYfIVdLSvkknJFr_O5TWRulo_iKIgS-PosIl6J0tDR6bx_Tv5Ab_w7DABg3qdKZ846MZ7TCw - large: https://lob-assets.com/letters/ltr_da8267c6a6545cd6_thumb_large_1.png?version=v1&expires=1568239830&signature=4Y1OIymaWkSO3aBIHCeshFAVnF-pDcF2FFqkx_jovaUFuk4FT1SI24L7_POwTRXQHlETMGlzkP_CGgqselRUAA - expected_delivery_date: '2019-08-16' - date_created: '2019-08-08T17:08:12.224Z' - date_modified: '2019-08-08T17:08:13.990Z' - send_date: '2019-08-08T17:08:12.224Z' - cards: null - use_type: marketing - fsc: true - object: letter - object: list - next_url: https://api.lob.com/v1/letters?limit=2&after=eyJkYXRlT2Zmc2V0IjoiMjAxOS0wOC0wOFQxNzowODoxMi4yMjRaIiwiaWRPZmZzZXQiOiJsdHJfZGE4MjY3YzZhNjU0NWNkNiJ9 - previous_url: null - count: 2 - post_letter: - description: Returns a letter object - headers: - ratelimit-limit: - $ref: '#/components/headers/ratelimit-limit' - ratelimit-remaining: - $ref: '#/components/headers/ratelimit-remaining' - ratelimit-reset: - $ref: '#/components/headers/ratelimit-reset' - content: - application/json: - schema: - $ref: '#/components/schemas/letter' - example: - id: ltr_4868c3b754655f90 - description: Demo Letter - metadata: {} - to: - id: adr_d3489cd64c791ab5 - description: null - name: HARRY ZHANG - company: null - phone: null - email: null - address_line1: 210 KING ST STE 6100 - address_line2: null - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2017-09-05T15:54:53.264Z' - date_modified: '2017-09-05T15:54:53.264Z' - deleted: true - object: address - from: - id: adr_b8fb5acf3a2b55db - description: null - name: LEORE AVIDAR - company: null - phone: null - email: null - address_line1: 210 KING ST STE 6100 - address_line2: null - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2017-09-05T15:54:53.264Z' - date_modified: '2017-09-05T15:54:53.264Z' - deleted: true - object: address - color: true - double_sided: true - address_placement: top_first_page - return_envelope: false - perforated_page: null - custom_envelope: null - extra_service: null - mail_type: usps_first_class - url: https://lob-assets.com/letters/ltr_4868c3b754655f90.pdf?expires=1540372221&signature=8r94fse8uam7wGWmW5baxXulU88X2CA - carrier: USPS - tracking_number: null - tracking_events: [] - thumbnails: - - small: https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_small_1.png?expires=1540372221&signature=a5fRBJ22ZA78Vgpg34M9UfmHWTS3eha - medium: https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_medium_1.png?expires=1540372221&signature=bAzL8sv935PY09FWSkpDpWKkyvGSWYF - large: https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_large_1.png?expires=1540372221&signature=gsKvxXgrm4v4iZD3bOibK7jApNkEMdW - merge_variables: - name: Harry - expected_delivery_date: '2017-09-12' - date_created: '2017-09-05T15:54:53.346Z' - date_modified: '2017-09-05T15:54:53.346Z' - send_date: '2017-09-05T15:54:53.346Z' - cards: - - id: card_c51ae96f5cebf3e - account_id: fa9ea650fc7b31a89f92 - description: null - url: https://lob-assets.com/cards/card_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA - size: 2.125x3.375 - auto_reorder: false - reorder_quantity: null - raw_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - front_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - back_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw - thumbnails: - - small: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg - medium: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA - large: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw - - small: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_2.png?version=v1&expires=1636910992&signature=IWsmPa_ULlv2yyqjX564d_YfHHY_M7i9YxDnw-WXDr2jtOFcArmRZQbnHeE9g_rYxnddJbgosuv8-c2utiu7Cg - medium: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_2.png?version=v1&expires=1636910992&signature=zxK7VKGiTvz5Ywrkaydd0v3GcYf58R7A08J4tNfI7-aiNODDcTF3l0MqY13n9Pyc8RXSdD0XVBY-OpbA1VM-Ag - large: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_2.png?version=v1&expires=1636910992&signature=r0OFUhh315ZwN0raMZdIwJd2oCIEYsz0BABaMxIuO1PKTD0ckGWrhcGdzk2dlWQ6vSvp0CUQ5k1RXGqkIIqkDw - available_quantity: 10000 - pending_quantity: 0 - countries: null - status: rendered - mode: test - orientation: horizontal - threshold_amount: 0 - date_created: '2017-08-05T15:54:53.346Z' - date_modified: '2017-08-05T15:54:53.346Z' - object: card - use_type: marketing - fsc: false - object: letter - postcard_deleted: - description: Deleted - content: - application/json: - schema: - $ref: '#/components/schemas/postcard_deletion' - example: - id: psc_123456789 - deleted: true - all_postcards: - description: A dictionary with a data property that contains an array of up to `limit` postcards. Each entry in the array is a separate postcard. The previous and next page of postcards can be retrieved by calling the endpoint contained in the `previous_url` and `next_url` fields in the API response respectively.
If no more postcards are available beyond the current set of returned results, the `next_url` field will be empty. - content: - application/json: - schema: - allOf: - - $ref: '#/components/schemas/list' - - type: object - properties: - data: - type: array - description: list of postcards - items: - $ref: '#/components/schemas/postcard' - example: - data: - - id: psc_208e45e48d271294 - description: null - metadata: {} - to: - id: adr_210a8d4b0b76d77b + id: adr_d3489cd64c791ab5 description: null - name: LEORE AVIDAR + name: HARRY ZHANG company: null phone: null email: null @@ -22477,44 +19806,12 @@ components: address_zip: 94107-1741 address_country: UNITED STATES metadata: {} - date_created: '2018-12-08T03:01:07.651Z' - date_modified: '2018-12-08T03:01:07.651Z' - object: address - url: https://lob-assets.com/postcards/psc_208e45e48d271294.pdf?version=v1&expires=1619218302&signature=NfHHLBSr5tOHA_Z4kij4dKqZG8f3vMDtwvuFVeeF9pV_lylcjLsVVODhNCE5hR6-2slUr6t9WMNsi429Pj7_DA - carrier: USPS - front_template_id: null - back_template_id: null - front_template_version_id: null - back_template_version_id: null - date_created: '2021-03-24T22:51:42.838Z' - date_modified: '2021-03-24T22:51:42.838Z' - send_date: '2021-03-24T22:51:42.838Z' - use_type: marketing - fsc: false - object: postcard - - id: psc_0e03d1ad7d31f151 - description: null - metadata: {} - to: - id: adr_c7cb63d68f8d6 - description: null - name: JANE DOE - company: LOB - phone: '5555555555' - email: jane.doe@lob.com - address_line1: 370 WATER ST - address_line2: '' - address_city: SUMMERSIDE - address_state: PE - address_zip: C1N 1C4 - address_country: CANADA - metadata: {} - date_created: '2018-12-08T03:01:07.651Z' - date_modified: '2018-12-08T03:01:07.651Z' + date_created: '2017-09-05T15:54:53.264Z' + date_modified: '2017-09-05T15:54:53.264Z' + deleted: true object: address - recipient_moved: false from: - id: adr_210a8d4b0b76d77b + id: adr_b8fb5acf3a2b55db description: null name: LEORE AVIDAR company: null @@ -22527,256 +19824,3167 @@ components: address_zip: 94107-1741 address_country: UNITED STATES metadata: {} - date_created: '2018-12-08T03:01:07.651Z' - date_modified: '2018-12-08T03:01:07.651Z' + date_created: '2017-09-05T15:54:53.264Z' + date_modified: '2017-09-05T15:54:53.264Z' + deleted: true object: address - url: https://lob-assets.com/postcards/psc_208e45e48d271294.pdf?version=v1&expires=1619218302&signature=NfHHLBSr5tOHA_Z4kij4dKqZG8f3vMDtwvuFVeeF9pV_lylcjLsVVODhNCE5hR6-2slUr6t9WMNsi429Pj7_DA + color: true + double_sided: true + address_placement: top_first_page + return_envelope: false + perforated_page: null + custom_envelope: null + extra_service: null + mail_type: usps_first_class + url: >- + https://lob-assets.com/letters/ltr_4868c3b754655f90.pdf?expires=1540372221&signature=8r94fse8uam7wGWmW5baxXulU88X2CA carrier: USPS - front_template_id: null - back_template_id: null - front_template_version_id: null - back_template_version_id: null + tracking_number: null tracking_events: [] - size: 6x11 - mail_type: usps_first_class - merge_variables: {} thumbnails: - - small: https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_small_1.png?expires=1540372221&signature=a5fRBJ22ZA78Vgpg34M9UfmHWTS3eha - medium: https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_medium_1.png?expires=1540372221&signature=bAzL8sv935PY09FWSkpDpWKkyvGSWYF - large: https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_large_1.png?expires=1540372221&signature=gsKvxXgrm4v4iZD3bOibK7jApNkEMdW - expected_delivery_date: '2021-03-30' - date_created: '2021-03-24T22:51:42.838Z' - date_modified: '2021-03-24T22:51:42.838Z' - send_date: '2021-03-24T22:51:42.838Z' + - small: >- + https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_small_1.png?expires=1540372221&signature=a5fRBJ22ZA78Vgpg34M9UfmHWTS3eha + medium: >- + https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_medium_1.png?expires=1540372221&signature=bAzL8sv935PY09FWSkpDpWKkyvGSWYF + large: >- + https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_large_1.png?expires=1540372221&signature=gsKvxXgrm4v4iZD3bOibK7jApNkEMdW + merge_variables: + name: Harry + expected_delivery_date: '2017-09-12' + date_created: '2017-09-05T15:54:53.346Z' + date_modified: '2017-09-05T15:54:53.346Z' + send_date: '2017-09-05T15:54:53.346Z' + cards: + - id: card_c51ae96f5cebf3e + account_id: fa9ea650fc7b31a89f92 + description: null + url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA + size: 2.125x3.375 + auto_reorder: false + reorder_quantity: null + raw_url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + front_original_url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + back_original_url: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw + thumbnails: + - small: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg + medium: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA + large: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw + - small: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_2.png?version=v1&expires=1636910992&signature=IWsmPa_ULlv2yyqjX564d_YfHHY_M7i9YxDnw-WXDr2jtOFcArmRZQbnHeE9g_rYxnddJbgosuv8-c2utiu7Cg + medium: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_2.png?version=v1&expires=1636910992&signature=zxK7VKGiTvz5Ywrkaydd0v3GcYf58R7A08J4tNfI7-aiNODDcTF3l0MqY13n9Pyc8RXSdD0XVBY-OpbA1VM-Ag + large: >- + https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_2.png?version=v1&expires=1636910992&signature=r0OFUhh315ZwN0raMZdIwJd2oCIEYsz0BABaMxIuO1PKTD0ckGWrhcGdzk2dlWQ6vSvp0CUQ5k1RXGqkIIqkDw + available_quantity: 10000 + pending_quantity: 0 + countries: null + status: rendered + mode: test + orientation: horizontal + threshold_amount: 0 + date_created: '2017-08-05T15:54:53.346Z' + date_modified: '2017-08-05T15:54:53.346Z' + object: card use_type: marketing fsc: false - object: postcard - object: list - previous_url: null - next_url: null - count: 2 - post_postcard: - description: Returns a postcard object - headers: - ratelimit-limit: - $ref: '#/components/headers/ratelimit-limit' - ratelimit-remaining: - $ref: '#/components/headers/ratelimit-remaining' - ratelimit-reset: - $ref: '#/components/headers/ratelimit-reset' - content: - application/json: + object: letter + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/letters/ltr_4868c3b754655f90 \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: Typescript + source: | + try { + const letter= await new LettersApi(config).get('ltr_xxxx'); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.letters.retrieve('ltr_4868c3b754655f90', function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + letterApi = LettersApi.new(config) + + begin + retrievedLetter = letterApi.get("ltr_4868c3b754655f90") + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = LettersApi(api_client) + + try: + letter = api.get("ltr_4868c3b754655f90") + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\LettersApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->get("ltr_4868c3b754655f90"); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + LettersApi apiInstance = new LettersApi(config); + + try { + Letter response = apiInstance.get("ltr_4868c3b754655f90"); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Letter.find("ltr_4868c3b754655f90") + label: ELIXIR + - lang: CSharp + source: | + LettersApi api = new LettersApi(config); + + try { + Letter response = api.get("ltr_4868c3b754655f90"); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + fetchedLetter, _, err := + apiClient.LettersApi.Get(context,"ltr_4868c3b754655f90").Execute() + + + if err != nil { + return err + } + label: GO + delete: + operationId: letter_cancel + summary: Cancel + description: >- + Completely removes a letter from production. This can only be done if + the letter has a `send_date` and the `send_date` has not yet passed. If + the letter is successfully canceled, you will not be charged for it. + Read more on [cancellation windows](#section/Cancellation-Windows) and + [scheduling](#section/Scheduled-Mailings). Scheduling and cancellation + is a premium feature. Upgrade to the appropriate Print & Mail Edition to gain access. + tags: + - Letters + responses: + '200': + $ref: '#/components/responses/letter_deleted' + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: | + curl -X DELETE https://api.lob.com/v1/letters/ltr_4868c3b754655f90 \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: Typescript + source: | + try { + const deleteLetter = await new LettersApi(config).delete('ltr_xxxx') + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.letters.delete('ltr_4868c3b754655f90', function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + letterApi = LettersApi.new(config) + + begin + deletedLetter = letterApi.cancel("ltr_4868c3b754655f90") + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = LettersApi(api_client) + + try: + deleted_resource = api.cancel("ltr_4868c3b754655f90") + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\LettersApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->cancel("ltr_4868c3b754655f90"); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + LettersApi apiInstance = new LettersApi(config); + + try { + LetterDeletion response = apiInstance.cancel("ltr_4868c3b754655f90"); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Letter.destroy("ltr_4868c3b754655f90") + label: ELIXIR + - lang: CSharp + source: | + LettersApi api = new LettersApi(config); + + try { + LetterDeletion response = api.cancel("ltr_4868c3b754655f90"); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + deletedLetter, _, err := apiClient.LettersApi.Cancel(context, + "ltr_4868c3b754655f90").Execute() + + + if err != nil { + return err + } + label: GO + /letters: + get: + operationId: letters_list + summary: List + description: >- + Returns a list of your letters. The letters are returned sorted by + creation date, with the most recently created letters appearing first. + tags: + - Letters + 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/campaign_id' + - $ref: '#/components/parameters/status' + - in: query + name: color + description: >- + Set to `true` to return only color letters. Set to `false` to return + only black & white letters. + schema: + type: boolean + - $ref: '#/components/parameters/scheduled' + - $ref: '#/components/parameters/send_date' + - $ref: '#/components/parameters/mail_type' + - $ref: '#/components/parameters/sort_by' + responses: + '200': + $ref: '#/components/responses/all_letters' + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: | + curl -X GET "https://api.lob.com/v1/letters?limit=2" \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: typescript + source: | + try { + const letters = await new LettersApi(config).list(2); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.letters.list({limit: 2}, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + lettersApi = LettersApi.new(config) + + begin + letters = lettersApi.list({ limit: 2 }) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = LettersApi(api_client) + + try: + letters = api.list(limit=2) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\LettersApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->list( + 2, // limit + ); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + LettersApi apiInstance = new LettersApi(config); + + try { + LetterList response = apiInstance.list( + 2, // limit + null, // before + null, // after + null, // include + null, // dateCreated + null, // metadata + null, // color + null, // scheduled + null, // sendDate + null, // mailType + null // sortBy + ); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Letter.list(%{limit: 2}) + label: ELIXIR + - lang: CSharp + source: > + LettersApi api = new LettersApi(config); + + + List includeList = new List(); + + includeList.Add("total_count"); + + Dictionary metadata = new Dictionary(); + + metadata.Add("name", "Harry"); + + Dictionary dateCreated = new Dictionary(); + + DateTime dateCreatedDate = DateTime.Today.AddMonths(-1); + + dateCreated.Add("lt", dateCreatedDate); + + Dictionary sendDate = new Dictionary(); + + sendDate.Add("lt", + DateTime.Now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz")); + + SortBy3 sortBy = new SortBy3(SortBy3.DateCreatedEnum.Asc); + + + try { + LetterList response = api.list( + 2, // limit + null, // before + null, // after + includeList, // include + dateCreated, // dateCreated + metadata, // metadata + true, // color + true, // scheduled + sendDate, // sendDate + MailType.FirstClass, // mailType + sortBy // sortBy + ); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + LetterList = apiClient.LettersApi.List(context).Execute() + + if err != nil { + return err + } + label: GO + post: + operationId: letter_create + summary: Create + description: Creates a new letter given information + tags: + - Letters + parameters: + - $ref: '#/components/parameters/idem-header' + - $ref: '#/components/parameters/idem-query' + - $ref: '#/components/parameters/lob-version' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/letter_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 Letter for + {{name}} + color: true + cards: + - card_c51ae96f5cebf3e + double_sided: false + address_placement: bottom_first_page + mail_type: usps_first_class + return_envelope: true + perforated_page: 1 + merge_variables: + name: Harry + metadata: + spiffy: 'true' + send_date: '2017-11-01T00:00:00.000Z' + extra_service: registered + custom_envelope: null + 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 + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/letter_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 Letter for + {{name}} + color: true + cards: + - card_c51ae96f5cebf3e + double_sided: false + address_placement: top_first_page + mail_type: usps_first_class + return_envelope: true + perforated_page: 1 + merge_variables: + name: Harry + metadata: + spiffy: 'true' + send_date: '2017-11-01T00:00:00.000Z' + extra_service: registered + custom_envelope: null + use_type: marketing + qr_code: + position: relative + redirect_url: https://www.lob.com + width: '2' + bottom: '2' + right: '2' + pages: 1,4 + fsc: true + encoding: + to: + style: deepObject + explode: true + from: + style: deepObject + explode: true + merge_variables: + style: deepObject + explode: true + metadata: + style: deepObject + explode: true + multipart/form-data: + schema: + $ref: '#/components/schemas/letter_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 Letter for + {{name}} + color: true + cards: + - card_c51ae96f5cebf3e + double_sided: false + address_placement: top_first_page + mail_type: usps_first_class + return_envelope: true + perforated_page: 1 + merge_variables: + name: Harry + metadata: + spiffy: 'true' + send_date: '2017-11-01T00:00:00.000Z' + extra_service: registered + custom_envelope: null + use_type: marketing + qr_code: + position: relative + redirect_url: https://www.lob.com + width: '2' + bottom: '2' + left: '2' + pages: 1,3-5 + fsc: true + responses: + '200': + $ref: '#/components/responses/post_letter' + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/letters \ + -u YOUR_API_KEY \ + -d 'description=Demo Letter' \ + -d 'to[name]=Harry Zhang' \ + -d 'to[address_line1]=210 King St' \ + -d 'to[address_line2]=# 6100' \ + -d 'to[address_city]=San Francisco' \ + -d 'to[address_state]=CA' \ + -d 'to[address_zip]=94107' \ + -d 'from=adr_210a8d4b0b76d77b' \ + --data-urlencode 'file=HTML Letter for {{name}}' \ + -d 'merge_variables[name]=Harry' \ + -d 'color=true' \ + -d 'cards[]=card_c51ae96f5cebf3e' \ + -d 'qr_code[position]=relative' \ + -d 'qr_code[redirect_url]=https://www.lob.com' \ + -d 'qr_code[width]=2' \ + -d 'qr_code[bottom]=2' \ + -d 'qr_code[left]=2' \ + -d 'qr_code[pages]=3,4-5' \ + -d 'fsc=true' + label: CURL + - lang: Typescript + source: | + const letterCreate = new LetterEditable({ + to: { + name: 'Harry Zhang', + address_line1: '210 King St', + address_line2: '# 6100', + address_city: 'San Francisco', + address_state: 'CA', + address_zip: '94107' + }, + from: 'adr_xxxx', + color: true, + extra_service: LetterEditableExtraServiceEnum.Certified, + file: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/us_letter_1pg.pdf', + use_type: 'marketing', + qr_code : { + position: 'relative', + redirect_url: 'https://www.lob.com', + width: '2', + bottom: '2', + left: '2', + pages: '2,5' + }, + fsc: true + }); + + try { + const myLetter = await new LettersApi(config).create(letterCreate); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.letters.create({ + description: 'Demo Letter', + to: { + name: 'Harry Zhang', + address_line1: '210 King St', + address_line2: '# 6100', + address_city: 'San Francisco', + address_state: 'CA', + address_zip: '94107' + }, + from: 'adr_210a8d4b0b76d77b', + file: 'HTML Letter for {{name}}', + merge_variables: { + name: 'Harry' + }, + color: true, + cards: ['card_c51ae96f5cebf3e'], + use_type: 'marketing', + qr_code : { + position: 'relative', + redirect_url: 'https://www.lob.com', + width: '2', + bottom: '2', + left: '2', + pages: '2,4-5' + }, + fsc: true + }, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + letterCreate = LetterEditable.new({ + description: "Demo Letter", + from: "adr_210a8d4b0b76d77b", + file: "HTML Letter for {{name}}", + color: "true", + to: AddressEditable.new({ + name: "Harry Zhang", + address_line1: "210 King St", + address_line2: "# 6100", + address_city: "San Francisco", + address_state: "CA", + address_zip: "94107", + }), + merge_variables: { + name: "Harry" + }, + cards: [ + "card_c51ae96f5cebf3e", + ], + use_type: "marketing", + fsc: true + }); + + letterApi = LettersApi.new(config) + + begin + createdLetter = letterApi.create(letterCreate) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + letter_editable = LetterEditable( + description = "Demo Letter", + _from = "adr_210a8d4b0b76d77b", + file = "HTML Letter for {{name}}", + color = True, + to = AddressEditable( + name = "Harry Zhang", + address_line1 = "210 King St", + address_line2 = "# 6100", + address_city = "San Francisco", + address_state = "CA", + address_zip = "94107", + ), + merge_variables = MergeVariables( + name = "Harry", + ), + cards = [ + "card_c51ae96f5cebf3e", + ], + use_type = "marketing", + qr_code = { + "position" : "relative", + "redirect_url" : "https://www.lob.com", + "width" : "2", + "bottom" : "2", + "left" : "2", + "pages" : "1,3" + }, + fsc = true + ) + + with ApiClient(configuration) as api_client: + api = LettersApi(api_client) + + try: + created_letter = api.create(letter_editable) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $to = new OpenAPI\Client\Model\AddressEditable( + array( + "name" => "Harry Zhang", + "address_line1" => "210 King St", + "address_line2" => "# 6100", + "address_city" => "San Francisco", + "address_state" => "CA", + "address_zip" => "94107", + ) + ); + + + $qr_code = new OpenAPI\Client\Model\QRCode( + array( + "position" => "relative", + "redirect_url" => "https://www.lob.com", + "width" => "2", + "bottom" => "2", + "left" => "2", + "pages" => "1,3,5", + ) + ); + + + $merge_variables = new stdClass; + + $merge_variables->name = "Harry"; + + + $use_type = "marketing"; + + $fsc = true; + + + $apiInstance = new OpenAPI\Client\Api\LettersApi($config, new + GuzzleHttp\Client()); + + $letter_editable = new OpenAPI\Client\Model\LetterEditable( + array( + "description" => "Demo Letter", + "from" => "adr_210a8d4b0b76d77b", + "file" => "HTML Letter for {{name}}", + "color" => "true", + "to" => $to, + "merge_variables" => $merge_variables, + "cards" => array( + "card_c51ae96f5cebf3e", + "card_thingy", + ), + "use_type" => $use_type; + "qr_code" => $qr_code, + "fsc" => $fsc, + ) + ); + + + try { + $result = $apiInstance->create($letter_editable); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + Map merge_variables = new HashMap(); + merge_variables.put("name", "Harry"); + + LettersApi apiInstance = new LettersApi(config); + + AddressEditable to = new AddressEditable(); + to.setName("Harry Zhang"); + to.setAddressLine1("210 King St"); + to.setAddressLine2("# 6100"); + to.setAddressCity("San Francisco"); + to.setAddressState("CA"); + to.setAddressZip("94107"); + + QRCode qrCode = new QRCode(); + qrCode.setPosition("relative"); + qrCode.setRedirectUrl("https://www.lob.com"); + qrCode.setWidth("2"); + qrCode.setLeft("2"); + qrCode.setBottom("2"); + qrCode.setPages("1,3,5"); + + List cards = new ArrayList(); + cards.add("card_c51ae96f5cebf3e"); + cards.add("card_thingy"); + + try { + LetterEditable letterEditable = new LetterEditable(); + letterEditable.setDescription("Demo Letter"); + letterEditable.setFrom("adr_210a8d4b0b76d77b"); + letterEditable.setFile("HTML Letter for {{name}}"); + letterEditable.setColor(true); + letterEditable.setTo(to); + letterEditable.setMergeVariables(merge_variables); + letterEditable.setCards(cards); + letterEditable.setUseType("operational"); + letterEditable.setQRCode(qrCode); + letterEditable.setFsc(true); + + Letter result = apiInstance.create(letterEditable, null); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Letter.create(%{ + description: 'Demo Letter', + to: %{ + name: 'Harry Zhang', + address_line1: '210 King St', + address_line2: '# 6100', + address_city: 'San Francisco', + address_state: 'CA', + address_zip: '94107' + }, + from: 'adr_210a8d4b0b76d77b', + file: 'HTML Letter for {{name}}', + merge_variables: %{ + name: 'Harry' + }, + color: true, + cards: ['card_c51ae96f5cebf3e'], + use_type: 'marketing', + qr_code: %{ + position: 'relative', + redirect_url: 'https://www.lob.com', + width: '2', + bottom: '2', + left: '2', + pages: '1-2,5' + }, + fsc: true + }) + label: ELIXIR + - lang: CSharp + source: > + Dictionary mergeVariables = new Dictionary(); + + mergeVariables.Add("name", "Harry"); + + + LettersApi api = new LettersApi(config); + + + AddressEditable to = new AddressEditable( + "210 King St", // addressLine1 + "# 6100", // addressLine2 + "San Francisco", // addressCity + "CA", // addressState + "94107", // addressZip + default(CountryExtended), // addressCounty + null, // description + "Harry Zhang" // name + ); + + + UseType usetype = new UseType("marketing"); + + + QRCode qrCode = new QRCode( + "relative", //position, + "https://www.lob.com", //redirect_url + "2", //width + "2", //left + "2", //bottom + "1-2,5", //pages + ); + + + Fsc fsc = new Fsc(true); + + + List cards = new List(); + + cards.Add("card_c51ae96f5cebf3e"); + + + LetterEditable letterEditable = new LetterEditable( + "Demo Letter", // description + default(Dictionary), // metadata + default(MailType), // mailType + mergeVariables, // mergeVariables + default(DateTime), // sendDate + true, // color + true, // doubleSided + LetterEditable.AddressPlacementEnum.TopFirstPage, // addressPlacement + default(Object), // returnEnvelope + default(int?), // perforatedPage + default(LetterEditableCustomEnvelope), // customEnvelope + to.ToJson(), // to + "adr_249af768103d2810", // from + "HTML Letter for {{name}}", // file + default(LetterEditable.ExtraServiceEnum?), // extraService + cards, // cards + usetype, + qrCode, + fsc + ); + + + try { + Letter result = api.create(letterEditable, null); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + var to = *lob.NewAddressEditable() + + to.SetAddressLine1("210 King St") + + to.SetAddressLine2("# 6100") + + to.SetAddressCity("San Francisco") + + to.SetAddressState("CA") + + to.SetAddressZip("94107") + + to.SetAddressCountry(lob.COUNTRYEXTENDED_US) + + to.SetDescription("") + + to.SetName("Harry Zhang") + + + var letterCreate = *lob.NewLetterEditable() + + letterCreate.SetDescription("Demo Letter") + + letterCreate.SetFrom("adr_210a8d4b0b76d77b") + + letterCreate.SetFile("HTML Letter for {{name}}") + + letterCreate.SetColor("true") + + letterCreate.SetTo(to) + + letterCreate.SetFsc(true) + + + + createdletter, _, err := + apiClient.LettersApi.Create(context).LetterEditable(letterCreate).Execute() + + + if err != nil { + return err + } + label: GO + /postcards/{psc_id}: + parameters: + - in: path + name: psc_id + description: id of the postcard + required: true + schema: + $ref: '#/components/schemas/psc_id' + get: + operationId: postcard_retrieve + summary: Retrieve + description: >- + Retrieves the details of an existing postcard. You need only supply the + unique customer identifier that was returned upon postcard creation. + tags: + - Postcards + responses: + '200': + description: Returns a postcard object + content: + application/json: + schema: + $ref: '#/components/schemas/postcard' + examples: + basic: + value: + id: psc_208e45e48d271294 + description: null + metadata: {} + to: + id: adr_210a8d4b0b76d77b + description: null + name: null + company: LOB + phone: null + email: null + address_line1: 210 KING ST STE 6100 + address_line2: null + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2018-12-08T03:01:07.651Z' + date_modified: '2018-12-08T03:01:07.651Z' + object: address + url: >- + https://lob-assets.com/postcards/psc_208e45e48d271294.pdf?version=v1&expires=1619218302&signature=NfHHLBSr5tOHA_Z4kij4dKqZG8f3vMDtwvuFVeeF9pV_lylcjLsVVODhNCE5hR6-2slUr6t9WMNsi429Pj7_DA + carrier: USPS + front_template_id: null + back_template_id: null + date_created: '2021-03-24T22:51:42.838Z' + date_modified: '2021-03-24T22:51:42.838Z' + send_date: '2021-03-24T22:51:42.838Z' + use_type: marketing + fsc: false + object: postcard + full: + value: + id: psc_0e03d1ad7d31f151 + description: null + metadata: {} + to: + id: adr_c7cb63d68f8d6 + description: null + name: JANE DOE + company: LOB + phone: '5555555555' + email: jane.doe@lob.com + address_line1: 370 WATER ST + address_line2: '' + address_city: SUMMERSIDE + address_state: PE + address_zip: C1N 1C4 + address_country: CANADA + metadata: {} + date_created: '2018-12-08T03:01:07.651Z' + date_modified: '2018-12-08T03:01:07.651Z' + object: address + recipient_moved: false + from: + id: adr_210a8d4b0b76d77b + description: null + name: LEORE AVIDAR + company: null + phone: null + email: null + address_line1: 210 KING ST STE 6100 + address_line2: null + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 + address_country: UNITED STATES + metadata: {} + date_created: '2018-12-08T03:01:07.651Z' + date_modified: '2018-12-08T03:01:07.651Z' + object: address + url: >- + https://lob-assets.com/postcards/psc_208e45e48d271294.pdf?version=v1&expires=1619218302&signature=NfHHLBSr5tOHA_Z4kij4dKqZG8f3vMDtwvuFVeeF9pV_lylcjLsVVODhNCE5hR6-2slUr6t9WMNsi429Pj7_DA + carrier: USPS + front_template_id: tmpl_93c369f06171958 + back_template_id: tmpl_93c369f06171958 + front_template_version_id: vrsn_a83e044941c393b + back_template_version_id: vrsn_a83e044941c393b + tracking_events: [] + size: 6x11 + mail_type: usps_first_class + merge_variables: {} + thumbnails: + - small: >- + https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_small_1.png?expires=1540372221&signature=a5fRBJ22ZA78Vgpg34M9UfmHWTS3eha + medium: >- + https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_medium_1.png?expires=1540372221&signature=bAzL8sv935PY09FWSkpDpWKkyvGSWYF + large: >- + https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_large_1.png?expires=1540372221&signature=gsKvxXgrm4v4iZD3bOibK7jApNkEMdW + expected_delivery_date: '2021-03-30' + date_created: '2021-03-24T22:51:42.838Z' + date_modified: '2021-03-24T22:51:42.838Z' + send_date: '2021-03-24T22:51:42.838Z' + use_type: marketing + fsc: false + object: postcard + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/postcards/psc_5c002b86ce47537a \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: Typescript + source: | + try { + const postcard = await new PostCardsApi(config).get('psc_xxxx'); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.postcards.retrieve('psc_5c002b86ce47537a', function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + letterApi = LettersApi.new(config) + + begin + retrievedLetter = letterApi.get("ltr_4868c3b754655f90") + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = PostcardsApi(api_client) + + try: + postcard = api.get("psc_5c002b86ce47537a") + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\PostcardsApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->get("psc_5c002b86ce47537a"); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + PostcardsApi apiInstance = new PostcardsApi(config); + + try { + Postcard response = apiInstance.get("psc_5c002b86ce47537a"); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Postcard.find("psc_5c002b86ce47537a") + label: ELIXIR + - lang: CSharp + source: | + PostcardsApi api = new PostcardsApi(config); + + try { + Postcard response = api.get("psc_5c002b86ce47537a"); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + fetchedPostcard, _, err := + apiClient.PostcardsApi.Get(context,"psc_5c002b86ce47537a").Execute() + + + if err != nil { + return err + } + label: GO + delete: + operationId: postcard_delete + summary: Cancel + description: >- + Completely removes a postcard from production. This can only be done if + the postcard has a `send_date` and the `send_date` has not yet passed. + If the postcard is successfully canceled, you will not be charged for + it. Read more on [cancellation windows](#section/Cancellation-Windows) + and [scheduling](#section/Scheduled-Mailings). Scheduling and + cancellation is a premium feature. Upgrade to the appropriate Print & Mail Edition to gain access. + tags: + - Postcards + responses: + '200': + $ref: '#/components/responses/postcard_deleted' + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: > + curl -X DELETE https://api.lob.com/v1/postcards/psc_5c002b86ce47537a + \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: Typescript + source: | + try { + const deletePostcard = await new PostcardsApi(config).delete('psc_xxxx'); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.postcards.delete('psc_5c002b86ce47537a', function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + letterApi = LettersApi.new(config) + + begin + deletedLetter = letterApi.cancel("ltr_4868c3b754655f90") + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = PostcardsApi(api_client) + + try: + deleted_resource = api.cancel("psc_5c002b86ce47537a") + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\PostcardsApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->cancel("psc_5c002b86ce47537a"); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + PostcardsApi apiInstance = new PostcardsApi(config); + + try { + PostcardDeletion response = apiInstance.cancel("psc_5c002b86ce47537a"); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Postcard.destroy("psc_5c002b86ce47537a") + label: ELIXIR + - lang: CSharp + source: | + PostcardsApi api = new PostcardsApi(config); + + try { + PostcardDeletion response = api.delete("psc_5c002b86ce47537a"); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + deletedPostcard, _, err := apiClient.PostcardsApi.Delete(context, + "psc_5c002b86ce47537a").Execute() + + + if err != nil { + return err + } + label: GO + /postcards: + get: + operationId: postcards_list + summary: List + description: >- + Returns a list of your postcards. The addresses are returned sorted by + creation date, with the most recently created addresses appearing first. + tags: + - Postcards + 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/campaign_id' + - $ref: '#/components/parameters/status' + - in: query + name: size + description: >- + Specifies the size of the postcard. Only `4x6` postcards can be sent + to international destinations. schema: - $ref: '#/components/schemas/postcard' - examples: - basic: - value: - id: psc_208e45e48d271294 - description: null - metadata: {} - to: - id: adr_210a8d4b0b76d77b - description: null - name: null - company: LOB - phone: null - email: null - address_line1: 210 KING ST STE 6100 - address_line2: null - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2018-12-08T03:01:07.651Z' - date_modified: '2018-12-08T03:01:07.651Z' - object: address - url: https://lob-assets.com/postcards/psc_208e45e48d271294.pdf?version=v1&expires=1619218302&signature=NfHHLBSr5tOHA_Z4kij4dKqZG8f3vMDtwvuFVeeF9pV_lylcjLsVVODhNCE5hR6-2slUr6t9WMNsi429Pj7_DA - carrier: USPS - front_template_id: null - back_template_id: null - date_created: '2021-03-24T22:51:42.838Z' - date_modified: '2021-03-24T22:51:42.838Z' - send_date: '2021-03-24T22:51:42.838Z' - use_type: marketing - fsc: false - object: postcard - full: - value: - id: psc_0e03d1ad7d31f151 - description: null - metadata: {} - to: - id: adr_c7cb63d68f8d6 - description: null - name: JANE DOE - company: LOB - phone: '5555555555' - email: jane.doe@lob.com - address_line1: 370 WATER ST - address_line2: '' - address_city: SUMMERSIDE - address_state: PE - address_zip: C1N 1C4 - address_country: CANADA - metadata: {} - date_created: '2018-12-08T03:01:07.651Z' - date_modified: '2018-12-08T03:01:07.651Z' - object: address - recipient_moved: false - from: - id: adr_210a8d4b0b76d77b - description: null - name: LEORE AVIDAR - company: null - phone: null - email: null - address_line1: 210 KING ST STE 6100 - address_line2: null - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2018-12-08T03:01:07.651Z' - date_modified: '2018-12-08T03:01:07.651Z' - object: address - url: https://lob-assets.com/postcards/psc_208e45e48d271294.pdf?version=v1&expires=1619218302&signature=NfHHLBSr5tOHA_Z4kij4dKqZG8f3vMDtwvuFVeeF9pV_lylcjLsVVODhNCE5hR6-2slUr6t9WMNsi429Pj7_DA - carrier: USPS - front_template_id: tmpl_93c369f06171958 - back_template_id: tmpl_93c369f06171958 - front_template_version_id: vrsn_a83e044941c393b - back_template_version_id: vrsn_a83e044941c393b - tracking_events: [] - size: 6x11 - mail_type: usps_first_class - merge_variables: {} - thumbnails: - - small: https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_small_1.png?expires=1540372221&signature=a5fRBJ22ZA78Vgpg34M9UfmHWTS3eha - medium: https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_medium_1.png?expires=1540372221&signature=bAzL8sv935PY09FWSkpDpWKkyvGSWYF - large: https://lob-assets.com/letters/ltr_4868c3b754655f90_thumb_large_1.png?expires=1540372221&signature=gsKvxXgrm4v4iZD3bOibK7jApNkEMdW - expected_delivery_date: '2021-03-30' - date_created: '2021-03-24T22:51:42.838Z' - date_modified: '2021-03-24T22:51:42.838Z' - send_date: '2021-03-24T22:51:42.838Z' - use_type: marketing - fsc: false - object: postcard - self_mailer_deleted: - description: Deleted - content: - application/json: + type: array + items: + $ref: '#/components/schemas/postcard_size' + - $ref: '#/components/parameters/scheduled' + - $ref: '#/components/parameters/send_date' + - $ref: '#/components/parameters/mail_type' + - $ref: '#/components/parameters/sort_by' + responses: + '200': + $ref: '#/components/responses/all_postcards' + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: | + curl -X GET "https://api.lob.com/v1/postcards?limit=2" \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: typescript + source: | + try { + const postcards = await new PostcardsApi(config).list(2); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.postcards.list({limit: 2}, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + postcardsApi = PostcardsApi.new(config) + + begin + postcards = postcardsApi.list({ limit: 2 }) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = PostcardsApi(api_client) + + try: + postcards = api.list(limit=2) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\PostcardsApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->list( + 2, // limit + ); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + PostcardsApi apiInstance = new PostcardsApi(config); + + try { + PostcardList response = apiInstance.list( + 2, // limit + null, // before + null, // after + null, // include + null, // dateCreated + null, // metadata + null, // size + null, // scheduled + null, // sendDate + null, // mailType + null // sortBy + ); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Postcard.list(%{limit: 2}) + label: ELIXIR + - lang: CSharp + source: > + PostcardsApi api = new PostcardsApi(config); + + + List includeList = new List(); + + includeList.Add("total_count"); + + Dictionary metadata = new Dictionary(); + + metadata.Add("name", "Harry"); + + Dictionary dateCreated = new Dictionary(); + + DateTime dateCreatedDate = DateTime.Today.AddMonths(-1); + + dateCreated.Add("lt", dateCreatedDate); + + Dictionary sendDate = new Dictionary(); + + sendDate.Add("lt", + DateTime.Now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz")); + + SortBy3 sortBy = new SortBy3(SortBy3.DateCreatedEnum.Asc); + + List sizeArray = new List(); + + sizeArray.Add(PostcardSize._4x6); + + + try { + PostcardList response = api.list( + 2, // limit + null, // before + null, // after + includeList, // include + dateCreated, // dateCreated + metadata, // metadata + sizeArray, // size + true, // scheduled + sendDate, // sendDate + MailType.FirstClass, // mailType + sortBy // sortBy + ); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + PostcardList = apiClient.PostcardsApi.List(context).Execute() + + if err != nil { + return err + } + label: GO + post: + operationId: postcard_create + summary: Create + description: Creates a new postcard given information + tags: + - Postcards + parameters: + - $ref: '#/components/parameters/idem-header' + - $ref: '#/components/parameters/idem-query' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/postcard_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: + 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 + front: tmpl_a1234dddg + back: tmpl_a1234dddg + size: 6x9 + 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.5' + top: '2.5' + right: '2.5' + pages: front,back + fsc: true + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/postcard_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: + 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 + front: tmpl_c94e83ca2cd5121 + back: tmpl_c94e83ca2cd5121 + size: 6x9 + 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.5' + bottom: '2.5' + right: '2.5' + pages: back + fsc: true + encoding: + to: + style: deepObject + explode: true + from: + style: deepObject + explode: true + merge_variables: + style: deepObject + explode: true + metadata: + style: deepObject + explode: true + multipart/form-data: + schema: + $ref: '#/components/schemas/postcard_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: + 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 + front: tmpl_a1234dddg + back: tmpl_a1234dddg + size: 6x9 + 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.5' + bottom: '2.5' + left: '2.5' + pages: front + fsc: true + responses: + '200': + $ref: '#/components/responses/post_postcard' + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/postcards \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ + -d 'description=Demo Postcard job' \ + -d 'to[name]=Harry Zhang' \ + -d 'to[address_line1]=210 King St' \ + -d 'to[address_line2]=# 6100' \ + -d 'to[address_city]=San Francisco' \ + -d 'to[address_state]=CA' \ + -d 'to[address_zip]=94107' \ + -d 'from=adr_210a8d4b0b76d77b' \ + --data-urlencode 'front=Front HTML for {{name}}' \ + --data-urlencode 'back=Back HTML for {{name}}' \ + -d 'merge_variables[name]=Harry' \ + -d 'use_type=marketing' \ + -d 'qr_code[position]=relative' \ + -d 'qr_code[redirect_url]=https://www.lob.com' \ + -d 'qr_code[width]=2.5' \ + -d 'qr_code[bottom]=2.5' \ + -d 'qr_code[left]=2.5' \ + -d 'qr_code[pages]=front,back' \ + -d 'fsc=true' + label: CURL + - lang: Typescript + source: > + const postcardCreate = new PostcardEditable({ + + to: new AddressEditable({ + name: 'Harry Zhang', + address_line1: '210 King St', + address_line2: '# 6100', + address_city: 'San Francisco', + address_state: 'CA', + address_zip: '94107' + }), + + from: 'adr_xxxx', + + front: + + 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/4x6_pc_template.pdf', + + back: + 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/4x6_pc_template.pdf', + + use_type: 'marketing', + + qr_code : { + position: 'relative', + redirect_url: 'https://www.lob.com', + width: '2.5', + bottom: '2.5', + left: '2.5', + pages: 'front' + }, + + fsc: true + + }); + + + try { + const myPostcard = await new PostcardsApi(config).create(postcardCreate); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.postcards.create({ + description: 'Demo Postcard job', + to: { + name: 'Harry Zhang', + address_line1: '210 King St', + address_line2: '# 6100', + address_city: 'San Francisco', + address_state: 'CA', + address_zip: '94107' + }, + from: 'adr_210a8d4b0b76d77b', + front: 'Front HTML for {{name}}', + back: 'Back HTML for {{name}}', + merge_variables: { + name: 'Harry' + }, + use_type: 'marketing' + qr_code : { + position: 'relative', + redirect_url: 'https://www.lob.com', + width: '2.5', + bottom: '2.5', + left: '2.5', + pages: 'back' + }, + fsc: true + }, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + postcardCreate = PostcardEditable.new({ + description: "Demo Postcard job", + from: "adr_210a8d4b0b76d77b", + front: "Front HTML for {{name}}", + back: "Back HTML for {{name}}", + to: AddressEditable.new({ + name: "Harry Zhang", + address_line1: "210 King St", + address_line2: "# 6100", + address_city: "San Francisco", + address_state: "CA", + address_zip: "94107", + }), + merge_variables: { + name: "Harry" + }, + fsc: true + }); + + postcardApi = PostcardsApi.new(config) + + begin + createdPostcard = postcardApi.create(postcardCreate) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + postcard_editable = PostcardEditable( + description = "Demo Postcard job", + _from = "adr_210a8d4b0b76d77b", + front = "Front HTML for {{name}}", + back = "Back HTML for {{name}}", + to = AddressEditable( + name = "Harry Zhang", + address_line1 = "210 King St", + address_line2 = "# 6100", + address_city = "San Francisco", + address_state = "CA", + address_zip = "94107", + ), + merge_variables = MergeVariables( + name = "Harry", + ), + use_type = "marketing", + qr_code = { + "position" : "relative", + "redirect_url" : "https://www.lob.com", + "width" : "2.5", + "bottom" : "2.5", + "left" : "2.5", + "pages" : "front" + }, + fsc = true + ) + + with ApiClient(configuration) as api_client: + api = PostcardsApi(api_client) + + try: + created_postcard = api.create(postcard_editable) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $to = new OpenAPI\Client\Model\AddressEditable( + array( + "name" => "Harry Zhang", + "address_line1" => "210 King St", + "address_line2" => "# 6100", + "address_city" => "San Francisco", + "address_state" => "CA", + "address_zip" => "94107", + ) + ); + + + $merge_variables = new stdClass; + + $merge_variables->name = "Harry"; + + $use_type = "marketing"; + + + $qr_code = new OpenAPI\Client\Model\QRCode( + array( + "position" => "relative", + "redirect_url" => "https://www.lob.com", + "width" => "2", + "bottom" => "2", + "left" => "2", + "pages" => "front,back" + ) + ); + + + $fsc = true; + + + $apiInstance = new OpenAPI\Client\Api\PostcardsApi($config, new + GuzzleHttp\Client()); + + $postcard_editable = new OpenAPI\Client\Model\PostcardEditable( + array( + "description" => "Demo Postcard job", + "from" => "adr_210a8d4b0b76d77b", + "front" => "Front HTML for {{name}}", + "back" => "Back HTML for {{name}}", + "to" => $to, + "merge_variables" => $merge_variables, + "use_type" => $use_type, + "qr_code" => $qr_code, + "fsc" => $fsc + ) + ); + + + try { + $result = $apiInstance->create($postcard_editable); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + Map merge_variables = new HashMap(); + merge_variables.put("name", "Harry"); + + PostcardsApi apiInstance = new PostcardsApi(config); + + AddressEditable to = new AddressEditable(); + to.setName("Harry Zhang"); + to.setAddressLine1("210 King St"); + to.setAddressLine2("# 6100"); + to.setAddressCity("San Francisco"); + to.setAddressState("CA"); + to.setAddressZip("94107"); + + QRCode qrCode = new QRCode(); + qrCode.setPosition("relative"); + qrCode.setRedirectUrl("https://www.lob.com"); + qrCode.setWidth("2"); + qrCode.setLeft("2"); + qrCode.setBottom("2"); + qrCode.setPages("back"); + + try { + PostcardEditable postcardEditable = new PostcardEditable(); + postcardEditable.setDescription("Demo Postcard job"); + postcardEditable.setFrom("adr_210a8d4b0b76d77b"); + postcardEditable.setFront("Front HTML for {{name}}"); + postcardEditable.setBack("Back HTML for {{name}}"); + postcardEditable.setTo(to); + postcardEditable.setMergeVariables(merge_variables); + postcardEditable.setUseType("operational"); + postcardEditable.setQRCode(qrCode); + postcardEditable.setFsc(true); + + Postcard result = apiInstance.create(postcardEditable, null); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Postcard.create(%{ + description: 'Demo Postcard job', + to: %{ + name: 'Harry Zhang', + address_line1: '210 King St', + address_line2: '# 6100', + address_city: 'San Francisco', + address_state: 'CA', + address_zip: '94107' + }, + from: 'adr_210a8d4b0b76d77b', + front: 'Front HTML for {{name}}', + back: 'Back HTML for {{name}}', + merge_variables: %{ + name: 'Harry' + }, + use_type: 'marketing' + qr_code: %{ + position: 'relative', + redirect_url: 'https://www.lob.com', + width: '2', + bottom: '2', + left: '2', + pages: 'front,back' + }, + fsc: true + }) + label: ELIXIR + - lang: CSharp + source: > + Dictionary mergeVariables = new Dictionary(); + + mergeVariables.Add("name", "Harry"); + + + PostcardsApi api = new PostcardsApi(config); + + + AddressEditable to = new AddressEditable( + "210 King St", // addressLine1 + "# 6100", // addressLine2 + "San Francisco", // addressCity + "CA", // addressState + "94107", // addressZip + CountryExtended.US, // addressCounty + null, // description + "Harry Zhang" // name + ); + + + UseType usetype = new UseType('marketing'); + + + QRCode qrCode = new QRCode( + "relative", //position, + "https://www.lob.com", //redirect_url + "2", //width + "2", //left + "2", //bottom + "front", //pages + ); + + + Fsc fsc = new Fsc(true); + + + PostcardEditable postcardEditable = new PostcardEditable( + to.ToJson(), // to + "adr_249af768103d2810", // from + default(PostcardSize), // size + "Demo Postcard Job", // description + null, // metadata + default(MailType), // mailType + mergeVariables, // mergeVariables + default(DateTime), // sendDate + "Back HTML for {{name}}", // front + "Back HTML for {{name}}", // back + usetype, + qrCode, + fsc + ); + + + try { + Postcard result = api.create(postcardEditable, null); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + var to = *lob.NewAddressEditable() + + to.SetAddressLine1("210 King St") + + to.SetAddressLine2("# 6100") + + to.SetAddressCity("San Francisco") + + to.SetAddressState("CA") + + to.SetAddressZip("94107") + + to.SetAddressCountry(lob.COUNTRYEXTENDED_US) + + to.SetDescription("") + + to.SetName("Harry Zhang") + + + var postcardCreate = *lob.NewPostcardEditable() + + postcardCreate.SetDescription("Demo Postcard job") + + postcardCreate.SetFrom("adr_210a8d4b0b76d77b") + + postcardCreate.SetFront("Front HTML for {{name}}") + + postcardCreate.SetBack("Back HTML for {{name}}") + + postcardCreate.SetTo(to) + + postcardCreate.SetFsc(true) + + + + createdpostcard, _, err := + apiClient.PostcardsApi.Create(context).PostcardEditable(postcardCreate).Execute() + + + if err != nil { + return err + } + label: GO + /qr_code_analytics: + get: + operationId: qr_codes_list + summary: List + description: >- + Returns a list of your QR codes. The QR codes are returned sorted by + scan date, with the most recently scanned QR codes appearing first. + tags: + - QR Codes + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/date_created' + - in: query + name: scanned + description: >- + Filter list of responses to only include QR codes with at least one + scan event. + schema: + type: boolean + - in: query + name: resource_ids + description: Filter by the resource ID. + schema: + type: array + maxItems: 100 + default: [] + responses: + '200': + description: Returns a list of QR Codes and their analytics. + content: + application/json: + schema: + allOf: + - type: object + properties: + object: + $ref: '#/components/schemas/object' + 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 + scanned_count: + type: integer + description: >- + Indicates the number of QR Codes out of `count` that + were scanned atleast once. + data: + type: array + description: List of QR code analytics + items: + $ref: '#/components/schemas/qr_code_scans' + example: + data: + - resource_id: ltr_d5a5a89da9106f8 + date_created: '2019-07-27T23:49:01.511Z' + number_of_scans: 2 + scans: + - ip_location: 127.0.0.1 + scan_date: '2022-07-27T23:49:01.511Z' + - ip_location: 127.0.0.1 + scan_date: '2022-07-29T23:45:00.436Z' + - resource_id: psc_d5a5a89da9106f8 + date_created: '2022-09-27T23:49:01.511Z' + number_of_scans: 1 + scans: + - ip_location: 127.0.0.1 + scan_date: '2022-09-27T23:49:01.511Z' + object: list + count: 2 + scanned_count: 2 + total_count: 2 + x-codeSamples: + - lang: Shell + source: > + curl -X GET + "https://api.lob.com/v1/qr_code_analytics?limit=2&scanned=true" \ + + -u : + /domains/{domain_id}: + parameters: + - in: path + name: domain_id + required: true + description: Unique identifier for a domain. + schema: + type: string + get: + operationId: domain_get + summary: Retrieve a domain + description: Retrieve details for a single domain. + tags: + - URL Shortener + responses: + '200': + description: Returns domain related details. + content: + application/json: + schema: + $ref: '#/components/schemas/domain_response' + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + x-codeSamples: + - lang: Shell + source: | + curl -X GET "https://api.lob.com/v1/domains/{domain_id}" \ + -u : + label: CURL + - lang: Typescript + source: | + try { + const domain = await new DomainsApi(config).get('xxxxxx'); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.domains.retrieve('xxxxxx', function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + domainsAPI = DomainsApi.new(config) + + begin + retrievedDomain = domainsAPI.get("xxxxxx") + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = DomainsApi(api_client) + + try: + domain = api.get("xxxxxx") + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\DomainsApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->get("xxxxxx"); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + DomainsApi apiInstance = new DomainsApi(config); + + try { + Domain response = apiInstance.get("xxxxxx"); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Domain.retrieve("xxxxxx") + label: ELIXIR + - lang: CSharp + source: | + DomainsApi api = new DomainsApi(config); + + try { + Domain response = api.get("xxxxxx"); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + fetchedDomain, _, err := + apiClient.DomainsApi.Get(context,"xxxxxx").Execute() + + + if err != nil { + return err + } + label: GO + delete: + operationId: domain_delete + summary: Delete a Domain + description: >- + Delete a registered domain. This operation can only be performed if all + associated links with the domain are deleted. + tags: + - URL Shortener + responses: + '200': + description: Returns the deleted link object. + content: + application/json: + schema: + $ref: '#/components/schemas/domain_response' + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /domains: + post: + operationId: domain_create + summary: Create Domain + description: Add a new custom domain that can be used to create custom links. + tags: + - URL Shortener + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/domains' + examples: + basic: + value: + domain: lob.st + test: + value: + domain: lob.st + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/domains' + examples: + basic: + value: + domain: lob.st + test: + value: + domain: lob.st + multipart/form-data: + schema: + $ref: '#/components/schemas/domains' + examples: + basic: + value: + domain: lob.st + test: + value: + domain: lob.st + responses: + '200': + description: Returns a domain object with details. + content: + application/json: + schema: + $ref: '#/components/schemas/domain_response' + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + example: + error: + code: invalid + message: domain is required + status_code: 422 + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/domains \ + -u : \ + -d "domain=lob.st" + label: CURL + - lang: Typescript + source: | + const domainApi = await new DomainsApi(config); + const domainData: DomainsWritable = { + domain: 'lob.st' + } + try { + const createdDomain = await domainApi.createDomain(domainData); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.domains.create({ + domain: 'lob.st' + }, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + domainsAPI = DomainsApi.new(config) + + domainsData = DomainsWritable.new({ + domain: "lob.st" + }) + + begin + createdDomain = domainsAPI.create(domainsData) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = DomainsApi(api_client) + + domains_data = DomainsWritable( + domain: "lob.st" + ) + + try: + domain = api.create(domains_data) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\DomainsApi($config, new + GuzzleHttp\Client()); + + + $domainsData = new OpenAPI\Client\Model\DomainsWritable(array( + 'domain' => 'lob.st', + )); + + + try { + $result = $apiInstance->create($domainsData); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + DomainsWritable domain = new DomainsWritable(); + domain.setDomain("lob.st"); + + DomainsApi apiInstance = new DomainsApi(config); + + try { + apiInstance.create(domain); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Domain.create(%{ + domain: "lob.st" + }) + label: ELIXIR + - lang: CSharp + source: | + DomainsWritable domain = new DomainsWritable( + "lob.st" + ) + + DomainsApi api = new DomainsApi(config); + + try { + api.create(domain, null); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + get: + operationId: domain_list + summary: List all domains + description: Retrieve a list of all created domains. + tags: + - URL Shortener + responses: + '200': + description: Returns a list of all domains. + content: + application/json: + schema: + $ref: '#/components/schemas/domains_response' + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + x-codeSamples: + - lang: Shell + source: | + curl -X GET "https://api.lob.com/v1/domains?limit=2" \ + -u : + label: CURL + - lang: Typescript + source: | + try { + const domains = await new DomainsApi(config).list(2); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.domains.list({limit: 2}, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + domainsApi = DomainsApi.new(config) + + begin + domains = domainsApi.list({ limit: 2 }) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = DomainsApi(api_client) + + try: + domains = api.list(limit=2) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\DomainsApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->list( + 2, // limit + ); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + DomainsApi apiInstance = new DomainsApi(config); + + try { + DomainsList response = apiInstance.list( + 2, // limit + null, // before + null, // after + null, // include + null, // dateCreated + ); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Domains.list(%{limit: 2}) + label: ELIXIR + - lang: CSharp + source: | + DomainsApi api = new DomainsApi(config); + + try { + DomainsList response = api.list( + 2, // limit + null, // before + null, // after + null, // include + null, // dateCreated + ); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + DomainsList = apiClient.DomainsApi.List(context).Execute() + + if err != nil { + return err + } + label: GO + /domains/{domain_id}/links: + parameters: + - in: path + name: domain_id + required: true + description: Unique identifier for a domain. + schema: + type: string + delete: + operationId: domain_delete_links + summary: Delete all links for a domain + description: Delete all associated links for a domain + tags: + - URL Shortener + responses: + '200': + description: Returns the deleted objects. + content: + application/json: + schema: + $ref: '#/components/schemas/domains_response' + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /links: + get: + operationId: links_list + summary: Retrieve all shortened links + description: >- + Retrieves a list of shortened links. The list is sorted by creation + date, with the most recently created appearing first. + tags: + - URL Shortener + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/date_created' + - $ref: '#/components/parameters/metadata' + - in: query + name: campaign_id + description: >- + Filter the links generated for a particular campaign using its + campaign id. schema: - $ref: '#/components/schemas/self_mailer_deletion' - example: - id: sfm_123456789 - deleted: true - all_self_mailers: - description: A dictionary with a data property that contains an array of up to `limit` self_mailers. Each entry in the array is a separate self_mailer. The previous and next page of self_mailers can be retrieved by calling the endpoint contained in the `previous_url` and `next_url` fields in the API response respectively.
If no more self_mailers are available beyond the current set of returned results, the `next_url` field will be empty. - content: - application/json: + $ref: '#/components/schemas/cmp_id' + - in: query + name: clicked + description: Retrieve the list of links that have been opened. schema: - allOf: - - $ref: '#/components/schemas/list' - - type: object - properties: - data: - type: array - description: list of self_mailers - items: - $ref: '#/components/schemas/self_mailer' - example: - data: - - id: sfm_7239rhwqkrfaskas - description: April Campaign - metadata: {} - to: - id: adr_asdi2y3riuasasoi - description: Harry - Office - name: Harry Zhang - company: Lob - phone: '5555555555' - email: harry@lob.com - metadata: {} - address_line1: 370 WATER ST - address_line2: '' - address_city: SUMMERSIDE - address_state: PRINCE EDWARD ISLAND - address_zip: C1N 1C4 - address_country: CANADA - recipient_moved: false - date_created: '2019-09-20T00:14:00.361Z' - date_modified: '2019-09-20T00:14:00.361Z' - object: address - from: - id: adr_210a8d4b0b76d77b - description: null - name: null - company: LOB - phone: null - email: null - address_line1: 210 KING ST STE 6100 - address_line2: null - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2018-12-08T03:01:07.651Z' - date_modified: '2018-12-08T03:01:07.651Z' - object: address - url: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf.pdf?version=v1&expires=1618781264&signature=YP_bCwrgVA2lz1Gr1YVCJN1f-WspUGsH0aJp2ihjfLXU7lDUV12_xRv4uPch0mfWeOOxEqpyP8hGpgvjmQKNAw - outside_template_id: tmpl_a3cb937f26d7eec - inside_template_id: tmpl_a3cb937f26d7eec - inside_template_version_id: vrsn_bfdf70893b00a85 - outside_template_version_id: vrsn_bfdf70893b00a85 - carrier: USPS - tracking_events: [] - thumbnails: - - small: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_small_1.png?version=v1&expires=1618781264&signature=A7q5HbRO53sUYYnwGlmP5mTS6ylLE7kS2mYhfcEOdexjyqG7UseK0MD26DppE4Q0aE4u2msDVMxd5ukjMerYCg - medium: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_medium_1.png?version=v1&expires=1618781264&signature=b9pynuawVpU_vrhnT_mTpksdE-FLF_ZjdIBOFR_ltIzEGlx-VKD4VvZrqP98lG2D8V7UKQ7SdRr2nUAk4LxvCg - large: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_large_1.png?version=v1&expires=1618781264&signature=g2jifhCselPqIj8au6lsbJMNFN8ZX3aM6GkLoAXiHBCS8X5mF9nhVbmO0odpnmwNlV1CWIp-MXVsZkC3NmxqBQ - - small: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_small_2.png?version=v1&expires=1618781264&signature=biJY4-ZbNNRydPYg3cZkq7wxjILbPBK_nIVyoyQsg5X5q4jlsa-2fzeMa48V9jprUetsC6WEuYvasHosRfG_DQ - medium: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_medium_2.png?version=v1&expires=1618781264&signature=xEAX7bURyc8fSphacuo5yb7iVIpT8Xvq05KgMaNQS4r3aCpx0z1p42wbPmW758B5Ae0li1YDYvVyzS7qJIoWAw - large: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_large_2.png?version=v1&expires=1618781264&signature=NieHDnoQ7STZUvofHrFt7S987CzIkUJWpaSgpVQPZw-C3_wwTPsIrvxYdXEuFrr6ciTUcxRBFPlE0lurmMkyCA - merge_variables: - name: null - size: 6x18_bifold - mail_type: usps_first_class - expected_delivery_date: '2021-03-24' - date_created: '2021-03-16T18:40:40.504Z' - date_modified: '2021-03-16T18:41:06.691Z' - send_date: '2021-03-16T18:45:40.493Z' - deleted: true - use_type: marketing - fsc: false - object: self_mailer - - id: sfm_8ffbe811dea49dcf + type: boolean + - in: query + name: billing_group_id + description: Filter the links generated for a particular billing group id. + schema: + $ref: '#/components/schemas/billing_group_id' + responses: + '200': + description: Returns the deleted link object. + content: + application/json: + schema: + $ref: '#/components/schemas/links_response' + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + x-codeSamples: + - lang: Shell + source: | + curl -X GET "https://api.lob.com/v1/links/?limit=2" \ + -u : + label: CURL + - lang: Typescript + source: | + try { + const links = await new LinksApi(config).list(2); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.links.list({limit: 2}, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + linksApi = LinksApi.new(config) + + begin + links = linksApi.list({ limit: 2 }) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = LinksApi(api_client) + + try: + links = api.list(limit=2) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\LinksApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->list( + 2, // limit + ); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + LinksApi apiInstance = new LinksApi(config); + + try { + LinksList response = apiInstance.list( + 2, // limit + null, // before + null, // after + null, // include + null, // dateCreated + ); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.Links.list(%{limit: 2}) + label: ELIXIR + - lang: CSharp + source: | + LinksApi api = new LinksApi(config); + + try { + LinksList response = api.list( + 2, // limit + null, // before + null, // after + null, // include + null, // dateCreated + ); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + LinksList = apiClient.LinksApi.List(context).Execute() + + if err != nil { + return err + } + label: GO + /links/{link_id}: + parameters: + - in: path + name: link_id + required: true + description: Unique identifier for a link. + schema: + type: string + get: + operationId: links_get + summary: Retrieve a link + description: Retrievs a single shortened link. + tags: + - URL Shortener + responses: + '200': + description: Returns a single link. + content: + application/json: + schema: + $ref: '#/components/schemas/link_response' + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + x-codeSamples: + - lang: Shell + source: | + curl -X GET "https://api.lob.com/v1/links/" \ + -u : + label: CURL + patch: + operationId: link_update + summary: Update a Link + description: Update any of the properties of a shortened link. + tags: + - URL Shortener + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/link_single' + examples: + basic: + value: + resource_id: ltr_133 + test: + value: + redirect_link: ltr_133 + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/link_single' + examples: + basic: + value: + resource_id: ltr_133 + test: + value: + resource_id: ltr_133 + multipart/form-data: + schema: + $ref: '#/components/schemas/link_single' + examples: + basic: + value: + resource_id: ltr_133 + test: + value: + resource_id: ltr_133 + responses: + '200': + description: Returns the updated link. + content: + application/json: + schema: + $ref: '#/components/schemas/link_response' + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + example: + error: + code: invalid + message: redirect_link is required + status_code: 422 + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/links/ \ + -u : \ + -d "redirect_link=https://www.lob.com" + label: CURL + delete: + operationId: links_delete + summary: Delete Link + description: Delete the shortened link. + tags: + - URL Shortener + responses: + '200': + description: Returns the deleted short link object + content: + application/json: + schema: + $ref: '#/components/schemas/link_response' + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /links/shorten: + post: + operationId: link_create + summary: Create Link + description: >- + Given a long URL, shorten your URL either by using a custom domain or + Lob's own short domain. + tags: + - URL Shortener + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/link_single' + examples: + basic: + value: + redirect_link: https://www.lob.com + slug: a1b2c3 + test: + value: + redirect_link: https://www.lob.com + slug: a1b2c3 + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/link_single' + examples: + basic: + value: + redirect_link: https://www.lob.com + domain: lob.st + test: + value: + redirect_link: https://www.lob.com + domain: lob.st + multipart/form-data: + schema: + $ref: '#/components/schemas/link_single' + examples: + basic: + value: + redirect_link: https://www.lob.com + test: + value: + redirect_link: https://www.lob.com + responses: + '200': + description: Returns a successfully created link. + content: + application/json: + schema: + $ref: '#/components/schemas/link_response' + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + example: + error: + code: invalid + message: redirect_link is required + status_code: 422 + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/links/shorten \ + -u : \ + -d "redirect_link=https://www.lob.com" + label: CURL + /links/shorten/bulk: + post: + operationId: link_bulk_create + summary: Bulk Create Links + description: Shortens a list of links in a single request. + tags: + - URL Shortener + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/link_list' + example: + links: + - redirect_link: https://www.lob.com + slug: a1b2c3 + - redirect_link: https://www.lob.com + slug: a1b2c3 + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/link_list' + example: + links: + - redirect_link: https://www.lob.com + slug: a1b2c3 + - redirect_link: https://www.lob.com + slug: a1b2c3 + multipart/form-data: + schema: + $ref: '#/components/schemas/link_list' + example: + links: + - redirect_link: https://www.lob.com + slug: a1b2c3 + - redirect_link: https://www.lob.com + slug: a1b2c3 + responses: + '200': + description: Returns all successfully created links + content: + application/json: + schema: + $ref: '#/components/schemas/links_response' + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + example: + error: + code: invalid + message: redirect_link is required + status_code: 422 + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/links/shorten/bulk \ + -u : \ + --header 'Content-Type: application/x-www-form-urlencoded' \ + --data-urlencode 'links[0][redirect_link]=https://www.lob.com' + label: CURL + /self_mailers/{sfm_id}: + parameters: + - in: path + name: sfm_id + description: id of the self_mailer + required: true + schema: + $ref: '#/components/schemas/sfm_id' + get: + operationId: self_mailer_retrieve + summary: Retrieve + description: >- + Retrieves the details of an existing self_mailer. You need only supply + the unique self_mailer identifier that was returned upon self_mailer + creation. + tags: + - Self Mailers + responses: + '200': + description: Returns a self_mailer object + content: + application/json: + schema: + $ref: '#/components/schemas/self_mailer' + example: + id: sfm_8ffbe811dea49dcf description: April Campaign metadata: {} to: - id: adr_f9228b743884ff98 + id: adr_bae820679f3f536b description: null - name: AYA + name: HARRY ZHANG company: null phone: null email: null - address_line1: 2812 PARK RD + address_line1: 210 KING ST STE 6100 address_line2: null - address_city: CHARLOTTE - address_state: NC - address_zip: 28209-1314 + address_city: SAN FRANCISCO + address_state: CA + address_zip: 94107-1741 address_country: UNITED STATES metadata: {} - date_created: '2021-03-16T18:40:40.410Z' - date_modified: '2021-03-16T18:40:40.410Z' + date_created: '2017-09-05T17:47:53.767Z' + date_modified: '2017-09-05T17:47:53.767Z' deleted: true object: address from: id: adr_210a8d4b0b76d77b description: null - name: null - company: LOB + name: LEORE AVIDAR + company: null phone: null email: null address_line1: 210 KING ST STE 6100 @@ -22786,10 +22994,12 @@ components: address_zip: 94107-1741 address_country: UNITED STATES metadata: {} - date_created: '2018-12-08T03:01:07.651Z' - date_modified: '2018-12-08T03:01:07.651Z' + date_created: '2017-09-05T17:47:53.767Z' + date_modified: '2017-09-05T17:47:53.767Z' + deleted: true object: address - url: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf.pdf?version=v1&expires=1618781264&signature=YP_bCwrgVA2lz1Gr1YVCJN1f-WspUGsH0aJp2ihjfLXU7lDUV12_xRv4uPch0mfWeOOxEqpyP8hGpgvjmQKNAw + url: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf.pdf?version=v1&expires=1618512040&signature=qvyCqXI1ndBvc4AjvG8FlirqLXEcfmYo4sDrRtabaXMOsX88to9G3K49uIk_aqevvZXe8HoRYD_nWydbQHqaCA outside_template_id: tmpl_a3cb937f26d7eec inside_template_id: tmpl_a3cb937f26d7eec inside_template_version_id: vrsn_bfdf70893b00a85 @@ -22797,937 +23007,4389 @@ components: carrier: USPS tracking_events: [] thumbnails: - - small: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_small_1.png?version=v1&expires=1618781264&signature=A7q5HbRO53sUYYnwGlmP5mTS6ylLE7kS2mYhfcEOdexjyqG7UseK0MD26DppE4Q0aE4u2msDVMxd5ukjMerYCg - medium: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_medium_1.png?version=v1&expires=1618781264&signature=b9pynuawVpU_vrhnT_mTpksdE-FLF_ZjdIBOFR_ltIzEGlx-VKD4VvZrqP98lG2D8V7UKQ7SdRr2nUAk4LxvCg - large: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_large_1.png?version=v1&expires=1618781264&signature=g2jifhCselPqIj8au6lsbJMNFN8ZX3aM6GkLoAXiHBCS8X5mF9nhVbmO0odpnmwNlV1CWIp-MXVsZkC3NmxqBQ - - small: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_small_2.png?version=v1&expires=1618781264&signature=biJY4-ZbNNRydPYg3cZkq7wxjILbPBK_nIVyoyQsg5X5q4jlsa-2fzeMa48V9jprUetsC6WEuYvasHosRfG_DQ - medium: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_medium_2.png?version=v1&expires=1618781264&signature=xEAX7bURyc8fSphacuo5yb7iVIpT8Xvq05KgMaNQS4r3aCpx0z1p42wbPmW758B5Ae0li1YDYvVyzS7qJIoWAw - large: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_large_2.png?version=v1&expires=1618781264&signature=NieHDnoQ7STZUvofHrFt7S987CzIkUJWpaSgpVQPZw-C3_wwTPsIrvxYdXEuFrr6ciTUcxRBFPlE0lurmMkyCA + - small: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_small_1.png?version=v1&expires=1618512040&signature=-bipeUHP-hAMcCBSrWM0ZH1VwRdSPNVGGZN9hAZKr6Lh4ly6uxvratVd5LXJCK_zOEMYk_mTWASt0ge7OY6SDA + medium: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_medium_1.png?version=v1&expires=1618512040&signature=ryxN7bsXGtw_GRFSP3Cs3A3IYjxZi3cW9BHDCNgMt6p3nobVmsc_iFHt2e-S7ndAXhhN7nP-MQVov3bt3r37BQ + large: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_large_1.png?version=v1&expires=1618512040&signature=kBrm00xkyCkJNJRHxH8HshFaebtOxnzjVWOs1VVmGMuw8H6OBNcMAMxt9s49K0jlpHoh3Nr9uSncEZMQaaNjAg + - small: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_small_2.png?version=v1&expires=1618512040&signature=3gTgU7Fd3KoT_vNlQnTGptRps5ZgnkhSnPrAwk7L98higIzSwfKoLvuu_DIpMM48dHbxckKT9waR8euJ4KSDBQ + medium: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_medium_2.png?version=v1&expires=1618512040&signature=Ue1lw5CMj7KRx6cMQL8xPeazaHCdJzWcACd1w3acuYPnWkVIpSt62OIO7hAtpAQK9xm1dhhlFj0rqRZMdRMMBA + large: >- + https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_large_2.png?version=v1&expires=1618512040&signature=cICc7HEm1xG_eyM4a_wtvPk2FqoLRmtgGa29kJisWnMIYBL0OkyzG4ZCYGMhp-5cZpJlSpXfTgGKh_Qmeo1TDw merge_variables: name: null size: 6x18_bifold mail_type: usps_first_class expected_delivery_date: '2021-03-24' date_created: '2021-03-16T18:40:40.504Z' - date_modified: '2021-03-16T18:41:06.691Z' + date_modified: '2021-03-16T18:40:40.504Z' send_date: '2021-03-16T18:45:40.493Z' - deleted: true use_type: marketing - fsc: true + fsc: false object: self_mailer - object: list - next_url: null - previous_url: null - count: 2 - post_self_mailer: - description: Returns a self_mailer object - headers: - ratelimit-limit: - $ref: '#/components/headers/ratelimit-limit' - ratelimit-remaining: - $ref: '#/components/headers/ratelimit-remaining' - ratelimit-reset: - $ref: '#/components/headers/ratelimit-reset' - content: - application/json: - schema: - $ref: '#/components/schemas/self_mailer' - example: - id: sfm_8ffbe811dea49dcf - description: April Campaign - metadata: {} - to: - id: adr_bae820679f3f536b - description: null - name: HARRY ZHANG - company: null - phone: null - email: null - address_line1: 210 KING ST STE 6100 - address_line2: null - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2017-09-05T17:47:53.767Z' - date_modified: '2017-09-05T17:47:53.767Z' - deleted: true - object: address - from: - id: adr_210a8d4b0b76d77b - description: null - name: LEORE AVIDAR - company: null - phone: null - email: null - address_line1: 210 KING ST STE 6100 - address_line2: null - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2017-09-05T17:47:53.767Z' - date_modified: '2017-09-05T17:47:53.767Z' - deleted: true - object: address - url: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf.pdf?version=v1&expires=1618512040&signature=qvyCqXI1ndBvc4AjvG8FlirqLXEcfmYo4sDrRtabaXMOsX88to9G3K49uIk_aqevvZXe8HoRYD_nWydbQHqaCA - outside_template_id: tmpl_a3cb937f26d7eec - inside_template_id: tmpl_a3cb937f26d7eec - inside_template_version_id: vrsn_bfdf70893b00a85 - outside_template_version_id: vrsn_bfdf70893b00a85 - carrier: USPS - tracking_events: [] - thumbnails: - - small: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_small_1.png?version=v1&expires=1618512040&signature=-bipeUHP-hAMcCBSrWM0ZH1VwRdSPNVGGZN9hAZKr6Lh4ly6uxvratVd5LXJCK_zOEMYk_mTWASt0ge7OY6SDA - medium: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_medium_1.png?version=v1&expires=1618512040&signature=ryxN7bsXGtw_GRFSP3Cs3A3IYjxZi3cW9BHDCNgMt6p3nobVmsc_iFHt2e-S7ndAXhhN7nP-MQVov3bt3r37BQ - large: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_large_1.png?version=v1&expires=1618512040&signature=kBrm00xkyCkJNJRHxH8HshFaebtOxnzjVWOs1VVmGMuw8H6OBNcMAMxt9s49K0jlpHoh3Nr9uSncEZMQaaNjAg - - small: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_small_2.png?version=v1&expires=1618512040&signature=3gTgU7Fd3KoT_vNlQnTGptRps5ZgnkhSnPrAwk7L98higIzSwfKoLvuu_DIpMM48dHbxckKT9waR8euJ4KSDBQ - medium: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_medium_2.png?version=v1&expires=1618512040&signature=Ue1lw5CMj7KRx6cMQL8xPeazaHCdJzWcACd1w3acuYPnWkVIpSt62OIO7hAtpAQK9xm1dhhlFj0rqRZMdRMMBA - large: https://lob-assets.com/self-mailers/sfm_8ffbe811dea49dcf_thumb_large_2.png?version=v1&expires=1618512040&signature=cICc7HEm1xG_eyM4a_wtvPk2FqoLRmtgGa29kJisWnMIYBL0OkyzG4ZCYGMhp-5cZpJlSpXfTgGKh_Qmeo1TDw - merge_variables: - name: null - size: 6x18_bifold - mail_type: usps_first_class - expected_delivery_date: '2021-03-24' - date_created: '2021-03-16T18:40:40.504Z' - date_modified: '2021-03-16T18:40:40.504Z' - send_date: '2021-03-16T18:45:40.493Z' - use_type: marketing - fsc: false - object: self_mailer - post_snap_pack: - description: Returns a snap_pack object - headers: - ratelimit-limit: - $ref: '#/components/headers/ratelimit-limit' - ratelimit-remaining: - $ref: '#/components/headers/ratelimit-remaining' - ratelimit-reset: - $ref: '#/components/headers/ratelimit-reset' - content: - application/json: - schema: - $ref: '#/components/schemas/snap_pack' - example: - id: ord_0d6a16a3fff6318ac8f8008dc1 - description: April Campaign - to: - id: adr_bae820679f3f536b - description: null - name: HARRY ZHANG - company: null - phone: null - email: null - address_line1: 210 KING ST STE 6100 - address_line2: null - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2017-09-05T17:47:53.767Z' - date_modified: '2017-09-05T17:47:53.767Z' - deleted: true - object: address - from: - id: adr_210a8d4b0b76d77b - description: null - name: LEORE AVIDAR - company: null - phone: null - email: null - address_line1: 210 KING ST STE 6100 - address_line2: null - address_city: SAN FRANCISCO - address_state: CA - address_zip: 94107-1741 - address_country: UNITED STATES - metadata: {} - date_created: '2017-09-05T17:47:53.767Z' - date_modified: '2017-09-05T17:47:53.767Z' - deleted: true - object: address - url: https://lob-assets.com/order-creatives/ord_0d6a16a3fff6318ac8f8008dc1_comp_a20fd48ba4efda76ee827400d.pdf?version=v1&expires=1618512040&signature=qvyCqXI1ndBvc4AjvG8FlirqLXEcfmYo4sDrRtabaXMOsX88to9G3K49uIk_aqevvZXe8HoRYD_nWydbQHqaCA - outside_template_id: tmpl_a3cb937f26d7eec - inside_template_id: tmpl_a3cb937f26d7eec - inside_template_version_id: vrsn_bfdf70893b00a85 - outside_template_version_id: vrsn_bfdf70893b00a85 - carrier: USPS - tracking_events: [] - thumbnails: - - small: https://lob-assets.com/order-creatives/ord_0d6a16a3fff6318ac8f8008dc1_comp_a20fd48ba4efda76ee827400d_thumb_small_1.png?version=v1&expires=1618512040&signature=-bipeUHP-hAMcCBSrWM0ZH1VwRdSPNVGGZN9hAZKr6Lh4ly6uxvratVd5LXJCK_zOEMYk_mTWASt0ge7OY6SDA - medium: https://lob-assets.com/order-creatives/ord_0d6a16a3fff6318ac8f8008dc1_comp_a20fd48ba4efda76ee827400d_thumb_medium_1.png?version=v1&expires=1618512040&signature=ryxN7bsXGtw_GRFSP3Cs3A3IYjxZi3cW9BHDCNgMt6p3nobVmsc_iFHt2e-S7ndAXhhN7nP-MQVov3bt3r37BQ - large: https://lob-assets.com/order-creatives/ord_0d6a16a3fff6318ac8f8008dc1_comp_a20fd48ba4efda76ee827400d_thumb_large_1.png?version=v1&expires=1618512040&signature=kBrm00xkyCkJNJRHxH8HshFaebtOxnzjVWOs1VVmGMuw8H6OBNcMAMxt9s49K0jlpHoh3Nr9uSncEZMQaaNjAg - - small: https://lob-assets.com/order-creatives/ord_0d6a16a3fff6318ac8f8008dc1_comp_a20fd48ba4efda76ee827400d_thumb_small_2.png?version=v1&expires=1618512040&signature=3gTgU7Fd3KoT_vNlQnTGptRps5ZgnkhSnPrAwk7L98higIzSwfKoLvuu_DIpMM48dHbxckKT9waR8euJ4KSDBQ - medium: https://lob-assets.com/order-creatives/ord_0d6a16a3fff6318ac8f8008dc1_comp_a20fd48ba4efda76ee827400d_thumb_medium_2.png?version=v1&expires=1618512040&signature=Ue1lw5CMj7KRx6cMQL8xPeazaHCdJzWcACd1w3acuYPnWkVIpSt62OIO7hAtpAQK9xm1dhhlFj0rqRZMdRMMBA - large: https://lob-assets.com/order-creatives/ord_0d6a16a3fff6318ac8f8008dc1_comp_a20fd48ba4efda76ee827400d_thumb_large_2.png?version=v1&expires=1618512040&signature=cICc7HEm1xG_eyM4a_wtvPk2FqoLRmtgGa29kJisWnMIYBL0OkyzG4ZCYGMhp-5cZpJlSpXfTgGKh_Qmeo1TDw - merge_variables: - name: null - size: 8.5x11 - mail_type: usps_first_class - expected_delivery_date: '2021-03-24' - date_created: '2021-03-16T18:40:40.504Z' - date_modified: '2021-03-16T18:40:40.504Z' - send_date: '2021-03-16T18:45:40.493Z' - use_type: marketing - fsc: false - color: false - object: snap_pack - template_error: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - example: - error: - code: invalid - message: html is required - status_code: 422 - post_template_version: - description: Returns the template version with the given template and version ids. - headers: - ratelimit-limit: - $ref: '#/components/headers/ratelimit-limit' - ratelimit-remaining: - $ref: '#/components/headers/ratelimit-remaining' - ratelimit-reset: - $ref: '#/components/headers/ratelimit-reset' - content: - application/json: - schema: - $ref: '#/components/schemas/template_version' - example: - id: vrsn_534e339882d2282 - description: Second Version - html: Second HTML for {{name}} - date_created: '2017-11-09T04:49:38.016Z' - date_modified: '2017-11-09T04:49:38.016Z' - object: version - template_version_deleted: - description: Deleted - content: - application/json: - schema: - $ref: '#/components/schemas/template_version_deletion' - example: - value: - id: vrsn_123456789 - deleted: true - all_template_versions: - description: A dictionary with a data property that contains an array of up to `limit` template versions. Each entry in the array is a separate template version object. The previous and next page of template versions can be retrieved by calling the endpoint contained in the `previous_url` and `next_url` fields in the API response respectively.
If no more template versions are available beyond the current set of returned results, the `next_url` field will be empty. - content: - application/json: + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: > + curl -X GET + "https://api.lob.com/v1/self_mailers/sfm_8ffbe811dea49dcf" \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: typescript + source: | + try { + const selfMailer = await new SelfMailersApi(config).get('sfm_xxxx'); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: > + Lob.selfMailers.retrieve('sfm_8ffbe811dea49dcf', function (err, res) + { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + selfMailerApi = SelfMailersApi.new(config) + + begin + retrievedSelfMailer = selfMailerApi.get("sfm_8ffbe811dea49dcf") + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = SelfMailersApi(api_client) + + try: + self_mailer = api.get("sfm_8ffbe811dea49dcf") + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\SelfMailersApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->get("sfm_8ffbe811dea49dcf"); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + SelfMailersApi apiInstance = new SelfMailersApi(config); + + try { + SelfMailer response = apiInstance.get("sfm_8ffbe811dea49dcf"); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.SelfMailer.find("sfm_8ffbe811dea49dcf") + label: ELIXIR + - lang: CSharp + source: | + SelfMailersApi api = new SelfMailersApi(config); + + try { + SelfMailer response = api.get("sfm_8ffbe811dea49dcf"); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + fetchedSelfMailer, _, err := + apiClient.SelfMailersApi.Get(context,"sfm_8ffbe811dea49dcf").Execute() + + + if err != nil { + return err + } + label: GO + delete: + operationId: self_mailer_delete + summary: Delete + description: >- + Completely removes a self mailer from production. This can only be done + if the self mailer's `send_date` has not yet passed. If the self mailer + is successfully canceled, you will not be charged for it. This feature + is exclusive to certain customers. Upgrade to the appropriate Print & Mail Edition to gain access. + tags: + - Self Mailers + responses: + '200': + $ref: '#/components/responses/self_mailer_deleted' + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: > + curl -X DELETE + https://api.lob.com/v1/self_mailers/sfm_8ffbe811dea49dcf \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: typescript + source: | + try { + const deleteSelfMailer = await new SelfMailersApi(config).delete('sfm_xxxx'); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.selfMailers.delete('sfm_8ffbe811dea49dcf', function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + selfMailerApi = SelfMailersApi.new(config) + + begin + deletedSelfMailer = selfMailerApi.delete("sfm_8ffbe811dea49dcf") + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = SelfMailersApi(api_client) + + try: + deleted_resource = api.delete("sfm_8ffbe811dea49dcf") + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\SelfMailersApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->delete("sfm_8ffbe811dea49dcf"); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + SelfMailersApi apiInstance = new SelfMailersApi(config); + + try { + SelfMailerDeletion response = apiInstance.delete("sfm_8ffbe811dea49dcf"); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.SelfMailer.destroy("sfm_8ffbe811dea49dcf") + label: ELIXIR + - lang: CSharp + source: | + SelfMailersApi api = new SelfMailersApi(config); + + try { + SelfMailerDeletion response = api.delete("sfm_8ffbe811dea49dcf"); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + deletedSelfMailer, _, err := + apiClient.SelfMailersApi.Delete(context, + "sfm_8ffbe811dea49dcf").Execute() + + + if err != nil { + return err + } + label: GO + /self_mailers: + get: + operationId: self_mailers_list + summary: List + description: >- + Returns a list of your self_mailers. The self_mailers are returned + sorted by creation date, with the most recently created self_mailers + appearing first. + tags: + - Self Mailers + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/before_after' + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/date_created' + - $ref: '#/components/parameters/metadata' + - in: query + name: size + description: The self mailer sizes to be returned. schema: - allOf: - - $ref: '#/components/schemas/list' - - type: object - properties: - data: - type: array - description: list of template versions - items: - $ref: '#/components/schemas/template_version' - example: - data: - - id: vrsn_4d6ff5d868bf630 + type: array + items: + $ref: '#/components/schemas/self_mailer_size' + - $ref: '#/components/parameters/scheduled' + - $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_self_mailers' + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: | + curl -X GET "https://api.lob.com/v1/self_mailers?limit=2" \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: typescript + source: | + try { + const selfMailers = await new selfMailersApi(config).list(2); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.selfMailers.list({limit: 2}, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + selfMailersApi = SelfMailersApi.new(config) + + begin + selfMailers = selfMailersApi.list({ limit: 2 }) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = SelfMailersApi(api_client) + + try: + self_mailers = api.list(limit=2) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\SelfMailersApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->list( + 2, // limit + ); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + SelfMailersApi apiInstance = new SelfMailersApi(config); + + try { + SelfMailerList response = apiInstance.list( + 2, // limit + null, // before + null, // after + null, // include + null, // dateCreated + null, // metadata + null, // size + null, // scheduled + null, // sendDate + null, // mailType + null // sortBy + ); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.SelfMailer.list(%{limit: 2}) + label: ELIXIR + - lang: CSharp + source: > + SelfMailersApi api = new SelfMailersApi(config); + + + List includeList = new List(); + + includeList.Add("total_count"); + + Dictionary metadata = new Dictionary(); + + metadata.Add("name", "Harry"); + + Dictionary dateCreated = new Dictionary(); + + DateTime dateCreatedDate = DateTime.Today.AddMonths(-1); + + dateCreated.Add("lt", dateCreatedDate); + + Dictionary sendDate = new Dictionary(); + + sendDate.Add("lt", + DateTime.Now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz")); + + SortBy3 sortBy = new SortBy3(SortBy3.DateCreatedEnum.Asc); + + + try { + SelfMailerList response = api.list( + 2, // limit + null, // before + null, // after + includeList, // include + dateCreated, // dateCreated + metadata, // metadata + null, // size + true, // scheduled + sendDate, // sendDate + MailType.FirstClass, // mailType + sortBy // sortBy + ); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + SelfMailerList = apiClient.SelfMailersApi.List(context).Execute() + + if err != nil { + return err + } + label: GO + post: + operationId: self_mailer_create + summary: Create + description: Creates a new self_mailer given information + tags: + - Self Mailers + parameters: + - $ref: '#/components/parameters/idem-header' + - $ref: '#/components/parameters/idem-query' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/self_mailer_editable' + example: + description: Demo Self Mailer job + to: adr_bae820679f3f536b + from: adr_210a8d4b0b76d77b + inside: https://lob.com/selfmailerinside.pdf + outside: https://lob.com/selfmaileroutside.pdf + size: 12x9_bifold + metadata: + spiffy: 'true' + mail_type: usps_standard + merge_variables: + name: Harry + send_date: '2017-11-01T00:00:00.000Z' + use_type: marketing + qr_code: + position: relative + redirect_url: https://www.lob.com + width: '2.5' + top: '2.5' + right: '2.5' + pages: inside,outside + fsc: true + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/self_mailer_editable' + example: + description: Demo Self Mailer job + to: adr_bae820679f3f536b + from: adr_210a8d4b0b76d77b + inside: https://lob.com/selfmailerinside.pdf + outside: https://lob.com/selfmaileroutside.pdf + size: 12x9_bifold + metadata: + spiffy: 'true' + mail_type: usps_standard + merge_variables: + name: Harry + send_date: '2017-11-01T00:00:00.000Z' + use_type: marketing + qr_code: + position: relative + redirect_url: https://www.lob.com + width: '2.5' + top: '2.5' + right: '2.5' + pages: inside,outside + fsc: true + encoding: + merge_variables: + style: deepObject + explode: true + metadata: + style: deepObject + explode: true + multipart/form-data: + schema: + $ref: '#/components/schemas/self_mailer_editable' + example: + description: Demo Self Mailer job + to: adr_bae820679f3f536b + from: adr_210a8d4b0b76d77b + inside: https://lob.com/selfmailerinside.pdf + outside: https://lob.com/selfmaileroutside.pdf + size: 12x9_bifold + metadata: + spiffy: 'true' + mail_type: usps_standard + merge_variables: + name: Harry + send_date: '2017-11-01T00:00:00.000Z' + use_type: marketing + qr_code: + position: relative + redirect_url: https://www.lob.com + width: '2.5' + top: '2.5' + right: '2.5' + pages: inside,outside + fsc: true + responses: + '200': + $ref: '#/components/responses/post_self_mailer' + default: + $ref: '#/components/responses/mailpiece_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/self_mailers \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ + -d "description=Demo Self Mailer job" \ + -d "to[name]=Harry Zhang" \ + -d "to[address_line1]=210 King St" \ + -d "to[address_city]=San Francisco" \ + -d "to[address_state]=CA" \ + -d "to[address_zip]=94107" \ + -d "from=adr_210a8d4b0b76d77b" \ + -d "use_type=marketing" \ + -d 'qr_code[position]=relative' \ + -d 'qr_code[redirect_url]=https://www.lob.com' \ + -d 'qr_code[width]=2.5' \ + -d 'qr_code[bottom]=2.5' \ + -d 'qr_code[left]=2.5' \ + -d 'qr_code[pages]=inside,outside' + --data-urlencode "inside=Inside HTML for {{name}}" \ + --data-urlencode "outside=Outside HTML for {{name}}" \ + -d "merge_variables[name]=Harry" \ + -d 'fsc=true' + label: CURL + - lang: Typescript + source: | + const selfMailerCreate = new SelfMailerEditable({ + to: { + name: 'Harry Zhang', + address_line1: '210 King St', + address_line2: '# 6100', + address_city: 'San Francisco', + address_state: 'CA', + address_zip: '94107', + }, + from: 'adr_xxxx', + inside: + 'https://s3.us-west-2.amazonaws.com/public.lob.com/assets/templates/self_mailers/6x18_sfm_inside.pdf', + outside: + 'https://s3.us-west-2.amazonaws.com/public.lob.com/assets/templates/self_mailers/6x18_sfm_outside.pdf', + use_type: 'marketing' + qr_code : { + position: 'relative', + redirect_url: 'https://www.lob.com', + width: '2.5', + bottom: '2.5', + left: '2.5', + pages: 'inside' + }, + fsc: true + }); + + try { + const mySelfMailer = await new SelfMailersApi(config).create(selfMailerCreate); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.selfMailers.create({ + description: 'Demo Self Mailer job', + to: { + name: 'Harry Zhang', + address_line1: '210 King St', + address_city: 'San Francisco', + address_state: 'CA', + address_zip: '94107' + }, + from: 'adr_210a8d4b0b76d77b', + inside: 'Inside HTML for {{name}}', + outside: 'Outside HTML for {{name}}', + merge_variables: { + name: 'Harry' + }, + use_type: 'marketing' + qr_code : { + position: 'relative', + redirect_url: 'https://www.lob.com', + width: '2.5', + bottom: '2.5', + left: '2.5', + pages: 'inside' + }, + fsc: true + }, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + selfMailerCreate = SelfMailerEditable.new({ + description: "Demo Self Mailer job", + from: "adr_210a8d4b0b76d77b", + inside: "Inside HTML for {{name}}", + outside: "Outside HTML for {{name}}", + to: AddressEditable.new({ + name: "Harry Zhang", + address_line1: "210 King St", + address_line2: "# 6100", + address_city: "San Francisco", + address_state: "CA", + address_zip: "94107", + }), + merge_variables: { + name: "Harry" + }, + use_type: 'marketing' + qr_code : { + position: 'relative', + redirect_url: 'https://www.lob.com', + width: '2.5', + bottom: '2.5', + left: '2.5', + pages: 'inside' + }, + fsc: true + }); + + selfMailerApi = SelfMailersApi.new(config) + + begin + createdSelfMailer = selfMailerApi.create(selfMailerCreate) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + self_mailer_editable = SelfMailerEditable( + description = "Demo Self Mailer job", + _from = "adr_210a8d4b0b76d77b", + inside = "Inside HTML for {{name}}", + outside = "Outside HTML for {{name}}", + to = AddressEditable( + name = "Harry Zhang", + address_line1 = "210 King St", + address_line2 = "# 6100", + address_city = "San Francisco", + address_state = "CA", + address_zip = "94107", + ), + merge_variables = MergeVariables( + name = "Harry", + ), + use_type = "marketing" + qr_code = { + position: "relative", + redirect_url: "https://www.lob.com", + width: "2.5", + bottom: "2.5", + left: "2.5", + pages: "inside" + }, + fsc = true + ) + + with ApiClient(configuration) as api_client: + api = SelfMailersApi(api_client) + + try: + created_self_mailer = api.create(self_mailer_editable) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $to = new OpenAPI\Client\Model\AddressEditable( + array( + "name" => "Harry Zhang", + "address_line1" => "210 King St", + "address_line2" => "# 6100", + "address_city" => "San Francisco", + "address_state" => "CA", + "address_zip" => "94107", + ) + ); + + + $merge_variables = new stdClass; + + $merge_variables->name = "Harry"; + + + $use_type = "marketing"; + + $fsc = true; + + + $qr_code = new OpenAPI\Client\Model\QRCode( + array( + "position" => "relative", + "redirect_url" => "https://www.lob.com", + "width" => "2", + "bottom" => "2", + "left" => "2", + "pages" => "inside,outside" + ) + ); + + + $apiInstance = new OpenAPI\Client\Api\SelfMailersApi($config, new + GuzzleHttp\Client()); + + $self_mailer_editable = new OpenAPI\Client\Model\SelfMailerEditable( + array( + "description" => "Demo Self Mailer job", + "from" => "adr_210a8d4b0b76d77b", + "inside" => "Inside HTML for {{name}}", + "outside" => "Outside HTML for {{name}}", + "to" => $to, + "merge_variables" => $merge_variables, + "use_type" => $use_type, + "qr_code" => $qr_code, + "fsc" => $fsc + ) + ); + + + try { + $result = $apiInstance->create($self_mailer_editable); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + Map merge_variables = new HashMap(); + merge_variables.put("name", "Harry"); + + SelfMailersApi apiInstance = new SelfMailersApi(config); + + AddressEditable to = new AddressEditable(); + to.setName("Harry Zhang"); + to.setAddressLine1("210 King St"); + to.setAddressLine2("# 6100"); + to.setAddressCity("San Francisco"); + to.setAddressState("CA"); + to.setAddressZip("94107"); + + QRCode qrCode = new QRCode(); + qrCode.setPosition("relative"); + qrCode.setRedirectUrl("https://www.lob.com"); + qrCode.setWidth("2"); + qrCode.setLeft("2"); + qrCode.setBottom("2"); + qrCode.setPages("outside"); + + try { + SelfMailerEditable selfMailerEditable = new SelfMailerEditable(); + selfMailerEditable.setDescription("Demo Self Mailer job"); + selfMailerEditable.setFrom("adr_210a8d4b0b76d77b"); + selfMailerEditable.setInside("Inside HTML for {{name}}"); + selfMailerEditable.setOutside("Outside HTML for {{name}}"); + selfMailerEditable.setTo(to); + selfMailerEditable.setMergeVariables(merge_variables); + selfMailerEditable.setUseType("marketing"); + selfMailerEditable.setQRCode(qrCode); + selfMailerEditable.setFsc(true); + + + SelfMailer result = apiInstance.create(selfMailerEditable, null); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.SelfMailer.create(%{ + description: "Demo Self Mailer job", + to: %{ + name: "Harry Zhang", + address_line1: "210 King St", + address_city: "San Francisco", + address_state: "CA", + address_zip: "94107" + }, + from: "adr_210a8d4b0b76d77b", + inside: "Inside HTML for {{name}}", + outside: "Outside HTML for {{name}}", + merge_variables: %{ + name: "Harry" + }, + use_type: "marketing" + qr_code: %{ + position: 'relative', + redirect_url: 'https://www.lob.com', + width: '2', + bottom: '2', + left: '2', + pages: 'inside,outside' + }, + fsc: true + }) + label: ELIXIR + - lang: CSharp + source: > + Dictionary mergeVariables = new Dictionary(); + + mergeVariables.Add("name", "Harry"); + + + SelfMailersApi api = new SelfMailersApi(config); + + + AddressEditable to = new AddressEditable( + "210 King St", // addressLine1 + "# 6100", // addressLine2 + "San Francisco", // addressCity + "CA", // addressState + "94107", // addressZip + default(CountryExtended), // addressCounty + null, // description + "Harry Zhang" // name + ); + + + QRCode qrCode = new QRCode( + "relative", //position, + "https://www.lob.com", //redirect_url + "2", //width + "2", //left + "2", //bottom + "inside", //pages + ); + + + Fsc fsc = new Fsc(true); + + + SelfMailerEditable selfMailerEditable = new SelfMailerEditable( + to.ToJson(), // to + "adr_249af768103d2810", // from + default(SelfMailerSize), // size + "Demo Self Mailer Job", // description + default(Dictionary), // metadata + default(MailType), // mailType + mergeVariables, // mergeVariables + default(DateTime), // sendDate + "Inside HTML for {{name}}", // inside + "Outside HTML for {{name}}", // outside + "marketing", // use_type + qrCode, + fsc + ); + + + try { + SelfMailer result = api.create(selfMailerEditable, null); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + var to = *lob.NewAddressEditable() + + to.SetAddressLine1("210 King St") + + to.SetAddressLine2("# 6100") + + to.SetAddressCity("San Francisco") + + to.SetAddressState("CA") + + to.SetAddressZip("94107") + + to.SetAddressCountry(lob.COUNTRYEXTENDED_US) + + to.SetDescription("") + + to.SetName("Harry Zhang") + + + var selfMailerCreate = *lob.NewSelfMailerEditable() + + selfMailerCreate.SetDescription("Demo Self Mailer job") + + selfMailerCreate.SetFrom("adr_210a8d4b0b76d77b") + + selfMailerCreate.SetInside("Inside HTML for {{name}}") + + selfMailerCreate.SetOutside("Outside HTML for {{name}}") + + selfMailerCreate.SetTo(to) + + selfMailerCreate.SetFsc(true) + + + + createdselfMailer, _, err := + apiClient.SelfMailersApi.Create(context).SelfMailerEditable(selfMailerCreate).Execute() + + + if err != nil { + return err + } + label: GO + /snap_packs: + 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 + 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 + 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 \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ + -d "description=Demo Snap Pack job" \ + -d "to[name]=Harry Zhang" \ + -d "to[address_line1]=210 King St" \ + -d "to[address_city]=San Francisco" \ + -d "to[address_state]=CA" \ + -d "to[address_zip]=94107" \ + -d "from=adr_210a8d4b0b76d77b" \ + -d "use_type=marketing" \ + --data-urlencode "inside=Inside HTML for {{name}}" \ + --data-urlencode "outside=Outside HTML for {{name}}" \ + -d "merge_variables[name]=Harry" \ + -d 'fsc=false' + label: CURL + - lang: Typescript + source: | + const snapPackCreate = new SnapPackEditable({ + to: { + name: 'Harry Zhang', + address_line1: '210 King St', + address_line2: '# 6100', + address_city: 'San Francisco', + address_state: 'CA', + address_zip: '94107', + }, + from: 'adr_xxxx', + inside: + 'https://s3.us-west-2.amazonaws.com/public.lob.com/assets/8.5x11_Snappack_template_address.pdf', + outside: + 'https://s3.us-west-2.amazonaws.com/public.lob.com/assets/8.5x11_Snappack_template_address.pdf', + use_type: 'marketing' + fsc: false + }); + + try { + const mySnapPack = await new SnapPacksApi(config).create(snapPackCreate); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.snapPacks.create({ + description: 'Demo Snap Packs job', + to: { + name: 'Harry Zhang', + address_line1: '210 King St', + address_city: 'San Francisco', + address_state: 'CA', + address_zip: '94107' + }, + from: 'adr_210a8d4b0b76d77b', + inside: 'Inside HTML for {{name}}', + outside: 'Outside HTML for {{name}}', + merge_variables: { + name: 'Harry' + }, + use_type: 'marketing' + fsc: false + }, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + snapPackCreate = SnapPackEditable.new({ + description: "Demo Snap Pack job", + from: "adr_210a8d4b0b76d77b", + inside: "Inside HTML for {{name}}", + outside: "Outside HTML for {{name}}", + to: AddressEditable.new({ + name: "Harry Zhang", + address_line1: "210 King St", + address_line2: "# 6100", + address_city: "San Francisco", + address_state: "CA", + address_zip: "94107", + }), + merge_variables: { + name: "Harry" + }, + use_type: 'marketing', + fsc: true + }); + + snapPackApi = SnapPacksApi.new(config) + + begin + createdSnapPack = snapPackApi.create(snapPackCreate) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + snap_pack_editable = SnapPackEditable( + description = "Demo Snap Pack job", + _from = "adr_210a8d4b0b76d77b", + inside = "Inside HTML for {{name}}", + outside = "Outside HTML for {{name}}", + to = AddressEditable( + name = "Harry Zhang", + address_line1 = "210 King St", + address_line2 = "# 6100", + address_city = "San Francisco", + address_state = "CA", + address_zip = "94107", + ), + merge_variables = MergeVariables( + name = "Harry", + ), + use_type = "marketing", + fsc = true + ) + + with ApiClient(configuration) as api_client: + api = SnapPacksApi(api_client) + + try: + created_snap_pack = api.create(snap_pack_editable) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $to = new OpenAPI\Client\Model\AddressEditable( + array( + "name" => "Harry Zhang", + "address_line1" => "210 King St", + "address_line2" => "# 6100", + "address_city" => "San Francisco", + "address_state" => "CA", + "address_zip" => "94107", + ) + ); + + + $merge_variables = new stdClass; + + $merge_variables->name = "Harry"; + + + $use_type = "marketing"; + + $fsc = true; + + + $apiInstance = new OpenAPI\Client\Api\SnapPacksApi($config, new + GuzzleHttp\Client()); + + $snap_pack_editable = new OpenAPI\Client\Model\SnapPackEditable( + array( + "description" => "Demo Snap Pack job", + "from" => "adr_210a8d4b0b76d77b", + "inside" => "Inside HTML for {{name}}", + "outside" => "Outside HTML for {{name}}", + "to" => $to, + "merge_variables" => $merge_variables, + "use_type" => $use_type, + "fsc" => $fsc + ) + ); + + + try { + $result = $apiInstance->create($snap_pack_editable); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + Map merge_variables = new HashMap(); + merge_variables.put("name", "Harry"); + + SnapPacksApi apiInstance = new SnapPacksApi(config); + + AddressEditable to = new AddressEditable(); + to.setName("Harry Zhang"); + to.setAddressLine1("210 King St"); + to.setAddressLine2("# 6100"); + to.setAddressCity("San Francisco"); + to.setAddressState("CA"); + to.setAddressZip("94107"); + + try { + SnapPackEditable SnapPackEditable = new SnapPackEditable(); + SnapPackEditable.setDescription("Demo Snap Pack job"); + SnapPackEditable.setFrom("adr_210a8d4b0b76d77b"); + SnapPackEditable.setInside("Inside HTML for {{name}}"); + SnapPackEditable.setOutside("Outside HTML for {{name}}"); + SnapPackEditable.setTo(to); + SnapPackEditable.setMergeVariables(merge_variables); + SnapPackEditable.setUseType("marketing"); + SnapPackEditable.setFsc(true); + + + SnapPack result = apiInstance.create(SnapPackEditable, null); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.SnapPack.create(%{ + description: "Demo Snap Pack job", + to: %{ + name: "Harry Zhang", + address_line1: "210 King St", + address_city: "San Francisco", + address_state: "CA", + address_zip: "94107" + }, + from: "adr_210a8d4b0b76d77b", + inside: "Inside HTML for {{name}}", + outside: "Outside HTML for {{name}}", + merge_variables: %{ + name: "Harry" + }, + use_type: "marketing", + fsc: true + }) + label: ELIXIR + - lang: CSharp + source: > + Dictionary mergeVariables = new Dictionary(); + + mergeVariables.Add("name", "Harry"); + + + SnapPacksApi api = new SnapPacksApi(config); + + + AddressEditable to = new AddressEditable( + "210 King St", // addressLine1 + "# 6100", // addressLine2 + "San Francisco", // addressCity + "CA", // addressState + "94107", // addressZip + default(CountryExtended), // addressCounty + null, // description + "Harry Zhang" // name + ); + + + Fsc fsc = new Fsc(true); + + + SnapPackEditable SnapPackEditable = new SnapPackEditable( + to.ToJson(), // to + "adr_249af768103d2810", // from + default(SnapPacksize), // size + "Demo Snap Pack Job", // description + default(Dictionary), // metadata + default(MailType), // mailType + mergeVariables, // mergeVariables + default(DateTime), // sendDate + "Inside HTML for {{name}}", // inside + "Outside HTML for {{name}}", // outside + "marketing", // use_type + fsc + ); + + + try { + SnapPack result = api.create(SnapPackEditable, null); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + var to = *lob.NewAddressEditable() + + to.SetAddressLine1("210 King St") + + to.SetAddressLine2("# 6100") + + to.SetAddressCity("San Francisco") + + to.SetAddressState("CA") + + to.SetAddressZip("94107") + + to.SetAddressCountry(lob.COUNTRYEXTENDED_US) + + to.SetDescription("") + + to.SetName("Harry Zhang") + + + var SnapPackCreate = *lob.NewSnapPackEditable() + + SnapPackCreate.SetDescription("Demo Snap Pack job") + + SnapPackCreate.SetFrom("adr_210a8d4b0b76d77b") + + SnapPackCreate.SetInside("Inside HTML for {{name}}") + + SnapPackCreate.SetOutside("Outside HTML for {{name}}") + + SnapPackCreate.SetTo(to) + + SnapPackCreate.SetFsc(true) + + + + createdSnapPack, _, err := + apiClient.SnapPacksApi.Create(context).SnapPackEditable(SnapPackCreate).Execute() + + + if err != nil { + return err + } + label: GO + /templates/{tmpl_id}/versions/{vrsn_id}: + parameters: + - in: path + name: tmpl_id + description: The ID of the template to which the version belongs. + required: true + schema: + $ref: '#/components/schemas/tmpl_id' + - in: path + name: vrsn_id + description: id of the template_version + required: true + schema: + $ref: '#/components/schemas/vrsn_id' + get: + operationId: template_version_retrieve + summary: Retrieve + description: Retrieves the template version with the given template and version ids. + tags: + - Template Versions + responses: + '200': + description: >- + Returns the template version with the given template and version + ids. + content: + application/json: + schema: + $ref: '#/components/schemas/template_version' + example: + id: vrsn_534e339882d2282 description: Second Version - html: 'Second HTML for ' - date_created: '2017-11-09T05:09:03.665Z' - date_modified: '2018-05-22T22:01:10.479Z' - object: version - - id: vrsn_2a17159c1911919 - description: Test Template - html: 'HTML for ' - date_created: '2017-11-09T05:08:40.004Z' - date_modified: '2018-05-22T22:01:11.309Z' + html: Second HTML for {{name}} + date_created: '2017-11-09T04:49:38.016Z' + date_modified: '2017-11-09T04:49:38.016Z' object: version - object: list - count: 2 - template_deleted: - description: Deleted - content: - application/json: + default: + $ref: '#/components/responses/template_error' + x-codeSamples: + - lang: Shell + source: > + curl + https://api.lob.com/v1/templates/tmpl_c94e83ca2cd5121/versions/vrsn_534e339882d2282 + \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: Typescript + source: | + try { + const templateVersion = await new TemplateVersionsApi(config).get('tmpl_xxxx', 'vrsn_xxxx'); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + This feature is not currently supported by this library. + label: NODE + - lang: Ruby + source: | + templateVersionApi = TemplateVersionsApi.new(config) + + begin + retrievedTemplateVersion = templateVersionApi.get("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282") + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = TemplateVersionsApi(api_client) + + try: + template_version = api.get("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282") + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\TemplateVersionsApi($config, + new GuzzleHttp\Client()); + + + try { + $result = $apiInstance->get("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282"); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + TemplateVersionsApi apiInstance = new TemplateVersionsApi(config); + + try { + TemplateVersion response = apiInstance.get("vrsn_534e339882d2282"); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + This feature is not currently supported by this library. + label: ELIXIR + - lang: CSharp + source: | + TemplateVersionsApi api = new TemplateVersionsApi(config); + + try { + TemplateVersion response = api.get("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282"); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + fetchedTemplateVersion, _, err := + apiClient.TemplateVersionsApi.Get(context,"tmpl_c94e83ca2cd5121", + "vrsn_534e339882d2282").Execute() + + + if err != nil { + return err + } + label: GO + post: + operationId: template_version_update + summary: Update + description: Updates the template version with the given template and version ids. + tags: + - Template Versions + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/template_version_updatable' + example: + description: Some description + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/template_version_updatable' + example: + description: Some description + multipart/form-data: + schema: + $ref: '#/components/schemas/template_version_updatable' + example: + description: Some description + responses: + '200': + $ref: '#/components/responses/post_template_version' + default: + $ref: '#/components/responses/template_error' + x-codeSamples: + - lang: Shell + source: > + curl + https://api.lob.com/v1/templates/tmpl_c94e83ca2cd5121/versions/vrsn_534e339882d2282 + \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ + -d "description=Updated description" + label: CURL + - lang: Typescript + source: | + const TemplateVersions = new TemplateVersionsApi(config); + + try { + const updateData = new TemplateVersionUpdatable({ + description: 'updated template' + }); + const updateTemplateVersion = await TemplateVersions.update('vrsn_xxxx', updateData); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + This feature is not currently supported by this library. + label: NODE + - lang: Ruby + source: | + templateVersionUpdatable = TemplateUpdate.new({ + description: "updated template version", + }) + + templateVersionApi = TemplateVersionsApi.new(config) + + begin + updatedTemplateVersion = templateVersionApi.update("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282", templateVersionUpdatable) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = TemplateVersionsApi(api_client) + + update_data = TemplateVersionUpdatable( + description = "updated template" + ) + + try: + update_template_version = api.update("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282", update_data) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\TemplateVersionsApi($config, + new GuzzleHttp\Client()); + + + $templateVersionUpdate = new + OpenAPI\Client\Model\TemplateUpdate(array( + "description" => "Updated template version" + )); + + + try { + $result = $apiInstance->update("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282", $templateVersionUpdate); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + This feature is not currently supported by this library. + label: JAVA + - lang: Elixir + source: | + This feature is not currently supported by this library. + label: ELIXIR + - lang: CSharp + source: > + TemplateVersionsApi api = new TemplateVersionsApi(config); + + TemplateVersionUpdatable update = new + TemplateVersionUpdatable("update template", EngineHtml.Handlebars); + + + try { + api.update("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282", update); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + var templateWritable = *lob.NewTemplateWritable("Updated HTML + for Template 1/html>") + + var templateVersionWritable = + *lob.NewTemplateVersionWritable("Updated HTML for Template + 1/html>") + + createdTemplate, _, _ := + apiClient.TemplatesApi.Create(context).TemplateWritable(templateWritable).Execute() + + + createdTemplateVersion, _, err := + apiClient.TemplateVersionsApi.Create(context, + createdTemplate.Id).TemplateVersionWritable(templateVersionWritable).Execute() + + createdTemplateVersion.SetDescription("New Template Version") + + resp, _, err := apiClient.TemplatesApi.Update(context, + createdTemplate.Id, + createdTemplateVersion.Id).TemplateVersionWritable(templateVersionWritable).Execute() + + + if err != nil { + return err + } + label: GO + delete: + operationId: template_version_delete + summary: Delete + description: >- + Permanently deletes a template version. A template's `published_version` + can not be deleted. + tags: + - Template Versions + responses: + '200': + $ref: '#/components/responses/template_version_deleted' + default: + $ref: '#/components/responses/template_error' + x-codeSamples: + - lang: Shell + source: > + curl -X DELETE + https://api.lob.com/v1/templates/tmpl_4aa14648113e45b/versions/vrsn_534e339882d2282 + \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: Typescript + source: | + try { + const deleteTemplateVersion = await new TemplateVersionsApi(config).delete("tmpl_xxxx","vrsn_xxxx"); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + This feature is not currently supported by this library. + label: NODE + - lang: Ruby + source: | + templateVersionApi = TemplateVersionsApi.new(config) + + begin + deletedTemplateVersion = templateVersionApi.delete("tmpl_4aa14648113e45b", "vrsn_534e339882d2282") + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = TemplateVersionsApi(api_client) + + try: + deleted_resource = api.delete("tmpl_4aa14648113e45b", "vrsn_534e339882d2282") + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: | + This feature is not currently supported by this library. + - lang: Java + source: | + This feature is not currently supported by this library. + label: JAVA + - lang: Elixir + source: | + This feature is not currently supported by this library. + label: ELIXIR + - lang: CSharp + source: | + TemplateVersionsApi api = new TemplateVersionsApi(config); + + try { + TemplateVersionDeletion response = api.delete("tmpl_xxx", "vrsn_xxx"); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + deletedTemplateVersion, _, err := + apiClient.TemplateVersionsApi.Delete(context, + "tmpl_4aa14648113e45b", "vrsn_534e339882d2282").Execute() + + + if err != nil { + return err + } + label: GO + /templates/{tmpl_id}/versions: + get: + operationId: template_versions_list + summary: List + description: > + Returns a list of template versions for the given template ID. The + template versions are sorted by creation date, with the most recently + created appearing first. + tags: + - Template Versions + parameters: + - in: path + name: tmpl_id + description: The ID of the template associated with the retrieved versions + required: true schema: - $ref: '#/components/schemas/template_deletion' - example: - value: - id: tmpl_123456789 - deleted: true - all_templates: - description: A dictionary with a data property that contains an array of up to `limit` templates. Each entry in the array is a separate template. The previous and next page of templates can be retrieved by calling the endpoint contained in the `previous_url` and `next_url` fields in the API response respectively.
If no more templates are available beyond the current set of returned results, the `next_url` field will be empty. - content: - application/json: + $ref: '#/components/schemas/tmpl_id' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/before_after' + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/date_created' + responses: + '200': + $ref: '#/components/responses/all_template_versions' + default: + $ref: '#/components/responses/template_error' + x-codeSamples: + - lang: Shell + source: > + curl -X GET + "https://api.lob.com/v1/templates/tmpl_ea6e6a1abf01703/versions?limit=2" + \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: Typescript + source: | + try { + const templateVersions = await new TemplateVersionsApi(config).list(tmpl_xxxx); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + This feature is not currently supported by this library. + label: NODE + - lang: Ruby + source: | + templateVersionsApi = TemplateVersionsApi.new(config) + + begin + templateVersions = templateVersionsApi.list("tmpl_dadaaf7b76c9f25", { limit: 2 }) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = TemplateVersionsApi(api_client) + + try: + template_versions = api.list("tmpl_dadaaf7b76c9f25", limit=2) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\TemplateVersionsApi($config, + new GuzzleHttp\Client()); + + + try { + $result = $apiInstance->list( + tmpl_dadaaf7b76c9f25, // tmplId + 2, // limit + ); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + TemplateVersionsApi apiInstance = new TemplateVersionsApi(config); + + try { + List response = apiInstance.list( + "tmpl_dadaaf7b76c9f25", // tmplId + 2, // limit + null, // before + null, // after + null, // include + null // dateCreated + ); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + This feature is not currently supported by this library. + label: ELIXIR + - lang: CSharp + source: > + TemplateVersionsApi api = new TemplateVersionsApi(config); + + + List includeList = new List(); + + includeList.Add("total_count"); + + Dictionary dateCreated = new Dictionary(); + + DateTime dateCreatedDate = DateTime.Today.AddMonths(-1); + + dateCreated.Add("lt", dateCreatedDate); + + + try { + TemplateVersionList response = api.list( + "tmpl_dadaaf7b76c9f25", // tmplId + 2, // limit + null, // before + null, // after + includeList, // include + dateCreated // dateCreated + ); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + TemplateVersionList = apiClient.TemplateVersionsApi.List(context, + "tmpl_4aa14648113e45b").Execute() + + if err != nil { + return err + } + label: GO + post: + operationId: create_template_version + summary: Create + description: Creates a new template version attached to the specified template. + tags: + - Template Versions + parameters: + - in: path + name: tmpl_id + description: The ID of the template the new version will be attached to + required: true schema: - allOf: - - $ref: '#/components/schemas/list' - - type: object - properties: - data: - type: array - description: list of templates - items: - $ref: '#/components/schemas/template' - example: - data: - - id: tmpl_d5a5a89da9106f8 + $ref: '#/components/schemas/tmpl_id' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/template_version_writable' + example: + description: Some Description + html: HTML for {{name}} + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/template_version_writable' + example: + description: Some Description + html: HTML for {{name}} + multipart/form-data: + schema: + $ref: '#/components/schemas/template_version_writable' + example: + description: Some Description + html: HTML for {{name}} + responses: + '200': + $ref: '#/components/responses/post_template_version' + default: + $ref: '#/components/responses/template_error' + x-codeSamples: + - lang: Shell + source: > + curl https://api.lob.com/v1/templates/tmpl_4aa14648113e45b/versions + \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ + -d "description=Second Version" \ + --data-urlencode "html=Second HTML for {{name}}" + label: CURL + - lang: Typescript + source: | + const templateVersionCreate = new TemplateVersionWritable({ + description: 'Newer Template', + html: 'Updated HTML for {{name}}' + }); + + try { + const myTemplateVersion = await new TemplateVersionsApi(config).create('tmpl_xxxx', templateVersionCreate); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + This feature is not currently supported by this library. + label: NODE + - lang: Ruby + source: | + templateVersionCreate = TemplateVersionWritable.new({ + description: "Second Version", + html: "Second HTML for {{name}}", + }); + + templateVersionApi = TemplateVersionsApi.new(config) + + begin + createdTemplateVersion = templateVersionApi.create("tmpl_4aa14648113e45b", templateVersionCreate) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + template_version_writable = TemplateVersionWritable( + description = "Second Version", + html = "Second HTML for {{name}}", + ) + + with ApiClient(configuration) as api_client: + api = TemplateVersionsApi(api_client) + + try: + created_template_version = api.create("tmpl_4aa14648113e45b", template_version_writable) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\TemplateVersionsApi($config, + new GuzzleHttp\Client()); + + $template_version_writable = new + OpenAPI\Client\Model\TemplateVersionWritable( + array( + "description" => "Second Version", + "html" => "Second HTML for {{name}}", + ) + ); + + + try { + $result = $apiInstance->create("tmpl_4aa14648113e45b", $template_version_writable); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + TemplateVersionsApi apiInstance = new TemplateVersionsApi(config); + + try { + TemplateVersionWritable = new TemplateVersionWritable(); + .set("Second Version"); + .set("Second HTML for {{name}}"); + + TemplateVersion result = apiInstance.create(); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + This feature is not currently supported by this library. + label: ELIXIR + - lang: CSharp + source: > + TemplateVersionsApi api = new TemplateVersionsApi(config); + + + TemplateVersionWritable templateVersionWritable = new + TemplateVersionWritable( + "Second Version", // description + "Second HTML for {{name}}" // html + ); + + + try { + TemplateVersion result = api.create("tmpl_4aa14648113e45b", templateVersionWritable); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + + var templateVersionCreate = *lob.NewTemplateVersionWritable() + + templateVersionCreate.SetDescription("Second Version") + + templateVersionCreate.SetHtml("Second HTML for + {{name}}") + + + + + createdtemplateVersion, _, err := + apiClient.TemplateVersionsApi.Create(context, + "tmpl_4aa14648113e45b").TemplateVersionWritable(templateVersionCreate).Execute() + + + if err != nil { + return err + } + label: GO + /templates/{tmpl_id}: + parameters: + - in: path + name: tmpl_id + description: id of the template + required: true + schema: + $ref: '#/components/schemas/tmpl_id' + get: + operationId: template_retrieve + summary: Retrieve + description: >- + Retrieves the details of an existing template. You need only supply the + unique template identifier that was returned upon template creation. + tags: + - Templates + responses: + '200': + description: Returns a template object + content: + application/json: + schema: + $ref: '#/components/schemas/template' + example: + id: tmpl_c94e83ca2cd5121 description: Test Template versions: - - id: vrsn_232a02fb8224791 + - id: vrsn_362184d96d9b0c9 suggest_json_editor: true description: Test Template engine: legacy - html: 'HTML for ' - date_created: '2019-07-27T23:49:01.512Z' - date_modified: '2019-07-27T23:49:01.512Z' + html: HTML for {{name}} + date_created: '2017-11-07T22:56:10.962Z' + date_modified: '2017-11-07T22:56:10.962Z' object: version published_version: - id: vrsn_232a02fb8224791 + id: vrsn_362184d96d9b0c9 suggest_json_editor: false description: Test Template engine: handlebars - html: 'HTML for ' - date_created: '2019-07-27T23:49:01.512Z' - date_modified: '2019-07-27T23:49:01.512Z' - object: version - metadata: {} - date_created: '2019-07-27T23:49:01.511Z' - date_modified: '2019-07-27T23:49:01.511Z' - object: template - - id: tmpl_59b2150ae120887 - description: Test Template - versions: - - id: vrsn_2a7eb63ccb795b9 - description: Test Template - html: 'HTML for ' - date_created: '2019-03-29T10:22:34.643Z' - date_modified: '2019-03-29T10:22:34.643Z' - object: version - published_version: - id: vrsn_2a7eb63ccb795b9 - description: Test Template - html: 'HTML for ' - date_created: '2019-03-29T10:22:34.643Z' - date_modified: '2019-03-29T10:22:34.643Z' + html: HTML for {{name}} + date_created: '2017-11-07T22:56:10.962Z' + date_modified: '2017-11-07T22:56:10.962Z' object: version metadata: {} - date_created: '2019-03-29T10:22:34.642Z' - date_modified: '2019-03-29T10:22:34.642Z' + date_created: '2017-11-07T22:56:10.962Z' + date_modified: '2017-11-07T22:56:10.962Z' object: template - object: list - previous_url: null - next_url: https://api.lob.com/v1/templates?limit=2&after=eyJkYXRlT2Zmc2V0IjoiMjAxOS0wMy0yOVQxMDoyMjozNC42NDJaIiwiaWRPZmZzZXQiOiJ0bXBsXzU5YjIxNTBhZTEyMDg4NyJ9 - count: 2 - all_uploads: - description: An array of matching uploads. Each entry in the array is a separate upload. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/upload' - example: - - id: upl_71be866e430b11e9 - accountId: fa9ea650fc7b31a89f92 - campaignId: cmp_1933ad629bae1408 - mode: test - failuresUrl: https://www.example.com - originalFilename: my_audience.csv - state: Draft - totalMailpieces: 100 - failedMailpieces: 5 - validatedMailpieces: 95 - bytesProcessed: 17268 - dateCreated: '2017-09-05T17:47:53.767Z' - dateModified: '2017-09-05T17:47:53.767Z' - requiredAddressColumnMapping: - name: recipient_name - address_line1: primary_line - address_city: city - address_state: state - address_zip: zip_code - optionalAddressColumnMapping: - address_line2: secondary_line - company: company - address_country: country - mergeVariableColumnMapping: - gift_code: code - metadata: - columns: - - recipient_name - - zip_code - upload_validation_error: - description: Validation Error - content: - application/json: - schema: - title: HTTPValidationError - type: object - properties: - detail: - title: Detail - type: array - items: - title: ValidationError - required: - - loc - - msg - - type - type: object - properties: - loc: - title: Location - type: array - items: - anyOf: - - type: string - - type: integer - msg: - title: Message - type: string - type: - title: Error Type - type: string - upload_not_found: - description: Not Found Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - example: - error: - code: not_found - message: upload not found - status_code: 404 - upload_export_error: - description: Create Export Error - content: - application/json: - schema: - type: object - required: - - code - - message - - errors - properties: - code: - description: A conventional HTTP status code - type: number - enum: - - 400 - - 404 - message: - description: A human-readable message with more details about the error - type: string - errors: - description: An array of pre-defined strings that identify an error - type: array - items: - type: string + default: + $ref: '#/components/responses/template_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/templates/tmpl_c94e83ca2cd5121 \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: Typescript + source: | + try { + const Template = await new TemplatesApi(config).get('tmpl_xxxx'); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + This feature is not currently supported by this library. + label: NODE + - lang: Ruby + source: | + templateApi = TemplatesApi.new(config) + + begin + retrievedTemplate = templateApi.get("tmpl_c94e83ca2cd5121") + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = TemplatesApi(api_client) + + try: + template = api.get("tmpl_c94e83ca2cd5121") + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\TemplatesApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->get("tmpl_c94e83ca2cd5121"); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + TemplatesApi apiInstance = new TemplatesApi(config); + + try { + Template response = apiInstance.get("tmpl_c94e83ca2cd5121"); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + This feature is not currently supported by this library. + label: ELIXIR + - lang: CSharp + source: | + TemplatesApi api = new TemplatesApi(config); + + try { + Template response = api.get("tmpl_c94e83ca2cd5121"); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + fetchedTemplate, _, err := + apiClient.TemplatesApi.Get(context,"tmpl_c94e83ca2cd5121").Execute() + + + if err != nil { + return err + } + label: GO + post: + operationId: template_update + summary: Update + description: >- + Updates the description and/or published version of the template with + the given id. To update the template's html, create a new version of the + template. + tags: + - Templates + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/template_update' example: - code: 400 - message: Invalid body, check 'errors' property for more info. - errors: - - type must be a string - feature_flag_disabled: - description: Forbidden Error - content: - application/json: - schema: - type: object - properties: - code: - description: The error code - type: number - message: - type: string - description: Details of the error message with the feature flagged mentioned. - example: - message: 'This feature is not enabled for this account: access_upload_report' - code: 403 - us_autocompletions_error: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - example: - error: - code: invalid - message: address_prefix is required - status_code: 422 - us_autocompletions: - description: Returns a US autocompletion object. - headers: - ratelimit-limit: - $ref: '#/components/headers/ratelimit-limit' - ratelimit-remaining: - $ref: '#/components/headers/ratelimit-remaining' - ratelimit-reset: - $ref: '#/components/headers/ratelimit-reset' - content: - application/json: - schema: - $ref: '#/components/schemas/us_autocompletions' - examples: - basic: - value: - id: us_auto_a3ac97bcfbb2460ab20c - suggestions: - - primary_line: 185 BAYSIDE VILLAGE PL - city: SAN FRANCISCO - state: CA - zip_code: '94107' - - primary_line: 185 BRANNAN ST - city: SAN FRANCISCO - state: CA - zip_code: '94107' - - primary_line: 185 BONIFACIO ST - city: SAN FRANCISCO - state: CA - zip_code: '94107' - - primary_line: 185 BLAIR TER - city: SAN FRANCISCO - state: CA - zip_code: '94107' - - primary_line: 185 BLUXOME ST - city: SAN FRANCISCO - state: CA - zip_code: '94107' - - primary_line: 210 KING ST - city: SAN FRANCISCO - state: CA - zip_code: '94107' - - primary_line: 185 BRYANT ST - city: SAN FRANCISCO - state: CA - zip_code: '94107' - object: us_autocompletion - test: - value: - id: us_auto_a3ac97bcfbb2460ab20c - suggestions: - - primary_line: 1 TELEPHONE RD - city: OXFORD - state: AR - zip_code: '72565' - - primary_line: 1 TELEGA PL - city: PALMDALE - state: CA - zip_code: '93550' - - primary_line: 1 TELEGRAM AVE - city: ELMONT - state: NY - zip_code: '11003' - - primary_line: 1 TELEGRAM AVE - city: GARDEN CITY - state: KS - zip_code: '67846' - - primary_line: 1 TELEGRAPH HILL RD - city: HOLMDEL - state: NJ - zip_code: '07733' - - primary_line: 1 TELEGRAPH HILL RD S - city: HOLMDEL - state: NJ - zip_code: '07733' - - primary_line: 1 TELEGRAPH HILL BLVD - city: SAN FRANCISCO - state: CA - zip_code: '94133' - object: us_autocompletion - reverse_geocode_lookups_error: - description: Error - content: - application/json: - schema: - $ref: '#/components/schemas/error' - example: - error: - code: invalid - message: latitude is required - status_code: 422 - reverse_geocode_lookups: - description: Returns a zip lookup object if a valid zip was provided. - headers: - ratelimit-limit: - $ref: '#/components/headers/ratelimit-limit' - ratelimit-remaining: - $ref: '#/components/headers/ratelimit-remaining' - ratelimit-reset: - $ref: '#/components/headers/ratelimit-reset' - content: - application/json: - schema: - $ref: '#/components/schemas/reverse_geocode' - example: - id: us_reverse_geocode_8a013f3e - addresses: - - components: - zip_code: '94107' - zip_code_plus_4: '1702' - location_analysis: - latitude: 37.78271 - longitude: -122.416202 - distance: 1.32 - - components: - zip_code: '94107' - zip_code_plus_4: '1702' - location_analysis: - latitude: 37.782917 - longitude: -122.416131 - distance: 1.33 - us_verifications: - description: Returns a US verification object. - headers: - ratelimit-limit: - $ref: '#/components/headers/ratelimit-limit' - ratelimit-remaining: - $ref: '#/components/headers/ratelimit-remaining' - ratelimit-reset: - $ref: '#/components/headers/ratelimit-reset' - content: - application/json: + description: Updated Example + published_version: vrsn_a + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/template_update' + example: + description: Updated Example + published_version: vrsn_a + multipart/form-data: + schema: + $ref: '#/components/schemas/template_update' + example: + description: Updated Example + published_version: vrsn_a + responses: + '200': + description: Returns the updated template object + headers: + ratelimit-limit: + $ref: '#/components/headers/ratelimit-limit' + ratelimit-remaining: + $ref: '#/components/headers/ratelimit-remaining' + ratelimit-reset: + $ref: '#/components/headers/ratelimit-reset' + content: + application/json: + schema: + $ref: '#/components/schemas/template' + example: + id: tmpl_c94e83ca2cd5121 + description: Test Template + versions: + - id: vrsn_362184d96d9b0c9 + suggest_json_editor: true + description: Test Template + engine: legacy + html: HTML for {{name}} + date_created: '2017-11-07T22:56:10.962Z' + date_modified: '2017-11-07T22:56:10.962Z' + object: version + published_version: + id: vrsn_362184d96d9b0c9 + suggest_json_editor: false + description: Test Template + engine: handlebars + html: HTML for {{name}} + date_created: '2017-11-07T22:56:10.962Z' + date_modified: '2017-11-07T22:56:10.962Z' + object: version + metadata: {} + date_created: '2017-11-07T22:56:10.962Z' + date_modified: '2017-11-07T22:56:10.962Z' + object: template + default: + $ref: '#/components/responses/template_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/templates/tmpl_c94e83ca2cd5121 \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ + -d "description=Updated description" \ + -d "published_version=vrsn_362184d96d9b0c9" + label: CURL + - lang: Typescript + source: | + const Templates = new TemplatesApi(config); + + try { + const updateData = new TemplateUpdate ({ + description: 'updated template', + published_version: 'vrsn_xxxx' + }); + const updateTemplate = await Templates.update('tmpl_xxxx', updateData); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + This feature is not currently supported by this library. + label: NODE + - lang: Ruby + source: | + templateUpdate = TemplateUpdate.new({ + description: "updated template", + published_version: "vrsn_362184d96d9b0c9", + }) + + templateApi = TemplatesApi.new(config) + + begin + updatedTemplate = templateApi.update("tmpl_c94e83ca2cd5121", templateUpdate) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = TemplatesApi(api_client) + + update_data = TemplateUpdate( + description = "updated template", + published_version = "vrsn_362184d96d9b0c9" + ) + + try: + update_template = api.update("tmpl_c94e83ca2cd5121", update_data) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\TemplatesApi($config, new + GuzzleHttp\Client()); + + + $templateUpdate = new OpenAPI\Client\Model\TemplateUpdate(array( + "description" => "Updated description", + "published_version" => "vrsn_362184d96d9b0c9" + )); + + + try { + $result = $apiInstance->update("tmpl_c94e83ca2cd5121", $templateUpdate); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + TemplatesApi apiInstance = new TemplatesApi(config); + TemplateUpdate update = new TemplateUpdate(); + + update.setDescription("update template"); + update.setPublishedVersion("vrsn_362184d96d9b0c9"; + + try { + apiInstance.update("tmpl_c94e83ca2cd5121", update); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + This feature is not currently supported by this library. + label: ELIXIR + - lang: CSharp + source: > + TemplatesApi api = new TemplatesApi(config); + + TemplateUpdate update = new TemplateUpdate("update template", + "vrsn_362184d96d9b0c9"); + + + try { + api.update("tmpl_c94e83ca2cd5121", update); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + var templateWritable = *lob.NewTemplateWritable("Updated HTML + for Template 1/html>") + + createdTemplate, _, _ := + apiClient.TemplatesApi.Create(context).TemplateWritable(templateWritable).Execute() + + + templateWritable.SetDescription("Template updated") + + resp, _, err := apiClient.TemplatesApi.Update(context, + createdTemplate.Id).TemplateWritable(templateWritable).Execute() + + + if err != nil { + return err + } + label: GO + delete: + operationId: template_delete + summary: Delete + description: >- + Permanently deletes a template. Deleting a template also deletes its + associated versions. Deleted templates can not be used to create + postcard, letter, or check resources. + tags: + - Templates + responses: + '200': + $ref: '#/components/responses/template_deleted' + default: + $ref: '#/components/responses/template_error' + x-codeSamples: + - lang: Shell + source: > + curl -X DELETE https://api.lob.com/v1/templates/tmpl_df934eeda694203 + \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: Typescript + source: | + try { + const deleteTemplate = await new TemplatesApi(config).delete('tmpl_xxxx'); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + This feature is not currently supported by this library. + label: NODE + - lang: Ruby + source: | + templateApi = TemplatesApi.new(config) + + begin + deletedTemplate = templateApi.delete("tmpl_df934eeda694203") + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = TemplatesApi(api_client) + + try: + deleted_resource = api.delete("tmpl_df934eeda694203") + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\TemplatesApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->delete("tmpl_df934eeda694203"); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + TemplatesApi apiInstance = new TemplatesApi(config); + + try { + TemplateDeletion response = apiInstance.delete("tmpl_df934eeda694203"); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + This feature is not currently supported by this library. + label: ELIXIR + - lang: CSharp + source: | + TemplatesApi api = new TemplatesApi(config); + + try { + TemplateDeletion response = api.delete("tmpl_df934eeda694203"); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + deletedTemplate, _, err := apiClient.TemplatesApi.Delete(context, + "tmpl_df934eeda694203").Execute() + + + if err != nil { + return err + } + label: GO + /templates: + get: + operationId: templates_list + summary: List + description: >- + Returns a list of your templates. The templates are returned sorted by + creation date, with the most recently created templates appearing first. + tags: + - Templates + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/before_after' + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/date_created' + - $ref: '#/components/parameters/metadata' + responses: + '200': + $ref: '#/components/responses/all_templates' + default: + $ref: '#/components/responses/template_error' + x-codeSamples: + - lang: Shell + source: | + curl -X GET "https://api.lob.com/v1/templates?limit=2" \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: + label: CURL + - lang: Typescript + source: | + try { + const templates = await new TemplatesApi(config).list(2); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + This feature is not currently supported by this library. + label: NODE + - lang: Ruby + source: | + templatesApi = TemplatesApi.new(config) + + begin + templates = templatesApi.list({ limit: 2 }) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = TemplatesApi(api_client) + + try: + templates = api.list(limit=2) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\TemplatesApi($config, new + GuzzleHttp\Client()); + + + try { + $result = $apiInstance->list( + 2, // limit + ); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + TemplatesApi apiInstance = new TemplatesApi(config); + + try { + List response = apiInstance.list( + 2, // limit + null, // before + null, // after + null, // include + null, // dateCreated + null, // metadata + null // size + ); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + This feature is not currently supported by this library. + label: ELIXIR + - lang: CSharp + source: > + TemplatesApi api = new TemplatesApi(config); + + + List includeList = new List(); + + includeList.Add("total_count"); + + Dictionary metadata = new Dictionary(); + + metadata.Add("name", "Harry"); + + Dictionary dateCreated = new Dictionary(); + + DateTime dateCreatedDate = DateTime.Today.AddMonths(-1); + + dateCreated.Add("lt", dateCreatedDate); + + + try { + TemplateList response = api.list( + 2, // limit + null, // before + null, // after + includeList, // include + dateCreated, // dateCreated + metadata // metadata + ); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + TemplateList = apiClient.TemplatesApi.List(context).Execute() + + if err != nil { + return err + } + label: GO + post: + operationId: create_template + summary: Create + description: >- + Creates a new template for use with the Print & Mail API. In Live mode, + you can only have as many non-deleted templates as allotted in your + current Print & Mail Edition. If you attempt to create a + template past your limit, you will receive a `403` error. There is no + limit in Test mode. + tags: + - Templates + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/template_writable' + example: + description: demo + html: HTML for {{name}} + metadata: + spiffy: 'true' + engine: handlebars + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/template_writable' + example: + description: demo + html: HTML for {{name}} + metadata: + spiffy: 'true' + engine: handlebars + multipart/form-data: + schema: + $ref: '#/components/schemas/template_writable' + example: + description: demo + html: HTML for {{name}} + metadata: + spiffy: 'true' + engine: handlebars + responses: + '200': + description: Returns a template object + headers: + ratelimit-limit: + $ref: '#/components/headers/ratelimit-limit' + ratelimit-remaining: + $ref: '#/components/headers/ratelimit-remaining' + ratelimit-reset: + $ref: '#/components/headers/ratelimit-reset' + content: + application/json: + schema: + $ref: '#/components/schemas/template' + example: + id: tmpl_c94e83ca2cd5121 + description: Test Template + versions: + - id: vrsn_362184d96d9b0c9 + suggest_json_editor: true + description: Test Template + engine: legacy + html: HTML for {{name}} + date_created: '2017-11-07T22:56:10.962Z' + date_modified: '2017-11-07T22:56:10.962Z' + object: version + published_version: + id: vrsn_362184d96d9b0c9 + suggest_json_editor: false + description: Test Template + engine: handlebars + html: HTML for {{name}} + date_created: '2017-11-07T22:56:10.962Z' + date_modified: '2017-11-07T22:56:10.962Z' + object: version + metadata: {} + date_created: '2017-11-07T22:56:10.962Z' + date_modified: '2017-11-07T22:56:10.962Z' + object: template + default: + $ref: '#/components/responses/template_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/templates \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ + -d "description=Test Template" \ + --data-urlencode "html=HTML for {{name}}" + label: CURL + - lang: Typescript + source: | + const templateCreate = new TemplateWritable({ + description: 'Newer Template', + html: 'Updated HTML for {{name}}' + }); + + try { + const myTemplate = await new TemplatesApi(config).create(templateCreate); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + This feature is not currently supported by this library. + label: NODE + - lang: Ruby + source: | + templateCreate = TemplateWritable.new({ + description: "Test Template", + html: "HTML for {{name}}", + }); + + templateApi = TemplatesApi.new(config) + + begin + createdTemplate = templateApi.create(templateCreate) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + template_writable = TemplateWritable( + description = "Test Template", + html = "HTML for {{name}}", + ) + + with ApiClient(configuration) as api_client: + api = TemplatesApi(api_client) + + try: + created_template = api.create(template_writable) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\TemplatesApi($config, new + GuzzleHttp\Client()); + + $template_writable = new OpenAPI\Client\Model\TemplateWritable( + array( + "description" => "Test Template", + "html" => "HTML for {{name}}", + ) + ); + + + try { + $result = $apiInstance->create($template_writable); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: | + TemplatesApi apiInstance = new TemplatesApi(config); + + try { + TemplateWritable = new TemplateWritable(); + .set("Test Template"); + .set("HTML for {{name}}"); + + Template result = apiInstance.create(); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + This feature is not currently supported by this library. + label: ELIXIR + - lang: CSharp + source: | + TemplatesApi api = new TemplatesApi(config); + + TemplateWritable templateWritable = new TemplateWritable( + "Test Template", // description + "HTML for {{name}}" // html + ); + + try { + Template result = api.create(templateWritable); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(suite.ctx, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + + var templateCreate = *lob.NewTemplateWritable() + + templateCreate.SetDescription("Test Template") + + templateCreate.SetHtml("HTML for {{name}}") + + + + + createdtemplate, _, err := + apiClient.TemplatesApi.Create(context).TemplateWritable(templateCreate).Execute() + + + if err != nil { + return err + } + label: GO + /uploads: + get: + operationId: uploads_list + summary: List + description: Returns a list of your uploads. Optionally, filter uploads by campaign. + tags: + - Uploads + parameters: + - required: false schema: - $ref: '#/components/schemas/us_verification' - examples: - basic: - value: - id: us_ver_c7cb63d68f8d6 - recipient: LOB.COM - primary_line: 210 KING ST - secondary_line: '' - urbanization: '' - last_line: SAN FRANCISCO CA 94107-1702 - deliverability: deliverable - valid_address: true - components: - primary_number: '210' - street_predirection: '' - street_name: KING - street_suffix: ST - street_postdirection: '' - secondary_designator: '' - secondary_number: '' - pmb_designator: '' - pmb_number: '' - extra_secondary_designator: '' - extra_secondary_number: '' - city: SAN FRANCISCO - state: CA - zip_code: '94107' - zip_code_plus_4: '1702' - zip_code_type: standard - delivery_point_barcode: '941071702108' - address_type: commercial - record_type: street - default_building_address: false - county: SAN FRANCISCO - county_fips: '06075' - carrier_route: C032 - carrier_route_type: city_delivery - po_box_only_flag: 'N' - latitude: 37.77597542841264 - longitude: -122.3929557343685 - deliverability_analysis: - dpv_confirmation: 'Y' - dpv_cmra: 'N' - dpv_vacant: 'N' - dpv_active: 'Y' - dpv_inactive_reason: '' - dpv_throwback: 'N' - dpv_non_delivery_day_flag: 'N' - dpv_non_delivery_day_values: '' - dpv_no_secure_location: 'N' - dpv_door_not_accessible: 'N' - dpv_footnotes: - - AA - - BB - ews_match: false - lacs_indicator: '' - lacs_return_code: '' - suite_return_code: '' - lob_confidence_score: - score: 100 - level: high - object: us_verification - test: - value: - id: us_ver_po_box - recipient: TEST KEYS DO NOT VERIFY ADDRESSES - primary_line: PO BOX 720114 - secondary_line: '' - urbanization: '' - last_line: SAN FRANCISCO CA 94172-0114 - deliverability: deliverable - valid_address: true - components: - primary_number: '720114' - street_predirection: '' - street_name: PO BOX - street_suffix: '' - street_postdirection: '' - secondary_designator: '' - secondary_number: '' - pmb_designator: '' - pmb_number: '' - extra_secondary_designator: '' - extra_secondary_number: '' - city: SAN FRANCISCO - state: CA - zip_code: '94172' - zip_code_plus_4: '0114' - zip_code_type: po_box - delivery_point_barcode: '941720114146' - address_type: residential - record_type: po_box - default_building_address: false - county: SAN FRANCISCO - county_fips: '06075' - carrier_route: BOO2 - carrier_route_type: po_box - po_box_only_flag: '' - latitude: 37.75971500260575 - longitude: -122.69397561170017 - deliverability_analysis: - dpv_confirmation: 'Y' - dpv_cmra: 'N' - dpv_vacant: 'N' - dpv_active: 'Y' - dpv_inactive_reason: '' - dpv_throwback: '' - dpv_non_delivery_day_flag: '' - dpv_non_delivery_day_values: '' - dpv_no_secure_location: '' - dpv_door_not_accessible: '' - dpv_footnotes: - - AA - - BB - ews_match: false - lacs_indicator: '' - lacs_return_code: '' - suite_return_code: '' - object: us_verification - zip_lookups_error: - description: Error - content: - application/json: + $ref: '#/components/schemas/cmp_id' + name: campaignId + description: id of the campaign + in: query + responses: + '200': + $ref: '#/components/responses/all_uploads' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/uploads \ + -u : + label: CURL + - lang: Ruby + source: | + uploadsApi = UploadsApi.new(config) + + begin + uploads = uploadsApi.list_upload({ campaign_id: "cmp_e05ee61ff80764b" }) + rescue => err + p err.message + end + label: RUBY + post: + operationId: upload_create + summary: Create + description: Creates a new upload with the provided properties. + tags: + - Uploads + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/upload_writable' + responses: + '201': + description: Upload created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/upload' + example: + id: upl_71be866e430b11e9 + accountId: fa9ea650fc7b31a89f92 + campaignId: cmp_1933ad629bae1408 + mode: live + failuresUrl: http://www.example.com + originalFilename: my_audience.csv + state: Draft + totalMailpieces: 100 + failedMailpieces: 5 + validatedMailpieces: 95 + bytesProcessed: 17628 + dateCreated: '2017-09-05T17:47:53.767Z' + dateModified: '2017-09-05T17:47:53.767Z' + requiredAddressColumnMapping: + name: null + address_line1: null + address_city: null + address_state: null + address_zip: null + optionalAddressColumnMapping: + address_line2: null + company: null + address_country: null + mergeVariableColumnMapping: null + metadata: + columns: [] + '422': + $ref: '#/components/responses/upload_validation_error' + x-codeSamples: + - lang: Shell + source: | + curl --location --request POST 'https://api.lob.com/v1/uploads' \ + --header 'Content-Type: application/json' \ + -u YOUR_KEY_HERE: \ + --data-raw '{ + "campaignId": "cmp_f33809b18b6f3ea8" + }' + label: CURL + - lang: Ruby + source: | + uploadCreate = UploadWritable.new({ + campaign_id: "cmp_e05ee61ff80764b", + }); + + uploadApi = UploadsApi.new(config) + + begin + createdUpload = uploadApi.create_upload(uploadCreate) + rescue => err + p err.message + end + label: RUBY + /uploads/{upl_id}: + parameters: + - in: path + name: upl_id + description: id of the upload + required: true + schema: + $ref: '#/components/schemas/upl_id' + get: + operationId: upload_retrieve + summary: Retrieve + description: >- + Retrieves the details of an existing upload. You need only supply the + unique upload identifier that was returned upon upload creation. + tags: + - Uploads + responses: + '200': + description: Returns an upload object + content: + application/json: + schema: + $ref: '#/components/schemas/upload' + example: + id: upl_71be866e430b11e9 + accountId: fa9ea650fc7b31a89f92 + campaignId: cmp_1933ad629bae1408 + mode: live + failuresUrl: http://www.example.com + originalFilename: my_audience.csv + state: Draft + totalMailpieces: 100 + failedMailpieces: 5 + validatedMailpieces: 95 + bytesProcessed: 17628 + dateCreated: '2017-09-05T17:47:53.767Z' + dateModified: '2017-09-05T17:47:53.767Z' + requiredAddressColumnMapping: + name: null + address_line1: null + address_city: null + address_state: null + address_zip: null + optionalAddressColumnMapping: + address_line2: null + company: null + address_country: null + mergeVariableColumnMapping: null + metadata: + columns: [] + '404': + $ref: '#/components/responses/upload_not_found' + '422': + $ref: '#/components/responses/upload_validation_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/uploads/upl_71be866e430b11e9 \ + -u : \ + label: CURL + - lang: Ruby + source: | + uploadApi = UploadsApi.new(config) + + begin + retrievedUpload = uploadApi.get_upload("upl_71be866e430b11e9") + rescue => err + p err.message + end + label: RUBY + patch: + operationId: upload_update + summary: Update + description: >- + Update the details of an existing upload. You need only supply the + unique identifier that was returned upon upload creation. + tags: + - Uploads + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/upload_updatable' + responses: + '200': + description: Returns an upload object + content: + application/json: + schema: + $ref: '#/components/schemas/upload' + example: + id: upl_71be866e430b11e9 + accountId: fa9ea650fc7b31a89f92 + campaignId: cmp_1933ad629bae1408 + mode: live + failuresUrl: http://www.example.com + originalFilename: my_audience.csv + state: Draft + totalMailpieces: 100 + failedMailpieces: 5 + validatedMailpieces: 95 + bytesProcessed: 17628 + dateCreated: '2017-09-05T17:47:53.767Z' + dateModified: '2017-09-05T17:47:53.767Z' + requiredAddressColumnMapping: + name: null + address_line1: null + address_city: null + address_state: null + address_zip: null + optionalAddressColumnMapping: + address_line2: null + company: null + address_country: null + mergeVariableColumnMapping: null + metadata: + columns: [] + '404': + $ref: '#/components/responses/upload_not_found' + '422': + $ref: '#/components/responses/upload_validation_error' + x-codeSamples: + - lang: Shell + source: | + curl -X PATCH https://api.lob.com/v1/uploads/upl_71be866e430b11e9 \ + -u : \ + -d "state=Ready for Validation" + label: CURL + - lang: Python + source: | + upload_updatable = UploadUpdatable( + state = UploadState("Ready for Validation"), + ) + + with ApiClient(configuration) as api_client: + api = UploadsApi(api_client) + + try: + updated_upload = api.update_upload("upl_71be866e430b11e9", upload_updatable) + except ApiException as e: + print(e) + label: PYTHON + - lang: Ruby + source: | + uploadUpdatable = UploadUpdatable.new({ + required_address_column_mapping: RequiredAddressColumnMapping.new({ + name: "recipient", + address_line1: "primary line", + address_city: "city", + address_state: "state", + address_zip: "zip_code", + }), + }) + + uploadApi = UploadsApi.new(config) + + begin + updatedUpload = uploadApi.update_upload("upl_71be866e430b11e9", uploadUpdatable) + rescue => err + p err.message + end + label: RUBY + delete: + operationId: upload_delete + summary: Delete + description: >- + Delete an existing upload. You need only supply the unique identifier + that was returned upon upload creation. + tags: + - Uploads + responses: + '204': + description: Successful Response + x-codeSamples: + - lang: Shell + source: | + curl -X DELETE https://api.lob.com/v1/uploads/upl_71be866e430b11e9 \ + -u : + label: CURL + - lang: Ruby + source: | + uploadApi = UploadsApi.new(config) + + begin + deletedUpload = uploadApi.delete_upload("upl_71be866e430b11e9") + rescue => err + p err.message + end + label: RUBY + /uploads/{upl_id}/file: + parameters: + - in: path + name: upl_id + description: ID of the upload + required: true + schema: + $ref: '#/components/schemas/upl_id' + post: + operationId: upload_file + summary: Upload file + description: >- + Upload an [audience + file](https://help.lob.com/print-and-mail/building-a-mail-strategy/campaign-or-triggered-sends/campaign-audience-guide) + and associate it with an upload. + tags: + - Uploads + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + responses: + '202': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/upload_file' + '422': + $ref: '#/components/responses/upload_validation_error' + x-codeSamples: + - lang: Shell + source: > + curl -X POST + https://api.lob.com/v1/uploads/upl_71be866e430b11e9/file \ + -u : \ + -F file=@ + label: CURL + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = UploadsApi(api_client) + + try: + res = api.upload_file("upl_71be866e430b11e9", open("", "rb")) + except ApiException as e: + print(e) + label: PYTHON + /uploads/{upl_id}/exports: + parameters: + - in: path + name: upl_id + description: ID of the upload + required: true + schema: + $ref: '#/components/schemas/upl_id' + post: + operationId: upload_export_create + summary: Create Export + description: >- + Campaign Exports can help you understand exactly which records in a + campaign could not be created. By initiating and retrieving an export, + you will get row-by-row errors for your campaign. For a step-by-step + walkthrough of creating a campaign and exporting failures, see our + [Campaigns + Guide](https://help.lob.com/print-and-mail/building-a-mail-strategy/campaign-or-triggered-sends/launch-your-first-campaign). + + + Create an export file associated with an upload. + tags: + - Uploads + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + type: + type: string + enum: + - all + - failures + - successes + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/upload_create_export' + 4XX: + $ref: '#/components/responses/upload_export_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/uploads/upl_71be866e430b11e9/exports \ + -u : \ + -d "type=failures" \ + label: CURL + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = UploadsApi(api_client) + + export_model = ExportModel( + type = "all" + ) + + try: + created_export = api.create_export("upl_71be866e430b11e9", export_model) + except ApiException as e: + print(e) + label: PYTHON + - lang: Ruby + source: | + exportModel = ExportModel.new({ + type: "all" + }) + + uploadsApi = UploadsApi.new(config) + + begin + createdExport = uploadsApi.create_export("upl_71be866e430b11e9", exportModel) + rescue => err + p err.message + end + label: RUBY + /uploads/{upl_id}/report: + parameters: + - in: path + name: upl_id + description: ID of the upload + required: true + schema: + $ref: '#/components/schemas/upl_id' + - in: query + required: false + name: status + description: >- + The status of line items to filter and retrieve. By default all line + items are returned. + schema: + enum: + - Validated + - Failed + - Processing + type: string + - in: query + required: false + name: limit + description: How many results to return. + schema: + type: integer + minimum: 1 + default: 100 + maximum: 100 + example: 10 + - $ref: '#/components/parameters/offset' + get: + operationId: report_retrieve + summary: Retrieve Line Item Report + description: >- + Retrieves the line item data for each row from the csv file associated + with the upload id record. NOTE: This endpoint is currently feature + flagged. Please reach out to Lob's support team if you would like + access to this API endpoint. + tags: + - Uploads + responses: + '200': + description: Returns an report object + content: + application/json: + schema: + type: object + required: + - data + - count + - offset + - total_count + properties: + data: + type: array + items: + properties: + rowNumber: + title: Row Number + type: number + description: The row number of the csv file containing this data. + status: + type: string + description: The processing status of line item. + enum: + - Validated + - Failed + - Processing + errorMessage: + type: string + nullable: true + description: >- + The error message detailing the reason why + processing the line item failed. + mailpieceId: + type: string + nullable: true + description: >- + The mailpiece id created from the line item when it + was validated. + originalData: + type: object + description: >- + Key-value pairs where each key is the column header + and each value is the value of the column for the + row. + next_url: + type: string + description: Url of next page of items in list. + nullable: true + prev_url: + type: string + description: Url of previous page of items in list. + nullable: true + 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 + example: + id: ex_6a94fe68fd151e0f8 + dateCreated: '2021-07-06T22:51:42.838Z' + dateModified: '2022-07-06T22:51:42.838Z' + deleted: false + s3Url: null + state: in_progress + type: failures + uploadId: upl_71be866e430b11e9 + '403': + $ref: '#/components/responses/feature_flag_disabled' + '404': + $ref: '#/components/responses/upload_not_found' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/uploads/upl_71be866e430b11e9/report \ + -u : + label: CURL + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = UploadsApi(api_client) + + try: + retrieved_report = api.get_report("upl_71be866e430b11e9") + except ApiException as e: + print(e) + label: PYTHON + - lang: Ruby + source: | + uploadsApi = UploadsApi.new(config) + + begin + retrievedreport = uploadsApi.get_report("upl_71be866e430b11e9") + rescue => err + p err.message + end + label: RUBY + /uploads/{upl_id}/exports/{ex_id}: + parameters: + - in: path + name: upl_id + description: ID of the upload + required: true + schema: + $ref: '#/components/schemas/upl_id' + - in: path + name: ex_id + description: ID of the export + required: true + schema: + $ref: '#/components/schemas/ex_id' + get: + operationId: export_retrieve + summary: Retrieve Export + description: >- + Retrieves the details of an existing export. You need only supply the + unique export identifier that was returned upon export creation. If you + try retrieving an export immediately after creating one (i.e., before + we're done processing the export), you will get back an export object + with `state = in_progress`. + tags: + - Uploads + responses: + '200': + description: Returns an export object + content: + application/json: + schema: + type: object + required: + - id + - dateCreated + - dateModified + - deleted + - s3Url + - state + - type + - uploadId + properties: + id: + $ref: '#/components/schemas/ex_id' + dateCreated: + type: string + format: date-time + description: >- + A timestamp in ISO 8601 format of the date the export was + created + dateModified: + type: string + format: date-time + description: >- + A timestamp in ISO 8601 format of the date the export was + last modified + deleted: + type: boolean + description: >- + Returns as `true` if the resource has been successfully + deleted. + s3Url: + type: string + description: The URL for the generated export file. + state: + type: string + enum: + - in_progress + - failed + - succeeded + description: >- + The state of the export file, which can be `in_progress`, + `failed` or `succeeded`. + type: + type: string + enum: + - all + - failures + - successes + description: >- + The export file type, which can be `all`, `failures` or + `successes`. + uploadId: + $ref: '#/components/schemas/upl_id' + example: + id: ex_6a94fe68fd151e0f8 + dateCreated: '2021-07-06T22:51:42.838Z' + dateModified: '2022-07-06T22:51:42.838Z' + deleted: false + s3Url: null + state: in_progress + type: failures + uploadId: upl_71be866e430b11e9 + x-codeSamples: + - lang: Shell + source: > + curl + https://api.lob.com/v1/uploads/upl_71be866e430b11e9/exports/ex_6a94fe68fd151e0f8 + \ + -u : + label: CURL + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = UploadsApi(api_client) + + try: + retrieved_export = api.get_export("upl_71be866e430b11e9", "ex_6a94fe68fd151e0f8") + except ApiException as e: + print(e) + label: PYTHON + - lang: Ruby + source: | + uploadsApi = UploadsApi.new(config) + + begin + retrievedExport = uploadsApi.get_export("upl_71be866e430b11e9", "ex_6a94fe68fd151e0f8") + rescue => err + p err.message + end + label: RUBY + /us_autocompletions: + post: + operationId: autocompletion + summary: Autocomplete + description: >- + Given an address prefix consisting of a partial primary line, as well as + optional input of city, state, and zip code, this functionality returns + up to 10 full US address suggestions. Not all of them will turn out to + be valid addresses; they'll need to be + [verified](#operation/verification_us). + tags: + - US Autocompletions + parameters: + - in: query + name: case schema: - $ref: '#/components/schemas/error' - example: - error: - code: invalid - message: zip_code is required - status_code: 422 - zip_lookups: - description: Returns a zip lookup object if a valid zip was provided. - headers: - ratelimit-limit: - $ref: '#/components/headers/ratelimit-limit' - ratelimit-remaining: - $ref: '#/components/headers/ratelimit-remaining' - ratelimit-reset: - $ref: '#/components/headers/ratelimit-reset' - content: - application/json: + type: string + enum: + - upper + - proper + default: upper + description: >- + Casing of the verified address. Possible values are `upper` and + `proper` for uppercased (e.g. "PO BOX") and proper-cased (e.g. "PO + Box"), respectively. Only affects `primary_line`, `city`, and + `state`. Default casing is `upper`. + required: false + - in: query + name: valid_addresses schema: - $ref: '#/components/schemas/zip' - example: - id: us_zip_c7cb63d68f8d6 - cities: - - city: SAN FRANCISCO - state: CA - county: SAN FRANCISCO - county_fips: '06075' - preferred: true - zip_code_type: standard - object: us_zip_lookup - zip_code: '94107' - events: - description: Returns an `event` object to the specified server. - content: - application/json: + type: boolean + enum: + - true + - false + default: false + description: >- + Possible values are `true` and `false`. If false, not all of the + suggestions in the response will be valid addresses; they'll need to + be verified in order to determine the deliverability. The + valid_addresses flag will greatly reduce the number of keystrokes + needed before reaching an intended address. + required: false + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/us_autocompletions_writable' + examples: + basic: + value: + address_prefix: 185 B + city: San Francisco + state: CA + zip_code: '94107' + geo_ip_sort: false + test: + value: + address_prefix: 1 sugg + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/us_autocompletions_writable' + examples: + basic: + value: + address_prefix: 185 B + city: San Francisco + state: CA + zip_code: '94107' + geo_ip_sort: false + test: + value: + address_prefix: 1 sugg + multipart/form-data: + schema: + $ref: '#/components/schemas/us_autocompletions_writable' + examples: + basic: + value: + address_prefix: 185 B + city: San Francisco + state: CA + zip_code: '94107' + geo_ip_sort: false + test: + value: + address_prefix: 1 sugg + responses: + '200': + $ref: '#/components/responses/us_autocompletions' + default: + $ref: '#/components/responses/us_autocompletions_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/us_autocompletions \ + -u : \ + -d "address_prefix=185 B" \ + -d "city=San Francisco" \ + -d "state=CA" + -d "zip_code=94107" + label: CURL + - lang: Typescript + source: | + const UsAutocompletions = new USAutocompletionsApi(av_config); + const autocompletionData: UsAutocompletionsWritable = { + address_prefix: '185 B', + city: 'SAN FRANCISCO' + }; + + try { + const autocompletedAddresses = await UsAutocompletions.autocomplete(autocompletionData); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.usAutocompletions.autocomplete({ + address_prefix: '185 B', + city: 'San Francisco', + state: 'CA', + zip_code: '94107', + }, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + usAutocompletionsApi = UsAutocompletionsApi.new(config) + + autocompletionData = UsAutocompletionsWritable.new({ + address_prefix: "185 B", + city: "San Francisco", + state: "CA", + zip_code: "94017", + }) + + begin + autocompletedAddress = usAutocompletionsApi.autocomplete(autocompletionData) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = UsAutocompletionsApi(api_client) + + autocompletion_data = UsAutocompletionsWritable( + address_prefix = "185 B", + city = "San Francisco", + state = "CA", + zip_code = "94017", + ) + + try: + autocompleted_addresses = api.autocomplete(autocompletion_data) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\UsAutocompletionsApi($config, + new GuzzleHttp\Client()); + + + $autocompletionData = new + OpenAPI\Client\Model\UsAutocompletionsWritable(array( + "address_prefix" => "185 B", + "city" => "San Francisco", + "state" => "CA", + "zip_code" => "94017", + )); + + + try { + $result = $apiInstance->autocomplete($autocompletionData); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: > + UsAutocompletionsApi apiInstance = new UsAutocompletionsApi(config); + + UsAutocompletionsWritable autoCompletionWritable = new + UsAutocompletionsWritable(); + + autoCompletionWritable.setAddressPrefix("185 B"); + + autoCompletionWritable.setCity("San Francisco"); + + autoCompletionWritable.setState("CA"); + + autoCompletionWritable.setZipCode("94017"); + + + try { + UsAutocompletions usAutocompletion = apiInstance.autocomplete(autoCompletionWritable); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.USAutocompletion.autocomplete(%{ + address_prefix: "185 B", + city: "San Francisco", + state: "CA", + zip_code: "94107" + }) + label: ELIXIR + - lang: CSharp + source: > + UsAutocompletionsApi api = new UsAutocompletionsApi(config); + + UsAutocompletionsWritable autoCompletionWritable = new + UsAutocompletionsWritable( + "185 B", // address_prefix + "San Francisco", // city + "CA", // state + "94017" // zip_code + ); + + + try { + UsAutocompletions usAutocompletion = api.autocomplete(autoCompletionWritable); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(context, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + var usAutocomplationsWritable = + *lob.NewUsAutocompletionsWritable("340 Wat") + + + resp, _, err := + suite.apiClient.UsAutocompletionsApi.Autocomplete(suite.ctx).UsAutocompletionsWritable(suite.usAutocomplationsWritable).Execute() + + + if err != nil { + return err + } + label: GO + /us_reverse_geocode_lookups: + post: + operationId: reverse_geocode_lookup + summary: Reverse Geocode Lookup + description: Reverse geocode a valid US location with a live API key. + tags: + - Reverse Geocode Lookups + parameters: + - in: query + name: size schema: - $ref: '#/components/schemas/events' - example: - event_type: - resource: postcards - enabled_for_test: true - id: postcard.created - object: event_type - reference_id: psc_d2d10a2e9cba991c - id: evt_d95ff8ffd2b5cfb4 - date_created: '2016-12-04T22:50:08.180Z' - body: - id: psc_d2d10a2e9cba991c - description: Test Postcard - metadata: {} - to: - id: adr_8e783523dd7f0e70 - description: Test Recipient Address - name: Harry Zhang - company: LOB - phone: null - email: null - address_line1: 123 TEST ST - address_line2: UNIT 1 - address_city: SAN FRANCISCO - address_state: CA - address_zip: '94107' - address_country: UNITED STATES - metadata: {} - date_created: '2016-12-04T10:51:51.844Z' - date_modified: '2016-12-04T10:51:51.844Z' - object: address - from: - id: adr_d2e26faf793ed422 - description: Test Sender Address - name: Harry Zhang - company: LOB - phone: null - email: null - address_line1: 123 TEST ST - address_line2: UNIT 1 - address_city: SAN FRANCISCO - address_state: CA - address_zip: '94107' - address_country: UNITED STATES - metadata: {} - date_created: '2016-12-04T10:51:51.845Z' - date_modified: '2016-12-04T10:51:51.845Z' - object: address - url: https://lob-assets.com/postcards/psc_d2d10a2e9cba991c.pdf?expires=1540372221&signature=dNE8OtbDymujUxBIMYle4H1cv1aZNFk - front_template_id: null - back_template_id: null - carrier: USPS - tracking_events: [] - thumbnails: - - small: https://lob-assets.com/postcards/psc_d2d10a2e9cba991c_thumb_small_1.png?expires=1540372221&signature=McmqScxPgbe7yQY5X31U3vhU8VUlfA1 - medium: https://lob-assets.com/postcards/psc_d2d10a2e9cba991c_thumb_medium_1.png?expires=1540372221&signature=VBClptOuCcj9Ybay6gE5aetT5j3C7KS - large: https://lob-assets.com/postcards/psc_d2d10a2e9cba991c_thumb_large_1.png?expires=1540372221&signature=RAHpIwoYKYM17f0bbaoOiamCkjpzYfH - - small: https://lob-assets.com/postcards/psc_d2d10a2e9cba991c_thumb_small_1.png?expires=1540372221&signature=5biHoaCmkphQaGJymOZxmTF0hHdiH4N - medium: https://lob-assets.com/postcards/psc_d2d10a2e9cba991c_thumb_medium_1.png?expires=1540372221&signature=1ApGx0kn5EO4qQKGJzCe6zEPnQpzpRY - large: https://lob-assets.com/postcards/psc_d2d10a2e9cba991c_thumb_large_1.png?expires=1540372221&signature=z80p90RBak6T26IAfg5yg7a6qKF53a8 - merge_variables: null - mail_type: usps_first_class - size: 4x6 - expected_delivery_date: '2016-12-09' - date_created: '2016-12-04T10:51:51.843Z' - date_modified: '2016-12-04T10:51:51.843Z' - send_date: '2016-12-04T10:56:51.843Z' - object: postcard - object: event - tracking_events: - description: Returns a `tracking_event` object to the specified server. - content: - application/json: + type: integer + minimum: 1 + default: 5 + maximum: 50 + example: 5 + description: >- + Determines the number of locations returned. Possible values are + between 1 and 50 and any number higher will be rounded down to 50. + Default size is a list of 5 reverse geocoded locations. + required: false + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/location' + example: + latitude: 37.7749 + longitude: 122.4194 + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/location' + example: + latitude: 37.7749 + longitude: 122.4194 + multipart/form-data: + schema: + $ref: '#/components/schemas/location' + example: + latitude: 37.7749 + longitude: 122.4194 + responses: + '200': + $ref: '#/components/responses/reverse_geocode_lookups' + default: + $ref: '#/components/responses/reverse_geocode_lookups_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/us_reverse_geocode_lookups \ + -u : \ + -d "latitude=37.7749" \ + -d "longitude=122.4194" \ + label: CURL + - lang: Typescript + source: > + const ReverseGeocodeLookup = new + ReverseGeocodeLookupsApi(av_config); + + const coordinates = new Location({ + latitude: 37.777456, + longitude: -122.393039 + }); + + try { + const geocode = await ReverseGeocodeLookup.lookup(coordinates); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.reverseGeocodeLookups.lookup({ + latitude: 37.7749, + longitude: 122.4194 + }, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + reverseGeocodeLookupsApi = ReverseGeocodeLookupsApi.new(config) + + coordinates = Location.new({ + latitude: 37.777456, + longitude: -122.393039, + }) + + begin + geocode = reverseGeocodeLookupsApi.lookup(coordinates) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = ReverseGeocodeLookupsApi(api_client) + + coordinates = Location( + latitude = 37.777456, + longitude = -122.393039, + ) + + try: + geocode = api.lookup(coordinates) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new + OpenAPI\Client\Api\ReverseGeocodeLookupsApi($config, new + GuzzleHttp\Client()); + + + $coordinates = new OpenAPI\Client\Model\Location(array( + "latitude" => "37.777456", + "longitude" => "-122.393039", + )); + + + try { + $result = $apiInstance->lookup($coordinates); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + label: PHP + - lang: Java + source: > + ReverseGeocodeLookupsApi apiInstance = new + ReverseGeocodeLookupsApi(config); + + + Location location = new Location(); + + location.setlatitude(37.777456f); + + location.setlongitude(-122.393039f); + + + try { + apiInstance.lookup(location, null); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.ReverseGeocodeLookup.lookup(%{ + latitude: 37.7749, + longitude: 122.4194 + }) + label: ELIXIR + - lang: CSharp + source: | + ReverseGeocodeLookupsApi api = new ReverseGeocodeLookupsApi(config); + + Location location = new Location( + 37.777456f, + -122.393039f + ); + + try { + api.lookup(location, null); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(context, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + var location = *lob.NewLocationWithDefaults() + + location.SetLatitude(37.777456) + + location.SetLongitude(122.393039) + + + resp, _, err := + apiClient.ReverseGeocodeLookupsApi.Lookup(context).Location(location).Execute() + + + if err != nil { + return err + } + label: GO + /us_verifications: + post: + operationId: us_verification + summary: Single Verify + description: >- + Verify a US or US territory address _with a live API key_. The address + can be in components (e.g. `primary_line` is "210 King Street", + `zip_code` is "94107") or as a single string (e.g. "210 King Street + 94107"), but not as both. Requests using a test API key validate + required fields but return empty values unless specific `primary_line` + values are provided. See the [US Verifications Test + Environment](#section/US-Verifications-Test-Env) for details. + tags: + - US Verifications + parameters: + - in: query + name: case schema: - oneOf: - - $ref: '#/components/schemas/tracking_event_normal' - - $ref: '#/components/schemas/tracking_event_certified' - examples: - normal: - value: - id: evnt_9e84094c9368cfb - type: normal - name: In Local Area - details: null - location: '72231' - time: '2016-06-30T15:51:41.000Z' - date_created: '2016-06-30T17:41:59.771Z' - date_modified: '2016-06-30T17:41:59.771Z' - object: tracking_event - certified: - value: - id: evnt_9e84094c9368cfb - type: certified - name: Delivered - details: - event: delivered - description: Package has been delivered. - notes: Delivered, Front Desk/Reception/Mail Room - action_required: false - location: '33408' - time: '2019-10-08T19:41:00Z' - date_created: '2019-10-08T19:41:00Z' - date_modified: '2019-10-08T19:41:00Z' - object: tracking_event - headers: - ratelimit-limit: - description: The rate limit for a given endpoint. - schema: - type: integer - example: 150 - ratelimit-remaining: - description: The number of requests remaining in the current window. - schema: - type: integer - example: 100 - ratelimit-reset: - description: | - The time at which the rate limit window resets in UTC epoch seconds - schema: - type: integer - example: 1528749846 -x-tagGroups: - - name: Overview - tags: - - Introduction - - Authentication - - Getting Started - - SDKs and Tools - - name: Address Book - tags: - - Addresses - - National Change of Address - - name: Print and Mail API - tags: - - Postcards - - Self Mailers - - Letters - - Checks - - Snap Packs - - Bank Accounts - - Templates - - Template Versions - - Template Design - - Manage Mail - - name: Campaigns API (BETA) - tags: - - Campaigns - - Creatives - - Uploads - - name: Address Verification API - tags: - - US Verifications - - US Verification Types - - US Autocompletions - - Reverse Geocode Lookups - - Zip Lookups - - Identity Validation - - Intl Autocompletions - - Intl Verifications - - name: Webhooks - tags: - - Webhooks - - Events - - Tracking Events - - name: Special Features - tags: - - Billing Groups - - Buckslips - - Buckslip Orders - - Cards - - Card Orders - - QR Codes - - URL Shortener - - name: Appendix - tags: - - Beta Program - - Errors - - Rate Limiting - - Requests and Responses - - Test and Live Environments - - Versioning and Changelog + type: string + enum: + - upper + - proper + default: upper + description: >- + Casing of the verified address. Possible values are `upper` and + `proper` for uppercased (e.g. "PO BOX") and proper-cased (e.g. "PO + Box"), respectively. Only affects `recipient`, `primary_line`, + `secondary_line`, `urbanization`, and `last_line`. Default casing is + `upper`. + required: false + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/us_verifications_writable' + examples: + basic: + value: + primary_line: 210 King Street + city: San Francisco + state: CA + zip_code: '94107' + full_payload: + value: + recipient: Walgreens + primary_line: Ave Wilson Churchill 123 + secondary_line: '' + urbanization: URB FAIR OAKS + city: RIO PIEDRAS + state: PR + zip_code: '00926' + single_line: + value: + address: 210 King Street 94107 + test: + value: + primary_line: po box + zip_code: '11111' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/us_verifications_writable' + examples: + basic: + value: + primary_line: 210 King Street + city: San Francisco + state: CA + zip_code: '94107' + full_payload: + value: + recipient: Walgreens + primary_line: Ave Wilson Churchill 123 + secondary_line: '' + urbanization: URB FAIR OAKS + city: RIO PIEDRAS + state: PR + zip_code: '00926' + single_line: + value: + address: 210 King Street 94107 + test: + value: + primary_line: po box + zip_code: '11111' + multipart/form-data: + schema: + $ref: '#/components/schemas/us_verifications_writable' + examples: + basic: + value: + primary_line: 210 King Street + city: San Francisco + state: CA + zip_code: '94107' + full_payload: + value: + recipient: Walgreens + primary_line: Ave Wilson Churchill 123 + secondary_line: '' + urbanization: URB FAIR OAKS + city: RIO PIEDRAS + state: PR + zip_code: '00926' + single_line: + value: + address: 210 King Street 94107 + test: + value: + primary_line: po box + zip_code: '11111' + responses: + '200': + $ref: '#/components/responses/us_verifications' + default: + $ref: '#/components/responses/us_verifications_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/us_verifications \ + -u : \ + -d "primary_line=210 King Street" \ + -d "city=San Francisco" \ + -d "state=CA" \ + -d "zip_code=94107" + label: CURL + - lang: Typescript + source: | + const UsVerification = new USVerificationsApi(av_config); + const verificationData1: UsVerificationsWritable = { + primary_line: '210 King Street', + city: 'San Francisco', + state: 'CA', + zip_code: '94107' + }; + + try { + const singleVerified = await UsVerification.verifySingle(verificationData1); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.usVerifications.verify({ + primary_line: '210 King Street', + city: 'San Francisco', + state: 'CA', + zip_code: '94107' + }, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + usVerificationsApi = UsVerificationsApi.new(config) + + verificationData = UsVerificationsWritable.new({ + primary_line: "210 King Street", + city: "San Francisco", + state: "CA", + zip_code: "94017", + }) + + begin + singleVerifiedAddr = usVerificationsApi.verifySingle(verificationData) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = UsVerificationsApi(api_client) + verification_data_1 = UsVerificationsWritable( + primary_line = "210 King Street", + city = "San Francisco", + state = "CA", + zip_code = "94017", + ) + + try: + single_verified = api.verifySingle(verification_data_1) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\UsVerificationsApi($config, + new GuzzleHttp\Client()); + + + $verificationData = new + OpenAPI\Client\Model\UsVerificationsWritable(array( + 'primary_line' => '210 King Street', + 'city' => 'San Francisco', + 'state' => 'CA', + 'zip_code' => '94017', + )); + + + try { + $result = $apiInstance->verifySingle($verificationData); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + - lang: Java + source: > + UsVerificationsWritable singleVerify = new + UsVerificationsWritable(); + + singleVerify.setPrimaryLine("210 King Street"); + + singleVerify.setCity("San Francisco"); + + singleVerify.setState("CA"); + + singleVerify.setZipCode("94017"); + + + UsVerificationsApi apiInstance = new UsVerificationsApi(config); + + try { + apiInstance.verifySingle(singleVerify, null); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.USVerification.verify(%{ + primary_line: "210 King Street", + city: "San Francisco", + state: "CA", + zip_code: "94107" + }) + label: ELIXIR + - lang: CSharp + source: | + UsVerificationsWritable singleVerify = new UsVerificationsWritable( + null, + null, + "210 King Street", + null, + null, + "San Francisco", + "CA", + "94017" + ); + + UsVerificationsApi api = new UsVerificationsApi(config); + + try { + api.verifySingle(singleVerify, null); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + /us_zip_lookups: + post: + operationId: zip_lookup + summary: Lookups + description: Returns information about a ZIP code + tags: + - Zip Lookups + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/zip5' + example: + zip_code: '94107' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/zip5' + example: + zip_code: '94107' + multipart/form-data: + schema: + $ref: '#/components/schemas/zip5' + example: + zip_code: '94107' + responses: + '200': + $ref: '#/components/responses/zip_lookups' + default: + $ref: '#/components/responses/zip_lookups_error' + x-codeSamples: + - lang: Shell + source: | + curl https://api.lob.com/v1/us_zip_lookups \ + -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ + -d "zip_code=94107" + label: CURL + - lang: Typescript + source: | + const ZipLookup = new ZipLookupsApi(av_config); + const zipRequest : ZipEditable = { + zip_code: '07090' + } + try { + const zipLookup : Zip = await ZipLookup.lookup(zipRequest); + } catch (err: any) { + console.error(err); + } + label: TYPESCRIPT + - lang: Javascript + source: | + Lob.usZipLookups.lookup({ + zip_code: '94107' + }, function (err, res) { + console.log(err, res); + }); + label: NODE + - lang: Ruby + source: | + zipLookupsApi = ZipLookupsApi.new(config) + + zipRequest = ZipEditable.new({ + zip_code: "94107" + }) + + begin + zipLookup = zipLookupsApi.lookup(zipRequest) + rescue => err + p err.message + end + label: RUBY + - lang: Python + source: | + with ApiClient(configuration) as api_client: + api = ZipLookupsApi(api_client) + + zip_request = ZipEditable( + zip_code = "94107" + ) + + try: + zip_lookup = api.lookup(zip_request) + except ApiException as e: + print(e) + label: PYTHON + - lang: PHP + source: > + $apiInstance = new OpenAPI\Client\Api\ZipLookupsApi($config, new + GuzzleHttp\Client()); + + + $zipRequest = new OpenAPI\Client\Model\ZipEditable(array( + "zip_code" => '94107' + )); + + + try { + $result = $apiInstance->lookup($zipRequest); + } catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; + } + label: PHP + - lang: Java + source: | + ZipEditable zipEditable = new ZipEditable(); + zipEditable.setZipCode("94107"); + + ZipLookupsApi apiInstance = new ZipLookupsApi(config); + try { + Zip response = apiInstance.lookup(zipEditable); + } catch (ApiException e) { + e.printStackTrace(); + } + label: JAVA + - lang: Elixir + source: | + Lob.USZipLookup.lookup(%{ + zip_code: "94107" + }) + label: ELIXIR + - lang: CSharp + source: | + ZipEditable zipEditable = new ZipEditable("94107"); + + ZipLookupsApi api = new ZipLookupsApi(config); + + try { + Zip response = api.lookup(zipEditable); + } catch (ApiException e) { + Console.WriteLine(e.ToString()); + } + label: CSHARP + - lang: Go + source: > + var context = context.Background() + + context = context.WithValue(context, lob.ContextBasicAuth, + lob.BasicAuth{UserName: os.Getenv("")}) + + + var apiClient = *lob.NewAPIClient(configuration) + + + var zipEditable = *lob.NewZipEditable() + + zipEditable.SetZipCode("94107") + + + resp, _, err := + apiClient.ZipLookupsApi.Lookup(context).ZipEditable(zipEditable).Execute() + + + if err != nil { + return err + } + label: GO diff --git a/docs/index.html b/docs/index.html index ccf27463..899257a7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -166,27 +166,27 @@ data-modal-example-questions="How do I get started with the API,How does mailpiece tracking work?">