plenty_client 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +23 -0
- data/.rspec +2 -0
- data/.rubocop.yml +43 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +154 -0
- data/Rakefile +6 -0
- data/lib/plenty_client/config.rb +15 -0
- data/lib/plenty_client/constants.rb +362 -0
- data/lib/plenty_client/endpoint.rb +73 -0
- data/lib/plenty_client/item/attribute/name.rb +52 -0
- data/lib/plenty_client/item/attribute/value.rb +52 -0
- data/lib/plenty_client/item/attribute/value_name.rb +52 -0
- data/lib/plenty_client/item/attribute.rb +36 -0
- data/lib/plenty_client/item/barcode.rb +56 -0
- data/lib/plenty_client/item/cross_selling.rb +26 -0
- data/lib/plenty_client/item/image/availability.rb +37 -0
- data/lib/plenty_client/item/image/name.rb +57 -0
- data/lib/plenty_client/item/image.rb +53 -0
- data/lib/plenty_client/item/manufacturer/commission.rb +52 -0
- data/lib/plenty_client/item/manufacturer.rb +36 -0
- data/lib/plenty_client/item/property/market_reference.rb +52 -0
- data/lib/plenty_client/item/property/name.rb +52 -0
- data/lib/plenty_client/item/property.rb +36 -0
- data/lib/plenty_client/item/property_group.rb +36 -0
- data/lib/plenty_client/item/property_group_name.rb +44 -0
- data/lib/plenty_client/item/sales_price.rb +37 -0
- data/lib/plenty_client/item/shipping_profile.rb +26 -0
- data/lib/plenty_client/item/unit.rb +35 -0
- data/lib/plenty_client/item/unit_name.rb +38 -0
- data/lib/plenty_client/item/variation/barcode.rb +53 -0
- data/lib/plenty_client/item/variation/bundle.rb +52 -0
- data/lib/plenty_client/item/variation/category.rb +52 -0
- data/lib/plenty_client/item/variation/client.rb +37 -0
- data/lib/plenty_client/item/variation/default_category.rb +45 -0
- data/lib/plenty_client/item/variation/description.rb +53 -0
- data/lib/plenty_client/item/variation/image.rb +49 -0
- data/lib/plenty_client/item/variation/market.rb +37 -0
- data/lib/plenty_client/item/variation/market_ident_number.rb +53 -0
- data/lib/plenty_client/item/variation/sales_price.rb +53 -0
- data/lib/plenty_client/item/variation/sku.rb +52 -0
- data/lib/plenty_client/item/variation/stock.rb +57 -0
- data/lib/plenty_client/item/variation/supplier.rb +52 -0
- data/lib/plenty_client/item/variation/warehouse.rb +52 -0
- data/lib/plenty_client/item/variation.rb +35 -0
- data/lib/plenty_client/item/variation_property.rb +36 -0
- data/lib/plenty_client/item/variation_property_value.rb +48 -0
- data/lib/plenty_client/item.rb +24 -0
- data/lib/plenty_client/item_set/component.rb +54 -0
- data/lib/plenty_client/item_set/config.rb +20 -0
- data/lib/plenty_client/item_set.rb +44 -0
- data/lib/plenty_client/order/contact_wish.rb +17 -0
- data/lib/plenty_client/order/coupon_code/contact.rb +20 -0
- data/lib/plenty_client/order/coupon_code/validation.rb +20 -0
- data/lib/plenty_client/order/coupon_code.rb +19 -0
- data/lib/plenty_client/order/currency.rb +32 -0
- data/lib/plenty_client/order/date.rb +32 -0
- data/lib/plenty_client/order/item/date.rb +20 -0
- data/lib/plenty_client/order/item/property.rb +20 -0
- data/lib/plenty_client/order/item/serial_number.rb +25 -0
- data/lib/plenty_client/order/item.rb +18 -0
- data/lib/plenty_client/order/property.rb +21 -0
- data/lib/plenty_client/order/referrer.rb +22 -0
- data/lib/plenty_client/order/shipping/country.rb +18 -0
- data/lib/plenty_client/order/shipping/information.rb +45 -0
- data/lib/plenty_client/order/shipping/package.rb +54 -0
- data/lib/plenty_client/order/shipping/profile.rb +23 -0
- data/lib/plenty_client/order/shipping/service_provider.rb +27 -0
- data/lib/plenty_client/order/shipping.rb +12 -0
- data/lib/plenty_client/order.rb +43 -0
- data/lib/plenty_client/request.rb +128 -0
- data/lib/plenty_client/sales_price/account.rb +30 -0
- data/lib/plenty_client/sales_price/country.rb +26 -0
- data/lib/plenty_client/sales_price/currency.rb +26 -0
- data/lib/plenty_client/sales_price/customer_class.rb +31 -0
- data/lib/plenty_client/sales_price/name.rb +36 -0
- data/lib/plenty_client/sales_price/online_store.rb +29 -0
- data/lib/plenty_client/sales_price/referrer.rb +25 -0
- data/lib/plenty_client/version.rb +3 -0
- data/lib/plenty_client.rb +108 -0
- data/plenty_client.gemspec +29 -0
- metadata +204 -0
@@ -0,0 +1,52 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Item
|
3
|
+
module Variation
|
4
|
+
class Warehouse
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
ITEM_VARIATION_WAREHOUSE_PATH = '/items/{itemId}/variations/{variationId}'.freeze
|
9
|
+
|
10
|
+
LIST_ITEM_VARIATIONS_WAREHOUSE = '/variation_warehouses'.freeze
|
11
|
+
GET_ITEM_VARIATIONS_WAREHOUSE = '/variation_warehouses/{warehouseId}'.freeze
|
12
|
+
CREATE_ITEM_VARIATIONS_WAREHOUSE = '/variation_warehouses'.freeze
|
13
|
+
UPDATE_ITEM_VARIATIONS_WAREHOUSE = '/variation_warehouses/{warehouseId}'.freeze
|
14
|
+
DELETE_ITEM_VARIATIONS_WAREHOUSE = '/variation_warehouses/{warehouseId}'.freeze
|
15
|
+
|
16
|
+
class << self
|
17
|
+
def list(item_id, variation_id, headers = {}, &block)
|
18
|
+
get(build_endpoint("#{ITEM_VARIATION_WAREHOUSE_PATH}#{LIST_ITEM_VARIATIONS_WAREHOUSE}",
|
19
|
+
item: item_id,
|
20
|
+
variation: variation_id), headers, &block)
|
21
|
+
end
|
22
|
+
|
23
|
+
def find(item_id, variation_id, warehouse_id, headers = {}, &block)
|
24
|
+
get(build_endpoint("#{ITEM_VARIATION_WAREHOUSE_PATH}#{GET_ITEM_VARIATIONS_WAREHOUSE}",
|
25
|
+
item: item_id,
|
26
|
+
variation: variation_id,
|
27
|
+
warehouse: warehouse_id), headers, &block)
|
28
|
+
end
|
29
|
+
|
30
|
+
def create(item_id, variation_id, body = {})
|
31
|
+
post(build_endpoint("#{ITEM_VARIATION_WAREHOUSE_PATH}#{CREATE_ITEM_VARIATIONS_WAREHOUSE}",
|
32
|
+
item: item_id,
|
33
|
+
variation: variation_id), body)
|
34
|
+
end
|
35
|
+
|
36
|
+
def update(item_id, variation_id, warehouse_id, body = {})
|
37
|
+
put(build_endpoint("#{ITEM_VARIATION_WAREHOUSE_PATH}#{CREATE_ITEM_VARIATIONS_WAREHOUSE}",
|
38
|
+
item: item_id,
|
39
|
+
variation: variation_id), body)
|
40
|
+
end
|
41
|
+
|
42
|
+
def delete(item_id, variation_id, warehouse_id)
|
43
|
+
delete(build_endpoint("#{ITEM_VARIATION_WAREHOUSE_PATH}#{DELETE_ITEM_VARIATIONS_WAREHOUSE}",
|
44
|
+
item: item_id,
|
45
|
+
variation: variation_id,
|
46
|
+
warehouse: warehouse_id))
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Item
|
3
|
+
module Variation
|
4
|
+
extend PlentyClient::Endpoint
|
5
|
+
extend PlentyClient::Request
|
6
|
+
ALL_VARIATIONS = '/items/variations'.freeze
|
7
|
+
DELETE_ITEMS_VARIATION = '/items/{itemId}/variations/{variationId}'.freeze
|
8
|
+
GET_ITEMS_VARIATION = '/items/{itemId}/variations/{variationId}'.freeze
|
9
|
+
GET_ITEMS_VARIATIONS = '/items/{itemId}/variations'.freeze
|
10
|
+
POST_ITEMS_VARIATION = '/items/{itemId}/variations'.freeze
|
11
|
+
|
12
|
+
class << self
|
13
|
+
def all(headers = {}, &block)
|
14
|
+
get(ALL_VARIATIONS, headers, &block)
|
15
|
+
end
|
16
|
+
|
17
|
+
def find(item_id, variation_id, headers = {}, &block)
|
18
|
+
get(build_endpoint(GET_ITEMS_VARIATION, item: item_id, variation: variation_id), headers, &block)
|
19
|
+
end
|
20
|
+
|
21
|
+
def list(item_id, headers = {}, &block)
|
22
|
+
get(build_endpoint(GET_ITEMS_VARIATIONS, item: item_id), headers, &block)
|
23
|
+
end
|
24
|
+
|
25
|
+
def update(item_id, body = {})
|
26
|
+
post(build_endpoint(POST_ITEMS_VARIATION, item: item_id), body)
|
27
|
+
end
|
28
|
+
|
29
|
+
def delete(item_id, variation_id)
|
30
|
+
delete(build_endpoint(DELETE_ITEMS_VARIATION, item: item_id, variation: variation_id))
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Item
|
3
|
+
class VariationProperty
|
4
|
+
extend PlentyClient::Endpoint
|
5
|
+
extend PlentyClient::Request
|
6
|
+
|
7
|
+
LIST_ALL_VARIATION_PROPERTIES = '/items/{itemId}/variation_properties'.freeze
|
8
|
+
GET_VARIATION_PROPERTY = '/items/{itemId}/variation_properties/{variationId}'.freeze
|
9
|
+
CREATE_VARIATION_PROPERTY = '/items/{itemId}/variation_properties'.freeze
|
10
|
+
UPDATE_VARIATION_PROPERTY = '/items/{itemId}/variation_properties/{variationId}'.freeze
|
11
|
+
DELETE_VARIATION_PROPERTY = '/items/{itemId}/variation_properties/{variationId}'.freeze
|
12
|
+
|
13
|
+
class << self
|
14
|
+
def list(headers = {}, &block)
|
15
|
+
get(build_endpoint(LIST_ALL_VARIATION_PROPERTIES), headers, &block)
|
16
|
+
end
|
17
|
+
|
18
|
+
def find(item_id, variation_id, headers = {}, &block)
|
19
|
+
get(build_endpoint(GET_VARIATION_PROPERTY, item: item_id, variation: variation_id), headers, &block)
|
20
|
+
end
|
21
|
+
|
22
|
+
def create(headers = {})
|
23
|
+
post(build_endpoint(CREATE_VARIATION_PROPERTY), headers)
|
24
|
+
end
|
25
|
+
|
26
|
+
def update(item_id, variation_id, headers = {})
|
27
|
+
put(build_endpoint(UPDATE_VARIATION_PROPERTY, item: item_id, variation: variation_id), headers)
|
28
|
+
end
|
29
|
+
|
30
|
+
def delete(item_id, variation_id)
|
31
|
+
delete(build_endpoint(DELETE_VARIATION_PROPERTY, item: item_id, variation: variation_id))
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Item
|
3
|
+
class VariationPropertyValue
|
4
|
+
extend PlentyClient::Endpoint
|
5
|
+
extend PlentyClient::Request
|
6
|
+
|
7
|
+
VARIATION_PROPERTY_VALUE_BASE_PATH = '/items/{itemId}/variation_properties/{variationId}'.freeze
|
8
|
+
|
9
|
+
LIST_ALL_VARIATION_PROPERTY_VALUES = '/values'.freeze
|
10
|
+
GET_VARIATION_PROPERTY_VALUES = '/values/{propertyId}'.freeze
|
11
|
+
CREATE_VARIATION_PROPERTY_VALUES = '/values'.freeze
|
12
|
+
UPDATE_VARIATION_PROPERTY_VALUES = '/values/{propertyId}'.freeze
|
13
|
+
DELETE_VARIATION_PROPERTY_VALUES = '/values/{propertyId}'.freeze
|
14
|
+
|
15
|
+
class << self
|
16
|
+
def list(headers = {}, &block)
|
17
|
+
get(build_endpoint("#{VARIATION_PROPERTY_VALUE_BASE_PATH}#{LIST_ALL_VARIATION_PROPERTY_VALUES}"),
|
18
|
+
headers, &block)
|
19
|
+
end
|
20
|
+
|
21
|
+
def find(item_id, variation_id, property_id, headers = {}, &block)
|
22
|
+
get(build_endpoint("#{VARIATION_PROPERTY_VALUE_BASE_PATH}#{GET_VARIATION_PROPERTY}"),
|
23
|
+
item: item_id,
|
24
|
+
variation: variation_id,
|
25
|
+
property: property_id), headers, &block)
|
26
|
+
end
|
27
|
+
|
28
|
+
def create(body = {})
|
29
|
+
post(build_endpoint("#{VARIATION_PROPERTY_VALUE_BASE_PATH}#{CREATE_VARIATION_PROPERTY_VALUES}"), body)
|
30
|
+
end
|
31
|
+
|
32
|
+
def update(item_id, variation_id, property_id, body = {})
|
33
|
+
put(build_endpoint("#{VARIATION_PROPERTY_VALUE_BASE_PATH}#{UPDATE_VARIATION_PROPERTY_VALUES}",
|
34
|
+
item: item_id,
|
35
|
+
variation: variation_id,
|
36
|
+
property: property_id), body)
|
37
|
+
end
|
38
|
+
|
39
|
+
def delete(item_id, variation_id, property_id)
|
40
|
+
delete(build_endpoint("#{VARIATION_PROPERTY_VALUE_BASE_PATH}#{DELETE_VARIATION_PROPERTY_VALUES}",
|
41
|
+
item: item_id,
|
42
|
+
variation: variation_id,
|
43
|
+
property: property_id))
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Item
|
3
|
+
extend PlentyClient::Endpoint
|
4
|
+
extend PlentyClient::Request
|
5
|
+
|
6
|
+
LIST_ITEMS = '/items'.freeze
|
7
|
+
CREATE_ITEM = '/items'.freeze
|
8
|
+
GET_ITEM = '/items/{itemId}'.freeze
|
9
|
+
|
10
|
+
class << self
|
11
|
+
def list(headers = {}, &block)
|
12
|
+
get(build_endpoint(LIST_ITEMS), headers, &block)
|
13
|
+
end
|
14
|
+
|
15
|
+
def find(item_id = nil, headers = {}, &block)
|
16
|
+
get(build_endpoint(GET_ITEM, item: item_id), headers, &block)
|
17
|
+
end
|
18
|
+
|
19
|
+
def create(body = {})
|
20
|
+
post(CREATE_ITEM, body)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module ItemSet
|
3
|
+
class Component
|
4
|
+
extend PlentyClient::Endpoint
|
5
|
+
extend PlentyClient::Request
|
6
|
+
LIST_ITEM_SET_COMPONENT = '/item_sets/{itemSetId}/components/{componentId}'.freeze
|
7
|
+
LIST_ITEM_SETS_COMPONENT = '/item_sets/{itemSetId}/components'.freeze
|
8
|
+
CREATE_ITEM_SET_COMPONENTS = '/item_sets/{itemSetId}/components'.freeze
|
9
|
+
UPDATE_ITEM_SET_COMPONENT = '/item_sets/{itemSetId}/components/{componentId}'.freeze
|
10
|
+
UPDATE_ITEM_SETS_COMPONENTS = '/item_sets/{itemSetId}/components'.freeze
|
11
|
+
DELETE_ITEM_SET_COMPONENT = '/item_sets/{itemSetId}/components/{componentId}'.freeze
|
12
|
+
DELETE_ITEM_SETS_COMPONENTS = '/item_sets/{itemSetId}/components'.freeze
|
13
|
+
|
14
|
+
class << self
|
15
|
+
def list_item_set_component(item_set_id, component_id, headers = {}, &block)
|
16
|
+
get(build_endpoint(LIST_ITEM_SET_COMPONENT,
|
17
|
+
item_set: item_set_id,
|
18
|
+
component: component_id), headers, &block)
|
19
|
+
end
|
20
|
+
|
21
|
+
def list_item_sets_components(item_set_id, headers = {}, &block)
|
22
|
+
get(build_endpoint(LIST_ITEM_SETS_COMPONENT,
|
23
|
+
item_set: item_set_id), headers, &block)
|
24
|
+
|
25
|
+
|
26
|
+
def create(item_set_id, body = {})
|
27
|
+
post(build_endpoint(CREATE_ITEM_SET_COMPONENTS, item_set: item_set_id), body)
|
28
|
+
end
|
29
|
+
|
30
|
+
def update_item_set_component(item_set_id, component_id, body = {})
|
31
|
+
put(build_endpoint(UPDATE_ITEM_SET_COMPONENT,
|
32
|
+
item_set: item_set_id,
|
33
|
+
component: component_id), body)
|
34
|
+
end
|
35
|
+
|
36
|
+
def update_item_sets_components(item_set_id, body = {})
|
37
|
+
put(build_endpoint(UPDATE_ITEM_SETS_COMPONENTS,
|
38
|
+
item_set: item_set_id), body)
|
39
|
+
end
|
40
|
+
|
41
|
+
def delete_item_set_component(item_set_id, component_id, body = {})
|
42
|
+
delete(build_endpoint(DELETE_ITEM_SET_COMPONENT,
|
43
|
+
item_set: item_set_id,
|
44
|
+
component: component_id), body)
|
45
|
+
end
|
46
|
+
|
47
|
+
def delete_item_sets_components(item_set_id, body = {})
|
48
|
+
delete(build_endpoint(DELETE_ITEM_SETS_COMPONENTS,
|
49
|
+
item_set: item_set_id), body)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module ItemSet
|
3
|
+
class Config
|
4
|
+
extend PlentyClient::Endpoint
|
5
|
+
extend PlentyClient::Request
|
6
|
+
FIND_ITEM_SET_CONFIGS = '/item_sets/{itemSetId}/config'.freeze
|
7
|
+
UPDATE_ITEM_SET_CONFIGS = '/item_sets/{itemSetId}/config'.freeze
|
8
|
+
|
9
|
+
class << self
|
10
|
+
def find(item_set_id, headers = {}, &block)
|
11
|
+
get(build_endpoint(FIND_ITEM_SET_CONFIGS, item_set: item_set_id), headers, &block)
|
12
|
+
end
|
13
|
+
|
14
|
+
def update(item_set_id, body = {})
|
15
|
+
put(build_endpoint(UPDATE_ITEM_SET_CONFIGS, item_set: item_set_id), body)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module ItemSet
|
3
|
+
extend PlentyClient::Endpoint
|
4
|
+
extend PlentyClient::Request
|
5
|
+
|
6
|
+
LIST_ITEM_SETS = '/item_sets'.freeze
|
7
|
+
GET_ITEM_SET = '/item_sets/{itemSetId}'.freeze
|
8
|
+
CREATE_ITEM_SETS = '/item_sets'.freeze
|
9
|
+
UPDATE_ITEM_SET = '/item_sets/{itemSetId}'.freeze
|
10
|
+
UPDATE_ITEM_SETS = '/item_sets'.freeze
|
11
|
+
DELETE_ITEM_SET = '/item_sets/{itemSetId}'.freeze
|
12
|
+
DELETE_ITEM_SETS = '/item_sets'.freeze
|
13
|
+
|
14
|
+
class << self
|
15
|
+
def list(headers = {}, &block)
|
16
|
+
get(build_endpoint(LIST_ITEM_SETS), headers, &block)
|
17
|
+
end
|
18
|
+
|
19
|
+
def find(item_set_id, headers = {}, &block)
|
20
|
+
get(build_endpoint(GET_ITEM_SET, item_set: item_set_id), headers, &block)
|
21
|
+
end
|
22
|
+
|
23
|
+
def create(body = {})
|
24
|
+
post(build_endpoint(CREATE_ITEM_SETS), body)
|
25
|
+
end
|
26
|
+
|
27
|
+
def update(item_set_id, body = {})
|
28
|
+
put(build_endpoint(UPDATE_ITEM_SET, item_set: item_set_id), body)
|
29
|
+
end
|
30
|
+
|
31
|
+
def update_sets(body = {})
|
32
|
+
put(build_endpoint(UPDATE_ITEM_SETS), body)
|
33
|
+
end
|
34
|
+
|
35
|
+
def delete(item_set_id, body = {})
|
36
|
+
put(build_endpoint(DELETE_ITEM_SET, item_set: item_set_id), body)
|
37
|
+
end
|
38
|
+
|
39
|
+
def delete_sets(body = {})
|
40
|
+
put(build_endpoint(DELETE_ITEM_SETS), body)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Order
|
3
|
+
module ContactWish
|
4
|
+
extend PlentyClient::Endpoint
|
5
|
+
extend PlentyClient::Request
|
6
|
+
|
7
|
+
FIND_ORDER_COTACT_WISH = '/orders/{orderId}/contactWish'.freeze
|
8
|
+
|
9
|
+
class << self
|
10
|
+
def find(order_id, headers = {}, &block)
|
11
|
+
get(build_endpoint(FIND_ORDER_COTACT_WISH, order: order_id), headers, &block)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Order
|
3
|
+
module CouponCode
|
4
|
+
class Contact
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
LIST_COUPON_CONTACTS = '/orders/coupons/codes/contacts/{contactId}'.freeze
|
9
|
+
|
10
|
+
class << self
|
11
|
+
def update(contact_id, headers = {}, &block)
|
12
|
+
post(build_endpoint(LIST_COUPON_CONTACTS,
|
13
|
+
contact: contact_id), headers, &block)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Order
|
3
|
+
module CouponCode
|
4
|
+
class Validation
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
VALIDATE_COUPON = '/orders/coupons/codes/{coupon}'.freeze
|
9
|
+
|
10
|
+
class << self
|
11
|
+
def update(coupon_string, headers = {}, &block)
|
12
|
+
post(build_endpoint(VALIDATE_COUPON,
|
13
|
+
coupon_string: coupon_string), headers, &block)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Order
|
3
|
+
module CouponCode
|
4
|
+
extend PlentyClient::Endpoint
|
5
|
+
extend PlentyClient::Request
|
6
|
+
|
7
|
+
UPDATE_COUPON_CODE = '/orders/{orderId}/coupons/{coupon}'.freeze
|
8
|
+
|
9
|
+
class << self
|
10
|
+
def update(order_id, coupon_string, headers = {}, &block)
|
11
|
+
post(build_endpoint(UPDATE_COUPON_CODE,
|
12
|
+
order: order_id,
|
13
|
+
coupon_string: coupon_string), headers, &block)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Order
|
3
|
+
class Currency
|
4
|
+
extend PlentyClient::Endpoint
|
5
|
+
extend PlentyClient::Request
|
6
|
+
|
7
|
+
LIST_CURRENCIES = '/orders/currencies'.freeze
|
8
|
+
FIND_CURRENCY_ISO = '/orders/currencies/{currencyIso}'.freeze
|
9
|
+
FIND_COUNTRIES_FOR_CURRENCY = '/orders/currencies/{currencyIso}/countries'.freeze
|
10
|
+
FIND_CURRENCY_FOR_COUNTRY = '/orders/currencies/countries/{countryId}'.freeze
|
11
|
+
|
12
|
+
class << self
|
13
|
+
def list(headers = {}, &block)
|
14
|
+
get(build_endpoint(LIST_CURRENCIES), headers, &block)
|
15
|
+
end
|
16
|
+
|
17
|
+
def find(currency_iso, headers = {}, &block)
|
18
|
+
get(build_endpoint(FIND_CURRENCY_ISO, currency: currency_iso), headers, &block)
|
19
|
+
end
|
20
|
+
|
21
|
+
def find_countries(currency_iso, headers = {}, &block)
|
22
|
+
get(build_endpoint(FIND_COUNTRIES_FOR_CURRENCY, currency: currency_iso), headers, &block)
|
23
|
+
end
|
24
|
+
|
25
|
+
def find_currency(country_id, headers = {}, &block)
|
26
|
+
get(build_endpoint(FIND_CURRENCY_FOR_COUNTRY, country: country_id), headers, &block)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Order
|
3
|
+
class Date
|
4
|
+
extend PlentyClient::Endpoint
|
5
|
+
extend PlentyClient::Request
|
6
|
+
|
7
|
+
LIST_ORDER_DATE_TYPE_NAMES = '/orders/dates/types/{typeId}/names'.freeze
|
8
|
+
FIND_ORDER_DATE_TYPE_NAME = '/orders/dates/types/{typeId}/names/{lang}'.freeze
|
9
|
+
LIST_ORDER_DATES = '/orders/{orderId}/dates'.freeze
|
10
|
+
FIND_ORDER_DATE = '/orders/{orderId}/dates/{typeId}'.freeze
|
11
|
+
|
12
|
+
class << self
|
13
|
+
def list_date_type_names(type_id, headers = {}, &block)
|
14
|
+
get(build_endpoint(LIST_ORDER_DATE_TYPE_NAMES, type: type_id), headers, &block)
|
15
|
+
end
|
16
|
+
|
17
|
+
def find_date_type_name(type_id, lang, headers = {}, &block)
|
18
|
+
get(build_endpoint(FIND_ORDER_DATE_TYPE_NAME, type: type_id, lang: lang), headers, &block)
|
19
|
+
end
|
20
|
+
|
21
|
+
def list(currency_iso, headers = {}, &block)
|
22
|
+
get(build_endpoint(LIST_ORDER_DATES, order: order_id), headers, &block)
|
23
|
+
end
|
24
|
+
|
25
|
+
def find(order_id, type_id, headers = {}, &block)
|
26
|
+
get(build_endpoint(FIND_ORDER_DATE, order: order_id, type: type_id), headers, &block)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Order
|
3
|
+
module Item
|
4
|
+
class Date
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
# get /orders/items/{orderItemId}/dates
|
9
|
+
# get /orders/items/{orderItemId}/dates/{typeId}
|
10
|
+
# post /orders/items/{orderItemId}/dates/{typeId}
|
11
|
+
# put /orders/items/{orderItemId}/dates/{typeId}
|
12
|
+
# delete /orders/items/{orderItemId}/dates/{typeId}
|
13
|
+
# get /orders/items/dates/{orderDateId}
|
14
|
+
# post /orders/items/dates
|
15
|
+
# put /orders/items/dates/{orderDateId}
|
16
|
+
# delete /orders/items/dates/{orderDateId}
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Order
|
3
|
+
module Item
|
4
|
+
class Property
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
# get /orders/items/{orderItemId}/properties
|
9
|
+
# get /orders/items/{orderItemId}/properties/{typeId}
|
10
|
+
# post /orders/items/{orderItemId}/properties/{typeId}
|
11
|
+
# put /orders/items/{orderItemId}/properties/{typeId}
|
12
|
+
# delete /orders/items/{orderItemId}/properties/{typeId}
|
13
|
+
# get /rest/orders/items/properties/{id}
|
14
|
+
# post /rest/orders/items/properties
|
15
|
+
# put /rest/orders/items/properties/{id}
|
16
|
+
# delete /rest/orders/items/properties/{id}
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Order
|
3
|
+
module Item
|
4
|
+
class SerialNumber
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
LIST_SERIAL_NUMBERS = '/orders/{orderId}/items/serialNumbers'.freeze
|
9
|
+
LIST_ORDER_ITEM_SERIAL_NUMBERS = '/orders/{orderId}/items/{orderItemId}/serialNumbers'.freeze
|
10
|
+
|
11
|
+
class << self
|
12
|
+
def list(order_id, headers = {}, &block)
|
13
|
+
get(build_endpoint(LIST_SERIAL_NUMBERS, order: order_id), headers, &block)
|
14
|
+
end
|
15
|
+
|
16
|
+
def find(order_id, order_item_id, headers = {}, &block)
|
17
|
+
get(build_endpoint(LIST_ORDER_ITEM_SERIAL_NUMBERS,
|
18
|
+
order: order_id,
|
19
|
+
order_item: order_item_id), headers, &block)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Order
|
3
|
+
module Item
|
4
|
+
extend PlentyClient::Endpoint
|
5
|
+
extend PlentyClient::Request
|
6
|
+
|
7
|
+
DELETE_ORDERS_ORDER_ITEM = '/orders/{orderId}/items/{orderItemId}'.freeze
|
8
|
+
|
9
|
+
class << self
|
10
|
+
def delete(order_id, order_item_id)
|
11
|
+
delete(build_endpoint(DELETE_ORDERS_ORDER_ITEM,
|
12
|
+
order: order_id,
|
13
|
+
order_item: order_item_id))
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Order
|
3
|
+
class Property
|
4
|
+
extend PlentyClient::Endpoint
|
5
|
+
extend PlentyClient::Request
|
6
|
+
|
7
|
+
# get /rest/orders/{orderId}/properties/{typeId?}
|
8
|
+
# post /rest/orders/{orderId}/properties
|
9
|
+
# put /rest/orders/{orderId}/properties/{typeId}
|
10
|
+
# put /rest/orders/properties/{id}
|
11
|
+
# delete /rest/orders/properties/{id}
|
12
|
+
# delete /rest/orders/{orderId}/properties/{typeId}
|
13
|
+
# get /rest/orders/properties/types
|
14
|
+
# get /rest/orders/properties/types/{typeId}
|
15
|
+
# post /rest/orders/properties/types
|
16
|
+
# put /rest/orders/properties/types/{typeId}
|
17
|
+
# delete /rest/orders/properties/types/{typeId}
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Order
|
3
|
+
class Referrer
|
4
|
+
extend PlentyClient::Endpoint
|
5
|
+
extend PlentyClient::Request
|
6
|
+
|
7
|
+
LIST_REFERRERS = '/orders/referrers'.freeze
|
8
|
+
CREATE_ORDER_REFERRER = '/orders/referrers/{parentReferrerId}'.freeze
|
9
|
+
|
10
|
+
class << self
|
11
|
+
def list(headers = {})
|
12
|
+
get(build_endpoint(LIST_REFERRERS), headers)
|
13
|
+
end
|
14
|
+
|
15
|
+
def create(parent_referrer_id, body = {})
|
16
|
+
post(build_endpoint(CREATE_ORDER_REFERRER, parent_referrer: parent_referrer_id), body)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Order
|
3
|
+
module Shipping
|
4
|
+
class Country
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
LIST_SHIPPING_COUNTRIES = '/orders/shipping/countries'.freeze
|
9
|
+
|
10
|
+
class << self
|
11
|
+
def list(headers = {}, &block)
|
12
|
+
get(build_endpoint(LIST_SHIPPING_COUNTRIES), headers, &block)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Order
|
3
|
+
module Shipping
|
4
|
+
class Information
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
BASE_ORDERS_SHIPPING_INFORMATION_PATH = '/orders/{orderId}/shipping'.freeze
|
9
|
+
|
10
|
+
LIST_ORDERS_SHIPPING_INFORMATION = '/shipping_information'.freeze
|
11
|
+
DELETE_ORDER_SHIPPING_INFORMATION = '/shipping_information'.freeze
|
12
|
+
CREATE_ORDER_SHIPPING_INFORMATION = '/shipping_information'.freeze
|
13
|
+
UPDATE_ORDER_SHIPPING_STATUS = '/shipping_information/status'.freeze
|
14
|
+
UPDATE_ORDER_SHIPPING_DATA = '/shipping_information/additional_data'.freeze
|
15
|
+
|
16
|
+
class << self
|
17
|
+
def list(order_id, headers = {}, &block)
|
18
|
+
get(build_endpoint("#{BASE_ORDERS_SHIPPING_INFORMATION_PATH}#{LIST_ORDERS_SHIPPING_INFORMATION}",
|
19
|
+
order: order_id), headers, &block)
|
20
|
+
end
|
21
|
+
|
22
|
+
def create(order_id, body = {})
|
23
|
+
post(build_endpoint("#{BASE_ORDERS_SHIPPING_INFORMATION_PATH}#{CREATE_ORDER_SHIPPING_INFORMATION}",
|
24
|
+
order: order_id), body)
|
25
|
+
end
|
26
|
+
|
27
|
+
def update_status(order_id, body = {})
|
28
|
+
put(build_endpoint("#{BASE_ORDERS_SHIPPING_INFORMATION_PATH}#{UPDATE_ORDER_SHIPPING_STATUS}",
|
29
|
+
order: order_id), body)
|
30
|
+
end
|
31
|
+
|
32
|
+
def update_data(order_id, body = {})
|
33
|
+
put(build_endpoint("#{BASE_ORDERS_SHIPPING_INFORMATION_PATH}#{UPDATE_ORDER_SHIPPING_DATA}",
|
34
|
+
order: order_id), body)
|
35
|
+
end
|
36
|
+
|
37
|
+
def delete(order_id, body = {})
|
38
|
+
delete(build_endpoint("#{BASE_ORDERS_SHIPPING_INFORMATION_PATH}#{DELETE_ORDER_SHIPPING_INFORMATION}",
|
39
|
+
order: order_id), body)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|