Models

Base

class shopify_trois.models.model.Model(*args, **kwargs)

Bases: builtins.object

Base model class for all Shopify resources.

changes()

Returns a dictionary of attributes that have changed.

http://stackoverflow.com/a/111364/1014879

enclosure = None

Holds the data enclosure name if not normalized.

exists()

Determine if the instance has been persisted.

is_subresource_of = None

Mark the model as being a subresource of another.

parent_id = None

Holds the model parent id value. Used with is_subresource_of.

primary_key = 'id'

The model primary key.

properties = []

List of properties exposed by the api.

resource = ''

The shopify url resource.

supported = []

List of supported actions on the resource.

to_dict()

Returns the instance as a dictionary.

classmethod to_underscore_name()

Underscore the class name.

update(data, ignore_properties=False)

Update the instance with the provided data.

Parameters:
  • data – Properties to update.
  • ignore_properties – Only update known properties when set to false

Models

class shopify_trois.models.ApplicationCharge(*args, **kwargs)

Bases: shopify_trois.models.model.Model

ApplicationCharge http://docs.shopify.com/api/applicationcharge

properties = ['created_at', 'id', 'name', 'price', 'return_url', 'status', 'test', 'updated_at', 'confirmation_url']
resource = 'application_charges'
supported = ['index', 'view', 'create', '/activate']
class shopify_trois.models.Article(*args, **kwargs)

Bases: shopify_trois.models.model.Model

Article http://docs.shopify.com/api/article

is_subresource_of

alias of Blog

properties = ['author', 'blog_id', 'body_html', 'created_at', 'id', 'published_at', 'summary_html', 'template_suffix', 'title', 'updated_at', 'user_id', 'tags']
resource = 'articles'
supported = ['index', 'count', 'view', 'create', 'update', 'delete']
class shopify_trois.models.Asset(*args, **kwargs)

Bases: shopify_trois.models.model.Model

Asset is probably the weirdest resource exposed by Shopify. Create/Update is actually a PUT on theme/#{id}/assets.json Delete is a DELETE on theme/#{id}/assets.json and the asset key is passed by parameter...

http://docs.shopify.com/api/asset

is_subresource_of

alias of Theme

properties = ['key', 'public_url', 'created_at', 'updated_at', 'content_type', 'size', 'theme_id']
resource = 'assets'
supported = ['index']
class shopify_trois.models.Blog(*args, **kwargs)

Bases: shopify_trois.models.model.Model

Blog http://docs.shopify.com/api/blog

properties = ['commentable', 'created_at', 'feedburner', 'feedburner_location', 'handle', 'id', 'template_suffix', 'title', 'updated_at', 'tags']
resource = 'blogs'
supported = ['index', 'count', 'view', 'create', 'update', 'delete']
class shopify_trois.models.CarrierService(*args, **kwargs)

Bases: shopify_trois.models.model.Model

CarrierService http://docs.shopify.com/api/carrierservice

properties = ['name', 'callback_url', 'format', 'service_discovery', 'active', 'carrier_service_type']
resource = 'carrier_services'
supported = ['index', 'create', 'view', 'delete', 'update']
class shopify_trois.models.Checkout(*args, **kwargs)

Bases: shopify_trois.models.model.Model

Checkout http://docs.shopify.com/api/checkout

properties = ['buyer_accepts_marketing', 'cart_token', 'closed_at', 'completed_at', 'created_at', 'currency', 'email', 'gateway', 'id', 'landing_site', 'note', 'referring_site', 'shipping_lines', 'subtotal_price', 'tax_lines', 'taxes_included', 'token', 'total_discounts', 'total_line_items_price', 'total_price', 'total_tax', 'total_weight', 'updated_at', 'line_items', 'name', 'note_attributes', 'discount_codes', 'billing_address', 'shipping_address', 'customer']
resource = 'checkouts'
supported = ['count', 'index']
class shopify_trois.models.Collect(*args, **kwargs)

Bases: shopify_trois.models.model.Model

Collect http://docs.shopify.com/api/collect

properties = ['collection_id', 'created_at', 'featured', 'id', 'product_id', 'sort_value', 'updated_at', 'position']
resource = 'collects'
supported = ['count', 'create', 'index', 'view']
class shopify_trois.models.Comment(*args, **kwargs)

Bases: shopify_trois.models.model.Model

Comment http://docs.shopify.com/api/comment

properties = ['article_id', 'author', 'blog_id', 'body', 'body_html', 'created_at', 'email', 'id', 'ip', 'published_at', 'status', 'updated_at', 'user_agent']
resource = 'comments'
supported = ['count', 'create', 'index', 'update', 'view', '/spam', '/not_spam', '/approve', '/remove']
class shopify_trois.models.Country(*args, **kwargs)

Bases: shopify_trois.models.model.Model

Country http://docs.shopify.com/api/country

properties = ['code', 'id', 'name', 'tax', 'provinces', 'weight_based_shipping_rates', 'price_based_shipping_rates', 'carrier_shipping_rate_providers']
resource = 'countries'
supported = ['index', 'count', 'view', 'create', 'update', 'delete']
class shopify_trois.models.CustomCollection(*args, **kwargs)

Bases: shopify_trois.models.model.Model

CustomCollection http://docs.shopify.com/api/customcollection

properties = ['body_html', 'handle', 'id', 'products_count', 'published_at', 'published_scope', 'sort_order', 'template_suffix', 'title', 'updated_at', 'image']
resource = 'custom_collections'
supported = ['count', 'create', 'delete', 'index', 'update', 'view']
class shopify_trois.models.Customer(*args, **kwargs)

Bases: shopify_trois.models.model.Model

Customer http://docs.shopify.com/api/customer

properties = ['accepts_marketing', 'created_at', 'email', 'first_name', 'id', 'last_name', 'last_order_id', 'muiltipass_identifier', 'note', 'order_count', 'state', 'total_spent', 'updated_at', 'verified_email', 'tags', 'last_order_name', 'default_address', 'addresses']
resource = 'customers'
supported = ['count', 'create', 'delete', 'index', 'search', 'update', 'view']
class shopify_trois.models.CustomerGroup(*args, **kwargs)

Bases: shopify_trois.models.model.Model

CustomerGroup http://docs.shopify.com/api/customergroup

properties = ['created_at', 'id', 'name', 'updated_at', 'query']
resource = 'customer_groups'
supported = ['create', 'delete', 'index', '/customers', 'update', 'view']
class shopify_trois.models.Event(*args, **kwargs)

Bases: shopify_trois.models.model.Model

Event http://docs.shopify.com/api/event

properties = ['arguments', 'body', 'created_at', 'id', 'subject_id', 'subject_type', 'verb', 'message']
resource = 'events'
supported = ['count', 'index', 'view']
class shopify_trois.models.Fulfillment(*args, **kwargs)

Bases: shopify_trois.models.model.Model

Fulfillment http://docs.shopify.com/api/fulfillment

is_subresource_of

alias of Order

properties = ['fulfillment_service', 'fulfillment_status', 'grams', 'id', 'price', 'product_id', 'quantity', 'requires_shipping', 'sku', 'title', 'variant_id', 'variant_title', 'vendor', 'name', 'variant_inventory_management', 'properties', 'product_exists']
resource = 'fulfillments'
supported = ['count', 'create', 'index', '/cancel', 'update', 'view']
class shopify_trois.models.FulfillmentService(*args, **kwargs)

Bases: shopify_trois.models.model.Model

FulfillmentService http://docs.shopify.com/api/fulfillmentservice

properties = ['callback_url', 'format', 'name', 'requires_shipping_method', 'tracking_support', 'credential1', 'email', 'handle', 'id', 'include_pending_stock', 'name', 'service_name', 'inventory_management', 'provider_id', 'credential2_exists']
resource = 'fulfillment_services'
supported = ['index', 'count', 'view', 'create', 'update', 'delete']
class shopify_trois.models.Metafield(*args, **kwargs)

Bases: shopify_trois.models.model.Model

MetaField http://docs.shopify.com/api/metafield

enclosure = 'metafield'
properties = ['created_at', 'description', 'id', 'key', 'namespace', 'owner_id', 'updated_at', 'value', 'value_type', 'owner_resource']
resource = 'metafields'
supported = ['count', 'create', 'delete', 'index', 'update', 'view']
class shopify_trois.models.Order(*args, **kwargs)

Bases: shopify_trois.models.model.Model

Order http://docs.shopify.com/api/order

properties = ['buyer_accepts_marketing', 'cancel_reason', 'cancelled_at', 'cart_token', 'checkout_token', 'closed_at', 'confirmed', 'created_at', 'currency', 'email', 'financial_status', 'fulfillment_status', 'gateway', 'id', 'landing_site', 'location_id', 'name', 'note', 'number', 'reference', 'referring_site', 'source', 'subtotal_price', 'taxes_included', 'test', 'token', 'total_discounts', 'total_line_items_price', 'total_price', 'total_price_usd', 'total_tax', 'total_weight', 'updated_at', 'user_id', 'browser_ip', 'landing_site_ref', 'order_number', 'discount_codes', 'note_attributes', 'processing_method', 'checkout_id', 'line_items', 'shipping_lines', 'tax_lines', 'payment_details', 'billing_address', 'shipping_address', 'fulfillments', 'client_details', 'customer']
resource = 'orders'
supported = ['count', 'create', 'delete', 'index', '/close', '/open', '/cancel', 'update', 'view']
class shopify_trois.models.OrderRisk(*args, **kwargs)

Bases: shopify_trois.models.model.Model

Page http://docs.shopify.com/api/orderrisk

enclosure = 'risk'
is_subresource_of

alias of Order

properties = ['cause_cancel', 'checkout_id', 'display', 'id', 'message', 'order_id', 'recommendation', 'score', 'source']
resource = 'risks'
supported = ['create', 'update', 'delete']
class shopify_trois.models.Page(*args, **kwargs)

Bases: shopify_trois.models.model.Model

Page http://docs.shopify.com/api/page

properties = ['author', 'body_html', 'created_at', 'handle', 'id', 'published_at', 'shop_id', 'template_suffix', 'title', 'updated_at']
resource = 'pages'
supported = ['index', 'view', 'create', 'count', 'update', 'delete']
class shopify_trois.models.Product(*args, **kwargs)

Bases: shopify_trois.models.model.Model

http://docs.shopify.com/api/product

properties = ['body_html', 'created_at', 'handle', 'id', 'product_type', 'published_at', 'published_scope', 'template_suffix', 'title', 'updated_at', 'vendor', 'tags', 'variants', 'options', 'images', 'image']
resource = 'products'
supported = ['index', 'view', 'create', 'count', 'update', 'delete']
class shopify_trois.models.ProductImage(*args, **kwargs)

Bases: shopify_trois.models.model.Model

ProductImage http://docs.shopify.com/api/productimage

enclosure = 'image'
is_subresource_of

alias of Product

properties = ['created_at', 'id', 'position', 'product_id', 'updated_at', 'src']
resource = 'images'
supported = ['index', 'view', 'create', 'delete']
class shopify_trois.models.ProductSearchEngine(*args, **kwargs)

Bases: shopify_trois.models.model.Model

http://docs.shopify.com/api/productsearchengine

properties = ['created_at', 'name']
resource = 'product_search_engines'
supported = ['index']
class shopify_trois.models.ProductVariant(*args, **kwargs)

Bases: shopify_trois.models.model.Model

ProductVariant http://docs.shopify.com/api/productvariant

enclosure = 'variant'
is_subresource_of

alias of Product

properties = ['barcode', 'compare_at_price', 'created_at', 'fulfillment_service', 'grams', 'id', 'inventory_management', 'inventory_policy', 'option1', 'option2', 'option3', 'position', 'price', 'product_id', 'requires_shipping', 'sku', 'taxable', 'title', 'updated_at', 'inventory_quantity']
resource = 'variants'
supported = ['index', 'view', 'count', 'create', 'update', 'delete']
class shopify_trois.models.Province(*args, **kwargs)

Bases: shopify_trois.models.model.Model

http://docs.shopify.com/api/province

is_subresource_of

alias of Country

properties = ['code', 'country_id', 'id', 'name', 'tax', 'tax_name', 'tax_type', 'tax_percentage']
resource = 'provinces'
supported = ['index', 'view', 'count', 'update']
class shopify_trois.models.RecurringApplicationCharge(*args, **kwargs)

Bases: shopify_trois.models.model.Model

RecurringApplicationCharge http://docs.shopify.com/api/recurringapplicationcharge

properties = ['activated_on', 'billing_on', 'cancelled_on', 'created_at', 'id', 'name', 'price', 'return_url', 'status', 'test', 'trial_days', 'trial_ends_on', 'updated_at', 'confirmation_url']
resource = 'recurring_application_charges'
supported = ['index', 'view', 'create', '/activate']
class shopify_trois.models.Redirect(*args, **kwargs)

Bases: shopify_trois.models.model.Model

Redirect http://docs.shopify.com/api/redirect

properties = ['created_at', 'id', 'path', 'target', 'updated_at']
resource = 'redirects'
supported = ['index', 'view', 'count', 'create', 'update', 'delete']
class shopify_trois.models.ScriptTag(*args, **kwargs)

Bases: shopify_trois.models.model.Model

ScriptTag http://docs.shopify.com/api/scriptag

properties = ['created_at', 'id', 'event', 'src', 'updated_at']
resource = 'script_tags'
supported = ['index', 'view', 'count', 'create', 'update', 'delete']
class shopify_trois.models.Shop(*args, **kwargs)

Bases: shopify_trois.models.model.Model

http://docs.shopify.com/api/shop

properties = ['address1', 'city', 'country', 'created_at', 'customer_email', 'currency', 'domain', 'email', 'google_apps_domain', 'google_apps_login_enabled', 'id', 'latitude', 'longitude', 'money_format', 'money_with_currency_format', 'myshopify_domain', 'name', 'plan_name', 'phone', 'province', 'public', 'shop_owner', 'source', 'tax_shipping', 'taxes_included', 'timezone', 'zip']
resource = 'shop'
supported = ['view']
class shopify_trois.models.SmartCollection(*args, **kwargs)

Bases: shopify_trois.models.model.Model

http://docs.shopify.com/api/smartcollection

properties = ['body_html', 'handle', 'id', 'products_count', 'published_at', 'published_scope', 'sort_order', 'template_suffix', 'title', 'updated_at', 'rules', 'image']
resource = 'smart_collections'
supported = ['index', 'view', 'count', 'create', 'update', 'delete']
class shopify_trois.models.Theme(*args, **kwargs)

Bases: shopify_trois.models.model.Model

Theme http://docs.shopify.com/api/theme

properties = ['created_at', 'id', 'name', 'role', 'updated_at', 'src']
resource = 'themes'
supported = ['index', 'view', 'create', 'update', 'delete']
class shopify_trois.models.Transaction(*args, **kwargs)

Bases: shopify_trois.models.model.Model

Transaction http://docs.shopify.com/api/transactions

is_subresource_of

alias of Order

properties = ['amount', 'authorization', 'created_at', 'gateway', 'id', 'kind', 'location_id', 'message', 'order_id', 'status', 'user_id', 'device_id', 'test', 'receipt']
resource = 'transactions'
supported = ['index', 'count', 'view', 'create']
class shopify_trois.models.Webhook(*args, **kwargs)

Bases: shopify_trois.models.model.Model

Webhook http://docs.shopify.com/api/webhook

properties = ['address', 'created_at', 'format', 'id', 'topic', 'updated_at']
resource = 'webhooks'
supported = ['index', 'count', 'view', 'create', 'update', 'delete']
Fork me on GitHub