# scandipwa/quote-graphql

> N/A

`composer require scandipwa/quote-graphql`

Canonical URL: https://packagento.com/scandipwa/quote-graphql

## At a glance

- **Vendor**: scandipwa (https://packagento.com/scandipwa.md)
- **Latest version**: 3.1.0 — released 2024-07-14
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/scandipwa/quote-graphql and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require scandipwa/quote-graphql:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

N/A

## README

**QuoteGraphQl** provides basic types and resolvers for Checkout steps.

### Endpoint description

All endpoints here should accept the same data as the API does. For an api reference, please follow [this link](https://devdocs.magento.com/redoc/2.3/customer-rest-api.html#operation/quoteGuestCartItemRepositoryV1SavePost)

> **IMPORTANT NOTE**: every following mutation and query work without specifying the `quote_id` param (or `quoteId`). If none quote id is specified the resolver will attempt to load the quote id from Auth header, where auth token should be present. If quoteId is passed, it will treat it as a guest request, so the `quote_id` should be encoded.

> **IMPORTANT NOTE**: this endpoint is an alternative for [Magento 2 GraphQL Quote endpoint](https://devdocs.magento.com/guides/v2.3/graphql/reference/quote.html) that is storing `quote_id` for authorized customer on server (using _state-full_ approach).

#### getCartForCustomer

This endpoint allows to get full cart data (items + totals).

```graphql
query GetCartForCustomer ($_guestCartId_0: String) {
    getCartForCustomer(guestCartId: $_guestCartId_0) {
        id
        tax_amount
        subtotal
        discount_amount
        subtotal_with_discount
        grand_total
        items {
            item_id
            qty
            product {
                price {
                    maximalPrice {
                        amount {
                            value
                            currency
                        }
                        adjustments {
                            code
                            amount {
                                value
                                currency
                            }
                        }
                    }
                }
            }
        }
    }
}
```

```json
{
  "_guestCartId_0":"xIXmScRLWb5ntIEsYe2ymzrVXYraivGx"
}
```

#### saveCartItem

type `cartItem` now implements sub-type of CartItemId, that allows to reference by one of many:
item_id or product SKU. This will become non-nullable in the future releases, when "sku" and "item_id" will be dropped. 

This endpoint allows to submit items to cart following the default API payload schema. In beneath example is a simple product option addition to cart.

```graphql
mutation SaveCartItem ($_cartItem_0: CartItemInput!, $_guestCartId_0: String) {
    saveCartItem(cartItem: $_cartItem_0, guestCartId: $_guestCartId_0) {
        getCartForCustomer(guestCartId: $_guestCartId_0) {
            id
            tax_amount
            subtotal
            discount_amount
            subtotal_with_discount
            grand_total
            items {
                item_id
                qty
                product {
                    price {
                        maximalPrice {
                            amount {
                                value
                                currency
                            }
                            adjustments {
                                code
                                amount {
                                    value
                                    currency
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```

```json
{
  "_cartItem_0":{
    "sku":"Test simple product",
    "product_type":"simple",
    "qty":1,
    "product_option": {
        "extension_attributes":{}
    }
  },
  "_guestCartId_0":"xIXmScRLWb5ntIEsYe2ymzrVXYraivGx"
}
```

#### removeCartItem

```graphql
mutation RemoveCartItem($item_id: Int!, $_guestCartId_0: String) {
    removeCartItem(item_id: $item_id, guestCartId: $_guestCartId_0) {
        getCartForCustomer(guestCartId: $_guestCartId_0) {
            id
            tax_amount
            subtotal
            discount_amount
            subtotal_with_discount
            grand_total
            items {
                item_id
                qty
                product {
                    price {
                        maximalPrice {
                            amount {
                                value
                                currency
                            }
                            adjustments {
                                code
                                amount {
                                    value
                                    currency
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```

```json
{
   "item_id": 1,
   "quoteId": "s44Xcnya8dmbysAeNTOozFsZCh8tyCH9"
}
```

#### estimateShippingCosts

```graphql
mutation EstimateShippingCosts(
    $guestCartId: String!
    $address: EstimateShippingCostsAddress!
) {
    estimateShippingCosts(address: $address, guestCartId: $guestCartId) {
        carrier_code
        method_code
        carrier_title
        method_title
        error_message
        amount
        base_amount
        price_excl_tax
        price_incl_tax
        available
    }
}
```

```json
{
  "guestCartId": "s44Xcnya8dmbysAeNTOozFsZCh8tyCH9",
  "address": {
      "region": "New York",
      "region_id": 43,
      "region_code": "NY",
      "country_id": "US",
      "street": [
      	"123 Oak Ave"
      ],
      "postcode": "10577",
      "city": "Purchase",
      "firstname": "Jane",
      "lastname": "Doe",
      "customer_id": 4,
      "email": "jdoe@example.com",
      "telephone": "(512) 555-1111",
      "same_as_billing": 1
  }
}
```

#### saveAddressInformation

_(README truncated for .md surface. Full README on https://packagento.com/scandipwa/quote-graphql.)_

## Recent Versions

| Version | Released |
|---|---|
| 3.1.0 | 2024-07-14 |
| 3.0.6 | 2024-04-04 |
| 3.0.5 | 2022-09-14 |
| 3.0.4 | 2022-08-04 |
| 3.0.3 | 2022-08-01 |
| 3.0.2 | 2022-07-27 |
| 3.0.1 | 2022-07-27 |
| 3.0.0 | 2022-07-18 |
| 2.19.26 | 2022-06-09 |
| 2.19.25 | 2022-05-26 |

Showing 10 of 85 versions. Full release history on https://packagento.com/scandipwa/quote-graphql.

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magento/framework | * |
| magento/module-authorization | * |
| magento/module-bundle | * |
| magento/module-bundle-graph-ql | ^100.3 |
| magento/module-catalog-rule | * |
| magento/module-checkout | * |
| magento/module-customer | * |
| magento/module-integration | * |
| magento/module-inventory-configuration-api | * |
| magento/module-inventory-reservations-api | * |
| magento/module-inventory-sales-api | * |
| magento/module-quote | * |
| magento/module-quote-graph-ql | ^100.3 |
| magento/module-sales | * |
| magento/module-webapi | * |
| scandipwa/performance | ^1.0 |

## Quality

Latest release (3.1.0) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 1 | 1 | – | – |
| 2.4.8 | – | 1 | 1 | – |
| 2.4.9 | – | – | 1 | 1 |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Fail | 119 | 1 error, 118 warnings (ruleset: Magento2) — 75 auto-fixable with phpcbf |
| PHPMD | Warning | 55 | 55 rule violations (UnusedFormalParameter:44, MissingImport:7, UnusedLocalVariable:3, ExcessiveParameterList:1) |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 13 | valid; 13 advisory notes (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 10 | 10 | – | – |
| 2.4.8 | – | 10 | 12 | – |
| 2.4.9 | – | – | 12 | 12 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["scandipwa/quote-graphql"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

scandipwa is a Magento 2 vendor on Packagento. See https://packagento.com/scandipwa.md for their full catalogue.

