Deposits Commerce SDK

pub package

The Deposits commerce SDK is an easy to embed commerce system for allowing creators to setup and operate an online store without owning an e-commerce website. Empowering vendors to launch commerce feature without the engineering time at less the cost of building commerce capabilities internally. Shoppers can view products and checkout one item at a time from each vendor's store without leaving the application .

deposits-one-click-checkout-flutter_cover

Installation

pubspec.yaml :

dependencies:

flutter:

sdk: flutter

deposits_ecommerce: <Latest version>

Terminal :

flutter pub add deposits_one_click_checkout

Features

  • Create Store.
  • Customer Management
  • Cart Management.
  • Order Management.
  • Products management.
  • Categories.
  • Shipping Address Management.
  • Merchant management.
  • Etc and more.

Requirements

Android

This plugin requires several changes to be able to work on Android devices. Please make sure you follow all these steps:

  1. Use Android 5.0 (API level 21) and above

  2. Rebuild the app, as the above changes don't update with hot reload

iOS

Compatible with apps targeting iOS 10 or above.

Web

We do not support the web via this plugin for now

Usage

The library provides a UI component for creating and managing stores and managing customers.

Customer Management/Flow Example

    depositsCustomerWidget(
      context,
      merchantId: '1',
      customerID: '1',
      envMode: envMode,
      apiKey: apiKey ,
    )

Merchant Management/Flow Example

    depositsMerchantWidget(
      context,
      ButtonConfig(buttonText: 'buttonText'),
      merchantID: '',
      apiKey: apiKey,
      envMode: envMode,
     )

Parameter, buttonText is the name you want on the button

Parameter merchantID is the id of the merchant(whom you want to display their products) provided by Deposits API when the merchant was created, e.g. 43cba34n65l.

Parameter customerID is the id of the customer which is the user about to buy/purchase something provided by the Deposits API when the customer was created, e.g. 98iei74uij.

Parameter apiKey is the key for the merchant provided byt Deposits API when the merchant was created, e.g. deposits-ecommerce-test.

Parameter `envMode`, tells the library if it should use the staging or the live environment. /// Useful if you are debuging or in development.

The goal of Deposits Commerce SDK is to make building amazing Ecommerce apps with flutter and Deposits as easy as can be and help improve your workflow.

Deposit Commerce SDK initialization

To initialize Deposit Ecommerce Customer Management/Flow in your Flutter app, use the depositsCustomerWidget and depositsMerchantWidget for Deposits Ecommerce Merchant Management/Flow

depositsCustomerWidget and depositsMerchantWidget offers context, buttonConfig, initialScreen, envMode, merchantID and customerID, apiKey. Only apiKey, envMode and buttonConfig (which has the following params : amount required, textStyle, height, minwidth , etc as customizable widgets ) is required. envMode is either true or false as a bool.

Dart API

deposits

The library offers several methods to handle both customer and merchant related actions:

import 'package:deposits_ecommerce/deposits_ecommerce.dart';

DepositsApi depositsApi = DepositsApi(
    apiKey: 'deposits-ecommerce-test', 
    isProduction: false, 
    isDebug: true
);

===================Merchant External API's===================
print("======>>>>>>");
var categoryApiResponse = await depositsApi.getCategories();
print("categoryApiResponse $categoryApiResponse");

print("======>>>>>>");
var setUpShopApiResponse = await depositsApi.setupMerchant('233', 'demo shop', 'my demo shop', 'support@example.com', 'Electronics', '500443', 'Mina avenue', 'Dallas', 'Texas', 'USA');
print("setUpShopApiResponse $setUpShopApiResponse");

print("======>>>>>>");
var getMerchantApiResponse = await depositsApi.getMerchant('22');
print("getMerchantApiResponse $getMerchantApiResponse");

print("======>>>>>>");
var getMerchantInfoApiResponse = await depositsApi.getMerchantInfo('22');
print("getMerchantInfoApiResponse $getMerchantInfoApiResponse");

print("======>>>>>>");
var getSelectedMerchantsApiResponse = await depositsApi.getSelectedMerchants(['22']);
print("getSelectedMerchantsApiResponse $getSelectedMerchantsApiResponse");

print("======>>>>>>");
var updateMerchantApiResponse = await depositsApi.updateMerchant('22', 'demo shop', 'my demo shop', 'support@example.com', 'Electronics', '500443', 'Mina avenue', 'Dallas', 'Texas', 'USA');
print("updateMerchantApiResponse $updateMerchantApiResponse");

print("======>>>>>>");
var updateMerchantContactInfoApiResponse = await depositsApi.updateMerchantContactInfo('22', 'mysupport@example.com', '74 clinoda avenue, dave town');
print("updateMerchantContactInfoApiResponse $updateMerchantContactInfoApiResponse");

print("======>>>>>>");
var updateMerchantPolicyApiResponse = await depositsApi.updateMerchantPolicy('22', 'we allow return but only if item is not defected', 'when we ship an order can not be cancelled and we deliver straight to your door step');
print("updateMerchantPolicyApiResponse $updateMerchantPolicyApiResponse");

print("======>>>>>>");
var updateMerchantShippingAndTaxInfoApiResponse = await depositsApi.updateMerchantShippingAndTaxInfo('22', '893883HHHJH', '20%', '30');
print("updateMerchantShippingAndTaxInfoApiResponse $updateMerchantShippingAndTaxInfoApiResponse");

print("======>>>>>>");
var createAssetApiResponse = await depositsApi.createAsset('22', 'file/csdvhrufre.png', 'my product', 'front image for my product');
print("createAssetApiResponse $createAssetApiResponse");

print("======>>>>>>");
var createProductApiResponse = await depositsApi.createProduct('22', 'HGDYU7374743', 'my product', '34', 'my book to help you sell', '3', 'true', '', '3', '10', {}, {});
print("createProductApiResponse $createProductApiResponse");


===================Customer External API's===================
print("======>>>>>>");
var createCustomerApiResponse = await depositsApi.createCustomer('22','calmpress@gmail.com','james','Bova','null','null',{'address':'null'});
print("createCustomerApiResponse $createCustomerApiResponse");

print("======>>>>>>");
var findCustomerApiResponse = await depositsApi.findCustomer('22','calmpress@gmail.com');
print("findCustomerApiResponse $findCustomerApiResponse");

print("======>>>>>>");
var getProductsApiResponse = await depositsApi.getProducts('22');
print("getProductsApiResponse $getProductsApiResponse");

print("======>>>>>>");
var getProductApiResponse = await depositsApi.getProduct('22', '2');
print("getProductApiResponse $getProductApiResponse");

print("======>>>>>>");
var getFeaturedProductsApiResponse = await depositsApi.getFeaturedProducts('22');
print("getFeaturedProductsApiResponse $getFeaturedProductsApiResponse");

The example app offers examples on how to use these methods.

Run the example app

  • Navigate to the example folder cd example

  • Install the dependencies

  • flutter pub get

  • Set up env vars for the flutter app and a local backend.

  • Get your test API keys

  • Get your live API keys

  • Start the example

  • Terminal 1: flutter run

Contributing

Only members of the deposits team can contribute to this. You can create an issue if you find a bug or have any challenge using this SDK.

Libraries

app/modules/customer/address/add_delivery_address/add_delivery_address
app/modules/customer/address/add_delivery_address/add_delivery_address_controller
app/modules/merchant/products_menu/add_products/add_product
app/modules/merchant/products_menu/add_products/add_product_controller
app/modules/merchant/settings_menu/tax_fees/add_tax_fees/add_tax_fees
app/modules/merchant/settings_menu/tax_fees/add_tax_fees/add_tax_fees_controller
app/modules/merchant/all_customers/all_customers
app/modules/merchant/all_customers/all_customers_controller
app/model/merchant_model/customer/all_customers_response
app/modules/merchant/all_merchant/all_merchants
app/model/merchant_model/merchant_response/all_merchants
app/modules/merchant/all_merchant/all_merchants_controller
app/model/customer_model/order_checkout/all_orders_response
app/modules/merchant/payments_menu/all_payments/all_payments
app/modules/merchant/payments_menu/all_payments/all_payments_controller
app/model/merchant_model/product/get_all/all_products_response
app/model/customer_model/shipping_address/all_shipping_address_response
app/common/values/app_colors
app/common/values/app_images
app/common/values/app_spacing
app/common/values/app_text_style
app/model/merchant_model/assets/asset_response/aseet_response
app/model/common/asset
app/common/utils/button_config
app/model/general_model/city_model
app/common/values/constants
app/modules/merchant/settings_menu/contact_address/contact_address/contact_address
app/modules/merchant/settings_menu/contact_address/contact_address/contact_address_controller
app/model/general_model/country_model
app/modules/merchant/create_customer/create_customer
app/modules/merchant/create_customer/create_customer_controller
app/model/merchant_model/customer/create_response
app/widgets/custom_appbar_widget
app/widgets/custom_back_button
app/widgets/custom_checkbox_widget
app/widgets/custom_close_button
app/widgets/custom_country_state_picker
app/widgets/custom_dropdown
app/widgets/custom_elevated_button
app/widgets/custom_horizontal_line
app/widgets/custom_image
app/widgets/custom_image_card
app/widgets/custom_image_loader
app/widgets/custom_inkwell_widget
app/widgets/custom_internet_retry
app/widgets/custom_listtile_checkbox_widget
app/widgets/custom_listtile_widget
app/widgets/custom_product_tag
app/widgets/custom_rich_text_widget
app/widgets/custom_row_text_widget
app/widgets/custom_safearea
app/widgets/custom_text
app/widgets/custom_text_button
app/widgets/custom_text_field_widget
app/widgets/custom_text_tag
app/model/common/customer
app/modules/merchant/dashboard/dashboard
app/modules/merchant/dashboard/dashboard_binding
app/modules/merchant/dashboard/dashboard_controller
app/model/general_model/data_source
app/modules/merchant/settings_menu/delete_account/delete_account
app/modules/merchant/settings_menu/delete_account/delete_account_controller
app/model/merchant_model/delete/delete_response
app/modules/customer/address/delivery_address/delivery_address
app/modules/customer/address/delivery_address/delivery_address_controller
app/modules/deposits_ecommerce
deposits_ecommerce
app/common/global/deposits_ecommerce_controller
app/common/values/dimens
app/services/dio_client
app/modules/customer/address/edit_address/edit_address
app/modules/customer/address/edit_address/edit_address_controller
app/modules/merchant/settings_menu/contact_address/edit_contact_address/edit_contact_address
app/modules/merchant/settings_menu/contact_address/edit_contact_address/edit_contact_address_controller
app/modules/merchant/products_menu/edit_product/edit_product
app/modules/merchant/products_menu/edit_product/edit_product_controller
app/modules/merchant/settings_menu/shipping_policy/edit_shipping_policy/edit_shipping_policy
app/modules/merchant/settings_menu/shipping_policy/edit_shipping_policy/edit_shipping_policy_controller
app/modules/merchant/settings_menu/shop_details/edit_shop_detail/edit_shop_detail
app/modules/merchant/settings_menu/shop_details/edit_shop_detail/edit_shop_detail_controller
app/modules/merchant/settings_menu/tax_fees/edit_tax_fees/edit_tax_fees
app/modules/merchant/settings_menu/tax_fees/edit_tax_fees/edit_tax_fees_controller
app/model/common/email_data
app/modules/merchant/payments_menu/payments/epayments
app/modules/merchant/payments_menu/payments/epayments_controller
app/common/utils/exports
app/common/utils/extensions
app/model/customer_model/find/find_customer_response
app/model/merchant_model/assets/get_all/get_all_assets_response
app/model/customer_model/get_customer/get_customer_response
app/model/merchant_model/merchant_response/get_merchant_email_response
app/model/customer_model/get_products/get_products_response
app/modules/merchant/home_menu/home_menu
app/modules/merchant/home_menu/home_menu_controller
app/services/logging
app/model/common/merchant
app/model/merchant_model/merchant_response/merchant_response
app/model/common/meta
app/model/common/order
app/model/customer_model/order_checkout/order_checkout_response
app/modules/merchant/payments_menu/payment_details/payment_details
app/modules/merchant/payments_menu/payment_details/payment_details_controller
app/model/general_model/payments_source
app/model/common/pivot
app/modules/customer/google_search/place_service
app/modules/customer/google_search/places_response
app/model/common/product
app/model/merchant_model/product/product_categories/product_categories
app/modules/merchant/products_menu/product_details/product_details
app/modules/merchant/products_menu/product_details/product_details_controller
app/model/common/product_element
app/model/merchant_model/product/product_response/product_response
app/modules/merchant/products_menu/products/products
app/modules/merchant/products_menu/products/products_controller
app/model/merchant_model/setup_merchant/setup_merchant_response
app/modules/merchant/setup_shop/setup_shop
app/modules/merchant/setup_shop/setup_shop_controller
app/model/common/shipping_address
app/model/customer_model/shipping_address/shipping_address_response
app/modules/merchant/settings_menu/shipping_policy/shipping_policy/shipping_policy
app/modules/merchant/settings_menu/shipping_policy/shipping_policy/shipping_policy_controller
app/common/global/shop_button
app/modules/merchant/settings_menu/shop_details/shop_details/shop_detail
app/modules/merchant/settings_menu/shop_details/shop_details/shop_detail_controller
app/modules/customer/shop/shop_item_detail/shop_item_detail
app/modules/customer/shop/shop_item_detail/shop_item_detail_controller
app/modules/merchant/settings_menu/shop_settings/shop_settings
app/modules/merchant/settings_menu/shop_settings/shop_settings_controller
app/modules/customer/shop/shops/shops
app/modules/customer/shop/shops/shops_controller
app/model/customer_model/single_product/single_product_response
app/model/general_model/state_model
app/model/general_model/status_model
app/common/storage/storage
app/common/values/strings
app/modules/customer/successful_mgs/successful_mgs
app/modules/customer/successful_mgs/successful_mgs_controller
app/modules/merchant/settings_menu/support/support
app/modules/merchant/settings_menu/support/support_controller
app/model/merchant_model/support/support_response
app/modules/merchant/settings_menu/tax_fees/tax_fees/tax_fee
app/modules/merchant/settings_menu/tax_fees/tax_fees/tax_fee_controller
app/common/values/theme
app/common/utils/uppercase_formatter
app/common/utils/utils
app/common/utils/validation
app/modules/merchant/settings_menu/view_shop_user/view_shop_item_detail/view_shop_item_detail
app/modules/merchant/settings_menu/view_shop_user/view_shop_item_detail/view_shop_item_detail_controller
app/modules/merchant/settings_menu/view_shop_user/view_shops/view_shops
app/modules/merchant/settings_menu/view_shop_user/view_shops/view_shops_controller
app/model/common/webhook