A Marketcloud account is required
In order to create an application, you need to create a Marketcloud account first.Create an account
Create an application
An application is where your store's data will live. Simply create one choosing an application name and a plan. We’ve got several plans including our favorite, Free!Create your first product
Add data using the dashboard
Once you created your application you can log into its dashboard just by clicking on it. Here you can open the "products" section and create your first product You can also add images and variants!Bootstrap your frontend
Install the SDK
The easiest way to install the PHP SDK is using Composer:
composer require marketcloud-php
But you can also clone from GitHub:
git clone https://github.com/Marketcloud/marketcloud-php.git
At this point you are ready to require it into your application
<?php require("vendor/autoload.php"); ?>
Configure the client
In order to query the API, you must set your application's public and secret keys into the client, You can find the keys under the "information" section.
Query the API
Marketcloud\Marketcloud::setCredentials(array( 'secret_key' => 'your-secret-key', 'public_key' => 'your-public-key' ));
Use the PHP client
Congratulations you are ready to query the API! Use the client to retrieve the product you created earlier:
$products = Marketcloud\Products::get(array( "category_id" => 12 ));
The code above will retrieve a paginated list of products, you can also use the first parameter to filter them by any key. For example, assuming that we added some books with a "author" property to the application, we could easily retrieve books writter by George Martin:
$query = array( "author" => "George Martin"); $products = Marketcloud\Products::get($query);
You have a Marketcloud powered application!
In these 5 little steps you obtained:
Full featured dashboard to manage your store
Infinite frontend flexibility
A fast and scalable backend for your eCommerce applications
Now you can add more features to your app by checking the documentation, or you can spend more time on the dashboard adding more stuff!
We're super happy to help with any question you might have! Send us an email, or get in touch with us in our Slack channel !