Connect your catalog

Modemagic requires catalog data, including inventory and pricing information, to power their apps.

The APIs should be available as

  • REST / GraphQL for accessing from the backend system
  • Ajax API hosted on the store domain from where we can get the latest info about stock availability of the product and other product details like variant info(to show in dropdown)

APIs Required

1. Get Product by ID

  • Description: This API endpoint allows Modemagic to retrieve product information by providing a unique product ID.
  • HTTP Method: GET
  • Endpoint: /api/products/{product_id}
  • Parameters:
    • product_id (string) - The unique identifier for the product.
  • Response:
    • JSON object containing detailed product information, including inventory and pricing data.

2. Search Products

  • Description: This API endpoint enables Modemagic to search for products based on multiple criteria, such as IDs / status / tags
  • HTTP Method: GET
  • Endpoint: /api/products/search
  • Parameters:
    • product_ids (array of strings) - A list of product IDs to search for.
    • status (string) - The status of the products to filter by.
    • tags ( array ) - Search products by tags
  • Response:
    • JSON array containing product objects that match the search criteria.

3. Get Products in the Collection

  • Description: This API endpoint allows Modemagic to retrieve a list of products within a specific collection.
  • HTTP Method: GET
  • Endpoint: /api/collections/{collection_id}/products
  • Parameters:
    • collection_id (string) - The unique identifier for the collection.
  • Response:
    • JSON array containing product objects that belong to the specified collection.

Support Required

Modemagic requires the following additional support for their catalog API:

1. Batching

  • Description: Modemagic needs the ability to perform batch requests to efficiently retrieve multiple products or collections in a single API call.

2. Ability to Fetch Certain Fields in the Response

  • Description: Modemagic requires the capability to specify which fields they want to retrieve in the API response to optimize data transfer and processing.

Structure of Catalog Data

{
      "id": 8034661663017,
      "title": "Black Dot Print Skirt with Festive look",
			"description": "<div><body><span>Black dot print light festive flared skirt in midrise with elasticated waistband.</span></body></div>",
      
			"url": "https://teststore-l169.myshopify.com/products/black-dot-print-skirt",
			
      "price": "60.00",
      "compare_at_price": null,
      
			"variants": [
        {
          "id": 44941765640489,
          "product_id": 8034661663017,
          "title": "Small / blue / silk",
          "price": "60.00",
          "compare_at_price": null,
					"grams": 0,

          "sku": "",
          "position": 1,

          "inventory_policy": "deny",
          "fulfillment_service": "manual",
          "inventory_management": "shopify",

          "option1": "Small",
          "option2": "blue",
          "option3": "silk",

          "created_at": "2023-04-28T13:54:45+05:30",
          "updated_at": "2023-10-03T16:11:52+05:30",

          "taxable": true,
          "barcode": "",

          "image_id": 39987574898985,
          "weight": 0.0,
          "weight_unit": "lb",
          "inventory_item_id": 46981476516137,
          "inventory_quantity": 22,
          "old_inventory_quantity": 22,
          "requires_shipping": true,
          "admin_graphql_api_id": "gid://shopify/ProductVariant/44941765640489",
          "available": true,
          "options": [
            "Small",
            "blue",
            "silk"
          ],
          "images": [
            {
              "url": "https://cdn.shopify.com/s/files/1/0688/4062/0329/products/20CRE60059-502547_1.jpg?v=1670419559"
            }
          ]
        },
      ],
      "options": [
        {
          "id": 10206822433065,
          "product_id": 8034661663017,
          "name": "Size",
          "position": 1,
          "values": [
            "Small",
            "Medium",
            "Large",
            "XLvcs dbcfjsemvdncfjhdvxcmdfjsmnxbvcdujxdhbsvcjdbfmznxvehdcjg"
          ]
        },
        {
          "id": 10677572731177,
          "product_id": 8034661663017,
          "name": "Color",
          "position": 2,
          "values": [
            "blue",
            "black"
          ]
        },
        {
          "id": 11028469350697,
          "product_id": 8034661663017,
          "name": "Material",
          "position": 3,
          "values": [
            "silk"
          ]
        }
      ],
      "images": [
        {
          "url": "https://cdn.shopify.com/s/files/1/0688/4062/0329/products/20CRE60059-502547_1.jpg?v=1670419559"
        },
        {
          "url": "https://cdn.shopify.com/s/files/1/0688/4062/0329/products/20CRE60059-502547_3.jpg?v=1670419559"
        },
        {
          "url": "https://cdn.shopify.com/s/files/1/0688/4062/0329/products/20CRE60059-502547_5.jpg?v=1670419559"
        },
        {
          "url": "https://cdn.shopify.com/s/files/1/0688/4062/0329/products/20CRE60059-502547_6.jpg?v=1670419559"
        }
      ],
      
}

What’s Next