2 min read

Shopify Api Clients

Poq.Backend.Shopify.Client namespace provides Contracts and Clients that allow quick usage of Shopify API.

Contracts

Contain all necessary contracts to use Shopify clients effectively.

Clients

List of Available Clients

ShopifyAccountClient

Provides creation of user account in Shopify, accessing user account details, accessing user orders, obtain user order by id. It uses ShopifyClientConfiguration.StoreFrontAccessToken to access Shopify Storefront Graphql API

Methods
  • CreateAccountAsync creates customer account with provided parameters.

  • UpdateAccountAsync updates customer account. Requires customer access token.

  • GetAccountDetailsAsync returns customer account details. Requires customer access token.

  • GetAccountOrdersAsync returns customer orders.

  • GetAccountOrderAsync returns customer order details.

  • DeleteAccountAsync marks customer account as deleted.

ShopifyAddressClient

Provides CRUD operation for user addresses.

Methods
  • CreateAddressAsync creates customer address

  • UpdateAddressAsync updates customer address

  • DeleteAddressAsync deletes customer address

  • ListAddressesAsync returns list of customer addresses

  • SetDefaultAddressAsync sets default customer address

  • GetAddressAsync returns address details

ShopifyCartClient

Provides CRUD operations for carts. It uses Shopify Graphql API to manipulate shopify carts.

Methods
  • CreateCartAsync creates cart

  • CartBuyerIdentityUpdateAsync update buyer identity of a cart. (connects certain customer to cart)

  • CartDiscountCodesUpdateAsync add, remove, update discount codes applied to the cart

  • CartNoteUpdateAsync add, remove, update cart note

  • CartAttributesUpdateAsync add, remove, update cart attributes (supports customizations)

  • CartLinesAddAsync add cart items

  • CartLinesRemoveAsync remove cart item

  • CartLinesUpdateAsync update cart item

  • GetCartAsync returns cart by its id

  • GetRawCartResponseAsync returns HttpResponseMessage received from getCart request

ShopifyCheckoutClient

Provides creation of order with list of products inside.

Methods
  • CreateCheckoutAsync creates shopify checkout with specified items and currencies.

  • AssociateCustomerToCheckoutAsync associates customer to shopify checkout. Resolves registered users access to shopify checkout.

ShopifyCollectionClient

This client is intended to support work with custom and smart collections defined in shopify administration.

Methods
  • GetCustomCollectionsAsync obtains custom collections from Shopify Admin API

  • GetUpdatedCustomCollectionsAsync obtains custom collections updated after specific data from Shopify Admin API

  • GetSmartCollectionsAsync obtains smart collections from Shopify Admin API

  • GetUpdatedSmartCollectionsAsync obtains smart collections updated after specific data from Shopify Admin API

  • GetCollectsAsync obtains connections between product and collection from Shopify Admin API

  • GetCollectsByCollectionAsync obtains products connections for specific collection from Shopify Admin API

  • GetCollections obtains collections matching search criteria(or all if no criteria is provided) from Shopify Graphql API

ShopifyIdentityClient

Provides login, logout, token renewal operations.

Methods
  • GetTokenAsync obtains access token for registered user(login).

  • TokenRenewAsync renews customer access token

  • LogoutAsync deletes customer access token

ShopifyLocationsClient

Provides information for physical stores defined in Shopify administration

Methods
  • GetLocationsAsync obtains all locations defined in administration. Uses Shopify Admin Graphql API

ShopifyMetafieldsClient

Provides information for metafields defined in Shopify administration. Uses Shopify Admin Graphql API.

Methods
  • SetMetafieldAsync set metafield for object.

  • GetMetafieldAsync get metafield for object.

  • GetMetafieldsAsync get all metafields for object.

ShopifyNavigationClient

When custom code is added to shopify site this client can obtain entire navigation tree defined in shopify administration. This client is used when building category tree from feed file.

Methods
  • GetNavigationLayoutAsync obtains navigation menu from shopify using custom poq template page.

  • GetNavigationLayoutAsync overload available to obtain navigation from development stores. (Shopify development stores require password to access all web pages)

ShopifyProductClient

Provides listing all products, get product by collectionId, get products updated after certain date. This client is used to obtain products information and generate feed file.

Methods
  • GetProductsByCollectionAsync obtains product in collection from Shopify Admin Rest API

  • GetUpdatedProductsAsync obtains products updated after specific date from Shopify Admin Rest API

  • GetUpdatedProductsByCollectionAsync obtains products in collection updated after specific date from Shopify Admin Rest API

  • GetProductsAsync obtains all products from Shopify Admin Rest API.

  • GetProductsByCollectionIdAsync obtains products in collection from Shopify Admin Rest API

  • GetProductsByIdsAsync obtains products by their ids from Shopify Storefront Graphql API

  • GetProductsByVariantIdsAsync obtains products by variant ids from Shopify Storefront Graphql API

ShopifySearchClient

Provides methods to search in shopify inventory by several criteria

Methods
  • SearchAsync searches for products by keyword, price range and availability. Uses Shopify Storefront Graphql API

  • SearchInCollectionAsync searches for products in certain collection by price range, availability and options filter(size, color). Uses Shopify Storefront Graphql API

  • GetCollectionFiltersAsync obtains available filters for certain collection. Uses Shopify Storefront Graphql API

  • SearchByBarcodeAsync specific search query to search by product barcode in Shopify Storefront Graphql API.