Methods


Entity Properties


Each merchant maintains a completely unique catalog of products managed at Red Stag Fulfillment whether in stock or not. It is preferable that a merchant creates all of their products with accurate names, goods type and barcodes before actually shipping physical inventory to aid in accurate processing of deliveries.

product.search (null|object $filters = null, null|array $options = null, null|string|number $store = 0)

Retrieve list of products with basic info (id, sku, type, set, name).

Parameters

orderdescription
0
  • null - Retrieve list of all products.
  • object - Retrieve list of products using specified filters.
Allowed properties for filtering: "sku", "vendor_sku", "status", "availability", "visibility", "created_at", "updated_at".
1
  • null - No options will be applied.
  • object - Apply specified options.
2
  • null - Default store will be used.
  • number - Specified store will be used.
  • string - Specified store will be used.

Return Value

An array of objects. Each object will contain “Product Properties”.

Example Request

Get product information for one product SKU:

{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "method" : "call",
    "params" : [
        "be1c13ed4e03f0ed7f1e4053dfff9658",
        "product.search",
        [
            {
                "sku" : { "eq" : "product2" }
            }
        ]
    ]
}

Example Response

{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "error" : null,
    "result" : [
        {
            "sku" : "productsku",
            "name" : "product name",
            "barcode" : "productbarcode",
            "goods_type" : "NORMAL",
            "status" : 1,
            "availability" : 1,
            "visibility" : 2,
            "weight" : 12.75,
            "length" : null,
            "width" : null,
            "height" : null,
            "customs_value_usd" : "24.5600",
            "country_of_manufacture" : "DK",
            "hts_base_code" : 1234.56,
            "hts_country_code" : [
                {
                    "country_id" : "BB",
                    "extension" : 01
                },
                {
                    "country_id" : "FO",
                    "extension" : 02
                }
            ],
            "vendor_sku" : "vendorsku",
            "requires_packaging" : 1,
            "confirmation_per_item" : 0,
            "special_box" : "boxsku",
            "special_supplies" : [ "supplysku1", "supplysku2" ],
            "special_other" : [ "specialsku1", "specialsku2" ],
            "unit_qty" : 5
        }
    ]
}

Error Codes

code message
108 Invalid filters given. Details in error message.

product.create (string $sku, object $productData)

Create new product.

Parameters

orderdescription
0 string - Product SKU.
1 object - Product data.

Return Value

true if product was successfully created.

Example Request

{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "method" : "call",
    "params" : [
        "be1c13ed4e03f0ed7f1e4053dfff9658",
        "product.create",
        [
            "product3",
            {
                "name" : "Product 3",
                "barcode" : "product3",
                "goods_type" : "NORMAL",
                "weight" : 1.75,
                "length" : 123,
                "width" : 100,
                "height" : 28,
                "customs_value_usd" : "24.5600",
                "country_of_manufacture" : "DK",
                "hts_base_code" : 1234.56,
                "hts_country_code" : "BH:1000|ZW:1001",
                "vendor_sku" : "vendorsku",
                "requires_packaging" : 1,
                "confirmation_per_item" : 0,
                "special_box" : "boxsku",
                "special_supplies" : "supplysku1|supplysku2",
                "special_other" : "othersku1|othersku2",
                "unit_qty" : 5
            }
        ]
    ]
}

Example Response

{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "error" : null,
    "result" : true
}

Error Codes

code message
102 Invalid data given. Details in error message.
104 Product type is not in allowed types.
105 Product’s attribute set does not exist.
106 Product’s attribute set is not a Catalog Product entity type.
107 Another product with this SKU already exists.

product.info (string $sku, null|string|number $store = null)

Retrieve product info.

Parameters

orderdescription
0 string - Product SKU.
1
  • null - Use default store.
  • int - Use specified store.
  • string - Use specified store.

Return Value

Object with Product Properties.

Example Request

{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "method" : "call",
    "params" : [
        "be1c13ed4e03f0ed7f1e4053dfff9658",
        "product.info",
        [
            "product1"
        ]
    ]
}

Example Response

{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "error" : null,
    "result" : {
        "sku" : "productsku",
        "name" : "product name",
        "barcode" : "productbarcode",
        "goods_type" : "NORMAL",
        "status" : 1,
        "availability" : 1,
        "visibility" : 2,
        "weight" : 12.75,
        "length" : null,
        "width" : null,
        "height" : null,
        "customs_value_usd" : "24.5600",
        "country_of_manufacture" : "DK",
        "hts_base_code" : 1234.56,
        "hts_country_code" : [
            {
                "country_id" : "BB",
                "extension" : 01
            },
            {
                "country_id" : "FO",
                "extension" : 02
            }
        ],
        "vendor_sku" : "vendorsku",
        "requires_packaging" : 1,
        "confirmation_per_item" : 0,
        "special_box" : "boxsku",
        "special_supplies" : [ "supplysku1", "supplysku2" ],
        "special_other" : [ "othersku1", "othersku2" ],
        "unit_qty" : 5
    }
}

Error Codes

code message
101 Product not exists.

product.update (string $sku, object $productData, null|string|number $store = null)

Update product data.

Parameters

orderdescription
0 string - Product SKU.
1 object - Product data.
2
  • null - Use default store.
  • int - Use specified store.
  • string - Use specified store.

Return Value

true if product was successfully updated.

Example Request

{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "method" : "call",
    "params" : [
        "be1c13ed4e03f0ed7f1e4053dfff9658",
        "product.update",
        [
            "product3",
            {
                "name" : "product name",
                "barcode" : "productbarcode",
                "goods_type" : "NORMAL",
                "status" : 1,
                "availability" : 1,
                "visibility" : 2,
                "weight" : 12.75,
                "length" : null,
                "width" : null,
                "height" : null,
                "customs_value_usd" : "24.5600",
                "country_of_manufacture" : "DK",
                "hts_base_code" : 1234.56,
                "hts_country_code" : [
                    {
                        "country_id" : "BB",
                        "extension" : 01
                    },
                    {
                        "country_id" : "FO",
                        "extension" : 02
                    }
                ],
                "vendor_sku" : "vendorsku",
                "requires_packaging" : 1,
                "confirmation_per_item" : 0,
                "special_box" : "boxsku",
                "special_supplies" : [ "supplysku1", "supplysku2" ],
                "special_other" : [ "specialsku1", "specialsku2" ],
                "unit_qty" : 5
            }
        ]
    ]
}

Example Response

{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "error" : null,
    "result" : true
}

Error Codes

code message
101 Product not exists.
102 Invalid data given. Details in error message.

Entity Properties

Product Properties

sku
{ "sku" : "product1" }
A unique identifier for a product. The SKU does appear on the packing slip. It is recommended that this be human-readable and end with a per-pack quantity to facilitate proper receiving. For example, a single blue widget may be "BlueWidget-1" and a pack of 5 blue widgets may be "BlueWidget-5". Maximum character length is 64.
name
{ "name" : "Product 1" }
The "Name" property.
export_description
{ "export_description" : "Herbal teas and herbal infusions (single species, unmixed)" }
Harmonized Tariff Schedule article description.
barcode
{ "barcode" : "product1,p1" }
The "Barcode" property. Single or comma separated barcodes.
goods_type
{ "goods_type" : "NORMAL" }
The "Goods Type" property. Allowed: "NORMAL", "ORM_D".
status
{ "status" : 1 }
The "Status" property. Allowed: "0" - out of stock. "1" - in stock.
availability
{ "availability" : 1 }
The "Availability" property. Allowed: "1" - available. "2" - not available.
visibility
{ "visibility" : 2 }
The "Visibility" property. Allowed: "1" - not visible, "2" - visible.
weight
{ "weight" : 12 }
The "Weight" property.
length
{ "length" : 5 }
The "Length" property.
width
{ "width" : 6 }
The "Width" property.
height
{ "height" : 7 }
The "Height" property.
customs_value_usd
{ "customs_value_usd" : "24.5600" }
The "Customs Value USD" property.
country_of_manufacture
{ "country_of_manufacture" : "DK" }
The "Country of Manufacture" property.
hts_base_code
{ "hts_base_code" : 1234.56 }
The "HTS Base Code" property.
hts_country_code
{ "hts_country_code" : "BH:1000|ZW:1001" }
The "HTS Country Code" property. Format: "{COUNTRY}:{CODE}". Separator: "|".
requires_packaging
{ "requires_packaging" : 1 }
The "Requires Packaging" property. Allowed: "0" - not required. "1" - required.
confirmation_per_item
{ "confirmation_per_item" : 0 }
The "Confirmation per Item" property. Allowed: "0" - not required. "1" - required.
special_box
{ "special_box" : "specialboxsku" }
The "Special Box" property. SKU of the special box packaging.
special_supplies
{ "special_supplies" : "supplysku1|supplysku2" }
The "Special Supplies" property. SKU of the special supplies packaging.
special_other
{ "special_other" : "othersku1|othersku2" }
The "Special Other" property. SKU of the other special packaging. Separator: "|".
unit_qty
{ "unit_qty" : 5 }
The "Unit Quantity" property. Number of individually packaged items contained therein for purposes of special packaging features.
external_id
{ "external_id" : 632910392 }
The "External ID" property. The external unique numeric identifier for the product.
vendor_sku
{ "vendor_sku" : "vendorsku" }
The "Vendor SKU" property. Use if different from the "SKU" property.