Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 7 additions & 61 deletions examples/example.py → examples/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# Creating an Address Object

example_address = lob.Address.create(
name='Joe Smith',
address_line1='104, Printing Boulevard',
address_city='Boston',
address_state='MA',
address_country='US',
address_zip='12345'
name = 'Joe Smith',
address_line1 = '104, Printing Boulevard',
address_city = 'Boston',
address_state = 'MA',
address_country = 'US',
address_zip = '12345'
)
print "\n"
print "Address Response"
Expand All @@ -21,61 +21,7 @@
print "======================================================="
print "\n"

# Creating an Object

example_object = lob.Object.create(
name='Example Object',
file='https://www.lob.com/test.pdf',
setting_id='201',
quantity=1,
double_sided=1
)

print "Object Response"
print "\n"
print "======================================================="
print "\n"
print example_object
print "\n"
print "======================================================="
print "\n"

# Creating a Job using the previously created address and object

example_job = lob.Job.create(
to_address = example_address,
from_address = example_address,
objects = example_object,
)

print "Job Response"
print "\n"
print "======================================================="
print "\n"
print example_job
print "\n"
print "======================================================="
print "\n"

# Creating a Postcard

example_postcard = lob.Postcard.create(
to_address = example_address,
from_address = example_address,
front = 'https://www.lob.com/test.pdf',
back = 'https://www.lob.com/test.pdf'
)

print "Postcard Response"
print "\n"
print "======================================================="
print "\n"
print example_postcard
print "\n"
print "======================================================="
print "\n"

# Creating a Bank Account
# Creating a Bank Account using the previously created account_address

example_bank_account = lob.BankAccount.create(
routing_number = '123456789',
Expand Down
58 changes: 58 additions & 0 deletions examples/job.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import lob
lob.api_key = "test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc" # Replace this API key with your own.

# Creating an Address Object

example_address = lob.Address.create(
name = 'Joe Smith',
address_line1 = '104, Printing Boulevard',
address_city = 'Boston',
address_state = 'MA',
address_country = 'US',
address_zip = '12345'
)
print "\n"
print "Address Response"
print "\n"
print "======================================================="
print "\n"
print example_address
print "\n"
print "======================================================="
print "\n"

# Creating an Object

example_object = lob.Object.create(
name = 'Example Object',
file = 'https://www.lob.com/test.pdf',
setting_id = '201',
quantity = 1,
double_sided = 1
)

print "Object Response"
print "\n"
print "======================================================="
print "\n"
print example_object
print "\n"
print "======================================================="
print "\n"

# Creating a Job using the previously created address and object

example_job = lob.Job.create(
to_address = example_address,
from_address = example_address,
objects = example_object,
)

print "Job Response"
print "\n"
print "======================================================="
print "\n"
print example_job
print "\n"
print "======================================================="
print "\n"
40 changes: 40 additions & 0 deletions examples/postcard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import lob
lob.api_key = "test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc" # Replace this API key with your own.

# Creating an Address Object

example_address = lob.Address.create(
name = 'Joe Smith',
address_line1 = '104, Printing Boulevard',
address_city = 'Boston',
address_state = 'MA',
address_country = 'US',
address_zip = '12345'
)
print "\n"
print "Address Response"
print "\n"
print "======================================================="
print "\n"
print example_address
print "\n"
print "======================================================="
print "\n"

# Creating a Postcard

example_postcard = lob.Postcard.create(
to_address = example_address,
from_address = example_address,
front = 'https://www.lob.com/test.pdf',
back = 'https://www.lob.com/test.pdf'
)

print "Postcard Response"
print "\n"
print "======================================================="
print "\n"
print example_postcard
print "\n"
print "======================================================="
print "\n"