bigcommerce 0.10.0 → 1.0.0.beta
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 +4 -4
- data/.gitignore +17 -0
- data/.rspec +2 -0
- data/.rubocop.yml +620 -0
- data/.travis.yml +15 -0
- data/CHANGELOG.md +11 -0
- data/CONTRIBUTING.md +119 -0
- data/DEPENDENCIES.md +7 -0
- data/Gemfile +15 -0
- data/Guardfile +22 -0
- data/LICENSE +15 -15
- data/README.md +61 -70
- data/RELEASING.md +64 -0
- data/Rakefile +8 -6
- data/bigcommerce.gemspec +22 -53
- data/examples/README.md +148 -0
- data/examples/configuration/legacy_auth.rb +12 -0
- data/examples/configuration/oauth.rb +9 -0
- data/examples/content/blog_post.rb +39 -0
- data/examples/content/blog_tag.rb +10 -0
- data/examples/content/redirect.rb +43 -0
- data/examples/customers/customer.rb +36 -0
- data/examples/customers/customer_address.rb +50 -0
- data/examples/customers/customer_group.rb +35 -0
- data/examples/exception_handling.rb +50 -0
- data/examples/geography/country.rb +16 -0
- data/examples/geography/state.rb +19 -0
- data/examples/marketing/coupon.rb +44 -0
- data/examples/orders/order.rb +53 -0
- data/examples/orders/order_coupon.rb +17 -0
- data/examples/orders/order_message.rb +17 -0
- data/examples/orders/order_product.rb +23 -0
- data/examples/orders/order_shipping_address.rb +23 -0
- data/examples/orders/order_status.rb +15 -0
- data/examples/orders/order_tax.rb +17 -0
- data/examples/orders/shipment.rb +57 -0
- data/examples/payments/payment_method.rb +10 -0
- data/examples/products/brand.rb +36 -0
- data/examples/products/bulk_pricing_rule.rb +47 -0
- data/examples/products/category.rb +37 -0
- data/examples/products/configurable_field.rb +29 -0
- data/examples/products/custom_field.rb +44 -0
- data/examples/products/google_product_search_mapping.rb +12 -0
- data/examples/products/option.rb +37 -0
- data/examples/products/option_set.rb +35 -0
- data/examples/products/option_set_option.rb +50 -0
- data/examples/products/option_value.rb +43 -0
- data/examples/products/product.rb +44 -0
- data/examples/products/product_image.rb +42 -0
- data/examples/products/product_option.rb +17 -0
- data/examples/products/product_review.rb +12 -0
- data/examples/products/product_rule.rb +54 -0
- data/examples/products/product_video.rb +45 -0
- data/examples/products/sku.rb +48 -0
- data/examples/shipping/shipping_method.rb +13 -0
- data/examples/store/store_info.rb +10 -0
- data/examples/system/time.rb +10 -0
- data/examples/tax/tax_class.rb +13 -0
- data/examples/webhooks/webhook.rb +29 -0
- data/lib/bigcommerce.rb +50 -8
- data/lib/bigcommerce/exception.rb +51 -0
- data/lib/bigcommerce/middleware/auth.rb +16 -0
- data/lib/bigcommerce/middleware/http_exception.rb +14 -0
- data/lib/bigcommerce/request.rb +89 -0
- data/lib/bigcommerce/resource_actions.rb +51 -0
- data/lib/bigcommerce/resources/content/blog_post.rb +31 -0
- data/lib/bigcommerce/resources/content/blog_tag.rb +17 -0
- data/lib/bigcommerce/resources/content/redirect.rb +21 -0
- data/lib/bigcommerce/resources/customers/customer.rb +30 -0
- data/lib/bigcommerce/resources/customers/customer_address.rb +34 -0
- data/lib/bigcommerce/resources/customers/customer_group.rb +21 -0
- data/lib/bigcommerce/resources/geography/country.rb +22 -0
- data/lib/bigcommerce/resources/geography/state.rb +25 -0
- data/lib/bigcommerce/resources/marketing/coupon.rb +30 -0
- data/lib/bigcommerce/resources/orders/order.rb +73 -0
- data/lib/bigcommerce/resources/orders/order_coupon.rb +20 -0
- data/lib/bigcommerce/resources/orders/order_message.rb +23 -0
- data/lib/bigcommerce/resources/orders/order_product.rb +64 -0
- data/lib/bigcommerce/resources/orders/order_shipping_address.rb +50 -0
- data/lib/bigcommerce/resources/orders/order_status.rb +16 -0
- data/lib/bigcommerce/resources/orders/order_tax.rb +23 -0
- data/lib/bigcommerce/resources/orders/shipment.rb +30 -0
- data/lib/bigcommerce/resources/payments/payment_method.rb +17 -0
- data/lib/bigcommerce/resources/products/brand.rb +23 -0
- data/lib/bigcommerce/resources/products/bulk_pricing_rule.rb +26 -0
- data/lib/bigcommerce/resources/products/category.rb +29 -0
- data/lib/bigcommerce/resources/products/configurable_field.rb +30 -0
- data/lib/bigcommerce/resources/products/custom_field.rb +24 -0
- data/lib/bigcommerce/resources/products/google_product_search_mapping.rb +26 -0
- data/lib/bigcommerce/resources/products/option.rb +20 -0
- data/lib/bigcommerce/resources/products/option_set.rb +18 -0
- data/lib/bigcommerce/resources/products/option_set_option.rb +19 -0
- data/lib/bigcommerce/resources/products/option_value.rb +15 -0
- data/lib/bigcommerce/resources/products/product.rb +97 -0
- data/lib/bigcommerce/resources/products/product_image.rb +31 -0
- data/lib/bigcommerce/resources/products/product_option.rb +17 -0
- data/lib/bigcommerce/resources/products/product_review.rb +22 -0
- data/lib/bigcommerce/resources/products/product_rule.rb +31 -0
- data/lib/bigcommerce/resources/products/product_video.rb +24 -0
- data/lib/bigcommerce/resources/products/sku.rb +29 -0
- data/lib/bigcommerce/resources/resource.rb +10 -0
- data/lib/bigcommerce/resources/shipping/shipping_method.rb +15 -0
- data/lib/bigcommerce/resources/store/store_information.rb +37 -0
- data/lib/bigcommerce/resources/system/time.rb +15 -0
- data/lib/bigcommerce/resources/tax/tax_class.rb +15 -0
- data/lib/bigcommerce/resources/webhooks/webhook.rb +22 -0
- data/lib/bigcommerce/subresource_actions.rb +43 -0
- data/lib/bigcommerce/version.rb +1 -4
- data/spec/bigcommerce/bigcommerce_spec.rb +76 -0
- data/spec/bigcommerce/unit/actions_spec.rb +151 -0
- data/spec/bigcommerce/unit/exception_spec.rb +53 -0
- data/spec/bigcommerce/unit/middleware/auth_spec.rb +18 -0
- data/spec/bigcommerce/unit/middleware/http_exception_spec.rb +40 -0
- data/spec/bigcommerce/unit/request_spec.rb +180 -0
- data/spec/bigcommerce/unit/resources/content/blog_post_spec.rb +12 -0
- data/spec/bigcommerce/unit/resources/content/blog_tag_spec.rb +12 -0
- data/spec/bigcommerce/unit/resources/content/redirect_spec.rb +12 -0
- data/spec/bigcommerce/unit/resources/customers/customer_address_spec.rb +21 -0
- data/spec/bigcommerce/unit/resources/customers/customer_group_spec.rb +12 -0
- data/spec/bigcommerce/unit/resources/customers/customer_spec.rb +12 -0
- data/spec/bigcommerce/unit/resources/geography/country_spec.rb +12 -0
- data/spec/bigcommerce/unit/resources/geography/state_spec.rb +21 -0
- data/spec/bigcommerce/unit/resources/marketing/coupon_spec.rb +12 -0
- data/spec/bigcommerce/unit/resources/orders/order_product_spec.rb +21 -0
- data/spec/bigcommerce/unit/resources/orders/order_shipping_address_spec.rb +21 -0
- data/spec/bigcommerce/unit/resources/orders/order_spec.rb +13 -0
- data/spec/bigcommerce/unit/resources/orders/shipment_spec.rb +21 -0
- data/spec/bigcommerce/unit/resources/payments/payment_method_spec.rb +23 -0
- data/spec/bigcommerce/unit/resources/products/brand_spec.rb +12 -0
- data/spec/bigcommerce/unit/resources/products/bulk_pricing_rule_spec.rb +21 -0
- data/spec/bigcommerce/unit/resources/products/category_spec.rb +12 -0
- data/spec/bigcommerce/unit/resources/products/configurable_field_spec.rb +21 -0
- data/spec/bigcommerce/unit/resources/products/custom_field_spec.rb +21 -0
- data/spec/bigcommerce/unit/resources/products/google_product_search_mapping_spec.rb +14 -0
- data/spec/bigcommerce/unit/resources/products/option_set_spec.rb +12 -0
- data/spec/bigcommerce/unit/resources/products/option_spec.rb +12 -0
- data/spec/bigcommerce/unit/resources/products/product_image_spec.rb +21 -0
- data/spec/bigcommerce/unit/resources/products/product_review_spec.rb +14 -0
- data/spec/bigcommerce/unit/resources/products/product_rule_spec.rb +21 -0
- data/spec/bigcommerce/unit/resources/products/product_spec.rb +13 -0
- data/spec/bigcommerce/unit/resources/products/product_video_spec.rb +21 -0
- data/spec/bigcommerce/unit/resources/products/sku_spec.rb +21 -0
- data/spec/bigcommerce/unit/resources/resource_spec.rb +4 -0
- data/spec/bigcommerce/unit/resources/store_info/store_information_spec.rb +12 -0
- data/spec/bigcommerce/unit/resources/system/time_spec.rb +12 -0
- data/spec/bigcommerce/unit/version_spec.rb +7 -0
- data/spec/spec_helper.rb +9 -25
- metadata +203 -127
- data/lib/big_commerce.rb +0 -1
- data/lib/bigcommerce/api.rb +0 -473
- data/lib/bigcommerce/connection.rb +0 -171
- data/lib/bigcommerce/product.rb +0 -13
- data/lib/bigcommerce/resource.rb +0 -50
- data/spec/big_commerce_spec.rb +0 -9
- data/spec/integration/orders_spec.rb +0 -18
- data/spec/support/integration_context.rb +0 -13
- data/spec/support/mock_api_context.rb +0 -10
- data/spec/unit/api_request_spec.rb +0 -34
- data/spec/unit/api_spec.rb +0 -49
- data/spec/unit/connection_spec.rb +0 -23
- data/spec/unit/date_time_spec.rb +0 -31
- data/spec/unit/version_spec.rb +0 -13
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Order Shipping Addresses
|
|
2
|
+
# Shipping addresses associated with an order.
|
|
3
|
+
# https://developer.bigcommerce.com/api/stores/v2/orders/shipping_addresses
|
|
4
|
+
|
|
5
|
+
module Bigcommerce
|
|
6
|
+
class OrderShippingAddress < Resource
|
|
7
|
+
include Bigcommerce::SubresourceActions.new(
|
|
8
|
+
uri: 'orders/%d/shipping_addresses/%d',
|
|
9
|
+
disable: [:create, :update, :destroy, :destroy_all])
|
|
10
|
+
|
|
11
|
+
property :id
|
|
12
|
+
property :order_id
|
|
13
|
+
property :count
|
|
14
|
+
property :first_name
|
|
15
|
+
property :last_name
|
|
16
|
+
property :company
|
|
17
|
+
property :street_1
|
|
18
|
+
property :street_2
|
|
19
|
+
property :city
|
|
20
|
+
property :zip
|
|
21
|
+
property :country
|
|
22
|
+
property :country_iso2
|
|
23
|
+
property :state
|
|
24
|
+
property :email
|
|
25
|
+
property :phone
|
|
26
|
+
property :items_total
|
|
27
|
+
property :items_shipped
|
|
28
|
+
property :shipping_method
|
|
29
|
+
property :base_cost
|
|
30
|
+
property :cost_ex_tax
|
|
31
|
+
property :cost_inc_tax
|
|
32
|
+
property :cost_tax
|
|
33
|
+
property :cost_tax_class_id
|
|
34
|
+
property :base_handling_cost
|
|
35
|
+
property :handling_cost_ex_tax
|
|
36
|
+
property :handling_cost_inc_tax
|
|
37
|
+
property :handling_cost_tax
|
|
38
|
+
property :handling_cost_tax_class_id
|
|
39
|
+
property :shipping_zone_id
|
|
40
|
+
property :shipping_zone_name
|
|
41
|
+
|
|
42
|
+
def self.count(order_id)
|
|
43
|
+
get "orders/#{order_id}/shipping_addresses/count"
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def self.count_all
|
|
47
|
+
get 'orders/shipping_addresses/count'
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Order Status
|
|
2
|
+
# Statuses that can be assigned to orders. Each status represents a state in
|
|
3
|
+
# the fulfilment workflow.
|
|
4
|
+
# https://developer.bigcommerce.com/api/stores/v2/order_statuses
|
|
5
|
+
|
|
6
|
+
module Bigcommerce
|
|
7
|
+
class OrderStatus < Resource
|
|
8
|
+
include Bigcommerce::ResourceActions.new(
|
|
9
|
+
uri: 'order_statuses/%d',
|
|
10
|
+
disable: [:create, :update, :destroy, :destroy_all])
|
|
11
|
+
|
|
12
|
+
property :id
|
|
13
|
+
property :name
|
|
14
|
+
property :order
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Order Shipping Addresses
|
|
2
|
+
# Shipping addresses associated with an order.
|
|
3
|
+
# https://developer.bigcommerce.com/api/stores/v2/orders/shipping_addresses
|
|
4
|
+
|
|
5
|
+
module Bigcommerce
|
|
6
|
+
class OrderTax < Resource
|
|
7
|
+
include Bigcommerce::SubresourceActions.new(
|
|
8
|
+
uri: 'orders/%d/taxes/%d',
|
|
9
|
+
disable: [:create, :update, :destroy, :destroy_all])
|
|
10
|
+
|
|
11
|
+
property :id
|
|
12
|
+
property :order_id
|
|
13
|
+
property :order_address_id
|
|
14
|
+
property :tax_rate_id
|
|
15
|
+
property :tax_class_id
|
|
16
|
+
property :name
|
|
17
|
+
property :tax_class, from: :class
|
|
18
|
+
property :rate
|
|
19
|
+
property :priority
|
|
20
|
+
property :priority_amount
|
|
21
|
+
property :line_amount
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Order Shipment
|
|
2
|
+
# Shipping package consignments tracked from an order.
|
|
3
|
+
# https://developer.bigcommerce.com/api/stores/v2/orders/shipments
|
|
4
|
+
|
|
5
|
+
module Bigcommerce
|
|
6
|
+
class Shipment < Resource
|
|
7
|
+
include Bigcommerce::SubresourceActions.new uri: 'orders/%d/shipments/%d'
|
|
8
|
+
|
|
9
|
+
property :id
|
|
10
|
+
property :order_id
|
|
11
|
+
property :count
|
|
12
|
+
property :customer_id
|
|
13
|
+
property :order_address_id
|
|
14
|
+
property :date_created
|
|
15
|
+
property :tracking_number
|
|
16
|
+
property :shipping_method
|
|
17
|
+
property :comments
|
|
18
|
+
property :billing_address
|
|
19
|
+
property :shipping_address
|
|
20
|
+
property :items
|
|
21
|
+
|
|
22
|
+
def self.count(order_id)
|
|
23
|
+
get "orders/#{order_id}/shipments/count"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def self.count_all
|
|
27
|
+
get 'orders/shipments/count'
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Payment Method
|
|
2
|
+
# Enabled payment methods.
|
|
3
|
+
# https://developer.bigcommerce.com/api/stores/v2/payments/methods
|
|
4
|
+
|
|
5
|
+
module Bigcommerce
|
|
6
|
+
class PaymentMethod < Resource
|
|
7
|
+
include Bigcommerce::Request.new 'payments/methods'
|
|
8
|
+
|
|
9
|
+
property :code
|
|
10
|
+
property :name
|
|
11
|
+
property :test_mode
|
|
12
|
+
|
|
13
|
+
def self.all(params = {})
|
|
14
|
+
get path.build, params
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Brand
|
|
2
|
+
# Brand facets for identifying and categorising products according
|
|
3
|
+
# to their manufacturer or company metonym.
|
|
4
|
+
# https://developer.bigcommerce.com/api/stores/v2/brands
|
|
5
|
+
|
|
6
|
+
module Bigcommerce
|
|
7
|
+
class Brand < Resource
|
|
8
|
+
include Bigcommerce::ResourceActions.new uri: 'brands/%d'
|
|
9
|
+
|
|
10
|
+
property :id
|
|
11
|
+
property :name
|
|
12
|
+
property :count
|
|
13
|
+
property :page_title
|
|
14
|
+
property :meta_keywords
|
|
15
|
+
property :meta_description
|
|
16
|
+
property :image_file
|
|
17
|
+
property :search_keywords
|
|
18
|
+
|
|
19
|
+
def self.count
|
|
20
|
+
get 'brands/count'
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Bulk Pricing Rule
|
|
2
|
+
# Bulk pricing rules applied to a product.
|
|
3
|
+
# https://developer.bigcommerce.com/api/stores/v2/products/discount_rules
|
|
4
|
+
|
|
5
|
+
module Bigcommerce
|
|
6
|
+
class BulkPricingRule < Resource
|
|
7
|
+
include Bigcommerce::SubresourceActions.new(
|
|
8
|
+
uri: 'products/%d/discount_rules/%d')
|
|
9
|
+
|
|
10
|
+
property :id
|
|
11
|
+
property :count
|
|
12
|
+
property :product_id
|
|
13
|
+
property :min
|
|
14
|
+
property :max
|
|
15
|
+
property :type
|
|
16
|
+
property :type_value
|
|
17
|
+
|
|
18
|
+
def self.count(product_id)
|
|
19
|
+
get "products/#{product_id}/discount_rules/count"
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def self.count_all
|
|
23
|
+
get 'products/discount_rules/count'
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Category
|
|
2
|
+
# Index of hierarchical categories used to organise and group products.
|
|
3
|
+
# https://developer.bigcommerce.com/api/stores/v2/categories
|
|
4
|
+
|
|
5
|
+
module Bigcommerce
|
|
6
|
+
class Category < Resource
|
|
7
|
+
include Bigcommerce::ResourceActions.new uri: 'categories/%d'
|
|
8
|
+
|
|
9
|
+
property :id
|
|
10
|
+
property :parent_id
|
|
11
|
+
property :name
|
|
12
|
+
property :count
|
|
13
|
+
property :description
|
|
14
|
+
property :sort_order
|
|
15
|
+
property :page_title
|
|
16
|
+
property :meta_keywords
|
|
17
|
+
property :meta_description
|
|
18
|
+
property :layout_file
|
|
19
|
+
property :parent_category_list
|
|
20
|
+
property :image_file
|
|
21
|
+
property :is_visible
|
|
22
|
+
property :search_keywords
|
|
23
|
+
property :url
|
|
24
|
+
|
|
25
|
+
def self.count
|
|
26
|
+
get 'categories/count'
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Configurable Field
|
|
2
|
+
# Configurable fields associated with a product.
|
|
3
|
+
# https://developer.bigcommerce.com/api/stores/v2/products/configurable_fields
|
|
4
|
+
|
|
5
|
+
module Bigcommerce
|
|
6
|
+
class ConfigurableField < Resource
|
|
7
|
+
include Bigcommerce::SubresourceActions.new(
|
|
8
|
+
uri: 'products/%d/configurable_fields/%d',
|
|
9
|
+
disable: [:create, :update])
|
|
10
|
+
|
|
11
|
+
property :id
|
|
12
|
+
property :product_id
|
|
13
|
+
property :count
|
|
14
|
+
property :name
|
|
15
|
+
property :type
|
|
16
|
+
property :allowed_file_types
|
|
17
|
+
property :max_size
|
|
18
|
+
property :select_options
|
|
19
|
+
property :is_required
|
|
20
|
+
property :sort_order
|
|
21
|
+
|
|
22
|
+
def self.count(product_id)
|
|
23
|
+
get "products/#{product_id}/configurable_fields/count"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def self.count_all
|
|
27
|
+
get 'products/configurable_fields/count'
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Custom Field
|
|
2
|
+
# Custom fields associated with a product.
|
|
3
|
+
# https://developer.bigcommerce.com/api/stores/v2/products/custom_fields
|
|
4
|
+
|
|
5
|
+
module Bigcommerce
|
|
6
|
+
class CustomField < Resource
|
|
7
|
+
include Bigcommerce::SubresourceActions.new(
|
|
8
|
+
uri: 'products/%d/custom_fields/%d')
|
|
9
|
+
|
|
10
|
+
property :id
|
|
11
|
+
property :product_id
|
|
12
|
+
property :count
|
|
13
|
+
property :name
|
|
14
|
+
property :text
|
|
15
|
+
|
|
16
|
+
def self.count(product_id)
|
|
17
|
+
get "products/#{product_id}/custom_fields/count"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.count_all
|
|
21
|
+
get 'products/custom_fields/count'
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Google Product Search Mapping
|
|
2
|
+
# Google Product Search mappings for a product.
|
|
3
|
+
# https://developer.bigcommerce.com/api/stores/v2/products/googleproductsearch
|
|
4
|
+
|
|
5
|
+
module Bigcommerce
|
|
6
|
+
class GoogleProductSearchMapping < Resource
|
|
7
|
+
include Bigcommerce::Request.new 'products/%d/googleproductsearch'
|
|
8
|
+
|
|
9
|
+
property :enabled
|
|
10
|
+
property :product_id
|
|
11
|
+
property :category_id
|
|
12
|
+
property :custom_item
|
|
13
|
+
property :global_trade_item_number
|
|
14
|
+
property :manufacturer_part_number
|
|
15
|
+
property :gender
|
|
16
|
+
property :age_group
|
|
17
|
+
property :color
|
|
18
|
+
property :size
|
|
19
|
+
property :material
|
|
20
|
+
property :pattern
|
|
21
|
+
|
|
22
|
+
def self.all(product_id)
|
|
23
|
+
get path.build(product_id)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Option
|
|
2
|
+
# Shared attributes that control value facets on a product.
|
|
3
|
+
# https://developer.bigcommerce.com/api/stores/v2/options
|
|
4
|
+
|
|
5
|
+
module Bigcommerce
|
|
6
|
+
class Option < Resource
|
|
7
|
+
include Bigcommerce::ResourceActions.new uri: 'options/%d'
|
|
8
|
+
|
|
9
|
+
property :id
|
|
10
|
+
property :name
|
|
11
|
+
property :count
|
|
12
|
+
property :display_name
|
|
13
|
+
property :type
|
|
14
|
+
property :values
|
|
15
|
+
|
|
16
|
+
def self.count
|
|
17
|
+
get 'options/count'
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Option Set
|
|
2
|
+
# A reusable set of option facets that can be applied to products.
|
|
3
|
+
# https://developer.bigcommerce.com/api/stores/v2/options_sets
|
|
4
|
+
|
|
5
|
+
module Bigcommerce
|
|
6
|
+
class OptionSet < Resource
|
|
7
|
+
include Bigcommerce::ResourceActions.new uri: 'option_sets/%d'
|
|
8
|
+
|
|
9
|
+
property :id
|
|
10
|
+
property :name
|
|
11
|
+
property :count
|
|
12
|
+
property :options
|
|
13
|
+
|
|
14
|
+
def self.count
|
|
15
|
+
get 'option_sets/count'
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Option Set Option
|
|
2
|
+
# Options belonging to an option set.
|
|
3
|
+
# https://developer.bigcommerce.com/api/stores/v2/option_sets/options
|
|
4
|
+
|
|
5
|
+
module Bigcommerce
|
|
6
|
+
class OptionSetOption < Resource
|
|
7
|
+
include Bigcommerce::SubresourceActions.new(
|
|
8
|
+
uri: 'option_sets/%d/options/%d')
|
|
9
|
+
|
|
10
|
+
property :id
|
|
11
|
+
property :option_id
|
|
12
|
+
property :option_set_id
|
|
13
|
+
property :display_name
|
|
14
|
+
property :sort_order
|
|
15
|
+
property :is_required
|
|
16
|
+
property :option
|
|
17
|
+
property :values
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Option Value
|
|
2
|
+
# Values that can be selected for an option.
|
|
3
|
+
# https://developer.bigcommerce.com/api/stores/v2/options/values
|
|
4
|
+
|
|
5
|
+
module Bigcommerce
|
|
6
|
+
class OptionValue < Resource
|
|
7
|
+
include Bigcommerce::SubresourceActions.new uri: 'options/%d/values/%d'
|
|
8
|
+
|
|
9
|
+
property :id
|
|
10
|
+
property :option_id
|
|
11
|
+
property :label
|
|
12
|
+
property :sort_order
|
|
13
|
+
property :value
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Product
|
|
2
|
+
# Catalog of saleable items in the store.
|
|
3
|
+
# https://developer.bigcommerce.com/api/stores/v2/products
|
|
4
|
+
|
|
5
|
+
module Bigcommerce
|
|
6
|
+
class Product < Resource
|
|
7
|
+
include Bigcommerce::ResourceActions.new uri: 'products/%d'
|
|
8
|
+
|
|
9
|
+
property :id
|
|
10
|
+
property :count
|
|
11
|
+
property :keyword_filter
|
|
12
|
+
property :name
|
|
13
|
+
property :type
|
|
14
|
+
property :sku
|
|
15
|
+
property :description
|
|
16
|
+
property :search_keywords
|
|
17
|
+
property :availability_description
|
|
18
|
+
property :price
|
|
19
|
+
property :cost_price
|
|
20
|
+
property :retail_price
|
|
21
|
+
property :sale_price
|
|
22
|
+
property :calculated_price
|
|
23
|
+
property :sort_order
|
|
24
|
+
property :is_visible
|
|
25
|
+
property :is_featured
|
|
26
|
+
property :related_products
|
|
27
|
+
property :inventory_level
|
|
28
|
+
property :inventory_warning_level
|
|
29
|
+
property :warranty
|
|
30
|
+
property :weight
|
|
31
|
+
property :width
|
|
32
|
+
property :height
|
|
33
|
+
property :depth
|
|
34
|
+
property :fixed_cost_shipping_price
|
|
35
|
+
property :is_free_shipping
|
|
36
|
+
property :inventory_tracking
|
|
37
|
+
property :rating_total
|
|
38
|
+
property :rating_count
|
|
39
|
+
property :total_sold
|
|
40
|
+
property :date_created
|
|
41
|
+
property :brand_id
|
|
42
|
+
property :view_count
|
|
43
|
+
property :page_title
|
|
44
|
+
property :meta_keywords
|
|
45
|
+
property :meta_description
|
|
46
|
+
property :layout_file
|
|
47
|
+
property :is_price_hidden
|
|
48
|
+
property :price_hidden_label
|
|
49
|
+
property :categories
|
|
50
|
+
property :date_modified
|
|
51
|
+
property :event_date_field_name
|
|
52
|
+
property :event_date_type
|
|
53
|
+
property :event_date_start
|
|
54
|
+
property :event_date_end
|
|
55
|
+
property :myob_asset_account
|
|
56
|
+
property :myob_income_account
|
|
57
|
+
property :myob_expense_account
|
|
58
|
+
property :peachtree_gl_account
|
|
59
|
+
property :condition
|
|
60
|
+
property :is_condition_shown
|
|
61
|
+
property :preorder_release_date
|
|
62
|
+
property :is_preorder_only
|
|
63
|
+
property :preorder_message
|
|
64
|
+
property :order_quantity_minimum
|
|
65
|
+
property :order_quantity_maximum
|
|
66
|
+
property :open_graph_type
|
|
67
|
+
property :open_graph_title
|
|
68
|
+
property :open_graph_description
|
|
69
|
+
property :is_open_graph_thumbnail
|
|
70
|
+
property :upc
|
|
71
|
+
property :date_last_imported
|
|
72
|
+
property :option_set_id
|
|
73
|
+
property :tax_class_id
|
|
74
|
+
property :option_set_display
|
|
75
|
+
property :bin_picking_number
|
|
76
|
+
property :custom_url
|
|
77
|
+
property :availability
|
|
78
|
+
property :brand
|
|
79
|
+
property :downloads
|
|
80
|
+
property :images
|
|
81
|
+
property :discount_rules
|
|
82
|
+
property :configurable_fields
|
|
83
|
+
property :custom_fields
|
|
84
|
+
property :videos
|
|
85
|
+
property :skus
|
|
86
|
+
property :rules
|
|
87
|
+
property :option_set
|
|
88
|
+
property :options
|
|
89
|
+
property :tax_class
|
|
90
|
+
property :avalara_product_tax_code
|
|
91
|
+
property :primary_image
|
|
92
|
+
|
|
93
|
+
def self.count(params = {})
|
|
94
|
+
get 'products/count', params
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|