@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/llms-full.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  # DoSwiftly Storefront Operations — Full Reference
2
2
 
3
- > Schema version: **8.0.0**
4
- > 48 queries · 44 mutations · 104 fragments
3
+ > Schema version: **10.0.0**
4
+ > 48 queries · 39 mutations · 99 fragments
5
5
 
6
6
  Auto-generated from `.graphql` source files. Do not edit by hand — this file is
7
7
  regenerated on every release to match the published schema.
@@ -430,22 +430,35 @@ query CustomerOrder($orderId: ID!) {
430
430
  }
431
431
  ```
432
432
 
433
- ### Query: `Checkout`
433
+ ### Query: `CartValidateDiscountCode`
434
434
 
435
- **Section**: Checkout
435
+ **Section**: Discount Code Validation
436
436
 
437
- **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.
437
+ **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`.
438
438
 
439
439
  **Variables**:
440
- - `$id`: `ID!`
441
-
442
- **Fragments used**: `Checkout`
440
+ - `$cartId`: `ID!`
441
+ - `$discountCode`: `String!`
443
442
 
444
443
  **GraphQL**:
445
444
  ```graphql
446
- query Checkout($id: ID!) {
447
- checkout(id: $id) {
448
- ...Checkout
445
+ query CartValidateDiscountCode($cartId: ID!, $discountCode: String!) {
446
+ cartValidateDiscountCode(cartId: $cartId, discountCode: $discountCode) {
447
+ isValid
448
+ discount {
449
+ code
450
+ title
451
+ type
452
+ value
453
+ discountAmount {
454
+ amount
455
+ currencyCode
456
+ }
457
+ }
458
+ error {
459
+ code
460
+ message
461
+ }
449
462
  }
450
463
  }
451
464
  ```
@@ -1383,11 +1396,11 @@ mutation CartRemoveLines($id: ID!, $lineIds: [ID!]!) {
1383
1396
  }
1384
1397
  ```
1385
1398
 
1386
- ### Mutation: `CartApplyDiscountCodes`
1399
+ ### Mutation: `CartDiscountCodesUpdate`
1387
1400
 
1388
1401
  **Section**: Cart Mutations
1389
1402
 
1390
- **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`.
1403
+ **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.
1391
1404
 
1392
1405
  **Variables**:
1393
1406
  - `$id`: `ID!`
@@ -1397,8 +1410,8 @@ mutation CartRemoveLines($id: ID!, $lineIds: [ID!]!) {
1397
1410
 
1398
1411
  **GraphQL**:
1399
1412
  ```graphql
1400
- mutation CartApplyDiscountCodes($id: ID!, $discountCodes: [String!]!) {
1401
- cartApplyDiscountCodes(id: $id, discountCodes: $discountCodes) {
1413
+ mutation CartDiscountCodesUpdate($id: ID!, $discountCodes: [String!]!) {
1414
+ cartDiscountCodesUpdate(id: $id, discountCodes: $discountCodes) {
1402
1415
  cart {
1403
1416
  ...Cart
1404
1417
  }
@@ -1774,355 +1787,228 @@ mutation CustomerResetPassword($token: String!, $newPassword: String!) {
1774
1787
  }
1775
1788
  ```
1776
1789
 
1777
- ### Mutation: `CheckoutCreate`
1790
+ ### Mutation: `CartSetShippingAddress`
1778
1791
 
1779
- **Section**: Checkout Mutations
1792
+ **Section**: Cart Completion Mutations
1780
1793
 
1781
- **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.
1794
+ **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`.
1782
1795
 
1783
1796
  **Variables**:
1784
- - `$input`: `CheckoutCreateInput!`
1797
+ - `$input`: `CartSetShippingAddressInput!`
1785
1798
 
1786
- **Fragments used**: `Checkout`, `UserError`
1799
+ **Fragments used**: `Cart`, `CartWarning`, `UserError`
1787
1800
 
1788
1801
  **GraphQL**:
1789
1802
  ```graphql
1790
- mutation CheckoutCreate($input: CheckoutCreateInput!) {
1791
- checkoutCreate(input: $input) {
1792
- checkout {
1793
- ...Checkout
1803
+ mutation CartSetShippingAddress($input: CartSetShippingAddressInput!) {
1804
+ cartSetShippingAddress(input: $input) {
1805
+ cart {
1806
+ ...Cart
1794
1807
  }
1795
1808
  userErrors {
1796
1809
  ...UserError
1797
1810
  }
1798
- }
1799
- }
1800
- ```
1801
-
1802
- ### Mutation: `CheckoutUpdateShippingAddress`
1803
-
1804
- **Section**: Checkout Mutations
1805
-
1806
- **Description**: Sets the shipping address (full replace, not patch). Triggers cart re-pricing. Address format is NOT validated here — full validation runs at `checkoutComplete`.
1807
-
1808
- **Variables**:
1809
- - `$id`: `ID!`
1810
- - `$shippingAddress`: `CheckoutAddressInput!`
1811
-
1812
- **Fragments used**: `Checkout`, `UserError`
1813
-
1814
- **GraphQL**:
1815
- ```graphql
1816
- mutation CheckoutUpdateShippingAddress($id: ID!, $shippingAddress: CheckoutAddressInput!) {
1817
- checkoutUpdateShippingAddress(id: $id, shippingAddress: $shippingAddress) {
1818
- checkout {
1819
- ...Checkout
1820
- }
1821
- userErrors {
1822
- ...UserError
1811
+ warnings {
1812
+ ...CartWarning
1823
1813
  }
1824
1814
  }
1825
1815
  }
1826
1816
  ```
1827
1817
 
1828
- ### Mutation: `CheckoutUpdateBillingAddress`
1818
+ ### Mutation: `CartSetBillingAddress`
1829
1819
 
1830
- **Section**: Checkout Mutations
1820
+ **Section**: Cart Completion Mutations
1831
1821
 
1832
- **Description**: Sets the billing address (full replace). Independent of shipping address — pass it explicitly even when "billing same as shipping".
1822
+ **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`.
1833
1823
 
1834
1824
  **Variables**:
1835
- - `$id`: `ID!`
1836
- - `$billingAddress`: `CheckoutAddressInput!`
1825
+ - `$input`: `CartSetBillingAddressInput!`
1837
1826
 
1838
- **Fragments used**: `Checkout`, `UserError`
1827
+ **Fragments used**: `Cart`, `CartWarning`, `UserError`
1839
1828
 
1840
1829
  **GraphQL**:
1841
1830
  ```graphql
1842
- mutation CheckoutUpdateBillingAddress($id: ID!, $billingAddress: CheckoutAddressInput!) {
1843
- checkoutUpdateBillingAddress(id: $id, billingAddress: $billingAddress) {
1844
- checkout {
1845
- ...Checkout
1831
+ mutation CartSetBillingAddress($input: CartSetBillingAddressInput!) {
1832
+ cartSetBillingAddress(input: $input) {
1833
+ cart {
1834
+ ...Cart
1846
1835
  }
1847
1836
  userErrors {
1848
1837
  ...UserError
1849
1838
  }
1850
- }
1851
- }
1852
- ```
1853
-
1854
- ### Mutation: `CheckoutUpdateEmail`
1855
-
1856
- **Section**: Checkout Mutations
1857
-
1858
- **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.
1859
-
1860
- **Variables**:
1861
- - `$id`: `ID!`
1862
- - `$email`: `String!`
1863
-
1864
- **Fragments used**: `Checkout`, `UserError`
1865
-
1866
- **GraphQL**:
1867
- ```graphql
1868
- mutation CheckoutUpdateEmail($id: ID!, $email: String!) {
1869
- checkoutUpdateEmail(id: $id, email: $email) {
1870
- checkout {
1871
- ...Checkout
1872
- }
1873
- userErrors {
1874
- ...UserError
1839
+ warnings {
1840
+ ...CartWarning
1875
1841
  }
1876
1842
  }
1877
1843
  }
1878
1844
  ```
1879
1845
 
1880
- ### Mutation: `CheckoutSelectShippingRate`
1846
+ ### Mutation: `CartSelectShippingMethod`
1881
1847
 
1882
- **Section**: Checkout Mutations
1848
+ **Section**: Cart Completion Mutations
1883
1849
 
1884
- **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.
1850
+ **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`.
1885
1851
 
1886
1852
  **Variables**:
1887
- - `$id`: `ID!`
1888
- - `$rateId`: `String!`
1853
+ - `$input`: `CartSelectShippingMethodInput!`
1889
1854
 
1890
- **Fragments used**: `Checkout`, `UserError`
1855
+ **Fragments used**: `Cart`, `CartWarning`, `UserError`
1891
1856
 
1892
1857
  **GraphQL**:
1893
1858
  ```graphql
1894
- mutation CheckoutSelectShippingRate($id: ID!, $rateId: String!) {
1895
- checkoutSelectShippingRate(id: $id, rateId: $rateId) {
1896
- checkout {
1897
- ...Checkout
1859
+ mutation CartSelectShippingMethod($input: CartSelectShippingMethodInput!) {
1860
+ cartSelectShippingMethod(input: $input) {
1861
+ cart {
1862
+ ...Cart
1898
1863
  }
1899
1864
  userErrors {
1900
1865
  ...UserError
1901
1866
  }
1867
+ warnings {
1868
+ ...CartWarning
1869
+ }
1902
1870
  }
1903
1871
  }
1904
1872
  ```
1905
1873
 
1906
- ### Mutation: `CheckoutApplyDiscountCode`
1874
+ ### Mutation: `CartSelectPaymentMethod`
1907
1875
 
1908
- **Section**: Checkout Mutations
1876
+ **Section**: Cart Completion Mutations
1909
1877
 
1910
- **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.
1878
+ **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`.
1911
1879
 
1912
1880
  **Variables**:
1913
- - `$id`: `ID!`
1914
- - `$discountCode`: `String!`
1881
+ - `$input`: `CartSelectPaymentMethodInput!`
1915
1882
 
1916
- **Fragments used**: `Checkout`, `UserError`
1883
+ **Fragments used**: `Cart`, `CartWarning`, `UserError`
1917
1884
 
1918
1885
  **GraphQL**:
1919
1886
  ```graphql
1920
- mutation CheckoutApplyDiscountCode($id: ID!, $discountCode: String!) {
1921
- checkoutApplyDiscountCode(id: $id, discountCode: $discountCode) {
1922
- checkout {
1923
- ...Checkout
1887
+ mutation CartSelectPaymentMethod($input: CartSelectPaymentMethodInput!) {
1888
+ cartSelectPaymentMethod(input: $input) {
1889
+ cart {
1890
+ ...Cart
1924
1891
  }
1925
1892
  userErrors {
1926
1893
  ...UserError
1927
1894
  }
1895
+ warnings {
1896
+ ...CartWarning
1897
+ }
1928
1898
  }
1929
1899
  }
1930
1900
  ```
1931
1901
 
1932
- ### Mutation: `CheckoutRemoveDiscountCode`
1902
+ ### Mutation: `CartApplyGiftCard`
1933
1903
 
1934
- **Section**: Checkout Mutations
1904
+ **Section**: Cart Completion Mutations
1935
1905
 
1936
- **Description**: Removes a code from the cart's `discount_codes` array (filters by exact match). Triggers re-pricing.
1906
+ **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 `cartComplete`. Errors: `GIFT_CARD_NOT_FOUND`, `GIFT_CARD_DEPLETED`, `GIFT_CARD_UNUSABLE`.
1937
1907
 
1938
1908
  **Variables**:
1939
- - `$id`: `ID!`
1940
- - `$discountCode`: `String!`
1909
+ - `$input`: `CartApplyGiftCardInput!`
1941
1910
 
1942
- **Fragments used**: `Checkout`, `UserError`
1911
+ **Fragments used**: `Cart`, `CartWarning`, `UserError`
1943
1912
 
1944
1913
  **GraphQL**:
1945
1914
  ```graphql
1946
- mutation CheckoutRemoveDiscountCode($id: ID!, $discountCode: String!) {
1947
- checkoutRemoveDiscountCode(id: $id, discountCode: $discountCode) {
1948
- checkout {
1949
- ...Checkout
1915
+ mutation CartApplyGiftCard($input: CartApplyGiftCardInput!) {
1916
+ cartApplyGiftCard(input: $input) {
1917
+ cart {
1918
+ ...Cart
1950
1919
  }
1951
1920
  userErrors {
1952
1921
  ...UserError
1953
1922
  }
1923
+ warnings {
1924
+ ...CartWarning
1925
+ }
1954
1926
  }
1955
1927
  }
1956
1928
  ```
1957
1929
 
1958
- ### Mutation: `CheckoutValidateDiscountCode`
1930
+ ### Mutation: `CartRemoveGiftCard`
1959
1931
 
1960
- **Section**: Checkout Mutations
1932
+ **Section**: Cart Completion Mutations
1961
1933
 
1962
- **Description**: READ-ONLY validation of a discount code against the current checkout does NOT modify state. Returns `{ isValid, discount, error }` for previewing the effect (e.g. inline UI feedback as the user types).
1934
+ **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.
1963
1935
 
1964
1936
  **Variables**:
1965
- - `$id`: `ID!`
1966
- - `$discountCode`: `String!`
1937
+ - `$input`: `CartRemoveGiftCardInput!`
1967
1938
 
1968
- **Fragments used**: `UserError`
1939
+ **Fragments used**: `Cart`, `CartWarning`, `UserError`
1969
1940
 
1970
1941
  **GraphQL**:
1971
1942
  ```graphql
1972
- mutation CheckoutValidateDiscountCode($id: ID!, $discountCode: String!) {
1973
- checkoutValidateDiscountCode(id: $id, discountCode: $discountCode) {
1974
- result {
1975
- isValid
1976
- discount {
1977
- code
1978
- title
1979
- type
1980
- value
1981
- discountAmount {
1982
- amount
1983
- currencyCode
1984
- }
1985
- }
1986
- error {
1987
- code
1988
- message
1989
- }
1943
+ mutation CartRemoveGiftCard($input: CartRemoveGiftCardInput!) {
1944
+ cartRemoveGiftCard(input: $input) {
1945
+ cart {
1946
+ ...Cart
1990
1947
  }
1991
1948
  userErrors {
1992
1949
  ...UserError
1993
1950
  }
1951
+ warnings {
1952
+ ...CartWarning
1953
+ }
1994
1954
  }
1995
1955
  }
1996
1956
  ```
1997
1957
 
1998
- ### Mutation: `CheckoutSelectPaymentMethod`
1958
+ ### Mutation: `CartUpdateGiftCardRecipient`
1999
1959
 
2000
- **Section**: Checkout Mutations
1960
+ **Section**: Cart Completion Mutations
2001
1961
 
2002
- **Description**: Selects a payment method by `paymentMethodId` (UUID from `availablePaymentMethods` query). Validates existence and active status; no pre-authorization is performed here.
1962
+ **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.
2003
1963
 
2004
1964
  **Variables**:
2005
- - `$id`: `ID!`
2006
- - `$paymentMethodId`: `ID!`
1965
+ - `$input`: `CartUpdateGiftCardRecipientInput!`
2007
1966
 
2008
- **Fragments used**: `Checkout`, `UserError`
1967
+ **Fragments used**: `Cart`, `CartWarning`, `UserError`
2009
1968
 
2010
1969
  **GraphQL**:
2011
1970
  ```graphql
2012
- mutation CheckoutSelectPaymentMethod($id: ID!, $paymentMethodId: ID!) {
2013
- checkoutSelectPaymentMethod(id: $id, paymentMethodId: $paymentMethodId) {
2014
- checkout {
2015
- ...Checkout
1971
+ mutation CartUpdateGiftCardRecipient($input: CartUpdateGiftCardRecipientInput!) {
1972
+ cartUpdateGiftCardRecipient(input: $input) {
1973
+ cart {
1974
+ ...Cart
2016
1975
  }
2017
1976
  userErrors {
2018
1977
  ...UserError
2019
1978
  }
1979
+ warnings {
1980
+ ...CartWarning
1981
+ }
2020
1982
  }
2021
1983
  }
2022
1984
  ```
2023
1985
 
2024
- ### Mutation: `CheckoutComplete`
1986
+ ### Mutation: `CartComplete`
2025
1987
 
2026
- **Section**: Checkout Mutations
1988
+ **Section**: Cart Completion Mutations
2027
1989
 
2028
- **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 here — for hosted gateways (PayU, P24) the storefront calls a separate `paymentCreate` mutation after this returns.
1990
+ **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`.
2029
1991
 
2030
1992
  **Variables**:
2031
- - `$id`: `ID!`
2032
- - `$input`: `CheckoutCompleteInput`
1993
+ - `$input`: `CartCompleteInput!`
2033
1994
 
2034
- **Fragments used**: `Checkout`, `Order`, `UserError`
1995
+ **Fragments used**: `Cart`, `CartWarning`, `Order`, `UserError`
2035
1996
 
2036
1997
  **GraphQL**:
2037
1998
  ```graphql
2038
- mutation CheckoutComplete($id: ID!, $input: CheckoutCompleteInput) {
2039
- checkoutComplete(id: $id, input: $input) {
2040
- checkout {
2041
- ...Checkout
1999
+ mutation CartComplete($input: CartCompleteInput!) {
2000
+ cartComplete(input: $input) {
2001
+ cart {
2002
+ ...Cart
2042
2003
  }
2043
2004
  order {
2044
2005
  ...Order
2045
2006
  }
2046
- paymentUrl
2047
2007
  userErrors {
2048
2008
  ...UserError
2049
2009
  }
2050
- }
2051
- }
2052
- ```
2053
-
2054
- ### Mutation: `CheckoutApplyGiftCard`
2055
-
2056
- **Section**: Gift Card Checkout Mutations
2057
-
2058
- **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`.
2059
-
2060
- **Variables**:
2061
- - `$id`: `ID!`
2062
- - `$giftCardCode`: `String!`
2063
-
2064
- **Fragments used**: `Checkout`, `UserError`
2065
-
2066
- **GraphQL**:
2067
- ```graphql
2068
- mutation CheckoutApplyGiftCard($id: ID!, $giftCardCode: String!) {
2069
- checkoutApplyGiftCard(id: $id, giftCardCode: $giftCardCode) {
2070
- checkout {
2071
- ...Checkout
2072
- }
2073
- userErrors {
2074
- ...UserError
2075
- }
2076
- }
2077
- }
2078
- ```
2079
-
2080
- ### Mutation: `CheckoutRemoveGiftCard`
2081
-
2082
- **Section**: Gift Card Checkout Mutations
2083
-
2084
- **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.
2085
-
2086
- **Variables**:
2087
- - `$id`: `ID!`
2088
- - `$giftCardCode`: `String!`
2089
-
2090
- **Fragments used**: `Checkout`, `UserError`
2091
-
2092
- **GraphQL**:
2093
- ```graphql
2094
- mutation CheckoutRemoveGiftCard($id: ID!, $giftCardCode: String!) {
2095
- checkoutRemoveGiftCard(id: $id, giftCardCode: $giftCardCode) {
2096
- checkout {
2097
- ...Checkout
2098
- }
2099
- userErrors {
2100
- ...UserError
2101
- }
2102
- }
2103
- }
2104
- ```
2105
-
2106
- ### Mutation: `CheckoutUpdateGiftCardRecipient`
2107
-
2108
- **Section**: Gift Card Checkout Mutations
2109
-
2110
- **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.
2111
-
2112
- **Variables**:
2113
- - `$input`: `CheckoutGiftCardRecipientInput!`
2114
-
2115
- **Fragments used**: `Checkout`, `UserError`
2116
-
2117
- **GraphQL**:
2118
- ```graphql
2119
- mutation CheckoutUpdateGiftCardRecipient($input: CheckoutGiftCardRecipientInput!) {
2120
- checkoutUpdateGiftCardRecipient(input: $input) {
2121
- checkout {
2122
- ...Checkout
2123
- }
2124
- userErrors {
2125
- ...UserError
2010
+ warnings {
2011
+ ...CartWarning
2126
2012
  }
2127
2013
  }
2128
2014
  }
@@ -2801,6 +2687,7 @@ fragment MailingAddress on MailingAddress {
2801
2687
  countryCode
2802
2688
  firstName
2803
2689
  lastName
2690
+ name
2804
2691
  phone
2805
2692
  state
2806
2693
  stateCode
@@ -2864,7 +2751,7 @@ fragment Customer on Customer {
2864
2751
 
2865
2752
  **Section**: Customer
2866
2753
 
2867
- **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.
2754
+ **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.
2868
2755
 
2869
2756
  **Uses fragments**: `MailingAddress`, `Money`
2870
2757
 
@@ -2898,6 +2785,8 @@ fragment Order on Order {
2898
2785
  ...MailingAddress
2899
2786
  }
2900
2787
  itemCount
2788
+ canCreatePayment
2789
+ paymentMethodType
2901
2790
  }
2902
2791
  ```
2903
2792
 
@@ -3065,9 +2954,9 @@ fragment CartDiscountAllocation on CartDiscountAllocation {
3065
2954
 
3066
2955
  **Section**: Cart
3067
2956
 
3068
- **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.
2957
+ **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.
3069
2958
 
3070
- **Uses fragments**: `CartBuyerIdentity`, `CartCost`, `CartDiscountAllocation`, `CartDiscountCode`, `CartLine`, `PageInfo`
2959
+ **Uses fragments**: `CartAppliedGiftCard`, `CartBuyerIdentity`, `CartCost`, `CartDiscountAllocation`, `CartDiscountCode`, `CartLine`, `CartSelectedPaymentMethod`, `CartShippingMethod`, `MailingAddress`, `PageInfo`
3071
2960
 
3072
2961
  **GraphQL**:
3073
2962
  ```graphql
@@ -3111,11 +3000,90 @@ fragment Cart on Cart {
3111
3000
  key
3112
3001
  value
3113
3002
  }
3003
+ email
3004
+ phone
3005
+ shippingAddress {
3006
+ ...MailingAddress
3007
+ }
3008
+ billingAddress {
3009
+ ...MailingAddress
3010
+ }
3011
+ selectedShippingMethod {
3012
+ ...CartShippingMethod
3013
+ }
3014
+ selectedPaymentMethod {
3015
+ ...CartSelectedPaymentMethod
3016
+ }
3017
+ appliedGiftCards {
3018
+ ...CartAppliedGiftCard
3019
+ }
3114
3020
  createdAt
3115
3021
  updatedAt
3116
3022
  }
3117
3023
  ```
3118
3024
 
3025
+ ### Fragment: `CartShippingMethod` on `CartShippingMethod`
3026
+
3027
+ **Section**: Cart
3028
+
3029
+ **Description**: Shipping method selected on a cart (D8 term unification — wcześniej ShippingRate). Returned przez `cart.selectedShippingMethod` po `cartSelectShippingMethod` mutation.
3030
+
3031
+ **Uses fragments**: `Money`
3032
+
3033
+ **GraphQL**:
3034
+ ```graphql
3035
+ fragment CartShippingMethod on CartShippingMethod {
3036
+ handle
3037
+ title
3038
+ price {
3039
+ ...Money
3040
+ }
3041
+ }
3042
+ ```
3043
+
3044
+ ### Fragment: `CartAppliedGiftCard` on `CartAppliedGiftCard`
3045
+
3046
+ **Section**: Cart
3047
+
3048
+ **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`.
3049
+
3050
+ **Uses fragments**: `Money`
3051
+
3052
+ **GraphQL**:
3053
+ ```graphql
3054
+ fragment CartAppliedGiftCard on CartAppliedGiftCard {
3055
+ maskedCode
3056
+ lastCharacters
3057
+ appliedAmount {
3058
+ ...Money
3059
+ }
3060
+ remainingBalance {
3061
+ ...Money
3062
+ }
3063
+ }
3064
+ ```
3065
+
3066
+ ### Fragment: `CartSelectedPaymentMethod` on `PaymentMethod`
3067
+
3068
+ **Section**: Cart
3069
+
3070
+ **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.
3071
+
3072
+ **GraphQL**:
3073
+ ```graphql
3074
+ fragment CartSelectedPaymentMethod on PaymentMethod {
3075
+ id
3076
+ name
3077
+ provider
3078
+ type
3079
+ icon
3080
+ description
3081
+ isDefault
3082
+ supportedCurrencies
3083
+ position
3084
+ }
3085
+ ```
3086
+
3119
3087
  ### Fragment: `ShopColors` on `ShopColors`
3120
3088
 
3121
3089
  **Section**: Shop
@@ -3350,247 +3318,6 @@ fragment AvailablePaymentMethods on AvailablePaymentMethods {
3350
3318
  }
3351
3319
  ```
3352
3320
 
3353
- ### Fragment: `ShippingRate` on `ShippingRate`
3354
-
3355
- **Section**: Checkout
3356
-
3357
- **Description**: Single shipping rate option — `handle` is the stable id you pass to `checkoutSelectShippingRate` as `rateId`, plus title and price.
3358
-
3359
- **Uses fragments**: `Money`
3360
-
3361
- **GraphQL**:
3362
- ```graphql
3363
- fragment ShippingRate on ShippingRate {
3364
- handle
3365
- title
3366
- price {
3367
- ...Money
3368
- }
3369
- }
3370
- ```
3371
-
3372
- ### Fragment: `TaxLine` on `TaxLine`
3373
-
3374
- **Section**: Checkout
3375
-
3376
- **Description**: One tax line on the checkout — title, rate (decimal, e.g. 0.23 for 23%), computed amount. Spread on the order summary.
3377
-
3378
- **Uses fragments**: `Money`
3379
-
3380
- **GraphQL**:
3381
- ```graphql
3382
- fragment TaxLine on TaxLine {
3383
- title
3384
- rate
3385
- price {
3386
- ...Money
3387
- }
3388
- }
3389
- ```
3390
-
3391
- ### Fragment: `DiscountAffectedItem` on `DiscountAffectedItem`
3392
-
3393
- **Section**: Checkout
3394
-
3395
- **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.
3396
-
3397
- **Uses fragments**: `Money`
3398
-
3399
- **GraphQL**:
3400
- ```graphql
3401
- fragment DiscountAffectedItem on DiscountAffectedItem {
3402
- productId
3403
- variantId
3404
- title
3405
- quantity
3406
- originalPrice {
3407
- ...Money
3408
- }
3409
- discountedPrice {
3410
- ...Money
3411
- }
3412
- savings {
3413
- ...Money
3414
- }
3415
- isFreeItem
3416
- }
3417
- ```
3418
-
3419
- ### Fragment: `DiscountApplication` on `DiscountApplication`
3420
-
3421
- **Section**: Checkout
3422
-
3423
- **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.
3424
-
3425
- **Uses fragments**: `DiscountAffectedItem`, `Money`
3426
-
3427
- **GraphQL**:
3428
- ```graphql
3429
- fragment DiscountApplication on DiscountApplication {
3430
- code
3431
- isApplicable
3432
- type
3433
- value {
3434
- ...Money
3435
- }
3436
- title
3437
- affectedItems {
3438
- ...DiscountAffectedItem
3439
- }
3440
- buyQuantity
3441
- getQuantity
3442
- getDiscountPercent
3443
- }
3444
- ```
3445
-
3446
- ### Fragment: `DiscountCode` on `DiscountCode`
3447
-
3448
- **Section**: Checkout
3449
-
3450
- **Description**: Lightweight discount code entry on the checkout — code + applicability flag.
3451
-
3452
- **GraphQL**:
3453
- ```graphql
3454
- fragment DiscountCode on DiscountCode {
3455
- code
3456
- isApplicable
3457
- }
3458
- ```
3459
-
3460
- ### Fragment: `CheckoutLineItem` on `CheckoutLineItem`
3461
-
3462
- **Section**: Checkout
3463
-
3464
- **Description**: Single line item in the checkout — variant snapshot, quantity, unit + total prices, image. Use on the order summary panel.
3465
-
3466
- **Uses fragments**: `ImageThumbnail`, `Money`
3467
-
3468
- **GraphQL**:
3469
- ```graphql
3470
- fragment CheckoutLineItem on CheckoutLineItem {
3471
- id
3472
- title
3473
- variantTitle
3474
- quantity
3475
- pricePerUnit {
3476
- ...Money
3477
- }
3478
- total {
3479
- ...Money
3480
- }
3481
- variantId
3482
- productId
3483
- sku
3484
- image {
3485
- ...ImageThumbnail
3486
- }
3487
- }
3488
- ```
3489
-
3490
- ### Fragment: `AppliedGiftCard` on `AppliedGiftCard`
3491
-
3492
- **Section**: Checkout
3493
-
3494
- **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.
3495
-
3496
- **Uses fragments**: `Money`
3497
-
3498
- **GraphQL**:
3499
- ```graphql
3500
- fragment AppliedGiftCard on AppliedGiftCard {
3501
- maskedCode
3502
- lastCharacters
3503
- appliedAmount {
3504
- ...Money
3505
- }
3506
- remainingBalance {
3507
- ...Money
3508
- }
3509
- }
3510
- ```
3511
-
3512
- ### Fragment: `Checkout` on `Checkout`
3513
-
3514
- **Section**: Checkout
3515
-
3516
- **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`.
3517
-
3518
- **Uses fragments**: `AppliedGiftCard`, `CheckoutLineItem`, `DiscountApplication`, `DiscountCode`, `MailingAddress`, `Money`, `PaymentMethod`, `ShippingRate`, `TaxLine`
3519
-
3520
- **GraphQL**:
3521
- ```graphql
3522
- fragment Checkout on Checkout {
3523
- id
3524
- isReady
3525
- isCompleted
3526
- completedOrderId
3527
- webUrl
3528
- lineItems {
3529
- ...CheckoutLineItem
3530
- }
3531
- totalQuantity
3532
- shippingAddress {
3533
- ...MailingAddress
3534
- }
3535
- billingAddress {
3536
- ...MailingAddress
3537
- }
3538
- shippingLine {
3539
- ...ShippingRate
3540
- }
3541
- availableShippingRates {
3542
- ...ShippingRate
3543
- }
3544
- shippingRatesReady
3545
- email
3546
- phone
3547
- customerId
3548
- discountCodes {
3549
- ...DiscountCode
3550
- }
3551
- discountApplications {
3552
- ...DiscountApplication
3553
- }
3554
- availablePaymentMethods {
3555
- ...PaymentMethod
3556
- }
3557
- selectedPaymentMethodId
3558
- cost {
3559
- subtotal {
3560
- ...Money
3561
- }
3562
- total {
3563
- ...Money
3564
- }
3565
- totalTax {
3566
- ...Money
3567
- }
3568
- totalShipping {
3569
- ...Money
3570
- }
3571
- totalDiscounts {
3572
- ...Money
3573
- }
3574
- }
3575
- taxLines {
3576
- ...TaxLine
3577
- }
3578
- appliedGiftCards {
3579
- ...AppliedGiftCard
3580
- }
3581
- totalGiftCardAmount {
3582
- ...Money
3583
- }
3584
- paymentDue {
3585
- ...Money
3586
- }
3587
- currencyCode
3588
- note
3589
- createdAt
3590
- updatedAt
3591
- }
3592
- ```
3593
-
3594
3321
  ### Fragment: `ShipmentEvent` on `ShipmentEvent`
3595
3322
 
3596
3323
  **Section**: Shipments / Tracking