woosignal_shopify_api 2.3.2
woosignal_shopify_api: ^2.3.2 copied to clipboard
Shopify API for Dart, connect a Shopify store on WooSignal and start using the API to get products, login, create orders and more.
Shopify API Dart plugin #
Official WooSignal Shopify package
Build apps for Shopify easier with our new package. Free to get started, see the simple examples below.
Getting Started #
In your flutter project add the dependency:
dependencies:
...
woosignal_shopify_api: ^2.3.2
Usage example #
Import woosignal_shopify_api.dart
import 'package:shopify_woosignal/woosignal_shopify_api.dart';
Example using WooSignal API for Shopify #
import 'woosignal_shopify_api/woosignal_shopify_api.dart';
...
// EXAMPLE GET PRODUCT
_getProducts() async {
// Step 1 - Initialize WooSignal
await WooSignalShopify.instance.init(appKey: "your app key");
// Step 2 - Call an API
ShopifyProductResponse? shopifyProductResponse = await WooSignalShopify.instance.getProducts();
print(shopifyProductResponse?.products?[0].name); // prints a product name
});
}
Available API Requests #
Shopify API Client Documentation #
Below is a comprehensive list of available methods grouped by their functionality.
Cart Operations #
cartCheck(List<Map<String, dynamic>> cartLines) #
Validates if items in the cart are in stock.
- Parameters: List of cart items
- Returns: List of validated cart items
- Method: POST
Product Operations #
getProducts({int? first, String? after, String? status}) #
Fetches products with pagination support.
- Parameters:
first: Number of products to fetchafter: Cursor for paginationstatus: Product status (active, archived, draft)
- Returns:
ShopifyProductResponse - Method: POST
getProductsRestApi({...}) #
Fetches products using REST API with extensive filtering options.
- Parameters:
limit: Maximum number of productsproductType: Filter by product typecollectionId: Filter by collection- Various date filters and other parameters
- Returns: List of
Product - Method: POST
getProduct({required String productId, String? fields}) #
Fetches a single product by ID.
- Parameters:
productId: Product identifierfields: Specific fields to retrieve
- Returns:
Product - Method: POST
getProductCount({...}) #
Gets the total count of products with filtering options.
- Parameters: Various filters including product type, collection ID, date ranges
- Returns:
CountResponse - Method: POST
productSearch({String? query, int first = 100, String? after}) #
Searches for products.
- Parameters:
query: Search termfirst: Number of resultsafter: Pagination cursor
- Returns:
ShopifyProductSearch - Method: POST
Collection Operations #
getCollectionsByIds({required List<String> ids}) #
Fetches collections by their IDs.
- Parameters: List of collection IDs
- Returns:
CollectionItem - Method: POST
getProductsByCollectionId({String? id, int? first, String? after}) #
Retrieves products within a specific collection.
- Parameters:
id: Collection IDfirst: Number of productsafter: Pagination cursor
- Returns:
ProductsByCollectionIdResponse - Method: POST
Customer Authentication #
authCustomerLogin({required String? email, required String? password, bool? loginUser}) #
Authenticates a customer.
- Parameters:
email: Customer emailpassword: Customer passwordloginUser: Whether to automatically log in
- Returns:
AuthCustomer - Method: POST
authCustomerRegister({...}) #
Registers a new customer.
- Parameters:
email: Customer emailpassword: Customer passwordfirstName: Customer first namelastName: Customer last nameacceptsMarketing: Marketing preferences
- Returns:
AuthCustomer - Method: POST
authCustomerForgotPassword({required String email}) #
Initiates password reset process.
- Parameters: Customer email
- Returns: Boolean indicating success
- Method: POST
Customer Management #
authCustomer({String? accessToken}) #
Retrieves customer details.
- Parameters: Customer access token
- Returns:
AuthCustomerInfo - Method: GET
authCustomerUpdate({String? customerAccessToken, String? firstName, String? lastName}) #
Updates customer information.
- Parameters: Access token and updated fields
- Returns:
AuthCustomerUpdateResponse - Method: PUT
authCustomerUpdateAddress({...}) #
Updates customer shipping address.
- Parameters: Address details including street, city, country, etc.
- Returns:
AuthCustomerAddressUpdated - Method: PUT
Order Management #
createOrder(ShopifyOrder shopifyOrder) #
Creates a new order.
- Parameters: Order details
- Returns:
OrderCreatedResponse - Method: POST
getOrder({required String orderId}) #
Retrieves order details.
- Parameters: Order ID
- Returns:
OrderResponse - Method: GET
authCustomerOrders({String? customerAccessToken, int? perPage, String? after}) #
Fetches customer's order history.
- Parameters:
customerAccessToken: Customer access tokenperPage: Results per pageafter: Pagination cursor
- Returns:
AuthCustomerOrder - Method: GET
Shop Information #
getShop({String? fields}) #
Retrieves shop details.
- Parameters: Specific fields to retrieve
- Returns:
ShopResponse - Method: POST
getPolicies({String? fields}) #
Fetches shop policies.
- Parameters: Specific fields to retrieve
- Returns:
PoliciesResponse - Method: POST
checkAppStatus() #
Verifies if the app can process orders.
- Returns: Boolean
- Method: POST
Shipping #
fetchShippingZones() #
Retrieves available shipping zones.
- Returns:
ShopifyShippingZone - Method: GET
getShippingZones({String? fields}) #
Fetches detailed shipping zone information.
- Parameters: Specific fields to retrieve
- Returns:
ShippingZonesResponse - Method: POST
getProvinces({required String id, String? fields}) #
Retrieves provinces/states for a country.
- Parameters:
id: Country IDfields: Specific fields to retrieve
- Returns:
ProvincesResponse - Method: POST
Discounts #
getDiscountCodeByLookup({String? code}) #
Validates a discount code.
- Parameters: Discount code
- Returns:
DiscountCode - Method: GET
getPriceRuleById({String? priceRuleId}) #
Retrieves price rule details.
- Parameters: Price rule ID
- Returns:
PriceRuleResponse - Method: POST
Disclaimer: This plugin is not affiliated with or supported by Shopify. All logos and trademarks are the property of their respective owners.
