Project

shipvine

0.0
No commit activity in last 3 years
No release in over 3 years
Shipvine API bindings
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 5.0
~> 10.0

Runtime

~> 1.3.1
~> 0.13.7
~> 2.6.0
 Project Readme

Shipvine

Installation

gem 'shipvine'

Configuration

Shipvine.api_key = ENV['SHIPVINE_API_KEY']
Shipvine.merchant_code = ENV['SHIPVINE_MERCHANT_CODE']

# optional, if you want to disable XML validation
Shipvine.validate_xml = false

# optional
Shipvine.testmode = true

# optional, if you want to use HTTPParty's debugging
if !Rails.env.production?
  Shipvine::Client.debug_output $stdout
end

Usage

FulfillmentRequest

fulfillment_request = Shipvine::FulfillmentRequest.new(
  merchant_identifier: order_id,
  email_address: email,
  first_name: first_name,
  last_name: last_name,
  address: {
    company: company,
    address1: address1,
    address2: address2,
    city_or_town: city,
    state_or_province: state,
    postal_code: zipcode,
    phone: phone,
  },
  lines: items,
  shipping_method: shipping_method,
  # optional
  metadata: {
    channel: channel,
    environment: Rails.env
  }
)

fulfillment_request.create
  • Discount, tax, and shipping is set to 0 USD. If you need to pass the actual values, submit a PR adding the feature to pass these values to the fulfillment request.
  • First name, last name is required. The company name is used if no name is defined.
  • ShipVine::FulfillmentRequest#get_shipvine_identifier will throw a 404 if the fulfillment request is not shipped

Item & Item Group

item_group = Shipvine::ItemGroup.new(
  merchant_identifier: 'group-name',
  name: 'group-name',
  harmonized_code: '6105100000',
  country_of_origin: 'US'
)

item_group.create

item = Shipvine::Item.new(
  group_merchant_identifier: 'group-name'
  merchant_identifier: 'item-sku',
  name: 'item-name',
  harmonized_code: '6105100000',
  country_of_origin: 'US',
  weight: {
    magnitude: 0.25,
    unit: 'Pounds'
  },
  barcodes: {
    barcode: 'UPC'
  },
  metadata: {
    environment: Rails.env,
  }
)

item.create

Development

Notes

  • deep_compact! is added to Hash and Array. This might cause issues if this gem is used in larger applications. Feel free to submit a PR :)
  • There are no tests for this gem. It is tested via integration tests in another project.