> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spojit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Adobe Commerce GraphQL

> Storefront operations: product search, cart, checkout, customer self-service, and CMS.

The Adobe Commerce GraphQL connector lets your workflows interact with a Magento 2 / Adobe Commerce store via the GraphQL API. Best for storefront operations: product catalog browsing, cart and checkout flows, and customer self-service. Returns only the fields you request.

<Note>
  For admin/back-office operations like order management, inventory updates, shipments, and invoices, use the [Adobe Commerce REST](/connectors/integrations/adobe-commerce-rest) connector instead, which covers the full Magento admin API surface.
</Note>

<Note>
  For the full API reference, see the [Adobe Commerce GraphQL API documentation](https://developer.adobe.com/commerce/webapi/graphql/).
</Note>

<Snippet file="connection-note.mdx" />

## Connection setup

<Steps>
  <Step title="Create an Integration in Magento Admin">
    Go to **System → Integrations → Add New Integration**. Give it a name (e.g., "Spojit") and configure the **API** tab to grant access to the resources your workflows need.
  </Step>

  <Step title="Activate and copy the tokens">
    Click **Activate** on the integration. Copy the **Access Token**. This is a permanent token that works until revoked.
  </Step>

  <Step title="Add the connection in Spojit">
    Go to **Connections** in Spojit, click **Add Connection**, select **Adobe Commerce GraphQL**, and enter:

    * **Base URL**: Your store URL (e.g., `https://mystore.com`)
    * **Access Token**: The integration access token
    * **Store Code** (optional): Defaults to `default`
  </Step>
</Steps>

## Tools

### Catalog

<AccordionGroup>
  <Accordion title="search-products: Search products">
    <ParamField body="search" type="string">
      Search term.
    </ParamField>

    <ParamField body="categoryId" type="string">
      Filter by category UID.
    </ParamField>

    <ParamField body="minPrice" type="number">
      Minimum price filter.
    </ParamField>

    <ParamField body="maxPrice" type="number">
      Maximum price filter.
    </ParamField>

    <ParamField body="pageSize" type="number" default="20">
      Results per page.
    </ParamField>

    <ParamField body="currentPage" type="number" default="1">
      Page number.
    </ParamField>

    <ParamField body="fields" type="string">
      Custom GraphQL fields for product items; use GraphQL field syntax including nested selections (e.g., `sku name price_range { minimum_price { final_price { value currency } } }`). If omitted, returns: uid, sku, name, type\_id, stock\_status, price\_range, small\_image, short\_description, categories, url\_key.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "search": "shirt",
      "pageSize": 2,
      "currentPage": 1
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "products": {
          "total_count": 15,
          "items": [
            {
              "uid": "NDI=",
              "sku": "WS-001",
              "name": "Blue Cotton Shirt",
              "type_id": "simple",
              "stock_status": "IN_STOCK",
              "price_range": {
                "minimum_price": {
                  "regular_price": { "value": 29.99, "currency": "USD" },
                  "final_price": { "value": 29.99, "currency": "USD" },
                  "discount": { "amount_off": 0, "percent_off": 0 }
                }
              },
              "small_image": { "url": "https://mystore.com/media/catalog/product/w/s/ws-001.jpg", "label": "Blue Cotton Shirt" },
              "short_description": { "html": "<p>Lightweight blue cotton shirt.</p>" },
              "categories": [
                { "uid": "NQ==", "name": "Tops", "url_path": "men/tops" }
              ],
              "url_key": "blue-cotton-shirt"
            }
          ],
          "page_info": {
            "current_page": 1,
            "page_size": 2,
            "total_pages": 8
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="get-product-detail: Get product by SKU">
    <ParamField body="sku" type="string" required>
      Product SKU.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "sku": "WS-001"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "products": {
          "items": [
            {
              "uid": "NDI=",
              "sku": "WS-001",
              "name": "Blue Cotton Shirt",
              "type_id": "simple",
              "stock_status": "IN_STOCK",
              "meta_title": "Blue Cotton Shirt",
              "meta_description": "Shop our blue cotton shirt, lightweight and comfortable.",
              "url_key": "blue-cotton-shirt",
              "price_range": {
                "minimum_price": {
                  "regular_price": { "value": 29.99, "currency": "USD" },
                  "final_price": { "value": 29.99, "currency": "USD" },
                  "discount": { "amount_off": 0, "percent_off": 0 }
                },
                "maximum_price": {
                  "regular_price": { "value": 29.99, "currency": "USD" },
                  "final_price": { "value": 29.99, "currency": "USD" }
                }
              },
              "description": { "html": "<p>A comfortable blue cotton shirt, perfect for warm weather.</p>" },
              "short_description": { "html": "<p>Lightweight blue cotton shirt.</p>" },
              "media_gallery": [
                { "url": "https://mystore.com/media/catalog/product/w/s/ws-001-front.jpg", "label": "Front view", "position": 1, "disabled": false },
                { "url": "https://mystore.com/media/catalog/product/w/s/ws-001-back.jpg", "label": "Back view", "position": 2, "disabled": false }
              ],
              "categories": [
                { "uid": "NQ==", "name": "Tops", "url_path": "men/tops", "level": 3 }
              ],
              "related_products": [
                { "uid": "NDM=", "sku": "WS-003", "name": "Green Cotton Shirt" }
              ],
              "crosssell_products": [],
              "upsell_products": []
            }
          ]
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="get-categories: List categories">
    <ParamField body="parentId" type="string">
      Parent category UID to filter children.
    </ParamField>

    <ParamField body="name" type="string">
      Filter categories by name.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "parentId": "Mg=="
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "categories": {
          "total_count": 4,
          "items": [
            {
              "uid": "Mw==",
              "name": "Men",
              "level": 2,
              "path": "1/2/3",
              "url_path": "men",
              "children_count": "3",
              "product_count": 45,
              "children": [
                { "uid": "NQ==", "name": "Tops", "level": 3, "url_path": "men/tops", "product_count": 20 },
                { "uid": "Ng==", "name": "Bottoms", "level": 3, "url_path": "men/bottoms", "product_count": 15 }
              ]
            },
            {
              "uid": "NA==",
              "name": "Women",
              "level": 2,
              "path": "1/2/4",
              "url_path": "women",
              "children_count": "2",
              "product_count": 60,
              "children": [
                { "uid": "Nw==", "name": "Dresses", "level": 3, "url_path": "women/dresses", "product_count": 30 }
              ]
            }
          ]
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="get-category: Get category by ID">
    <ParamField body="id" type="number" required>
      Category ID.
    </ParamField>

    <ParamField body="pageSize" type="number" default="20">
      Products per page.
    </ParamField>

    <ParamField body="currentPage" type="number" default="1">
      Product page number.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": 5
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "category": {
          "uid": "NQ==",
          "name": "Tops",
          "description": "<p>Browse our collection of tops for men.</p>",
          "level": 3,
          "path": "1/2/3/5",
          "url_path": "men/tops",
          "image": "https://mystore.com/media/catalog/category/tops-banner.jpg",
          "product_count": 20,
          "children": [
            { "uid": "OA==", "name": "T-Shirts", "url_path": "men/tops/t-shirts", "product_count": 12 },
            { "uid": "OQ==", "name": "Polos", "url_path": "men/tops/polos", "product_count": 8 }
          ],
          "products": {
            "total_count": 20,
            "items": [
              {
                "uid": "NDI=",
                "sku": "WS-001",
                "name": "Blue Cotton Shirt",
                "stock_status": "IN_STOCK",
                "price_range": {
                  "minimum_price": {
                    "regular_price": { "value": 29.99, "currency": "USD" },
                    "final_price": { "value": 29.99, "currency": "USD" }
                  }
                },
                "small_image": { "url": "https://mystore.com/media/catalog/product/w/s/ws-001.jpg", "label": "Blue Cotton Shirt" }
              }
            ],
            "page_info": {
              "current_page": 1,
              "page_size": 20,
              "total_pages": 1
            }
          }
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### Cart & Checkout

<AccordionGroup>
  <Accordion title="create-cart: Create empty cart">
    Creates an empty cart and returns the cart ID. No parameters required.

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "createEmptyCart": "aGVsbG8gd29ybGQ="
      }
    }
    ```
  </Accordion>

  <Accordion title="add-to-cart: Add products to cart">
    <ParamField body="cartId" type="string" required>
      Cart ID.
    </ParamField>

    <ParamField body="items" type="array" required>
      Array of `{ sku, quantity }` objects.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "cartId": "aGVsbG8gd29ybGQ=",
      "items": [
        { "sku": "WS-001", "quantity": 2 },
        { "sku": "WS-003", "quantity": 1 }
      ]
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "addProductsToCart": {
          "cart": {
            "id": "aGVsbG8gd29ybGQ=",
            "total_quantity": 3,
            "items": [
              {
                "uid": "MQ==",
                "quantity": 2,
                "product": { "sku": "WS-001", "name": "Blue Cotton Shirt" },
                "prices": {
                  "price": { "value": 29.99, "currency": "USD" },
                  "row_total": { "value": 59.98, "currency": "USD" }
                }
              },
              {
                "uid": "Mg==",
                "quantity": 1,
                "product": { "sku": "WS-003", "name": "Green Cotton Shirt" },
                "prices": {
                  "price": { "value": 34.99, "currency": "USD" },
                  "row_total": { "value": 34.99, "currency": "USD" }
                }
              }
            ],
            "prices": {
              "grand_total": { "value": 94.97, "currency": "USD" },
              "subtotal_excluding_tax": { "value": 94.97, "currency": "USD" },
              "applied_taxes": [],
              "discounts": []
            }
          },
          "user_errors": []
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="get-cart: Get cart contents">
    <ParamField body="cartId" type="string" required>
      Cart ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "cartId": "aGVsbG8gd29ybGQ="
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "cart": {
          "id": "aGVsbG8gd29ybGQ=",
          "email": null,
          "total_quantity": 3,
          "items": [
            {
              "uid": "MQ==",
              "quantity": 2,
              "product": {
                "uid": "NDI=",
                "sku": "WS-001",
                "name": "Blue Cotton Shirt",
                "small_image": { "url": "https://mystore.com/media/catalog/product/w/s/ws-001.jpg" }
              },
              "prices": {
                "price": { "value": 29.99, "currency": "USD" },
                "row_total": { "value": 59.98, "currency": "USD" }
              }
            }
          ],
          "prices": {
            "grand_total": { "value": 99.97, "currency": "USD" },
            "subtotal_excluding_tax": { "value": 94.97, "currency": "USD" },
            "subtotal_including_tax": { "value": 94.97, "currency": "USD" },
            "applied_taxes": [],
            "discounts": []
          },
          "shipping_addresses": [],
          "billing_address": null,
          "selected_payment_method": { "code": "", "title": "" },
          "available_payment_methods": [
            { "code": "checkmo", "title": "Check / Money order" },
            { "code": "cashondelivery", "title": "Cash On Delivery" }
          ]
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="set-shipping-address: Set shipping address">
    <ParamField body="cartId" type="string" required>Cart ID.</ParamField>

    <ParamField body="address" type="object" required>
      Address object with `firstname`, `lastname`, `street`, `city`, `region`, `regionId`, `postcode`, `countryCode`, `telephone`.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "cartId": "aGVsbG8gd29ybGQ=",
      "address": {
        "firstname": "Jane",
        "lastname": "Smith",
        "street": ["123 Main St"],
        "city": "Austin",
        "region": "TX",
        "postcode": "73301",
        "countryCode": "US",
        "telephone": "5125551234"
      }
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "setShippingAddressesOnCart": {
          "cart": {
            "id": "aGVsbG8gd29ybGQ=",
            "shipping_addresses": [
              {
                "firstname": "Jane",
                "lastname": "Smith",
                "street": ["123 Main St"],
                "city": "Austin",
                "region": { "code": "TX", "label": "Texas" },
                "postcode": "73301",
                "country": { "code": "US", "label": "US" },
                "telephone": "5125551234",
                "available_shipping_methods": [
                  {
                    "carrier_code": "flatrate",
                    "carrier_title": "Flat Rate",
                    "method_code": "flatrate",
                    "method_title": "Fixed",
                    "amount": { "value": 5.00, "currency": "USD" }
                  },
                  {
                    "carrier_code": "freeshipping",
                    "carrier_title": "Free Shipping",
                    "method_code": "freeshipping",
                    "method_title": "Free",
                    "amount": { "value": 0.00, "currency": "USD" }
                  }
                ]
              }
            ]
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="set-shipping-method: Set shipping method">
    <ParamField body="cartId" type="string" required>Cart ID.</ParamField>
    <ParamField body="carrierCode" type="string" required>Carrier code (e.g., `flatrate`).</ParamField>
    <ParamField body="methodCode" type="string" required>Method code (e.g., `flatrate`).</ParamField>

    **Example request:**

    ```json theme={null}
    {
      "cartId": "aGVsbG8gd29ybGQ=",
      "carrierCode": "flatrate",
      "methodCode": "flatrate"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "setShippingMethodsOnCart": {
          "cart": {
            "id": "aGVsbG8gd29ybGQ=",
            "shipping_addresses": [
              {
                "selected_shipping_method": {
                  "carrier_code": "flatrate",
                  "carrier_title": "Flat Rate",
                  "method_code": "flatrate",
                  "method_title": "Fixed",
                  "amount": { "value": 5.00, "currency": "USD" }
                }
              }
            ],
            "prices": {
              "grand_total": { "value": 99.97, "currency": "USD" }
            }
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="place-order: Place order">
    Sets the payment method and places the order.
    <ParamField body="cartId" type="string" required>Cart ID.</ParamField>
    <ParamField body="paymentMethodCode" type="string" required>Payment method code (e.g., `checkmo`).</ParamField>

    **Example request:**

    ```json theme={null}
    {
      "cartId": "aGVsbG8gd29ybGQ=",
      "paymentMethodCode": "checkmo"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "placeOrder": {
          "order": {
            "order_number": "000000101"
          }
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### Customer

<AccordionGroup>
  <Accordion title="create-customer: Register customer">
    <ParamField body="firstname" type="string" required>First name.</ParamField>
    <ParamField body="lastname" type="string" required>Last name.</ParamField>
    <ParamField body="email" type="string" required>Email address.</ParamField>
    <ParamField body="password" type="string" required>Password.</ParamField>

    **Example request:**

    ```json theme={null}
    {
      "firstname": "John",
      "lastname": "Doe",
      "email": "john@example.com",
      "password": "SecurePass123!"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "createCustomerV2": {
          "customer": {
            "firstname": "John",
            "lastname": "Doe",
            "email": "john@example.com",
            "is_subscribed": false,
            "created_at": "2025-04-01 14:00:00"
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="get-customer: Get current customer">
    Get the profile of the currently authenticated customer. Requires a customer token.

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "customer": {
          "firstname": "John",
          "lastname": "Doe",
          "email": "john@example.com",
          "date_of_birth": "1990-05-15",
          "gender": 1,
          "is_subscribed": false,
          "created_at": "2025-04-01 14:00:00",
          "addresses": [
            {
              "id": 1,
              "firstname": "John",
              "lastname": "Doe",
              "street": ["456 Oak Ave"],
              "city": "Portland",
              "region": { "region_code": "OR", "region": "Oregon" },
              "postcode": "97201",
              "country_code": "US",
              "telephone": "5035559876",
              "default_shipping": true,
              "default_billing": true
            }
          ],
          "orders": {
            "total_count": 3,
            "items": [
              {
                "order_number": "000000101",
                "order_date": "2025-03-28 16:42:00",
                "status": "Complete",
                "total": {
                  "grand_total": { "value": 99.97, "currency": "USD" }
                }
              }
            ]
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="update-customer: Update customer">
    <ParamField body="firstname" type="string">First name.</ParamField>
    <ParamField body="lastname" type="string">Last name.</ParamField>
    <ParamField body="email" type="string">Email.</ParamField>
    <ParamField body="dateOfBirth" type="string">Date of birth (`YYYY-MM-DD`).</ParamField>
    <ParamField body="gender" type="number">Gender: `1` = Male, `2` = Female, `3` = Not Specified.</ParamField>
    <ParamField body="isSubscribed" type="boolean">Newsletter subscription.</ParamField>

    **Example request:**

    ```json theme={null}
    {
      "firstname": "Jonathan",
      "lastname": "Doe"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "updateCustomerV2": {
          "customer": {
            "firstname": "Jonathan",
            "lastname": "Doe",
            "email": "john@example.com",
            "is_subscribed": false,
            "date_of_birth": "1990-05-15",
            "gender": 1
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="generate-customer-token: Get customer token">
    <ParamField body="email" type="string" required>Customer email.</ParamField>
    <ParamField body="password" type="string" required>Customer password.</ParamField>

    **Example request:**

    ```json theme={null}
    {
      "email": "john@example.com",
      "password": "SecurePass123!"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "generateCustomerToken": {
          "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### Store & CMS

<AccordionGroup>
  <Accordion title="get-store-config: Get store configuration">
    Returns store name, locale, currency, base URLs, and other settings.

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "storeConfig": {
          "store_code": "default",
          "store_name": "Main Website Store",
          "store_group_name": "Main Website Store",
          "website_name": "Main Website",
          "locale": "en_US",
          "base_currency_code": "USD",
          "default_display_currency_code": "USD",
          "timezone": "America/Chicago",
          "weight_unit": "lbs",
          "base_url": "https://mystore.com/",
          "base_link_url": "https://mystore.com/",
          "base_media_url": "https://mystore.com/media/",
          "secure_base_url": "https://mystore.com/",
          "secure_base_link_url": "https://mystore.com/",
          "copyright": "Copyright 2025 My Store. All rights reserved.",
          "head_shortcut_icon": "favicon.ico",
          "default_title": "My Store",
          "default_description": "Shop the latest products at My Store.",
          "default_keywords": "store, shop, ecommerce"
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="get-cms-page: Get CMS page">
    <ParamField body="identifier" type="string" required>
      CMS page identifier (e.g., `home`, `about-us`).
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "identifier": "about-us"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "cmsPage": {
          "identifier": "about-us",
          "url_key": "about-us",
          "title": "About Us",
          "content": "<div class=\"about-page\"><h2>Our Story</h2><p>We started in 2020...</p></div>",
          "content_heading": "About Us",
          "page_layout": "1column",
          "meta_title": "About Us - My Store",
          "meta_description": "Learn about our company and mission.",
          "meta_keywords": "about, company, story"
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="get-countries: Get available countries">
    Returns a list of all available countries with regions.

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "countries": [
          {
            "id": "US",
            "two_letter_abbreviation": "US",
            "three_letter_abbreviation": "USA",
            "full_name_locale": "United States",
            "full_name_english": "United States",
            "available_regions": [
              { "id": 1, "code": "AL", "name": "Alabama" },
              { "id": 12, "code": "CA", "name": "California" },
              { "id": 43, "code": "TX", "name": "Texas" }
            ]
          },
          {
            "id": "GB",
            "two_letter_abbreviation": "GB",
            "three_letter_abbreviation": "GBR",
            "full_name_locale": "United Kingdom",
            "full_name_english": "United Kingdom",
            "available_regions": []
          }
        ]
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### Advanced

<AccordionGroup>
  <Accordion title="raw-graphql: Execute any GraphQL query">
    Execute any Adobe Commerce GraphQL query or mutation not covered by other tools.

    See the [Adobe Commerce GraphQL reference](https://developer.adobe.com/commerce/webapi/graphql/reference/) for the full schema.

    <ParamField body="query" type="string" required>
      GraphQL query or mutation string.
    </ParamField>

    <ParamField body="variables" type="object">
      Variables object for the query.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "query": "query GetUrlResolver($url: String!) { urlResolver(url: $url) { id type redirect_code relative_url } }",
      "variables": { "url": "blue-cotton-shirt.html" }
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "urlResolver": {
          "id": 42,
          "type": "PRODUCT",
          "redirect_code": 0,
          "relative_url": "blue-cotton-shirt.html"
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>
