Skip to content

Solidus Easypost Setup Guide

Allison Reilly edited this page Apr 27, 2020 · 7 revisions

Installation

This goes in your Gemfile:

  gem 'solidus_easypost'

This goes in your terminal:

  rake railties:install:migrations
  rake db:migrate

This goes into a new file called config/initializers/easy_post.rb:

  EasyPost.api_key = 'YOUR_API_KEY_HERE'

To enable DDP, place this in the file config/initializers/easy_post.rb:

  Spree::Easypost::Config.ddp_enabled = true

We also have the below configurations available.

Spree::Easypost::Config.api_enabled = true # default
Spree::Easypost::Config.address_verification_enabled = false # default
Spree::Easypost::Config.verify_strict_enabled = false # default

Setup

  1. Set up your Stock Location with a valid address
  2. Make sure all variants have their weight set. Weight is in ounces. Weight cannot be 0.
  3. To generate shipping method options, attempt checkout with an address from each country you ship to.
  4. You will receive an error "We are unable to calculate shipping rates for the selected items." Go to the admin panel for shipping methods. There will be new shipping methods available.
  5. To make a shipping method available to users, edit the shipping method and apply "Available to Users". Now you can complete checkout.

In the admin panel, when a shipment is ready, click ship and the shipping label will be generated in Easypost.

Available Features

Address Verification

To enable address verification, set the configuration preference address_verification_enabled to true. The default is false. Place this in the file config/initializers/easy_post.rb:

Spree::Easypost::Config.address_verification_enabled = true

Before transitioning to delivery, the address will be verified through Easypost. If the address is invalid, checkout will be refused and an error message will flash with Easypost's API error response message.

The verify strict option is available in the configuration, but if an address is invalid, it raise an exception.

Spree::Easypost::Config.verify_strict_enabled = false # default

Digital Products

We have added the ability to handle digital products, or non-shippable products.

  1. Create a stock location only for digital products: Check is digital to true.
  2. Shipping Category “Digital Products” or whatever you would like
  3. Shipping Method for digital products:
    • Set stock location to the is digital enabled stock location
    • Set the shipping category to digital products
    • Set flat rate of 0
  4. Assign shipping category to products that are digital products
  5. Adjust stock on digital products to only have backorderable checked on the digital product stock location. 0 on hand for all.
  6. Adjust stock on all non digital products to have backorderable set to false.