MX Retail

This guide will provide examples of using our MX Retail app through the API.

Get Catalog Id

The MX Retail utilizes the catalogId more than any other API we have. To get this you need to make a get request to our MX merchant API to get the catalogId.

GET: https://sandbox.api.mxmerchant.com/checkout/v3/merchant/554123

"general": {
            "defaultCatalogId": 123456,
            "locationId": 99937,
            "package": [
                "Basic",
                "Developer",
                "Retail",
                "Invoice"
            ],
            "timezoneOffset": "-8:00",
            "daylightSaving": true
        }

Create a Product

This endpoint will allow you to add a product to your inventory. This however doesn't add the pricing or give you the choice to add options to your product at the same. If you review your product, you will notice it doesn't have a price assigned to. You need to create a variance for your product.

POST: https://sandbox.api.mxmerchant.com/checkout/v3/catalogproduct?id=123456&echo=true

{
  "taxable":true,
  "clientNumber": 1,
  "name": "Test Product",
  "deleted":"false",
  "description": "Test Product Description",
   "taxCode": "Tax Code"
}
{
    "id": 567890,
    "name": "Test Product",
    "clientNumber": "1",
    "description": "Test Product Description",
    "taxCode": "Tax Code",
    "active": true,
    "modified": "2020-10-12T13:35:18.24Z",
    "created": "2020-10-12T13:35:18.24Z",
    "deleted": false,
    "taxable": true,
    "availableCount": 0,
    "quantitySold": 0,
    "displayImageDefault": true
}

Create a Variance for your product

After creating your product you need to create a variance for it. Below is a simple example of adding a single variance to your product.

POST: https://sandbox.api.mxmerchant.com/checkout/v3/productvariant?id=567890&echo=true

{
  "cost": 0.01,
  "price": 0.01,
  "name": "Variance Name"
}
{
    "id": 456890,
    "dateCreated": "2020-10-12T14:06:14.403Z",
    "dateModified": "2020-10-12T14:06:14.403Z",
    "name": "Variance Name",
    "productId": 456890,
    "primaryId": "VN000001",
    "price": "0.01",
    "cost": "0.01",
    "notifyOnLowStock": false,
    "hideOnNoStock": false,
    "isActive": true,
    "isDeleted": false,
    "onHand": 0
}

If your product has options, you would need to add another field called properties. Below is an example.

{
  "name": "variance name",
  "price": 0.92,
  "cost": 8.11,
  "primaryId": "1234567890",
  "properties": {
    "Variant Option 1": "variance name"
  }
}
{
    "id": 369708,
    "dateCreated": "2020-10-14T13:30:44.953Z",
    "dateModified": "2020-10-14T13:30:44.953Z",
    "name": "variance name",
    "productId": 567890,
    "primaryId": "233723872378",
    "price": "0.92",
    "cost": "8.11",
    "notifyOnLowStock": false,
    "hideOnNoStock": false,
    "tags": [],
    "isActive": true,
    "isDeleted": false,
    "onHand": 0,
    "properties": {
        "Variant Option 1": "variance name"
    },
    "productProperties": {}
}

Create a Supplier

Below is an example of creating a supplier for MX Retail

POST: https://sandbox.api.mxmerchant.com/checkout/v3/supplier?echo=true

{
  "name": "Supplier",
  "merchantId": 55441423,
  "catalogId": 567890,
  "taxId": "123456789",
  "number": "1234567890"
}
{
    "id": 1331,
    "merchantId": 55441423,
    "catalogId": 567890,
    "name": "Supplier",
    "number": "1234567890",
    "taxId": "*****6789",
    "created": "2020-10-12T14:48:14.477Z",
    "lastActivity": "2020-10-12T14:48:14.477Z"
}

Add Supplier to Product

Below I provided an example of how the endpoint should look when attempting to add a supplier to your product. This endpoint will give a 200 OK response. To know for sure if your supplier was added I recommend checking your product settings.

PUT: https://sandbox.api.mxmerchant.com/checkout/v3/productsupplier?id=456890&subId=1331

Create a Collection

Example of creating a single collection for MX Retail

https://sandbox.api.mxmerchant.com/checkout/v3/catalogcollection?id=123456&echo=true

{
  "name": "Collection Name",
  "description": "Collection Description",
  "catalogId": 123456,
  "merchantId": 59876543
}
{
    "id": 876,
    "catalogId": 123456,
    "name": "Collection Name",
    "description": "Collection Description",
    "created": "0001-01-01T00:00:00",
    "isAutomatic": false,
    "isFeatured": false,
    "modified": "0001-01-01T00:00:00",
    "productCount": 0
}

Add a product to the collection

Please know that this endpoint is not for creating a product. If you attempt to add a product that does not exist to your collection, nothing will happen. Below I provided an example of adding a valid product to a collection. You need to check your collection to really know if a product has been added.

PUT: https://sandbox.api.mxmerchant.com/checkout/v3/collection?id=876&echo=true

{
  "id": 876,
  "catalogId": 237263,
  "name": " Collection Name",
  "description": "Collection Description",
  "products": [
    {
      "id": 7678766,
      "name": "Test Product",
      "clientNumber": "1"
    }
  ],
  "merchantId": 667854
}
This endpoint will return a 200 response if you attempt to add a product that does not exist in your merchant. Please check your collection to know if a product was added successfully.

Did this page help you?