Skip to content

gabe-ochoa/squarespace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SquareSpace Commerce API

Gem Version

Ruby gem for interacting with the Squarespace API.

Installation

Add this line to your application's Gemfile:

gem 'squarespace'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install squarespace

Example usage

Initializing the client

client = Squarespace::Client.new(
  app_name: 'YOUR_APP_NAME'
  app_secret: 'YOUR_CLIENT_SECRET'
)

Get an order

client.get_order(order_id)

Get all orders

client.get_orders

Get all orders with a specified fulfillment status

client.get_orders('pending')
client.get_orders('fulfilled')
client.get_orders('canceled')

Fulfill an order

client.fulfill_order(order_id, shipments, send_notification)
`shipments` is a hash array in the form of
[{
  tracking_number: 'test_tracking_number1',
  tracking_url: 'https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=test_tracking_number2',
  carrier_name: 'USPS',
  service: 'ground'
},{
  tracking_number: 'test_tracking_number2',
  tracking_url: nil,
  carrier_name: 'USPS',
  service: 'prioritt'
}]

Testing

bundle exec rspec

About

A Ruby gem to interface with the Squarespace API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages