Class: ShopifyAPI::DraftOrder

Inherits:
Base show all
Includes:
Metafields
Defined in:
lib/shopify_api/resources/draft_order.rb

Instance Method Summary collapse

Methods included from Metafields

#add_metafield, #metafields

Methods inherited from Base

activate_session, #as_json, clear_session, #encode, #headers, init_prefix, init_prefix_explicit, #persisted?

Methods included from Countable

#count

Methods inherited from ActiveResource::Base

delete, headers

Instance Method Details

#complete(options = {}) ⇒ Object


10
11
12
# File 'lib/shopify_api/resources/draft_order.rb', line 10

def complete(options = {})
  load_attributes_from_response(put(:complete, options, nil))
end

#send_invoice(draft_order_invoice = ShopifyAPI::DraftOrderInvoice.new) ⇒ Object


5
6
7
8
# File 'lib/shopify_api/resources/draft_order.rb', line 5

def send_invoice(draft_order_invoice = ShopifyAPI::DraftOrderInvoice.new)
  resource = post(:send_invoice, {}, draft_order_invoice.encode)
  ShopifyAPI::DraftOrderInvoice.new(ShopifyAPI::DraftOrder.format.decode(resource.body))
end