Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions platforms/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ dependencies {

Checkout Kit presents a standard Shopify checkout URL. The common flow is:

1. Create or update a cart with the [Storefront GraphQL API](https://shopify.dev/docs/api/storefront), for example with [`cartCreate`](https://shopify.dev/docs/api/storefront/2026-04/mutations/cartCreate) and related cart mutations.
2. Read the cart's [`checkoutUrl`](https://shopify.dev/docs/api/storefront/2026-04/objects/Cart#field-cart-checkouturl).
1. Create or update a cart with the [Storefront GraphQL API](https://shopify.dev/docs/api/storefront), for example with [`cartCreate`](https://shopify.dev/docs/api/storefront/2026-07/mutations/cartCreate) and related cart mutations.
2. Read the cart's [`checkoutUrl`](https://shopify.dev/docs/api/storefront/2026-07/objects/Cart#field-cart-checkouturl).
3. Pass that URL, or a [cart permalink](https://help.shopify.com/en/manual/products/details/cart-permalink), to Checkout Kit.

You can use any GraphQL client. The sample app uses Apollo Kotlin and is a complete reference for a modern Storefront API cart flow.

For production use, see the [Storefront API GraphiQL Explorer](https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/getting-started) for schema exploration and the [`cartCreate`](https://shopify.dev/docs/api/storefront/2026-04/mutations/cartCreate) mutation reference for the full input shape, including buyer identity, attributes, discount codes, delivery addresses, and delivery options.
For production use, see the [Storefront API GraphiQL Explorer](https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/getting-started) for schema exploration and the [`cartCreate`](https://shopify.dev/docs/api/storefront/2026-07/mutations/cartCreate) mutation reference for the full input shape, including buyer identity, attributes, discount codes, delivery addresses, and delivery options.

## Present checkout

Expand Down
6 changes: 3 additions & 3 deletions platforms/swift/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ pod "ShopifyCheckoutKit/AcceleratedCheckouts", "4.0.0-alpha.6"

Checkout Kit presents a standard Shopify checkout URL. The common flow is:

1. Create or update a cart with the [Storefront GraphQL API](https://shopify.dev/docs/api/storefront), for example with [`cartCreate`](https://shopify.dev/docs/api/storefront/2026-04/mutations/cartCreate) and related cart mutations.
2. Read the cart's [`checkoutUrl`](https://shopify.dev/docs/api/storefront/2026-04/objects/Cart#field-cart-checkouturl).
1. Create or update a cart with the [Storefront GraphQL API](https://shopify.dev/docs/api/storefront), for example with [`cartCreate`](https://shopify.dev/docs/api/storefront/2026-07/mutations/cartCreate) and related cart mutations.
2. Read the cart's [`checkoutUrl`](https://shopify.dev/docs/api/storefront/2026-07/objects/Cart#field-cart-checkouturl).
3. Pass that URL, or a [cart permalink](https://help.shopify.com/en/manual/products/details/cart-permalink), to Checkout Kit.

You can use any GraphQL client. The sample app uses Apollo iOS and is a complete reference for a modern Storefront API integration.

For production use, see the [Storefront API GraphiQL Explorer](https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/getting-started) for schema exploration and the [`cartCreate`](https://shopify.dev/docs/api/storefront/2026-04/mutations/cartCreate) mutation reference for the full input shape, including buyer identity, attributes, discount codes, and delivery preferences.
For production use, see the [Storefront API GraphiQL Explorer](https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/getting-started) for schema exploration and the [`cartCreate`](https://shopify.dev/docs/api/storefront/2026-07/mutations/cartCreate) mutation reference for the full input shape, including buyer identity, attributes, discount codes, and delivery preferences.

## Present checkout

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ final class InfoDictionary: Sendable {
fatalError("Missing required configuration. Check your info.plist.")
}

let apiVersion = infoPlist["API_VERSION"] as? String ?? "2026-04"
let apiVersion = infoPlist["API_VERSION"] as? String ?? "2026-07"

self.apiVersion = apiVersion
self.address1 = address1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,75 +60,14 @@ extension GraphQLDocument {
currencyCode
}
}
discountCodes {
applicable
code
}
discountAllocations {
__typename
... on CartAutomaticDiscountAllocation {
discountedAmount {
amount
currencyCode
}
targetType
discountApplication {
targetSelection
targetType
value {
__typename
... on MoneyV2 {
amount
currencyCode
}
... on PricingPercentageValue {
percentage
}
}
}
discountApplications {
targetType
totalAllocatedAmount {
amount
currencyCode
}
... on CartCodeDiscountAllocation {
... on CartCodeDiscountApplication {
code
discountedAmount {
amount
currencyCode
}
targetType
discountApplication {
targetSelection
targetType
value {
__typename
... on MoneyV2 {
amount
currencyCode
}
... on PricingPercentageValue {
percentage
}
}
}
}
... on CartCustomDiscountAllocation {
discountedAmount {
amount
currencyCode
}
targetType
discountApplication {
targetSelection
targetType
value {
__typename
... on MoneyV2 {
amount
currencyCode
}
... on PricingPercentageValue {
percentage
}
}
}
}
}
}
Expand Down Expand Up @@ -195,73 +134,6 @@ extension GraphQLDocument {
currencyCode
}
}
discountAllocations {
__typename
... on CartAutomaticDiscountAllocation {
discountedAmount {
amount
currencyCode
}
targetType
discountApplication {
targetSelection
targetType
value {
__typename
... on MoneyV2 {
amount
currencyCode
}
... on PricingPercentageValue {
percentage
}
}
}
}
... on CartCodeDiscountAllocation {
code
discountedAmount {
amount
currencyCode
}
targetType
discountApplication {
targetSelection
targetType
value {
__typename
... on MoneyV2 {
amount
currencyCode
}
... on PricingPercentageValue {
percentage
}
}
}
}
... on CartCustomDiscountAllocation {
discountedAmount {
amount
currencyCode
}
targetType
discountApplication {
targetSelection
targetType
value {
__typename
... on MoneyV2 {
amount
currencyCode
}
... on PricingPercentageValue {
percentage
}
}
}
}
}
}
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,7 @@ extension StorefrontAPI {
let delivery: CartDelivery?
let lines: BaseCartLineConnection
let cost: CartCost
let discountCodes: [CartDiscountCode]
let discountAllocations: [CartDiscountAllocation]
}

/// Cart discount code
struct CartDiscountCode: Codable {
let code: String
let applicable: Bool
let discountApplications: [CartDiscountApplication]
}

/// Cart buyer identity
Expand Down Expand Up @@ -136,85 +129,11 @@ extension StorefrontAPI {
let nodes: [BaseCartLine]
}

/// Cart discount allocation
enum CartDiscountAllocation: Codable {
case automatic(CartAutomaticDiscountAllocation)
case code(CartCodeDiscountAllocation)
case custom(CartCustomDiscountAllocation)

private enum CodingKeys: String, CodingKey {
case __typename
}

private enum TypeName: String, Codable {
case cartAutomaticDiscountAllocation = "CartAutomaticDiscountAllocation"
case cartCodeDiscountAllocation = "CartCodeDiscountAllocation"
case cartCustomDiscountAllocation = "CartCustomDiscountAllocation"
}

init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
let typename = try container.decode(TypeName.self, forKey: .__typename)

switch typename {
case .cartAutomaticDiscountAllocation:
let allocation = try CartAutomaticDiscountAllocation(from: decoder)
self = .automatic(allocation)
case .cartCodeDiscountAllocation:
let allocation = try CartCodeDiscountAllocation(from: decoder)
self = .code(allocation)
case .cartCustomDiscountAllocation:
let allocation = try CartCustomDiscountAllocation(from: decoder)
self = .custom(allocation)
}
}

func encode(to encoder: Encoder) throws {
switch self {
case let .automatic(allocation):
try allocation.encode(to: encoder)
case let .code(allocation):
try allocation.encode(to: encoder)
case let .custom(allocation):
try allocation.encode(to: encoder)
}
}
}

/// Automatic discount allocation
struct CartAutomaticDiscountAllocation: Codable {
let discountApplication: CartDiscountApplication
let discountedAmount: MoneyV2
let targetType: DiscountApplicationTargetType
}

/// Code discount allocation
struct CartCodeDiscountAllocation: Codable {
let code: String
let discountApplication: CartDiscountApplication
let discountedAmount: MoneyV2
let targetType: DiscountApplicationTargetType
}

/// Custom discount allocation
struct CartCustomDiscountAllocation: Codable {
let discountApplication: CartDiscountApplication
let discountedAmount: MoneyV2
let targetType: DiscountApplicationTargetType
}

/// Cart discount application
struct CartDiscountApplication: Codable {
let targetSelection: DiscountApplicationTargetSelection
let targetType: DiscountApplicationTargetType
let value: PricingValue
}

/// Discount application target selection
enum DiscountApplicationTargetSelection: String, Codable {
case all = "ALL"
case entitled = "ENTITLED"
case explicit = "EXPLICIT"
let totalAllocatedAmount: MoneyV2
let code: String?
}

/// Discount application target type
Expand All @@ -223,56 +142,12 @@ extension StorefrontAPI {
case shippingLine = "SHIPPING_LINE"
}

/// Pricing value (union type for percentage or fixed amount)
enum PricingValue: Codable {
case percentage(PricingPercentageValue)
case fixedAmount(MoneyV2)

private enum CodingKeys: String, CodingKey {
case __typename
}

private enum TypeName: String, Codable {
case pricingPercentageValue = "PricingPercentageValue"
case moneyV2 = "MoneyV2"
}

init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
let typename = try container.decode(TypeName.self, forKey: .__typename)

switch typename {
case .pricingPercentageValue:
let percentage = try PricingPercentageValue(from: decoder)
self = .percentage(percentage)
case .moneyV2:
let amount = try MoneyV2(from: decoder)
self = .fixedAmount(amount)
}
}

func encode(to encoder: Encoder) throws {
switch self {
case let .percentage(percentage):
try percentage.encode(to: encoder)
case let .fixedAmount(amount):
try amount.encode(to: encoder)
}
}
}

/// Pricing percentage value
struct PricingPercentageValue: Codable {
let percentage: Double
}

/// Base cart line
struct BaseCartLine: Codable {
let id: Types.ID
let quantity: Int
let merchandise: ProductVariant?
let cost: CartLineCost
let discountAllocations: [CartDiscountAllocation]
}

/// Cart line cost
Expand Down Expand Up @@ -906,7 +781,7 @@ extension StorefrontAPI {
}

/// Represents shop settings data fetched from the Storefront API
/// https://shopify.dev/docs/api/storefront/2026-04/objects/Shop
/// https://shopify.dev/docs/api/storefront/2026-07/objects/Shop
@available(iOS 16.0, *)
class ShopSettings: ObservableObject {
/// The shop's name (merchant name for display)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ final class StorefrontAPI: ObservableObject, StorefrontAPIProtocol {
/// - Parameters:
/// - storefrontDomain: The shop domain (e.g., "example.myshopify.com")
/// - storefrontAccessToken: The storefront access token
/// - apiVersion: The API version to use (defaults to "2026-04")
/// - apiVersion: The API version to use (defaults to "2026-07")
/// - countryCode: Optional country code for localization
/// - languageCode: Optional language code for localization
init(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ShopifyCheckoutKit

public enum ShopifyAcceleratedCheckouts {
/// Storefront API version used for cart operations
internal static let apiVersion = "2026-04"
internal static let apiVersion = "2026-07"

internal static let name = "ShopifyAcceleratedCheckouts"

Expand Down
Loading
Loading