ZRPL
  • Welcome!
  • Quick Start
  • Reference
    • API Reference
      • Categories List
      • Category Details by ID
      • Create Simple Product
      • Config Product Creation
      • Product List
      • Update Existing Product
      • Product Details by SKU
      • Product Details by ID
      • Products in Category
      • Create Order
      • Order Details
      • Order History
      • Create Customer
      • Customer Token
      • Create Customer Cart
      • Add Item to Cart
      • View Cart
      • Update Cart
      • Delete Cart
      • Country Code
      • Set Shipping and Billing
      • Place Order
      • Customer Details
Powered by GitBook
On this page
  1. Reference
  2. API Reference

Product Details by SKU

The endpoint retrieves product details from the catalog based on the product SKU

GET {{Base_url}}/rest/V1/products/your-product-sku

The API response is a detailed JSON representation of a product retrieved from the Magento system using the endpoint {{Base_url}}/rest/V1/products/your-product-sku. It provides extensive information about the product, including attributes, media gallery, custom properties, and other metadata. The response highlights key properties such as the product's name, price, weight, and visibility, while also including additional details like custom attributes, media files, and extension attributes. This structure is crucial for understanding the product's configuration in Magento and facilitates updates or integrations with external systems.

curl --location '{{Base_url}}/rest/V1/products/your-product-sku' \
--header 'Authorization: Bearer eyJraWQiOiIxIiwiYWxnIjoiSFMyNTYifQ.eyJ1aWQiOjU1LCJ1dHlwaWQiOjIsImlhdCI6MTczNjIyOTQwMiwiZXhwIjoxNzM2MjMzMDAyfQ.Ieac-0kIJbKSPCT8ncYF-X6DGPzHjdUT0vbYuNk4_uY' \
--header 'Cookie: PHPSESSID=6t4unirh1unu87ef0stp2sv3kv; private_content_version=5ab80b7def0c212f723edead3c971a19'

Responses

{
    "id": 14535,
    "sku": "your-product-sku",
    "name": "Your Product Name",
    "attribute_set_id": 4,
    "price": 99.99,
    "status": 1,
    "visibility": 4,
    "type_id": "simple",
    "created_at": "2024-12-12 11:03:46",
    "updated_at": "2025-01-07 06:54:07",
    "weight": 1,
    "extension_attributes": {
        "website_ids": [
            1
        ]
    },
    "product_links": [],
    "options": [],
    "media_gallery_entries": [
        {
            "id": 212271,
            "media_type": "image",
            "label": "Image Label",
            "position": 0,
            "disabled": false,
            "types": [],
            "file": "/r/b/rbj1_4_2.jpeg"
        },
        {
            "id": 212270,
            "media_type": "image",
            "label": "Image Label",
            "position": 0,
            "disabled": false,
            "types": [],
            "file": "/r/b/rbj1_4_1.jpeg"
        },
        {
            "id": 212268,
            "media_type": "image",
            "label": "Image Label",
            "position": 0,
            "disabled": false,
            "types": [],
            "file": "/r/b/rbj1_3_2.jpeg"
        },
        {
            "id": 212269,
            "media_type": "image",
            "label": "Image Label",
            "position": 0,
            "disabled": false,
            "types": [
                "image",
                "small_image",
                "thumbnail"
            ],
            "file": "/r/b/rbj1_4.jpeg"
        },
        {
            "id": 212267,
            "media_type": "image",
            "label": "Image Label",
            "position": 0,
            "disabled": false,
            "types": [],
            "file": "/r/b/rbj1_3_1.jpeg"
        }
    ],
    "tier_prices": [],
    "custom_attributes": [
        {
            "attribute_code": "short_description",
            "value": "<p>html <b>short description here</b></p>"
        },
        {
            "attribute_code": "image",
            "value": "/r/b/rbj1_4.jpeg"
        },
        {
            "attribute_code": "url_key",
            "value": "your-product-name"
        },
        {
            "attribute_code": "description",
            "value": "<p>html <b>description here</b></p>"
        },
        {
            "attribute_code": "meta_title",
            "value": "Product Meta Title"
        },
        {
            "attribute_code": "small_image",
            "value": "/r/b/rbj1_4.jpeg"
        },
        {
            "attribute_code": "options_container",
            "value": "container2"
        },
        {
            "attribute_code": "meta_keyword",
            "value": "product, keywords, magento"
        },
        {
            "attribute_code": "thumbnail",
            "value": "/r/b/rbj1_4.jpeg"
        },
        {
            "attribute_code": "meta_description",
            "value": "Meta description for the product."
        },
        {
            "attribute_code": "swatch_image",
            "value": "no_selection"
        },
        {
            "attribute_code": "purchase_price_cap",
            "value": "0.000000"
        },
        {
            "attribute_code": "msrp_display_actual_price_type",
            "value": "0"
        },
        {
            "attribute_code": "is_sclp",
            "value": "0"
        },
        {
            "attribute_code": "required_options",
            "value": "0"
        },
        {
            "attribute_code": "has_options",
            "value": "0"
        },
        {
            "attribute_code": "image_label",
            "value": "Image Label"
        },
        {
            "attribute_code": "small_image_label",
            "value": "Image Label"
        },
        {
            "attribute_code": "thumbnail_label",
            "value": "Image Label"
        },
        {
            "attribute_code": "popular_product",
            "value": "0"
        },
        {
            "attribute_code": "tax_class_id",
            "value": "2"
        },
        {
            "attribute_code": "category_ids",
            "value": []
        },
        {
            "attribute_code": "sw_featured",
            "value": "0"
        }
    ]
}

Top-Level Attributes

  1. id: The unique identifier for the product in the Magento database.

    • Example: 14535

  2. sku: The Stock Keeping Unit, a unique string to identify the product.

    • Example: "your-product-sku"

  3. name: The product's name.

    • Example: "Your Product Name"

  4. attribute_set_id: The ID of the attribute set to which the product belongs.

    • Example: 4

  5. price: The price of the product.

    • Example: 99.99

  6. status: The product's status (1 for enabled, 0 for disabled).

    • Example: 1

  7. visibility: Determines where the product is visible (e.g., catalog, search).

    • Example: 4 (Visible in catalog and search)

  8. type_id: The type of product (e.g., simple, configurable, virtual).

    • Example: "simple"

  9. created_at: Timestamp when the product was created.

    • Example: "2024-12-12 11:03:46"

  10. updated_at: Timestamp when the product was last updated.

    • Example: "2025-01-07 06:54:07"

  11. weight: The weight of the product.

    • Example: 1


extension_attributes

  1. website_ids: An array of website IDs where the product is available.

    • Example: [1]


product_links

An array representing linked products (e.g., related or upsell products). In this response, it's empty.


options

Customizable options for the product. This is empty in the response.


media_gallery_entries

A list of media files (images) associated with the product.

Each entry contains:

  1. id: Unique ID for the media file.

    • Example: 212271

  2. media_type: Type of media (e.g., image).

    • Example: "image"

  3. label: Label for the media.

    • Example: "Image Label"

  4. position: Order position in the gallery.

    • Example: 0

  5. disabled: Whether the image is disabled.

    • Example: false

  6. types: Array of image roles (e.g., image, small_image, thumbnail).

    • Example: ["image", "small_image", "thumbnail"]

  7. file: File path in the media storage.

    • Example: "/r/b/rbj1_4.jpeg"


tier_prices

Pricing tiers for the product (empty in this case).


custom_attributes

A list of additional product-specific attributes.

  1. attribute_code: Code of the attribute.

  2. value: Value of the attribute.

Examples:

  • short_description: A brief description of the product.

    • Value: "<p>html <b>short description here</b></p>"

  • image: Main image for the product.

    • Value: "/r/b/rbj1_4.jpeg"

  • url_key: SEO-friendly URL for the product.

    • Value: "your-product-name"

  • meta_title: SEO meta title.

    • Value: "Product Meta Title"

  • meta_keyword: SEO meta keywords.

    • Value: "product, keywords, magento"

  • thumbnail: Path to the product's thumbnail image.

    • Value: "/r/b/rbj1_4.jpeg"


Other Important Custom Attributes

  • swatch_image: Indicates a swatch image (value is "no_selection" if not set).

  • tax_class_id: The tax class applied to the product.

    • Value: "2"

  • category_ids: Array of category IDs to which the product belongs.

    • Example: [] (empty in this response)

{
    "message": "The product that was requested doesn't exist. Verify the product and try again."
}
{
    "message": "\"%fieldName\" is required. Enter and try again.",
    "parameters": {
        "fieldName": "searchCriteria"
    }
}
PreviousUpdate Existing ProductNextProduct Details by ID

Last updated 4 months ago