Amazon MWS (Marketplace Web Services) API is the older API for the Amazon Marketplace while Selling Partner (SP) API provides number of improvements over MWS API including JSON-based REST API design standards and OAuth 2.0. SP-API includes all functionality available in Amazon MWS API.
You may specify which API to connect to by setting Schema. Please be aware that each API has different available connection options as described below.
When using the Amazon Selling Partner API to connect to the Amazon Marketplace, the following properties are required:
Schema: Set this to SellingPartner.
InitiateOAuth: Set this to GETANDREFRESH.
Marketplace: Set this to the Marketplace region that you are registered to sell in.
Also, you can use the SellingPartner property to choose Seller or Vendor authentication.
When using the Amazon MWS API to connect to the Amazon Marketplace, SellerId, Marketplace, Marketplace are required connection properties. Set Schema to Marketplace.
To connect to Amazon Marketplace first authorize CData developer. To do so follow the steps below:
Using the CData MWS developer id: 195280669143.
Go to the Manage your apps page in Seller Central and log into your Amazon seller account as the primary account holder.
Click the Authorize new developer button and follows the authorization workflow using the developer id provided by the provider.
Or you can go to Amazon Marketplace CData Driver and click Authorize Now on the right panel.
To obtain the MWS Auth Token, follow the steps below:
Go to the Manage your apps page in Seller Central and log into your Amazon seller account as the primary account holder.
Find the CData App.
Under the MWS Auth Token Column click View.
To obtain the Seller ID follow the steps below:
Login to your seller account.
Select Settings, then Account Info on upper right of screen.
Under Business Information select "Your Merchant Token".
Set the following connection properties to connect:
SellerId: Set the Seller ID of Amazon marketplace web service settings.
Marketplace: Set Amazon market place location (United States, Canada, Japan etc.).
Schema: Set Schema to Marketplace.
Amazon Marketplace uses the OAuth authentication standard.
To authenticate using OAuth, you will either need to use the embedded application or create a new custom OAuth app. You can use a custom OAuth app to authenticate with a service account or a user account.
Log into the Selling Partner Console and open Develop Apps from Apps & Services.
Click Add new app client.
Provide name for the app and select SP-API as the API type.
Provide IAM ARN for the AWS account and Select Sellers.
Provide OAuth Login URI and OAuth Redirect URI values. After creating the app, the OAuthClientId and OAuthClientSecret are displayed under LWA credentials.
For a more in depth reading of how to create a custom OAuth app and configure the IAM role, please see the Amazon Selling Partner Guide.
After setting the following, you are ready to connect:
OAuthClientId: Set this to the client Id assigned when you registered your app.
OAuthClientSecret: Set this to the client secret assigned when you registered your app.
InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.
Marketplace: Set this to the The Marketplace region that you are registered to sell in.
AppId: Set this to the application Id for the Selling Partner app you created.
Schema: Set this to 'SellingPartner' to connect to SP-API.
AWSAccessKey: This is the Access Key tied to the AWS user that is associated with the the OAuthClientId.
AWSSecretKey: This is the Secret Key tied to the AWS user that is associated with the the OAuthClientId.
When you connect the provider opens the OAuth endpoint in your default browser. Log in and grant permissions to the application. The provider then completes the OAuth process:
Extracts the access token from the callback URL and authenticates requests.
Refreshes the access token when it expires.
Saves OAuth values in OAuthSettingsLocation to be persisted across connections.
In all cases, you must set ShopUrl to the full URL of your Shopify shop (https://yourshopname.myshopify.com). The rest of this document assumes that you have done so.
Before authenticating, you need to create a custom application via your Shopify admin page. Follow the steps below to register an application and obtain the access token:
Log in to your Shopify from the admin page and navigate to Apps > Apps and sales channels.
Click Develop apps and select Create an app.
In the Overview tab, click Configure Admin API scopes and select the access permissions for your store that you want to grant to your application. The permissions required by our provider to use all the tables and views are:
read_assigned_fulfillment_orders, write_assigned_fulfillment_orders
read_content, write_content
read_customers, write_customers
read_draft_orders, write_draft_orders
read_fulfillments, write_fulfillments
read_gift_cards, write_gift_cards
read_inventory, write_inventory
read_marketing_events, write_marketing_events
read_orders, write_orders
read_price_rules, write_price_rules
read_product_listings, write_product_listings
read_products, write_products
read_reports, write_reports
read_script_tags, write_script_tags
read_shopify_payments_payouts
read_themes, write_themes
Click Save.
Select API Credentials.
Under "Access tokens" click Install app. This creates your access token.
Copy your access token under Admin API Access token. NOTE: The token can be revealed and copied only once.
To authenticate using an access token, specify the following:
AuthScheme: Set to AccessToken.
AccessToken: Set to the access token value you copied from the custom app.
To connect using OAuth, you must create a public or custom application in the Shopify Partner Dashboard. During this process, API key and API secret key values are generated. You need these keys when you connect using a custom application.
Note: You must set AuthScheme to OAuth. All the sections below assume that you have done so. Otherwise, you cannot connect.
Follow the procedure below to register a Public or Custom app and obtain the client credentials, such as the OAuthClientId and OAuthClientSecret:
Log in to Shopify with the developer login portal.
Select Apps > Create app > Create app manually, enter a name for the app and click Create.
Note the displayed API key and API secret key on the Overview page.
Navigate to the App setup page.
Note: You can request access for additional permissions for your app on this page which might be required for retrieving data from certain tables or views from a store.
Provide an App URL, and a redirection URL under Allowed redirection URL(s), and click Save.
For Desktop, you can set the redirection URL to a local host, for example http://localhost:3333, the provider's default.
For Web Authentication, select a different port of your choice and set the CallbackURL to the exact reply URL you defined.
Navigate to the Distribution page.
You can choose to either publish your app on the Shopify App Store as a public app or generate an install link exclusive to one store.
After configuring a distribution method, you can use the API key and API secret key credentials to access your store's data.
After setting the following, you are ready to connect:
InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken connection property.
OAuthClientId: Set this to the app's API key value.
OAuthClientSecret: Set this to the app's API secret key value.
CallbackURL: Set this to the redirect URI defined when you registered your app.
When you connect, the provider opens the OAuth endpoint in your default browser. Log in and grant permissions to the application. The provider then completes the OAuth process by saving OAuth values in OAuthSettingsLocation that persists across connections and obtaining a new access token when the old one expires.
To connect, set the URL; for example, http://yoursitename/magento2, and optionally provide the StoreCode of the store you are connecting to, if more than one are present.
To authenticate to Magento 2.x server versions, you can use either the Basic or the Token AuthScheme.
AuthScheme Set this to Basic.
User Set this to your user name in Magento.
Password Set this to your password in Magento.
AuthScheme Set this to Token.
AccessToken Set this to your AccessToken in Magento.
To generate the AccessToken, Log in to the Magento Stores > Settings > Configuration > Services > OAuth > Access Token.
In order to connect to WooCommerce, you also must specify the URL of the instance to connect to.
Url - Set this to the base URL of the WooCommerce instance to connect to. For Example : Url=http://localhost/woocommerce/;
WooCommerce supports the following authentication methods: Basic Authentication, one-legged OAuth1.0 Authentication and standard OAuth2.0 Authentication.
Some plugins and some servers may interfere with the Authorization header, if not configured properly.
For these cases, Basic authentication may be used. In this authentication mode, the user provides the consumer_key and the consumer_secret as user and password respectively.
These credentials are then sent as query parameters with each request.
Specify the following properties:
AuthScheme - Set this to Basic.
User - Set this to your consumer key
Password - Set this to your consumer secret
Specify the following properties (NOTE: the below credentials are generated from WooCommerce settings page and should not be confused with the credentials generated by using WooCommerce OAuth2.0 plugin):
AuthScheme - Set this to OAuthOneLegged.
ConsumerKey
ConsumerSecret
You will need the OAuth2 Plugin in order to authenticate via OAuth2.0. To install the plugin manually, copy the downloaded folder to the wp-content\plugins folder and then Activate the plugin through the 'Plugins' menu in the WordPress admin interface.
To create an OAuth application, log into your site through the admin panel, navigate to OAuth Server and click on Add New Client. After filling in the required fields, you may click "Create Client" and the following Oauth credentials will be displayed:
Client Key - This will be your OAuthClientId
Client Secret - This will be your OAuthClientSecret
Note that while creating the OAuth application, you will be required to specify a Callback. This is the url the user will be redirected to after explicitly granting access. WooCommerce does not do any validation on this however, so you can input something like http://localhost:33333.
You can now use these credentials to connect to WooCommerce by setting them as the following connection properties:
OAuthClientId = Client Id
OAuthClientSecret = Client Secret
InitiateOAuth = GETANDREFRESH
CallbackURL = Callback
Url = The URL of your instance