The NewStore Connector enables you to seamlessly integrate within Mule apps. Manage integration events, master data, orders, catalogs, inventories, fulfillment.

This connector connects you to the NewStore REST API with a variety of operations to access the backend systems.

For compatibility information and fixed issues, see the release notes.

Release Notes: NewStore Release Notes
Connector Reference: NewStore Connector Reference

Before You Begin

To use this connector, you must be familiar with:

  • The NewStore REST API

  • Anypoint Connectors

  • Mule runtime engine (Mule)

  • Elements and global elements in a Mule flow

  • Creating a Mule app using Anypoint Studio

Before creating an app, you must have:

  • Access to a NewStore account.

Authentication Types

NewStore Connector connections use the following authentication type:

  • Basic authentication
    Uses a username and password for authentication

Common Use Cases for the Connector

  • Integrate events with third-party systems or amazon S3 buckets, and the streamed events.

  • Route events to the correct business flows based on their type.

  • Inject and retrieve orders to/from NewStore, manage returns and fulfillment requests.

  • Manage transfers, receive, count and adjust stock of your products in your stores.

  • Request ATP(Available To Promise) globally or from fulfillment location groups, also manage your fulfillment location groups.

  • Manage stores, catalogs, stock and prices of your products.

Using the connector

Add the connector to the Anypoint Studio

The Apache Maven pom.xml file generated by Anypoint Studio contains dependencies for a Mule app. If you code a Mule app manually, include this XML snippet in your pom.xml file to enable access to this connector:

<dependency>
    <groupId>io.positiveminds.mule.newstore</groupId>
    <artifactId>newstore-connector</artifactId>
    <version>1.0.0</version>
    <classifier>mule-plugin</classifier>
</dependency>

To obtain the most up-to-date pom.xml file information:

  • You can check the latest version in the release notes

or

  • Go to Anypoint Exchange

  • In Exchange, click Login and supply your Anypoint Platform username and password.

  • In Exchange, search for NewStore.

  • Select the connector.

  • Click Dependency Snippets near the upper right of the screen.

Configure the Connector credentials with Basic Authentication

  • Tenant
    Typically the name of your company

  • Stage
    The stage variable, for example: sandbox, staging or empty if production.

  • Username
    Your NewStore username

  • Password
    Your NewStore password

connector credentials configuration
	<newstore:config
        name="NewStore_Config"
        doc:name="NewStore Config" doc:id="2bd7e097-0ed0-48d8-85fa-95be4d660923" objectStore="">
		<newstore:connection>
			<newstore:connection-parameters
                tenant="YOUR-INSTANCE-TENANT"
                stage="YOUR-INSTANCE_STAGE"
                username="YOUR_EMAIL@example.com"
                password="YOUR-PASSWORD" />
		</newstore:connection>
	</newstore:config>

Studio - Retrieve the store pickup config

This use case provides an example of how to use the NewStore Connector to retrieve a store pickup configuration, it contains:

  • An HTTP Listener as the input source.

  • Uses a NewStore operation with a parameter.

flow to retrieve instore pickup config
  1. Add a private flow with a HTTP Listener.

  2. Search for Get instore pickup config for store in the Mule Palette.

  3. Drag the operation into your flow.

  4. Insert the store id of your store, or insert it from the http query parameters like attributes.queryParams.store.

connector get pickup config for store
  1. Drag a transform dataweave after the operation and add the following snippet:

%dw 2.0
output application/json
---
{
	tax_code: payload.cost.tax_code,
	currency_code: payload.cost.currency_code,
	delivery_time: payload.delivery_time
}

XML - Retrieve the store pickup config

Paste the XML code provided in this example into the Configuration XML tab in Anypoint Studio to experiment with the flow described in the previous section.

Keep in mind that you must still provide the credentials for the NewStore connector.

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core" xmlns:newstore="http://www.mulesoft.org/schema/mule/newstore"
	xmlns:http="http://www.mulesoft.org/schema/mule/http"
	xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd">
	<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" doc:id="7c1c195b-5609-4a26-bb33-db226afc96b2" >
		<http:listener-connection host="0.0.0.0" port="8081" />
	</http:listener-config>
	<newstore:config name="NewStore_Config" doc:name="NewStore Config" doc:id="2f8363f3-dd1b-47c9-a7ea-a49a0a009b51" objectStore="">
		<newstore:connection >
			<newstore:connection-parameters tenant="YOUR-INSTANCE-TENANT" stage="YOUR-INSTANCE_STAGE" username="YOUR_EMAIL@example.com" password="YOUR-PASSWORD" />
		</newstore:connection>
	</newstore:config>
	<flow name="retrieve-instore-pickup-config" doc:id="f3b2bc87-dad0-48e0-b4af-c412c440e684" >
		<http:listener doc:name="Listener" doc:id="3c74fc86-641e-4508-892d-9136f8ea1d52" config-ref="HTTP_Listener_config" path="/test" />
		<newstore:get-instore-pickup-config-for-store doc:id="c4acccd0-f42d-448d-b36c-75262bd297f1" config-ref="NewStore_Config" storeId="#[attributes.queryParams.store]" doc:name="Get instore pickup config for store" />
		<ee:transform doc:name="Transform Message" doc:id="dda0dfb7-397f-46cb-8df0-46d3f16c8fed" >
			<ee:message >
				<ee:set-payload ><![CDATA[%dw 2.0
output application/json
---
{
	tax_code: payload.cost.tax_code,
	currency_code: payload.cost.currency_code,
	delivery_time: payload.delivery_time
}]]></ee:set-payload>
			</ee:message>
		</ee:transform>
	</flow>
	</mule>