> ## 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.

# Shopify

> Manage products, orders, customers, inventory, collections, and discounts.

The Shopify connector lets your workflows interact with a Shopify store through the Admin API. Manage products, fulfil orders, update inventory, and more.

<Note>
  For the full API reference, see the [Shopify API documentation](https://shopify.dev/docs/api).
</Note>

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

## Connection setup

<Steps>
  <Step title="Create a custom app in Shopify">
    In your Shopify admin, go to **Settings → Apps and sales channels → Develop apps**. Click **Create an app** and give it a name (e.g., "Spojit Integration").
  </Step>

  <Step title="Configure API scopes">
    Click **Configure Admin API scopes** and enable the scopes your workflows need (e.g., `read_products`, `write_products`, `read_orders`, `write_orders`, `read_customers`, `write_customers`, `read_inventory`, `write_inventory`).
  </Step>

  <Step title="Install the app and copy the token">
    Click **Install app**, then copy the **Admin API access token**. This token is shown only once, so save it securely.
  </Step>

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

    * **Store Name**: Your store name (e.g., `my-store`, without `.myshopify.com`)
    * **Admin API Access Token**: The token you copied
    * **API Version** (optional): Defaults to the latest stable version
  </Step>
</Steps>

## Tools

### Shop

<AccordionGroup>
  <Accordion title="get-shop: Get store information">
    Returns store details including name, domain, currency, timezone, and plan.

    No parameters required.

    **Example request:**

    ```json theme={null}
    {
      "query": "{ shop { name primaryDomain { url host } email myshopifyDomain currencyCode plan { displayName } } }"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "shop": {
          "name": "My Store",
          "primaryDomain": {
            "url": "https://my-store.myshopify.com",
            "host": "my-store.myshopify.com"
          },
          "email": "owner@my-store.com",
          "myshopifyDomain": "my-store.myshopify.com",
          "currencyCode": "USD",
          "plan": {
            "displayName": "Basic Shopify"
          }
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### Products

<AccordionGroup>
  <Accordion title="list-products: List or search products">
    <ParamField body="query" type="string">
      Shopify search query (e.g., `status:active`, `title:shirt`). Optional.
    </ParamField>

    <ParamField body="first" type="number" default="20">
      Number of results to return (max 250).
    </ParamField>

    <ParamField body="after" type="string">
      Pagination cursor for the next page.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "query": "status:active",
      "first": 3
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "products": {
          "edges": [
            {
              "node": {
                "id": "gid://shopify/Product/1234567890",
                "title": "Classic Leather Jacket",
                "status": "ACTIVE",
                "vendor": "Acme Apparel",
                "productType": "Outerwear",
                "createdAt": "2024-01-15T10:30:00Z",
                "updatedAt": "2024-03-20T14:22:00Z",
                "tags": ["leather", "jacket", "premium"]
              },
              "cursor": "eyJsYXN0X2lkIjoxMjM0NTY3ODkwfQ=="
            },
            {
              "node": {
                "id": "gid://shopify/Product/1234567891",
                "title": "Cotton T-Shirt",
                "status": "ACTIVE",
                "vendor": "Acme Apparel",
                "productType": "Tops",
                "createdAt": "2024-02-01T08:00:00Z",
                "updatedAt": "2024-03-18T09:15:00Z",
                "tags": ["cotton", "t-shirt", "basics"]
              },
              "cursor": "eyJsYXN0X2lkIjoxMjM0NTY3ODkxfQ=="
            }
          ],
          "pageInfo": {
            "hasNextPage": true,
            "endCursor": "eyJsYXN0X2lkIjoxMjM0NTY3ODkxfQ=="
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="get-product: Get product by ID">
    Returns full product details including variants and images.

    <ParamField body="id" type="string" required>
      Product ID (numeric or Shopify GID).
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": "gid://shopify/Product/1234567890"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "product": {
          "id": "gid://shopify/Product/1234567890",
          "title": "Classic Leather Jacket",
          "descriptionHtml": "<p>Premium full-grain leather jacket with satin lining.</p>",
          "vendor": "Acme Apparel",
          "productType": "Outerwear",
          "status": "ACTIVE",
          "tags": ["leather", "jacket", "premium"],
          "createdAt": "2024-01-15T10:30:00Z",
          "updatedAt": "2024-03-20T14:22:00Z",
          "variants": {
            "edges": [
              {
                "node": {
                  "id": "gid://shopify/ProductVariant/111111111",
                  "title": "Small / Black",
                  "price": "299.00",
                  "sku": "LJ-BLK-S",
                  "inventoryQuantity": 15
                }
              },
              {
                "node": {
                  "id": "gid://shopify/ProductVariant/222222222",
                  "title": "Medium / Black",
                  "price": "299.00",
                  "sku": "LJ-BLK-M",
                  "inventoryQuantity": 23
                }
              }
            ]
          },
          "images": {
            "edges": [
              {
                "node": {
                  "id": "gid://shopify/ProductImage/333333333",
                  "url": "https://cdn.shopify.com/s/files/1/0000/0001/products/leather-jacket.jpg",
                  "altText": "Classic Leather Jacket front view"
                }
              }
            ]
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="create-product: Create a new product">
    <ParamField body="title" type="string" required>
      Product title.
    </ParamField>

    <ParamField body="descriptionHtml" type="string">
      HTML description.
    </ParamField>

    <ParamField body="vendor" type="string">
      Vendor name.
    </ParamField>

    <ParamField body="productType" type="string">
      Product type.
    </ParamField>

    <ParamField body="tags" type="string[]">
      Product tags.
    </ParamField>

    <ParamField body="status" type="string" default="DRAFT">
      Product status: `ACTIVE`, `DRAFT`, or `ARCHIVED`.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "title": "Classic Leather Jacket",
      "descriptionHtml": "<p>Premium full-grain leather jacket with satin lining.</p>",
      "vendor": "Acme Apparel",
      "productType": "Outerwear",
      "tags": ["leather", "jacket", "premium"],
      "status": "DRAFT"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "productCreate": {
          "product": {
            "id": "gid://shopify/Product/1234567890",
            "title": "Classic Leather Jacket",
            "descriptionHtml": "<p>Premium full-grain leather jacket with satin lining.</p>",
            "vendor": "Acme Apparel",
            "productType": "Outerwear",
            "status": "DRAFT",
            "tags": ["leather", "jacket", "premium"],
            "createdAt": "2024-03-20T14:22:00Z"
          },
          "userErrors": []
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="update-product: Update an existing product">
    <ParamField body="id" type="string" required>
      Product ID.
    </ParamField>

    <ParamField body="title" type="string">
      New title.
    </ParamField>

    <ParamField body="descriptionHtml" type="string">
      New HTML description.
    </ParamField>

    <ParamField body="vendor" type="string">
      New vendor.
    </ParamField>

    <ParamField body="productType" type="string">
      New product type.
    </ParamField>

    <ParamField body="tags" type="string[]">
      New tags.
    </ParamField>

    <ParamField body="status" type="string">
      New status: `ACTIVE`, `DRAFT`, or `ARCHIVED`.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": "gid://shopify/Product/1234567890",
      "title": "Premium Leather Jacket",
      "status": "ACTIVE"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "productUpdate": {
          "product": {
            "id": "gid://shopify/Product/1234567890",
            "title": "Premium Leather Jacket",
            "status": "ACTIVE",
            "updatedAt": "2024-03-21T09:00:00Z"
          },
          "userErrors": []
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="delete-product: Permanently delete a product">
    <ParamField body="id" type="string" required>
      Product ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": "gid://shopify/Product/1234567890"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "productDelete": {
          "deletedProductId": "gid://shopify/Product/1234567890",
          "userErrors": []
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### Orders

<AccordionGroup>
  <Accordion title="list-orders: List or filter orders">
    <ParamField body="query" type="string">
      Shopify search query (e.g., `financial_status:paid`).
    </ParamField>

    <ParamField body="first" type="number" default="20">
      Number of results (max 250).
    </ParamField>

    <ParamField body="after" type="string">
      Pagination cursor.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "query": "financial_status:paid",
      "first": 5
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "orders": {
          "edges": [
            {
              "node": {
                "id": "gid://shopify/Order/4567890123",
                "name": "#1001",
                "createdAt": "2024-03-15T12:00:00Z",
                "displayFinancialStatus": "PAID",
                "displayFulfillmentStatus": "UNFULFILLED",
                "totalPriceSet": {
                  "shopMoney": {
                    "amount": "349.00",
                    "currencyCode": "USD"
                  }
                },
                "customer": {
                  "id": "gid://shopify/Customer/7890123456",
                  "displayName": "Jane Doe"
                }
              },
              "cursor": "eyJsYXN0X2lkIjo0NTY3ODkwMTIzfQ=="
            }
          ],
          "pageInfo": {
            "hasNextPage": true,
            "endCursor": "eyJsYXN0X2lkIjo0NTY3ODkwMTIzfQ=="
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="get-order: Get order by ID">
    <ParamField body="id" type="string" required>
      Order ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": "gid://shopify/Order/4567890123"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "order": {
          "id": "gid://shopify/Order/4567890123",
          "name": "#1001",
          "createdAt": "2024-03-15T12:00:00Z",
          "displayFinancialStatus": "PAID",
          "displayFulfillmentStatus": "UNFULFILLED",
          "note": null,
          "tags": [],
          "totalPriceSet": {
            "shopMoney": {
              "amount": "349.00",
              "currencyCode": "USD"
            }
          },
          "subtotalPriceSet": {
            "shopMoney": {
              "amount": "299.00",
              "currencyCode": "USD"
            }
          },
          "totalShippingPriceSet": {
            "shopMoney": {
              "amount": "50.00",
              "currencyCode": "USD"
            }
          },
          "totalTaxSet": {
            "shopMoney": {
              "amount": "0.00",
              "currencyCode": "USD"
            }
          },
          "customer": {
            "id": "gid://shopify/Customer/7890123456",
            "displayName": "Jane Doe",
            "email": "jane@example.com"
          },
          "lineItems": {
            "edges": [
              {
                "node": {
                  "title": "Classic Leather Jacket",
                  "quantity": 1,
                  "variant": {
                    "id": "gid://shopify/ProductVariant/111111111",
                    "title": "Small / Black",
                    "price": "299.00"
                  }
                }
              }
            ]
          },
          "shippingAddress": {
            "address1": "123 Main St",
            "city": "Portland",
            "province": "Oregon",
            "country": "United States",
            "zip": "97201"
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="update-order: Update order tags or notes">
    <ParamField body="id" type="string" required>
      Order ID.
    </ParamField>

    <ParamField body="tags" type="string[]">
      New tags.
    </ParamField>

    <ParamField body="note" type="string">
      New note.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": "gid://shopify/Order/4567890123",
      "tags": ["vip", "priority"],
      "note": "Customer requested gift wrapping"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "orderUpdate": {
          "order": {
            "id": "gid://shopify/Order/4567890123",
            "name": "#1001",
            "tags": ["vip", "priority"],
            "note": "Customer requested gift wrapping"
          },
          "userErrors": []
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="cancel-order: Cancel an order">
    <ParamField body="id" type="string" required>
      Order ID.
    </ParamField>

    <ParamField body="reason" type="string" default="OTHER">
      Cancel reason: `CUSTOMER`, `FRAUD`, `INVENTORY`, `DECLINED`, or `OTHER`.
    </ParamField>

    <ParamField body="refund" type="boolean" default="false">
      Issue a refund.
    </ParamField>

    <ParamField body="restock" type="boolean" default="false">
      Restock inventory.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": "gid://shopify/Order/4567890123",
      "reason": "CUSTOMER",
      "refund": true,
      "restock": true
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "orderCancel": {
          "order": {
            "id": "gid://shopify/Order/4567890123",
            "name": "#1001",
            "cancelledAt": "2024-03-21T10:30:00Z",
            "cancelReason": "CUSTOMER",
            "displayFinancialStatus": "REFUNDED",
            "displayFulfillmentStatus": "UNFULFILLED"
          },
          "orderCancelUserErrors": []
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="close-order: Close/complete an order">
    <ParamField body="id" type="string" required>
      Order ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": "gid://shopify/Order/4567890123"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "orderClose": {
          "order": {
            "id": "gid://shopify/Order/4567890123",
            "name": "#1001",
            "closed": true,
            "closedAt": "2024-03-21T11:00:00Z"
          },
          "userErrors": []
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### Customers

<AccordionGroup>
  <Accordion title="list-customers: List or search customers">
    <ParamField body="query" type="string">
      Shopify search query.
    </ParamField>

    <ParamField body="first" type="number" default="20">
      Number of results (max 250).
    </ParamField>

    <ParamField body="after" type="string">
      Pagination cursor.
    </ParamField>

    **Example request:**

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

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "customers": {
          "edges": [
            {
              "node": {
                "id": "gid://shopify/Customer/7890123456",
                "firstName": "Jane",
                "lastName": "Doe",
                "email": "jane@example.com",
                "phone": "+15551234567",
                "state": "ENABLED",
                "tags": ["vip"],
                "note": null,
                "numberOfOrders": "3",
                "createdAt": "2024-01-10T08:00:00Z",
                "updatedAt": "2024-03-20T14:00:00Z"
              },
              "cursor": "eyJsYXN0X2lkIjo3ODkwMTIzNDU2fQ=="
            }
          ],
          "pageInfo": {
            "hasNextPage": true,
            "endCursor": "eyJsYXN0X2lkIjo3ODkwMTIzNDU2fQ=="
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="get-customer: Get customer by ID">
    <ParamField body="id" type="string" required>
      Customer ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": "gid://shopify/Customer/7890123456"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "customer": {
          "id": "gid://shopify/Customer/7890123456",
          "firstName": "Jane",
          "lastName": "Doe",
          "email": "jane@example.com",
          "phone": "+15551234567",
          "state": "ENABLED",
          "tags": ["vip"],
          "note": "Preferred customer",
          "numberOfOrders": "3",
          "amountSpent": {
            "amount": "947.00",
            "currencyCode": "USD"
          },
          "createdAt": "2024-01-10T08:00:00Z",
          "updatedAt": "2024-03-20T14:00:00Z",
          "defaultAddress": {
            "address1": "123 Main St",
            "city": "Portland",
            "province": "Oregon",
            "country": "United States",
            "zip": "97201"
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="create-customer: Create a new customer">
    <ParamField body="firstName" type="string">
      First name.
    </ParamField>

    <ParamField body="lastName" type="string">
      Last name.
    </ParamField>

    <ParamField body="email" type="string">
      Email address.
    </ParamField>

    <ParamField body="phone" type="string">
      Phone number.
    </ParamField>

    <ParamField body="tags" type="string[]">
      Customer tags.
    </ParamField>

    <ParamField body="note" type="string">
      Internal note.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "firstName": "Jane",
      "lastName": "Doe",
      "email": "jane@example.com",
      "phone": "+15551234567",
      "tags": ["newsletter"],
      "note": "Signed up at trade show"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "customerCreate": {
          "customer": {
            "id": "gid://shopify/Customer/7890123456",
            "firstName": "Jane",
            "lastName": "Doe",
            "email": "jane@example.com",
            "phone": "+15551234567",
            "tags": ["newsletter"],
            "note": "Signed up at trade show",
            "createdAt": "2024-03-21T09:00:00Z"
          },
          "userErrors": []
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="update-customer: Update a customer">
    <ParamField body="id" type="string" required>
      Customer ID.
    </ParamField>

    <ParamField body="firstName" type="string">
      First name.
    </ParamField>

    <ParamField body="lastName" type="string">
      Last name.
    </ParamField>

    <ParamField body="email" type="string">
      Email address.
    </ParamField>

    <ParamField body="phone" type="string">
      Phone number.
    </ParamField>

    <ParamField body="tags" type="string[]">
      Customer tags.
    </ParamField>

    <ParamField body="note" type="string">
      Internal note.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": "gid://shopify/Customer/7890123456",
      "tags": ["vip", "newsletter"],
      "note": "Upgraded to VIP after 3rd purchase"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "customerUpdate": {
          "customer": {
            "id": "gid://shopify/Customer/7890123456",
            "firstName": "Jane",
            "lastName": "Doe",
            "tags": ["vip", "newsletter"],
            "note": "Upgraded to VIP after 3rd purchase",
            "updatedAt": "2024-03-21T09:30:00Z"
          },
          "userErrors": []
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### Collections

<AccordionGroup>
  <Accordion title="list-collections: List collections">
    <ParamField body="query" type="string">
      Shopify search query.
    </ParamField>

    <ParamField body="first" type="number" default="20">
      Number of results.
    </ParamField>

    <ParamField body="after" type="string">
      Pagination cursor.
    </ParamField>

    **Example request:**

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

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "collections": {
          "edges": [
            {
              "node": {
                "id": "gid://shopify/Collection/9876543210",
                "title": "Summer Collection",
                "descriptionHtml": "<p>Lightweight essentials for warm weather.</p>",
                "handle": "summer-collection",
                "sortOrder": "BEST_SELLING",
                "productsCount": {
                  "count": 12
                },
                "updatedAt": "2024-03-15T10:00:00Z"
              },
              "cursor": "eyJsYXN0X2lkIjo5ODc2NTQzMjEwfQ=="
            }
          ],
          "pageInfo": {
            "hasNextPage": true,
            "endCursor": "eyJsYXN0X2lkIjo5ODc2NTQzMjEwfQ=="
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="get-collection: Get collection by ID">
    <ParamField body="id" type="string" required>
      Collection ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": "gid://shopify/Collection/9876543210"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "collection": {
          "id": "gid://shopify/Collection/9876543210",
          "title": "Summer Collection",
          "descriptionHtml": "<p>Lightweight essentials for warm weather.</p>",
          "handle": "summer-collection",
          "sortOrder": "BEST_SELLING",
          "productsCount": {
            "count": 12
          },
          "updatedAt": "2024-03-15T10:00:00Z",
          "products": {
            "edges": [
              {
                "node": {
                  "id": "gid://shopify/Product/1234567891",
                  "title": "Cotton T-Shirt",
                  "status": "ACTIVE"
                }
              }
            ]
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="create-collection: Create a new collection">
    <ParamField body="title" type="string" required>
      Collection title.
    </ParamField>

    <ParamField body="descriptionHtml" type="string">
      HTML description.
    </ParamField>

    <ParamField body="sortOrder" type="string">
      Sort order for products in the collection.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "title": "Summer Collection",
      "descriptionHtml": "<p>Lightweight essentials for warm weather.</p>",
      "sortOrder": "BEST_SELLING"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "collectionCreate": {
          "collection": {
            "id": "gid://shopify/Collection/9876543210",
            "title": "Summer Collection",
            "descriptionHtml": "<p>Lightweight essentials for warm weather.</p>",
            "handle": "summer-collection",
            "sortOrder": "BEST_SELLING",
            "updatedAt": "2024-03-21T09:00:00Z"
          },
          "userErrors": []
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### Inventory

<AccordionGroup>
  <Accordion title="get-inventory-levels: Get inventory quantities">
    Returns inventory quantities across all locations.

    <ParamField body="inventoryItemId" type="string" required>
      Inventory Item ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "inventoryItemId": "gid://shopify/InventoryItem/5555555555"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "inventoryItem": {
          "id": "gid://shopify/InventoryItem/5555555555",
          "tracked": true,
          "sku": "LJ-BLK-S",
          "inventoryLevels": {
            "edges": [
              {
                "node": {
                  "id": "gid://shopify/InventoryLevel/88888888?inventory_item_id=5555555555",
                  "quantities": [
                    {
                      "name": "available",
                      "quantity": 15
                    },
                    {
                      "name": "committed",
                      "quantity": 3
                    },
                    {
                      "name": "on_hand",
                      "quantity": 18
                    }
                  ],
                  "location": {
                    "id": "gid://shopify/Location/6666666666",
                    "name": "Main Warehouse"
                  }
                }
              }
            ]
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="adjust-inventory: Adjust inventory quantity">
    <ParamField body="inventoryItemId" type="string" required>
      Inventory Item ID.
    </ParamField>

    <ParamField body="locationId" type="string" required>
      Location ID.
    </ParamField>

    <ParamField body="delta" type="number" required>
      Quantity change (positive to add, negative to subtract).
    </ParamField>

    <ParamField body="reason" type="string" default="correction">
      Adjustment reason code. Valid values: `correction`, `cycle_count_available`, `damaged`, `movement_created`, `movement_received`, `movement_updated`, `other`, `promotion`, `quality_control`, `received`, `reservation_created`, `reservation_deleted`, `reservation_updated`, `restock`, `safety_stock`, `shrinkage`.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "inventoryItemId": "gid://shopify/InventoryItem/5555555555",
      "locationId": "gid://shopify/Location/6666666666",
      "delta": 10,
      "reason": "correction"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "inventoryAdjustQuantities": {
          "changes": [
            {
              "name": "available",
              "delta": 10,
              "quantityAfterChange": 25,
              "item": {
                "id": "gid://shopify/InventoryItem/5555555555",
                "sku": "LJ-BLK-S"
              },
              "location": {
                "id": "gid://shopify/Location/6666666666",
                "name": "Main Warehouse"
              }
            }
          ],
          "userErrors": []
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### Discounts

<AccordionGroup>
  <Accordion title="list-discounts: List discount codes">
    <ParamField body="first" type="number" default="20">
      Number of results (max 250).
    </ParamField>

    <ParamField body="after" type="string">
      Pagination cursor.
    </ParamField>

    **Example request:**

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

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "codeDiscountNodes": {
          "edges": [
            {
              "node": {
                "id": "gid://shopify/DiscountCodeNode/1111111111",
                "codeDiscount": {
                  "title": "SUMMER20",
                  "status": "ACTIVE",
                  "startsAt": "2024-06-01T00:00:00Z",
                  "endsAt": "2024-08-31T23:59:59Z",
                  "usageLimit": 1000,
                  "asyncUsageCount": 142,
                  "appliesOncePerCustomer": true,
                  "codes": {
                    "edges": [
                      {
                        "node": {
                          "code": "SUMMER20"
                        }
                      }
                    ]
                  }
                }
              },
              "cursor": "eyJsYXN0X2lkIjoxMTExMTExMTExfQ=="
            }
          ],
          "pageInfo": {
            "hasNextPage": false,
            "endCursor": "eyJsYXN0X2lkIjoxMTExMTExMTExfQ=="
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="create-discount: Create a discount code">
    <ParamField body="title" type="string" required>
      Discount title.
    </ParamField>

    <ParamField body="code" type="string" required>
      Discount code customers will enter.
    </ParamField>

    <ParamField body="type" type="string" required>
      Discount type: `percentage` or `fixed`.
    </ParamField>

    <ParamField body="value" type="number" required>
      Discount value. For `percentage` type, use a decimal (e.g., `0.2` for 20%). For `fixed` type, use the currency amount (e.g., `10` for \$10 off).
    </ParamField>

    <ParamField body="startsAt" type="string">
      Start date (ISO 8601).
    </ParamField>

    <ParamField body="endsAt" type="string">
      End date (ISO 8601).
    </ParamField>

    <ParamField body="usageLimit" type="number">
      Maximum number of uses.
    </ParamField>

    <ParamField body="appliesOncePerCustomer" type="boolean" default="false">
      Limit to one use per customer.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "title": "SUMMER20",
      "code": "SUMMER20",
      "type": "percentage",
      "value": 0.2,
      "startsAt": "2024-06-01T00:00:00Z",
      "endsAt": "2024-08-31T23:59:59Z",
      "usageLimit": 1000,
      "appliesOncePerCustomer": true
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "discountCodeBasicCreate": {
          "codeDiscountNode": {
            "id": "gid://shopify/DiscountCodeNode/1111111111",
            "codeDiscount": {
              "title": "SUMMER20",
              "status": "ACTIVE",
              "startsAt": "2024-06-01T00:00:00Z",
              "endsAt": "2024-08-31T23:59:59Z",
              "usageLimit": 1000,
              "appliesOncePerCustomer": true,
              "codes": {
                "edges": [
                  {
                    "node": {
                      "code": "SUMMER20"
                    }
                  }
                ]
              }
            }
          },
          "userErrors": []
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="delete-discount: Delete a discount code">
    <ParamField body="id" type="string" required>
      Discount node ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": "gid://shopify/DiscountCodeNode/1111111111"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "discountCodeDelete": {
          "deletedCodeDiscountId": "gid://shopify/DiscountCodeNode/1111111111",
          "userErrors": []
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### Advanced

<AccordionGroup>
  <Accordion title="raw-graphql: Execute arbitrary GraphQL">
    Run any GraphQL query or mutation against the Shopify Admin API.

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

    <ParamField body="variables" type="object">
      GraphQL variables.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "query": "query ($first: Int!) { products(first: $first) { edges { node { id title status } } } }",
      "variables": {
        "first": 5
      }
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "data": {
        "products": {
          "edges": [
            {
              "node": {
                "id": "gid://shopify/Product/1234567890",
                "title": "Classic Leather Jacket",
                "status": "ACTIVE"
              }
            },
            {
              "node": {
                "id": "gid://shopify/Product/1234567891",
                "title": "Cotton T-Shirt",
                "status": "ACTIVE"
              }
            }
          ]
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>
