Skip to content

Instantly share code, notes, and snippets.

Avatar

Sawyer Bateman sawyer

  • EasyPost
  • San Francisco, CA
View GitHub Profile
@sawyer
sawyer / easypost_stripe_relay.rb
Last active Sep 3, 2017
Sample integration of EasyPost with Stripe Relay.
View easypost_stripe_relay.rb
require 'stripe'
require 'easypost'
Stripe.api_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
EasyPost.api_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
SHIPPING_ORIGIN_ADDRESS = {
company: "EasyPost",
street1: "417 Montgomery St",
street2: "5 FL",
@sawyer
sawyer / all_shipments.php
Last active Aug 29, 2015
Paging through all EasyPost Shipments in PHP
View all_shipments.php
<?php
require_once("../lib/easypost.php");
\EasyPost\EasyPost::setApiKey('cueqNZUb3ldeWTNX7MU3Mel8UXtaAMUi');
$base_params = array(
"start_datetime" => "2015-07-01",
"end_datetime" => "2015-08-01",
"purchased" => false, // actually means only_purchased?
"page_size" => 10
@sawyer
sawyer / ThreadTest.java
Created May 15, 2015
EasyPost Java Threading Example
View ThreadTest.java
package com.easypost;
import com.easypost.model.*;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.Rule;
import org.junit.rules.ExpectedException;
import java.text.ParseException;
import java.util.HashMap;
View easypost_batch_from_csv.rb
# This program will take swag.csv and create a batch of USPS
# shipping labels in one PDF file for easy printing using
# the EasyPost simple shipping API.
#
# If you have any questions about EasyPost or want help
# modifying this script for other carriers or a non-US
# source address please email us anytime at contact@easypost.com
#
# Usage:
# easypost_batch_from_csv.rb