Giter Site home page Giter Site logo

blastramp's Introduction

blastramp

Ruby wrapper for the blastramp SOAP API

Blastramp is a Shipping Services Client Library for polling inventory and submitting shipping orders.

Usage example

blastramp = Blastramp::Session.new('vendor_code', 'vendor_access_key')

# Get array of inventory counts for a product SKU at all warehouses:
inventory_counts = blastramp.inventory_counts.find('1000-BLK-M')

# Get a single inventory count for one warehouse id:
inventory_count = blastramp.inventory_counts.find_by_whid('1000-BLK-M','0001')

# Get # of available_to_sell units from an inventory_count
inventory_count.available_to_sell
inventory_count.backordered
inventory_count.total_shipped

# Create order:
order = Blastramp::Order.new

order.order_id = '123'
order.order_date = Time.now.strftime("%m/%d/%Y")
order.start_date = Time.now.strftime("%m/%d/%Y")
order.expiry_date = 1.month.from_now.strftime("%m/%d/%Y")
order.ship_method = 'UPS Worldwide Standard'
order.warehouse_id = '0001'

ship_address = Blastramp::Address.new
ship_address.name = 'John Smith'
ship_address.line1 = '1222 Oak Street'
ship_address.line2 = 'Apt 205'
ship_address.city = 'Springfield'
ship_address.provstate = 'IL'
ship_address.country = 'USA'
ship_address.phone = '555-555-5555'
order.ship_address = ship_address
order.bill_address = ship_address

order_item = Blastramp::OrderItem.new
order_item.order_id = '123'
order_item.sku = 'AAA-01-XX'
order_item.quantity = 2
order_item.item_value = 12.99
order.order_items << order_item

order_upload = Blastramp::OrderUpload.new(blastramp, [order])
order_upload.submit

Credits

Sponsored by zkron.com

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.