Prerequisites

You should have

  • a valid api merchant-token enabled for api access & product management access
  • an api-client

 

Getting a list of your products

To get a list of the products you have currently listed in the marketplace.

Request URL

https://{your hublify url}/api/merchant_10/merchant_product_getList

Request parameter (optional)

While not mandatory, it is recommended to filter your request

// Example to retrieve products listed with less than 10 available
{
    "filter": {
        "prcmrch_storage_counter": {
            "search": "< 10"
        }
    },
    "fields": [
        "pcode",
        "prcmrch_pcode_merchant",
        "name",
        "prcmrch_storage_counter",
        "prcmrch_price",
        "prcmrch_discount"
    ]
}

Response

If your request was successful, you receive the details for your products

See "Getting product details" for a more extensive list of result data

{
    "status": true,
    "data": [
        {
            "pcode": "MRCHPRD234",                     // this is the SKU for this product in the marketplace system
            "prcmrch_pcode_merchant": "MyMrchPrd234",  // this is your own SKU 
            "prcmrch_price": "111.1100",               // the price incl. VAT that you set for this product 
            "prcmrch_discount": null,                  // optional discount price
            "prcmrch_storage_counter": "8.0000",       // currently saved available quantity in the marketplace
            "name": "Example Merchant Product 234"     // product name
        },
        {
            "pcode": "MRCHPRD345",
            "prcmrch_pcode_merchant": "MyMrchPrd345",
            "prcmrch_price": "11.1100",
            "prcmrch_discount": "9.9900",
            "prcmrch_storage_counter": "7.0000",
            "name": "Example Merchant Product 345"
        },
        {
            "pcode": "MRCHPRD456",
            "prcmrch_pcode_merchant": "MyMrchPrd456",
            "prcmrch_price": "123.4500",
            "prcmrch_discount": null,
            "prcmrch_storage_counter": "5.0000",
            "name": "Example Merchant Product 456"
        }
    ],
    "meta": {
        "FOUND_ROWS": "3"
    }
}

Response - Error

If your request failed, you receive an error message.

{
    "status": false,
    "msg": [
        {
            "type": "ERROR",
            "text": "Request failed."
        }
    ]
}

 

Getting product details

To retrieve details about one specific product, you need the Hublify pcode or your own product code as saved in the marketplace

Request URL

https://{your hublify url}/api/merchant_10/merchant_product_get

Request parameter

{
    "filter": {
        "pcode": "MRCHPRD345"                    // the Marketplace internal SKU (product-code)
    }
} 

// or 

{
    "filter": {
        "prcmrch_pcode_merchant": "MyMrchPrd345" // your own SKU that is saved in the marketplace
    }
} 


Response

If your request was successful, you receive the details for this product.
Depending on the hublify-system you might also be able to retrieve additional data that are not mentioned here.
 

{
    "status": true,
    "data": {
        "pcode": "MRCHPRD345",
        "prcmrch_pcode_merchant": "MyMrchPrd345",
        "prcmrch_price": "11.1100",
        "prcmrch_discount": "9.9900",
        "prcmrch_discount_start": null,
        "prcmrch_discount_end": null,
        "prcmrch_dsc_scale": {
            "model": "price_scale",
            "data": []
        },
        "prcmrch_state": "2",
        "prcmrch_condition": "",
        "prcmrch_delivery_time": null,
        "prcmrch_description": null,
        "prcmrch_storage_counter": "7.0000",
        "prcmrch_insert_time": "2021-06-20 21:22:23",
        "prcmrch_update_time": "2022-06-17 18:19:20",
        "name": "Example Merchant Product 345"
    }

}

Response - Error

If your request failed, you receive a message detailing the error that occurred.

{
    "status": false,
    "msg": [
        {
            "type": "ERROR",
            "text": "Product not found."
        }
    ]
}

Update product details

To update details about a product you need the Hublify pcode or your own product code as a filter.
You only need to provide the fields that you want to update.

Request URL

https://{your hublify url}/api/merchant_10/merchant_product_update

Request parameter

// Example: updating the storage counter
{
    "filter": {
        "pcode": "MRCHPRD345"
    },
    "fields": {
        "prcmrch_storage_counter": 42
    }
}


Response

If your request was successful, you receivea success message
 

{

    "status": true,
    "msg": [
        {
            "type": "OK",
            "text": "MerchantProduct successfully updated."
        }
    ]
}

Response - Error

If your request failed, you receive a message detailing the error that occurred.

{
    "status": false,
    "msg": [
        {
            "type": "ERROR",
            "text": "Product not found."
        }
    ]
}

 

Create a new product

To add a new product to the marketplace, you need to provide at least your own product code. You should also add name, prices and the available amount.
See the Field-Description for more details about available fields.

Request URL

https://{your hublify url}/api/merchant_10/merchant_product_create

Request parameter

// Minimal data
{
    "fields": {
        "prcmrch_pcode_merchant": "MyMrchPrd567",  // You own SKU
        "prcmrch_price": 12.34,                    // The price incl. VAT
        "prcmrch_storage_counter": "100",          // Available quantity 
        "name": "My New Product 567"               // A name for the product
    }
}

Response

If your request was successful, you receive a success message
 

{

    "status": true,
    "msg": [
        {
            "type": "OK",
            "text": "MerchantProduct successfully created."
        }
    ]
}

Response - Error

If your request failed, you receive a message detailing the error that occurred.

{
    "status": false,
    "msg": [
        {
            "type": "ERROR",
            "text": "Fields missing. Please provide at least \"prcmrch_pcode_merchant\"."
        }
    ]
}