plenty_client 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- 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,53 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Item
|
3
|
+
module Variation
|
4
|
+
class Barcode
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
ITEM_VARIATION_BARCODE_PATH = '/items/{itemId}/variations/{variationId}'.freeze
|
9
|
+
|
10
|
+
LIST_ITEM_VARIATION_BARCODES = "#{ITEM_VARIATION_BARCODE_PATH}/variation_barcodes".freeze
|
11
|
+
GET_ITEM_VARIATIONS_BARCODE = "#{ITEM_VARIATION_BARCODE_PATH}/variation_barcodes/{barcodeId}".freeze
|
12
|
+
CREATE_ITEM_VARIATIONS_BARCODE = "#{ITEM_VARIATION_BARCODE_PATH}/variation_barcodes".freeze
|
13
|
+
UPDATE_ITEM_VARIATIONS_BARCODE = "#{ITEM_VARIATION_BARCODE_PATH}/variation_barcodes/{barcodeId}".freeze
|
14
|
+
DELETE_ITEM_VARIATIONS_BARCODE = "#{ITEM_VARIATION_BARCODE_PATH}/variation_barcodes/{barcodeId}".freeze
|
15
|
+
|
16
|
+
class << self
|
17
|
+
def list(item_id, variation_id, headers = {}, &block)
|
18
|
+
get(build_endpoint("#{ITEM_VARIATION_BARCODE_PATH}#{LIST_ITEM_VARIATION_BARCODES}",
|
19
|
+
item: item_id,
|
20
|
+
variation: variation_id), headers, &block)
|
21
|
+
end
|
22
|
+
|
23
|
+
def find(item_id, variation_id, barcode_id, headers = {})
|
24
|
+
get(build_endpoint("#{ITEM_VARIATION_BARCODE_PATH}#{GET_ITEM_VARIATIONS_BARCODE}",
|
25
|
+
item: item_id,
|
26
|
+
variation: variation_id,
|
27
|
+
barcode: barcode_id), headers, &block)
|
28
|
+
end
|
29
|
+
|
30
|
+
def create(item_id, variation_id, body = {})
|
31
|
+
post(build_endpoint("#{ITEM_VARIATION_BARCODE_PATH}#{CREATE_ITEM_VARIATIONS_BARCODE}",
|
32
|
+
item: item_id,
|
33
|
+
variation: variation_id), body)
|
34
|
+
end
|
35
|
+
|
36
|
+
def update(item_id, variation_id, barcode_id, body = {})
|
37
|
+
put(build_endpoint("#{ITEM_VARIATION_BARCODE_PATH}#{UPDATE_ITEM_VARIATIONS_BARCODE}",
|
38
|
+
item: item_id,
|
39
|
+
variation: variation_id,
|
40
|
+
barcode: barcode_id), body)
|
41
|
+
end
|
42
|
+
|
43
|
+
def delete(item_id, variation_id, barcode_id)
|
44
|
+
delete(build_endpoint("#{ITEM_VARIATION_BARCODE_PATH}#{DELETE_ITEM_VARIATIONS_BARCODE}",
|
45
|
+
item: item_id,
|
46
|
+
variation: variation_id,
|
47
|
+
barcode: barcode_id))
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Item
|
3
|
+
module Variation
|
4
|
+
class Bundle
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
ITEM_VARIATION_BUNDLE_PATH = '/items/{itemId}/variations/{variationId}'.freeze
|
9
|
+
|
10
|
+
LIST_ITEM_VARIATIONS_BUNDLE = '/variation_bundles'.freeze
|
11
|
+
GET_ITEM_VARIATIONS_BUNDLE = '/variation_bundles/{bundleId}'.freeze
|
12
|
+
CREATE_ITEM_VARIATIONS_BUNDLE = '/variation_bundles'.freeze
|
13
|
+
UPDATE_ITEM_VARIATIONS_BUNDLE = '/variation_bundles/{bundleId}'.freeze
|
14
|
+
DELETE_ITEM_VARIATIONS_BUNDLE = '/variation_bundles/{bundleId}'.freeze
|
15
|
+
|
16
|
+
class << self
|
17
|
+
def list(item_id, variation_id, headers = {}, &block)
|
18
|
+
get(build_endpoint("#{ITEM_VARIATION_BUNDLE_PATH}#{LIST_ITEM_VARIATIONS_BUNDLE}",
|
19
|
+
item: item_id,
|
20
|
+
variation: variation_id), headers, &block)
|
21
|
+
end
|
22
|
+
|
23
|
+
def find(item_id, variation_id, bundle_id, headers = {}, &block)
|
24
|
+
get(build_endpoint("#{ITEM_VARIATION_BUNDLE_PATH}#{GET_ITEM_VARIATIONS_BUNDLE}",
|
25
|
+
item: item_id,
|
26
|
+
variation: variation_id,
|
27
|
+
bundle: bundle_id), headers, &block)
|
28
|
+
end
|
29
|
+
|
30
|
+
def create(item_id, variation_id, body = {})
|
31
|
+
post(build_endpoint("#{ITEM_VARIATION_BUNDLE_PATH}#{CREATE_ITEM_VARIATIONS_BUNDLE}",
|
32
|
+
item: item_id,
|
33
|
+
variation: variation_id), body)
|
34
|
+
end
|
35
|
+
|
36
|
+
def update(item_id, variation_id, bundle_id, body = {})
|
37
|
+
put(build_endpoint("#{ITEM_VARIATION_BUNDLE_PATH}#{CREATE_ITEM_VARIATIONS_BUNDLE}",
|
38
|
+
item: item_id,
|
39
|
+
variation: variation_id), body)
|
40
|
+
end
|
41
|
+
|
42
|
+
def delete(item_id, variation_id, bundle_id)
|
43
|
+
delete(build_endpoint("#{ITEM_VARIATION_BUNDLE_PATH}#{DELETE_ITEM_VARIATIONS_BUNDLE}",
|
44
|
+
item: item_id,
|
45
|
+
variation: variation_id,
|
46
|
+
bundle: bundle_id))
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Item
|
3
|
+
module Variation
|
4
|
+
class Category
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
ITEM_VARIATION_CATEGORY_PATH = '/items/{itemId}/variations/{variationId}'.freeze
|
9
|
+
|
10
|
+
LIST_ITEM_VARIATIONS_CATEGORY = '/variation_categories'.freeze
|
11
|
+
GET_ITEM_VARIATIONS_CATEGORY = '/variation_categories/{catId}'.freeze
|
12
|
+
CREATE_ITEM_VARIATIONS_CATEGORY = '/variation_categories'.freeze
|
13
|
+
UPDATE_ITEM_VARIATIONS_CATEGORY = '/variation_categories/{catId}'.freeze
|
14
|
+
DELETE_ITEM_VARIATIONS_CATEGORY = '/variation_categories/{catId}'.freeze
|
15
|
+
|
16
|
+
class << self
|
17
|
+
def list(item_id, variation_id, headers = {}, &block)
|
18
|
+
get(build_endpoint("#{ITEM_VARIATION_CATEGORY_PATH}#{LIST_ITEM_VARIATIONS_CATEGORY}",
|
19
|
+
item: item_id,
|
20
|
+
variation: variation_id), headers, &block)
|
21
|
+
end
|
22
|
+
|
23
|
+
def find(item_id, variation_id, category_id, headers = {}, &block)
|
24
|
+
get(build_endpoint("#{ITEM_VARIATION_CATEGORY_PATH}#{GET_ITEM_VARIATIONS_CATEGORY}",
|
25
|
+
item: item_id,
|
26
|
+
variation: variation_id,
|
27
|
+
category: category_id), headers, &block)
|
28
|
+
end
|
29
|
+
|
30
|
+
def create(item_id, variation_id, body = {})
|
31
|
+
post(build_endpoint("#{ITEM_VARIATION_CATEGORY_PATH}#{CREATE_ITEM_VARIATIONS_CATEGORY}",
|
32
|
+
item: item_id,
|
33
|
+
variation: variation_id), body)
|
34
|
+
end
|
35
|
+
|
36
|
+
def update(item_id, variation_id, category_id, body = {})
|
37
|
+
put(build_endpoint("#{ITEM_VARIATION_CATEGORY_PATH}#{CREATE_ITEM_VARIATIONS_CATEGORY}",
|
38
|
+
item: item_id,
|
39
|
+
variation: variation_id), body)
|
40
|
+
end
|
41
|
+
|
42
|
+
def delete(item_id, variation_id, category_id)
|
43
|
+
delete(build_endpoint("#{ITEM_VARIATION_CATEGORY_PATH}#{DELETE_ITEM_VARIATIONS_CATEGORY}",
|
44
|
+
item: item_id,
|
45
|
+
variation: variation_id,
|
46
|
+
category: category_id))
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Item
|
3
|
+
module Variation
|
4
|
+
class Client
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
ITEM_VARIATION_CLIENTS_PATH = '/items/{itemId}/variations/{variationId}'.freeze
|
9
|
+
|
10
|
+
GET_ITEM_VARIATIONS_CLIENTS = '/variation_clients'.freeze
|
11
|
+
CREATE_ITEM_VARIATIONS_CLIENTS = '/variation_clients'.freeze
|
12
|
+
DELETE_ITEM_VARIATIONS_CLIENTS = '/variation_clients/{plentyId}'.freeze
|
13
|
+
|
14
|
+
class << self
|
15
|
+
def list(item_id, variation_id, headers = {}, &block)
|
16
|
+
get(build_endpoint("#{ITEM_VARIATION_CLIENTS_PATH}#{GET_ITEM_VARIATIONS_CLIENTS}",
|
17
|
+
item: item_id,
|
18
|
+
variation: variation_id), headers, &block)
|
19
|
+
end
|
20
|
+
|
21
|
+
def create(item_id, variation_id, body = {})
|
22
|
+
post(build_endpoint("#{ITEM_VARIATION_CLIENTS_PATH}#{CREATE_ITEM_VARIATIONS_CLIENTS}",
|
23
|
+
item: item_id,
|
24
|
+
variation: variation_id), body)
|
25
|
+
end
|
26
|
+
|
27
|
+
def delete(item_id, variation_id, marketplace_id)
|
28
|
+
delete(build_endpoint("#{ITEM_VARIATION_CLIENTS_PATH}#{DELETE_ITEM_VARIATIONS_CLIENTS}",
|
29
|
+
item: item_id,
|
30
|
+
variation: variation_id,
|
31
|
+
marketplace: marketplace_id))
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Item
|
3
|
+
module Variation
|
4
|
+
class DefaultCategory
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
ITEM_VARIATION_DEFAULT_CATEGORY_PATH = '/items/{itemId}/variations/{variationId}'.freeze
|
9
|
+
|
10
|
+
LIST_ITEM_VARIATIONS_DEFAULT_CATEGORY = '/variation_default_categories'.freeze
|
11
|
+
GET_ITEM_VARIATIONS_DEFAULT_CATEGORY = '/variation_default_categories/{plentyId}'.freeze
|
12
|
+
CREATE_ITEM_VARIATIONS_DEFAULT_CATEGORY = '/variation_default_categories'.freeze
|
13
|
+
DELETE_ITEM_VARIATIONS_DEFAULT_CATEGORY = '/variation_default_categories/{plentyId}'.freeze
|
14
|
+
|
15
|
+
class << self
|
16
|
+
def list(item_id, variation_id, headers = {}, &block)
|
17
|
+
get(build_endpoint("#{ITEM_VARIATION_DEFAULT_CATEGORY_PATH}#{LIST_ITEM_VARIATIONS_DEFAULT_CATEGORY}",
|
18
|
+
item: item_id,
|
19
|
+
variation: variation_id), headers, &block)
|
20
|
+
end
|
21
|
+
|
22
|
+
def find(item_id, variation_id, plenty_id, headers = {}, &block)
|
23
|
+
get(build_endpoint("#{ITEM_VARIATION_DEFAULT_CATEGORY_PATH}#{GET_ITEM_VARIATIONS_DEFAULT_CATEGORY}",
|
24
|
+
item: item_id,
|
25
|
+
variation: variation_id,
|
26
|
+
plenty: plenty_id), headers, &block)
|
27
|
+
end
|
28
|
+
|
29
|
+
def create(item_id, variation_id, body = {})
|
30
|
+
post(build_endpoint("#{ITEM_VARIATION_DEFAULT_CATEGORY_PATH}#{CREATE_ITEM_VARIATIONS_DEFAULT_CATEGORY}",
|
31
|
+
item: item_id,
|
32
|
+
variation: variation_id), body)
|
33
|
+
end
|
34
|
+
|
35
|
+
def delete(item_id, variation_id, marketplace_id)
|
36
|
+
delete(build_endpoint("#{ITEM_VARIATION_DEFAULT_CATEGORY_PATH}#{DELETE_ITEM_VARIATIONS_DEFAULT_CATEGORY}",
|
37
|
+
item: item_id,
|
38
|
+
variation: variation_id,
|
39
|
+
marketplace: marketplace_id))
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Item
|
3
|
+
module Variation
|
4
|
+
class Description
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
ITEM_VARIATION_DESCRIPTION_BASE_PATH = '/items/{itemId}/variations/{variationId}'.freeze
|
9
|
+
|
10
|
+
LIST_ITEM_VARIATION_DESCRIPTIONS = '/descriptions'.freeze
|
11
|
+
GET_ITEM_VARIATIONS_DESCRIPTION = '/descriptions/{lang}'.freeze
|
12
|
+
CREATE_ITEM_VARIATIONS_DESCRIPTION = '/descriptions'.freeze
|
13
|
+
UPDATE_ITEM_VARIATIONS_DESCRIPTION = '/descriptions/{lang}'.freeze
|
14
|
+
DELETE_ITEM_VARIATIONS_DESCRIPTION = '/descriptions/{lang}'.freeze
|
15
|
+
|
16
|
+
class << self
|
17
|
+
def list(item_id, variation_id, headers = {}, &block)
|
18
|
+
get(build_endpoint("#{ITEM_VARIATION_DESCRIPTION_BASE_PATH}#{LIST_ITEM_VARIATION_DESCRIPTIONS}",
|
19
|
+
item: item_id,
|
20
|
+
variation: variation_id), headers, &block)
|
21
|
+
end
|
22
|
+
|
23
|
+
def find(item_id, variation_id, lang, headers = {})
|
24
|
+
get(build_endpoint("#{ITEM_VARIATION_DESCRIPTION_BASE_PATH}#{GET_ITEM_VARIATIONS_DESCRIPTION}",
|
25
|
+
item: item_id,
|
26
|
+
variation: variation_id,
|
27
|
+
lang: lang), headers, &block)
|
28
|
+
end
|
29
|
+
|
30
|
+
def create(item_id, variation_id, body = {})
|
31
|
+
post(build_endpoint("#{ITEM_VARIATION_DESCRIPTION_BASE_PATH}#{CREATE_ITEM_VARIATIONS_DESCRIPTION}",
|
32
|
+
item: item_id,
|
33
|
+
variation: variation_id), body)
|
34
|
+
end
|
35
|
+
|
36
|
+
def update(item_id, variation_id, lang, body = {})
|
37
|
+
put(build_endpoint("#{ITEM_VARIATION_DESCRIPTION_BASE_PATH}#{UPDATE_ITEM_VARIATIONS_DESCRIPTION}",
|
38
|
+
item: item_id,
|
39
|
+
variation: variation_id,
|
40
|
+
lang: lang), body)
|
41
|
+
end
|
42
|
+
|
43
|
+
def delete(item_id, variation_id, lang)
|
44
|
+
delete(build_endpoint("#{ITEM_VARIATION_DESCRIPTION_BASE_PATH}#{DELETE_ITEM_VARIATIONS_DESCRIPTION}",
|
45
|
+
item: item_id,
|
46
|
+
variation: variation_id,
|
47
|
+
lang: lang))
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Item
|
3
|
+
module Variation
|
4
|
+
class Image
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
ITEM_IMAGE_BASE_PATH = '/items/{itemId}'.freeze
|
8
|
+
|
9
|
+
LIST_IMAGES_IMAGE_LINKS = '/images/{imageId}/variation_images'.freeze
|
10
|
+
LIST_VARIATION_IMAGE_LINKS = '/variations/{variationId}/variation_images'.freeze
|
11
|
+
GET_ITEM_IMAGES = '/variation_images'.freeze
|
12
|
+
UPDATE_ITEM_IMAGES = '/variations/{variationId}/variation_images'.freeze
|
13
|
+
DELETE_ITEM_IMAGES = '/variations/{variationId}/variation_images/{imageId}'.freeze
|
14
|
+
|
15
|
+
class << self
|
16
|
+
def list_images_image_links(item_id, image_id, headers = {}, &block)
|
17
|
+
get(build_endpoint("#{ITEM_IMAGE_BASE_PATH}#{LIST_IMAGES_IMAGE_LINKS}",
|
18
|
+
item: item_id,
|
19
|
+
image: image_id), headers, &block)
|
20
|
+
end
|
21
|
+
|
22
|
+
def list_variations_image_links(item_id, variation_id, headers = {}, &block)
|
23
|
+
get(build_endpoint("#{ITEM_IMAGE_BASE_PATH}#{LIST_VARIATION_IMAGE_LINKS}",
|
24
|
+
item: item_id,
|
25
|
+
variation: variation_id), headers, &block)
|
26
|
+
end
|
27
|
+
|
28
|
+
def list_items_image_links(item_id, headers = {}, &block)
|
29
|
+
get(build_endpoint("#{ITEM_IMAGE_BASE_PATH}#{GET_ITEM_IMAGES}",
|
30
|
+
item: item_id), headers, &block)
|
31
|
+
end
|
32
|
+
|
33
|
+
def create(item_id, variation_id, body = {})
|
34
|
+
post(build_endpoint("#{ITEM_IMAGE_BASE_PATH}#{UPDATE_ITEM_IMAGES}",
|
35
|
+
item: item_id,
|
36
|
+
variation: variation_id), body)
|
37
|
+
end
|
38
|
+
|
39
|
+
def delete(item_id, variation_id, image_id)
|
40
|
+
delete(build_endpoint("#{ITEM_IMAGE_BASE_PATH}#{DELETE_ITEM_IMAGES}",
|
41
|
+
item: item_id,
|
42
|
+
variation: variation_id,
|
43
|
+
image: image_id))
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Item
|
3
|
+
module Variation
|
4
|
+
class Market
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
ITEM_VARIATION_MARKETS_PATH = '/items/{itemId}/variations/{variationId}'.freeze
|
9
|
+
|
10
|
+
GET_ITEM_VARIATIONS_MARKETS = '/variation_markets'.freeze
|
11
|
+
CREATE_ITEM_VARIATIONS_MARKETS = '/variation_markets'.freeze
|
12
|
+
DELETE_ITEM_VARIATIONS_MARKETS = '/variation_markets/{marketplaceId}'.freeze
|
13
|
+
|
14
|
+
class << self
|
15
|
+
def list(item_id, variation_id, headers = {}, &block)
|
16
|
+
get(build_endpoint("#{ITEM_VARIATION_MARKETS_PATH}#{GET_ITEM_VARIATIONS_MARKETS}",
|
17
|
+
item: item_id,
|
18
|
+
variation: variation_id), headers, &block)
|
19
|
+
end
|
20
|
+
|
21
|
+
def create(item_id, variation_id, body = {})
|
22
|
+
post(build_endpoint("#{ITEM_VARIATION_MARKETS_PATH}#{CREATE_ITEM_VARIATIONS_MARKETS}",
|
23
|
+
item: item_id,
|
24
|
+
variation: variation_id), body)
|
25
|
+
end
|
26
|
+
|
27
|
+
def delete(item_id, variation_id, marketplace_id)
|
28
|
+
delete(build_endpoint("#{ITEM_VARIATION_MARKETS_PATH}#{DELETE_ITEM_VARIATIONS_MARKETS}",
|
29
|
+
item: item_id,
|
30
|
+
variation: variation_id,
|
31
|
+
marketplace: marketplace_id))
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Item
|
3
|
+
module Variation
|
4
|
+
class MarketIdentNumber
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
ITEM_VARIATION_MARKET_IDENT_PATH = '/items/{itemId}/variations/{variationId}'.freeze
|
9
|
+
|
10
|
+
LIST_ITEM_VARIATION_MARKET_IDENT = '/market_ident_numbers'.freeze
|
11
|
+
GET_ITEM_VARIATIONS_MARKET_IDENT = '/market_ident_numbers/{marketIdentNumberId}'.freeze
|
12
|
+
CREATE_ITEM_VARIATIONS_MARKET_IDENT = '/market_ident_numbers'.freeze
|
13
|
+
UPDATE_ITEM_VARIATIONS_MARKET_IDENT = '/market_ident_numbers/{marketIdentNumberId}'.freeze
|
14
|
+
DELETE_ITEM_VARIATIONS_MARKET_IDENT = '/market_ident_numbers/{marketIdentNumberId}'.freeze
|
15
|
+
|
16
|
+
class << self
|
17
|
+
def list(item_id, variation_id, headers = {}, &block)
|
18
|
+
get(build_endpoint("#{ITEM_VARIATION_MARKET_IDENT_PATH}#{LIST_ITEM_VARIATION_MARKET_IDENT}",
|
19
|
+
item: item_id,
|
20
|
+
variation: variation_id), headers, &block)
|
21
|
+
end
|
22
|
+
|
23
|
+
def find(item_id, variation_id, market_ident_number_id, headers = {})
|
24
|
+
get(build_endpoint("#{ITEM_VARIATION_MARKET_IDENT_PATH}#{GET_ITEM_VARIATIONS_MARKET_IDENT}",
|
25
|
+
item: item_id,
|
26
|
+
variation: variation_id,
|
27
|
+
market_ident_number: market_ident_number_id), headers, &block)
|
28
|
+
end
|
29
|
+
|
30
|
+
def create(item_id, variation_id, body = {})
|
31
|
+
post(build_endpoint("#{ITEM_VARIATION_MARKET_IDENT_PATH}#{CREATE_ITEM_VARIATIONS_MARKET_IDENT}",
|
32
|
+
item: item_id,
|
33
|
+
variation: variation_id), body)
|
34
|
+
end
|
35
|
+
|
36
|
+
def update(item_id, variation_id, market_ident_number_id, body = {})
|
37
|
+
put(build_endpoint("#{ITEM_VARIATION_MARKET_IDENT_PATH}#{UPDATE_ITEM_VARIATIONS_MARKET_IDENT}",
|
38
|
+
item: item_id,
|
39
|
+
variation: variation_id,
|
40
|
+
market_ident_number: market_ident_number_id), body)
|
41
|
+
end
|
42
|
+
|
43
|
+
def delete(item_id, variation_id, market_ident_number_id)
|
44
|
+
delete(build_endpoint("#{ITEM_VARIATION_MARKET_IDENT_PATH}#{DELETE_ITEM_VARIATIONS_MARKET_IDENT}",
|
45
|
+
item: item_id,
|
46
|
+
variation: variation_id,
|
47
|
+
market_ident_number: market_ident_number_id))
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Item
|
3
|
+
module Variation
|
4
|
+
class SalesPrice
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
ITEM_VARIATION_SALES_PRICES_PATH = '/items/{itemId}/variations/{variationId}'.freeze
|
9
|
+
|
10
|
+
LIST_ITEM_VARIATIONS_SALES_PRICES = '/variation_sales_prices'.freeze
|
11
|
+
GET_ITEM_VARIATIONS_SALES_PRICES = '/variation_sales_prices/{priceId}'.freeze
|
12
|
+
CREATE_ITEM_VARIATIONS_SALES_PRICES = '/variation_sales_prices'.freeze
|
13
|
+
UPDATE_ITEM_VARIATIONS_SALES_PRICES = '/variation_sales_prices/{priceId}'.freeze
|
14
|
+
DELETE_ITEM_VARIATIONS_SALES_PRICES = '/variation_sales_prices/{priceId}'.freeze
|
15
|
+
|
16
|
+
class << self
|
17
|
+
def list(item_id, variation_id, headers = {}, &block)
|
18
|
+
get(build_endpoint("#{ITEM_VARIATION_SALES_PRICES_PATH}#{LIST_ITEM_VARIATIONS_SALES_PRICES}",
|
19
|
+
item: item_id,
|
20
|
+
variation: variation_id), headers, &block)
|
21
|
+
end
|
22
|
+
|
23
|
+
def find(item_id, variation_id, price_id, headers = {}, &block)
|
24
|
+
get(build_endpoint("#{ITEM_VARIATION_SALES_PRICES_PATH}#{GET_ITEM_VARIATIONS_SALES_PRICES}",
|
25
|
+
item: item_id,
|
26
|
+
variation: variation_id,
|
27
|
+
price: price_id), headers, &block)
|
28
|
+
end
|
29
|
+
|
30
|
+
def create(item_id, variation_id, body = {})
|
31
|
+
post(build_endpoint("#{ITEM_VARIATION_SALES_PRICES_PATH}#{CREATE_ITEM_VARIATIONS_SALES_PRICES}",
|
32
|
+
item: item_id,
|
33
|
+
variation: variation_id), body)
|
34
|
+
end
|
35
|
+
|
36
|
+
def update(item_id, variation_id, price_id. body = {})
|
37
|
+
put(build_endpoint("#{ITEM_VARIATION_SALES_PRICES_PATH}#{UPDATE_ITEM_VARIATIONS_SALES_PRICES}",
|
38
|
+
item: item_id,
|
39
|
+
variation: variation_id,
|
40
|
+
price: price_id), body)
|
41
|
+
end
|
42
|
+
|
43
|
+
def delete(item_id, variation_id, price_id)
|
44
|
+
delete(build_endpoint("#{ITEM_VARIATION_SALES_PRICES_PATH}#{DELETE_ITEM_VARIATIONS_SALES_PRICES}",
|
45
|
+
item: item_id,
|
46
|
+
variation: variation_id,
|
47
|
+
price: price_id))
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Item
|
3
|
+
module Variation
|
4
|
+
class Sku
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
ITEM_VARIATION_SKU_PATH = '/items/{itemId}/variations/{variationId}'.freeze
|
9
|
+
|
10
|
+
LIST_ITEM_VARIATIONS_SKU = '/variation_skus'.freeze
|
11
|
+
GET_ITEM_VARIATIONS_SKU = '/variation_skus/{skuId}'.freeze
|
12
|
+
CREATE_ITEM_VARIATIONS_SKU = '/variation_skus'.freeze
|
13
|
+
UPDATE_ITEM_VARIATIONS_SKU = '/variation_skus/{skuId}'.freeze
|
14
|
+
DELETE_ITEM_VARIATIONS_SKU = '/variation_skus/{skuId}'.freeze
|
15
|
+
|
16
|
+
class << self
|
17
|
+
def list(item_id, variation_id, headers = {}, &block)
|
18
|
+
get(build_endpoint("#{ITEM_VARIATION_SKU_PATH}#{LIST_ITEM_VARIATIONS_SKU}",
|
19
|
+
item: item_id,
|
20
|
+
variation: variation_id), headers, &block)
|
21
|
+
end
|
22
|
+
|
23
|
+
def find(item_id, variation_id, sku_id, headers = {}, &block)
|
24
|
+
get(build_endpoint("#{ITEM_VARIATION_SKU_PATH}#{GET_ITEM_VARIATIONS_SKU}",
|
25
|
+
item: item_id,
|
26
|
+
variation: variation_id,
|
27
|
+
sku: sku_id), headers, &block)
|
28
|
+
end
|
29
|
+
|
30
|
+
def create(item_id, variation_id, body = {})
|
31
|
+
post(build_endpoint("#{ITEM_VARIATION_SKU_PATH}#{CREATE_ITEM_VARIATIONS_SKU}",
|
32
|
+
item: item_id,
|
33
|
+
variation: variation_id), body)
|
34
|
+
end
|
35
|
+
|
36
|
+
def update(item_id, variation_id, sku_id, body = {})
|
37
|
+
put(build_endpoint("#{ITEM_VARIATION_SKU_PATH}#{CREATE_ITEM_VARIATIONS_SKU}",
|
38
|
+
item: item_id,
|
39
|
+
variation: variation_id), body)
|
40
|
+
end
|
41
|
+
|
42
|
+
def delete(item_id, variation_id, sku_id)
|
43
|
+
delete(build_endpoint("#{ITEM_VARIATION_SKU_PATH}#{DELETE_ITEM_VARIATIONS_SKU}",
|
44
|
+
item: item_id,
|
45
|
+
variation: variation_id,
|
46
|
+
sku: sku_id))
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Item
|
3
|
+
module Variation
|
4
|
+
class Stock
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
ITEM_VARIATION_STOCK_PATH = '/items/{itemId}/variations/{variationId}'.freeze
|
9
|
+
|
10
|
+
LIST_ITEM_VARIATIONS_STOCK = '/stock'.freeze
|
11
|
+
LIST_ITEM_VARIATIONS_STOCK_STORAGE_LOCATIONS = '/stock/storageLocations'.freeze
|
12
|
+
LIST_ITEM_VARIATIONS_STOCK_MOVEMENTS = '/stock/movements'.freeze
|
13
|
+
UPDATE_ITEM_VARIATIONS_STOCK_INCOMING_ITEMS = '/stock/bookIncomingItems'.freeze
|
14
|
+
UPDATE_ITEM_VARIATIONS_STOCK_CORRECTION = '/stock/correction'.freeze
|
15
|
+
UPDATE_ITEM_VARIATIONS_STOCK_REDISTRIBUTE = '/stock/redistribute'.freeze
|
16
|
+
|
17
|
+
class << self
|
18
|
+
def list(item_id, variation_id, headers = {}, &block)
|
19
|
+
get(build_endpoint("#{ITEM_VARIATION_STOCK_PATH}#{LIST_ITEM_VARIATIONS_STOCK}",
|
20
|
+
item: item_id,
|
21
|
+
variation: variation_id), headers, &block)
|
22
|
+
end
|
23
|
+
|
24
|
+
def list_storage_locations(item_id, variation_id, headers = {}, &block)
|
25
|
+
get(build_endpoint("#{ITEM_VARIATION_STOCK_PATH}#{LIST_ITEM_VARIATIONS_STOCK_STORAGE_LOCATIONS}",
|
26
|
+
item: item_id,
|
27
|
+
variation: variation_id), headers, &block)
|
28
|
+
end
|
29
|
+
|
30
|
+
def list_stock_movements(item_id, variation_id, headers = {}, &block)
|
31
|
+
get(build_endpoint("#{ITEM_VARIATION_STOCK_PATH}#{LIST_ITEM_VARIATIONS_STOCK_MOVEMENTS}",
|
32
|
+
item: item_id,
|
33
|
+
variation: variation_id), headers, &block)
|
34
|
+
end
|
35
|
+
|
36
|
+
def update_incoming_items(item_id, variation_id, body = {})
|
37
|
+
put(build_endpoint("#{ITEM_VARIATION_STOCK_PATH}#{UPDATE_ITEM_VARIATIONS_STOCK_INCOMING_ITEMS}",
|
38
|
+
item: item_id,
|
39
|
+
variation: variation_id), body)
|
40
|
+
end
|
41
|
+
|
42
|
+
def update_corrections(item_id, variation_id, body = {})
|
43
|
+
put(build_endpoint("#{ITEM_VARIATION_STOCK_PATH}#{UPDATE_ITEM_VARIATIONS_STOCK_INCOMING_ITEMS}",
|
44
|
+
item: item_id,
|
45
|
+
variation: variation_id), body)
|
46
|
+
end
|
47
|
+
|
48
|
+
def update_rediestributions(item_id, variation_id, body = {})
|
49
|
+
put(build_endpoint("#{ITEM_VARIATION_STOCK_PATH}#{UPDATE_ITEM_VARIATIONS_STOCK_INCOMING_ITEMS}",
|
50
|
+
item: item_id,
|
51
|
+
variation: variation_id), body)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module PlentyClient
|
2
|
+
module Item
|
3
|
+
module Variation
|
4
|
+
class Supplier
|
5
|
+
extend PlentyClient::Endpoint
|
6
|
+
extend PlentyClient::Request
|
7
|
+
|
8
|
+
ITEM_VARIATION_SUPPLIER_PATH = '/items/{itemId}/variations/{variationId}'.freeze
|
9
|
+
|
10
|
+
LIST_ITEM_VARIATIONS_SUPPLIER = '/variation_suppliers'.freeze
|
11
|
+
GET_ITEM_VARIATIONS_SUPPLIER = '/variation_suppliers/{variationSupplierId}'.freeze
|
12
|
+
CREATE_ITEM_VARIATIONS_SUPPLIER = '/variation_suppliers'.freeze
|
13
|
+
UPDATE_ITEM_VARIATIONS_SUPPLIER = '/variation_suppliers/{variationSupplierId}'.freeze
|
14
|
+
DELETE_ITEM_VARIATIONS_SUPPLIER = '/variation_suppliers/{variationSupplierId}'.freeze
|
15
|
+
|
16
|
+
class << self
|
17
|
+
def list(item_id, variation_id, headers = {}, &block)
|
18
|
+
get(build_endpoint("#{ITEM_VARIATION_SUPPLIER_PATH}#{LIST_ITEM_VARIATIONS_SUPPLIER}",
|
19
|
+
item: item_id,
|
20
|
+
variation: variation_id), headers, &block)
|
21
|
+
end
|
22
|
+
|
23
|
+
def find(item_id, variation_id, supplier_id, headers = {}, &block)
|
24
|
+
get(build_endpoint("#{ITEM_VARIATION_SUPPLIER_PATH}#{GET_ITEM_VARIATIONS_SUPPLIER}",
|
25
|
+
item: item_id,
|
26
|
+
variation: variation_id,
|
27
|
+
supplier: supplier_id), headers, &block)
|
28
|
+
end
|
29
|
+
|
30
|
+
def create(item_id, variation_id, body = {})
|
31
|
+
post(build_endpoint("#{ITEM_VARIATION_SUPPLIER_PATH}#{CREATE_ITEM_VARIATIONS_SUPPLIER}",
|
32
|
+
item: item_id,
|
33
|
+
variation: variation_id), body)
|
34
|
+
end
|
35
|
+
|
36
|
+
def update(item_id, variation_id, supplier_id, body = {})
|
37
|
+
put(build_endpoint("#{ITEM_VARIATION_SUPPLIER_PATH}#{CREATE_ITEM_VARIATIONS_SUPPLIER}",
|
38
|
+
item: item_id,
|
39
|
+
variation: variation_id), body)
|
40
|
+
end
|
41
|
+
|
42
|
+
def delete(item_id, variation_id, supplier_id)
|
43
|
+
delete(build_endpoint("#{ITEM_VARIATION_SUPPLIER_PATH}#{DELETE_ITEM_VARIATIONS_SUPPLIER}",
|
44
|
+
item: item_id,
|
45
|
+
variation: variation_id,
|
46
|
+
supplier: supplier_id))
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|