Welcome to the Moltin documentation, we're working as fast as we can to give you complete coverage of the API, as well as response data, helpful guides and SDK examples.

If you notice any problems with the documentation you can find the files on GitHub.

Getting Started

Getting started instructions.

Resource Description
Authentication Before you start making calls you need to Authenticate
Making a Call A helping hand to get started making API calls
PHP-SDK Quick start with PHP and Composer

Category

Categories are collections of products that are used to seperate content and make browsing easier.

Resource Description
Create new category Creates a new category
Update a category Updates a category with the given ID
Get category by ID Returns a category of the given ID
Get single category by criteria Gets a category based on the given criteria
Get multiple categories by criteria Gets an array of categories
Update category order & parents Orders and sets the parents of a set of given cateories
Delete category by ID Deletes a category with a given ID

Product

Products are collections of data that can be displayed and listed.

Resource Description
modifier Modifiers allow you to create options for products, such as size, colour, etc.
Create new product Creates a new product
Update a product Updates a product with the given ID
Get single product by criteria Gets a product based on the given criteria
Get product modifiers Returns a list of modifiers and variations of the given product
Get product variations Returns a list of child-product variations of the given product
Search products Searches for a set of products based on the given criteria
Get a specific products fields Gets the given products flow data and field fields
Delete product by ID Deletes a product with a given ID
Get multiple products by criteria Gets a list of products based on the given criteria
Get product fields Gets the flow field data assigned to products
Get product by ID Returns a product of the given ID

Cart

Add to basket and cart manipulation.

Resource Description
Add item to cart Insert an item into the cart
Add variation to cart Insert a variation into the cart
Get cart contents Retrieve the cart contents
Get item from cart by identifier Gets an item from the cart with a given identifier
Update item in a cart Updates a cart item by identifier
Delete item from cart Removes an item from the cart
Delete cart and contents Destroys a cart and its' item contents
Get the available checkout options Retrieve available checkout options for a cart
Pass a cart to checkout Process the checkout data into an order.
Check if item is in a cart Checks if the cart contains an item of a given identifier

Getting Started

To help you get started with the API we've put together a number of guides and packages. Each of these are designed to get you up and running as fast as possible and ease the initial processes involved.

Authentication

Before using the API you must first authenticate with it, this will allow it to retrieve the correct data for your account as well as keep your data safe and secure. For anyone already familiar with OAuth from other places this should be a very easy process, for those not so you'll find all the help you need.

Authentication

Before using the API you must first authenticate with it, this will allow it to retrieve the correct data for your account as well as keep your data safe and secure. For anyone already familiar with OAuth from other places this should be a very easy process, for those not so you'll find all the help you need below.

OAuth 2.0

OAuth is an open standard for authorization. OAuth provides a method for clients to access server resources on behalf of a resource owner (such as a different client or an end-user). It also provides a process for end-users to authorize third-party access to their server resources without sharing their credentials (typically, a username and password pair), using user-agent redirections.

The Moltin API uses OAuth 2.0 to authenticate requests and we have several grant types integrated.

When you create a store on our website, you will be given a client id and secret. You can use these tokens to authenticate and gain access to the API.

Client Libraries

PHP

Javascript

C#

Client Credentials

The easiest grant type to get started with. Designed to grant access to your own store using your own client id and secret. This grant type is designed to be used on your storefront and does not require you to redirect or login.

Authorising with Client Credentials

To authorize with client credentials you simply need to post your client id and client secret to the https://api.molt.in/oauth/access_token. If all goes well then you will receive a response with your access token.

Resource URL

POST https://api.molt.in/oauth/access_token

Paramaters

Key Type Description Value
grant_type String The grant type to use client_credentials
client_id String Your client id
client_secret String Your client secret

Example Successful Response


{
  "access_token": "7LKQe9urWbIGYf7WCjqteljYgy9KrL1aayJl2sQq",
  "token_type": "Bearer",
  "expires": 1385050869,
  "expires_in": 3600
}

Authorization Code

Designed for apps which may integrate with numerous stores (i.e. accountancy app or price comparison website). This grant type is for developers of third party apps and requires the store owner to login to authorize the application before access is granted. This is the most common OAuth 2.0 grant type and will be familiar to those of you who have ever used Facebook to login to an app or website.

Authorizing with Authorization Code

Authorizing with the authorization code grant type is a little more complicated than client credentials. On the right there is a diagram of how the authorization code grant type works.

Step 1

First you need to redirect to Moltin with some information so your user can login to grant access

URL

GET https://auth.molt.in/oauth

Paramaters

Key Type Description Value
client_id String Your client id
redirect_uri String The URL to redirect back to when the user has authorized your app
state String A unique and random string that you can use to match against when the user comes back
scope String A comma separated list of scopes you need access to for your app to function
response_type String The type of response you'd like to receive code

Step 2

After the user has authorized your app, the user will be redirected back to the redirect_uri that you provided with some data that you can use to complete the request. You will then need to exchange your code for an access token which will grant you access to the API.

Resource URL

POST https://api.molt.in/oauth/access_token

Paramaters

Key Type Description Value
grant_type String The grant type to use authorization_code
client_id String Your client id
client_secret String Your client secret
code String The code which was passed back to your application
redirect_uri String The URL you used when authorizing

The Authorization code flow


+--------+                               +---------------+
|        |--(A)- authorisation Request ->|   Resource    |
|        |                               |     Owner     |
|        |<-(B)-- authorisation Grant ---|               |
|        |                               +---------------+
|        |
|        |                               +---------------+
|        |--(C)-- authorisation Grant -->| authorisation |
| Client |                               |     Server    |
|        |<-(D)----- Access Token -------|               |
|        |                               +---------------+
|        |
|        |                               +---------------+
|        |--(E)----- Access Token ------>|    Resource   |
|        |                               |     Server    |
|        |<-(F)--- Protected Resource ---|               |
+--------+                               +---------------+

Example Successful Response


{
    "access_token": "7LKQe9urWbIGYf7WCjqteljYgy9KrL1aayJl2sQq",
    "token_type": "Bearer",
    "expires": 1404999022,
    "expires_in": 3600,
    "refresh_token": "JpllFt6o9qSYKA7WCMOx0MurIH75haMcgjgR4xhG"
}

Refresh Token

The refresh_token grant type is used to refresh an access token which you retrieved from the authorization_code grant type to prevent you needing to reauthenticate the user every time the access token expires.

Authorizing with Refresh Token

Authorizing with a refresh token is very similar to using client credentials, except you need to pass over your refresh token as well. You will not be sent another refresh token back, you can keep using the same refresh token every time your access token expires.

Resource URL

POST https://api.molt.in/oauth/access_token

Paramaters

Key Type Description Value
grant_type String The grant type to use refresh_token
client_id String Your client id
client_secret String Your client secret
refresh_token String The refresh token

Example Successful Response


{
    "access_token": "bXbJUbPGxfDBFerVtMuGYl8AxKNYhdRt0eCblyfl",
    "token_type": "bearer",
    "expires": 1405000406,
    "expires_in": 3600
}

Making a Call

Once you have your Access Token you can then start to make calls to the API. Throughout our documentation you will see different URLs (or End-Points) that when called in different ways will return information and in some cases perform a specific action.

HTTP Methods

We've tried to make the API as simple as possible and utilise HTTP methods to keep the range of end-points/URLs to a minumum. We've also made sure that a single call enough to perform an action, rather than requiring multiple calls to create a form that can be used to update a product for example. The methods you'll see throughout are our API are:

  • GET - The most common method, used to retrieve data
  • POST - Used to create or insert objects
  • PUT - Used to update objects
  • DELETE - Used to delete or remove objects

These methods (when not using GET) will be set in the header of your request, this is done like so:

-X PUT

Making a Request

There are numerous ways to make requests to the API, throughout this guide we'll focus on CURL as it is one of the most comonly used libraries available. If you are happier using something else to perform these actions that is not a problem and the API will work with any library capable of setting headers and making regular HTTP calls.

Along with every request you make your access token recieved from Authentication will be required as a header, and will be set as a header like so:

"Authorization: Bearer NUB6998XaPHuga7UwEn3spE8axebREswUT4EH3fR"
Basic GET Request
curl -H "Authorization: Bearer NUB6998XaPHuga7UwEn3spE8axebREswUT4EH3fR" https://api.molt.in/beta/product/1
Basic POST Request
curl -X POST -H "Authorization: Bearer NUB6998XaPHuga7UwEn3spE8axebREswUT4EH3fR" https://api.molt.in/beta/product
Basic PUT Request
curl -X PUT -H "Authorization: Bearer NUB6998XaPHuga7UwEn3spE8axebREswUT4EH3fR" https://api.molt.in/beta/product/1

PHP-SDK

If you're planning on using PHP for your Moltin project then you can install our PHP SDK via Composer.

Add the following to the "require" section of your composer.json file then run "composer update".


    "moltin/php-sdk": "dev-master"

Category

Resource Description
Create new category Creates a new category
Update a category Updates a category with the given ID
Get category by ID Returns a category of the given ID
Get single category by criteria Gets a category based on the given criteria
Get multiple categories by criteria Gets an array of categories
Update category order & parents Orders and sets the parents of a set of given cateories
Delete category by ID Deletes a category with a given ID

Create new category

This call creates a new category with the POST data provided. If there are any problems with the creation these will be returned in an errors array listing all validation problems, otherwise the new category will be returned.

Resource URL

POST https://api.molt.in/beta/category

Paramaters

Key Type Description
title String The Title of the category, must be unique
slug String The Slug/URI of the category, must be unique
parent Integer The Parent category ID of the category, can be null
status Choice (1 or 0) Is the product Live or a Draft
description String The Description of the product

Example Successful Response


{
  "status": true,
  "result": {
    "id": "137",
    "parent": null,
    "title": "My Awesome New Category",
    "slug": "my-awesome-new-category",
    "status": {
      "key": "1",
      "value": "Live"
    },
    "description": "Categories are awesome! But this one is the most awesome, because it is new!",
    "images": []
  }
}

Example Empty Response


{
    "status": false,
    "errors": [
        "Slug must be unique",
        "Description is required"
    ]
}

Update a category

This call edits a category with a given ID. There are no minumum required paramaters and only those differing from current values will be updated, as such you can pass all or one of the fields and there will be no difference.

Resource URL

PUT https://api.molt.in/beta/category/:id

Paramaters

Key Type Description
titleoptional String The Title of the category, must be unique
slugoptional String The Slug/URI of the category, must be unique
parentoptional Integer The Parent category ID of the category, can be null
statusoptional Choice (1 or 0) Is the product Live or a Draft
descriptionoptional String The Description of the product

Example Successful Response


{
  "status": true,
  "result": {
    "id": "60",
    "parent": null,
    "title": "I have just updated my title, isn't that great!",
    "slug": "featured",
    "status": {
      "key": "1",
      "value": "Live"
    },
    "description": "Featured products",
    "images": []
  }
}

Example Failed Response


{
    "status": false,
    "errors": [
        "Slug must be unique",
        "Description is required"
    ]
}

Get category by ID

Returns a category based on a given ID. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

https://api.molt.in/beta/category/:id

Paramaters

None required

Example Successful Response


{
    "status": true,
    "result": {
        "id": 18,
        "parent": {
            "id": 17,
            "parent": null,
            "title": "Test Category 7",
            "slug": "test-category-7",
            "status": {
                "key": "1",
                "value": "Live"
            },
            "description": "Description"
        },
        "title": "Test Category 3",
        "slug": "test-category-3",
        "status": {
            "key": "1",
            "value": "Live"
        },
        "description": "Desc",
        "images": [

        ]
    }
}

Example Empty Response


{
    "status": false,
    "error": "No category found"
}

Get single category by criteria

Returns a category based on a given set of key-value properties. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

https://api.molt.in/beta/category

Paramaters

Key Type Description
idoptional Integer Select by ID
titleoptional String Select by Title
slugoptional String Select by Slug
parentoptional Integer Select by Parent ID
statusoptional Integer Select by Status Key, 1 or 0

Example Successful Response


{
    "status": true,
    "result": {
        "id": 18,
        "parent": {
            "id": 17,
            "parent": null,
            "title": "Test Category 7",
            "slug": "test-category-7",
            "status": {
                "key": "1",
                "value": "Live"
            },
            "description": "Description"
        },
        "title": "Test Category 3",
        "slug": "test-category-3",
        "status": {
            "key": "1",
            "value": "Live"
        },
        "description": "Desc",
        "images": [

        ]
    }
}

Example Empty Response


{
    "status": false,
    "error": "No category found"
}

Get multiple categories by criteria

Returns a range of categories based on a given set of paramaters. All choices and relaionships will be converted to their appropriate data values to reduce the number of extra calls required.

Resource URL

GET https://api.molt.in/beta/categories

Paramaters

Key Type Description
limitoptional Integer The number of categories to return, defaults to all
offsetoptional Integer The first category to be shown, used for pagination

Example Successful Response


{
  "status": true,
  "result": [
    {
      "id": "60",
      "parent": null,
      "title": "Featured",
      "slug": "featured",
      "status": {
        "key": "1",
        "value": "Live"
      },
      "description": "Featured products",
      "images": []
    },
    {
      "id": "16",
      "parent": null,
      "title": "Accessories",
      "slug": "accessories",
      "status": {
        "key": "1",
        "value": "Live"
      },
      "description": "Shop for all your must have accessories!",
      "images": []
    },
    {
      "id": "42",
      "parent": null,
      "title": "Arts and Crafts",
      "slug": "arts-and-crafts",
      "status": {
        "key": "1",
        "value": "Live"
      },
      "description": "Good quality art materials at affordable prices. We're here to help you create without limits!",
      "images": []
    },
    {
      "id": "17",
      "parent": null,
      "title": "Household",
      "slug": "household",
      "status": {
        "key": "1",
        "value": "Live"
      },
      "description": "Household items and decorative ornaments.",
      "images": []
    }
  ],
  "pagination": {
    "total": 4,
    "current": 4,
    "limit": 10,
    "offset": 0,
    "from": 1,
    "to": 4,
    "offsets": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    },
    "links": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    }
  }
}

Example Empty Response


{
  "status": true,
  "result": [],
  "pagination": {
    "total": 0,
    "current": 0,
    "limit": 10,
    "offset": 0,
    "from": 1,
    "to": 0,
    "offsets": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    },
    "links": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    }
  }
}

Update category order & parents

You can update the order and parents of categories in one go. This is useful if you have some sort of drag-n-drop system in place to reorder your categories.

Resource URL

PUT https://api.molt.in/beta/categories/order

Paramaters

Key Type Description
:id[parent] Integer The parent category
:id[order] Integer The order in which this category appears

Example Successful Response


{
  "status": true
}

Example Failed Response


{
  "status": false,
  "errors": []
}

Delete category by ID

This call deletes a category with a given ID or a set of categories in a comma-seperated list of IDs. Once a category has been deleted all products in that category will be removed and possibly unavailable.

Resource URL

DELETE https://api.molt.in/beta/category/:id[,:id]

Paramaters

N/A

Example Successful Response


{
    "status": true,
    "message": "Category deleted successfully"
}

Example Invalid ID Response


TBA

Product

Resource Description
modifier Modifiers allow you to create options for products, such as size, colour, etc.
Create new product Creates a new product
Update a product Updates a product with the given ID
Get single product by criteria Gets a product based on the given criteria
Get product modifiers Returns a list of modifiers and variations of the given product
Get product variations Returns a list of child-product variations of the given product
Search products Searches for a set of products based on the given criteria
Get a specific products fields Gets the given products flow data and field fields
Delete product by ID Deletes a product with a given ID
Get multiple products by criteria Gets a list of products based on the given criteria
Get product fields Gets the flow field data assigned to products
Get product by ID Returns a product of the given ID

modifier

Resource Description
Get product modifier by ID Returns a product modifier of the given ID
Get product modifier fields Gets the flow field data assigned to product modifiers
variation Product variation end-points
Get a specific product modifiers fields Gets the given product modifiers flow data and field fields
Create new product modifier Creates a new product modifier
Delete product modifier by ID Deletes a product modifier with a given ID
Update a product modifier Updates a product modifier with the given ID

Get product modifier by ID

This call simply returns a product modifier based on a given ID. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

GET https://api.molt.in/beta/product/:productId/modifer/:id

Paramaters

None required

Example Successful Response


{
    "status": true,
    "result":
    {
        "id": "450",
        "type":
        {
            "value": "Variant",
            "data":
            {
                "key": "variant",
                "value": "Variant"
            }
        },
        "title": "Colour",
        "instructions": "Please select a colour",
        "product": 6,
        "created_at": "2014-05-04 23:41:01",
        "updated_at": "2014-05-06 15:33:10",
        "images":
        [
        ]
    }
}

Example Invalid ID Response


{
    "status": false,
    "error": "No modifier found"
}

Usage Example


try {
    $product = $moltin->get('product/6/modifier/450');
} catch(\Exception $e) {
    exit($e->getMessage());
}

Get product modifier fields

This call returns the data required to build a dynamic flows form based on the product modifier creation requirements. It provides all options available for the choice fields as well as those featured in relationships (eg, product). It also provides information of field requirements, default values, etc.

Resource URL

https://api.molt.in/beta/product/:productId/modifier/fields

Paramaters

None required

Example Successful Response


{
   "status": true,
   "result":
   {
       "type":
       {
           "slug": "type",
           "name": "Type",
           "type": "choice",
           "options":
           {
               "choices":
               {
                   "variant": "Variant",
                   "single": "Single",
                   "input": "Input"
               },
               "default": "variant"
           },
           "required": true,
           "unique": false,
           "locked": true,
           "order": null,
           "value": null
       },
       "title":
       {
           "slug": "title",
           "name": "Title",
           "type": "string",
           "options":
           [
           ],
           "required": true,
           "unique": false,
           "locked": true,
           "order": null,
           "value": null
       },
       "instructions":
       {
           "slug": "instructions",
           "name": "Instructions",
           "type": "text",
           "options":
           [
           ],
           "required": false,
           "unique": false,
           "locked": true,
           "order": null,
           "value": null
       },
       "product":
       {
           "slug": "product",
           "name": "Product",
           "type": "integer",
           "options":
           {
               "default": 0
           },
           "required": false,
           "unique": false,
           "locked": true,
           "order": null,
           "value": null
       }
   }
}

PHP (SDK) Example - Direct


$result = $moltin->get('product/5/modifier/fields');
$fields = $result['result'];

PHP (SDK) Example - Flows Builder


$fields = $moltin->fields('product/5/modifier');

variation

Resource Description
Get product variation by ID Returns a product variation of the given ID
Get product variation fields Gets the flow field data assigned to product variations
Get a specific product variation fields Gets the given product variation flow data and field fields
Create new product variation Creates a new product variation
Update a product variation Updates a product variation with the given ID
Delete product variation by ID Deletes a product variation with a given ID

Get product variation by ID

This call simply returns a product variation based on a given ID. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

GET https://api.molt.in/beta/product/:productId/modifer/:modifierId/variation/:id

Paramaters

None required

Example Successful Response


{
    "status": true,
    "result":
    {
        "id": "524",
        "title": "Red",
        "mod_price": "-0.50",
        "modifier": 523,
        "product": 0,
        "created_at": "2014-05-07 10:57:58",
        "updated_at": "2014-05-07 11:03:26"
    }
}

Example Invalid ID Response


{
    "status": false,
    "error": "No variation found"
}

Usage Example


try {
    $variation = $moltin->get('product/6/modifier/450/variation/524');
} catch(\Exception $e) {
    exit($e->getMessage());
}

Get product variation fields

This call returns the data required to build a dynamic flows form based on the product variation creation requirements. It provides all options available for the choice fields as well as those featured in relationships (eg, modifier). It also provides information of field requirements, default values, etc.

Resource URL

https://api.molt.in/beta/product/:productId/modifier/:modifierId/variation/fields

Paramaters

None required

Example Successful Response


{
    "status": true,
    "result":
    {
        "title":
        {
            "slug": "title",
            "name": "Title",
            "type": "string",
            "options":
            [
            ],
            "required": true,
            "unique": false,
            "locked": true,
            "order": null,
            "value": null
        },
        "mod_price":
        {
            "slug": "mod_price",
            "name": "Price Modifier",
            "type": "string",
            "options":
            [
            ],
            "required": false,
            "unique": false,
            "locked": true,
            "order": null,
            "value": null
        },
        "modifier":
        {
            "slug": "modifier",
            "name": "Parent",
            "type": "integer",
            "options":
            {
                "default": 0
            },
            "required": false,
            "unique": false,
            "locked": true,
            "order": null,
            "value": null
        },
        "product":
        {
            "slug": "product",
            "name": "Product",
            "type": "integer",
            "options":
            {
                "default": 0
            },
            "required": false,
            "unique": false,
            "locked": true,
            "order": null,
            "value": null
        }
    }
}

PHP (SDK) Example - Direct


$result = $moltin->get('product/5/modifier/100/variation/fields');
$fields = $result['result'];

PHP (SDK) Example - Flows Builder


$fields = $moltin->fields('product/5/modifier/100/variation');

Get a specific product variation fields

This call returns the data required to build a dynamic flows form based on the product edit requirements. It provides all options available for the choice fields as well as those featured in relationships (eg, Modifier). It also provides information of field requirements, default values, etc.

Unlike /product/:id/modifier/fields this adds the current variation data to the array to allow for prepopulation of fields.

Resource URL

https://api.molt.in/beta/product/:productId/modifier/:id/fields

Paramaters

None required

Example Successful Response


{
    "status": true,
    "result":
    {
        "title":
        {
            "slug": "title",
            "name": "Title",
            "type": "string",
            "options":
            [
            ],
            "required": true,
            "unique": false,
            "locked": true,
            "order": null,
            "value": "Red"
        },
        "mod_price":
        {
            "slug": "mod_price",
            "name": "Price Modifier",
            "type": "string",
            "options":
            [
            ],
            "required": false,
            "unique": false,
            "locked": true,
            "order": null,
            "value": "-0.50"
        },
        "modifier":
        {
            "slug": "modifier",
            "name": "Parent",
            "type": "integer",
            "options":
            {
                "default": 0
            },
            "required": false,
            "unique": false,
            "locked": true,
            "order": null,
            "value": 523
        },
        "product":
        {
            "slug": "product",
            "name": "Product",
            "type": "integer",
            "options":
            {
                "default": 0
            },
            "required": false,
            "unique": false,
            "locked": true,
            "order": null,
            "value": 0
        }
    }
}

Create new product variation

This call creates a new product variation with the POST data provided. If there are any problems with the creation these will be returned in an errors array listing all validation problems, otherwise the new variation will be returned.

Resource URL

POST https://api.molt.in/beta/product/:productId/modifier/:modifierId/variation

Paramaters

Key Type Description
title String The Title of the variation, must be unique per modifier
mod_priceoptional String Pricing modifier, a decimal prefixed with +, - or = (eg. +0.50, -1.50, =5.99)

Example Successful Response


{
    "status": true,
    "result":
    {
        "id": "524",
        "title": "Red",
        "mod_price": " 0.50",
        "modifier": 523,
        "product": 0,
        "created_at": "2014-05-07 10:57:58",
        "updated_at": "2014-05-07 10:57:58"
    }
}

Example Invalid Title Response


{
    "status": false,
    "errors":
    [
        "The title must be unique for the modifier"
    ]
}

Update a product variation

This call edits a product variation with a given ID. There are no minumum required paramaters and only those differing from current values will be updated, as such you can pass all or one of the fields and there will be no difference.

Resource URL

PUT https://api.molt.in/beta/product/:productId/modifier/:modifierId/variation/:id

Paramaters

Key Type Description
title String The Title of the variation, must be unique per modifier
mod_priceoptional String Pricing modifier, a decimal prefixed with +, - or = (eg. +0.50, -1.50, =5.99)

Example Successful Response


{
    "status": true,
    "result":
    {
        "id": "524",
        "title": "Red",
        "mod_price": "-0.50",
        "modifier": 523,
        "product": 0,
        "created_at": "2014-05-07 10:57:58",
        "updated_at": "2014-05-07 11:03:26"
    }
}

Example Invalid ID Response


{
    "status": false,
    "errors": [
        "Title must be unique"
    ]
}

Delete product variation by ID

This call deletes a product variation with a given ID or a set of modifiers in a comma-seperated list of IDs.

Resource URL

DELETE https://api.molt.in/beta/product/:productId/modifier/:modifierId/variation:id[,:id]

Paramaters

None required

Example Successful Response


{
    "status": true,
    "message": "Product Variation deleted successfully"
}

Example Invalid ID Response


{
    "status": false,
    "error": "Product Variation does not exist"
}

PHP (SDK) Example


$result = $moltin->delete('product/15/modifier/100/variation/105');

if ( ! $result['status'] ) {
    throw new Exception($result['error']);
}

Get a specific product modifiers fields

This call returns the data required to build a dynamic flows form based on the product edit requirements. It provides all options available for the choice fields as well as those featured in relationships (eg, Product). It also provides information of field requirements, default values, etc.

Unlike /product/:id/modifier/fields this adds the current modifiers data to the array to allow for prepopulation of fields.

Resource URL

https://api.molt.in/beta/product/:productId/modifier/:id/fields

Paramaters

None required

Example Successful Response


{
   "status": true,
   "result":
   {
       "type":
       {
           "slug": "type",
           "name": "Type",
           "type": "choice",
           "options":
           {
               "choices":
               {
                   "variant": "Variant",
                   "single": "Single",
                   "input": "Input"
               },
               "default": "variant"
           },
           "required": true,
           "unique": false,
           "locked": true,
           "order": null,
           "value":
           {
               "value": "Variant",
               "data":
               {
                   "key": "variant",
                   "value": "Variant"
               }
           }
       },
       "title":
       {
           "slug": "title",
           "name": "Title",
           "type": "string",
           "options":
           [
           ],
           "required": true,
           "unique": false,
           "locked": true,
           "order": null,
           "value": "Colour"
       },
       "instructions":
       {
           "slug": "instructions",
           "name": "Instructions",
           "type": "text",
           "options":
           [
           ],
           "required": false,
           "unique": false,
           "locked": true,
           "order": null,
           "value": "Please select a colour"
       },
       "product":
       {
           "slug": "product",
           "name": "Product",
           "type": "integer",
           "options":
           {
               "default": 0
           },
           "required": false,
           "unique": false,
           "locked": true,
           "order": null,
           "value": 6
       }
   }
}

Create new product modifier

This call creates a new product modifier with the POST data provided. If there are any problems with the creation these will be returned in an errors array listing all validation problems, otherwise the new modifier will be returned.

Resource URL

POST https://api.molt.in/beta/product/:productId/modifier

Paramaters

Key Type Description
title String The Title of the modifier, must be unique per product
type Choice variant, single or input
instructionsoptional Text Any associated instructions for this modifier

Example Successful Response


{
    "status": true,
    "result":
    {
        "id": "523",
        "type":
        {
            "value": "Variant",
            "data":
            {
                "key": "variant",
                "value": "Variant"
            }
        },
        "title": "Size",
        "instructions": "Example size modifier",
        "product": 6,
        "created_at": "2014-05-07 10:29:34",
        "updated_at": "2014-05-07 10:29:34",
        "images":
        [
        ]
    }
}

Example Invalid Title Response


{
    "status": false,
    "errors":
    [
        "The title must be unique for the product"
    ]
}

Delete product modifier by ID

This call deletes a product modifier with a given ID or a set of modifiers in a comma-seperated list of IDs.

Resource URL

DELETE https://api.molt.in/beta/product/:productId/modifier/:id[,:id]

Paramaters

None required

Example Successful Response


{
    "status": true,
    "message": "Product Modifier deleted successfully"
}

Example Invalid ID Response


{
    "status": false,
    "error": "Product Modifier does not exist"
}

PHP (SDK) Example


$result = $moltin->delete('product/15/modifier/100');

if ( ! $result['status'] ) {
    throw new Exception($result['error']);
}

Update a product modifier

This call edits a product modifier with a given ID. There are no minumum required paramaters and only those differing from current values will be updated, as such you can pass all or one of the fields and there will be no difference.

Resource URL

PUT https://api.molt.in/beta/product/:productId/modifier/:id

Paramaters

Key Type Description
title String The Title of the modifier, must be unique per product
type Choice variant, single or input
instructionsoptional Text Any associated instructions for this modifier

Example Successful Response


{
    "status": true,
    "result":
    {
        "id": "523",
        "type":
        {
            "value": "Variant",
            "data":
            {
                "key": "variant",
                "value": "Variant"
            }
        },
        "title": "Colour",
        "instructions": "Updated instructions",
        "product": 6,
        "created_at": "2014-05-07 10:29:34",
        "updated_at": "2014-05-07 10:40:53",
        "images":
        [
        ]
    }
}

Example Invalid ID Response


{
    "status": false,
    "errors": [
        "Title must be unique"
    ]
}

Create new product

This call creates a new product with the POST data provided. If there are any problems with the creation these will be returned in an errors array listing all validation problems, otherwise the new product will be returned.

Resource URL

POST https://api.molt.in/beta/product

Paramaters

Key Type Description
sku String The SKU of the product, must be unique
title String The Title of the product, must be unique
slug String The Slug/URI of the product, must be unique
price Float The Price of the product
status Choice (1 or 0) Is the product Live or a Draft
category Integer The Category of the product
stock_level Integer The Stock Level of the product
stock_status Choice (0 to 6) The Stock Status of the product
description String The Description of the product
requires_shipping Choice (1 or 0) Does the product require Shipping?
sale_priceoptional Float The Sale Price of the product
weightoptional Float The Weight of the product, used in shipping calculations
heightoptional Float The Height of the product, used in shipping calculations
widthoptional Float The Width of the product, used in shipping calculations
depthoptional Float The Depth of the product, used in shipping calculations

Example Successful Response


{
    "status": true,
    "result": {
        "id": 26,
        "title": "Test Product 10",
        "slug": "test-product-10",
        "price": "35.00",
        "sale_price": "30.00",
        "status": {
            "key": "1",
            "value": "Live"
        },
        "stock_level": 100,
        "stock_status": {
            "key": "1",
            "value": "In Stock"
        },
        "requires_shipping": {
            "key": "1",
            "value": "Yes"
        },
        "description": "Description",
        "sku": "TEST10",
        "category": {
            "id": 16,
            "parent": null,
            "title": "Test Category",
            "slug": "test-category",
            "status": {
                "key": "1",
                "value": "Live"
            },
            "description": "Description"
        },
        "weight": "10.00",
        "width": "10.00",
        "height": "10.00",
        "depth": "10.00",
        "tax_band": null,
        "pricing":
        {
           "formatted":
           {
               "with_tax": "£35.00",
               "without_tax": "£35.00"
           },
           "rounded":
           {
               "with_tax": 35,
               "without_tax": 35
           },
           "raw":
           {
               "with_tax": 35,
               "without_tax": 35
           }
        },
        "images": [

        ]
    }
}

Example Invalid ID Response


{
    "status": false,
    "errors": [
        "Slug must be unique",
        "SKU is required",
        "Category is required"
    ]
}

Update a product

This call edits a product with a given ID. There are no minumum required paramaters and only those differing from current values will be updated, as such you can pass all or one of the fields and there will be no difference.

Resource URL

PUT https://api.molt.in/beta/product/:id

Paramaters

Key Type Description
skuoptional String The SKU of the product, must be unique
titleoptional String The Title of the product, must be unique
slugoptional String The Slug/URI of the product, must be unique
priceoptional Float The Price of the product
statusoptional Choice (1 or 0) Is the product Live or a Draft
categoryoptional Integer The Category of the product
stock_leveloptional Integer The Stock Level of the product
stock_statusoptional Choice (0 to 6) The Stock Status of the product
descriptionoptional String The Description of the product
requires_shippingoptional Choice (1 or 0) Does the product require Shipping?
sale_priceoptional Float The Sale Price of the product
weightoptional Float The Weight of the product, used in shipping calculations
heightoptional Float The Height of the product, used in shipping calculations
widthoptional Float The Width of the product, used in shipping calculations
depthoptional Float The Depth of the product, used in shipping calculations

Example Successful Response


{
    "status": true,
    "result": {
        "id": 26,
        "title": "Test Product 10 (Updated)",
        "slug": "test-product-10-updated",
        "price": "35.00",
        "sale_price": "30.00",
        "status": {
            "key": "1",
            "value": "Live"
        },
        "stock_level": 100,
        "stock_status": {
            "key": "1",
            "value": "In Stock"
        },
        "requires_shipping": {
            "key": "1",
            "value": "Yes"
        },
        "description": "Description",
        "sku": "TEST10",
        "category": {
            "id": 16,
            "parent": null,
            "title": "Test Category",
            "slug": "test-category",
            "status": {
                "key": "1",
                "value": "Live"
            },
            "description": "Description"
        },
        "weight": "10.00",
        "width": "10.00",
        "height": "10.00",
        "depth": "10.00",
        "tax_band": null,
        "pricing":
        {
           "formatted":
           {
               "with_tax": "£35.00",
               "without_tax": "£35.00"
           },
           "rounded":
           {
               "with_tax": 35,
               "without_tax": 35
           },
           "raw":
           {
               "with_tax": 35,
               "without_tax": 35
           }
        },
        "images": [

        ]
    }
}

Example Invalid ID Response


{
    "status": false,
    "errors": [
        "Title must be unique",
        "Slug must be unique"
    ]
}

Get single product by criteria

Returns a product based on a given set of key-value properties. One or more paramaters can be passed to the method but they must all match exactly and the best match will be returned.

While this call is similar to search it will only return a single product.

Resource URL

GET https://api.molt.in/beta/product

Paramaters

Key Type Description
idoptional Integer Select by ID
skuoptional String Select by SKU
titleoptional String Select by Title
slugoptional String Select by Slug
priceoptional Float Select by Price
sale_priceoptional Float Select by Sale Price
statusoptional Choice (1 or 0) Select by Status
categoryoptional Integer Select by Category ID
stock_leveloptional Integer Select by Stock Level
stock_statusoptional Choice (0 to 6) Select by Stock Status

PHP (SDK) Example


    $result = $moltin->get('product', ['slug' => 'test-product-1']);

    if ( ! $result['status'] ) {
        throw new Exception($result['error']);
    }

    $product = $result['result'];

Example Successful Response


{
    "status": true,
    "result": {
        "id": 15,
        "title": "Test Product 1",
        "slug": "test-product-1",
        "price": "235.00",
        "sale_price": "200.00",
        "status": {
            "key": "1",
            "value": "Live"
        },
        "stock_level": 234,
        "stock_status": {
            "key": "1",
            "value": "In Stock"
        },
        "requires_shipping": {
            "key": "0",
            "value": "No"
        },
        "description": "This is a test product",
        "sku": "TEST01",
        "category": {
            "id": 18,
            "parent": {
                "id": 17,
                "parent": null,
                "title": "Test Category 1",
                "slug": "test-category-1",
                "status": {
                    "key": "1",
                    "value": "Live"
                },
                "description": "Description"
            },
            "title": "Test Category 2",
            "slug": "test-category-2",
            "status": {
                "key": "1",
                "value": "Live"
            },
            "description": "Description"
        },
        "weight": "100.00",
        "width": "200.00",
        "height": "200.00",
        "depth": "200.00",
        "tax_band": null,
        "pricing":
        {
           "formatted":
           {
               "with_tax": "£235.00",
               "without_tax": "£235.00"
           },
           "rounded":
           {
               "with_tax": 235,
               "without_tax": 235
           },
           "raw":
           {
               "with_tax": 235,
               "without_tax": 235
           }
        },
        "images": {
            "26": {
                "id": 26,
                "name": "product_tablet_landscape.png",
                "url": {
                    "http": "http:\/\/d2xufakadxl3ok.cloudfront.net\/1\/product_tablet_landscape.png",
                    "https": "https:\/\/d2xufakadxl3ok.cloudfront.net\/1\/product_tablet_landscape.png"
                }
            }
        }
    }
}

Example Invalid Response


TBA

Get by ID


try {
    $product = $moltin->getProduct(['id' => 15]);
} catch(\Exception $e) {
    exit($e->getMessage());
}

Get by Slug


try {
    $product = $moltin->getProduct(['slug' => 'test-product-1']);
} catch(\Exception $e) {
    exit($e->getMessage());
}

Get by SKU


try {
    $product = $moltin->getProduct(['sku' => 'TEST01']);
} catch(\Exception $e) {
    exit($e->getMessage());
}

Get product modifiers

Returns a range of modifiers and variations for a product. All choices and relationships will be converted to their appropriate data values to reduce the number of extra calls required.

Resource URL

GET https://api.molt.in/beta/product/:id/modifiers

Paramaters

None required

Example Successful Response


{
    "status": true,
    "result":
    {
        "450":
        {
            "id": "450",
            "type":
            {
                "value": "Variant",
                "data":
                {
                    "key": "variant",
                    "value": "Variant"
                }
            },
            "title": "Colour",
            "instructions": "Please select a colour",
            "product": 6,
            "created_at": "2014-05-04 23:41:01",
            "updated_at": "2014-05-06 15:33:10",
            "variations":
            {
                "451":
                {
                    "id": "451",
                    "title": "Red",
                    "mod_price": "",
                    "modifier": 450,
                    "product": 0,
                    "created_at": "2014-05-04 23:41:11",
                    "updated_at": "2014-05-05 14:29:05",
                    "difference": "£0.00"
                },
                "496":
                {
                    "id": "496",
                    "title": "Green",
                    "mod_price": "=2.99",
                    "modifier": 450,
                    "product": 0,
                    "created_at": "2014-05-05 20:40:04",
                    "updated_at": "2014-05-05 22:07:42",
                    "difference": "=£2.99"
                },
                "498":
                {
                    "id": "498",
                    "title": "Blue",
                    "mod_price": "+1.50",
                    "modifier": 450,
                    "product": 0,
                    "created_at": "2014-05-05 22:08:33",
                    "updated_at": "2014-05-05 22:08:33",
                    "difference": "+£1.50"
                }
            }
        },
        "457":
        {
            "id": "457",
            "type":
            {
                "value": "Variant",
                "data":
                {
                    "key": "variant",
                    "value": "Variant"
                }
            },
            "title": "Size",
            "instructions": "Please select a size",
            "product": 6,
            "created_at": "2014-05-04 23:41:54",
            "updated_at": "2014-05-06 15:33:23",
            "variations":
            {
                "458":
                {
                    "id": "458",
                    "title": "Small",
                    "mod_price": "-0.50",
                    "modifier": 457,
                    "product": 0,
                    "created_at": "2014-05-04 23:42:06",
                    "updated_at": "2014-05-05 22:10:29",
                    "difference": "-£0.50"
                },
                "500":
                {
                    "id": "500",
                    "title": "Medium",
                    "mod_price": "+0.00",
                    "modifier": 457,
                    "product": 0,
                    "created_at": "2014-05-05 22:09:27",
                    "updated_at": "2014-05-05 22:09:27",
                    "difference": "+£0.00"
                },
                "504":
                {
                    "id": "504",
                    "title": "Large",
                    "mod_price": "+0.50",
                    "modifier": 457,
                    "product": 0,
                    "created_at": "2014-05-05 22:09:41",
                    "updated_at": "2014-05-05 22:09:41",
                    "difference": "+£0.50"
                }
            }
        },
        "478":
        {
            "id": "478",
            "type":
            {
                "value": "Single",
                "data":
                {
                    "key": "single",
                    "value": "Single"
                }
            },
            "title": "Gift Wrap",
            "instructions": "",
            "product": 6,
            "created_at": "2014-05-05 01:05:06",
            "updated_at": "2014-05-05 22:13:41",
            "variations":
            {
                "480":
                {
                    "id": "480",
                    "title": "Yes",
                    "mod_price": "+2.99",
                    "modifier": 478,
                    "product": 0,
                    "created_at": "2014-05-05 01:51:35",
                    "updated_at": "2014-05-05 22:15:20",
                    "difference": "+£2.99"
                },
                "508":
                {
                    "id": "508",
                    "title": "No",
                    "mod_price": "+0.00",
                    "modifier": 478,
                    "product": 0,
                    "created_at": "2014-05-05 22:15:32",
                    "updated_at": "2014-05-05 22:15:32",
                    "difference": "+£0.00"
                }
            }
        },
        "481":
        {
            "id": "481",
            "type":
            {
                "value": "Input",
                "data":
                {
                    "key": "input",
                    "value": "Input"
                }
            },
            "title": "Add a message",
            "instructions": "",
            "product": 6,
            "created_at": "2014-05-05 11:49:19",
            "updated_at": "2014-05-05 11:49:19",
            "variations":
            [
            ]
        },
        "523":
        {
            "id": "523",
            "type":
            {
                "value": "Variant",
                "data":
                {
                    "key": "variant",
                    "value": "Variant"
                }
            },
            "title": "Colour",
            "instructions": "Updated instructions",
            "product": 6,
            "created_at": "2014-05-07 10:29:34",
            "updated_at": "2014-05-07 10:40:53",
            "variations":
            {
                "524":
                {
                    "id": "524",
                    "title": "Red",
                    "mod_price": "-0.50",
                    "modifier": 523,
                    "product": 0,
                    "created_at": "2014-05-07 10:57:58",
                    "updated_at": "2014-05-07 11:03:26",
                    "difference": "-£0.50"
                }
            }
        }
    }
}

Example Invalid ID Response


{
    "status": false,
    "error": "No product found"
}

Usage Example


try {
    $modifiers = $moltin->get('product/6/modifiers');
} catch(\Exception $e) {
    exit($e->getMessage());
}

Get product variations

Returns a range of child-product variations for a product. All choices and relationships will be converted to their appropriate data values to reduce the number of extra calls required.

Resource URL

GET https://api.molt.in/beta/product/:id/variations

Paramaters

None required

Example Successful Response


{
    "status": true,
    "result":
    [
        {
            "id": "525",
            "sku": "PRD_A0002_RESMRE",
            "title": "Conté Sticks - Red Small Red",
            "slug": "conte-sticks-red-small-red",
            "price": "8.49",
            "sale_price": "8.99",
            "status":
            {
                "value": "Live",
                "data":
                {
                    "key": "1",
                    "value": "Live"
                }
            },
            "category":
            {
                "value": "Arts and Crafts",
                "data":
                {
                    "42":
                    {
                        "id": "42",
                        "parent": null,
                        "title": "Arts and Crafts",
                        "slug": "arts-and-crafts",
                        "status":
                        {
                            "value": "Live",
                            "data":
                            {
                                "key": "1",
                                "value": "Live"
                            }
                        },
                        "description": "Good quality art materials at affordable prices. We're here to help you create without limits!",
                        "created_at": "",
                        "updated_at": ""
                    }
                }
            },
            "stock_level": 1050,
            "stock_status":
            {
                "value": "In Stock",
                "data":
                {
                    "key": "1",
                    "value": "In Stock"
                }
            },
            "description": "Drawing with conté sticks is a sure way to achive high contrast, richly pigmented images. This media can also be usto shapen lines as a final stage of a painting's development. ",
            "requires_shipping":
            {
                "value": "Yes",
                "data":
                {
                    "key": "1",
                    "value": "Yes"
                }
            },
            "weight": "10.00",
            "height": "10.00",
            "width": "10.00",
            "depth": "10.00",
            "collection": null,
            "brand":
            {
                "value": " ",
                "data":
                {
                    "id": "514",
                    "title": " ",
                    "slug": " ",
                    "status":
                    {
                        "value": "Draft",
                        "data":
                        {
                            "key": "0",
                            "value": "Draft"
                        }
                    },
                    "description": " ",
                    "created_at": "2014-05-06 15:59:43",
                    "updated_at": "2014-05-06 15:59:43"
                }
            },
            "tax_band": null,
            "meta_title": "",
            "created_at": "2014-05-07 10:58:03",
            "updated_at": "2014-05-07 11:03:26",
            "pricing":
            {
                "formatted":
                {
                    "with_tax": "£8.49",
                    "without_tax": "£8.49"
                },
                "rounded":
                {
                    "with_tax": 8.49,
                    "without_tax": 8.49
                },
                "raw":
                {
                    "with_tax": 8.49,
                    "without_tax": 8.49
                }
            },
            "is_variation": true,
            "modifiers":
            [
                {
                    "data":
                    {
                        "type": "variant",
                        "title": "Colour",
                        "product": "6",
                        "instructions": "Please select a colour"
                    },
                    "var_title": "Red",
                    "var_price": null,
                    "var_id": 451
                },
                {
                    "data":
                    {
                        "type": "variant",
                        "title": "Size",
                        "product": "6",
                        "instructions": "Please select a size"
                    },
                    "var_title": "Small",
                    "var_price": null,
                    "var_id": 458
                },
                {
                    "data":
                    {
                        "type": "variant",
                        "title": "Colour",
                        "product": "6",
                        "instructions": "Updated instructions"
                    },
                    "var_title": "Red",
                    "var_price": null,
                    "var_id": 524
                }
            ],
            "images":
            {
                "45":
                {
                    "id": 45,
                    "name": "artpastels1.jpg",
                    "url":
                    {
                        "http": "http://d2xufakadxl3ok.cloudfront.net/1/artpastels1.jpg",
                        "https": "https://d2xufakadxl3ok.cloudfront.net/1/artpastels1.jpg"
                    }
                },
                "47":
                {
                    "id": 47,
                    "name": "artpastels2.jpg",
                    "url":
                    {
                        "http": "http://d2xufakadxl3ok.cloudfront.net/1/artpastels2.jpg",
                        "https": "https://d2xufakadxl3ok.cloudfront.net/1/artpastels2.jpg"
                    }
                }
            }
        }
        [...]
    ]
}

Example Invalid ID Response


{
    "status": false,
    "error": "No products found"
}

Usage Example


try {
    $products = $moltin->get('product/6/variations');
} catch(\Exception $e) {
    exit($e->getMessage());
}

Example Successful Response


{
    "status": true,
    "result": {
        "id": 15,
        "title": "Test Product 1",
        "slug": "test-product-1",
        "price": "235.00",
        "sale_price": "200.00",
        "status": {
            "key": "1",
            "value": "Live"
        },
        "stock_level": 234,
        "stock_status": {
            "key": "1",
            "value": "In Stock"
        },
        "requires_shipping": {
            "key": "0",
            "value": "No"
        },
        "description": "This is a test product",
        "sku": "TEST01",
        "category": {
            "id": 18,
            "parent": {
                "id": 17,
                "parent": null,
                "title": "Test Category 1",
                "slug": "test-category-1",
                "status": {
                    "key": "1",
                    "value": "Live"
                },
                "description": "Description"
            },
            "title": "Test Category 2",
            "slug": "test-category-2",
            "status": {
                "key": "1",
                "value": "Live"
            },
            "description": "Description"
        },
        "weight": "100.00",
        "width": "200.00",
        "height": "200.00",
        "depth": "200.00",
        "tax_band": null,
        "pricing":
        {
           "formatted":
           {
               "with_tax": "£235.00",
               "without_tax": "£235.00"
           },
           "rounded":
           {
               "with_tax": 235,
               "without_tax": 235
           },
           "raw":
           {
               "with_tax": 235,
               "without_tax": 235
           }
        },
        "images": {
            "26": {
                "id": 26,
                "name": "product_tablet_landscape.png",
                "url": {
                    "http": "http:\/\/d2xufakadxl3ok.cloudfront.net\/1\/product_tablet_landscape.png",
                    "https": "https:\/\/d2xufakadxl3ok.cloudfront.net\/1\/product_tablet_landscape.png"
                }
            }
        }
    }
}

Example Invalid Response


{
    "status": true,
    "result": [

    ],
    "pagination": {
        "total": 9,
        "current": 0,
        "limit": 3,
        "offset": 10,
        "from": 11,
        "to": 10,
        "offsets": {
            "first": 0,
            "previous": 7,
            "next": false,
            "last": 6
        },
        "links": {
            "first": "https:\/\/api.molt.in\/beta\/products/search?limit=3",
            "previous": "https:\/\/api.molt.in\/beta\/products/search?offset=7&limit=3",
            "next": false,
            "last": "https:\/\/api.molt.in\/beta\/products/search?offset=6&limit=3"
        }
    }
}

Get a specific products fields

This call returns the data required to build a dynamic flows form based on the product edit requirements. It provides all options available for the choice fields as well as those featured in relationships (eg, Categories). It also provides information of field requirements, default values, etc.

Unlike /products/fields this adds the current products data to the array to allow for prepopulation of fields.

Resource URL

https://api.molt.in/beta/product/:id/fields

Paramaters

None required

Example Successful Response


{
  "status": true,
  "result": {
    "sku": {
      "slug": "sku",
      "name": "SKU",
      "type": "string",
      "options": [],
      "required": true,
      "unique": true,
      "locked": true,
      "order": 1,
      "value": "PRD_H0001"
    },
    "title": {
      "slug": "title",
      "name": "Product Title",
      "type": "string",
      "options": [],
      "required": true,
      "unique": false,
      "locked": true,
      "order": 2,
      "value": "Choc Fondue Pot"
    },
    "slug": {
      "slug": "slug",
      "name": "Slug",
      "type": "slug",
      "options": {
        "parent": "title"
      },
      "required": true,
      "unique": true,
      "locked": true,
      "order": 3,
      "value": "choc-fondue-pot"
    },
    "price": {
      "slug": "price",
      "name": "Price",
      "type": "decimal",
      "options": {
        "decimal_places": 2
      },
      "required": true,
      "unique": false,
      "locked": true,
      "order": 4,
      "value": "17.99"
    },
    "sale_price": {
      "slug": "sale_price",
      "name": "Sale Price",
      "type": "decimal",
      "options": {
        "decimal_places": 2
      },
      "required": false,
      "unique": false,
      "locked": false,
      "order": 5,
      "value": "14.99"
    },
    "status": {
      "slug": "status",
      "name": "Status",
      "type": "choice",
      "options": {
        "choices": [
          "Draft",
          "Live"
        ],
        "default": 0
      },
      "required": true,
      "unique": false,
      "locked": true,
      "order": 6,
      "value": {
        "key": "1",
        "value": "Live"
      }
    },
    "category": {
      "slug": "category",
      "name": "Category",
      "type": "relationship",
      "options": {},
      "required": true,
      "unique": false,
      "locked": true,
      "order": 7,
      "available": {
        "16": "Accessories",
        "17": "Household",
        "42": "Arts and Crafts",
        "60": "I have just updated my title, isn't that great!",
        "137": "My Awesome New Category"
      },
      "value": {
        "id": "60",
        "parent": null,
        "title": "I have just updated my title, isn't that great!",
        "slug": "featured",
        "status": {
          "key": "1",
          "value": "Live"
        },
        "description": "Featured products"
      }
    },
    "stock_level": {
      "slug": "stock_level",
      "name": "Stock Level",
      "type": "integer",
      "options": {
        "default": false
      },
      "required": true,
      "unique": false,
      "locked": true,
      "order": 8,
      "value": 8892
    },
    "stock_status": {
      "slug": "stock_status",
      "name": "Stock Status",
      "type": "choice",
      "options": {
        "choices": [
          "Unlimited",
          "In Stock",
          "Low Stock",
          "Out Of Stock",
          "More Stock Ordered",
          "Discontinued"
        ],
        "default": 1
      },
      "required": true,
      "unique": false,
      "locked": true,
      "order": 9,
      "value": {
        "key": "1",
        "value": "In Stock"
      }
    },
    "description": {
      "slug": "description",
      "name": "Description",
      "type": "text",
      "options": [],
      "required": true,
      "unique": false,
      "locked": true,
      "order": 10,
      "value": "Make your favorite sweets extra special with a coating of freshly melted Chocolate! This chocolate Fondue set makes dessert a fun shared experience, perfect for a romantic meal or for celebrations with friends and family. Always a great gift idea for the chocoholic in your life!"
    },
    "requires_shipping": {
      "slug": "requires_shipping",
      "name": "Requires Shipping",
      "type": "choice",
      "options": {
        "choices": [
          "No",
          "Yes"
        ],
        "default": 1
      },
      "required": true,
      "unique": false,
      "locked": true,
      "order": 11,
      "value": {
        "key": "1",
        "value": "Yes"
      }
    },
    "weight": {
      "slug": "weight",
      "name": "Weight",
      "type": "decimal",
      "options": {
        "decimal_places": 2
      },
      "required": false,
      "unique": false,
      "locked": true,
      "order": 12,
      "value": "234.00"
    },
    "height": {
      "slug": "height",
      "name": "Height",
      "type": "decimal",
      "options": {
        "decimal_places": 2
      },
      "required": false,
      "unique": false,
      "locked": true,
      "order": 13,
      "value": "24.00"
    },
    "width": {
      "slug": "width",
      "name": "Width",
      "type": "decimal",
      "options": {
        "decimal_places": 2
      },
      "required": false,
      "unique": false,
      "locked": true,
      "order": 14,
      "value": "24.00"
    },
    "depth": {
      "slug": "depth",
      "name": "Depth",
      "type": "decimal",
      "options": {
        "decimal_places": 2
      },
      "required": false,
      "unique": false,
      "locked": true,
      "order": 15,
      "value": "32.00"
    },
    "tax_band": {
      "slug": "tax_band",
      "name": "Tax Band",
      "type": "tax-band",
      "options": [],
      "required": false,
      "unique": false,
      "locked": false,
      "order": null,
      "available": {
        "1": "Default",
        "3": "Tax Band 2"
      },
      "value": {
        "id": 1,
        "title": "Default",
        "description": null,
        "rate": "20.00"
      }
    }
  }
}

Delete product by ID

This call deletes a product with a given ID or a set of products in a comma-seperated list of IDs.

Resource URL

DELETE https://api.molt.in/beta/product/:id[,:id]

Paramaters

None required

PHP (SDK) Example


    $result = $moltin->delete('product/15');

    if ( ! $result['status'] ) {
        throw new Exception($result['error']);
    }

Example Successful Response


{
    "status": true,
    "message": "Product deleted successfully"
}

Example Invalid ID Response


{
    "status": false,
    "error": "Product does not exist"
}

Get multiple products by criteria

Returns a range of products based on a given set of paramaters. All choices and relationships will be converted to their appropriate data values to reduce the number of extra calls required.

Resource URL

GET https://api.molt.in/beta/products

Paramaters

Key Type Description
limitoptional Integer The number of products to return
offsetoptional Integer The first product to be shown, used for pagination

Example Successful Response


{
    "status": true,
    "result": [
        {
            "id": 14,
            "title": "Test Product 03",
            "slug": "test-product-03",
            "price": "250.00",
            "sale_price": "135.00",
            "status": {
                "key": "0",
                "value": "Draft"
            },
            "stock_level": 34,
            "stock_status": {
                "key": "1",
                "value": "In Stock"
            },
            "requires_shipping": {
                "key": "0",
                "value": "No"
            },
            "description": "Description",
            "sku": "TEST03",
            "category": null,
            "weight": "250.00",
            "width": "100.00",
            "height": "100.00",
            "depth": "100.00",
            "tax_band": null,
            "pricing":
            {
               "formatted":
               {
                   "with_tax": "£250.00",
                   "without_tax": "£250.00"
               },
               "rounded":
               {
                   "with_tax": 250,
                   "without_tax": 250
               },
               "raw":
               {
                   "with_tax": 250,
                   "without_tax": 250
               }
            },
            "images": [

            ]
        },
        {
            "id": 15,
            "title": "Test Product 02",
            "slug": "test-product-02",
            "price": "235.00",
            "sale_price": "200.00",
            "status": {
                "key": "1",
                "value": "Live"
            },
            "stock_level": 100,
            "stock_status": {
                "key": "1",
                "value": "In Stock"
            },
            "requires_shipping": {
                "key": "0",
                "value": "No"
            },
            "description": "Description",
            "sku": "TEST02",
            "category": {
                "id": 18,
                "parent": {
                    "id": 17,
                    "parent": null,
                    "title": "Test Category 01",
                    "slug": "test-category-01",
                    "status": {
                        "key": "1",
                        "value": "Live"
                    },
                    "description": "Description"
                },
                "title": "Test Category 02",
                "slug": "test-category-02",
                "status": {
                    "key": "1",
                    "value": "Live"
                },
                "description": "Desc"
            },
            "weight": "100.00",
            "width": "100.00",
            "height": "100.00",
            "depth": "100.00",
            "tax_band": null,
            "pricing":
            {
               "formatted":
               {
                   "with_tax": "£35.00",
                   "without_tax": "£35.00"
               },
               "rounded":
               {
                   "with_tax": 35,
                   "without_tax": 35
               },
               "raw":
               {
                   "with_tax": 35,
                   "without_tax": 35
               }
            },
            "images": {
                "26": {
                    "id": 26,
                    "name": "product_tablet_landscape.png",
                    "url": {
                        "http": "http:\/\/d2xufakadxl3ok.cloudfront.net\/1\/product_tablet_landscape.png",
                        "https": "https:\/\/d2xufakadxl3ok.cloudfront.net\/1\/product_tablet_landscape.png"
                    }
                }
            }
        },
        {
            "id": 10,
            "title": "Test Product 01",
            "slug": "test-product-01",
            "price": "135.00",
            "sale_price": "100.00",
            "status": {
                "key": "1",
                "value": "Live"
            },
            "stock_level": 55,
            "stock_status": {
                "key": "1",
                "value": "In Stock"
            },
            "requires_shipping": {
                "key": "0",
                "value": "No"
            },
            "description": "Description",
            "sku": "TEST01",
            "category": null,
            "weight": "5.00",
            "width": "3.00",
            "height": "4.00",
            "depth": "2.00",
            "tax_band": null,
            "pricing":
            {
               "formatted":
               {
                   "with_tax": "£35.00",
                   "without_tax": "£35.00"
               },
               "rounded":
               {
                   "with_tax": 35,
                   "without_tax": 35
               },
               "raw":
               {
                   "with_tax": 35,
                   "without_tax": 35
               }
            },
            "images": [

            ]
        }
    ],
    "pagination": {
        "total": 9,
        "current": 3,
        "limit": 3,
        "offset": 0,
        "from": 1,
        "to": 3,
        "offsets": {
            "first": 0,
            "previous": false,
            "next": 3,
            "last": 6
        },
        "links": {
            "first": "https:\/\/api.molt.in\/beta\/products?limit=3",
            "previous": false,
            "next": "https:\/\/api.molt.in\/beta\/products?offset=3&limit=3",
            "last": "https:\/\/api.molt.in\/beta\/products?offset=6&limit=3"
        }
    }
}

Example Empty Response


{
    "status": true,
    "result": [

    ],
    "pagination": {
        "total": 9,
        "current": 0,
        "limit": 3,
        "offset": 10,
        "from": 11,
        "to": 10,
        "offsets": {
            "first": 0,
            "previous": 7,
            "next": false,
            "last": 6
        },
        "links": {
            "first": "https:\/\/api.molt.in\/beta\/products?limit=3",
            "previous": "https:\/\/api.molt.in\/beta\/products?offset=7&limit=3",
            "next": false,
            "last": "https:\/\/api.molt.in\/beta\/products?offset=6&limit=3"
        }
    }
}

Get product fields

This call returns the data required to build a dynamic flows form based on the product creation requirements. It provides all options available for the choice fields as well as those featured in relationships (eg, Categories). It also provides information of field requirements, default values, etc.

Resource URL

https://api.molt.in/beta/products/fields

Paramaters

None required

PHP (SDK) Example - Direct


    $result      = $moltin->get('product/fields');
    $fields = $result['result'];

PHP (SDK) Example - Flows Builder

Built in to the PHP SDK is a form builder that can automatically generate the HTML form elements for you as well as make the necissary calls.


    $fields = $moltin->fields('product');

Example Successful Response


{
    "status": true,
    "result": {
        "title": {
            "slug": "title",
            "name": "Product Title",
            "type": "string",
            "options": [

            ],
            "required": true,
            "unique": false,
            "locked": true,
            "order": null
        },
        "slug": {
            "slug": "slug",
            "name": "Slug",
            "type": "slug",
            "options": {
                "parent": "title"
            },
            "required": true,
            "unique": true,
            "locked": true,
            "order": null
        },
        "price": {
            "slug": "price",
            "name": "Price",
            "type": "decimal",
            "options": {
                "decimal_places": 2
            },
            "required": true,
            "unique": false,
            "locked": true,
            "order": null
        },
        "sale_price": {
            "slug": "sale_price",
            "name": "Sale Price",
            "type": "decimal",
            "options": {
                "decimal_places": 2
            },
            "required": false,
            "unique": false,
            "locked": false,
            "order": null
        },
        "status": {
            "slug": "status",
            "name": "Status",
            "type": "choice",
            "options": {
                "choices": [
                    "Draft",
                    "Live"
                ],
                "default": 0
            },
            "required": true,
            "unique": false,
            "locked": true,
            "order": null
        },
        "stock_level": {
            "slug": "stock_level",
            "name": "Stock Level",
            "type": "integer",
            "options": {
                "default": false
            },
            "required": true,
            "unique": false,
            "locked": true,
            "order": null
        },
        "stock_status": {
            "slug": "stock_status",
            "name": "Stock Status",
            "type": "choice",
            "options": {
                "choices": [
                    "Unlimited",
                    "In Stock",
                    "Low Stock",
                    "Out Of Stock",
                    "More Stock Ordered",
                    "Discontinued"
                ],
                "default": 1
            },
            "required": true,
            "unique": false,
            "locked": true,
            "order": null
        },
        "requires_shipping": {
            "slug": "requires_shipping",
            "name": "Requires Shipping",
            "type": "choice",
            "options": {
                "choices": [
                    "No",
                    "Yes"
                ],
                "default": 1
            },
            "required": true,
            "unique": false,
            "locked": true,
            "order": null
        },
        "description": {
            "slug": "description",
            "name": "Description",
            "type": "text",
            "options": [

            ],
            "required": true,
            "unique": false,
            "locked": true,
            "order": null
        },
        "sku": {
            "slug": "sku",
            "name": "SKU",
            "type": "string",
            "options": [

            ],
            "required": true,
            "unique": true,
            "locked": true,
            "order": null
        },
        "category": {
            "slug": "category",
            "name": "Category",
            "type": "relationship",
            "options": [

            ],
            "required": true,
            "unique": false,
            "locked": true,
            "order": null,
            "available": {
                "19": "Test Category 4",
                "17": "Test Category 7",
                "16": "Test Category",
                "18": "Test Category 3"
            }
        },
        "weight": {
            "slug": "weight",
            "name": "Weight",
            "type": "decimal",
            "options": {
                "decimal_places": 2
            },
            "required": false,
            "unique": false,
            "locked": true,
            "order": null
        },
        "width": {
            "slug": "width",
            "name": "Width",
            "type": "decimal",
            "options": {
                "decimal_places": 2
            },
            "required": false,
            "unique": false,
            "locked": true,
            "order": null
        },
        "height": {
            "slug": "height",
            "name": "Height",
            "type": "decimal",
            "options": {
                "decimal_places": 2
            },
            "required": false,
            "unique": false,
            "locked": true,
            "order": null
        },
        "depth": {
            "slug": "depth",
            "name": "Depth",
            "type": "decimal",
            "options": {
                "decimal_places": 2
            },
            "required": false,
            "unique": false,
            "locked": true,
            "order": null
        }
    }
}

Get product by ID

This call simply returns a product based on a given ID. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

GET https://api.molt.in/beta/product/:id

Paramaters

None required

Example Successful Response


{
    "status": true,
    "result": {
        "id": 15,
        "title": "Test Product 1",
        "slug": "test-product-1",
        "price": "235.00",
        "sale_price": "200.00",
        "status": {
            "key": "1",
            "value": "Live"
        },
        "stock_level": 234,
        "stock_status": {
            "key": "1",
            "value": "In Stock"
        },
        "requires_shipping": {
            "key": "0",
            "value": "No"
        },
        "description": "This is a test product",
        "sku": "TEST01",
        "category": {
            "id": 18,
            "parent": {
                "id": 17,
                "parent": null,
                "title": "Test Category 1",
                "slug": "test-category-1",
                "status": {
                    "key": "1",
                    "value": "Live"
                },
                "description": "Description"
            },
            "title": "Test Category 2",
            "slug": "test-category-2",
            "status": {
                "key": "1",
                "value": "Live"
            },
            "description": "Description"
        },
        "weight": "100.00",
        "width": "200.00",
        "height": "200.00",
        "depth": "200.00",
        "tax_band": null,
        "pricing":
        {
           "formatted":
           {
               "with_tax": "£235.00",
               "without_tax": "£235.00"
           },
           "rounded":
           {
               "with_tax": 235,
               "without_tax": 235
           },
           "raw":
           {
               "with_tax": 235,
               "without_tax": 235
           }
        },
        "images": {
            "26": {
                "id": 26,
                "name": "product_tablet_landscape.png",
                "url": {
                    "http": "http:\/\/d2xufakadxl3ok.cloudfront.net\/1\/product_tablet_landscape.png",
                    "https": "https:\/\/d2xufakadxl3ok.cloudfront.net\/1\/product_tablet_landscape.png"
                }
            }
        }
    }
}

Example Invalid ID Response


{
    "status": false,
    "error": "No product found"
}

Usage Example


try {
    $product = $moltin->getProductById(15);
} catch(\Exception $e) {
    exit($e->getMessage());
}

Cart

Resource Description
Add item to cart Insert an item into the cart
Add variation to cart Insert a variation into the cart
Get cart contents Retrieve the cart contents
Get item from cart by identifier Gets an item from the cart with a given identifier
Update item in a cart Updates a cart item by identifier
Delete item from cart Removes an item from the cart
Delete cart and contents Destroys a cart and its' item contents
Get the available checkout options Retrieve available checkout options for a cart
Pass a cart to checkout Process the checkout data into an order.
Check if item is in a cart Checks if the cart contains an item of a given identifier

Add item to cart

You can insert an item into the cart by POSTing to the cart endpoint with a list of parameters.

Resource URL

POST https://api.molt.in/beta/cart/[:identifier]

Paramaters

Key Type Description
id String The ID of the product you want to add to the cart, can be a product id
nameoptional String The name of the product, only required if your product ID is not a product stored in the database
quantity Integer How many of this product you want to add to the cart
priceoptional Float The Price of the product, only required if your product ID is not a product stored in the database
weightoptional Float The weight of the product. Automatically set if the product is found in the database
heightoptional Float The height of the product. Automatically set if the product is found in the database
widthoptional Float The width of the product. Automatically set if the product is found in the database
depthoptional Float The depth of the product. Automatically set if the product is found in the database

Example Successful Response


{
  "status": true,
  "item": {
    "identifier": "bb4a6db4295d6be8bd12791ed5650087",
    "id": "14",
    "quantity": "1",
    "/beta/cart/123": "",
    "sku": "PRD_H0001",
    "title": "Choc Fondue Pot",
    "slug": "choc-fondue-pot",
    "price": "17.99",
    "sale_price": "14.99",
    "status": {
      "key": "1",
      "value": "Live"
    },
    "category": {
      "id": "60",
      "parent": null,
      "title": "Featured",
      "slug": "featured",
      "status": {
        "key": "1",
        "value": "Live"
      },
      "description": "Featured products"
    },
    "stock_level": 8892,
    "stock_status": {
      "key": "1",
      "value": "In Stock"
    },
    "description": "Make your favorite sweets extra special with a coating of freshly melted Chocolate! This chocolate Fondue set makes dessert a fun shared experience, perfect for a romantic meal or for celebrations with friends and family. Always a great gift idea for the chocoholic in your life!",
    "requires_shipping": {
      "key": "1",
      "value": "Yes"
    },
    "weight": "234.00",
    "height": "24.00",
    "width": "24.00",
    "depth": "32.00",
    "tax_band": {
      "id": 1,
      "title": "Default",
      "description": null,
      "rate": "20.00"
    },
    "pricing": {
      "formatted": {
        "with_tax": "£22.00",
        "without_tax": "£18.33"
      },
      "rounded": {
        "with_tax": 22,
        "without_tax": 18.33
      },
      "raw": {
        "with_tax": 21.588,
        "without_tax": 17.99
      }
    },
    "images": {
      "60": {
        "id": 60,
        "name": "fonduepot1.jpg",
        "url": {
          "http": "http://d2xufakadxl3ok.cloudfront.net/1/fonduepot1.jpg",
          "https": "https://d2xufakadxl3ok.cloudfront.net/1/fonduepot1.jpg"
        }
      },
      "61": {
        "id": 61,
        "name": "fonduepot2.jpg",
        "url": {
          "http": "http://d2xufakadxl3ok.cloudfront.net/1/fonduepot2.jpg",
          "https": "https://d2xufakadxl3ok.cloudfront.net/1/fonduepot2.jpg"
        }
      },
      "62": {
        "id": 62,
        "name": "fonduepot3.jpg",
        "url": {
          "http": "http://d2xufakadxl3ok.cloudfront.net/1/fonduepot3.jpg",
          "https": "https://d2xufakadxl3ok.cloudfront.net/1/fonduepot3.jpg"
        }
      }
    },
    "name": "Choc Fondue Pot",
    "tax": "20.00",
    "total": 21.588,
    "total_before_tax": 17.99,
    "totals": {
      "formatted": {
        "with_tax": "£22.00",
        "without_tax": "£18.33"
      },
      "rounded": {
        "with_tax": 22,
        "without_tax": 18.33
      },
      "raw": {
        "with_tax": 21.588,
        "without_tax": 17.99
      }
    }
  }
}

Example Failed Response


{
  "status": false,
  "error": "The 'id' field is required"
}

Add variation to cart

You can insert a product variation into the cart by POSTing to the cart endpoint with a list of parameters and modifier/variation pairs.

Resource URL

POST https://api.molt.in/beta/cart/[:identifier]

Paramaters

Key Type Description
modifier String Modifier key pairs, modifier[:modifierId]=:variationId, eg modifier[401]=402
quantity Integer How many of this product you want to add to the cart

Example Successful Response


{
    "status": true,
    "item":
    {
        "identifier": "007297ed53cdc06b2a895f93190f1281",
        "modifier":
        {
            "523": "524"
        },
        "quantity": "3",
        "id": "525",
        "sku": "PRD_A0002_RESMRE",
        "title": "Conté Sticks - Red Small Red",
        "slug": "conte-sticks-red-small-red",
        "price": "8.49",
        "sale_price": "8.99",
        "status":
        {
            "value": "Live",
            "data":
            {
                "key": "1",
                "value": "Live"
            }
        },
        "category":
        {
            "value": "Arts and Crafts",
            "data":
            {
                "42":
                {
                    "id": "42",
                    "parent": null,
                    "title": "Arts and Crafts",
                    "slug": "arts-and-crafts",
                    "status":
                    {
                        "value": "Live",
                        "data":
                        {
                            "key": "1",
                            "value": "Live"
                        }
                    },
                    "description": "Good quality art materials at affordable prices. We're here to help you create without limits!",
                    "created_at": "",
                    "updated_at": ""
                }
            }
        },
        "stock_level": 1050,
        "stock_status":
        {
            "value": "In Stock",
            "data":
            {
                "key": "1",
                "value": "In Stock"
            }
        },
        "description": "Drawing with conté sticks is a sure way to achive high contrast, richly pigmented images. This media can also be used to shapen lines as a final stage of a painting's development. ",
        "requires_shipping":
        {
            "value": "Yes",
            "data":
            {
                "key": "1",
                "value": "Yes"
            }
        },
        "weight": "10.00",
        "height": "10.00",
        "width": "10.00",
        "depth": "10.00",
        "collection": null,
        "brand":
        {
            "value": " ",
            "data":
            {
                "id": "514",
                "title": " ",
                "slug": " ",
                "status":
                {
                    "value": "Draft",
                    "data":
                    {
                        "key": "0",
                        "value": "Draft"
                    }
                },
                "description": " ",
                "created_at": "2014-05-06 15:59:43",
                "updated_at": "2014-05-06 15:59:43"
            }
        },
        "tax_band": null,
        "meta_title": "",
        "created_at": "2014-05-07 10:58:03",
        "updated_at": "2014-05-07 11:03:26",
        "pricing":
        {
            "formatted":
            {
                "with_tax": "£8.49",
                "without_tax": "£8.49"
            },
            "rounded":
            {
                "with_tax": 8.49,
                "without_tax": 8.49
            },
            "raw":
            {
                "with_tax": 8.49,
                "without_tax": 8.49
            }
        },
        "images":
        {
            "45":
            {
                "id": 45,
                "name": "artpastels1.jpg",
                "url":
                {
                    "http": "http://d2xufakadxl3ok.cloudfront.net/1/artpastels1.jpg",
                    "https": "https://d2xufakadxl3ok.cloudfront.net/1/artpastels1.jpg"
                }
            },
            "47":
            {
                "id": 47,
                "name": "artpastels2.jpg",
                "url":
                {
                    "http": "http://d2xufakadxl3ok.cloudfront.net/1/artpastels2.jpg",
                    "https": "https://d2xufakadxl3ok.cloudfront.net/1/artpastels2.jpg"
                }
            }
        },
        "name": "Conté Sticks - Red Small Red",
        "total": 25.47,
        "total_before_tax": 25.47,
        "totals":
        {
            "formatted":
            {
                "with_tax": "£25.47",
                "without_tax": "£25.47"
            },
            "rounded":
            {
                "with_tax": 25.47,
                "without_tax": 25.47
            },
            "raw":
            {
                "with_tax": 25.47,
                "without_tax": 25.47
            }
        }
    }
}

Example Failed Response


{
  "status": false,
  "error": "The variation was not found"
}

Get cart contents

You can retrieve the shopping cart by calling the cart endpoint and pass the cart identifier as part of the URL.

Resource URL

GET https://api.molt.in/beta/cart/:identifier

Paramaters

None required

Example Successful Response


{
  "status": true,
  "contents": {
    "bb4a6db4295d6be8bd12791ed5650087": {
      "id": "14",
      "quantity": 2,
      "/beta/cart/123": "",
      "sku": "PRD_H0001",
      "title": "Choc Fondue Pot",
      "slug": "choc-fondue-pot",
      "price": "17.99",
      "sale_price": "14.99",
      "status": {
        "key": "1",
        "value": "Live"
      },
      "category": {
        "id": "60",
        "parent": null,
        "title": "Featured",
        "slug": "featured",
        "status": {
          "key": "1",
          "value": "Live"
        },
        "description": "Featured products"
      },
      "stock_level": 8892,
      "stock_status": {
        "key": "1",
        "value": "In Stock"
      },
      "description": "Make your favorite sweets extra special with a coating of freshly melted Chocolate! This chocolate Fondue set makes dessert a fun shared experience, perfect for a romantic meal or for celebrations with friends and family. Always a great gift idea for the chocoholic in your life!",
      "requires_shipping": {
        "key": "1",
        "value": "Yes"
      },
      "weight": "234.00",
      "height": "24.00",
      "width": "24.00",
      "depth": "32.00",
      "tax_band": {
        "id": 1,
        "title": "Default",
        "description": null,
        "rate": "20.00"
      },
      "pricing": {
        "formatted": {
          "with_tax": "£22.00",
          "without_tax": "£18.33"
        },
        "rounded": {
          "with_tax": 22,
          "without_tax": 18.33
        },
        "raw": {
          "with_tax": 21.588,
          "without_tax": 17.99
        }
      },
      "images": {
        "60": {
          "id": 60,
          "name": "fonduepot1.jpg",
          "url": {
            "http": "http://d2xufakadxl3ok.cloudfront.net/1/fonduepot1.jpg",
            "https": "https://d2xufakadxl3ok.cloudfront.net/1/fonduepot1.jpg"
          }
        },
        "61": {
          "id": 61,
          "name": "fonduepot2.jpg",
          "url": {
            "http": "http://d2xufakadxl3ok.cloudfront.net/1/fonduepot2.jpg",
            "https": "https://d2xufakadxl3ok.cloudfront.net/1/fonduepot2.jpg"
          }
        },
        "62": {
          "id": 62,
          "name": "fonduepot3.jpg",
          "url": {
            "http": "http://d2xufakadxl3ok.cloudfront.net/1/fonduepot3.jpg",
            "https": "https://d2xufakadxl3ok.cloudfront.net/1/fonduepot3.jpg"
          }
        }
      },
      "name": "Choc Fondue Pot",
      "tax": "20.00",
      "total": 43.176,
      "total_before_tax": 35.98,
      "totals": {
        "formatted": {
          "with_tax": "£44.00",
          "without_tax": "£36.66"
        },
        "rounded": {
          "with_tax": 44,
          "without_tax": 36.66
        },
        "raw": {
          "with_tax": 43.176,
          "without_tax": 35.98
        }
      }
    }
  },
  "total": 43.176,
  "total_before_tax": 35.98,
  "total_items": 2,
  "total_unique_items": 2,
  "totals": {
    "formatted": {
      "with_tax": "£44.00",
      "without_tax": "£36.66"
    },
    "rounded": {
      "with_tax": 44,
      "without_tax": 36.66
    },
    "raw": {
      "with_tax": 43.176,
      "without_tax": 35.98
    }
  },
  "currency": {
    "code": "GBP",
    "format": "£{price}",
    "decimal": ".",
    "thousand": ",",
    "rounding": "full"
  }
}

Get item from cart by identifier

You can retrieve a specific item from the cart by calling this endpoint with the cart identifier and item identifier.

Resource URL

GET https://api.molt.in/beta/cart/:identifier/item/:id

Paramaters

None required

Example Successful Response


{
  "status": true,
  "item": {
    "id": "14",
    "quantity": "1",
    "/beta/cart/123": "",
    "sku": "PRD_H0001",
    "title": "Choc Fondue Pot",
    "slug": "choc-fondue-pot",
    "price": "17.99",
    "sale_price": "14.99",
    "status": {
      "key": "1",
      "value": "Live"
    },
    "category": {
      "id": "60",
      "parent": null,
      "title": "Featured",
      "slug": "featured",
      "status": {
        "key": "1",
        "value": "Live"
      },
      "description": "Featured products"
    },
    "stock_level": 8892,
    "stock_status": {
      "key": "1",
      "value": "In Stock"
    },
    "description": "Make your favorite sweets extra special with a coating of freshly melted Chocolate! This chocolate Fondue set makes dessert a fun shared experience, perfect for a romantic meal or for celebrations with friends and family. Always a great gift idea for the chocoholic in your life!",
    "requires_shipping": {
      "key": "1",
      "value": "Yes"
    },
    "weight": "234.00",
    "height": "24.00",
    "width": "24.00",
    "depth": "32.00",
    "tax_band": {
      "id": 1,
      "title": "Default",
      "description": null,
      "rate": "20.00"
    },
    "pricing": {
      "formatted": {
        "with_tax": "£22.00",
        "without_tax": "£18.33"
      },
      "rounded": {
        "with_tax": 22,
        "without_tax": 18.33
      },
      "raw": {
        "with_tax": 21.588,
        "without_tax": 17.99
      }
    },
    "images": {
      "60": {
        "id": 60,
        "name": "fonduepot1.jpg",
        "url": {
          "http": "http://d2xufakadxl3ok.cloudfront.net/1/fonduepot1.jpg",
          "https": "https://d2xufakadxl3ok.cloudfront.net/1/fonduepot1.jpg"
        }
      },
      "61": {
        "id": 61,
        "name": "fonduepot2.jpg",
        "url": {
          "http": "http://d2xufakadxl3ok.cloudfront.net/1/fonduepot2.jpg",
          "https": "https://d2xufakadxl3ok.cloudfront.net/1/fonduepot2.jpg"
        }
      },
      "62": {
        "id": 62,
        "name": "fonduepot3.jpg",
        "url": {
          "http": "http://d2xufakadxl3ok.cloudfront.net/1/fonduepot3.jpg",
          "https": "https://d2xufakadxl3ok.cloudfront.net/1/fonduepot3.jpg"
        }
      }
    },
    "name": "Choc Fondue Pot",
    "tax": "20.00",
    "total": 21.588,
    "total_before_tax": 17.99,
    "totals": {
      "formatted": {
        "with_tax": "£22.00",
        "without_tax": "£18.33"
      },
      "rounded": {
        "with_tax": 22,
        "without_tax": 18.33
      },
      "raw": {
        "with_tax": 21.588,
        "without_tax": 17.99
      }
    }
  }
}

Example Failed Response


{
  "status": false,
  "error": "Item does not exist"
}

Update item in a cart

You can update an item in the cart by sending a PUT request to the item's endpoint with a list of parameters.

Resource URL

PUT https://api.molt.in/beta/cart/:identifier/item/:id

Paramaters

Key Type Description
nameoptional String The new name of this item
quantityoptional Integer A new quantity for this item
priceoptional Float The new price of this item
weightoptional Float The new weight of this item
heightoptional Float The new height of this item
widthoptional Float The new width of this item
depthoptional Float The new depth of this item

Example Successful Response


{
  "status": true,
  "item": {
    "id": "14",
    "quantity": "100",
    "/beta/cart/123": "",
    "sku": "PRD_H0001",
    "title": "Choc Fondue Pot",
    "slug": "choc-fondue-pot",
    "price": "17.99",
    "sale_price": "14.99",
    "status": {
      "key": "1",
      "value": "Live"
    },
    "category": {
      "id": "60",
      "parent": null,
      "title": "Featured",
      "slug": "featured",
      "status": {
        "key": "1",
        "value": "Live"
      },
      "description": "Featured products"
    },
    "stock_level": 8892,
    "stock_status": {
      "key": "1",
      "value": "In Stock"
    },
    "description": "Make your favorite sweets extra special with a coating of freshly melted Chocolate! This chocolate Fondue set makes dessert a fun shared experience, perfect for a romantic meal or for celebrations with friends and family. Always a great gift idea for the chocoholic in your life!",
    "requires_shipping": {
      "key": "1",
      "value": "Yes"
    },
    "weight": "234.00",
    "height": "24.00",
    "width": "24.00",
    "depth": "32.00",
    "tax_band": {
      "id": 1,
      "title": "Default",
      "description": null,
      "rate": "20.00"
    },
    "pricing": {
      "formatted": {
        "with_tax": "£22.00",
        "without_tax": "£18.33"
      },
      "rounded": {
        "with_tax": 22,
        "without_tax": 18.33
      },
      "raw": {
        "with_tax": 21.588,
        "without_tax": 17.99
      }
    },
    "images": {
      "60": {
        "id": 60,
        "name": "fonduepot1.jpg",
        "url": {
          "http": "http://d2xufakadxl3ok.cloudfront.net/1/fonduepot1.jpg",
          "https": "https://d2xufakadxl3ok.cloudfront.net/1/fonduepot1.jpg"
        }
      },
      "61": {
        "id": 61,
        "name": "fonduepot2.jpg",
        "url": {
          "http": "http://d2xufakadxl3ok.cloudfront.net/1/fonduepot2.jpg",
          "https": "https://d2xufakadxl3ok.cloudfront.net/1/fonduepot2.jpg"
        }
      },
      "62": {
        "id": 62,
        "name": "fonduepot3.jpg",
        "url": {
          "http": "http://d2xufakadxl3ok.cloudfront.net/1/fonduepot3.jpg",
          "https": "https://d2xufakadxl3ok.cloudfront.net/1/fonduepot3.jpg"
        }
      }
    },
    "name": "Choc Fondue Pot",
    "tax": "20.00",
    "/beta/cart/123/item/bb4a6db4295d6be8bd12791ed5650087": "",
    "total": 2158.8,
    "total_before_tax": 1799,
    "totals": {
      "formatted": {
        "with_tax": "£2,200.00",
        "without_tax": "£1,833.00"
      },
      "rounded": {
        "with_tax": 2200,
        "without_tax": 1833
      },
      "raw": {
        "with_tax": 2158.8,
        "without_tax": 1799
      }
    }
  }
}

Example Failed Response


{
  "status": false,
  "error": "Quantity can not be less than 1"
}

Delete item from cart

Deleting an item from a users cart is as simple as calling the item URL with a DELETE HTTP method.

Resource URL

DELETE https://api.molt.in/beta/cart/:identifier/item/:id

Paramaters

None required

Example Successful Response


{
    "status": true
}

Example Failed Response


{
    "status": false
}

Delete cart and contents

This method is used to destroy an entire shopping cart, this can not be undone.

Resource URL

DELETE https://api.molt.in/beta/cart/:identifier

Paramaters

None required

Example Successful Response


{
    "status": true,
    "message": "Cart destroyed"
}

Get the available checkout options

When you are ready to take a cart to checkout, you can make a call to the checkout endpoint to see what shipping methods, addresses and payment gateways are available for the contents of the specified cart.

Resource URL

GET https://api.molt.in/beta/cart/:identifier/checkout

Paramaters

Key Type Description
customeroptional Integer or String The ID or email address of the customer who is checking out

Example Successful Response


{
  "status": true,
  "result": {
    "cart": {
      "contents": {
        "027c91341fd5cf4d2579b49c4b6a90da": {
          "id": "1",
          "title": "My awesome product",
          "quantity": "1",
          "sku": "AWESOME",
          "slug": "my-awesome-product",
          "price": "35.00",
          "sale_price": "30.00",
          "status": {
            "key": "1",
            "value": "Live"
          },
          "category": null,
          "stock_level": 100,
          "stock_status": {
            "key": "1",
            "value": "In Stock"
          },
          "description": "An awesome product.",
          "requires_shipping": {
            "key": "1",
            "value": "Yes"
          },
          "weight": "10.00",
          "height": "10.00",
          "width": "10.00",
          "depth": "10.00",
          "collection": null,
          "brand": null,
          "tax_band": null,
          "pricing": {
            "formatted": {
              "with_tax": "£35.00",
              "without_tax": "£35.00"
            },
            "rounded": {
              "with_tax": 35,
              "without_tax": 35
            },
            "raw": {
              "with_tax": 35,
              "without_tax": 35
            }
          },
          "images": [],
          "name": "My awesome product",
          "total": 35,
          "total_before_tax": 35,
          "totals": {
            "formatted": {
              "with_tax": "£35.00",
              "without_tax": "£35.00"
            },
            "rounded": {
              "with_tax": 35,
              "without_tax": 35
            },
            "raw": {
              "with_tax": 35,
              "without_tax": 35
            }
          }
        }
      },
      "totals": {
        "formatted": {
          "with_tax": "£35.00",
          "without_tax": "£35.00"
        },
        "rounded": {
          "with_tax": 35,
          "without_tax": 35
        },
        "raw": {
          "with_tax": 35,
          "without_tax": 35
        }
      }
    },
    "shipping": {
      "required": true,
      "methods": [
        {
          "id": "70",
          "title": "£5 Shipping",
          "slug": "5-shipping",
          "company": "FedEx",
          "status": {
            "key": "1",
            "value": "Live"
          },
          "price": "5.00",
          "price_min": "",
          "price_max": "",
          "weight_min": "",
          "weight_max": "",
          "description": "",
          "tax_band": {
            "id": 1,
            "title": "Default",
            "description": null,
            "rate": "20.00"
          },
          "pricing": {
            "formatted": {
              "with_tax": "£6.00",
              "without_tax": "£5.00"
            },
            "rounded": {
              "with_tax": 6,
              "without_tax": 5
            },
            "raw": {
              "with_tax": 6,
              "without_tax": 5
            }
          },
          "totals": {
            "formatted": {
              "with_tax": "£41.00",
              "without_tax": "£40.00"
            },
            "rounded": {
              "with_tax": 41,
              "without_tax": 40
            },
            "raw": {
              "with_tax": 41,
              "without_tax": 40
            }
          }
        }
      ]
    },
    "addresses": [],
    "gateways": {
      "paypal-express": {
        "id": 4,
        "store_id": 1,
        "name": "PayPal Express",
        "slug": "paypal-express",
        "description": null,
        "enabled": true,
        "settings": {
          "username": "my-paypal-username",
          "password": "password",
          "signature": "signaturehere",
          "testMode": true,
          "solutionType": "Sole",
          "landingPage": "Billing",
          "headerImageUrl": ""
        }
      },
      "2checkout": {
        "id": 6,
        "store_id": 1,
        "name": "2Checkout",
        "slug": "2checkout",
        "description": null,
        "enabled": true,
        "settings": {
          "accountNumber": "my-account-no",
          "secretWord": "this-is-a-secret",
          "testMode": false
        }
      }
    }
  }
}

Pass a cart to checkout

When you have collected the data required to process the checkout, you can post it to this endpoint for processing, you can also use the specific endpoints for addresses, orders and order items if you want to process these sections individually. This endpoint will create the addresses, the order and add all the order items. You can then pass this order to the payment endpoint.

Resource URL

POST https://api.molt.in/beta/cart/:identifier/checkout

Paramaters

Key Type Description
customer Integer or String The ID or email address of the customer who is checking out
shippingoptional Integer The ID of the shipping method to use.
gateway String The slug of the payment gateway to use.
bill_to Integer, Array or String The ID of an existing address, or an array of fields to create a new address. You can also set this to "ship_to" to make the billing address the same as the shipping address.
ship_to Integer, Array or String The ID of an existing address, or an array of fields to create a new address. You can also set this to "bill_to" to make the shipping address the same as the billing address.

Example Successful Response


{
    "status": true,
    "result": {
        "id": "115",
        "customer": {
            "id": "111",
            "first_name": "Chris",
            "last_name": "Harvey",
            "email": "chris@molt.in"
        },
        "gateway": {
            "name": "Stripe",
            "slug": "stripe",
            "description": null,
            "enabled": true,
            "settings": {
                "apiKey": "my_api_key"
            }
        },
        "status": {
            "key": "unpaid",
            "value": "Unpaid"
        },
        "subtotal": "100.00",
        "shipping_price": "10.00",
        "total": "110.00",
        "currency": {
            "id": 1,
            "code": "GBP",
            "title": "British Pound",
            "enabled": true,
            "modifier": "+0",
            "exchange_rate": "1.00",
            "format": "£{price}",
            "decimal_point": ".",
            "thousand_point": ",",
            "rounding": null,
            "default": false
        },
        "currency_code": "GBP",
        "exchange_rate": "1.00",
        "ship_to": {
            "id": "112",
            "save_as": "",
            "first_name": "Chris",
            "last_name": "Harvey",
            "email": "chris@molt.in",
            "address_1": "55 Moltin Lane",
            "address_2": "",
            "city": "Moltinland",
            "county": "Moltin",
            "postcode": "M01T",
            "country": {
                "code": "GB",
                "name": "United Kingdom"
            },
            "customer": {
                "id": "111",
                "first_name": "Chris",
                "last_name": "Harvey",
                "email": "chris@molt.in"
            },
            "company": "",
            "phone": "123456778"
        },
        "bill_to": {
            "id": "112",
            "save_as": "",
            "first_name": "Chris",
            "last_name": "Harvey",
            "email": "chris@molt.in",
            "address_1": "55 Moltin Lane",
            "address_2": "",
            "city": "Moltinland",
            "county": "Moltin",
            "postcode": "M01T",
            "country": {
                "code": "GB",
                "name": "United Kingdom"
            },
            "customer": {
                "id": "111",
                "first_name": "Chris",
                "last_name": "Harvey",
                "email": "chris@molt.in"
            },
            "company": "",
            "phone": "123456778"
        },
        "shipping": {
            "id": "110",
            "title": "FedEx",
            "slug": "fedex",
            "company": "FedEx",
            "price": "10.00",
            "price_min": "",
            "price_max": "10000.00",
            "weight_min": "",
            "weight_max": "10000.00",
            "description": "",
            "tax_band": {
                "id": 1,
                "title": "Default",
                "description": null,
                "rate": "20.00"
            },
            "status": {
                "key": "1",
                "value": "Live"
            }
        }
    }
}

Check if item is in a cart

Checks if the cart contains the specified item identifier

Resource URL

GET https://api.molt.in/beta/cart/:identifier/has/:id

Paramaters

None required

Example Successful Response


{
    "status": true
}

Example Failed Response


{
    "status": false
}

Checkout

Resource Description
Process payment for an order Process the payment for an order.

Process payment for an order

When you have an order that is ready to be processed, you can call this method to process the payment. Payment gateways come in two forms, on-site gateways like Stripe where the card information is taken on your site then passed through to the gateway, and off-site gateways like PayPal that redirect the user to the gateway to process the payment.

Resource URL

POST https://api.molt.in/beta/checkout/payment/:method/:orderId

Payment Methods

Method Description
authorize Authorize an amount on the customer's card
complete_authorize Handle return from off-site gateways after authorization
capture Capture an amount you have previously authorized
purchase Authorize and immediately capture an amount on the customer's card
complete_purchase Handle return from off-site gateways after purchase
refund Refund an already processed transaction
void Generally can only be called up to 24 hours after submitting a transaction

Paramaters

Key Type Description
data Array An array of data required by the payment gateway
ipoptional String The IP address of the user who is making the payment
return_urloptional String A URL the user will be returned to if the payment is successful
cancel_urloptional String A URL the user will be returned to if they cancel

Data array

Key Type Description
number Numeric The credit/debit card number
expiry_month Numeric The expiry month of the credit/debit card in two digit format
expiry_year Numeric The expiry year of the credit/debit card in four digit format
start_monthoptional Numeric The start month of the credit/debit card in two digit format
start_yearoptional Numeric The start year of the credit/debit card in four digit format
cvv Numeric The three digit CVV code for the credit/debit card
issue_numberoptional Numeric The issue number of the credit/debit card
typeoptional See card types The credit/debit card type

Card types

Name Slug
Visa visa
MasterCard mastercard
Discover discover
Amex amex
Diners Club diners_club
JCB jcb
Switch switch
Solo solo
Dankort dankort
Maestro maestro
Forbrugsforeningen forbrugsforeningen
Laser laser

Example Successful On-Site Gateway Response


{
    "status": true,
    "result": {
        "message": "Payment completed successfully",
        "redirect": false,
        "reference": "ch_3zp8J7fHW4lfuP",
        "data": {
            "id": "ch_3zp8J7fHW4lfuP",
            "object": "charge",
            "created": 1399547716,
            "livemode": false,
            "paid": true,
            "amount": 10000,
            "currency": "gbp",
            "refunded": false,
            "card": {
                "id": "card_jksdfj7HBJHBJdkj",
                "object": "card",
                "last4": "4242",
                "type": "Visa",
                "exp_month": 12,
                "exp_year": 2015,
                "fingerprint": "LKJKjbhsdf3343",
                "customer": null,
                "country": "US",
                "name": "Chris Harvey",
                "address_line1": "55 Moltin Lane",
                "address_line2": "",
                "address_city": "Moltinland",
                "address_state": "Moltin",
                "address_zip": "M01T",
                "address_country": "United Kingdom",
                "cvc_check": "pass",
                "address_line1_check": "pass",
                "address_zip_check": "pass"
            },
            "captured": true,
            "balance_transaction": "txn_3hgfsdfGHJGcsdf",
            "failure_message": null,
            "failure_code": null,
            "amount_refunded": 0,
            "customer": null,
            "invoice": null,
            "description": "Order #223",
            "dispute": null,
            "metadata": [],
            "statement_description": null,
            "fee": 260,
            "fee_details": [
                {
                    "amount": 260,
                    "currency": "gbp",
                    "type": "stripe_fee",
                    "description": "Stripe processing fees",
                    "application": null
                }
            ]
        },
        "order": {
            "id": "223",
            "customer": {
                "value": "Chris",
                "data": {
                    "id": "111",
                    "first_name": "Chris",
                    "last_name": "Harvey",
                    "email": "chris@molt.in",
                    "group": null,
                    "created_at": "",
                    "updated_at": ""
                }
            },
            "gateway": {
                "value": "Stripe",
                "data": {
                    "name": "Stripe",
                    "slug": "stripe",
                    "description": null,
                    "enabled": true,
                    "settings": {
                        "apiKey": "That would be telling"
                    }
                }
            },
            "status": {
                "value": "Paid",
                "data": {
                    "key": "paid",
                    "value": "Paid"
                }
            },
            "subtotal": "100.00",
            "shipping_price": "",
            "total": "100.00",
            "currency": {
                "value": "British Pound",
                "data": {
                    "id": 4,
                    "code": "GBP",
                    "title": "British Pound",
                    "enabled": true,
                    "modifier": "+0",
                    "exchange_rate": null,
                    "format": "£{price}",
                    "decimal_point": ".",
                    "thousand_point": ",",
                    "rounding": null,
                    "default": false,
                    "created_at": null,
                    "updated_at": null
                }
            },
            "currency_code": "GBP",
            "exchange_rate": "1.00",
            "ship_to": {
                "value": "",
                "data": {
                    "id": "112",
                    "save_as": "",
                    "first_name": "Chris",
                    "last_name": "Harvey",
                    "email": "chris@molt.in",
                    "address_1": "55 Moltin Lane",
                    "address_2": "",
                    "city": "Moltinland",
                    "county": "Moltin",
                    "postcode": "M01T",
                    "country": {
                        "value": "United Kingdom",
                        "data": {
                            "code": "GB",
                            "name": "United Kingdom"
                        }
                    },
                    "customer": {
                        "value": "Chris",
                        "data": {
                            "id": "111",
                            "first_name": "Chris",
                            "last_name": "Harvey",
                            "email": "chris@molt.in",
                            "group": null,
                            "created_at": "",
                            "updated_at": ""
                        }
                    },
                    "company": "",
                    "phone": "123456778",
                    "created_at": "",
                    "updated_at": ""
                }
            },
            "bill_to": {
                "value": "",
                "data": {
                    "id": "112",
                    "save_as": "",
                    "first_name": "Chris",
                    "last_name": "Harvey",
                    "email": "chris@molt.in",
                    "address_1": "55 Moltin Lane",
                    "address_2": "",
                    "city": "Moltinland",
                    "county": "Moltin",
                    "postcode": "M01T",
                    "country": {
                        "value": "United Kingdom",
                        "data": {
                            "code": "GB",
                            "name": "United Kingdom"
                        }
                    },
                    "customer": {
                        "value": "Chris",
                        "data": {
                            "id": "111",
                            "first_name": "Chris",
                            "last_name": "Harvey",
                            "email": "chris@molt.in",
                            "group": null,
                            "created_at": "",
                            "updated_at": ""
                        }
                    },
                    "company": "",
                    "phone": "123456778",
                    "created_at": "",
                    "updated_at": ""
                }
            },
            "shipping": null,
            "created_at": "2014-05-08 11:11:44",
            "updated_at": "2014-05-08 11:13:55"
        }
    }
}

Example Failed Response


{
   "status": false,
   "error": "The number parameter is required"
}

Tax

Resource Description
Update single tax band Updates a tax band with the given ID
Update multiple tax bands Mass updates currency tax rates
Create new tax band Creates a new tax band
Get single tax band by criteria Gets a tax band based on the given criteria
Delete tax band by ID Deletes a tax band with a given ID
Get multiple tax bands by criteria Gets an array of tax bands
Get tax band by ID Returns a tax band of the given ID

Update single tax band

This call edits a tax band with a given ID. There are no minumum required paramaters and only those differing from current values will be updated, as such you can pass all or one of the fields and there will be no difference.

Resource URL

PUT https://api.molt.in/beta/tax/:id

Paramaters

Key Type Description
titleoptional String The title of this tax band
descriptionoptional String A short description of this tax band
rateoptional Decimal The default tax rate (can be changed on a per-currency basis)

Example Successful Response


{
  "status": true,
  "result": {
    "id": 8,
    "title": "My awesome tax band",
    "description": "No... Awesome products are exempt from taxes!",
    "rate": "0.00",
    "currencies": [
      {
        "id": 7,
        "code": "GBP",
        "title": "British Pound",
        "enabled": true,
        "modifier": "*3",
        "exchange_rate": "1.00",
        "format": "£{price}",
        "decimal_point": ".",
        "thousand_point": ",",
        "rounding": "full",
        "default": false,
        "rate": "0.00"
      },
      {
        "id": 9,
        "code": "EUR",
        "title": "Euro",
        "enabled": false,
        "modifier": "*0",
        "exchange_rate": "1.20",
        "format": "€{price}",
        "decimal_point": ",",
        "thousand_point": ",",
        "rounding": null,
        "default": false,
        "rate": "0.00"
      },
      {
        "id": 17,
        "code": "USD",
        "title": "US Dollar",
        "enabled": true,
        "modifier": "+0",
        "exchange_rate": null,
        "format": "${price}",
        "decimal_point": ".",
        "thousand_point": ",",
        "rounding": null,
        "default": false,
        "rate": "0.00"
      }
    ]
  }
}

Example Failed Response


{
  "status": false,
  "errors": [
    "The rate must be a number."
  ]
}

Update multiple tax bands

This endpoint mass updates the currency tax rates.

Resource URL

PUT https://api.molt.in/beta/taxes

Paramaters

Key Type Description
fields[:currencyId][:taxId] Decimal The tax rate (percentage) for this tax band in this currency

Example Successful Response


{
  "status": true,
  "message": "Tax rates have been updated successfully"
}

Example Failed Response


{
  "status": false,
  "errors": [
    "'99' is not a valid tax band"
  ]
}

Create new tax band

This call creates a new tax band with the POST data provided. If there are any problems with the creation these will be returned in an errors array listing all validation problems, otherwise the new tax band will be returned.

Resource URL

POST https://api.molt.in/beta/tax

Paramaters

Key Type Description
title String The title of this tax band
descriptionoptional String A short description of this tax band
rate Decimal The default tax rate (can be changed on a per-currency basis)

Example Successful Response


{
  "status": true,
  "result": {
    "id": 8,
    "title": "My awesome tax band",
    "description": "Awesome products are charged tax at 99% right?...",
    "rate": "99.00",
    "currencies": [
      {
        "id": 7,
        "code": "GBP",
        "title": "British Pound",
        "enabled": true,
        "modifier": "*3",
        "exchange_rate": "1.00",
        "format": "£{price}",
        "decimal_point": ".",
        "thousand_point": ",",
        "rounding": "full",
        "default": false,
        "rate": "99.00"
      },
      {
        "id": 9,
        "code": "EUR",
        "title": "Euro",
        "enabled": false,
        "modifier": "*0",
        "exchange_rate": "1.20",
        "format": "€{price}",
        "decimal_point": ",",
        "thousand_point": ",",
        "rounding": null,
        "default": false,
        "rate": "99.00"
      },
      {
        "id": 17,
        "code": "USD",
        "title": "US Dollar",
        "enabled": true,
        "modifier": "+0",
        "exchange_rate": null,
        "format": "${price}",
        "decimal_point": ".",
        "thousand_point": ",",
        "rounding": null,
        "default": false,
        "rate": "99.00"
      }
    ]
  }
}

Example Empty Response


{
  "status": false,
  "errors": [
    "The title field is required.",
    "The rate field is required."
  ]
}

Get single tax band by criteria

Returns a tax band based on a given set of key-value properties. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

https://api.molt.in/beta/tax

Paramaters

Key Type Description
idoptional Integer Select by ID
titleoptional String Select by tax band title
descriptionoptional String Select by tax band description
rateoptional Decimal The tax rate (percentage)

Example Successful Response


{
  "status": true,
  "result": {
    "id": 1,
    "store_id": 1,
    "title": "Default",
    "description": null,
    "rate": "20.00",
    "currencies": [
      {
        "id": 7,
        "code": "GBP",
        "title": "British Pound",
        "enabled": true,
        "modifier": "*3",
        "exchange_rate": "1.00",
        "format": "£{price}",
        "decimal_point": ".",
        "thousand_point": ",",
        "rounding": "full",
        "default": false,
        "rate": "20.00"
      },
      {
        "id": 9,
        "code": "EUR",
        "title": "Euro",
        "enabled": false,
        "modifier": "*0",
        "exchange_rate": "1.20",
        "format": "€{price}",
        "decimal_point": ",",
        "thousand_point": ",",
        "rounding": null,
        "default": false,
        "rate": "20.00"
      },
      {
        "id": 17,
        "code": "USD",
        "title": "US Dollar",
        "enabled": true,
        "modifier": "+0",
        "exchange_rate": null,
        "format": "${price}",
        "decimal_point": ".",
        "thousand_point": ",",
        "rounding": null,
        "default": false,
        "rate": "20.00"
      }
    ]
  }
}

Example Empty Response


{
  "status": true,
  "result": []
}

Delete tax band by ID

This call deletes a tax band with a given ID.

Resource URL

DELETE https://api.molt.in/beta/tax/:id

Paramaters

None required

Example Successful Response


{
  "status": true,
  "message": "Tax band deleted successfully"
}

Example Invalid ID Response


{
  "status": false,
  "message": "No tax found"
}

Get multiple tax bands by criteria

Returns a range of tax bands based on a given set of paramaters. All choices and relaionships will be converted to their appropriate data values to reduce the number of extra calls required.

Resource URL

GET https://api.molt.in/beta/taxes

Paramaters

Key Type Description
limitoptional Integer The number of tax bands to return, defaults to all
offsetoptional Integer The first tax band to be shown, used for pagination

Example Successful Response


{
  "status": true,
  "result": [
    {
      "id": 1,
      "title": "Default",
      "description": null,
      "rate": "20.00",
      "currencies": [
        {
          "id": 7,
          "code": "GBP",
          "title": "British Pound",
          "enabled": true,
          "modifier": "*3",
          "exchange_rate": "1.00",
          "format": "£{price}",
          "decimal_point": ".",
          "thousand_point": ",",
          "rounding": "full",
          "default": false,
          "rate": "20.00"
        },
        {
          "id": 9,
          "code": "EUR",
          "title": "Euro",
          "enabled": false,
          "modifier": "*0",
          "exchange_rate": "1.20",
          "format": "€{price}",
          "decimal_point": ",",
          "thousand_point": ",",
          "rounding": null,
          "default": false,
          "rate": "20.00"
        },
        {
          "id": 17,
          "code": "USD",
          "title": "US Dollar",
          "enabled": true,
          "modifier": "+0",
          "exchange_rate": null,
          "format": "${price}",
          "decimal_point": ".",
          "thousand_point": ",",
          "rounding": null,
          "default": false,
          "rate": "20.00"
        }
      ]
    },
    {
      "id": 3,
      "title": "Tax Band 2",
      "description": "Test",
      "rate": "20.00",
      "currencies": [
        {
          "id": 7,
          "code": "GBP",
          "title": "British Pound",
          "enabled": true,
          "modifier": "*3",
          "exchange_rate": "1.00",
          "format": "£{price}",
          "decimal_point": ".",
          "thousand_point": ",",
          "rounding": "full",
          "default": false,
          "rate": "20.00"
        },
        {
          "id": 9,
          "code": "EUR",
          "title": "Euro",
          "enabled": false,
          "modifier": "*0",
          "exchange_rate": "1.20",
          "format": "€{price}",
          "decimal_point": ",",
          "thousand_point": ",",
          "rounding": null,
          "default": false,
          "rate": "20.00"
        },
        {
          "id": 17,
          "code": "USD",
          "title": "US Dollar",
          "enabled": true,
          "modifier": "+0",
          "exchange_rate": null,
          "format": "${price}",
          "decimal_point": ".",
          "thousand_point": ",",
          "rounding": null,
          "default": false,
          "rate": "20.00"
        }
      ]
    }
  ]
}

Example Empty Response


{
  "status": true,
  "result": [],
  "pagination": {
    "total": 0,
    "current": 0,
    "limit": 10,
    "offset": 0,
    "from": 1,
    "to": 0,
    "offsets": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    },
    "links": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    }
  }
}

Get tax band by ID

Returns a tax band based on a given ID. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

https://api.molt.in/beta/tax/:id

Paramaters

None required

Example Successful Response


{
  "status": true,
  "result": {
    "id": 3,
    "store_id": 1,
    "title": "Tax Band 2",
    "description": "Test",
    "rate": "20.00",
    "currencies": [
      {
        "id": 7,
        "code": "GBP",
        "title": "British Pound",
        "enabled": true,
        "modifier": "*3",
        "exchange_rate": "1.00",
        "format": "£{price}",
        "decimal_point": ".",
        "thousand_point": ",",
        "rounding": "full",
        "default": false,
        "rate": "20.00"
      },
      {
        "id": 9,
        "code": "EUR",
        "title": "Euro",
        "enabled": false,
        "modifier": "*0",
        "exchange_rate": "1.20",
        "format": "€{price}",
        "decimal_point": ",",
        "thousand_point": ",",
        "rounding": null,
        "default": false,
        "rate": "20.00"
      },
      {
        "id": 17,
        "code": "USD",
        "title": "US Dollar",
        "enabled": true,
        "modifier": "+0",
        "exchange_rate": null,
        "format": "${price}",
        "decimal_point": ".",
        "thousand_point": ",",
        "rounding": null,
        "default": false,
        "rate": "20.00"
      }
    ]
  }
}

Example Empty Response


{
  "status": false,
  "error": "Tax not found"
}

Flow

Flows is Moltin's EAV system. It allows you to easily create intellegent database structures that can be accessed via the API. A lot of Moltin's core components are built on flows which means you can customise the fields and add fields to the core components of Moltin.

Resource Description
Field Type Flow Field Types endpoints
field Flow Field endpoints
entry Flow Entry endpoints
Get all flows Gets a list of flows
Get flow by slug Get a single flow based on the specified slug
Create new flow Creates a new flow
Update a flow Updates a flow
Delete flow by slug Deletes a flow with a given slug

Field Type

Flow fields require a field type, such as "string", "integer" or "relationship". Basic validation is also performed when entries are created or updated based on the selected type for the field.

Resource Description
Get all field types Get a list of the available field types
Get single field type by slug Get a single field type

Get all field types

Returns a list of the available field types and their options.

Resource URL

GET https://api.molt.in/beta/flows/types

Paramaters

None required

Example Successful Response


TBA

Example Invalid Slug Response


{
    "status": false,
    "error": "Flow not found"
}

Get single field type by slug

Returns a single field type with its available options.

Resource URL

GET https://api.molt.in/beta/flows/type/:slug

Paramaters

None required

Example Successful Response


TBA

Example Invalid Slug Response


{
    "status": false,
    "error": "Flow not found"
}

field

Fields can be assigned to flows to state what data should be stored in a specific flow.

Resource Description
Get all fields for a flow Returns all the fields for a given flow
Get single field for a flow by slug Get a single field from a flow
Assign new field to a flow Assign a new field to a flow
Update a field in a flow by slug Update a field that already exists
Delete flow field by slug Delete a field from a flow

Get all fields for a flow

This endpoint displays all the fields for a specified slug.

Resource URL

GET https://api.molt.in/beta/flow/:slug/fields

Paramaters

None required

Example Successful Response


{
    "status": true,
    "result": {
        "title": {
            "slug": "title",
            "name": "Title",
            "type": "string",
            "options": [],
            "required": false,
            "unique": false,
            "locked": false,
            "order": null,
            "value": null
        },
        "description": {
            "slug": "description",
            "name": "Description",
            "type": "text",
            "options": [],
            "required": false,
            "unique": false,
            "locked": false,
            "order": null,
            "value": null
        }
    }
}

Example Invalid Slug Response


{
    "status": false,
    "error": "Flow not found"
}

Get single field for a flow by slug

Returns a single field from the specified flow and with the specified field slug.

Resource URL

GET https://api.molt.in/beta/flow/:slug/field/:fieldSlug

Paramaters

None required

Example Successful Response


{
    "status": true,
    "result": {
        "slug": "title",
        "name": "Title",
        "type": "string",
        "options": [],
        "required": false,
        "unique": false,
        "locked": false,
        "order": null
    }
}

Example Invalid Slug Response


{
    "status": false,
    "error": "Flow not found"
}

Assign new field to a flow

You can add new fields to any flow, including the default Moltin flows.

Resource URL

POST https://api.molt.in/beta/flow/:slug/field

Paramaters

Key Type Description
name String The name of the field
slug String The field slug
type String The type of field
optionsoptional Array The options for this field type
requiredoptional Choice (1 or 0) Is this field required?
uniqueoptional Choice (1 or 0) Should this field be unique?

Example Successful Response


{
    "status": true,
    "result": {
        "slug": "description",
        "name": "Description",
        "type": "text",
        "options": [],
        "required": false,
        "unique": false,
        "locked": false,
        "order": null
    }
}

Example Invalid Slug Response


{
    "status": false,
    "error": "Flow not found"
}

Update a field in a flow by slug

You can update fields for any field, including the default Moltin fields. However, you are restricted to updating only the field title on the default fields.

Resource URL

PUT https://api.molt.in/beta/flow/:slug/field/:fieldSlug

Paramaters

Key Type Description
nameoptional String The name of the field
slugoptional String The field slug
typeoptional String The type of field
optionsoptional Array The options for this field type
requiredoptional Choice (1 or 0) Is this field required?
uniqueoptional Choice (1 or 0) Should this field be unique?

Example Successful Response


{
    "status": true,
    "result": {
        "slug": "title",
        "name": "My updated title",
        "type": "string",
        "options": [],
        "required": false,
        "unique": false,
        "locked": false,
        "order": null
    }
}

Example Invalid Slug Response


{
    "status": false,
    "error": "Flow not found"
}

Delete flow field by slug

With this endpoint you can delete a field from a flow. You can delete any field from a flow you created, but you are limited to deleting only your own fields from default Moltin flows.

Resource URL

DELETE https://api.molt.in/beta/flow/:slug/field/:fieldSlug

Paramaters

None required

Example Successful Response


{
    "status": true,
    "message": "Field unassigned successfully"
}

Example Invalid Slug Response


{
    "status": false,
    "error": "Field not found"
}

entry

Flows entries are records.

Resource Description
Get single entry for a flow Returns a single entry based on the specified ID
Get multiple entries for a flow Returns all the entries for a given flow
Create new entry in a flow Inserts a new entry into the flow
Update an entry in a flow Updates an entry in the specified flow
Delete flow entry by ID Deletes the specified entry from the flow

Get single entry for a flow

This endpoint will return a single entry for the ID you specified.

Resource URL

GET https://api.molt.in/beta/flow/:slug/entry/:id

Paramaters

None required

Example Successful Response


{
    "status": true,
    "result":
    {
        "id": "102",
        "title": "Hello universe",
        "description": "Hello universe, how are you today?"
    }
}

Example Invalid Slug Response


{
    "status": false,
    "error": "Entry not found"
}

Get multiple entries for a flow

This endpoint displays all the entries for a specified slug.

Resource URL

GET https://api.molt.in/beta/flow/:slug/entries

Paramaters

Key Type Description
limitoptional Integer The number of flows to return
offsetoptional Integer The first flow to be shown, used for pagination

Example Successful Response




    {
       "status": true,
       "result":
       [
           {
               "id": "100",
               "title": "Hello world",
               "description": ""
           },
           {
               "id": "101",
               "title": "Hello universe",
               "description": "Hello universe, how are you today?"
           }
       ],
       "pagination":
       {
           "total": 4,
           "current": 2,
           "limit": 2,
           "offset": 0,
           "from": 1,
           "to": 2,
           "offsets":
           {
               "first": 0,
               "previous": false,
               "next": 2,
               "last": 2
           },
           "links":
           {
               "first": "https://api.molt.in/beta/flow/my-flow/entries?limit=2",
               "previous": false,
               "next": "https://api.molt.in/beta/flow/my-flow/entries?offset=2&limit=2",
               "last": "https://api.molt.in/beta/flow/my-flow/entries?offset=2&limit=2"
           }
       }
    }


Example Invalid Slug Response


{
    "status": false,
    "error": "Flow not found"
}

Create new entry in a flow

This endpoint allows you to insert an entry into the flow.

Resource URL

POST https://api.molt.in/beta/flow/:slug/entry

Paramaters

Available fields vary based on the fields in this flow

Example Successful Response


{
    "status": true,
    "result":
    {
        "id": "105",
        "title": "Hello everyone",
        "description": "This is a successful entry insertion"
    }
}

Example Invalid Slug Response


{
    "status": false,
    "errors": [
        "Title is required"
    ]
}

Update an entry in a flow

This endpoint allows you to update an entry from the specified flow.

Resource URL

PUT https://api.molt.in/beta/flow/:slug/entry/:id

Paramaters

Available fields vary based on the fields in this flow

Example Successful Response


{
    "status": true,
    "result":
    {
        "id": "105",
        "title": "Hello again",
        "description": "This is a successful entry insertion"
    }
}

Example Invalid Slug Response


{
    "status": false,
    "errors": [
        "Title is required"
    ]
}

Delete flow entry by ID

This endpoint allows you delete an entry from the flow you specify.

Resource URL

DELETE https://api.molt.in/beta/flow/:slug/entry/:id

Paramaters

None required

Example Successful Response


{
    "status": true,
    "message": "Entry deleted successfully"
}

Example Invalid Slug Response


{
    "status": false,
    "errors": [
        "Entry not found"
    ]
}

Get all flows

Returns all the flows you have created, including the default flows like products and categories.

Resource URL

GET https://api.molt.in/beta/flows

Paramaters

Key Type Description
limitoptional Integer The number of flows to return
offsetoptional Integer The first flow to be shown, used for pagination

Example Successful Response


{
    "status": true,
    "result": [
        {
            "name": "Categories",
            "slug": "categories",
            "info": "Category data",
            "title_column": "title"
        },
        {
            "name": "Customers",
            "slug": "customers",
            "info": "Customer data",
            "title_column": "first_name"
        },
        {
            "name": "Addresses",
            "slug": "addresses",
            "info": "Customer addresses",
            "title_column": "save_as"
        },
        {
            "name": "Products",
            "slug": "products",
            "info": "Product data",
            "title_column": "tax_band"
        },
        {
            "name": "Orders",
            "slug": "orders",
            "info": "Orders",
            "title_column": null
        },
        {
            "name": "Order Items",
            "slug": "order_items",
            "info": "Order items",
            "title_column": "title"
        },
        {
            "name": "Brands",
            "slug": "brands",
            "info": "Brand data",
            "title_column": "title"
        },
        {
            "name": "Collections",
            "slug": "collections",
            "info": "Collection data",
            "title_column": "title"
        },
        {
            "name": "Shipping",
            "slug": "shipping",
            "info": "Shipping methods",
            "title_column": "title"
        },
        {
            "name": "My awesome custom flow",
            "slug": "my-awesome-custom-flow",
            "info": "Flows are awesome!",
            "title_column": "awesome_field"
        }
    ],
    "pagination": {
        "total": 10,
        "current": 10,
        "limit": 10,
        "offset": 0,
        "from": 1,
        "to": 10,
        "offsets": {
            "first": false,
            "previous": false,
            "next": false,
            "last": false
        },
        "links": {
            "first": false,
            "previous": false,
            "next": false,
            "last": false
        }
    }
}

Get flow by slug

Returns a single flow with the specified slug.

Resource URL

GET https://api.molt.in/beta/flow/:slug

Paramaters

None required

Example Successful Response


{
    "status": true,
    "result": {
        "name": "My awesome custom flow",
        "slug": "my-awesome-custom-flow",
        "info": "Flows are awesome!",
        "title_column": "awesome_field"
    }
}

Example Invalid Slug Response


{
    "status": false,
    "error": "Flow not found"
}

Create new flow

This endpoint allows you to create a new flow.

Resource URL

POST https://api.molt.in/beta/flow

Paramaters

Key Type Description
name String The name of the flow
slug String The slug of the flow (must be unique)
infooptional String A short description about the flow

Example Successful Response


{
    "status": true,
    "result": {
        "name": "My awesome custom flow",
        "slug": "my-awesome-custom-flow",
        "info": "Flows are awesome!",
        "title_column": null
    }
}

Example Failed Response


{
    "status": false,
    "errors": [
        "The name field is required.",
        "The slug field is required."
    ]
}

Update a flow

This endpoint allows you to update one of your flows. You can only update custom flows, flows created by Moltin are locked.

Resource URL

PUT https://api.molt.in/beta/flow/:slug

Paramaters

Key Type Description
nameoptional String The name of the flow
slugoptional String The slug of the flow (must be unique)
infooptional String A short description about the flow

Example Successful Response


{
    "status": true,
    "result": {
        "name": "My awesome updated custom flow",
        "slug": "my-awesome-custom-flow",
        "info": "Flows are even more awesome when they can be updated!",
        "title_column": null
    }
}

Example Failed Response


{
    "status": false,
    "errors": [
        "Slug must be unique"
    ]
}

Delete flow by slug

This endpoint deletes a flow with the specified slug. Only flows you created can be deleted, flows created by Moltin are locked.

Resource URL

DELETE https://api.molt.in/beta/flow/:id

Paramaters

None required

Example Successful Response


{
    "status": true,
    "message": "Flow deleted successfully"
}

Example Invalid Slug Response


{
    "status": false,
    "error": "Flow not found"
}

Address

Resource Description
Delete address by ID Deletes an address with the specified ID
Get address by criteria Gets an address based on the given criteria
Get address by ID Returns a customers address of the given ID
Get addresses by criteria Gets an array of addresses for a specified customer
Create new customer address Creates a new address for a specified customer
Update a customer address Updates a customers address with the given ID

Delete address by ID

This call deletes a customer's address with a given IDs. Once a customer has been deleted all orders with that address will become anonymous.

Resource URL

DELETE https://api.molt.in/beta/customer/:id/address/:id

Paramaters

N/A

Example Successful Response


{
    "status": true,
    "message": "Address deleted successfully"
}

Example Invalid ID Response


{
    "status": true,
    "message": "Address not found"
}

Get address by criteria

Returns an address based on a given set of key-value properties. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

https://api.molt.in/beta/customer/:id/address

Paramaters

Key Type Description
save_asoptional String The name the address is saved as
companyoptional String The name of the company this address belongs to
first_nameoptional String First name of the person this address belongs to
last_nameoptional String Last name of the person this address belongs to
emailoptional String The email address of the person this address belongs to
phoneoptional String The telephone number of the person this address belongs to
address_1optional String Address line 1
address_2optional String Address line 2
cityoptional String Address city
countyoptional String Address county
postcodeoptional String Address postcode
countryoptional Enumeration (ISO 3166-1-alpha-2) Address country

Example Successful Response


{
  "status": true,
  "result": {
    "id": "54",
    "save_as": "Home",
    "company": "",
    "first_name": "Cameron",
    "last_name": "Diaz",
    "email": "cameron.diaz@hotmail.com",
    "phone": "22637663429",
    "address_1": "23 Moltin Road",
    "address_2": "",
    "city": "Moltinland",
    "county": "Moltin ",
    "postcode": "M01T 1N",
    "country": {
      "code": "GB",
      "name": "United Kingdom"
    },
    "customer": {
      "id": "53",
      "first_name": "Chris",
      "last_name": "Harvey",
      "email": "chris@molt.in"
    }
  }
}

Example Empty Response


{
    "status": false,
    "error": "No address found"
}

Get address by ID

Returns a customers address based on a given ID. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

https://api.molt.in/beta/customer/:id/address/:id

Paramaters

None required

Example Successful Response


{
  "status": true,
  "result": {
    "id": "54",
    "save_as": "Home",
    "company": "",
    "first_name": "Cameron",
    "last_name": "Diaz",
    "email": "cameron.diaz@hotmail.com",
    "phone": "22637663429",
    "address_1": "23 Moltin Road",
    "address_2": "",
    "city": "Moltinland",
    "county": "Moltin ",
    "postcode": "M01T 1N",
    "country": {
      "code": "GB",
      "name": "United Kingdom"
    },
    "customer": {
      "id": "53",
      "first_name": "Chris",
      "last_name": "Harvey",
      "email": "chris@molt.in"
    }
  }
}

Example Empty Response


{
    "status": false,
    "error": "No address found"
}

Get addresses by criteria

Returns a list of addresses for a particular customer. All choices and relaionships will be converted to their appropriate data values to reduce the number of extra calls required.

Resource URL

GET https://api.molt.in/beta/customer/:id/addresses

Paramaters

None required

Example Successful Response


{
  "status": true,
  "result": [
    {
      "id": "54",
      "save_as": "Home",
      "company": "",
      "first_name": "Cameron",
      "last_name": "Diaz",
      "email": "cameron.diaz@hotmail.com",
      "phone": "22637663429",
      "address_1": "23 Moltin Road",
      "address_2": "",
      "city": "Moltinland",
      "county": "Moltin ",
      "postcode": "M01T 1N",
      "country": {
        "code": "GB",
        "name": "United Kingdom"
      },
      "customer": {
        "id": "53",
        "first_name": "Chris",
        "last_name": "Harvey",
        "email": "chris@molt.in"
      }
    }
  ],
  "pagination": {
    "total": 1,
    "current": 1,
    "limit": 10,
    "offset": 0,
    "from": 1,
    "to": 1,
    "offsets": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    },
    "links": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    }
  }
}

Example Empty Response


{
  "status": true,
  "result": [],
  "pagination": {
    "total": 0,
    "current": 0,
    "limit": 10,
    "offset": 0,
    "from": 1,
    "to": 0,
    "offsets": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    },
    "links": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    }
  }
}

Create new customer address

This endpoint creates a new address for a customer with the POST data provided. If there are any problems with the creation these will be returned in an errors array listing all validation problems, otherwise the new address will be returned.

Resource URL

POST https://api.molt.in/beta/customer/:id/address

Paramaters

Key Type Description
save_asoptional String The name the address is saved as
companyoptional String The name of the company this address belongs to
first_name String First name of the person this address belongs to
last_name String Last name of the person this address belongs to
email String The email address of the person this address belongs to
phone String The telephone number of the person this address belongs to
address_1 String Address line 1
address_2optional String Address line 2
city String Address city
county String Address county
postcode String Address postcode
country Enumeration (ISO 3166-1-alpha-2) Address country

Example Successful Response


{
  "status": true,
  "result": {
    "id": "55",
    "save_as": "Home",
    "company": "",
    "first_name": "John",
    "last_name": "Moltin",
    "email": "john@molt.in",
    "phone": "1234567890",
    "address_1": "24 Moltin Road",
    "address_2": "",
    "city": "Moltinland",
    "county": "Moltin",
    "postcode": "M01T 1N",
    "country": {
      "code": "GB",
      "name": "United Kingdom"
    },
    "customer": {
      "id": "53",
      "first_name": "Chris",
      "last_name": "Harvey",
      "email": "chris@molt.in"
    }
  }
}

Example Failed Response


{
  "status": false,
  "errors": [
    "First Name is required",
    "Last Name is required",
    "Email Address is required",
    "Phone is required",
    "Address Line 1 is required",
    "City is required",
    "County is required",
    "Postcode is required",
    "Country is required"
  ]
}

Update a customer address

This endpoint edits a customers address with a given ID. There are no minumum required paramaters and only those differing from current values will be updated, as such you can pass all or one of the fields and there will be no difference.

Resource URL

PUT https://api.molt.in/beta/customer/:id/address/:id

Paramaters

Key Type Description
save_asoptional String The name the address is saved as
companyoptional String The name of the company this address belongs to
first_nameoptional String First name of the person this address belongs to
last_nameoptional String Last name of the person this address belongs to
emailoptional String The email address of the person this address belongs to
phoneoptional String The telephone number of the person this address belongs to
address_1optional String Address line 1
address_2optional String Address line 2
cityoptional String Address city
countyoptional String Address county
postcodeoptional String Address postcode
countryoptional Enumeration (ISO 3166-1-alpha-2) Address country

Example Successful Response


{
  "status": true,
  "result": {
    "id": "55",
    "save_as": "Home",
    "company": "",
    "first_name": "John",
    "last_name": "Moltin",
    "email": "john@molt.in",
    "phone": "1234567890",
    "address_1": "24 Moltin Road",
    "address_2": "",
    "city": "Moltinland",
    "county": "Moltin",
    "postcode": "M01T 1N",
    "country": {
      "code": "US",
      "name": "United States"
    },
    "customer": {
      "id": "53",
      "first_name": "Chris",
      "last_name": "Harvey",
      "email": "chris@molt.in"
    }
  }
}

Example Failed Response


{
  "status": false,
  "errors": [
    "'MOLTIN' is not a valid country"
  ]
}

Brand

Resource Description
Delete brand by ID Deletes a brand with the specified ID
Get single brand by criteria Gets a brand based on the given criteria
Get brand by ID Returns a brand of the given ID
Get multiple brands by criteria Gets an array of brands based on the given criteria
Create new brand Creates a new brand
Update a brand Updates a brand with the given ID

Delete brand by ID

This call deletes a brand with a given ID. Once a brand has been deleted all products will lose that brand.

Resource URL

DELETE https://api.molt.in/beta/brand/:id

Paramaters

N/A

Example Successful Response


{
    "status": true,
    "message": "Brand deleted successfully"
}

Example Invalid ID Response


{
    "status": true,
    "message": "Brand not found"
}

Get single brand by criteria

Returns a brand based on a given set of key-value properties. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

https://api.molt.in/beta/brand

Paramaters

Key Type Description
idoptional Integer Select by ID
titleoptional String Select by Title
slugoptional String Select by Slug
statusoptional Choice (1 or 0) Select by Status

Example Successful Response


{
  "status": true,
  "result": {
    "id": "98",
    "title": "Example Brand",
    "slug": "example-brand",
    "status":
    {
      "key": "1",
      "value": "Live"
    },
    "description": "Example brand description"
  }
}

Example Empty Response


{
    "status": false,
    "error": "No brand found"
}

Get brand by ID

Returns a brand based on a given ID. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

https://api.molt.in/beta/brand/:id

Paramaters

None required

Example Successful Response


{
  "status": true,
  "result": {
    "id": "98",
    "title": "Example Brand",
    "slug": "example-brand",
    "status":
    {
      "key": "1",
      "value": "Live"
    },
    "description": "Example brand description"
  }
}

Example Empty Response


{
    "status": false,
    "error": "No brand found"
}

Get multiple brands by criteria

Returns a list of brands based on the given criteria. All choices and relaionships will be converted to their appropriate data values to reduce the number of extra calls required.

Resource URL

GET https://api.molt.in/beta/brands

Paramaters

None required

Example Successful Response


{
  "status": true,
  "result": [
    {
      "id": "98",
      "title": "Example Brand",
      "slug": "example-brand",
      "status":
      {
        "key": "1",
        "value": "Live"
      },
      "description": "Example brand description"
    }
  ],
  "pagination": {
    "total": 1,
    "current": 1,
    "limit": 10,
    "offset": 0,
    "from": 1,
    "to": 1,
    "offsets": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    },
    "links": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    }
  }
}

Example Empty Response


{
  "status": true,
  "result": [],
  "pagination": {
    "total": 0,
    "current": 0,
    "limit": 10,
    "offset": 0,
    "from": 1,
    "to": 0,
    "offsets": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    },
    "links": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    }
  }
}

Create new brand

This endpoint creates a new brand with the POST data provided. If there are any problems with the creation these will be returned in an errors array listing all validation problems, otherwise the new brand will be returned.

Resource URL

POST https://api.molt.in/beta/brand

Paramaters

Key Type Description
title String The Title of the brand, must be unique
slug String The Slug/URI of the brand, must be unique
status Choice (1 or 0) Is the brand Live or a Draft
description String The Description of the brand

Example Successful Response


{
  "status": true,
  "result": {
    "id": "98",
    "title": "Example Brand",
    "slug": "example-brand",
    "status":
    {
      "key": "1",
      "value": "Live"
    },
    "description": "Example brand description"
  }
}

Example Failed Response


{
  "status": false,
  "errors": [
    "Title is required",
    "Slug must be unique"
  ]
}

Update a brand

This endpoint edits a brand with a given ID. There are no minumum required paramaters and only those differing from current values will be updated, as such you can pass all or one of the fields and there will be no difference.

Resource URL

PUT https://api.molt.in/beta/brand/:id

Paramaters

Key Type Description
titleoptional String The Title of the brand, must be unique
slugoptional String The Slug/URI of the brand, must be unique
statusoptional Choice (1 or 0) Is the brand Live or a Draft
descriptionoptional String The Description of the brand

Example Successful Response


{
  "status": true,
  "result": {
    "id": "98",
    "title": "Example Brand",
    "slug": "example-brand",
    "status":
    {
      "key": "1",
      "value": "Live"
    },
    "description": "Example brand description"
  }
}

Example Failed Response


{
  "status": false,
  "errors": [
    "Slug must be unqiue"
  ]
}

Collection

Resource Description
Delete collection by ID Deletes a collection with the specified ID
Get single collection by criteria Gets a collection based on the given criteria
Get collection by ID Returns a collection of the given ID
Get multiple collections by criteria Gets an array of collections based on the given criteria
Create new collection Creates a new collection
Update existing collection Updates a collection with the given ID

Delete collection by ID

This call deletes a collection with a given ID. Once a collection has been deleted all products will lose that collection.

Resource URL

DELETE https://api.molt.in/beta/collection/:id

Paramaters

N/A

Example Successful Response


{
    "status": true,
    "message": "Collection deleted successfully"
}

Example Invalid ID Response


{
    "status": true,
    "message": "Collection not found"
}

Get single collection by criteria

Returns a collection based on a given set of key-value properties. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

https://api.molt.in/beta/collection

Paramaters

Key Type Description
idoptional Integer Select by ID
titleoptional String Select by Title
slugoptional String Select by Slug
statusoptional Choice (1 or 0) Select by Status

Example Successful Response


{
  "status": true,
  "result": {
    "id": "100",
    "title": "Example Collection",
    "slug": "example-collection",
    "status":
    {
      "key": "1",
      "value": "Live"
    },
    "description": "Example collection description"
  }
}

Example Empty Response


{
    "status": false,
    "error": "No collection found"
}

Get collection by ID

Returns a collection based on a given ID. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

https://api.molt.in/beta/collection/:id

Paramaters

None required

Example Successful Response


{
  "status": true,
  "result": {
    "id": "100",
    "title": "Example Collection",
    "slug": "example-collection",
    "status":
    {
      "key": "1",
      "value": "Live"
    },
    "description": "Example collection description"
  }
}

Example Empty Response


{
    "status": false,
    "error": "No collection found"
}

Get multiple collections by criteria

Returns a list of collections based on the given criteria. All choices and relaionships will be converted to their appropriate data values to reduce the number of extra calls required.

Resource URL

GET https://api.molt.in/beta/collections

Paramaters

None required

Example Successful Response


{
  "status": true,
  "result": [
    {
      "id": "100",
      "title": "Example Collection",
      "slug": "example-collection",
      "status":
      {
        "key": "1",
        "value": "Live"
      },
      "description": "Example collection description"
    }
  ],
  "pagination": {
    "total": 1,
    "current": 1,
    "limit": 10,
    "offset": 0,
    "from": 1,
    "to": 1,
    "offsets": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    },
    "links": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    }
  }
}

Example Empty Response


{
  "status": true,
  "result": [],
  "pagination": {
    "total": 0,
    "current": 0,
    "limit": 10,
    "offset": 0,
    "from": 1,
    "to": 0,
    "offsets": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    },
    "links": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    }
  }
}

Create new collection

This endpoint creates a new collection with the POST data provided. If there are any problems with the creation these will be returned in an errors array listing all validation problems, otherwise the new collection will be returned.

Resource URL

POST https://api.molt.in/beta/collection

Paramaters

Key Type Description
title String The Title of the collection, must be unique
slug String The Slug/URI of the collection, must be unique
status Choice (1 or 0) Is the collection Live or a Draft
description String The Description of the collection

Example Successful Response


{
  "status": true,
  "result": {
    "id": "100",
    "title": "Example Collection",
    "slug": "example-collection",
    "status":
    {
      "key": "1",
      "value": "Live"
    },
    "description": "Example collection description"
  }
}

Example Failed Response


{
  "status": false,
  "errors": [
    "Title is required",
    "Slug must be unique"
  ]
}

Update existing collection

This endpoint edits a collection with a given ID. There are no minumum required paramaters and only those differing from current values will be updated, as such you can pass all or one of the fields and there will be no difference.

Resource URL

PUT https://api.molt.in/beta/collection/:id

Paramaters

Key Type Description
titleoptional String The Title of the collection, must be unique
slugoptional String The Slug/URI of the collection, must be unique
statusoptional Choice (1 or 0) Is the collection Live or a Draft
descriptionoptional String The Description of the collection

Example Successful Response


{
  "status": true,
  "result": {
    "id": "100",
    "title": "Example Collection",
    "slug": "example-collection",
    "status":
    {
      "key": "1",
      "value": "Live"
    },
    "description": "Example collection description"
  }
}

Example Failed Response


{
  "status": false,
  "errors": [
    "Slug must be unqiue"
  ]
}

Currency

Resource Description
Delete currency by ID Deletes a currency with a given ID
Get multiple currencies by criteria Gets an array of currencies
Get single currency by criteria Gets a currency based on the given criteria
Get currency by ID Returns a currency of the given ID
Create new currency Creates a new currency
Update a currency Updates a currency with the given ID

Delete currency by ID

This call deletes a currency with the specified id.

Resource URL

DELETE https://api.molt.in/beta/currency/:id

Paramaters

None required

Example Successful Response


{
  "status": true,
  "message": "Currency deleted successfully"
}

Example Invalid ID Response


{
  "status": false,
  "error": "Currency not found"
}

Get multiple currencies by criteria

Returns a list of currencies that have been setup. All choices and relaionships will be converted to their appropriate data values to reduce the number of extra calls required.

Resource URL

GET https://api.molt.in/beta/currencies

Paramaters

None required

Example Successful Response


{
  "status": true,
  "result": [
    {
      "id": 7,
      "code": "GBP",
      "title": "British Pound",
      "enabled": true,
      "modifier": "*3",
      "exchange_rate": "1.00",
      "format": "£{price}",
      "decimal_point": ".",
      "thousand_point": ",",
      "rounding": "full",
      "default": false
    },
    {
      "id": 8,
      "code": "USD",
      "title": "US Dollar",
      "enabled": false,
      "modifier": "+1",
      "exchange_rate": "2.00",
      "format": "${price}",
      "decimal_point": ".",
      "thousand_point": ",",
      "rounding": "full",
      "default": false
    },
    {
      "id": 9,
      "code": "EUR",
      "title": "Euro",
      "enabled": false,
      "modifier": "*0",
      "exchange_rate": "1.20",
      "format": "€{price}",
      "decimal_point": ",",
      "thousand_point": ",",
      "rounding": null,
      "default": false
    }
  ]
}

Example Empty Response


{
  "status": true,
  "result": [],
  "pagination": {
    "total": 0,
    "current": 0,
    "limit": 10,
    "offset": 0,
    "from": 1,
    "to": 0,
    "offsets": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    },
    "links": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    }
  }
}

Get single currency by criteria

Returns a currency based on a given set of key-value properties. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

https://api.molt.in/beta/currency

Paramaters

Key Type Description
codeoptional String The currency code (i.e. GBP)
titleoptional String The currency title
enabledoptional Boolean Enabled or Disabled? 1 or 0
modifieroptional String The currency modifier (i.e. +1)
exchange_rateoptional Float The exchange rate
formatoptional String The currency format (i.e. £{price})
decimal_pointoptional String The decimal point symbol
thousand_pointoptional String The thousand separator symbol
roundingoptional Enumeration (50, 99, full) The currency rounding (i.e. 50, 99, full)
defaultoptional Boolean Is this the default currency? 1 or 0

Example Successful Response


{
  "status": true,
  "result": {
    "id": 7,
    "code": "GBP",
    "title": "British Pound",
    "enabled": true,
    "modifier": "*3",
    "exchange_rate": "1.00",
    "format": "£{price}",
    "decimal_point": ".",
    "thousand_point": ",",
    "rounding": "full",
    "default": false
  }
}

Example Failed Response


{
    "status": false,
    "error": "No currency found"
}

Get currency by ID

Returns a currency based on a given ID. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

https://api.molt.in/beta/currency/:id

Paramaters

None required

Example Successful Response


{
  "status": true,
  "result": {
    "id": 7,
    "code": "GBP",
    "title": "British Pound",
    "enabled": true,
    "modifier": "*3",
    "exchange_rate": "1.00",
    "format": "£{price}",
    "decimal_point": ".",
    "thousand_point": ",",
    "rounding": "full",
    "default": false
  }
}

Example Empty Response


{
  "status": false,
  "error": "Currency not found"
}

Create new currency

This call creates a new currency with the POST data provided. If there are any problems with the creation these will be returned in an errors array listing all validation problems, otherwise the new currency will be returned.

Resource URL

POST https://api.molt.in/beta/cateogry

Paramaters

Key Type Description
code String The currency code (i.e. GBP)
title String The currency title
enabled Boolean Enabled or Disabled? 1 or 0
modifieroptional String The currency modifier (i.e. +1)
exchange_rateoptional Float The exchange rate
formatoptional String The currency format (i.e. £{price})
decimal_pointoptional String The decimal point symbol
thousand_pointoptional String The thousand separator symbol
roundingoptional Enumeration (50, 99, full) The currency rounding (i.e. 50, 99, full)
defaultoptional Bollean Is this the default currency? 1 or 0

Example Successful Response


{
  "status": true,
  "result": {
    "id": 17,
    "store_id": 1,
    "code": "USD",
    "title": "US Dollar",
    "enabled": true,
    "modifier": "+0",
    "exchange_rate": null,
    "format": "${price}",
    "decimal_point": ".",
    "thousand_point": ",",
    "rounding": null,
    "default": false
  }
}

Example Empty Response


{
  "status": false,
  "errors": [
    "The code has already been taken."
  ]
}

Update a currency

This call edits a currency with a given ID. There are no minumum required paramaters and only those differing from current values will be updated, as such you can pass all or one of the fields and there will be no difference.

Resource URL

PUT https://api.molt.in/beta/cateogry

Paramaters

Key Type Description
codeoptional String The currency code (i.e. GBP)
titleoptional String The currency title
enabledoptional Boolean Enabled or Disabled? 1 or 0
modifieroptional String The currency modifier (i.e. +1)
exchange_rateoptional Float The exchange rate
formatoptional String The currency format (i.e. £{price})
decimal_pointoptional String The decimal point symbol
thousand_pointoptional String The thousand separator symbol
roundingoptional Enumeration (50, 99, full) The currency rounding (i.e. 50, 99, full)
defaultoptional Bollean Is this the default currency? 1 or 0

Example Successful Response


{
  "status": true,
  "result": {
    "id": 17,
    "store_id": 1,
    "code": "USD",
    "title": "US Dollar",
    "enabled": true,
    "modifier": "+0",
    "exchange_rate": null,
    "format": "${price}",
    "decimal_point": ".",
    "thousand_point": ",",
    "rounding": null,
    "default": false
  }
}

Example Empty Response


{
  "status": false,
  "errors": [
    "The code has already been taken."
  ]
}

Customer

Resource Description
Delete customer by ID Deletes a customer with a given ID
Get single customer by criteria Gets a customer based on the given criteria
Get customer by ID Returns a customer of the given ID
Get multiple customers by criteria Gets an array of customers
Create new customer Creates a new customer
Update a customer Updates a customer with the given ID

Delete customer by ID

This method deletes a customer with a given ID. Once a customer has been deleted all orders and addresses for that customer will become anonymous. Addresses which have not been used in an order will be permanently deleted.

Resource URL

DELETE https://api.molt.in/beta/customer/:id

Paramaters

None required

Example Successful Response


{
    "status": true,
    "message": "Customer deleted successfully"
}

Example Invalid ID Response


{
    "status": false,
    "message": "Customer not found"
}

Get single customer by criteria

Returns a customer based on a given set of key-value properties. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

https://api.molt.in/beta/customer

Paramaters

Key Type Description
idoptional Integer Select by ID
first_nameoptional String Select by first name
last_nameoptional String Select by last name
emailoptional String Select by email

Example Successful Response


{
  "status": true,
  "result": {
    "id": "63",
    "first_name": "Adam",
    "last_name": "Sturrock",
    "email": "adam@molt.in",
    "history": {
      "orders": 94,
      "value": "264.00"
    }
  }
}

Example Empty Response


{
    "status": false,
    "error": "No customer found"
}

Get customer by ID

Returns a customer based on a given ID. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

https://api.molt.in/beta/customer/:id

Paramaters

None required

Example Successful Response


{
  "status": true,
  "result": {
    "id": "53",
    "first_name": "Chris",
    "last_name": "Harvey",
    "email": "chris@molt.in",
    "history": {
      "orders": 98,
      "value": "3,003.00"
    }
  }
}

Example Empty Response


{
    "status": false,
    "error": "No customer found"
}

Get multiple customers by criteria

Returns a range of customers based on a given set of paramaters. All choices and relaionships will be converted to their appropriate data values to reduce the number of extra calls required.

Resource URL

GET https://api.molt.in/beta/customers

Paramaters

Key Type Description
limitoptional Integer The number of customers to return, defaults to all
offsetoptional Integer The first customer to be shown, used for pagination

Example Successful Response


{
  "status": true,
  "result": [
    {
      "id": "63",
      "first_name": "Adam",
      "last_name": "Sturrock",
      "email": "adam@molt.in",
      "history": {
        "orders": 22,
        "value": "609.00"
      }
    },
    {
      "id": "53",
      "first_name": "Chris",
      "last_name": "Harvey",
      "email": "chris@molt.in",
      "history": {
        "orders": 85,
        "value": "1,480.00"
      }
    },
    {
      "id": "65",
      "first_name": "Jamie",
      "last_name": "Holdroyd",
      "email": "jamie@molt.in",
      "history": {
        "orders": 48,
        "value": "1,601.00"
      }
    }
  ],
  "pagination": {
    "total": 3,
    "current": 3,
    "limit": 10,
    "offset": 0,
    "from": 1,
    "to": 3,
    "offsets": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    },
    "links": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    }
  }
}

Example Empty Response


{
  "status": true,
  "result": [],
  "pagination": {
    "total": 0,
    "current": 0,
    "limit": 10,
    "offset": 0,
    "from": 1,
    "to": 0,
    "offsets": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    },
    "links": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    }
  }
}

Create new customer

This endpoint creates a new customer with the POST data provided. If there are any problems with the creation these will be returned in an errors array listing all validation problems, otherwise the new customer will be returned.

Resource URL

POST https://api.molt.in/beta/customer

Paramaters

Key Type Description
first_name String The customer's first name
last_name String The customer's last name
email String The customer's email

Example Successful Response


{
  "status": true,
  "result": {
    "id": "142",
    "first_name": "John",
    "last_name": "Moltin",
    "email": "john@molt.in",
    "history": {
      "orders": 0,
      "value": 0
    }
  }
}

Example Failed Response


{
  "status": false,
  "errors": [
    "Last Name is required",
    "Email Address is required"
  ]
}

Update a customer

This call edits a customer with a given ID. There are no minumum required paramaters and only those differing from current values will be updated, as such you can pass all or one of the fields and there will be no difference.

Resource URL

PUT https://api.molt.in/beta/customer/:id

Paramaters

Key Type Description
first_nameoptional String The customer's first name
last_nameoptional String The customer's last name
emailoptional String The customer's email

Example Successful Response


{
  "status": true,
  "result": {
    "id": "142",
    "first_name": "John",
    "last_name": "Moltin",
    "email": "john@example.com",
    "history": {
      "orders": 0,
      "value": 0
    }
  }
}

Example Failed Response


{
  "status": false,
  "errors": [
    "'johnatexample.com' is not a valid email address"
  ]
}

Gateway

Resource Description
Disable gateway Returns a gateway of the given slug
Enable gateway Returns a gateway of the given slug
Get disabled gateways Gets an array of disabled gateways
Get enabled gateways Gets an array of enabled gateways
Get gateway by slug Returns a gateway of the given slug
Get all gateways Gets an array of gateways
Update a gateway Updates a gateway with the given slug

Disable gateway

Disables a gateway based on a given slug.

Resource URL

GET https://api.molt.in/beta/gateway/:slug/disable

Paramaters

None required

Example Successful Response


{
  "status": true,
  "message": "Gateway disabled successfully"
}

Example Empty Response


{
  "status": false,
  "error": "Gateway not found"
}

Enable gateway

Enables a gateway based on a given slug.

Resource URL

GET https://api.molt.in/beta/gateway/:slug/enable

Paramaters

None required

Example Successful Response


{
  "status": true,
  "message": "Gateway enabled successfully"
}

Example Empty Response


{
  "status": false,
  "error": "Gateway not found"
}

Get disabled gateways

Returns all disabled gateways

Resource URL

GET https://api.molt.in/beta/gateways/disabled

Paramaters

None required

Example Successful Response


{
  "status": true,
  "result": [
   {
      "name": "2Checkout",
      "slug": "2checkout",
      "description": null,
      "enabled": false,
      "settings": {
         "accountNumber": "",
         "secretWord": "",
         "testMode": false
      }
   },
   {
      "name": "Alipay Express",
      "slug": "alipay-express",
      "description": null,
      "enabled": false,
      "settings": {
         "partner": "",
         "key": "",
         "signType": "MD5",
         "inputCharset": "utf-8",
         "transport": "http"
      }
   },
   {
      "name": "Alipay Secured",
      "slug": "alipay-secured",
      "description": null,
      "enabled": false,
      "settings": {
         "partner": "",
         "key": "",
         "signType": "MD5",
         "inputCharset": "utf-8",
         "transport": "http"
      }
   },
   {
      "name": "AliPay Dual Func",
      "slug": "alipay-dual",
      "description": null,
      "enabled": false,
      "settings": {
         "partner": "",
         "key": "",
         "signType": "MD5",
         "inputCharset": "utf-8",
         "transport": "http"
      }
   },
   {
      "name": "Alipay Wap Express",
      "slug": "alipay-wapexpress",
      "description": null,
      "enabled": false,
      "settings": {
         "partner": "",
         "key": "",
         "signType": "MD5",
         "inputCharset": "utf-8"
      }
   },
   {
      "name": "Alipay Mobile Express",
      "slug": "alipay-mobileexpress",
      "description": null,
      "enabled": false,
      "settings": {
         "partner": "",
         "key": "",
         "signType": "MD5",
         "inputCharset": "utf-8",
         "transport": "http"
      }
   },
   {
      "name": "Alipay Bank",
      "slug": "alipay-bank",
      "description": null,
      "enabled": false,
      "settings": {
         "partner": "",
         "key": "",
         "signType": "MD5",
         "inputCharset": "utf-8",
         "transport": "http"
      }
   },
   {
      "name": "Authorize.Net AIM",
      "slug": "authorize-net-aim",
      "description": null,
      "enabled": false,
      "settings": {
         "apiLoginId": "",
         "transactionKey": "",
         "testMode": false,
         "developerMode": false
      }
   },
   {
      "name": "Authorize.Net SIM",
      "slug": "authorize-net-sim",
      "description": null,
      "enabled": false,
      "settings": {
         "apiLoginId": "",
         "transactionKey": "",
         "testMode": false,
         "developerMode": false,
         "hashSecret": ""
      }
   },
   {
      "name": "Buckaroo",
      "slug": "buckaroo",
      "description": null,
      "enabled": false,
      "settings": {
         "websiteKey": "",
         "secretKey": "",
         "testMode": false
      }
   },
   {
      "name": "CardSave",
      "slug": "cardsave",
      "description": null,
      "enabled": false,
      "settings": {
         "merchantId": "",
         "password": ""
      }
   },
   {
      "name": "TargetPay Directebanking",
      "slug": "directebanking",
      "description": null,
      "enabled": false,
      "settings": {
         "subAccountId": ""
      }
   },
   {
      "name": "Dummy",
      "slug": "dummy",
      "description": null,
      "enabled": false,
      "settings": [

      ]
   },
   {
      "name": "eWAY Rapid 3.0",
      "slug": "eway",
      "description": null,
      "enabled": false,
      "settings": {
         "apiKey": "",
         "password": "",
         "testMode": false
      }
   },
   {
      "name": "First Data Connect",
      "slug": "firstdata",
      "description": null,
      "enabled": false,
      "settings": {
         "storeId": "",
         "sharedSecret": "",
         "testMode": false
      }
   },
   {
      "name": "GoCardless",
      "slug": "gocardless",
      "description": null,
      "enabled": false,
      "settings": {
         "appId": "",
         "appSecret": "",
         "merchantId": "",
         "accessToken": "",
         "testMode": false
      }
   },
   {
      "name": "TargetPay iDEAL",
      "slug": "ideal",
      "description": null,
      "enabled": false,
      "settings": {
         "subAccountId": ""
      }
   },
   {
      "name": "MIGS 2-Party",
      "slug": "migs-2party",
      "description": null,
      "enabled": false,
      "settings": {
         "merchantId": "",
         "merchantAccessCode": "",
         "secureHash": ""
      }
   },
   {
      "name": "MIGS 3-Party",
      "slug": "migs-3party",
      "description": null,
      "enabled": false,
      "settings": {
         "merchantId": "",
         "merchantAccessCode": "",
         "secureHash": ""
      }
   },
   {
      "name": "Mollie",
      "slug": "mollie",
      "description": null,
      "enabled": false,
      "settings": {
         "partnerId": "",
         "testMode": false
      }
   },
   {
      "name": "TargetPay MrCash",
      "slug": "mrcash",
      "description": null,
      "enabled": false,
      "settings": {
         "subAccountId": ""
      }
   },
   {
      "name": "MultiSafepay",
      "slug": "multi-safepay",
      "description": null,
      "enabled": false,
      "settings": {
         "accountId": "",
         "siteId": "",
         "siteCode": "",
         "testMode": false
      }
   },
   {
      "name": "Netaxept",
      "slug": "netaxept",
      "description": null,
      "enabled": false,
      "settings": {
         "merchantId": "",
         "password": "",
         "testMode": false
      }
   },
   {
      "name": "NetBanx",
      "slug": "netbanx",
      "description": null,
      "enabled": false,
      "settings": {
         "accountNumber": "",
         "storeId": "",
         "storePassword": "",
         "testMode": false
      }
   },
   {
      "name": "PayFast",
      "slug": "payfast",
      "description": null,
      "enabled": false,
      "settings": {
         "merchantId": "",
         "merchantKey": "",
         "pdtKey": "",
         "testMode": false
      }
   },
   {
      "name": "Payflow",
      "slug": "payflow",
      "description": null,
      "enabled": false,
      "settings": {
         "username": "",
         "password": "",
         "vendor": "",
         "partner": "",
         "testMode": false
      }
   },
   {
      "name": "PayPal Express",
      "slug": "paypal-express",
      "description": null,
      "enabled": false,
      "settings": {
         "username": "",
         "password": "",
         "signature": "",
         "testMode": true,
         "solutionType": "Sole",
         "landingPage": "Billing",
         "headerImageUrl": ""
      }
   },
   {
      "name": "PayPal Pro",
      "slug": "paypal-pro",
      "description": null,
      "enabled": false,
      "settings": {
         "username": "",
         "password": "",
         "signature": "",
         "testMode": false
      }
   },
   {
      "name": "Pin",
      "slug": "pin",
      "description": null,
      "enabled": false,
      "settings": {
         "secretKey": "",
         "testMode": false
      }
   },
   {
      "name": "PaymentExpress PxPay",
      "slug": "px-pay",
      "description": null,
      "enabled": false,
      "settings": {
         "username": "",
         "password": ""
      }
   },
   {
      "name": "PaymentExpress PxPost",
      "slug": "px-post",
      "description": null,
      "enabled": false,
      "settings": {
         "username": "",
         "password": ""
      }
   },
   {
      "name": "Sage Pay Direct",
      "slug": "sagepay-direct",
      "description": null,
      "enabled": false,
      "settings": {
         "vendor": "",
         "testMode": false,
         "simulatorMode": false
      }
   },
   {
      "name": "Sage Pay Server",
      "slug": "sagepay-server",
      "description": null,
      "enabled": false,
      "settings": {
         "vendor": "",
         "testMode": false,
         "simulatorMode": false
      }
   },
   {
      "name": "SecurePay Direct Post",
      "slug": "securepay",
      "description": null,
      "enabled": false,
      "settings": {
         "merchantId": "",
         "transactionPassword": "",
         "testMode": false
      }
   },
   {
   {
      "name": "WorldPay",
      "slug": "worldpay",
      "description": null,
      "enabled": false,
      "settings": {
         "installationId": "",
         "secretWord": "",
         "callbackPassword": "",
         "testMode": false
      }
   }
  ]
}

Get enabled gateways

Returns all enabled gateways

Resource URL

GET https://api.molt.in/beta/gateways/enabled

Paramaters

None required

Example Successful Response


{
  "status": true,
  "result": [
   {
      "name": "Stripe",
      "slug": "stripe",
      "description": "This is my desc",
      "enabled": true,
      "settings": {
         "apiKey": "hello"
      }
   },
   {
      "name": "Manual",
      "slug": "manual",
      "description": null,
      "enabled": true,
      "settings": [
      
      ]
   }
  ]
}

Get gateway by slug

Returns a gateway based on a given slug. The gateway settings will also be returned as an array.

Resource URL

https://api.molt.in/beta/gateway/:slug

Paramaters

None required

Example Successful Response


{
  "status": true,
  "result": {
    "name": "Stripe",
    "slug": "stripe",
    "description": "Because, what other gateway would I ever need?",
    "enabled": false,
    "settings": {
      "apiKey": "my-secret-key"
    }
  }
}

Example Empty Response


{
  "status": false,
  "error": "Gateway not found"
}

Get all gateways

Returns all gateways, both enabled and disabled.

Resource URL

GET https://api.molt.in/beta/gateways

Paramaters

None required

Example Successful Response


{
  "status": true,
  "result": [
   {
      "name": "2Checkout",
      "slug": "2checkout",
      "description": null,
      "enabled": false,
      "settings": {
         "accountNumber": "",
         "secretWord": "",
         "testMode": false
      }
   },
   {
      "name": "Alipay Express",
      "slug": "alipay-express",
      "description": null,
      "enabled": false,
      "settings": {
         "partner": "",
         "key": "",
         "signType": "MD5",
         "inputCharset": "utf-8",
         "transport": "http"
      }
   },
   {
      "name": "Alipay Secured",
      "slug": "alipay-secured",
      "description": null,
      "enabled": false,
      "settings": {
         "partner": "",
         "key": "",
         "signType": "MD5",
         "inputCharset": "utf-8",
         "transport": "http"
      }
   },
   {
      "name": "AliPay Dual Func",
      "slug": "alipay-dual",
      "description": null,
      "enabled": false,
      "settings": {
         "partner": "",
         "key": "",
         "signType": "MD5",
         "inputCharset": "utf-8",
         "transport": "http"
      }
   },
   {
      "name": "Alipay Wap Express",
      "slug": "alipay-wapexpress",
      "description": null,
      "enabled": false,
      "settings": {
         "partner": "",
         "key": "",
         "signType": "MD5",
         "inputCharset": "utf-8"
      }
   },
   {
      "name": "Alipay Mobile Express",
      "slug": "alipay-mobileexpress",
      "description": null,
      "enabled": false,
      "settings": {
         "partner": "",
         "key": "",
         "signType": "MD5",
         "inputCharset": "utf-8",
         "transport": "http"
      }
   },
   {
      "name": "Alipay Bank",
      "slug": "alipay-bank",
      "description": null,
      "enabled": false,
      "settings": {
         "partner": "",
         "key": "",
         "signType": "MD5",
         "inputCharset": "utf-8",
         "transport": "http"
      }
   },
   {
      "name": "Authorize.Net AIM",
      "slug": "authorize-net-aim",
      "description": null,
      "enabled": false,
      "settings": {
         "apiLoginId": "",
         "transactionKey": "",
         "testMode": false,
         "developerMode": false
      }
   },
   {
      "name": "Authorize.Net SIM",
      "slug": "authorize-net-sim",
      "description": null,
      "enabled": false,
      "settings": {
         "apiLoginId": "",
         "transactionKey": "",
         "testMode": false,
         "developerMode": false,
         "hashSecret": ""
      }
   },
   {
      "name": "Buckaroo",
      "slug": "buckaroo",
      "description": null,
      "enabled": false,
      "settings": {
         "websiteKey": "",
         "secretKey": "",
         "testMode": false
      }
   },
   {
      "name": "CardSave",
      "slug": "cardsave",
      "description": null,
      "enabled": false,
      "settings": {
         "merchantId": "",
         "password": ""
      }
   },
   {
      "name": "TargetPay Directebanking",
      "slug": "directebanking",
      "description": null,
      "enabled": false,
      "settings": {
         "subAccountId": ""
      }
   },
   {
      "name": "Dummy",
      "slug": "dummy",
      "description": null,
      "enabled": false,
      "settings": [

      ]
   },
   {
      "name": "eWAY Rapid 3.0",
      "slug": "eway",
      "description": null,
      "enabled": false,
      "settings": {
         "apiKey": "",
         "password": "",
         "testMode": false
      }
   },
   {
      "name": "First Data Connect",
      "slug": "firstdata",
      "description": null,
      "enabled": false,
      "settings": {
         "storeId": "",
         "sharedSecret": "",
         "testMode": false
      }
   },
   {
      "name": "GoCardless",
      "slug": "gocardless",
      "description": null,
      "enabled": false,
      "settings": {
         "appId": "",
         "appSecret": "",
         "merchantId": "",
         "accessToken": "",
         "testMode": false
      }
   },
   {
      "name": "TargetPay iDEAL",
      "slug": "ideal",
      "description": null,
      "enabled": false,
      "settings": {
         "subAccountId": ""
      }
   },
   {
      "name": "Manual",
      "slug": "manual",
      "description": null,
      "enabled": true,
      "settings": [

      ]
   },
   {
      "name": "MIGS 2-Party",
      "slug": "migs-2party",
      "description": null,
      "enabled": false,
      "settings": {
         "merchantId": "",
         "merchantAccessCode": "",
         "secureHash": ""
      }
   },
   {
      "name": "MIGS 3-Party",
      "slug": "migs-3party",
      "description": null,
      "enabled": false,
      "settings": {
         "merchantId": "",
         "merchantAccessCode": "",
         "secureHash": ""
      }
   },
   {
      "name": "Mollie",
      "slug": "mollie",
      "description": null,
      "enabled": false,
      "settings": {
         "partnerId": "",
         "testMode": false
      }
   },
   {
      "name": "TargetPay MrCash",
      "slug": "mrcash",
      "description": null,
      "enabled": false,
      "settings": {
         "subAccountId": ""
      }
   },
   {
      "name": "MultiSafepay",
      "slug": "multi-safepay",
      "description": null,
      "enabled": false,
      "settings": {
         "accountId": "",
         "siteId": "",
         "siteCode": "",
         "testMode": false
      }
   },
   {
      "name": "Netaxept",
      "slug": "netaxept",
      "description": null,
      "enabled": false,
      "settings": {
         "merchantId": "",
         "password": "",
         "testMode": false
      }
   },
   {
      "name": "NetBanx",
      "slug": "netbanx",
      "description": null,
      "enabled": false,
      "settings": {
         "accountNumber": "",
         "storeId": "",
         "storePassword": "",
         "testMode": false
      }
   },
   {
      "name": "PayFast",
      "slug": "payfast",
      "description": null,
      "enabled": false,
      "settings": {
         "merchantId": "",
         "merchantKey": "",
         "pdtKey": "",
         "testMode": false
      }
   },
   {
      "name": "Payflow",
      "slug": "payflow",
      "description": null,
      "enabled": false,
      "settings": {
         "username": "",
         "password": "",
         "vendor": "",
         "partner": "",
         "testMode": false
      }
   },
   {
      "name": "PayPal Express",
      "slug": "paypal-express",
      "description": null,
      "enabled": false,
      "settings": {
         "username": "",
         "password": "",
         "signature": "",
         "testMode": true,
         "solutionType": "Sole",
         "landingPage": "Billing",
         "headerImageUrl": ""
      }
   },
   {
      "name": "PayPal Pro",
      "slug": "paypal-pro",
      "description": null,
      "enabled": false,
      "settings": {
         "username": "",
         "password": "",
         "signature": "",
         "testMode": false
      }
   },
   {
      "name": "Pin",
      "slug": "pin",
      "description": null,
      "enabled": false,
      "settings": {
         "secretKey": "",
         "testMode": false
      }
   },
   {
      "name": "PaymentExpress PxPay",
      "slug": "px-pay",
      "description": null,
      "enabled": false,
      "settings": {
         "username": "",
         "password": ""
      }
   },
   {
      "name": "PaymentExpress PxPost",
      "slug": "px-post",
      "description": null,
      "enabled": false,
      "settings": {
         "username": "",
         "password": ""
      }
   },
   {
      "name": "Sage Pay Direct",
      "slug": "sagepay-direct",
      "description": null,
      "enabled": false,
      "settings": {
         "vendor": "",
         "testMode": false,
         "simulatorMode": false
      }
   },
   {
      "name": "Sage Pay Server",
      "slug": "sagepay-server",
      "description": null,
      "enabled": false,
      "settings": {
         "vendor": "",
         "testMode": false,
         "simulatorMode": false
      }
   },
   {
      "name": "SecurePay Direct Post",
      "slug": "securepay",
      "description": null,
      "enabled": false,
      "settings": {
         "merchantId": "",
         "transactionPassword": "",
         "testMode": false
      }
   },
   {
      "name": "Stripe",
      "slug": "stripe",
      "description": "This is my desc",
      "enabled": enabled,
      "settings": {
         "apiKey": "hello"
      }
   },
   {
      "name": "WorldPay",
      "slug": "worldpay",
      "description": null,
      "enabled": false,
      "settings": {
         "installationId": "",
         "secretWord": "",
         "callbackPassword": "",
         "testMode": false
      }
   }
  ]
}

Update a gateway

This method edits a gateway with a given slug.

Resource URL

PUT https://api.molt.in/beta/gateway/:slug

Paramaters

Key Type Description
nameoptional String The name of the gateway
descriptionoptional String The description of this gateway
settings[] Array An array of gateway settings specific to the gateway you are updating

Example Successful Response


{
  "status": true,
  "result": {
    "settings": {
      "username": "moltinpp",
      "password": "password",
      "signature": "swirly-with-a-trailing-flick",
      "testMode": true,
      "solutionType": "Sole",
      "landingPage": "Billing",
      "headerImageUrl": "http://docs.dev.molt.in/assets/img/logo.png"
    },
    "slug": "paypal-express",
    "name": "PayPal Express"
  }
}

Example Failed Response


{
  "status": false,
  "errors": [
    "The Username setting is required",
    "The Password setting is required",
    "The Signature setting is required",
    "The Test Mode setting is required",
    "The Solution Type setting is required",
    "The Landing Page setting is required",
    "The selected Landing Page setting is invalid"
  ]
}

Order

Resource Description
order Item Order Item endpoints
Delete order by ID Deletes an order with a given ID
Get single order by criteria Gets an order based on the given criteria
Get order by ID Returns an order of the given ID
Get multiple orders by criteria Gets an array of orders
Create new order Creates a new order
Update an order Updates an order with the given ID

order Item

Items can be added to orders.

Resource Description
Get order items by criteria Gets an array of items for a specified order
Create order item Creates a new item for a specified order

Get order items by criteria

Returns an array of order items for a specified order.

Resource URL

GET https://api.molt.in/beta/order/:id/items

Paramaters

Key Type Description
limitoptional Integer The number of order items to return, defaults to all
offsetoptional Integer The first order item to be shown, used for pagination

Example Successful Response


{
   "status": true,
   "result":
   [
       {
           "id": "994",
           "product":
           {
               "value": "Espresso Cup - Small Red",
               "data":
               {
                   "id": "949",
                   "sku": "PRD_H0003_SMRE",
                   "title": "Espresso Cup - Small Red",
                   "slug": "espresso-cup-small-red",
                   "price": "14.99",
                   "sale_price": "12.99",
                   "status":
                   {
                       "value": "Live",
                       "data":
                       {
                           "key": "1",
                           "value": "Live"
                       }
                   },
                   "category":
                   {
                       "value": "Featured",
                       "data":
                       {
                           "60":
                           {
                               "id": "60",
                               "parent": null,
                               "title": "Featured",
                               "slug": "featured",
                               "status":
                               {
                                   "value": "Live",
                                   "data":
                                   {
                                       "key": "1",
                                       "value": "Live"
                                   }
                               },
                               "description": "Featured products",
                               "created_at": "",
                               "updated_at": ""
                           }
                       }
                   },
                   "stock_level": 1034,
                   "stock_status":
                   {
                       "value": "In Stock",
                       "data":
                       {
                           "key": "1",
                           "value": "In Stock"
                       }
                   },
                   "description": "Start the day off right with a shot of your favourite coffee from one of these gorgeous little cups!",
                   "requires_shipping":
                   {
                       "value": "Yes",
                       "data":
                       {
                           "key": "1",
                           "value": "Yes"
                       }
                   },
                   "weight": "10.00",
                   "height": "10.00",
                   "width": "10.00",
                   "depth": "10.00",
                   "collection": null,
                   "brand": null,
                   "tax_band":
                   {
                       "value": "Default",
                       "data":
                       {
                           "id": 1,
                           "title": "Default",
                           "description": null,
                           "rate": "20.00",
                           "created_at": null,
                           "updated_at": null
                       }
                   },
                   "meta_title": "",
                   "created_at": "2014-05-19 10:46:27",
                   "updated_at": "2014-05-19 10:46:28"
               }
           },
           "sku": "PRD_H0003_SMRE",
           "title": "Espresso Cup - Small Red",
           "price": "14.99",
           "quantity": 1,
           "tax_rate": "20.00",
           "tax_band":
           {
               "value": "Default",
               "data":
               {
                   "id": 1,
                   "title": "Default",
                   "description": null,
                   "rate": "20.00",
                   "created_at": null,
                   "updated_at": null
               }
           },
           "created_at": "2014-05-30 12:44:41",
           "updated_at": "2014-05-30 12:44:41"
       },
       [..]
   ],
   "pagination":
   {
       "total": 10,
       "current": 10,
       "limit": 10,
       "offset": 0,
       "from": 1,
       "to": 10,
       "offsets":
       {
           "first": false,
           "previous": false,
           "next": false,
           "last": false
       },
       "links":
       {
           "first": false,
           "previous": false,
           "next": false,
           "last": false
       }
   }
}

Example Empty Response


{
  "status": true,
  "result": [],
  "pagination": {
    "total": 0,
    "current": 0,
    "limit": 10,
    "offset": 0,
    "from": 1,
    "to": 0,
    "offsets": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    },
    "links": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    }
  }
}

Create order item

This endpoint allows you to add items to an order.

Resource URL

POST https://api.molt.in/beta/order/:id/item

Paramaters

Key Type Description
Productoptional Integer Link this item to a product
SKUrequired String The item SKU
Titlerequired String The item title
Pricerequired Float The item price
Quantityrequired Integer The quantity of this item
Tax Raterequired Float The current tax rate for this item
Tax Bandrequired Integer The tax band for this item

Example Successful Response


{
   "status": true,
   "result":
   {
       "id": "1007",
       "product": null,
       "sku": "test123",
       "title": "Test 1 2 3",
       "price": "19.99",
       "quantity": 1,
       "tax_rate": "0.00",
       "tax_band":
       {
           "value": "Default",
           "data":
           {
               "id": 1,
               "title": "Default",
               "description": null,
               "rate": "20.00",
               "created_at": null,
               "updated_at": null
           }
       },
       "created_at": "2014-06-10 10:29:40",
       "updated_at": "2014-06-10 10:29:40"
   }
}

Example Failed Response


{
    "status": false,
    "errors":
    [
        "SKU is required",
        "Product Title is required",
        "Price is required",
        "Quantity is required",
        "Tax Rate is required",
        "Tax Band is required"
    ]
}

Delete order by ID

This call deletes an order with a given ID.

Resource URL

DELETE https://api.molt.in/beta/order/:id

Paramaters

None required

Example Successful Response


{
  "status": true,
  "message": "Order deleted successfully"
}

Example Invalid ID Response


{
  "status": false,
  "message": "No order found"
}

Get single order by criteria

Returns an order based on a given set of key-value properties. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

https://api.molt.in/beta/order

Paramaters

Key Type Description
idoptional Integer Select by ID
customeroptional Integer Select by customer ID
gatewayoptional String Select by gateway slug
statusoptional String Select by Status Key, 1 or 0
subtotaloptional Decimal Select by subtotal
shipping_priceoptional Decimal Select by shipping price
totaloptional Decimal Select by the order total
currencyoptional Integer Select by currency id
currency_codeoptional String Select by currency code
exchange_rateoptional Decimal Select by exchange rate
ship_tooptional Integer Select by shipping address
bill_tooptional Integer Select by billing address
shippingoptional Integer Select by shipping method ID

Example Successful Response


{
  "status": true,
  "result": {
    "id": "150",
    "customer": null,
    "gateway": null,
    "status": {
      "key": "unpaid",
      "value": "Unpaid"
    },
    "subtotal": "100.00",
    "shipping_price": "20.00",
    "total": "120.00",
    "currency": {
      "id": 7,
      "code": "GBP",
      "title": "British Pound",
      "enabled": true,
      "modifier": "*3",
      "exchange_rate": "1.00",
      "format": "£{price}",
      "decimal_point": ".",
      "thousand_point": ",",
      "rounding": "full",
      "default": false
    },
    "currency_code": "GBP",
    "exchange_rate": "1.00",
    "ship_to": {
      "id": "54",
      "save_as": "Home",
      "company": "",
      "first_name": "Cameron",
      "last_name": "Diaz",
      "email": "cameron.diaz@hotmail.com",
      "phone": "22637663429",
      "address_1": "23 Moltin Road",
      "address_2": "",
      "city": "Moltinland",
      "county": "Moltin ",
      "postcode": "M01T 1N",
      "country": {
        "code": "GB",
        "name": "United Kingdom"
      },
      "customer": {
        "id": "53",
        "first_name": "Chris",
        "last_name": "Harvey",
        "email": "chris@molt.in"
      }
    },
    "bill_to": {
      "id": "54",
      "save_as": "Home",
      "company": "",
      "first_name": "Cameron",
      "last_name": "Diaz",
      "email": "cameron.diaz@hotmail.com",
      "phone": "22637663429",
      "address_1": "23 Moltin Road",
      "address_2": "",
      "city": "Moltinland",
      "county": "Moltin ",
      "postcode": "M01T 1 N",
      "country": {
        "code": "GB",
        "name": "United Kingdom"
      },
      "customer": {
        "id": "53",
        "first_name": "Chris",
        "last_name": "Harvey",
        "email": "chris@molt.in"
      }
    },
    "shipping": null
  }
}

Example Empty Response


{
  "status": true,
  "result": []
}

Get order by ID

Returns an order based on a given ID. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

https://api.molt.in/beta/order/:id

Paramaters

None required

Example Successful Response


{
  "status": true,
  "result": {
    "id": "150",
    "customer": null,
    "gateway": null,
    "status": {
      "key": "unpaid",
      "value": "Unpaid"
    },
    "subtotal": "100.00",
    "shipping_price": "20.00",
    "total": "120.00",
    "currency": {
      "id": 7,
      "code": "GBP",
      "title": "British Pound",
      "enabled": true,
      "modifier": "*3",
      "exchange_rate": "1.00",
      "format": "£{price}",
      "decimal_point": ".",
      "thousand_point": ",",
      "rounding": "full",
      "default": false
    },
    "currency_code": "GBP",
    "exchange_rate": "1.00",
    "ship_to": {
      "id": "54",
      "save_as": "Home",
      "company": "",
      "first_name": "Cameron",
      "last_name": "Diaz",
      "email": "cameron.diaz@hotmail.com",
      "phone": "22637663429",
      "address_1": "23 Moltin Road",
      "address_2": "",
      "city": "Moltinland",
      "county": "Moltin ",
      "postcode": "M01T 1N",
      "country": {
        "code": "GB",
        "name": "United Kingdom"
      },
      "customer": {
        "id": "53",
        "first_name": "Chris",
        "last_name": "Harvey",
        "email": "chris@molt.in"
      }
    },
    "bill_to": {
      "id": "54",
      "save_as": "Home",
      "company": "",
      "first_name": "Cameron",
      "last_name": "Diaz",
      "email": "cameron.diaz@hotmail.com",
      "phone": "22637663429",
      "address_1": "23 Moltin Road",
      "address_2": "",
      "city": "Moltinland",
      "county": "Moltin ",
      "postcode": "M01T 1 N",
      "country": {
        "code": "GB",
        "name": "United Kingdom"
      },
      "customer": {
        "id": "53",
        "first_name": "Chris",
        "last_name": "Harvey",
        "email": "chris@molt.in"
      }
    },
    "shipping": null
  }
}

Example Empty Response


{
    "status": false,
    "error": "No order found"
}

Get multiple orders by criteria

Returns a range of orders based on a given set of paramaters. All choices and relaionships will be converted to their appropriate data values to reduce the number of extra calls required.

Resource URL

GET https://api.molt.in/beta/orders

Paramaters

Key Type Description
limitoptional Integer The number of orders to return, defaults to all
offsetoptional Integer The first order to be shown, used for pagination

Example Successful Response


{
  "status": true,
  "result": [
    {
      "id": "150",
      "customer": null,
      "gateway": null,
      "status": {
        "key": "unpaid",
        "value": "Unpaid"
      },
      "subtotal": "100.00",
      "shipping_price": "20.00",
      "total": "120.00",
      "currency": {
        "id": 7,
        "code": "GBP",
        "title": "British Pound",
        "enabled": true,
        "modifier": "*3",
        "exchange_rate": "1.00",
        "format": "£{price}",
        "decimal_point": ".",
        "thousand_point": ",",
        "rounding": "full",
        "default": false
      },
      "currency_code": "GBP",
      "exchange_rate": "1.00",
      "ship_to": {
        "id": "54",
        "save_as": "Home",
        "company": "",
        "first_name": "Cameron",
        "last_name": "Diaz",
        "email": "cameron.diaz@hotmail.com",
        "phone": "22637663429",
        "address_1": "23 Moltin Road",
        "address_2": "",
        "city": "Moltinland",
        "county": "Moltin ",
        "postcode": "M01T 1N",
        "country": {
          "code": "GB",
          "name": "United Kingdom"
        },
        "customer": {
          "id": "53",
          "first_name": "Chris",
          "last_name": "Harvey",
          "email": "chris@molt.in"
        }
      },
      "bill_to": {
        "id": "54",
        "save_as": "Home",
        "company": "",
        "first_name": "Cameron",
        "last_name": "Diaz",
        "email": "cameron.diaz@hotmail.com",
        "phone": "22637663429",
        "address_1": "23 Moltin Road",
        "address_2": "",
        "city": "Moltinland",
        "county": "Moltin ",
        "postcode": "M01T 1N",
        "country": {
          "code": "GB",
          "name": "United Kingdom"
        },
        "customer": {
          "id": "53",
          "first_name": "Chris",
          "last_name": "Harvey",
          "email": "chris@molt.in"
        }
      },
      "shipping": null
    }
  ],
  "pagination": {
    "total": 1,
    "current": 1,
    "limit": 10,
    "offset": 0,
    "from": 1,
    "to": 1,
    "offsets": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    },
    "links": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    }
  }
}

Example Empty Response


{
  "status": true,
  "result": [],
  "pagination": {
    "total": 0,
    "current": 0,
    "limit": 10,
    "offset": 0,
    "from": 1,
    "to": 0,
    "offsets": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    },
    "links": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    }
  }
}

Create new order

This call creates a new order with the POST data provided. If there are any problems with the creation these will be returned in an errors array listing all validation problems, otherwise the new order will be returned.

Resource URL

POST https://api.molt.in/beta/order

Paramaters

Key Type Description
customeroptional Integer Customer ID
gatewayoptional String The gateway slug
status String The order status, 1 or 0
subtotal Decimal The order subtotal (before shipping and tax)
shipping_priceoptional Decimal Select by shipping price
total Decimal The order total (after tax and shipping)
currency Integer The currency ID
currency_code String The currency code
exchange_rate Decimal The currency exchange rate
ship_to Integer The customers shipping address
bill_to Integer The customers billing address
shippingoptional Integer The shipping method used

Example Successful Response


{
  "status": true,
  "result": {
    "id": "150",
    "customer": null,
    "gateway": null,
    "status": {
      "key": "unpaid",
      "value": "Unpaid"
    },
    "subtotal": "100.00",
    "shipping_price": "20.00",
    "total": "120.00",
    "currency": {
      "id": 7,
      "code": "GBP",
      "title": "British Pound",
      "enabled": true,
      "modifier": "*3",
      "exchange_rate": "1.00",
      "format": "£{price}",
      "decimal_point": ".",
      "thousand_point": ",",
      "rounding": "full",
      "default": false
    },
    "currency_code": "GBP",
    "exchange_rate": "1.00",
    "ship_to": {
      "id": "54",
      "save_as": "Home",
      "company": "",
      "first_name": "Cameron",
      "last_name": "Diaz",
      "email": "cameron.diaz@hotmail.com",
      "phone": "22637663429",
      "address_1": "23 Moltin Road",
      "address_2": "",
      "city": "Moltinland",
      "county": "Moltin ",
      "postcode": "M01T 1N",
      "country": {
        "code": "GB",
        "name": "United Kingdom"
      },
      "customer": {
        "id": "53",
        "first_name": "Chris",
        "last_name": "Harvey",
        "email": "chris@molt.in"
      }
    },
    "bill_to": {
      "id": "54",
      "save_as": "Home",
      "company": "",
      "first_name": "Cameron",
      "last_name": "Diaz",
      "email": "cameron.diaz@hotmail.com",
      "phone": "22637663429",
      "address_1": "23 Moltin Road",
      "address_2": "",
      "city": "Moltinland",
      "county": "Moltin ",
      "postcode": "M01T 1N",
      "country": {
        "code": "GB",
        "name": "United Kingdom"
      },
      "customer": {
        "id": "53",
        "first_name": "Chris",
        "last_name": "Harvey",
        "email": "chris@molt.in"
      }
    },
    "shipping": null
  }
}

Example Empty Response


{
  "status": false,
  "errors": [
    "'99' is not a valid relationship"
  ]
}

Update an order

This call edits an order with a given ID. There are no minumum required paramaters and only those differing from current values will be updated, as such you can pass all or one of the fields and there will be no difference.

Resource URL

PUT https://api.molt.in/beta/order/:id

Paramaters

Key Type Description
customeroptional Integer Customer ID
gatewayoptional String The gateway slug
statusoptional String The order status, 1 or 0
subtotaloptional Decimal The order subtotal (before shipping and tax)
shipping_priceoptional Decimal Select by shipping price
totaloptional Decimal The order total (after tax and shipping)
currencyoptional Integer The currency ID
currency_codeoptional String The currency code
exchange_rateoptional Decimal The currency exchange rate
ship_tooptional Integer The customers shipping address
bill_tooptional Integer The customers billing address
shippingoptional Integer The shipping method used

Example Successful Response


{
  "status": true,
  "result": {
    "id": "150",
    "customer": null,
    "gateway": null,
    "status": {
      "key": "unpaid",
      "value": "Unpaid"
    },
    "subtotal": "100.00",
    "shipping_price": "30.00",
    "total": "130.00",
    "currency": {
      "id": 7,
      "code": "GBP",
      "title": "British Pound",
      "enabled": true,
      "modifier": "*3",
      "exchange_rate": "1.00",
      "format": "£{price}",
      "decimal_point": ".",
      "thousand_point": ",",
      "rounding": "full",
      "default": false
    },
    "currency_code": "GBP",
    "exchange_rate": "1.00",
    "ship_to": {
      "id": "54",
      "save_as": "Home",
      "company": "",
      "first_name": "Cameron",
      "last_name": "Diaz",
      "email": "cameron.diaz@hotmail.com",
      "phone": "22637663429",
      "address_1": "23 Moltin Road",
      "address_2": "",
      "city": "Moltinland",
      "county": "Moltin ",
      "postcode": "M01T 1N",
      "country": {
        "code": "GB",
        "name": "United Kingdom"
      },
      "customer": {
        "id": "53",
        "first_name": "Chris",
        "last_name": "Harvey",
        "email": "chris@molt.in"
      }
    },
    "bill_to": {
      "id": "54",
      "save_as": "Home",
      "company": "",
      "first_name": "Cameron",
      "last_name": "Diaz",
      "email": "cameron.diaz@hotmail.com",
      "phone": "22637663429",
      "address_1": "23 Moltin Road",
      "address_2": "",
      "city": "Moltinland",
      "county": "Moltin ",
      "postcode": "M01T 1N",
      "country": {
        "code": "GB",
        "name": "United Kingdom"
      },
      "customer": {
        "id": "53",
        "first_name": "Chris",
        "last_name": "Harvey",
        "email": "chris@molt.in"
      }
    },
    "shipping": null
  }
}

Example Failed Response


{
  "status": false,
  "errors": [
    "Invalid decimal value for Subtotal"
  ]
}

Shipping

Resource Description
Delete shipping method by ID Deletes a shipping method with a given ID
Get shipping methods by criteria Gets a list of shipping methods based on the given criteria
Get shipping method by ID Returns a shipping method of the given ID
Create new shipping method Creates a new shipping method
Update a shipping method Updates a shipping method with the given ID

Delete shipping method by ID

This method deletes a shipping method with a given ID. Once a shipping method has been deleted all orders for that shipping method will become anonymous.

Resource URL

DELETE https://api.molt.in/beta/shipping/:id

Paramaters

None required

Example Successful Response


{
    "status": true,
    "message": "Shipping method deleted successfully"
}

Example Invalid ID Response


{
    "status": false,
    "message": "Shipping method not found"
}

Get shipping methods by criteria

Returns a paginated list of shipping methods based on a given set of key-value properties. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

https://api.molt.in/beta/shipping

Paramaters

Key Type Description
idoptional Integer Select by ID
titleoptional String Select by title
slugoptional String Select by slug
companyoptional String Select by company
statusoptional Integer Select by status (1 or 0)
priceoptional Decimal Select by price
price_minoptional Decimal Select by minimum price
price_maxoptional Decimal Select by maximum price
weight_minoptional Decimal Select by minumum weight
weight_maxoptional Decimal Select by maximum weight
descriptionoptional String Select by description
tax_bandoptional Integer Select by tax band id

Example Successful Response


{
  "status": true,
  "result": [
    {
      "id": "154",
      "title": "Free Shipping",
      "slug": "free",
      "company": "FedEx",
      "status": {
        "key": "1",
        "value": "Live"
      },
      "price": "0",
      "price_min": "10.00",
      "price_max": "100.00",
      "weight_min": "10.00",
      "weight_max": "100.00",
      "description": "Free shipping on orders between £10 and £100",
      "tax_band": {
        "id": 1,
        "title": "Default",
        "description": null,
        "rate": "20.00"
      }
    }
  ],
  "pagination": {
    "total": 1,
    "current": 1,
    "limit": 10,
    "offset": 0,
    "from": 1,
    "to": 1,
    "offsets": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    },
    "links": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    }
  }
}

Example Empty Response


{
  "status": true,
  "result": [],
  "pagination": {
    "total": 0,
    "current": 0,
    "limit": 10,
    "offset": 0,
    "from": 1,
    "to": 0,
    "offsets": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    },
    "links": {
      "first": false,
      "previous": false,
      "next": false,
      "last": false
    }
  }
}

Get shipping method by ID

Returns a shipping method based on a given ID. Any relational objects will also be returned as either key, values or for multiple-relational items an array.

Resource URL

https://api.molt.in/beta/shipping/:id

Paramaters

None required

Example Successful Response


{
  "status": true,
  "result": {
    "id": "154",
    "title": "Free Shipping",
    "slug": "free",
    "company": "FedEx",
    "status": {
      "key": "1",
      "value": "Live"
    },
    "price": "0",
    "price_min": "10.00",
    "price_max": "100.00",
    "weight_min": "10.00",
    "weight_max": "100.00",
    "description": "Free shipping on orders between £10 and £100",
    "tax_band": {
      "id": 1,
      "title": "Default",
      "description": null,
      "rate": "20.00"
    }
  }
}

Example Failed Response


{
    "status": false,
    "error": "No shipping method found"
}

Create new shipping method

This endpoint creates a new shipping method with the POST data provided. If there are any problems with the creation these will be returned in an errors array listing all validation problems, otherwise the new shipping method will be returned.

Resource URL

POST https://api.molt.in/beta/shipping

Paramaters

Key Type Description
title String The shipping method's title
slug String The shipping method's slug
company String The shipping method's company
status Integer The shipping method's status (1 or 0)
price Decimal The shipping method's price
price_minoptional Decimal The shipping method's minimum price
price_maxoptional Decimal The shipping method's maximum price
weight_minoptional Decimal The shipping method's minumum weight
weight_maxoptional Decimal The shipping method's maximum weight
descriptionoptional String The shipping method's description
tax_band Integer The shipping method's tax band id

Example Successful Response


{
  "status": true,
  "result": {
    "id": "154",
    "title": "Free Shipping",
    "slug": "free",
    "company": "FedEx",
    "status": {
      "key": "1",
      "value": "Live"
    },
    "price": "0",
    "price_min": "10.00",
    "price_max": "100.00",
    "weight_min": "10.00",
    "weight_max": "100.00",
    "description": "Free shipping on orders between £10 and £100",
    "tax_band": {
      "id": 1,
      "title": "Default",
      "description": null,
      "rate": "20.00"
    }
  }
}

Example Failed Response


{
  "status": false,
  "errors": [
    "Invalid choice specified for Status"
  ]
}

Update a shipping method

This endpoint edits a shipping method with a given ID. There are no minumum required paramaters and only those differing from current values will be updated, as such you can pass all or one of the fields and there will be no difference.

Resource URL

PUT https://api.molt.in/beta/shipping/:id

Paramaters

Key Type Description
titleoptional String The shipping method's title
slugoptional String The shipping method's slug
companyoptional String The shipping method's company
statusoptional Integer The shipping method's status (1 or 0)
priceoptional Decimal The shipping method's price
price_minoptional Decimal The shipping method's minimum price
price_maxoptional Decimal The shipping method's maximum price
weight_minoptional Decimal The shipping method's minumum weight
weight_maxoptional Decimal The shipping method's maximum weight
descriptionoptional String The shipping method's description
tax_bandoptional Integer The shipping method's tax band id

Example Successful Response


{
  "status": true,
  "result": {
    "id": "154",
    "title": "Free Shipping",
    "slug": "free",
    "company": "FedEx",
    "status": {
      "key": "1",
      "value": "Live"
    },
    "price": "0",
    "price_min": "10.00",
    "price_max": "1000.00",
    "weight_min": "10.00",
    "weight_max": "100.00",
    "description": "Free shipping on orders between £10 and £1000",
    "tax_band": {
      "id": 1,
      "title": "Default",
      "description": null,
      "rate": "20.00"
    }
  }
}

Example Failed Response


{
  "status": false,
  "errors": [
    "Invalid choice specified for Status"
  ]
}