Module: PlentyClient::Order

Includes:
Endpoint, Request
Defined in:
lib/plenty_client.rb,
lib/plenty_client/order.rb,
lib/plenty_client/order/date.rb,
lib/plenty_client/order/item.rb,
lib/plenty_client/order/currency.rb,
lib/plenty_client/order/property.rb,
lib/plenty_client/order/referrer.rb,
lib/plenty_client/order/shipping.rb,
lib/plenty_client/order/item/date.rb,
lib/plenty_client/order/coupon_code.rb,
lib/plenty_client/order/contact_wish.rb,
lib/plenty_client/order/item/property.rb,
lib/plenty_client/order/status_history.rb,
lib/plenty_client/order/shipping/country.rb,
lib/plenty_client/order/shipping/package.rb,
lib/plenty_client/order/shipping/profile.rb,
lib/plenty_client/order/item/serial_number.rb,
lib/plenty_client/order/coupon_code/contact.rb,
lib/plenty_client/order/shipping/information.rb,
lib/plenty_client/order/coupon_code/validation.rb,
lib/plenty_client/order/shipping/service_provider.rb

Defined Under Namespace

Modules: ContactWish, CouponCode, Item, Shipping, StatusHistory Classes: Currency, Date, Property, Referrer

Constant Summary collapse

CREATE_ORDER =
'/orders'
LIST_ORDERS =
'/orders'
FIND_ORDER =
'/orders/{orderId}'
LIST_CONTACTS_ORDERS =
'/orders/contacts/{contactId}'
UPDATE_ORDER =
'/orders/{orderId}'
LIST_ORDERS_PACKAGE_NUMBERS =
'/orders/{orderId}/packagenumbers'
DELETE_ORDER =
'/orders/{orderId}'

Class Method Summary collapse

Methods included from Request

included

Methods included from Endpoint

included

Class Method Details

.create(body = {}) ⇒ Object



17
18
19
# File 'lib/plenty_client/order.rb', line 17

def create(body = {})
  post(build_endpoint(CREATE_ORDER), body)
end

.destroy(order_id, body = {}) ⇒ Object



41
42
43
# File 'lib/plenty_client/order.rb', line 41

def destroy(order_id, body = {})
  delete(build_endpoint(DELETE_ORDER, order: order_id), body)
end

.find(order_id = nil, headers = {}, &block) ⇒ Object



33
34
35
# File 'lib/plenty_client/order.rb', line 33

def find(order_id = nil, headers = {}, &block)
  get(build_endpoint(FIND_ORDER, order: order_id), headers, &block)
end

.list(headers = {}, &block) ⇒ Object



21
22
23
# File 'lib/plenty_client/order.rb', line 21

def list(headers = {}, &block)
  get(build_endpoint(LIST_ORDERS), headers, &block)
end

.list_contacts_orders(contact_id, headers = {}, &block) ⇒ Object



25
26
27
# File 'lib/plenty_client/order.rb', line 25

def list_contacts_orders(contact_id, headers = {}, &block)
  get(build_endpoint(LIST_CONTACTS_ORDERS, contact: contact_id), headers, &block)
end

.list_package_numbers(order_id, headers = {}, &block) ⇒ Object



29
30
31
# File 'lib/plenty_client/order.rb', line 29

def list_package_numbers(order_id, headers = {}, &block)
  get(build_endpoint(LIST_ORDERS_PACKAGE_NUMBERS, order: order_id), headers, &block)
end

.update(order_id, body = {}) ⇒ Object



37
38
39
# File 'lib/plenty_client/order.rb', line 37

def update(order_id, body = {})
  put(build_endpoint(UPDATE_ORDER, order: order_id), body)
end