@doswiftly/storefront-operations 8.0.0 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/operations.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "schemaVersion": "8.0.0",
2
+ "schemaVersion": "10.0.0",
3
3
  "queries": [
4
4
  {
5
5
  "name": "Shop",
@@ -325,21 +325,24 @@
325
325
  "body": "query CustomerOrder($orderId: ID!) {\n customerOrder(orderId: $orderId) {\n ...Order\n }\n}"
326
326
  },
327
327
  {
328
- "name": "Checkout",
328
+ "name": "CartValidateDiscountCode",
329
329
  "kind": "query",
330
- "section": "Checkout",
331
- "description": "Fetches a checkout session by `id`. **Important**: `checkoutId` and `cartId` are 1:1 there is no separate \"checkout\" record, the response is built dynamically from the cart. Returns line items, addresses, selected shipping rate, available shipping rates + payment methods, applied discount/gift cards (gift card codes are masked for security), and totals (`cost`, `tax`, `paymentDue`). Public read; ownership enforced on mutations. Refetch after every checkout mutation.",
330
+ "section": "Discount Code Validation",
331
+ "description": "Read-only validation of a discount code against an existing cart does NOT modify cart state. Returns `{ isValid, discount, error }` (`DiscountValidationResult`) for previewing the effect of a code (inline UI feedback as the user types, before they commit to applying via `cartDiscountCodesUpdate`). Validates: discount existence + active status + customer eligibility + minimum order amount + minimum quantity met. Errors: `NOT_FOUND`, `INACTIVE`, `NOT_STARTED`, `EXPIRED`, `USAGE_LIMIT_REACHED`, `CUSTOMER_USAGE_LIMIT_REACHED`, `CUSTOMER_NOT_ELIGIBLE`, `MINIMUM_ORDER_NOT_MET`, `MINIMUM_QUANTITY_NOT_MET`.",
332
332
  "variables": [
333
333
  {
334
- "name": "id",
334
+ "name": "cartId",
335
335
  "type": "ID!",
336
336
  "defaultValue": null
337
+ },
338
+ {
339
+ "name": "discountCode",
340
+ "type": "String!",
341
+ "defaultValue": null
337
342
  }
338
343
  ],
339
- "fragmentRefs": [
340
- "Checkout"
341
- ],
342
- "body": "query Checkout($id: ID!) {\n checkout(id: $id) {\n ...Checkout\n }\n}"
344
+ "fragmentRefs": [],
345
+ "body": "query CartValidateDiscountCode($cartId: ID!, $discountCode: String!) {\n cartValidateDiscountCode(cartId: $cartId, discountCode: $discountCode) {\n isValid\n discount {\n code\n title\n type\n value\n discountAmount {\n amount\n currencyCode\n }\n }\n error {\n code\n message\n }\n }\n}"
343
346
  },
344
347
  {
345
348
  "name": "AvailablePaymentMethods",
@@ -1095,10 +1098,10 @@
1095
1098
  "body": "mutation CartRemoveLines($id: ID!, $lineIds: [ID!]!) {\n cartRemoveLines(id: $id, lineIds: $lineIds) {\n cart {\n ...Cart\n }\n userErrors {\n ...UserError\n }\n warnings {\n ...CartWarning\n }\n }\n}"
1096
1099
  },
1097
1100
  {
1098
- "name": "CartApplyDiscountCodes",
1101
+ "name": "CartDiscountCodesUpdate",
1099
1102
  "kind": "mutation",
1100
1103
  "section": "Cart Mutations",
1101
- "description": "Replaces (NOT appends) the cart's discount codes with the given list. Pass `[]` to clear all codes. Each code is validated against `discounts` table (existence, active status); invalid codes appear in `userErrors[]` as `DISCOUNT_CODE_INVALID`. Triggers cart re-pricing — discount allocations are recomputed and stored in `cart.discountAmount`.",
1104
+ "description": "Replaces (NOT appends) the cart's discount codes with the given list. Pass `[]` to clear all codes. Each code is validated against the discounts table (existence, active status); invalid codes appear in `userErrors[]` as `DISCOUNT_CODE_INVALID`. Triggers cart re-pricing — discount allocations are recomputed and stored in `cart.discountAmount`. Single canonical replace-all entry point — prior append/single-remove variants were removed in favor of this explicit caller-controlled list semantics.",
1102
1105
  "variables": [
1103
1106
  {
1104
1107
  "name": "id",
@@ -1116,7 +1119,7 @@
1116
1119
  "CartWarning",
1117
1120
  "UserError"
1118
1121
  ],
1119
- "body": "mutation CartApplyDiscountCodes($id: ID!, $discountCodes: [String!]!) {\n cartApplyDiscountCodes(id: $id, discountCodes: $discountCodes) {\n cart {\n ...Cart\n }\n userErrors {\n ...UserError\n }\n warnings {\n ...CartWarning\n }\n }\n}"
1122
+ "body": "mutation CartDiscountCodesUpdate($id: ID!, $discountCodes: [String!]!) {\n cartDiscountCodesUpdate(id: $id, discountCodes: $discountCodes) {\n cart {\n ...Cart\n }\n userErrors {\n ...UserError\n }\n warnings {\n ...CartWarning\n }\n }\n}"
1120
1123
  },
1121
1124
  {
1122
1125
  "name": "CartUpdateBuyerIdentity",
@@ -1386,293 +1389,157 @@
1386
1389
  "body": "mutation CustomerResetPassword($token: String!, $newPassword: String!) {\n customerResetPassword(token: $token, newPassword: $newPassword) {\n customer {\n ...Customer\n }\n customerAccessToken {\n ...CustomerAccessToken\n }\n userErrors {\n ...UserError\n }\n }\n}"
1387
1390
  },
1388
1391
  {
1389
- "name": "CheckoutCreate",
1392
+ "name": "CartSetShippingAddress",
1390
1393
  "kind": "mutation",
1391
- "section": "Checkout Mutations",
1392
- "description": "Creates a new checkout session for the given cart (or a fresh cart if `cartId` is omitted). Inherits applied discounts and gift cards from the cart by reference (not snapshot). Errors: `CART_NOT_FOUND`, `EMPTY_CART`, `ALREADY_COMPLETED` (cart already converted to order). NOT idempotent multiple calls create multiple checkouts.",
1394
+ "section": "Cart Completion Mutations",
1395
+ "description": "Phase 3 unify-cart-graphql-surface: wszystkie fulfillment + payment + completion operations teraz na Cart aggregate (zamiast Checkout dual-aggregate). Klient robi typowy checkout flow: cart create/add items setShipping/Billing/Method → selectPayment → (optional) applyGiftCard cartComplete Order created. Sets the shipping address on the cart (full replace, not patch). Triggers cart re-pricing (tax recalculation per address country/region). Address format validated against `CartAddressInput` constraints (firstName/lastName/streetLine1/city/country/postalCode required). Errors: `INVALID_ADDRESS`, `CART_NOT_FOUND`.",
1393
1396
  "variables": [
1394
1397
  {
1395
1398
  "name": "input",
1396
- "type": "CheckoutCreateInput!",
1397
- "defaultValue": null
1398
- }
1399
- ],
1400
- "fragmentRefs": [
1401
- "Checkout",
1402
- "UserError"
1403
- ],
1404
- "body": "mutation CheckoutCreate($input: CheckoutCreateInput!) {\n checkoutCreate(input: $input) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1405
- },
1406
- {
1407
- "name": "CheckoutUpdateShippingAddress",
1408
- "kind": "mutation",
1409
- "section": "Checkout Mutations",
1410
- "description": "Sets the shipping address (full replace, not patch). Triggers cart re-pricing. Address format is NOT validated here — full validation runs at `checkoutComplete`.",
1411
- "variables": [
1412
- {
1413
- "name": "id",
1414
- "type": "ID!",
1415
- "defaultValue": null
1416
- },
1417
- {
1418
- "name": "shippingAddress",
1419
- "type": "CheckoutAddressInput!",
1420
- "defaultValue": null
1421
- }
1422
- ],
1423
- "fragmentRefs": [
1424
- "Checkout",
1425
- "UserError"
1426
- ],
1427
- "body": "mutation CheckoutUpdateShippingAddress($id: ID!, $shippingAddress: CheckoutAddressInput!) {\n checkoutUpdateShippingAddress(id: $id, shippingAddress: $shippingAddress) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1428
- },
1429
- {
1430
- "name": "CheckoutUpdateBillingAddress",
1431
- "kind": "mutation",
1432
- "section": "Checkout Mutations",
1433
- "description": "Sets the billing address (full replace). Independent of shipping address — pass it explicitly even when \"billing same as shipping\".",
1434
- "variables": [
1435
- {
1436
- "name": "id",
1437
- "type": "ID!",
1438
- "defaultValue": null
1439
- },
1440
- {
1441
- "name": "billingAddress",
1442
- "type": "CheckoutAddressInput!",
1443
- "defaultValue": null
1444
- }
1445
- ],
1446
- "fragmentRefs": [
1447
- "Checkout",
1448
- "UserError"
1449
- ],
1450
- "body": "mutation CheckoutUpdateBillingAddress($id: ID!, $billingAddress: CheckoutAddressInput!) {\n checkoutUpdateBillingAddress(id: $id, billingAddress: $billingAddress) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1451
- },
1452
- {
1453
- "name": "CheckoutUpdateEmail",
1454
- "kind": "mutation",
1455
- "section": "Checkout Mutations",
1456
- "description": "Sets or updates the contact email on the checkout (used for guest checkout, order confirmation, and tracking emails). Validated against a regex; returns `INVALID` for malformed format.",
1457
- "variables": [
1458
- {
1459
- "name": "id",
1460
- "type": "ID!",
1461
- "defaultValue": null
1462
- },
1463
- {
1464
- "name": "email",
1465
- "type": "String!",
1399
+ "type": "CartSetShippingAddressInput!",
1466
1400
  "defaultValue": null
1467
1401
  }
1468
1402
  ],
1469
1403
  "fragmentRefs": [
1470
- "Checkout",
1471
- "UserError"
1472
- ],
1473
- "body": "mutation CheckoutUpdateEmail($id: ID!, $email: String!) {\n checkoutUpdateEmail(id: $id, email: $email) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1474
- },
1475
- {
1476
- "name": "CheckoutSelectShippingRate",
1477
- "kind": "mutation",
1478
- "section": "Checkout Mutations",
1479
- "description": "Selects a shipping method by `rateId` (a stable shipping-method UUID, NOT an opaque per-request token). The id comes from `availableShippingMethods` query, computed for the current address + cart subtotal at request time.",
1480
- "variables": [
1481
- {
1482
- "name": "id",
1483
- "type": "ID!",
1484
- "defaultValue": null
1485
- },
1486
- {
1487
- "name": "rateId",
1488
- "type": "String!",
1489
- "defaultValue": null
1490
- }
1491
- ],
1492
- "fragmentRefs": [
1493
- "Checkout",
1494
- "UserError"
1495
- ],
1496
- "body": "mutation CheckoutSelectShippingRate($id: ID!, $rateId: String!) {\n checkoutSelectShippingRate(id: $id, rateId: $rateId) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1497
- },
1498
- {
1499
- "name": "CheckoutApplyDiscountCode",
1500
- "kind": "mutation",
1501
- "section": "Checkout Mutations",
1502
- "description": "Appends a discount code to the cart's `discount_codes` array. Note: while multiple codes can be stored, the pricing engine currently uses **only the first applied code** — codes do not stack. Validated for existence, active status, and customer usage limits.",
1503
- "variables": [
1504
- {
1505
- "name": "id",
1506
- "type": "ID!",
1507
- "defaultValue": null
1508
- },
1509
- {
1510
- "name": "discountCode",
1511
- "type": "String!",
1512
- "defaultValue": null
1513
- }
1514
- ],
1515
- "fragmentRefs": [
1516
- "Checkout",
1404
+ "Cart",
1405
+ "CartWarning",
1517
1406
  "UserError"
1518
1407
  ],
1519
- "body": "mutation CheckoutApplyDiscountCode($id: ID!, $discountCode: String!) {\n checkoutApplyDiscountCode(id: $id, discountCode: $discountCode) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1408
+ "body": "mutation CartSetShippingAddress($input: CartSetShippingAddressInput!) {\n cartSetShippingAddress(input: $input) {\n cart {\n ...Cart\n }\n userErrors {\n ...UserError\n }\n warnings {\n ...CartWarning\n }\n }\n}"
1520
1409
  },
1521
1410
  {
1522
- "name": "CheckoutRemoveDiscountCode",
1411
+ "name": "CartSetBillingAddress",
1523
1412
  "kind": "mutation",
1524
- "section": "Checkout Mutations",
1525
- "description": "Removes a code from the cart's `discount_codes` array (filters by exact match). Triggers re-pricing.",
1413
+ "section": "Cart Completion Mutations",
1414
+ "description": "Sets the billing address on the cart (full replace). Independent of shipping address — pass it explicitly even when \"billing same as shipping\". Errors: `INVALID_ADDRESS`, `CART_NOT_FOUND`.",
1526
1415
  "variables": [
1527
1416
  {
1528
- "name": "id",
1529
- "type": "ID!",
1530
- "defaultValue": null
1531
- },
1532
- {
1533
- "name": "discountCode",
1534
- "type": "String!",
1417
+ "name": "input",
1418
+ "type": "CartSetBillingAddressInput!",
1535
1419
  "defaultValue": null
1536
1420
  }
1537
1421
  ],
1538
1422
  "fragmentRefs": [
1539
- "Checkout",
1423
+ "Cart",
1424
+ "CartWarning",
1540
1425
  "UserError"
1541
1426
  ],
1542
- "body": "mutation CheckoutRemoveDiscountCode($id: ID!, $discountCode: String!) {\n checkoutRemoveDiscountCode(id: $id, discountCode: $discountCode) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1427
+ "body": "mutation CartSetBillingAddress($input: CartSetBillingAddressInput!) {\n cartSetBillingAddress(input: $input) {\n cart {\n ...Cart\n }\n userErrors {\n ...UserError\n }\n warnings {\n ...CartWarning\n }\n }\n}"
1543
1428
  },
1544
1429
  {
1545
- "name": "CheckoutValidateDiscountCode",
1430
+ "name": "CartSelectShippingMethod",
1546
1431
  "kind": "mutation",
1547
- "section": "Checkout Mutations",
1548
- "description": "READ-ONLY validation of a discount code against the current checkoutdoes NOT modify state. Returns `{ isValid, discount, error }` for previewing the effect (e.g. inline UI feedback as the user types).",
1432
+ "section": "Cart Completion Mutations",
1433
+ "description": "Selects a shipping method by `shippingMethodId` (typed `ID!`, a stable shipping-method UUID — NOT a per-request token). The id comes from a list of methods available for the current address + cart subtotal (queryable separately). Errors: `SHIPPING_METHOD_REQUIRED`, `ZIP_CODE_NOT_SUPPORTED`, `CART_NOT_FOUND`.",
1549
1434
  "variables": [
1550
1435
  {
1551
- "name": "id",
1552
- "type": "ID!",
1553
- "defaultValue": null
1554
- },
1555
- {
1556
- "name": "discountCode",
1557
- "type": "String!",
1436
+ "name": "input",
1437
+ "type": "CartSelectShippingMethodInput!",
1558
1438
  "defaultValue": null
1559
1439
  }
1560
1440
  ],
1561
1441
  "fragmentRefs": [
1442
+ "Cart",
1443
+ "CartWarning",
1562
1444
  "UserError"
1563
1445
  ],
1564
- "body": "mutation CheckoutValidateDiscountCode($id: ID!, $discountCode: String!) {\n checkoutValidateDiscountCode(id: $id, discountCode: $discountCode) {\n result {\n isValid\n discount {\n code\n title\n type\n value\n discountAmount {\n amount\n currencyCode\n }\n }\n error {\n code\n message\n }\n }\n userErrors {\n ...UserError\n }\n }\n}"
1446
+ "body": "mutation CartSelectShippingMethod($input: CartSelectShippingMethodInput!) {\n cartSelectShippingMethod(input: $input) {\n cart {\n ...Cart\n }\n userErrors {\n ...UserError\n }\n warnings {\n ...CartWarning\n }\n }\n}"
1565
1447
  },
1566
1448
  {
1567
- "name": "CheckoutSelectPaymentMethod",
1449
+ "name": "CartSelectPaymentMethod",
1568
1450
  "kind": "mutation",
1569
- "section": "Checkout Mutations",
1570
- "description": "Selects a payment method by `paymentMethodId` (UUID from `availablePaymentMethods` query). Validates existence and active status; no pre-authorization is performed here.",
1451
+ "section": "Cart Completion Mutations",
1452
+ "description": "Selects a payment method by `paymentMethodId` (UUID from `availablePaymentMethods` query). Validates existence + active status; no pre-authorization performed here. Errors: `PAYMENT_METHOD_REQUIRED`, `INVALID_PAYMENT`, `CART_NOT_FOUND`.",
1571
1453
  "variables": [
1572
1454
  {
1573
- "name": "id",
1574
- "type": "ID!",
1575
- "defaultValue": null
1576
- },
1577
- {
1578
- "name": "paymentMethodId",
1579
- "type": "ID!",
1455
+ "name": "input",
1456
+ "type": "CartSelectPaymentMethodInput!",
1580
1457
  "defaultValue": null
1581
1458
  }
1582
1459
  ],
1583
1460
  "fragmentRefs": [
1584
- "Checkout",
1461
+ "Cart",
1462
+ "CartWarning",
1585
1463
  "UserError"
1586
1464
  ],
1587
- "body": "mutation CheckoutSelectPaymentMethod($id: ID!, $paymentMethodId: ID!) {\n checkoutSelectPaymentMethod(id: $id, paymentMethodId: $paymentMethodId) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1465
+ "body": "mutation CartSelectPaymentMethod($input: CartSelectPaymentMethodInput!) {\n cartSelectPaymentMethod(input: $input) {\n cart {\n ...Cart\n }\n userErrors {\n ...UserError\n }\n warnings {\n ...CartWarning\n }\n }\n}"
1588
1466
  },
1589
1467
  {
1590
- "name": "CheckoutComplete",
1468
+ "name": "CartApplyGiftCard",
1591
1469
  "kind": "mutation",
1592
- "section": "Checkout Mutations",
1593
- "description": "Finalizes the checkout: creates the `Order`, deducts gift cards, sends order-created confirmation all atomically. **Idempotent on `idempotencyKey`** (NOT on the checkout `id`); auto-generated if the caller omits it. The `paymentUrl` field is reserved but is NOT populated herefor hosted gateways (PayU, P24) the storefront calls a separate `paymentCreate` mutation after this returns.",
1470
+ "section": "Cart Completion Mutations",
1471
+ "description": "Applies a gift card to the cart, stackable with discount codes. Consumption is FIFO: each card consumes `min(remainingBalance, paymentDue)` against the current cart total in the order they were applied. The gift card balance is NOT debited yetactual deduction happens atomically at `cartComplete`. Errors: `GIFT_CARD_NOT_FOUND`, `GIFT_CARD_DEPLETED`, `GIFT_CARD_UNUSABLE`.",
1594
1472
  "variables": [
1595
- {
1596
- "name": "id",
1597
- "type": "ID!",
1598
- "defaultValue": null
1599
- },
1600
1473
  {
1601
1474
  "name": "input",
1602
- "type": "CheckoutCompleteInput",
1475
+ "type": "CartApplyGiftCardInput!",
1603
1476
  "defaultValue": null
1604
1477
  }
1605
1478
  ],
1606
1479
  "fragmentRefs": [
1607
- "Checkout",
1608
- "Order",
1480
+ "Cart",
1481
+ "CartWarning",
1609
1482
  "UserError"
1610
1483
  ],
1611
- "body": "mutation CheckoutComplete($id: ID!, $input: CheckoutCompleteInput) {\n checkoutComplete(id: $id, input: $input) {\n checkout {\n ...Checkout\n }\n order {\n ...Order\n }\n paymentUrl\n userErrors {\n ...UserError\n }\n }\n}"
1484
+ "body": "mutation CartApplyGiftCard($input: CartApplyGiftCardInput!) {\n cartApplyGiftCard(input: $input) {\n cart {\n ...Cart\n }\n userErrors {\n ...UserError\n }\n warnings {\n ...CartWarning\n }\n }\n}"
1612
1485
  },
1613
1486
  {
1614
- "name": "CheckoutApplyGiftCard",
1487
+ "name": "CartRemoveGiftCard",
1615
1488
  "kind": "mutation",
1616
- "section": "Gift Card Checkout Mutations",
1617
- "description": "Applies a gift card to the cart, stackable with discount codes. Consumption is FIFO: each card consumes `min(remainingBalance, paymentDue)` against the current cart total in the order they were applied. The gift card balance is NOT debited yet actual deduction happens atomically at `checkoutComplete`. Errors: `GIFT_CARD_NOT_FOUND`, `GIFT_CARD_DEPLETED`, `GIFT_CARD_UNUSABLE`, `GIFT_CARD_ALREADY_APPLIED`.",
1489
+ "section": "Cart Completion Mutations",
1490
+ "description": "Removes a gift card from the applied list and recalculates FIFO `appliedAmount` for the remaining cards. Since gift card balances are only debited at `cartComplete`, removing before completion has no effect on the underlying gift card balance.",
1618
1491
  "variables": [
1619
1492
  {
1620
- "name": "id",
1621
- "type": "ID!",
1622
- "defaultValue": null
1623
- },
1624
- {
1625
- "name": "giftCardCode",
1626
- "type": "String!",
1493
+ "name": "input",
1494
+ "type": "CartRemoveGiftCardInput!",
1627
1495
  "defaultValue": null
1628
1496
  }
1629
1497
  ],
1630
1498
  "fragmentRefs": [
1631
- "Checkout",
1499
+ "Cart",
1500
+ "CartWarning",
1632
1501
  "UserError"
1633
1502
  ],
1634
- "body": "mutation CheckoutApplyGiftCard($id: ID!, $giftCardCode: String!) {\n checkoutApplyGiftCard(id: $id, giftCardCode: $giftCardCode) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1503
+ "body": "mutation CartRemoveGiftCard($input: CartRemoveGiftCardInput!) {\n cartRemoveGiftCard(input: $input) {\n cart {\n ...Cart\n }\n userErrors {\n ...UserError\n }\n warnings {\n ...CartWarning\n }\n }\n}"
1635
1504
  },
1636
1505
  {
1637
- "name": "CheckoutRemoveGiftCard",
1506
+ "name": "CartUpdateGiftCardRecipient",
1638
1507
  "kind": "mutation",
1639
- "section": "Gift Card Checkout Mutations",
1640
- "description": "Removes a gift card from the applied list and recalculates FIFO `appliedAmount` for the remaining cards. Since gift card balances are only debited at `checkoutComplete`, removing before completion has no effect on the underlying gift card balance.",
1508
+ "section": "Cart Completion Mutations",
1509
+ "description": "Sets per-line-item recipient details (name, email, message) for digital gift card products in the cart (line items where the variant represents a gift-card SKU). Required before `cartComplete` for any line item with a gift-card variant. Recipient details propagated to the resulting order.",
1641
1510
  "variables": [
1642
1511
  {
1643
- "name": "id",
1644
- "type": "ID!",
1645
- "defaultValue": null
1646
- },
1647
- {
1648
- "name": "giftCardCode",
1649
- "type": "String!",
1512
+ "name": "input",
1513
+ "type": "CartUpdateGiftCardRecipientInput!",
1650
1514
  "defaultValue": null
1651
1515
  }
1652
1516
  ],
1653
1517
  "fragmentRefs": [
1654
- "Checkout",
1518
+ "Cart",
1519
+ "CartWarning",
1655
1520
  "UserError"
1656
1521
  ],
1657
- "body": "mutation CheckoutRemoveGiftCard($id: ID!, $giftCardCode: String!) {\n checkoutRemoveGiftCard(id: $id, giftCardCode: $giftCardCode) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1522
+ "body": "mutation CartUpdateGiftCardRecipient($input: CartUpdateGiftCardRecipientInput!) {\n cartUpdateGiftCardRecipient(input: $input) {\n cart {\n ...Cart\n }\n userErrors {\n ...UserError\n }\n warnings {\n ...CartWarning\n }\n }\n}"
1658
1523
  },
1659
1524
  {
1660
- "name": "CheckoutUpdateGiftCardRecipient",
1525
+ "name": "CartComplete",
1661
1526
  "kind": "mutation",
1662
- "section": "Gift Card Checkout Mutations",
1663
- "description": "Sets per-line-item recipient details (name, email, message, delivery date) for digital gift card products in the cart (variants with `type: GIFT_CARD`). Required before `checkoutComplete` for any line item with a gift-card variant. Recipient details are associated with each gift-card line item and propagated to the resulting order.",
1527
+ "section": "Cart Completion Mutations",
1528
+ "description": "Finalizes the cart creates the `Order`, deducts gift cards, sends order-created confirmation all atomically. **Idempotent on `idempotencyKey`** (auto-generated from cartId + minute timestamp if caller omits it). Returns `order` field after completion. Note: `paymentUrl` is intentionally NOT in payload for hosted gateways (online providers) the storefront calls a separate `paymentCreate` mutation after this returns (check `order.canCreatePayment` first). Errors: `EMAIL_REQUIRED`, `SHIPPING_ADDRESS_REQUIRED`, `SHIPPING_METHOD_REQUIRED`, `PAYMENT_METHOD_REQUIRED`, `INSUFFICIENT_STOCK`, `ALREADY_COMPLETED`.",
1664
1529
  "variables": [
1665
1530
  {
1666
1531
  "name": "input",
1667
- "type": "CheckoutGiftCardRecipientInput!",
1532
+ "type": "CartCompleteInput!",
1668
1533
  "defaultValue": null
1669
1534
  }
1670
1535
  ],
1671
1536
  "fragmentRefs": [
1672
- "Checkout",
1537
+ "Cart",
1538
+ "CartWarning",
1539
+ "Order",
1673
1540
  "UserError"
1674
1541
  ],
1675
- "body": "mutation CheckoutUpdateGiftCardRecipient($input: CheckoutGiftCardRecipientInput!) {\n checkoutUpdateGiftCardRecipient(input: $input) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1542
+ "body": "mutation CartComplete($input: CartCompleteInput!) {\n cartComplete(input: $input) {\n cart {\n ...Cart\n }\n order {\n ...Order\n }\n userErrors {\n ...UserError\n }\n warnings {\n ...CartWarning\n }\n }\n}"
1676
1543
  },
1677
1544
  {
1678
1545
  "name": "ReturnCreate",
@@ -2075,7 +1942,7 @@
2075
1942
  "description": "Customer mailing address — full street/city/state/country/postal code with names and phone. `isDefault` flips when this address is the default for shipping. Spread on the address book UI and order summaries.",
2076
1943
  "variables": [],
2077
1944
  "fragmentRefs": [],
2078
- "body": "fragment MailingAddress on MailingAddress {\n id\n streetLine1\n streetLine2\n city\n company\n country\n countryCode\n firstName\n lastName\n phone\n state\n stateCode\n postalCode\n isDefault\n}",
1945
+ "body": "fragment MailingAddress on MailingAddress {\n id\n streetLine1\n streetLine2\n city\n company\n country\n countryCode\n firstName\n lastName\n name\n phone\n state\n stateCode\n postalCode\n isDefault\n}",
2079
1946
  "onType": "MailingAddress"
2080
1947
  },
2081
1948
  {
@@ -2105,13 +1972,13 @@
2105
1972
  "name": "Order",
2106
1973
  "kind": "fragment",
2107
1974
  "section": "Customer",
2108
- "description": "Order summary — number, totals (cost / tax / shipping), payment + fulfillment status, shipping address, item count, lifecycle timestamps. Spread on the order list and order detail pages. Line items are not included here.",
1975
+ "description": "Order summary — number, totals (cost / tax / shipping), payment + fulfillment status, shipping address, item count, lifecycle timestamps, plus payment capability signal (`canCreatePayment` + `paymentMethodType`) the storefront uses to decide post-completion payment flow without hard-coded provider checks. Spread on the order list, order detail, and the `cartComplete` mutation result. Line items are not included here.",
2109
1976
  "variables": [],
2110
1977
  "fragmentRefs": [
2111
1978
  "MailingAddress",
2112
1979
  "Money"
2113
1980
  ],
2114
- "body": "fragment Order on Order {\n id\n orderNumber\n totals {\n total {\n ...Money\n }\n subtotal {\n ...Money\n }\n totalTax {\n ...Money\n }\n totalShipping {\n ...Money\n }\n }\n status\n paymentStatus\n fulfillmentStatus\n processedAt\n confirmedAt\n cancelledAt\n expiredAt\n shippingAddress {\n ...MailingAddress\n }\n itemCount\n}",
1981
+ "body": "fragment Order on Order {\n id\n orderNumber\n totals {\n total {\n ...Money\n }\n subtotal {\n ...Money\n }\n totalTax {\n ...Money\n }\n totalShipping {\n ...Money\n }\n }\n status\n paymentStatus\n fulfillmentStatus\n processedAt\n confirmedAt\n cancelledAt\n expiredAt\n shippingAddress {\n ...MailingAddress\n }\n itemCount\n canCreatePayment\n paymentMethodType\n}",
2115
1982
  "onType": "Order"
2116
1983
  },
2117
1984
  {
@@ -2198,19 +2065,57 @@
2198
2065
  "name": "Cart",
2199
2066
  "kind": "fragment",
2200
2067
  "section": "Cart",
2201
- "description": "Full cart shape — totals, line items (paginated up to 100), buyer identity, applied discount codes + allocations, note, custom attributes. Spread on the cart drawer / cart page; refetch after every cart mutation.",
2068
+ "description": "Full cart shape — totals, line items (paginated up to 100), buyer identity, applied discount codes + allocations, note, custom attributes, plus fulfillment fields (email/phone/addresses/shipping method/payment method/applied gift cards). Spread on the cart drawer / cart page; refetch after every cart mutation including completion lifecycle.",
2202
2069
  "variables": [],
2203
2070
  "fragmentRefs": [
2071
+ "CartAppliedGiftCard",
2204
2072
  "CartBuyerIdentity",
2205
2073
  "CartCost",
2206
2074
  "CartDiscountAllocation",
2207
2075
  "CartDiscountCode",
2208
2076
  "CartLine",
2077
+ "CartSelectedPaymentMethod",
2078
+ "CartShippingMethod",
2079
+ "MailingAddress",
2209
2080
  "PageInfo"
2210
2081
  ],
2211
- "body": "fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost {\n ...CartCost\n }\n lines(first: 100) {\n edges {\n cursor\n node {\n ... on CartLine {\n ...CartLine\n }\n }\n }\n nodes {\n ... on CartLine {\n ...CartLine\n }\n }\n pageInfo {\n ...PageInfo\n }\n totalCount\n }\n buyerIdentity {\n ...CartBuyerIdentity\n }\n discountCodes {\n ...CartDiscountCode\n }\n discountAllocations {\n ...CartDiscountAllocation\n }\n note\n attributes {\n key\n value\n }\n createdAt\n updatedAt\n}",
2082
+ "body": "fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost {\n ...CartCost\n }\n lines(first: 100) {\n edges {\n cursor\n node {\n ... on CartLine {\n ...CartLine\n }\n }\n }\n nodes {\n ... on CartLine {\n ...CartLine\n }\n }\n pageInfo {\n ...PageInfo\n }\n totalCount\n }\n buyerIdentity {\n ...CartBuyerIdentity\n }\n discountCodes {\n ...CartDiscountCode\n }\n discountAllocations {\n ...CartDiscountAllocation\n }\n note\n attributes {\n key\n value\n }\n email\n phone\n shippingAddress {\n ...MailingAddress\n }\n billingAddress {\n ...MailingAddress\n }\n selectedShippingMethod {\n ...CartShippingMethod\n }\n selectedPaymentMethod {\n ...CartSelectedPaymentMethod\n }\n appliedGiftCards {\n ...CartAppliedGiftCard\n }\n createdAt\n updatedAt\n}",
2212
2083
  "onType": "Cart"
2213
2084
  },
2085
+ {
2086
+ "name": "CartShippingMethod",
2087
+ "kind": "fragment",
2088
+ "section": "Cart",
2089
+ "description": "Shipping method selected on a cart (D8 term unification — wcześniej ShippingRate). Returned przez `cart.selectedShippingMethod` po `cartSelectShippingMethod` mutation.",
2090
+ "variables": [],
2091
+ "fragmentRefs": [
2092
+ "Money"
2093
+ ],
2094
+ "body": "fragment CartShippingMethod on CartShippingMethod {\n handle\n title\n price {\n ...Money\n }\n}",
2095
+ "onType": "CartShippingMethod"
2096
+ },
2097
+ {
2098
+ "name": "CartAppliedGiftCard",
2099
+ "kind": "fragment",
2100
+ "section": "Cart",
2101
+ "description": "Gift card applied to a cart — masked code for display, last 4 chars for matching, applied amount + remaining balance. Balance NIE debited yet — actual deduction atomically at `cartComplete`.",
2102
+ "variables": [],
2103
+ "fragmentRefs": [
2104
+ "Money"
2105
+ ],
2106
+ "body": "fragment CartAppliedGiftCard on CartAppliedGiftCard {\n maskedCode\n lastCharacters\n appliedAmount {\n ...Money\n }\n remainingBalance {\n ...Money\n }\n}",
2107
+ "onType": "CartAppliedGiftCard"
2108
+ },
2109
+ {
2110
+ "name": "CartSelectedPaymentMethod",
2111
+ "kind": "fragment",
2112
+ "section": "Cart",
2113
+ "description": "Payment method (integration provider) selected on a cart — id, name, provider code, type category (CARD/BLIK/BANK_TRANSFER/etc.), icon, description, isDefault, supportedCurrencies. Storefront UI używa do iconography + selection display.",
2114
+ "variables": [],
2115
+ "fragmentRefs": [],
2116
+ "body": "fragment CartSelectedPaymentMethod on PaymentMethod {\n id\n name\n provider\n type\n icon\n description\n isDefault\n supportedCurrencies\n position\n}",
2117
+ "onType": "PaymentMethod"
2118
+ },
2214
2119
  {
2215
2120
  "name": "ShopColors",
2216
2121
  "kind": "fragment",
@@ -2336,110 +2241,6 @@
2336
2241
  "body": "fragment AvailablePaymentMethods on AvailablePaymentMethods {\n methods {\n ...PaymentMethod\n }\n defaultMethod {\n ...PaymentMethod\n }\n}",
2337
2242
  "onType": "AvailablePaymentMethods"
2338
2243
  },
2339
- {
2340
- "name": "ShippingRate",
2341
- "kind": "fragment",
2342
- "section": "Checkout",
2343
- "description": "Single shipping rate option — `handle` is the stable id you pass to `checkoutSelectShippingRate` as `rateId`, plus title and price.",
2344
- "variables": [],
2345
- "fragmentRefs": [
2346
- "Money"
2347
- ],
2348
- "body": "fragment ShippingRate on ShippingRate {\n handle\n title\n price {\n ...Money\n }\n}",
2349
- "onType": "ShippingRate"
2350
- },
2351
- {
2352
- "name": "TaxLine",
2353
- "kind": "fragment",
2354
- "section": "Checkout",
2355
- "description": "One tax line on the checkout — title, rate (decimal, e.g. 0.23 for 23%), computed amount. Spread on the order summary.",
2356
- "variables": [],
2357
- "fragmentRefs": [
2358
- "Money"
2359
- ],
2360
- "body": "fragment TaxLine on TaxLine {\n title\n rate\n price {\n ...Money\n }\n}",
2361
- "onType": "TaxLine"
2362
- },
2363
- {
2364
- "name": "DiscountAffectedItem",
2365
- "kind": "fragment",
2366
- "section": "Checkout",
2367
- "description": "Item affected by a discount — the discounted product/variant with original + discounted prices and savings. Used on Buy-X-Get-Y promotions to highlight which items the discount applies to.",
2368
- "variables": [],
2369
- "fragmentRefs": [
2370
- "Money"
2371
- ],
2372
- "body": "fragment DiscountAffectedItem on DiscountAffectedItem {\n productId\n variantId\n title\n quantity\n originalPrice {\n ...Money\n }\n discountedPrice {\n ...Money\n }\n savings {\n ...Money\n }\n isFreeItem\n}",
2373
- "onType": "DiscountAffectedItem"
2374
- },
2375
- {
2376
- "name": "DiscountApplication",
2377
- "kind": "fragment",
2378
- "section": "Checkout",
2379
- "description": "A discount currently applied to the checkout — code, type, value, plus BXGY (Buy X Get Y) metadata when applicable (`buyQuantity`, `getQuantity`, `getDiscountPercent`, `affectedItems`). Use to render a \"Discounts applied\" panel.",
2380
- "variables": [],
2381
- "fragmentRefs": [
2382
- "DiscountAffectedItem",
2383
- "Money"
2384
- ],
2385
- "body": "fragment DiscountApplication on DiscountApplication {\n code\n isApplicable\n type\n value {\n ...Money\n }\n title\n affectedItems {\n ...DiscountAffectedItem\n }\n buyQuantity\n getQuantity\n getDiscountPercent\n}",
2386
- "onType": "DiscountApplication"
2387
- },
2388
- {
2389
- "name": "DiscountCode",
2390
- "kind": "fragment",
2391
- "section": "Checkout",
2392
- "description": "Lightweight discount code entry on the checkout — code + applicability flag.",
2393
- "variables": [],
2394
- "fragmentRefs": [],
2395
- "body": "fragment DiscountCode on DiscountCode {\n code\n isApplicable\n}",
2396
- "onType": "DiscountCode"
2397
- },
2398
- {
2399
- "name": "CheckoutLineItem",
2400
- "kind": "fragment",
2401
- "section": "Checkout",
2402
- "description": "Single line item in the checkout — variant snapshot, quantity, unit + total prices, image. Use on the order summary panel.",
2403
- "variables": [],
2404
- "fragmentRefs": [
2405
- "ImageThumbnail",
2406
- "Money"
2407
- ],
2408
- "body": "fragment CheckoutLineItem on CheckoutLineItem {\n id\n title\n variantTitle\n quantity\n pricePerUnit {\n ...Money\n }\n total {\n ...Money\n }\n variantId\n productId\n sku\n image {\n ...ImageThumbnail\n }\n}",
2409
- "onType": "CheckoutLineItem"
2410
- },
2411
- {
2412
- "name": "AppliedGiftCard",
2413
- "kind": "fragment",
2414
- "section": "Checkout",
2415
- "description": "Gift card applied to the checkout — `maskedCode` (first + last 4 chars), `lastCharacters` (for display matching), the amount applied to this checkout, and remaining balance after this order would complete.",
2416
- "variables": [],
2417
- "fragmentRefs": [
2418
- "Money"
2419
- ],
2420
- "body": "fragment AppliedGiftCard on AppliedGiftCard {\n maskedCode\n lastCharacters\n appliedAmount {\n ...Money\n }\n remainingBalance {\n ...Money\n }\n}",
2421
- "onType": "AppliedGiftCard"
2422
- },
2423
- {
2424
- "name": "Checkout",
2425
- "kind": "fragment",
2426
- "section": "Checkout",
2427
- "description": "Full checkout shape — line items, shipping + billing addresses, selected + available shipping rates, available payment methods, applied discounts + gift cards, tax lines, totals (`cost`, `paymentDue`, `totalGiftCardAmount`). Spread on the checkout flow; refetch after every checkout mutation. `isReady` flips to true when the checkout has all required fields to call `checkoutComplete`.",
2428
- "variables": [],
2429
- "fragmentRefs": [
2430
- "AppliedGiftCard",
2431
- "CheckoutLineItem",
2432
- "DiscountApplication",
2433
- "DiscountCode",
2434
- "MailingAddress",
2435
- "Money",
2436
- "PaymentMethod",
2437
- "ShippingRate",
2438
- "TaxLine"
2439
- ],
2440
- "body": "fragment Checkout on Checkout {\n id\n isReady\n isCompleted\n completedOrderId\n webUrl\n lineItems {\n ...CheckoutLineItem\n }\n totalQuantity\n shippingAddress {\n ...MailingAddress\n }\n billingAddress {\n ...MailingAddress\n }\n shippingLine {\n ...ShippingRate\n }\n availableShippingRates {\n ...ShippingRate\n }\n shippingRatesReady\n email\n phone\n customerId\n discountCodes {\n ...DiscountCode\n }\n discountApplications {\n ...DiscountApplication\n }\n availablePaymentMethods {\n ...PaymentMethod\n }\n selectedPaymentMethodId\n cost {\n subtotal {\n ...Money\n }\n total {\n ...Money\n }\n totalTax {\n ...Money\n }\n totalShipping {\n ...Money\n }\n totalDiscounts {\n ...Money\n }\n }\n taxLines {\n ...TaxLine\n }\n appliedGiftCards {\n ...AppliedGiftCard\n }\n totalGiftCardAmount {\n ...Money\n }\n paymentDue {\n ...Money\n }\n currencyCode\n note\n createdAt\n updatedAt\n}",
2441
- "onType": "Checkout"
2442
- },
2443
2244
  {
2444
2245
  "name": "ShipmentEvent",
2445
2246
  "kind": "fragment",