class EasyPost::Services::Batch
Public Instance Methods
Source
# File lib/easypost/services/batch.rb, line 49 def add_shipments(id, params = {}) response = @client.make_request(:post, "batches/#{id}/add_shipments", params) EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS) end
Add Shipments to a Batch
.
Source
# File lib/easypost/services/batch.rb, line 14 def all(params = {}) filters = { key: 'batches' } get_all_helper('batches', MODEL_CLASS, params, filters) end
Source
# File lib/easypost/services/batch.rb, line 28 def buy(id, params = {}) response = @client.make_request(:post, "batches/#{id}/buy", params) EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS) end
Buy a Batch
.
Source
# File lib/easypost/services/batch.rb, line 7 def create(params = {}) wrapped_params = { batch: params } response = @client.make_request(:post, 'batches', wrapped_params) EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS) end
Create a Batch
.
Source
# File lib/easypost/services/batch.rb, line 56 def create_scan_form(id, params = {}) response = @client.make_request(:post, "batches/#{id}/scan_form", params) EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS) end
Create a ScanForm for a Batch
.
Source
# File lib/easypost/services/batch.rb, line 35 def label(id, params = {}) response = @client.make_request(:post, "batches/#{id}/label", params) EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS) end
Convert the label format of a Batch
.
Source
# File lib/easypost/services/batch.rb, line 42 def remove_shipments(id, params = {}) response = @client.make_request(:post, "batches/#{id}/remove_shipments", params) EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS) end
Remove Shipments from a Batch
.
Source
# File lib/easypost/services/batch.rb, line 21 def retrieve(id) response = @client.make_request(:get, "batches/#{id}") EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS) end
Retrieve a Batch