Intuitive, RESTful, and Built for Developers

curl

node

ruby

python

php

java

curl https://api.lob.com/v1/postcards \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
  -d "description=Demo Postcard job" \
  -d "to[name]=Harry Zhang" \
  -d "to[address_line1]=123 Test Street" \
  -d "to[address_city]=Mountain View" \
  -d "to[address_state]=CA" \
  -d "to[address_zip]=94041" \
  -d "to[address_country]=US" \
  --data-urlencode "front=<html style='padding: 1in; font-size: 50;'>Front HTML for {{name}}</html>" \
  --data-urlencode "back=<html style='padding: 1in; font-size: 20;'>Back HTML for {{name}}</html>" \
  -d "data[name]=Harry"
            
Lob.postcards.create({
  description: 'Demo Postcard job',
  to: {
    name: 'Joe Smith',
    address_line1: '123 Main Street',
    address_city: 'Mountain View',
    address_state: 'CA',
    address_zip: '94041'
  },
  front: '<html style='padding: 1in; font-size: 50;'>Front HTML for {{name}}</html>',
  back: '<html style='padding: 1in; font-size: 20;'>Back HTML for {{name}}</html>',
  data: {
    name: 'Harry'
  }
}, function (err, res) {
  console.log(err, res);
});
            
@lob.postcards.create(
  description: "Demo Postcard job",
  to: {
    name: "Harry Zhang",
    address_line1: "123 Test Street",
    address_city: "Mountain View",
    address_state: "MA",
    address_country: "US",
    address_zip: 94041
  },
  front: "<html style='padding: 1in; font-size: 50;'>Front HTML for {{name}}</html>",
  back: "<html style='padding: 1in; font-size: 20;'>Back HTML for {{name}}</html>",
  data: {
    name: "Harry"
  }
)
            
lob.Postcard.create(
  to_address = {
    'name': 'Harry Zhang',
    'address_line1': '123 Test Street',
    'address_city': 'Mountain View',
    'address_state': 'CA',
    'address_zip': '94041',
    'address_country': 'US'
  },
  front = '<html style='padding: 1in; font-size: 50;'>Front HTML for {{name}}</html>',
  back = '<html style='padding: 1in; font-size: 20;'>Back HTML for {{name}}</html>',
  data = {
    'name': 'Harry'
  }
)
            
$lob->postcards()->create(array(
  'description' => 'Demo Postcard job',
  'to'      => array(
    'name'          => 'Joe Smith',
    'address_line1' => '123 Main Street',
    'address_city'  => 'Mountain View',
    'address_state' => 'CA',
    'address_zip'   => '94041',
  ),
  'front'       => '<html style='padding: 1in; font-size: 50;'>Front HTML for {{name}}</html>',
  'back'        => '<html style='padding: 1in; font-size: 20;'>Back HTML for {{name}}</html>',
  'data[name]'  => 'Harry'
));
            
final Map<String, String> data = Maps.newHashMap();
data.put("name", "Harry");

final PostcardRequest postcardRequest = PostcardRequest.builder()
  .to(AddressRequest.builder()
    .name("Harry Zhang")
    .line1("123 Test Street")
    .city("Mountain View")
    .state("CA")
    .zip("94041")
    .country("US")
    .build())
  .front("<html style='padding: 1in; font-size: 50;'>Front HTML for {{name}}</html>")
  .back("<html style='padding: 1in; font-size: 20;'>Back HTML for {{name}}</html>")
  .data(data)
  .build();
final PostcardResponse postcard = client.createPostcard(postcardRequest).get();
            

INTEGRATION IS EASY


Send a transactional postcard through a simple REST API.

We built Lob with developers in mind and offer wrappers in Node, Ruby, Python, PHP, Java, and iOS to help you get started in minutes.


READ DOCS

Built With Your Business in Mind

No Hassle and Easy-to-use Service that Just Works

Simple Pricing

On demand access, pay-as-you-go pricing, no minimums

Clear Docs

Get up and running in minutes with clean documentation

Read Docs >

Secure & Safe

Bank-grade security with PCI and HIPAA compliance

Reliable Support

Lightning-fast support directly from our engineers

Contact Us >