@doswiftly/storefront-operations 9.1.0 → 11.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/AGENTS.md +3 -3
- package/CHANGELOG.md +172 -0
- package/README.md +17 -37
- package/fragments.graphql +63 -156
- package/llms-full.txt +204 -480
- package/mutations.graphql +69 -122
- package/operations.json +119 -319
- package/package.json +1 -1
- package/queries.graphql +21 -7
- package/schema.graphql +398 -601
package/llms-full.txt
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# DoSwiftly Storefront Operations — Full Reference
|
|
2
2
|
|
|
3
|
-
> Schema version: **
|
|
4
|
-
> 48 queries ·
|
|
3
|
+
> Schema version: **11.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: `
|
|
433
|
+
### Query: `CartValidateDiscountCode`
|
|
434
434
|
|
|
435
|
-
**Section**:
|
|
435
|
+
**Section**: Discount Code Validation
|
|
436
436
|
|
|
437
|
-
**Description**:
|
|
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
|
-
- `$
|
|
441
|
-
|
|
442
|
-
**Fragments used**: `Checkout`
|
|
440
|
+
- `$cartId`: `ID!`
|
|
441
|
+
- `$discountCode`: `String!`
|
|
443
442
|
|
|
444
443
|
**GraphQL**:
|
|
445
444
|
```graphql
|
|
446
|
-
query
|
|
447
|
-
|
|
448
|
-
|
|
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: `
|
|
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
|
|
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
|
|
1401
|
-
|
|
1413
|
+
mutation CartDiscountCodesUpdate($id: ID!, $discountCodes: [String!]!) {
|
|
1414
|
+
cartDiscountCodesUpdate(id: $id, discountCodes: $discountCodes) {
|
|
1402
1415
|
cart {
|
|
1403
1416
|
...Cart
|
|
1404
1417
|
}
|
|
@@ -1774,356 +1787,226 @@ mutation CustomerResetPassword($token: String!, $newPassword: String!) {
|
|
|
1774
1787
|
}
|
|
1775
1788
|
```
|
|
1776
1789
|
|
|
1777
|
-
### Mutation: `
|
|
1790
|
+
### Mutation: `CartSetShippingAddress`
|
|
1778
1791
|
|
|
1779
|
-
**Section**:
|
|
1792
|
+
**Section**: Cart Completion Mutations
|
|
1780
1793
|
|
|
1781
|
-
**Description**:
|
|
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`: `
|
|
1797
|
+
- `$input`: `CartSetShippingAddressInput!`
|
|
1785
1798
|
|
|
1786
|
-
**Fragments used**: `
|
|
1799
|
+
**Fragments used**: `Cart`, `CartWarning`, `UserError`
|
|
1787
1800
|
|
|
1788
1801
|
**GraphQL**:
|
|
1789
1802
|
```graphql
|
|
1790
|
-
mutation
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
...
|
|
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: `
|
|
1818
|
+
### Mutation: `CartSetBillingAddress`
|
|
1829
1819
|
|
|
1830
|
-
**Section**:
|
|
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
|
-
- `$
|
|
1836
|
-
- `$billingAddress`: `CheckoutAddressInput!`
|
|
1825
|
+
- `$input`: `CartSetBillingAddressInput!`
|
|
1837
1826
|
|
|
1838
|
-
**Fragments used**: `
|
|
1827
|
+
**Fragments used**: `Cart`, `CartWarning`, `UserError`
|
|
1839
1828
|
|
|
1840
1829
|
**GraphQL**:
|
|
1841
1830
|
```graphql
|
|
1842
|
-
mutation
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
...
|
|
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: `
|
|
1846
|
+
### Mutation: `CartSelectShippingMethod`
|
|
1881
1847
|
|
|
1882
|
-
**Section**:
|
|
1848
|
+
**Section**: Cart Completion Mutations
|
|
1883
1849
|
|
|
1884
|
-
**Description**: Selects a shipping method by `
|
|
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
|
-
- `$
|
|
1888
|
-
- `$rateId`: `String!`
|
|
1853
|
+
- `$input`: `CartSelectShippingMethodInput!`
|
|
1889
1854
|
|
|
1890
|
-
**Fragments used**: `
|
|
1855
|
+
**Fragments used**: `Cart`, `CartWarning`, `UserError`
|
|
1891
1856
|
|
|
1892
1857
|
**GraphQL**:
|
|
1893
1858
|
```graphql
|
|
1894
|
-
mutation
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
...
|
|
1859
|
+
mutation CartSelectShippingMethod($input: CartSelectShippingMethodInput!) {
|
|
1860
|
+
cartSelectShippingMethod(input: $input) {
|
|
1861
|
+
cart {
|
|
1862
|
+
...Cart
|
|
1898
1863
|
}
|
|
1899
1864
|
userErrors {
|
|
1900
1865
|
...UserError
|
|
1901
1866
|
}
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
```
|
|
1905
|
-
|
|
1906
|
-
### Mutation: `CheckoutApplyDiscountCode`
|
|
1907
|
-
|
|
1908
|
-
**Section**: Checkout Mutations
|
|
1909
|
-
|
|
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.
|
|
1911
|
-
|
|
1912
|
-
**Variables**:
|
|
1913
|
-
- `$id`: `ID!`
|
|
1914
|
-
- `$discountCode`: `String!`
|
|
1915
|
-
|
|
1916
|
-
**Fragments used**: `Checkout`, `UserError`
|
|
1917
|
-
|
|
1918
|
-
**GraphQL**:
|
|
1919
|
-
```graphql
|
|
1920
|
-
mutation CheckoutApplyDiscountCode($id: ID!, $discountCode: String!) {
|
|
1921
|
-
checkoutApplyDiscountCode(id: $id, discountCode: $discountCode) {
|
|
1922
|
-
checkout {
|
|
1923
|
-
...Checkout
|
|
1924
|
-
}
|
|
1925
|
-
userErrors {
|
|
1926
|
-
...UserError
|
|
1867
|
+
warnings {
|
|
1868
|
+
...CartWarning
|
|
1927
1869
|
}
|
|
1928
1870
|
}
|
|
1929
1871
|
}
|
|
1930
1872
|
```
|
|
1931
1873
|
|
|
1932
|
-
### Mutation: `
|
|
1874
|
+
### Mutation: `CartSelectPaymentMethod`
|
|
1933
1875
|
|
|
1934
|
-
**Section**:
|
|
1876
|
+
**Section**: Cart Completion Mutations
|
|
1935
1877
|
|
|
1936
|
-
**Description**:
|
|
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`.
|
|
1937
1879
|
|
|
1938
1880
|
**Variables**:
|
|
1939
|
-
- `$
|
|
1940
|
-
- `$discountCode`: `String!`
|
|
1881
|
+
- `$input`: `CartSelectPaymentMethodInput!`
|
|
1941
1882
|
|
|
1942
|
-
**Fragments used**: `
|
|
1883
|
+
**Fragments used**: `Cart`, `CartWarning`, `UserError`
|
|
1943
1884
|
|
|
1944
1885
|
**GraphQL**:
|
|
1945
1886
|
```graphql
|
|
1946
|
-
mutation
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
...
|
|
1887
|
+
mutation CartSelectPaymentMethod($input: CartSelectPaymentMethodInput!) {
|
|
1888
|
+
cartSelectPaymentMethod(input: $input) {
|
|
1889
|
+
cart {
|
|
1890
|
+
...Cart
|
|
1950
1891
|
}
|
|
1951
1892
|
userErrors {
|
|
1952
1893
|
...UserError
|
|
1953
1894
|
}
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
```
|
|
1957
|
-
|
|
1958
|
-
### Mutation: `CheckoutValidateDiscountCode`
|
|
1959
|
-
|
|
1960
|
-
**Section**: Checkout Mutations
|
|
1961
|
-
|
|
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).
|
|
1963
|
-
|
|
1964
|
-
**Variables**:
|
|
1965
|
-
- `$id`: `ID!`
|
|
1966
|
-
- `$discountCode`: `String!`
|
|
1967
|
-
|
|
1968
|
-
**Fragments used**: `UserError`
|
|
1969
|
-
|
|
1970
|
-
**GraphQL**:
|
|
1971
|
-
```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
|
-
}
|
|
1990
|
-
}
|
|
1991
|
-
userErrors {
|
|
1992
|
-
...UserError
|
|
1895
|
+
warnings {
|
|
1896
|
+
...CartWarning
|
|
1993
1897
|
}
|
|
1994
1898
|
}
|
|
1995
1899
|
}
|
|
1996
1900
|
```
|
|
1997
1901
|
|
|
1998
|
-
### Mutation: `
|
|
1902
|
+
### Mutation: `CartApplyGiftCard`
|
|
1999
1903
|
|
|
2000
|
-
**Section**:
|
|
1904
|
+
**Section**: Cart Completion Mutations
|
|
2001
1905
|
|
|
2002
|
-
**Description**:
|
|
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`.
|
|
2003
1907
|
|
|
2004
1908
|
**Variables**:
|
|
2005
|
-
- `$
|
|
2006
|
-
- `$paymentMethodId`: `ID!`
|
|
1909
|
+
- `$input`: `CartApplyGiftCardInput!`
|
|
2007
1910
|
|
|
2008
|
-
**Fragments used**: `
|
|
1911
|
+
**Fragments used**: `Cart`, `CartWarning`, `UserError`
|
|
2009
1912
|
|
|
2010
1913
|
**GraphQL**:
|
|
2011
1914
|
```graphql
|
|
2012
|
-
mutation
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
...
|
|
1915
|
+
mutation CartApplyGiftCard($input: CartApplyGiftCardInput!) {
|
|
1916
|
+
cartApplyGiftCard(input: $input) {
|
|
1917
|
+
cart {
|
|
1918
|
+
...Cart
|
|
2016
1919
|
}
|
|
2017
1920
|
userErrors {
|
|
2018
1921
|
...UserError
|
|
2019
1922
|
}
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
```
|
|
2023
|
-
|
|
2024
|
-
### Mutation: `CheckoutComplete`
|
|
2025
|
-
|
|
2026
|
-
**Section**: Checkout Mutations
|
|
2027
|
-
|
|
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.
|
|
2029
|
-
|
|
2030
|
-
**Variables**:
|
|
2031
|
-
- `$id`: `ID!`
|
|
2032
|
-
- `$input`: `CheckoutCompleteInput`
|
|
2033
|
-
|
|
2034
|
-
**Fragments used**: `Checkout`, `Order`, `UserError`
|
|
2035
|
-
|
|
2036
|
-
**GraphQL**:
|
|
2037
|
-
```graphql
|
|
2038
|
-
mutation CheckoutComplete($id: ID!, $input: CheckoutCompleteInput) {
|
|
2039
|
-
checkoutComplete(id: $id, input: $input) {
|
|
2040
|
-
checkout {
|
|
2041
|
-
...Checkout
|
|
2042
|
-
}
|
|
2043
|
-
order {
|
|
2044
|
-
...Order
|
|
2045
|
-
}
|
|
2046
|
-
paymentUrl
|
|
2047
|
-
userErrors {
|
|
2048
|
-
...UserError
|
|
1923
|
+
warnings {
|
|
1924
|
+
...CartWarning
|
|
2049
1925
|
}
|
|
2050
1926
|
}
|
|
2051
1927
|
}
|
|
2052
1928
|
```
|
|
2053
1929
|
|
|
2054
|
-
### Mutation: `
|
|
1930
|
+
### Mutation: `CartRemoveGiftCard`
|
|
2055
1931
|
|
|
2056
|
-
**Section**:
|
|
1932
|
+
**Section**: Cart Completion Mutations
|
|
2057
1933
|
|
|
2058
|
-
**Description**:
|
|
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.
|
|
2059
1935
|
|
|
2060
1936
|
**Variables**:
|
|
2061
|
-
- `$
|
|
2062
|
-
- `$giftCardCode`: `String!`
|
|
1937
|
+
- `$input`: `CartRemoveGiftCardInput!`
|
|
2063
1938
|
|
|
2064
|
-
**Fragments used**: `
|
|
1939
|
+
**Fragments used**: `Cart`, `CartWarning`, `UserError`
|
|
2065
1940
|
|
|
2066
1941
|
**GraphQL**:
|
|
2067
1942
|
```graphql
|
|
2068
|
-
mutation
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
...
|
|
1943
|
+
mutation CartRemoveGiftCard($input: CartRemoveGiftCardInput!) {
|
|
1944
|
+
cartRemoveGiftCard(input: $input) {
|
|
1945
|
+
cart {
|
|
1946
|
+
...Cart
|
|
2072
1947
|
}
|
|
2073
1948
|
userErrors {
|
|
2074
1949
|
...UserError
|
|
2075
1950
|
}
|
|
1951
|
+
warnings {
|
|
1952
|
+
...CartWarning
|
|
1953
|
+
}
|
|
2076
1954
|
}
|
|
2077
1955
|
}
|
|
2078
1956
|
```
|
|
2079
1957
|
|
|
2080
|
-
### Mutation: `
|
|
1958
|
+
### Mutation: `CartUpdateGiftCardRecipient`
|
|
2081
1959
|
|
|
2082
|
-
**Section**:
|
|
1960
|
+
**Section**: Cart Completion Mutations
|
|
2083
1961
|
|
|
2084
|
-
**Description**:
|
|
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.
|
|
2085
1963
|
|
|
2086
1964
|
**Variables**:
|
|
2087
|
-
- `$
|
|
2088
|
-
- `$giftCardCode`: `String!`
|
|
1965
|
+
- `$input`: `CartUpdateGiftCardRecipientInput!`
|
|
2089
1966
|
|
|
2090
|
-
**Fragments used**: `
|
|
1967
|
+
**Fragments used**: `Cart`, `CartWarning`, `UserError`
|
|
2091
1968
|
|
|
2092
1969
|
**GraphQL**:
|
|
2093
1970
|
```graphql
|
|
2094
|
-
mutation
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
...
|
|
1971
|
+
mutation CartUpdateGiftCardRecipient($input: CartUpdateGiftCardRecipientInput!) {
|
|
1972
|
+
cartUpdateGiftCardRecipient(input: $input) {
|
|
1973
|
+
cart {
|
|
1974
|
+
...Cart
|
|
2098
1975
|
}
|
|
2099
1976
|
userErrors {
|
|
2100
1977
|
...UserError
|
|
2101
1978
|
}
|
|
1979
|
+
warnings {
|
|
1980
|
+
...CartWarning
|
|
1981
|
+
}
|
|
2102
1982
|
}
|
|
2103
1983
|
}
|
|
2104
1984
|
```
|
|
2105
1985
|
|
|
2106
|
-
### Mutation: `
|
|
1986
|
+
### Mutation: `CartComplete`
|
|
2107
1987
|
|
|
2108
|
-
**Section**:
|
|
1988
|
+
**Section**: Cart Completion Mutations
|
|
2109
1989
|
|
|
2110
|
-
**Description**:
|
|
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`.
|
|
2111
1991
|
|
|
2112
1992
|
**Variables**:
|
|
2113
|
-
- `$input`: `
|
|
1993
|
+
- `$input`: `CartCompleteInput!`
|
|
2114
1994
|
|
|
2115
|
-
**Fragments used**: `
|
|
1995
|
+
**Fragments used**: `CartWarning`, `Order`, `UserError`
|
|
2116
1996
|
|
|
2117
1997
|
**GraphQL**:
|
|
2118
1998
|
```graphql
|
|
2119
|
-
mutation
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
...
|
|
1999
|
+
mutation CartComplete($input: CartCompleteInput!) {
|
|
2000
|
+
cartComplete(input: $input) {
|
|
2001
|
+
order {
|
|
2002
|
+
...Order
|
|
2123
2003
|
}
|
|
2124
2004
|
userErrors {
|
|
2125
2005
|
...UserError
|
|
2126
2006
|
}
|
|
2007
|
+
warnings {
|
|
2008
|
+
...CartWarning
|
|
2009
|
+
}
|
|
2127
2010
|
}
|
|
2128
2011
|
}
|
|
2129
2012
|
```
|
|
@@ -2801,6 +2684,7 @@ fragment MailingAddress on MailingAddress {
|
|
|
2801
2684
|
countryCode
|
|
2802
2685
|
firstName
|
|
2803
2686
|
lastName
|
|
2687
|
+
name
|
|
2804
2688
|
phone
|
|
2805
2689
|
state
|
|
2806
2690
|
stateCode
|
|
@@ -2864,7 +2748,7 @@ fragment Customer on Customer {
|
|
|
2864
2748
|
|
|
2865
2749
|
**Section**: Customer
|
|
2866
2750
|
|
|
2867
|
-
**Description**: Order summary — number, totals (cost / tax / shipping), payment + fulfillment status, shipping address, item count, lifecycle timestamps. Spread on the order list
|
|
2751
|
+
**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
2752
|
|
|
2869
2753
|
**Uses fragments**: `MailingAddress`, `Money`
|
|
2870
2754
|
|
|
@@ -2898,6 +2782,8 @@ fragment Order on Order {
|
|
|
2898
2782
|
...MailingAddress
|
|
2899
2783
|
}
|
|
2900
2784
|
itemCount
|
|
2785
|
+
canCreatePayment
|
|
2786
|
+
paymentMethodType
|
|
2901
2787
|
}
|
|
2902
2788
|
```
|
|
2903
2789
|
|
|
@@ -3065,9 +2951,9 @@ fragment CartDiscountAllocation on CartDiscountAllocation {
|
|
|
3065
2951
|
|
|
3066
2952
|
**Section**: Cart
|
|
3067
2953
|
|
|
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.
|
|
2954
|
+
**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
2955
|
|
|
3070
|
-
**Uses fragments**: `CartBuyerIdentity`, `CartCost`, `CartDiscountAllocation`, `CartDiscountCode`, `CartLine`, `PageInfo`
|
|
2956
|
+
**Uses fragments**: `CartAppliedGiftCard`, `CartBuyerIdentity`, `CartCost`, `CartDiscountAllocation`, `CartDiscountCode`, `CartLine`, `CartSelectedPaymentMethod`, `CartShippingMethod`, `MailingAddress`, `PageInfo`
|
|
3071
2957
|
|
|
3072
2958
|
**GraphQL**:
|
|
3073
2959
|
```graphql
|
|
@@ -3111,11 +2997,90 @@ fragment Cart on Cart {
|
|
|
3111
2997
|
key
|
|
3112
2998
|
value
|
|
3113
2999
|
}
|
|
3000
|
+
email
|
|
3001
|
+
phone
|
|
3002
|
+
shippingAddress {
|
|
3003
|
+
...MailingAddress
|
|
3004
|
+
}
|
|
3005
|
+
billingAddress {
|
|
3006
|
+
...MailingAddress
|
|
3007
|
+
}
|
|
3008
|
+
selectedShippingMethod {
|
|
3009
|
+
...CartShippingMethod
|
|
3010
|
+
}
|
|
3011
|
+
selectedPaymentMethod {
|
|
3012
|
+
...CartSelectedPaymentMethod
|
|
3013
|
+
}
|
|
3014
|
+
appliedGiftCards {
|
|
3015
|
+
...CartAppliedGiftCard
|
|
3016
|
+
}
|
|
3114
3017
|
createdAt
|
|
3115
3018
|
updatedAt
|
|
3116
3019
|
}
|
|
3117
3020
|
```
|
|
3118
3021
|
|
|
3022
|
+
### Fragment: `CartShippingMethod` on `CartShippingMethod`
|
|
3023
|
+
|
|
3024
|
+
**Section**: Cart
|
|
3025
|
+
|
|
3026
|
+
**Description**: Shipping method selected on a cart (D8 term unification — wcześniej ShippingRate). Returned przez `cart.selectedShippingMethod` po `cartSelectShippingMethod` mutation.
|
|
3027
|
+
|
|
3028
|
+
**Uses fragments**: `Money`
|
|
3029
|
+
|
|
3030
|
+
**GraphQL**:
|
|
3031
|
+
```graphql
|
|
3032
|
+
fragment CartShippingMethod on CartShippingMethod {
|
|
3033
|
+
handle
|
|
3034
|
+
title
|
|
3035
|
+
price {
|
|
3036
|
+
...Money
|
|
3037
|
+
}
|
|
3038
|
+
}
|
|
3039
|
+
```
|
|
3040
|
+
|
|
3041
|
+
### Fragment: `CartAppliedGiftCard` on `CartAppliedGiftCard`
|
|
3042
|
+
|
|
3043
|
+
**Section**: Cart
|
|
3044
|
+
|
|
3045
|
+
**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`.
|
|
3046
|
+
|
|
3047
|
+
**Uses fragments**: `Money`
|
|
3048
|
+
|
|
3049
|
+
**GraphQL**:
|
|
3050
|
+
```graphql
|
|
3051
|
+
fragment CartAppliedGiftCard on CartAppliedGiftCard {
|
|
3052
|
+
maskedCode
|
|
3053
|
+
lastCharacters
|
|
3054
|
+
appliedAmount {
|
|
3055
|
+
...Money
|
|
3056
|
+
}
|
|
3057
|
+
remainingBalance {
|
|
3058
|
+
...Money
|
|
3059
|
+
}
|
|
3060
|
+
}
|
|
3061
|
+
```
|
|
3062
|
+
|
|
3063
|
+
### Fragment: `CartSelectedPaymentMethod` on `PaymentMethod`
|
|
3064
|
+
|
|
3065
|
+
**Section**: Cart
|
|
3066
|
+
|
|
3067
|
+
**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.
|
|
3068
|
+
|
|
3069
|
+
**GraphQL**:
|
|
3070
|
+
```graphql
|
|
3071
|
+
fragment CartSelectedPaymentMethod on PaymentMethod {
|
|
3072
|
+
id
|
|
3073
|
+
name
|
|
3074
|
+
provider
|
|
3075
|
+
type
|
|
3076
|
+
icon
|
|
3077
|
+
description
|
|
3078
|
+
isDefault
|
|
3079
|
+
supportedCurrencies
|
|
3080
|
+
position
|
|
3081
|
+
}
|
|
3082
|
+
```
|
|
3083
|
+
|
|
3119
3084
|
### Fragment: `ShopColors` on `ShopColors`
|
|
3120
3085
|
|
|
3121
3086
|
**Section**: Shop
|
|
@@ -3350,247 +3315,6 @@ fragment AvailablePaymentMethods on AvailablePaymentMethods {
|
|
|
3350
3315
|
}
|
|
3351
3316
|
```
|
|
3352
3317
|
|
|
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
3318
|
### Fragment: `ShipmentEvent` on `ShipmentEvent`
|
|
3595
3319
|
|
|
3596
3320
|
**Section**: Shipments / Tracking
|