diff --git a/.gitmodules b/.gitmodules index 9d22d9c28..5503e47ad 100644 --- a/.gitmodules +++ b/.gitmodules @@ -313,3 +313,8 @@ url = https://github.com/distilled-mirror/spec-mirror-sentry.git ignore = dirty shallow = true +[submodule "packages/squarespace/specs/spec-mirror-squarespace"] + path = packages/squarespace/specs/spec-mirror-squarespace + url = https://github.com/distilled-mirror/spec-mirror-squarespace.git + ignore = dirty + shallow = true diff --git a/packages/squarespace/.generated-specs/squarespace.json b/packages/squarespace/.generated-specs/squarespace.json new file mode 100644 index 000000000..0ae1c1be1 --- /dev/null +++ b/packages/squarespace/.generated-specs/squarespace.json @@ -0,0 +1,10333 @@ +{ + "smithy": "2.0", + "metadata": { + "suppressions": [ + { + "id": "HttpUriConflict", + "namespace": "*" + }, + { + "id": "HttpMethodSemantics", + "namespace": "*" + }, + { + "id": "UnreferencedShape", + "namespace": "*" + } + ], + "distilled.finalized": true + }, + "shapes": { + "com.squarespace.api#GetTransactionsSummariesRequestContactIdsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#GetTransactionsSummariesRequestGroupBy": { + "type": "enum", + "members": { + "CONTACTID": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "contactId" + } + } + }, + "traits": { + "smithy.api#documentation": "Field to group results by, should be a contactId" + } + }, + "com.squarespace.api#GetTransactionsSummariesRequest": { + "type": "structure", + "members": { + "contactIds": { + "target": "com.squarespace.api#GetTransactionsSummariesRequestContactIdsList", + "traits": { + "smithy.api#required": {} + } + }, + "groupBy": { + "target": "com.squarespace.api#GetTransactionsSummariesRequestGroupBy", + "traits": { + "smithy.api#documentation": "Field to group results by, should be a contactId", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#RetrieveTransactionsSummariesResponse": { + "type": "structure", + "members": { + "transactionsSummaryWrappers": { + "target": "com.squarespace.api#RetrieveTransactionsSummariesResponseTransactionsSummaryWrappersList", + "traits": { + "smithy.api#documentation": "List of transaction summary wrappers" + } + } + }, + "traits": {} + }, + "com.squarespace.api#TransactionsSummaryWrapper": { + "type": "structure", + "members": { + "contactId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique contact identifier" + } + }, + "transactionsSummary": { + "target": "com.squarespace.api#TransactionsSummary" + } + }, + "traits": { + "smithy.api#documentation": "List of transaction summary wrappers" + } + }, + "com.squarespace.api#TransactionsSummary": { + "type": "structure", + "members": { + "donationCount": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Count of donations submitted." + } + }, + "firstDonationSubmittedOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string; represents when the profile's first donation was submitted." + } + }, + "firstOrderSubmittedOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string; represents when the profile's first order was submitted." + } + }, + "lastDonationSubmittedOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string; represents when the profile's latest donation was submitted." + } + }, + "lastOrderSubmittedOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string; represents when the profile's latest order was submitted." + } + }, + "orderCount": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Count of orders submitted." + } + }, + "totalDonationAmount": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "totalOrderAmount": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "totalRefundAmount": { + "target": "com.squarespace.api#MonetaryAmount" + } + }, + "traits": { + "smithy.api#documentation": "Summary of profile's commerce transactions. If a profile has no commerce transactions, the object is still returned with null or 0 values. This information is calculated asynchronously; there may be a slight delay between when an order is created, and when it's reflected in the object." + } + }, + "com.squarespace.api#MonetaryAmount": { + "type": "structure", + "members": { + "currency": { + "target": "com.squarespace.api#MonetaryAmountCurrency", + "traits": { + "smithy.api#documentation": "ISO 4217 currency code." + } + }, + "value": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Decimal monetary value." + } + } + }, + "traits": { + "smithy.api#documentation": "A monetary amount with currency code and decimal value." + } + }, + "com.squarespace.api#MonetaryAmountCurrency": { + "type": "structure", + "members": { + "currencyCode": { + "target": "smithy.api#String" + }, + "defaultFractionDigits": { + "target": "smithy.api#Integer" + }, + "displayName": { + "target": "smithy.api#String" + }, + "numericCode": { + "target": "smithy.api#Integer" + }, + "numericCodeAsString": { + "target": "smithy.api#String" + }, + "symbol": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "ISO 4217 currency code." + } + }, + "com.squarespace.api#RetrieveTransactionsSummariesResponseTransactionsSummaryWrappersList": { + "type": "list", + "member": { + "target": "com.squarespace.api#TransactionsSummaryWrapper" + }, + "traits": { + "smithy.api#documentation": "List of transaction summary wrappers" + } + }, + "com.squarespace.api#GetTransactionsSummaries": { + "type": "operation", + "input": { + "target": "com.squarespace.api#GetTransactionsSummariesRequest" + }, + "output": { + "target": "com.squarespace.api#RetrieveTransactionsSummariesResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/v1/analytics/transaction-summaries", + "code": 200 + }, + "smithy.api#documentation": "Retrieve transaction summaries grouped by contact" + } + }, + "com.squarespace.api#ListDiscountsRequestSortBy": { + "type": "enum", + "members": { + "CREATED_ON": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREATED_ON" + } + }, + "PROMO_CODE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PROMO_CODE" + } + }, + "USES_COUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "USES_COUNT" + } + } + }, + "traits": {} + }, + "com.squarespace.api#ListDiscountsRequestSortDirection": { + "type": "enum", + "members": { + "ASCENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ASCENDING" + } + }, + "DESCENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DESCENDING" + } + } + }, + "traits": {} + }, + "com.squarespace.api#ListDiscountsRequestStatus": { + "type": "enum", + "members": { + "ALL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ALL" + } + }, + "ACTIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ACTIVE" + } + }, + "EXPIRED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EXPIRED" + } + }, + "SCHEDULED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SCHEDULED" + } + } + }, + "traits": {} + }, + "com.squarespace.api#ListDiscountsRequestCriteriaItem": { + "type": "enum", + "members": { + "ANY_ORDER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ANY_ORDER" + } + }, + "CART_TOTAL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CART_TOTAL" + } + }, + "PRODUCT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PRODUCT" + } + }, + "BUY_X_GET_Y": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BUY_X_GET_Y" + } + } + }, + "traits": {} + }, + "com.squarespace.api#ListDiscountsRequestCriteriaList": { + "type": "list", + "member": { + "target": "com.squarespace.api#ListDiscountsRequestCriteriaItem" + }, + "traits": {} + }, + "com.squarespace.api#ListDiscountsRequestTemplateItem": { + "type": "enum", + "members": { + "FIXED_AMOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FIXED_AMOUNT" + } + }, + "PERCENTAGE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PERCENTAGE" + } + }, + "BUY_X_GET_Y_FIXED_AMOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BUY_X_GET_Y_FIXED_AMOUNT" + } + }, + "BUY_X_GET_Y_PERCENTAGE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BUY_X_GET_Y_PERCENTAGE" + } + }, + "FREE_SHIPPING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FREE_SHIPPING" + } + } + }, + "traits": {} + }, + "com.squarespace.api#ListDiscountsRequestTemplateList": { + "type": "list", + "member": { + "target": "com.squarespace.api#ListDiscountsRequestTemplateItem" + }, + "traits": {} + }, + "com.squarespace.api#ListDiscountsRequestTrigger": { + "type": "enum", + "members": { + "AUTO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AUTO" + } + }, + "CODE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CODE" + } + } + }, + "traits": {} + }, + "com.squarespace.api#ListDiscountsRequest": { + "type": "structure", + "members": { + "sortBy": { + "target": "com.squarespace.api#ListDiscountsRequestSortBy", + "traits": { + "smithy.api#httpQuery": "sortBy", + "smithy.api#documentation": "Sort field for the result set." + } + }, + "sortDirection": { + "target": "com.squarespace.api#ListDiscountsRequestSortDirection", + "traits": { + "smithy.api#httpQuery": "sortDirection", + "smithy.api#documentation": "Sort direction." + } + }, + "search": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "search", + "smithy.api#documentation": "Free-text search across a discount's name and promo code." + } + }, + "status": { + "target": "com.squarespace.api#ListDiscountsRequestStatus", + "traits": { + "smithy.api#httpQuery": "status", + "smithy.api#documentation": "Filter by discount lifecycle status." + } + }, + "criteria": { + "target": "com.squarespace.api#ListDiscountsRequestCriteriaList", + "traits": { + "smithy.api#httpQuery": "criteria", + "smithy.api#documentation": "Filter by one or more criteria types (comma-separated). When omitted, defaults to all allowable values." + } + }, + "template": { + "target": "com.squarespace.api#ListDiscountsRequestTemplateList", + "traits": { + "smithy.api#httpQuery": "template", + "smithy.api#documentation": "Filter by one or more template types (comma-separated). When omitted, defaults to all allowable values." + } + }, + "trigger": { + "target": "com.squarespace.api#ListDiscountsRequestTrigger", + "traits": { + "smithy.api#httpQuery": "trigger", + "smithy.api#documentation": "Filter by one or more trigger types (comma-separated): AUTO (auto-applied) or CODE (promo code). When omitted, or when all allowable values are supplied, defaults to all allowable values." + } + }, + "limitedUseOnly": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#httpQuery": "limitedUseOnly", + "smithy.api#documentation": "When true, only discounts with limited-use semantics (per product rules) are returned." + } + }, + "offset": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpQuery": "offset", + "smithy.api#documentation": "Zero-based offset into the result set. Must be non-negative. Default 0." + } + }, + "limit": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpQuery": "limit", + "smithy.api#documentation": "Page size (1–1000; default 50)." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#PaginatedDiscountListResponse": { + "type": "structure", + "members": { + "discounts": { + "target": "com.squarespace.api#PaginatedDiscountListResponseDiscountsList", + "traits": { + "smithy.api#documentation": "Discounts for this page.", + "smithy.api#required": {} + } + }, + "hasNextPage": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "True when more results exist after the current window." + } + }, + "hasPreviousPage": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "True when a page of results exists before the current window." + } + } + }, + "traits": { + "smithy.api#documentation": "Offset-paginated list of discounts for a website." + } + }, + "com.squarespace.api#Discount": { + "type": "structure", + "members": { + "criteria": { + "target": "com.squarespace.api#DiscountCriteria", + "traits": { + "smithy.api#required": {} + } + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Discount id." + } + }, + "isLimitedUses": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "If true, the discount can only be used `maxUsesAllowed` times site-wide." + } + }, + "isOncePerCustomer": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "If true, a given customer can only use this discount once." + } + }, + "lastRedeemedAt": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Timestamp of the most recent redemption. Null if never redeemed." + } + }, + "maxUsesAllowed": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Maximum site-wide redemptions. Required when isLimitedUses=true; null otherwise." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Display name for the discount.", + "smithy.api#required": {} + } + }, + "numberOfUses": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Number of times this discount has been redeemed." + } + }, + "paymentPlanOptions": { + "target": "com.squarespace.api#PaymentPlanOptions" + }, + "status": { + "target": "com.squarespace.api#DiscountStatus", + "traits": { + "smithy.api#documentation": "Defines the lifecycle status of a discount." + } + }, + "subscriptionOptions": { + "target": "com.squarespace.api#SubscriptionOptions" + }, + "template": { + "target": "com.squarespace.api#DiscountTemplate", + "traits": { + "smithy.api#required": {} + } + }, + "trigger": { + "target": "com.squarespace.api#DiscountTrigger", + "traits": { + "smithy.api#required": {} + } + }, + "validFrom": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "When the discount becomes active.", + "smithy.api#required": {} + } + }, + "validTo": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "When the discount expires. Null = no expiry." + } + }, + "websiteId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "24-char website id." + } + } + }, + "traits": { + "smithy.api#documentation": "Discount configured for a Commerce store." + } + }, + "com.squarespace.api#AnyOrderCriteria": { + "type": "structure", + "members": { + "type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Discount applies to any order. No additional conditions." + } + }, + "com.squarespace.api#BuyXGetYCriteria": { + "type": "structure", + "members": { + "type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "criteriaAppliesTo": { + "target": "com.squarespace.api#BuyXGetYCriteriaCriteriaAppliesTo", + "traits": { + "smithy.api#documentation": "Specifies the possible targets for a BuyXGetYCriteria buy-side." + } + }, + "criteriaProductIds": { + "target": "com.squarespace.api#BuyXGetYCriteriaCriteriaProductIdsList", + "traits": { + "smithy.api#documentation": "Product ids the cart must contain. Required if criteriaAppliesTo=PRODUCT." + } + }, + "eligibleForDiscountQuantity": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Quantity of eligible items the discount applies to.", + "smithy.api#required": {} + } + }, + "requiredFullPriceQuantity": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Quantity of qualifying items required at full price.", + "smithy.api#required": {} + } + }, + "rewardAppliesTo": { + "target": "com.squarespace.api#BuyXGetYCriteriaRewardAppliesTo", + "traits": { + "smithy.api#documentation": "Specifies the possible targets for a BuyXGetYCriteria reward-side." + } + }, + "rewardProductIds": { + "target": "com.squarespace.api#BuyXGetYCriteriaRewardProductIdsList", + "traits": { + "smithy.api#documentation": "Product ids eligible for the reward. Required if rewardAppliesTo=PRODUCT." + } + } + }, + "traits": { + "smithy.api#documentation": "Discount applies when the cart contains a required quantity of qualifying items (buy side), granting a discount on a quantity of eligible items (reward side)." + } + }, + "com.squarespace.api#BuyXGetYCriteriaCriteriaAppliesTo": { + "type": "enum", + "members": { + "PRODUCT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PRODUCT" + } + } + }, + "traits": { + "smithy.api#documentation": "Specifies the possible targets for a BuyXGetYCriteria buy-side." + } + }, + "com.squarespace.api#BuyXGetYCriteriaCriteriaProductIdsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Product ids the cart must contain. Required if criteriaAppliesTo=PRODUCT." + } + }, + "com.squarespace.api#BuyXGetYCriteriaRewardAppliesTo": { + "type": "enum", + "members": { + "PRODUCT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PRODUCT" + } + } + }, + "traits": { + "smithy.api#documentation": "Specifies the possible targets for a BuyXGetYCriteria reward-side." + } + }, + "com.squarespace.api#BuyXGetYCriteriaRewardProductIdsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Product ids eligible for the reward. Required if rewardAppliesTo=PRODUCT." + } + }, + "com.squarespace.api#CartTotalCriteria": { + "type": "structure", + "members": { + "type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "minimumCartTotal": { + "target": "com.squarespace.api#MonetaryAmount", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Discount applies when the cart total meets or exceeds a minimum." + } + }, + "com.squarespace.api#ProductCriteria": { + "type": "structure", + "members": { + "type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "productId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Identifier of the product the discount targets." + } + }, + "productName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Display-time snapshot of the product name at the time the discount was created." + } + } + }, + "traits": { + "smithy.api#documentation": "Discount applies when the cart contains a specific product." + } + }, + "com.squarespace.api#DiscountCriteria": { + "type": "union", + "members": { + "AnyOrderCriteria": { + "target": "com.squarespace.api#AnyOrderCriteria" + }, + "BuyXGetYCriteria": { + "target": "com.squarespace.api#BuyXGetYCriteria" + }, + "CartTotalCriteria": { + "target": "com.squarespace.api#CartTotalCriteria" + }, + "ProductCriteria": { + "target": "com.squarespace.api#ProductCriteria" + } + }, + "traits": {} + }, + "com.squarespace.api#PaymentPlanOptions": { + "type": "structure", + "members": { + "type": { + "target": "com.squarespace.api#PaymentPlanOptionsType", + "traits": { + "smithy.api#documentation": "Defines how the discount applies to payment-plan payments.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Payment-plan applicability settings for this discount. When omitted from a create or update request, defaults to NONE." + } + }, + "com.squarespace.api#PaymentPlanOptionsType": { + "type": "enum", + "members": { + "NONE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NONE" + } + }, + "ALL_PAYMENTS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ALL_PAYMENTS" + } + } + }, + "traits": { + "smithy.api#documentation": "Defines how the discount applies to payment-plan payments." + } + }, + "com.squarespace.api#DiscountStatus": { + "type": "enum", + "members": { + "ACTIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ACTIVE" + } + }, + "SCHEDULED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SCHEDULED" + } + }, + "EXPIRED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EXPIRED" + } + } + }, + "traits": { + "smithy.api#documentation": "Defines the lifecycle status of a discount." + } + }, + "com.squarespace.api#SubscriptionOptions": { + "type": "structure", + "members": { + "type": { + "target": "com.squarespace.api#SubscriptionOptionsType", + "traits": { + "smithy.api#documentation": "Defines how the discount applies to subscription payments.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Subscription applicability settings for this discount. When omitted from a create or update request, defaults to EXCLUDED." + } + }, + "com.squarespace.api#SubscriptionOptionsType": { + "type": "enum", + "members": { + "EXCLUDED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EXCLUDED" + } + }, + "ALL_PAYMENTS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ALL_PAYMENTS" + } + }, + "LIMITED_PAYMENTS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LIMITED_PAYMENTS" + } + } + }, + "traits": { + "smithy.api#documentation": "Defines how the discount applies to subscription payments." + } + }, + "com.squarespace.api#BuyXGetYFixedAmountTemplate": { + "type": "structure", + "members": { + "type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "discountAmount": { + "target": "com.squarespace.api#MonetaryAmount", + "traits": { + "smithy.api#required": {} + } + }, + "maxApplicationsPerCart": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Caps how many times the discount can be applied per cart. 0 means unlimited." + } + } + }, + "traits": { + "smithy.api#documentation": "Apply a fixed monetary amount off each reward item in a BUY_X_GET_Y discount." + } + }, + "com.squarespace.api#BuyXGetYPercentageTemplate": { + "type": "structure", + "members": { + "type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "discountPercentage": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Percentage to subtract from each reward item. Range (0, 100].", + "smithy.api#required": {} + } + }, + "maxApplicationsPerCart": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Caps how many times the discount can be applied per cart. 0 means unlimited." + } + } + }, + "traits": { + "smithy.api#documentation": "Apply a percentage discount off each reward item in a BUY_X_GET_Y discount." + } + }, + "com.squarespace.api#FixedAmountTemplate": { + "type": "structure", + "members": { + "type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "discountAmount": { + "target": "com.squarespace.api#MonetaryAmount", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Apply a fixed monetary amount off the cart total." + } + }, + "com.squarespace.api#FreeShippingTemplate": { + "type": "structure", + "members": { + "type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "appliesToFulfillmentOptionType": { + "target": "com.squarespace.api#FreeShippingTemplateAppliesToFulfillmentOptionType", + "traits": { + "smithy.api#documentation": "Fulfillment channel a free-shipping discount applies to." + } + }, + "selectedShippingOption": { + "target": "com.squarespace.api#SelectedShippingOption" + } + }, + "traits": { + "smithy.api#documentation": "Waive shipping cost for eligible carts." + } + }, + "com.squarespace.api#FreeShippingTemplateAppliesToFulfillmentOptionType": { + "type": "enum", + "members": { + "SHIPPING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SHIPPING" + } + }, + "PICKUP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PICKUP" + } + }, + "LOCAL_DELIVERY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LOCAL_DELIVERY" + } + } + }, + "traits": { + "smithy.api#documentation": "Fulfillment channel a free-shipping discount applies to." + } + }, + "com.squarespace.api#SelectedShippingOption": { + "type": "structure", + "members": { + "isAllServicesSelected": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "If true, all services within the shipping option are eligible." + } + }, + "selectedService": { + "target": "com.squarespace.api#SelectedShippingOptionSelectedService", + "traits": { + "smithy.api#documentation": "Carrier service eligible for a free-shipping discount." + } + }, + "shippingOptionId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Identifier of the shipping option.", + "smithy.api#required": {} + } + }, + "shippingOptionName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Display-time snapshot of the shipping option name.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A shipping option targeted by a free-shipping discount." + } + }, + "com.squarespace.api#SelectedShippingOptionSelectedService": { + "type": "enum", + "members": { + "FEDEX_GROUND": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_GROUND" + } + }, + "FEDEX_GROUND_HOME_DELIVERY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_GROUND_HOME_DELIVERY" + } + }, + "FEDEX_PRIORITY_OVERNIGHT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_PRIORITY_OVERNIGHT" + } + }, + "FEDEX_STANDARD_OVERNIGHT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_STANDARD_OVERNIGHT" + } + }, + "FEDEX_2_DAY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_2_DAY" + } + }, + "FEDEX_2_DAY_AM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_2_DAY_AM" + } + }, + "FEDEX_EXPRESS_SAVER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_EXPRESS_SAVER" + } + }, + "FEDEX_FIRST_OVERNIGHT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_FIRST_OVERNIGHT" + } + }, + "FEDEX_SAME_DAY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_SAME_DAY" + } + }, + "FEDEX_SAME_DAY_CITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_SAME_DAY_CITY" + } + }, + "UPS_GROUND": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPS_GROUND" + } + }, + "UPS_NEXT_DAY_AIR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPS_NEXT_DAY_AIR" + } + }, + "UPS_NEXT_DAY_AIR_SAVER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPS_NEXT_DAY_AIR_SAVER" + } + }, + "UPS_NEXT_DAY_AIR_EARLY_AM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPS_NEXT_DAY_AIR_EARLY_AM" + } + }, + "UPS_TWO_DAY_AIR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPS_TWO_DAY_AIR" + } + }, + "UPS_TWO_DAY_AIR_AM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPS_TWO_DAY_AIR_AM" + } + }, + "UPS_THREE_DAY_SELECT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPS_THREE_DAY_SELECT" + } + }, + "USPS_PRIORITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "USPS_PRIORITY" + } + }, + "USPS_EXPRESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "USPS_EXPRESS" + } + }, + "USPS_STANDARD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "USPS_STANDARD" + } + } + }, + "traits": { + "smithy.api#documentation": "Carrier service eligible for a free-shipping discount." + } + }, + "com.squarespace.api#PercentageTemplate": { + "type": "structure", + "members": { + "type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "percentage": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Percentage to subtract from the cart total. Range (0, 100].", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Apply a percentage discount off the cart total." + } + }, + "com.squarespace.api#DiscountTemplate": { + "type": "union", + "members": { + "BuyXGetYFixedAmountTemplate": { + "target": "com.squarespace.api#BuyXGetYFixedAmountTemplate" + }, + "BuyXGetYPercentageTemplate": { + "target": "com.squarespace.api#BuyXGetYPercentageTemplate" + }, + "FixedAmountTemplate": { + "target": "com.squarespace.api#FixedAmountTemplate" + }, + "FreeShippingTemplate": { + "target": "com.squarespace.api#FreeShippingTemplate" + }, + "PercentageTemplate": { + "target": "com.squarespace.api#PercentageTemplate" + } + }, + "traits": {} + }, + "com.squarespace.api#AutoTrigger": { + "type": "structure", + "members": { + "type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Trigger for a discount that is automatically applied; no promo code required." + } + }, + "com.squarespace.api#PromoCodeTrigger": { + "type": "structure", + "members": { + "type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "promoCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Shopper-entered promo code. Required, non-empty, 1–50 characters; allowed characters: letters, digits, underscore, hyphen.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Trigger for a discount that is unlocked by a shopper-entered promo code." + } + }, + "com.squarespace.api#DiscountTrigger": { + "type": "union", + "members": { + "AutoTrigger": { + "target": "com.squarespace.api#AutoTrigger" + }, + "PromoCodeTrigger": { + "target": "com.squarespace.api#PromoCodeTrigger" + } + }, + "traits": {} + }, + "com.squarespace.api#PaginatedDiscountListResponseDiscountsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#Discount" + }, + "traits": { + "smithy.api#documentation": "Discounts for this page." + } + }, + "com.squarespace.api#ListDiscounts": { + "type": "operation", + "input": { + "target": "com.squarespace.api#ListDiscountsRequest" + }, + "output": { + "target": "com.squarespace.api#PaginatedDiscountListResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#Forbidden" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/v1/commerce/discounts", + "code": 200 + }, + "smithy.api#documentation": "List discounts\n\nReturns a paginated list of discounts for the website. Requires OAuth website scope website.discounts.read or website.discounts, or API key scope DISCOUNTS_READONLY or DISCOUNTS." + } + }, + "com.squarespace.api#CreateDiscountRequestCriteria": { + "type": "union", + "members": { + "AnyOrderCriteria": { + "target": "com.squarespace.api#AnyOrderCriteria" + }, + "BuyXGetYCriteria": { + "target": "com.squarespace.api#BuyXGetYCriteria" + }, + "CartTotalCriteria": { + "target": "com.squarespace.api#CartTotalCriteria" + }, + "ProductCriteria": { + "target": "com.squarespace.api#ProductCriteria" + } + }, + "traits": {} + }, + "com.squarespace.api#CreateDiscountRequestTemplate": { + "type": "union", + "members": { + "BuyXGetYFixedAmountTemplate": { + "target": "com.squarespace.api#BuyXGetYFixedAmountTemplate" + }, + "BuyXGetYPercentageTemplate": { + "target": "com.squarespace.api#BuyXGetYPercentageTemplate" + }, + "FixedAmountTemplate": { + "target": "com.squarespace.api#FixedAmountTemplate" + }, + "FreeShippingTemplate": { + "target": "com.squarespace.api#FreeShippingTemplate" + }, + "PercentageTemplate": { + "target": "com.squarespace.api#PercentageTemplate" + } + }, + "traits": {} + }, + "com.squarespace.api#CreateDiscountRequestTrigger": { + "type": "union", + "members": { + "AutoTrigger": { + "target": "com.squarespace.api#AutoTrigger" + }, + "PromoCodeTrigger": { + "target": "com.squarespace.api#PromoCodeTrigger" + } + }, + "traits": {} + }, + "com.squarespace.api#CreateDiscountRequest": { + "type": "structure", + "members": { + "criteria": { + "target": "com.squarespace.api#CreateDiscountRequestCriteria", + "traits": { + "smithy.api#required": {} + } + }, + "isLimitedUses": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "If true, the discount can only be used `maxUsesAllowed` times site-wide." + } + }, + "isOncePerCustomer": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "If true, a given customer can only use this discount once." + } + }, + "maxUsesAllowed": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Maximum site-wide redemptions. Required when isLimitedUses=true; null otherwise." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Display name for the discount.", + "smithy.api#required": {} + } + }, + "paymentPlanOptions": { + "target": "com.squarespace.api#PaymentPlanOptions" + }, + "subscriptionOptions": { + "target": "com.squarespace.api#SubscriptionOptions" + }, + "template": { + "target": "com.squarespace.api#CreateDiscountRequestTemplate", + "traits": { + "smithy.api#required": {} + } + }, + "trigger": { + "target": "com.squarespace.api#CreateDiscountRequestTrigger", + "traits": { + "smithy.api#required": {} + } + }, + "validFrom": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "When the discount becomes active.", + "smithy.api#required": {} + } + }, + "validTo": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "When the discount expires. Null = no expiry." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#DiscountResponse": { + "type": "structure", + "members": { + "discount": { + "target": "com.squarespace.api#Discount", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Envelope for a single discount response." + } + }, + "com.squarespace.api#CreateDiscount": { + "type": "operation", + "input": { + "target": "com.squarespace.api#CreateDiscountRequest" + }, + "output": { + "target": "com.squarespace.api#DiscountResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#Forbidden" + }, + { + "target": "com.squarespace.api#Conflict" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/v1/commerce/discounts", + "code": 200 + }, + "smithy.api#documentation": "Create discount\n\nCreates a discount. A successful request returns the created Discount resource. Requires OAuth website scope website.discounts, or API key scope DISCOUNTS." + } + }, + "com.squarespace.api#GetDiscountRequest": { + "type": "structure", + "members": { + "discountId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The discount's ID" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#GetDiscount": { + "type": "operation", + "input": { + "target": "com.squarespace.api#GetDiscountRequest" + }, + "output": { + "target": "com.squarespace.api#DiscountResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#Forbidden" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/v1/commerce/discounts/{discountId}", + "code": 200 + }, + "smithy.api#documentation": "Get discount\n\nReturns the discount for the given discount ID. Requires OAuth website scope website.discounts.read or website.discounts, or API key scope DISCOUNTS_READONLY or DISCOUNTS." + } + }, + "com.squarespace.api#UpdateDiscountRequestCriteria": { + "type": "union", + "members": { + "AnyOrderCriteria": { + "target": "com.squarespace.api#AnyOrderCriteria" + }, + "BuyXGetYCriteria": { + "target": "com.squarespace.api#BuyXGetYCriteria" + }, + "CartTotalCriteria": { + "target": "com.squarespace.api#CartTotalCriteria" + }, + "ProductCriteria": { + "target": "com.squarespace.api#ProductCriteria" + } + }, + "traits": {} + }, + "com.squarespace.api#UpdateDiscountRequestTemplate": { + "type": "union", + "members": { + "BuyXGetYFixedAmountTemplate": { + "target": "com.squarespace.api#BuyXGetYFixedAmountTemplate" + }, + "BuyXGetYPercentageTemplate": { + "target": "com.squarespace.api#BuyXGetYPercentageTemplate" + }, + "FixedAmountTemplate": { + "target": "com.squarespace.api#FixedAmountTemplate" + }, + "FreeShippingTemplate": { + "target": "com.squarespace.api#FreeShippingTemplate" + }, + "PercentageTemplate": { + "target": "com.squarespace.api#PercentageTemplate" + } + }, + "traits": {} + }, + "com.squarespace.api#UpdateDiscountRequestTrigger": { + "type": "union", + "members": { + "AutoTrigger": { + "target": "com.squarespace.api#AutoTrigger" + }, + "PromoCodeTrigger": { + "target": "com.squarespace.api#PromoCodeTrigger" + } + }, + "traits": {} + }, + "com.squarespace.api#UpdateDiscountRequest": { + "type": "structure", + "members": { + "discountId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The discount's unique identifier." + } + }, + "criteria": { + "target": "com.squarespace.api#UpdateDiscountRequestCriteria", + "traits": { + "smithy.api#required": {} + } + }, + "isLimitedUses": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "If true, the discount can only be used `maxUsesAllowed` times site-wide." + } + }, + "isOncePerCustomer": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "If true, a given customer can only use this discount once." + } + }, + "maxUsesAllowed": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Maximum site-wide redemptions. Required when isLimitedUses=true; null otherwise." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Display name for the discount.", + "smithy.api#required": {} + } + }, + "paymentPlanOptions": { + "target": "com.squarespace.api#PaymentPlanOptions" + }, + "subscriptionOptions": { + "target": "com.squarespace.api#SubscriptionOptions" + }, + "template": { + "target": "com.squarespace.api#UpdateDiscountRequestTemplate", + "traits": { + "smithy.api#required": {} + } + }, + "trigger": { + "target": "com.squarespace.api#UpdateDiscountRequestTrigger", + "traits": { + "smithy.api#required": {} + } + }, + "validFrom": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "When the discount becomes active.", + "smithy.api#required": {} + } + }, + "validTo": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "When the discount expires. Null = no expiry." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#UpdateDiscount": { + "type": "operation", + "input": { + "target": "com.squarespace.api#UpdateDiscountRequest" + }, + "output": { + "target": "com.squarespace.api#DiscountResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#Forbidden" + }, + { + "target": "com.squarespace.api#NotFound" + }, + { + "target": "com.squarespace.api#Conflict" + } + ], + "traits": { + "smithy.api#http": { + "method": "PUT", + "uri": "/v1/commerce/discounts/{discountId}", + "code": 200 + }, + "smithy.api#documentation": "Update discount\n\nReplaces the discount for the given discount ID. Requires OAuth website scope website.discounts, or API key scope DISCOUNTS." + } + }, + "com.squarespace.api#DeleteDiscountRequest": { + "type": "structure", + "members": { + "discountId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The discount's ID." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#DeleteDiscount": { + "type": "operation", + "input": { + "target": "com.squarespace.api#DeleteDiscountRequest" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.squarespace.api#Forbidden" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "DELETE", + "uri": "/v1/commerce/discounts/{discountId}", + "code": 200 + }, + "smithy.api#documentation": "Delete discount\n\nDeletes the discount for the given discount ID. Deletion is permitted for any discount owned by the website, including discounts whose criteria, template, or trigger types are not supported by this API version; no type validation is performed. Requires OAuth website scope website.discounts, or API key scope DISCOUNTS." + } + }, + "com.squarespace.api#GetContactsRequest": { + "type": "structure", + "members": { + "pageSize": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpQuery": "pageSize", + "smithy.api#documentation": "number of contacts to retrieve per request" + } + }, + "cursor": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "cursor", + "smithy.api#documentation": "where next page of results begins. should be {pagination.nextPageCursor} from previous response." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#PaginatedGetContactsResponse": { + "type": "structure", + "members": { + "contacts": { + "target": "com.squarespace.api#PaginatedGetContactsResponseContactsList", + "traits": { + "smithy.api#documentation": "paginated list of contacts retrieved" + } + }, + "pagination": { + "target": "com.squarespace.api#PaginatedGetContactsResponsePagination" + } + }, + "traits": {} + }, + "com.squarespace.api#Contact": { + "type": "structure", + "members": { + "createdOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The date and time when the contact was created." + } + }, + "defaultShippingAddress": { + "target": "com.squarespace.api#AddressBookEntry" + }, + "firstName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The contact's first name." + } + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The contact's ID." + } + }, + "lastName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The contact's last name." + } + }, + "locale": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The contact's locale." + } + }, + "primaryEmail": { + "target": "com.squarespace.api#Email" + } + }, + "traits": { + "smithy.api#documentation": "A contact." + } + }, + "com.squarespace.api#AddressBookEntry": { + "type": "structure", + "members": { + "address": { + "target": "com.squarespace.api#ContactAddress" + }, + "defaultShipping": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Whether this entry is the current default shipping address. When the contact has any address book entries, exactly one entry has this value set to true." + } + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The address book entry's ID." + } + } + }, + "traits": { + "smithy.api#documentation": "An address book entry for a contact." + } + }, + "com.squarespace.api#ContactAddress": { + "type": "structure", + "members": { + "city": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Address' city" + } + }, + "countryCode": { + "target": "com.squarespace.api#ContactAddressCountryCode", + "traits": { + "smithy.api#documentation": "ISO 3166 alpha-2 country code string.", + "smithy.api#required": {} + } + }, + "firstName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Contact's first name" + } + }, + "lastName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Contact's last name" + } + }, + "line1": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "First line of address" + } + }, + "line2": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Second line of address" + } + }, + "phoneNumber": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Contact's phone number" + } + }, + "postalCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "zip/postal code" + } + }, + "region": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "General region (State, Province, County, etc...)" + } + } + }, + "traits": { + "smithy.api#documentation": "Address properties for a contact." + } + }, + "com.squarespace.api#ContactAddressCountryCode": { + "type": "enum", + "members": { + "AF": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AF" + } + }, + "AX": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AX" + } + }, + "AL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AL" + } + }, + "DZ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DZ" + } + }, + "AS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AS" + } + }, + "AD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AD" + } + }, + "AO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AO" + } + }, + "AI": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AI" + } + }, + "AQ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AQ" + } + }, + "AG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AG" + } + }, + "AR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AR" + } + }, + "AM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AM" + } + }, + "AW": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AW" + } + }, + "AU": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AU" + } + }, + "AT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AT" + } + }, + "AZ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AZ" + } + }, + "BS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BS" + } + }, + "BH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BH" + } + }, + "BD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BD" + } + }, + "BB": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BB" + } + }, + "BY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BY" + } + }, + "BE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BE" + } + }, + "BZ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BZ" + } + }, + "BJ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BJ" + } + }, + "BM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BM" + } + }, + "BT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BT" + } + }, + "BO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BO" + } + }, + "BA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BA" + } + }, + "BW": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BW" + } + }, + "BV": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BV" + } + }, + "BR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BR" + } + }, + "IO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IO" + } + }, + "BN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BN" + } + }, + "BG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BG" + } + }, + "BF": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BF" + } + }, + "BI": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BI" + } + }, + "BQ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BQ" + } + }, + "KH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "KH" + } + }, + "CM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CM" + } + }, + "CA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CA" + } + }, + "CV": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CV" + } + }, + "KY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "KY" + } + }, + "CF": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CF" + } + }, + "TD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TD" + } + }, + "CL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CL" + } + }, + "CN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CN" + } + }, + "CX": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CX" + } + }, + "CC": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CC" + } + }, + "CO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CO" + } + }, + "KM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "KM" + } + }, + "CG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CG" + } + }, + "CD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CD" + } + }, + "CK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CK" + } + }, + "CR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CR" + } + }, + "CI": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CI" + } + }, + "CW": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CW" + } + }, + "HR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "HR" + } + }, + "CU": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CU" + } + }, + "CY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CY" + } + }, + "CZ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CZ" + } + }, + "DK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DK" + } + }, + "DJ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DJ" + } + }, + "DM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DM" + } + }, + "DO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DO" + } + }, + "EC": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EC" + } + }, + "EG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EG" + } + }, + "SV": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SV" + } + }, + "GQ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GQ" + } + }, + "ER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ER" + } + }, + "EE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EE" + } + }, + "ET": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ET" + } + }, + "FK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FK" + } + }, + "FO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FO" + } + }, + "FJ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FJ" + } + }, + "FI": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FI" + } + }, + "FR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FR" + } + }, + "GF": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GF" + } + }, + "PF": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PF" + } + }, + "TF": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TF" + } + }, + "GA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GA" + } + }, + "GM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GM" + } + }, + "GE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GE" + } + }, + "DE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DE" + } + }, + "GH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GH" + } + }, + "GI": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GI" + } + }, + "GR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GR" + } + }, + "GL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GL" + } + }, + "GD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GD" + } + }, + "GP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GP" + } + }, + "GU": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GU" + } + }, + "GT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GT" + } + }, + "GG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GG" + } + }, + "GN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GN" + } + }, + "GW": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GW" + } + }, + "GY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GY" + } + }, + "HT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "HT" + } + }, + "HM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "HM" + } + }, + "VA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "VA" + } + }, + "HN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "HN" + } + }, + "HK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "HK" + } + }, + "HU": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "HU" + } + }, + "IS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IS" + } + }, + "IN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IN" + } + }, + "ID": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ID" + } + }, + "IR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IR" + } + }, + "IQ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IQ" + } + }, + "IE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IE" + } + }, + "IM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IM" + } + }, + "IL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IL" + } + }, + "IT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IT" + } + }, + "JM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "JM" + } + }, + "JP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "JP" + } + }, + "JE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "JE" + } + }, + "JO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "JO" + } + }, + "KZ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "KZ" + } + }, + "KE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "KE" + } + }, + "KI": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "KI" + } + }, + "XK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "XK" + } + }, + "KP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "KP" + } + }, + "KR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "KR" + } + }, + "KW": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "KW" + } + }, + "KG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "KG" + } + }, + "LA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LA" + } + }, + "LV": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LV" + } + }, + "LB": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LB" + } + }, + "LS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LS" + } + }, + "LR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LR" + } + }, + "LY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LY" + } + }, + "LI": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LI" + } + }, + "LT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LT" + } + }, + "LU": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LU" + } + }, + "MO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MO" + } + }, + "MF": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MF" + } + }, + "MK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MK" + } + }, + "MG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MG" + } + }, + "MW": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MW" + } + }, + "MY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MY" + } + }, + "MV": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MV" + } + }, + "ML": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ML" + } + }, + "MT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MT" + } + }, + "MH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MH" + } + }, + "MQ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MQ" + } + }, + "MR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MR" + } + }, + "MU": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MU" + } + }, + "YT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "YT" + } + }, + "MX": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MX" + } + }, + "FM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FM" + } + }, + "MD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MD" + } + }, + "MC": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MC" + } + }, + "MN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MN" + } + }, + "ME": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ME" + } + }, + "MS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MS" + } + }, + "MA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MA" + } + }, + "MZ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MZ" + } + }, + "MM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MM" + } + }, + "NA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NA" + } + }, + "NR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NR" + } + }, + "NP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NP" + } + }, + "NL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NL" + } + }, + "AN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AN" + } + }, + "NC": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NC" + } + }, + "NZ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NZ" + } + }, + "NI": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NI" + } + }, + "NE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NE" + } + }, + "NG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NG" + } + }, + "NU": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NU" + } + }, + "NF": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NF" + } + }, + "MP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MP" + } + }, + "NO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NO" + } + }, + "OM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OM" + } + }, + "PK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PK" + } + }, + "PW": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PW" + } + }, + "PS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PS" + } + }, + "PA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PA" + } + }, + "PG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PG" + } + }, + "PY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PY" + } + }, + "PE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PE" + } + }, + "PH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PH" + } + }, + "PN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PN" + } + }, + "PL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PL" + } + }, + "PT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PT" + } + }, + "PR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PR" + } + }, + "QA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "QA" + } + }, + "RE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RE" + } + }, + "RO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RO" + } + }, + "RU": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RU" + } + }, + "RW": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RW" + } + }, + "BL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BL" + } + }, + "SH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SH" + } + }, + "KN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "KN" + } + }, + "LC": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LC" + } + }, + "PM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PM" + } + }, + "VC": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "VC" + } + }, + "WS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "WS" + } + }, + "SM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SM" + } + }, + "ST": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ST" + } + }, + "SA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SA" + } + }, + "SN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SN" + } + }, + "RS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RS" + } + }, + "SC": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SC" + } + }, + "SL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SL" + } + }, + "SG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SG" + } + }, + "SK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SK" + } + }, + "SI": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SI" + } + }, + "SB": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SB" + } + }, + "SO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SO" + } + }, + "SX": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SX" + } + }, + "ZA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ZA" + } + }, + "GS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GS" + } + }, + "ES": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ES" + } + }, + "LK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LK" + } + }, + "SD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SD" + } + }, + "SR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SR" + } + }, + "SJ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SJ" + } + }, + "SS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SS" + } + }, + "SZ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SZ" + } + }, + "SY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SY" + } + }, + "SE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SE" + } + }, + "CH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CH" + } + }, + "TW": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TW" + } + }, + "TJ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TJ" + } + }, + "TZ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TZ" + } + }, + "TH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TH" + } + }, + "TL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TL" + } + }, + "TG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TG" + } + }, + "TK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TK" + } + }, + "TO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TO" + } + }, + "TT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TT" + } + }, + "TN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TN" + } + }, + "TR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TR" + } + }, + "TM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TM" + } + }, + "TC": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TC" + } + }, + "TV": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TV" + } + }, + "UG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UG" + } + }, + "UA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UA" + } + }, + "AE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AE" + } + }, + "GB": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GB" + } + }, + "US": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "US" + } + }, + "UM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UM" + } + }, + "UY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UY" + } + }, + "UZ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UZ" + } + }, + "VU": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "VU" + } + }, + "VE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "VE" + } + }, + "VN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "VN" + } + }, + "VG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "VG" + } + }, + "VI": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "VI" + } + }, + "WF": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "WF" + } + }, + "EH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EH" + } + }, + "YE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "YE" + } + }, + "ZM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ZM" + } + }, + "ZW": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ZW" + } + } + }, + "traits": { + "smithy.api#documentation": "ISO 3166 alpha-2 country code string." + } + }, + "com.squarespace.api#Email": { + "type": "structure", + "members": { + "acceptsMarketing": { + "target": "com.squarespace.api#AcceptsMarketing" + }, + "createdOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The date and time when the email was created." + } + }, + "email": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The email address." + } + } + }, + "traits": { + "smithy.api#documentation": "The contact's primary email." + } + }, + "com.squarespace.api#AcceptsMarketing": { + "type": "structure", + "members": { + "acceptsMarketing": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Whether the contact accepts marketing email." + } + }, + "joinedOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The date and time the contact was added to the marketing list.The value returned in the creation response is a near-real-time estimate; the Get Contact endpoint should be used to verify the exact persisted timestamp." + } + }, + "leftOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The date and time the contact left Marketing list" + } + } + }, + "traits": { + "smithy.api#documentation": "Marketing subscription state for the contact's email." + } + }, + "com.squarespace.api#PaginatedGetContactsResponseContactsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#Contact" + }, + "traits": { + "smithy.api#documentation": "paginated list of contacts retrieved" + } + }, + "com.squarespace.api#PaginatedGetContactsResponsePagination": { + "type": "structure", + "members": { + "hasNextPage": { + "target": "smithy.api#Boolean" + }, + "nextPageCursor": { + "target": "smithy.api#String" + }, + "nextPageUrl": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.squarespace.api#GetContacts": { + "type": "operation", + "input": { + "target": "com.squarespace.api#GetContactsRequest" + }, + "output": { + "target": "com.squarespace.api#PaginatedGetContactsResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#Forbidden" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/v1/contacts", + "code": 200 + }, + "smithy.api#documentation": "List contacts\n\nReturns a paginated list of contacts for the website. Requires OAuth website scope website.contacts.read or website.contacts, or API key scope CONTACT_READONLY or CONTACT, or OAuth website scope website.profiles.read or website.profiles (OAuth only)." + } + }, + "com.squarespace.api#CreateEmail": { + "type": "structure", + "members": { + "acceptsMarketing": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "If contact's email accepts marketing" + } + }, + "email": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The email address.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Primary email supplied when creating a contact." + } + }, + "com.squarespace.api#CreateContactRequest": { + "type": "structure", + "members": { + "firstName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Contact's first name", + "smithy.api#required": {} + } + }, + "lastName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Contact's last name", + "smithy.api#required": {} + } + }, + "locale": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Contact's locale", + "smithy.api#required": {} + } + }, + "primaryEmail": { + "target": "com.squarespace.api#CreateEmail", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#CreateContactResponse": { + "type": "structure", + "members": { + "contact": { + "target": "com.squarespace.api#Contact" + } + }, + "traits": {} + }, + "com.squarespace.api#CreateContact": { + "type": "operation", + "input": { + "target": "com.squarespace.api#CreateContactRequest" + }, + "output": { + "target": "com.squarespace.api#CreateContactResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#Forbidden" + }, + { + "target": "com.squarespace.api#Conflict" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/v1/contacts", + "code": 200 + }, + "smithy.api#documentation": "Create contact\n\nCreates a new contact. Requires OAuth website scope website.contacts, or API key scope CONTACT, or OAuth website scope website.profiles (OAuth only)." + } + }, + "com.squarespace.api#AcceptsMarketingWithDate": { + "type": "structure", + "members": { + "acceptsMarketing": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "If contact's email accepts marketing" + } + }, + "joinedOn": { + "target": "com.squarespace.api#DateFilter" + } + }, + "traits": { + "smithy.api#documentation": "Contact's marketing settings with joined on date" + } + }, + "com.squarespace.api#DateFilter": { + "type": "structure", + "members": { + "after": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Filter out any dates after" + } + }, + "before": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Filter out any dates before" + } + } + }, + "traits": { + "smithy.api#documentation": "Object for filtering by before and after dates" + } + }, + "com.squarespace.api#IntegerFilter": { + "type": "structure", + "members": { + "max": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Filter out any numbers greater" + } + }, + "min": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Filter out any numbers lower" + } + } + }, + "traits": { + "smithy.api#documentation": "Object for filtering by a min and max integer" + } + }, + "com.squarespace.api#QueryContactsRequestSortDirection": { + "type": "enum", + "members": { + "ASCENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ASCENDING" + } + }, + "DESCENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DESCENDING" + } + } + }, + "traits": { + "smithy.api#documentation": "Direction to sort results, ASCENDING or DESCENDING" + } + }, + "com.squarespace.api#QueryContactsRequestSortField": { + "type": "enum", + "members": { + "ID": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ID" + } + }, + "CREATED_ON": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREATED_ON" + } + }, + "EMAIL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EMAIL" + } + }, + "ACCEPTS_MARKETING_JOINED_ON": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ACCEPTS_MARKETING_JOINED_ON" + } + }, + "FIRST_NAME": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FIRST_NAME" + } + }, + "LAST_NAME": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LAST_NAME" + } + }, + "ORDER_COUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ORDER_COUNT" + } + }, + "LAST_ORDER_ON": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LAST_ORDER_ON" + } + }, + "ORDER_AMOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ORDER_AMOUNT" + } + }, + "DONATION_COUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DONATION_COUNT" + } + }, + "LAST_DONATION_ON": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LAST_DONATION_ON" + } + }, + "DONATION_AMOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DONATION_AMOUNT" + } + } + }, + "traits": { + "smithy.api#documentation": "Field to sort results by" + } + }, + "com.squarespace.api#QueryContactsRequest": { + "type": "structure", + "members": { + "acceptsMarketingWithDate": { + "target": "com.squarespace.api#AcceptsMarketingWithDate" + }, + "cursor": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The cursor for the next page of results. Use the value of `pagination.nextPageCursor` from the previous response." + } + }, + "donationAmount": { + "target": "com.squarespace.api#IntegerFilter" + }, + "donationCount": { + "target": "com.squarespace.api#IntegerFilter" + }, + "firstDonationOn": { + "target": "com.squarespace.api#DateFilter" + }, + "firstOrderOn": { + "target": "com.squarespace.api#DateFilter" + }, + "lastDonationOn": { + "target": "com.squarespace.api#DateFilter" + }, + "lastOrderOn": { + "target": "com.squarespace.api#DateFilter" + }, + "orderAmount": { + "target": "com.squarespace.api#IntegerFilter" + }, + "orderCount": { + "target": "com.squarespace.api#IntegerFilter" + }, + "pageSize": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The number of contacts to return per request." + } + }, + "searchString": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Search string for Name and Email address" + } + }, + "sortDirection": { + "target": "com.squarespace.api#QueryContactsRequestSortDirection", + "traits": { + "smithy.api#documentation": "Direction to sort results, ASCENDING or DESCENDING" + } + }, + "sortField": { + "target": "com.squarespace.api#QueryContactsRequestSortField", + "traits": { + "smithy.api#documentation": "Field to sort results by" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#PaginatedQueryContactsResponse": { + "type": "structure", + "members": { + "contacts": { + "target": "com.squarespace.api#PaginatedQueryContactsResponseContactsList", + "traits": { + "smithy.api#documentation": "paginated list of contacts retrieved" + } + }, + "pagination": { + "target": "com.squarespace.api#PaginatedQueryContactsResponsePagination" + } + }, + "traits": {} + }, + "com.squarespace.api#PaginatedQueryContactsResponseContactsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#Contact" + }, + "traits": { + "smithy.api#documentation": "paginated list of contacts retrieved" + } + }, + "com.squarespace.api#PaginatedQueryContactsResponsePagination": { + "type": "structure", + "members": { + "hasNextPage": { + "target": "smithy.api#Boolean" + }, + "nextPageCursor": { + "target": "smithy.api#String" + }, + "nextPageUrl": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.squarespace.api#QueryContacts": { + "type": "operation", + "input": { + "target": "com.squarespace.api#QueryContactsRequest" + }, + "output": { + "target": "com.squarespace.api#PaginatedQueryContactsResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#Forbidden" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/v1/contacts/query", + "code": 200 + }, + "smithy.api#documentation": "Query contacts\n\nReturns a paginated list of contacts matching filters and sort options in the request body. Requires OAuth website scope website.contacts.read or website.contacts, or API key scope CONTACT_READONLY or CONTACT, or OAuth website scope website.profiles.read or website.profiles (OAuth only)." + } + }, + "com.squarespace.api#GetContactRequest": { + "type": "structure", + "members": { + "contactId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The contact's ID." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#GetContactResponse": { + "type": "structure", + "members": { + "contact": { + "target": "com.squarespace.api#Contact" + } + }, + "traits": {} + }, + "com.squarespace.api#GetContact": { + "type": "operation", + "input": { + "target": "com.squarespace.api#GetContactRequest" + }, + "output": { + "target": "com.squarespace.api#GetContactResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#Forbidden" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/v1/contacts/{contactId}", + "code": 200 + }, + "smithy.api#documentation": "Get contact\n\nReturns the contact for the given contact ID. Requires OAuth website scope website.contacts.read or website.contacts, or API key scope CONTACT_READONLY or CONTACT, or OAuth website scope website.profiles.read or website.profiles (OAuth only)." + } + }, + "com.squarespace.api#UpdateContactRequest": { + "type": "structure", + "members": { + "contactId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The contact's ID." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#PatchContactResponse": { + "type": "structure", + "members": { + "contact": { + "target": "com.squarespace.api#Contact" + } + }, + "traits": {} + }, + "com.squarespace.api#UpdateContact": { + "type": "operation", + "input": { + "target": "com.squarespace.api#UpdateContactRequest" + }, + "output": { + "target": "com.squarespace.api#PatchContactResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#Forbidden" + }, + { + "target": "com.squarespace.api#NotFound" + }, + { + "target": "com.squarespace.api#Conflict" + } + ], + "traits": { + "smithy.api#http": { + "method": "PATCH", + "uri": "/v1/contacts/{contactId}", + "code": 200 + }, + "smithy.api#documentation": "Update contact\n\nUpdates a contact using JSON merge patch. Requires OAuth website scope website.contacts, or API key scope CONTACT, or OAuth website scope website.profiles (OAuth only)." + } + }, + "com.squarespace.api#DeleteContactRequest": { + "type": "structure", + "members": { + "contactId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The contact's ID." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#DeleteContact": { + "type": "operation", + "input": { + "target": "com.squarespace.api#DeleteContactRequest" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.squarespace.api#Forbidden" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "DELETE", + "uri": "/v1/contacts/{contactId}", + "code": 200 + }, + "smithy.api#documentation": "Delete contact\n\nDeletes the contact for the given contact ID. Requires OAuth website scope website.contacts, or API key scope CONTACT, or OAuth website scope website.profiles (OAuth only)." + } + }, + "com.squarespace.api#GetAddressBookRequest": { + "type": "structure", + "members": { + "contactId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The contact's ID." + } + }, + "pageSize": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpQuery": "pageSize", + "smithy.api#documentation": "number of contacts to retrieve per request" + } + }, + "cursor": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "cursor", + "smithy.api#documentation": "where next page of results begins. should be {pagination.nextPageCursor} from previous response." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#GetAddressBookResponse": { + "type": "structure", + "members": { + "addressBook": { + "target": "com.squarespace.api#AddressBook" + }, + "pagination": { + "target": "com.squarespace.api#PaginationDetails" + } + }, + "traits": {} + }, + "com.squarespace.api#AddressBook": { + "type": "structure", + "members": { + "addressBookEntries": { + "target": "com.squarespace.api#AddressBookAddressBookEntriesList", + "traits": { + "smithy.api#documentation": "List of Address Book Entries" + } + }, + "defaultShippingAddressId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The id of the address book entry that is the default shipping address." + } + } + }, + "traits": { + "smithy.api#documentation": "Address settings for a contact. When there is at least one address book entry, exactly one is the default shipping address; default shipping address is always returned on the first page of paginated results)." + } + }, + "com.squarespace.api#AddressBookAddressBookEntriesList": { + "type": "list", + "member": { + "target": "com.squarespace.api#AddressBookEntry" + }, + "traits": { + "smithy.api#documentation": "List of Address Book Entries" + } + }, + "com.squarespace.api#PaginationDetails": { + "type": "structure", + "members": { + "hasNextPage": { + "target": "smithy.api#Boolean" + }, + "nextPageCursor": { + "target": "smithy.api#String" + }, + "nextPageUrl": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.squarespace.api#GetAddressBook": { + "type": "operation", + "input": { + "target": "com.squarespace.api#GetAddressBookRequest" + }, + "output": { + "target": "com.squarespace.api#GetAddressBookResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#Forbidden" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/v1/contacts/{contactId}/address-book", + "code": 200 + }, + "smithy.api#documentation": "Get address book\n\nReturns paginated addresses for the contact. When there is at least one entry, exactly one is the default shipping address (defaultShippingAddressId and each entry's defaultShipping reflect this). The default shipping address (when present) is always included on the first page of results. Requires OAuth website scope website.contacts.read or website.contacts, or API key scope CONTACT_READONLY or CONTACT, or OAuth website scope website.profiles.read or website.profiles (OAuth only)." + } + }, + "com.squarespace.api#CreateAddressBookEntryRequest": { + "type": "structure", + "members": { + "contactId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The contact's ID." + } + }, + "address": { + "target": "com.squarespace.api#ContactAddress", + "traits": { + "smithy.api#required": {} + } + }, + "defaultShipping": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Whether this entry should be the default shipping address. If this is the only address book entry for the contact after creation, it becomes the default even when set to false." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#CreateAddressBookEntryResponse": { + "type": "structure", + "members": { + "addressBookEntry": { + "target": "com.squarespace.api#AddressBookEntry" + } + }, + "traits": {} + }, + "com.squarespace.api#CreateAddressBookEntry": { + "type": "operation", + "input": { + "target": "com.squarespace.api#CreateAddressBookEntryRequest" + }, + "output": { + "target": "com.squarespace.api#CreateAddressBookEntryResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#Forbidden" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/v1/contacts/{contactId}/address-book", + "code": 200 + }, + "smithy.api#documentation": "Create address book entry\n\nCreates a new address book entry for the contact. If this is the contact's only address book entry after creation, it becomes the default shipping address even when defaultShipping is false. Requires OAuth website scope website.contacts, or API key scope CONTACT, or OAuth website scope website.profiles (OAuth only)." + } + }, + "com.squarespace.api#GetAddressBookEntryRequest": { + "type": "structure", + "members": { + "contactId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The contact's ID." + } + }, + "addressBookEntryId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The address book entry's ID." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#GetAddressBookEntryResponse": { + "type": "structure", + "members": { + "addressBookEntry": { + "target": "com.squarespace.api#AddressBookEntry" + } + }, + "traits": {} + }, + "com.squarespace.api#GetAddressBookEntry": { + "type": "operation", + "input": { + "target": "com.squarespace.api#GetAddressBookEntryRequest" + }, + "output": { + "target": "com.squarespace.api#GetAddressBookEntryResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#Forbidden" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/v1/contacts/{contactId}/address-book/{addressBookEntryId}", + "code": 200 + }, + "smithy.api#documentation": "Get address book entry\n\nReturns a single address book entry for the contact. Requires OAuth website scope website.contacts.read or website.contacts, or API key scope CONTACT_READONLY or CONTACT, or OAuth website scope website.profiles.read or website.profiles (OAuth only)." + } + }, + "com.squarespace.api#UpdateAddressBookEntryRequest": { + "type": "structure", + "members": { + "contactId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The contact's ID." + } + }, + "addressBookEntryId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The address book entry's ID." + } + }, + "address": { + "target": "com.squarespace.api#ContactAddress", + "traits": { + "smithy.api#required": {} + } + }, + "defaultShipping": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Whether this entry should be the default shipping address. When updating the entry that is currently the default, changing this value from true to false has no effect." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#UpdateAddressBookEntryResponse": { + "type": "structure", + "members": { + "addressBookEntry": { + "target": "com.squarespace.api#AddressBookEntry" + } + }, + "traits": {} + }, + "com.squarespace.api#UpdateAddressBookEntry": { + "type": "operation", + "input": { + "target": "com.squarespace.api#UpdateAddressBookEntryRequest" + }, + "output": { + "target": "com.squarespace.api#UpdateAddressBookEntryResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#Forbidden" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "PUT", + "uri": "/v1/contacts/{contactId}/address-book/{addressBookEntryId}", + "code": 200 + }, + "smithy.api#documentation": "Replace address book entry\n\nReplaces an address book entry for the contact with a full JSON body. When updating the entry that is currently the default, setting \"defaultShipping\" from true to false has no effect. Requires OAuth website scope website.contacts, or API key scope CONTACT, or OAuth website scope website.profiles (OAuth only)." + } + }, + "com.squarespace.api#DeleteAddressBookEntryRequest": { + "type": "structure", + "members": { + "contactId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The contact's ID." + } + }, + "addressBookEntryId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The address book entry's ID." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#DeleteAddressBookEntry": { + "type": "operation", + "input": { + "target": "com.squarespace.api#DeleteAddressBookEntryRequest" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.squarespace.api#Forbidden" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "DELETE", + "uri": "/v1/contacts/{contactId}/address-book/{addressBookEntryId}", + "code": 200 + }, + "smithy.api#documentation": "Delete address book entry\n\nDeletes the address book entry for the contact. If the deleted entry was the default shipping address, another entry is assigned as the default. Requires OAuth website scope website.contacts, or API key scope CONTACT, or OAuth website scope website.profiles (OAuth only)." + } + }, + "com.squarespace.api#FulfillmentOptionsList": { + "type": "structure", + "members": { + "fulfillmentOptions": { + "target": "com.squarespace.api#FulfillmentOptionsListFulfillmentOptionsList", + "traits": { + "smithy.api#documentation": "Fulfillment option IDs and carrier services for this website.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "List of fulfillment option IDs and carrier services." + } + }, + "com.squarespace.api#FulfillmentOption": { + "type": "structure", + "members": { + "availableServices": { + "target": "com.squarespace.api#FulfillmentOptionAvailableServicesList", + "traits": { + "smithy.api#documentation": "Available carrier services.", + "smithy.api#required": {} + } + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Fulfillment option id.", + "smithy.api#required": {} + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Display name for the option.", + "smithy.api#required": {} + } + }, + "type": { + "target": "com.squarespace.api#FulfillmentOptionType", + "traits": { + "smithy.api#documentation": "Fulfillment channel for this option.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Fulfillment option IDs and carrier services for a website." + } + }, + "com.squarespace.api#CarrierService": { + "type": "structure", + "members": { + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Human-readable carrier service name.", + "smithy.api#required": {} + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Carrier service identifier.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Carrier service identifier and display name." + } + }, + "com.squarespace.api#FulfillmentOptionAvailableServicesList": { + "type": "list", + "member": { + "target": "com.squarespace.api#CarrierService" + }, + "traits": { + "smithy.api#documentation": "Available carrier services." + } + }, + "com.squarespace.api#FulfillmentOptionType": { + "type": "enum", + "members": { + "SHIPPING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SHIPPING" + } + }, + "PICKUP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PICKUP" + } + }, + "LOCAL_DELIVERY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LOCAL_DELIVERY" + } + } + }, + "traits": { + "smithy.api#documentation": "Fulfillment channel for this option." + } + }, + "com.squarespace.api#FulfillmentOptionsListFulfillmentOptionsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#FulfillmentOption" + }, + "traits": { + "smithy.api#documentation": "Fulfillment option IDs and carrier services for this website." + } + }, + "com.squarespace.api#GetFulfillmentOptions": { + "type": "operation", + "input": { + "target": "smithy.api#Unit" + }, + "output": { + "target": "com.squarespace.api#FulfillmentOptionsList" + }, + "errors": [ + { + "target": "com.squarespace.api#Forbidden" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/v1/fulfillments/fulfillment-options", + "code": 200 + }, + "smithy.api#documentation": "Get fulfillment options\n\nReturns a list of fulfillment option IDs and carrier services that can be used with discounts. Requires OAuth website scope website.discounts.read or website.discounts, or API key scope DISCOUNTS_READONLY or DISCOUNTS." + } + }, + "com.squarespace.api#GetProductsRequestTypeList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#GetProductsRequest": { + "type": "structure", + "members": { + "modifiedAfter": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "modifiedAfter" + } + }, + "modifiedBefore": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "modifiedBefore" + } + }, + "cursor": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "cursor" + } + }, + "query": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "query" + } + }, + "type": { + "target": "com.squarespace.api#GetProductsRequestTypeList", + "traits": { + "smithy.api#httpQuery": "type" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#PaginatedProductListResponseV2": { + "type": "structure", + "members": { + "pagination": { + "target": "com.squarespace.api#PaginatedProductListResponseV2Pagination" + }, + "products": { + "target": "com.squarespace.api#PaginatedProductListResponseV2ProductsList" + } + }, + "traits": {} + }, + "com.squarespace.api#PaginatedProductListResponseV2Pagination": { + "type": "structure", + "members": { + "hasNextPage": { + "target": "smithy.api#Boolean" + }, + "nextPageCursor": { + "target": "smithy.api#String" + }, + "nextPageUrl": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.squarespace.api#DigitalProduct": { + "type": "structure", + "members": { + "createdOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "smithy.api#String" + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "images": { + "target": "com.squarespace.api#DigitalProductImagesList" + }, + "isVisible": { + "target": "smithy.api#Boolean" + }, + "modifiedOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "name": { + "target": "smithy.api#String" + }, + "seoOptions": { + "target": "com.squarespace.api#SeoOptions" + }, + "storePageId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.squarespace.api#DigitalProductTagsList" + }, + "type": { + "target": "com.squarespace.api#ProductTypeV2", + "traits": { + "smithy.api#required": {} + } + }, + "url": { + "target": "smithy.api#String" + }, + "urlSlug": { + "target": "smithy.api#String" + }, + "digitalGood": { + "target": "com.squarespace.api#DigitalGood" + }, + "pricing": { + "target": "com.squarespace.api#ProductPricing" + } + }, + "traits": { + "smithy.api#documentation": "A DIGITAL product." + } + }, + "com.squarespace.api#ProductImage": { + "type": "structure", + "members": { + "altText": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Alt text for the image; impacts SEO and appears in search results." + } + }, + "availableFormats": { + "target": "com.squarespace.api#ProductImageAvailableFormatsList", + "traits": { + "smithy.api#documentation": "Available image sizes. Use with `images.url` and a `format` query parameter to retrieve the image at a particular width." + } + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique ProductImage id." + } + }, + "orderIndex": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Position of the image in the product's image list." + } + }, + "originalSize": { + "target": "smithy.api#Document", + "traits": { + "smithy.api#documentation": "Image size when first uploaded." + } + }, + "url": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Absolute URL of the image hosted on Squarespace." + } + } + }, + "traits": { + "smithy.api#documentation": "Product image assigned to the variant." + } + }, + "com.squarespace.api#ProductImageAvailableFormatsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Available image sizes. Use with `images.url` and a `format` query parameter to retrieve the image at a particular width." + } + }, + "com.squarespace.api#DigitalProductImagesList": { + "type": "list", + "member": { + "target": "com.squarespace.api#ProductImage" + }, + "traits": {} + }, + "com.squarespace.api#SeoOptions": { + "type": "structure", + "members": { + "description": { + "target": "smithy.api#String" + }, + "title": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "Options for search engine optimization." + } + }, + "com.squarespace.api#DigitalProductTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#ProductTypeV2": { + "type": "enum", + "members": { + "PHYSICAL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PHYSICAL" + } + }, + "SERVICE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SERVICE" + } + }, + "GIFT_CARD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GIFT_CARD" + } + }, + "DIGITAL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DIGITAL" + } + } + }, + "traits": {} + }, + "com.squarespace.api#DigitalGood": { + "type": "structure", + "members": { + "filename": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Filename of the downloadable file." + } + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique DigitalGood id." + } + } + }, + "traits": { + "smithy.api#documentation": "Present for DIGITAL products only." + } + }, + "com.squarespace.api#ProductPricing": { + "type": "structure", + "members": { + "basePrice": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "onSale": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Indicates whether the variant is sold according to its sale price. Present for PHYSICAL products only." + } + }, + "salePrice": { + "target": "com.squarespace.api#MonetaryAmount" + } + }, + "traits": { + "smithy.api#documentation": "Present for DIGITAL products only. Digital products don't have variants, so pricing is at the product level." + } + }, + "com.squarespace.api#GiftCardProduct": { + "type": "structure", + "members": { + "createdOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "smithy.api#String" + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "images": { + "target": "com.squarespace.api#GiftCardProductImagesList" + }, + "isVisible": { + "target": "smithy.api#Boolean" + }, + "modifiedOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "name": { + "target": "smithy.api#String" + }, + "seoOptions": { + "target": "com.squarespace.api#SeoOptions" + }, + "storePageId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.squarespace.api#GiftCardProductTagsList" + }, + "type": { + "target": "com.squarespace.api#ProductTypeV2", + "traits": { + "smithy.api#required": {} + } + }, + "url": { + "target": "smithy.api#String" + }, + "urlSlug": { + "target": "smithy.api#String" + }, + "variants": { + "target": "com.squarespace.api#GiftCardProductVariantsList" + } + }, + "traits": { + "smithy.api#documentation": "A GIFT_CARD product." + } + }, + "com.squarespace.api#GiftCardProductImagesList": { + "type": "list", + "member": { + "target": "com.squarespace.api#ProductImage" + }, + "traits": {} + }, + "com.squarespace.api#GiftCardProductTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#GiftCardProductVariant": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + }, + "image": { + "target": "com.squarespace.api#ProductImage" + }, + "pricing": { + "target": "com.squarespace.api#SimpleProductPricing" + }, + "sku": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "A variant of a GIFT_CARD product." + } + }, + "com.squarespace.api#SimpleProductPricing": { + "type": "structure", + "members": { + "basePrice": { + "target": "com.squarespace.api#MonetaryAmount" + } + }, + "traits": {} + }, + "com.squarespace.api#GiftCardProductVariantsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#GiftCardProductVariant" + }, + "traits": {} + }, + "com.squarespace.api#PhysicalProduct": { + "type": "structure", + "members": { + "createdOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "smithy.api#String" + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "images": { + "target": "com.squarespace.api#PhysicalProductImagesList" + }, + "isVisible": { + "target": "smithy.api#Boolean" + }, + "modifiedOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "name": { + "target": "smithy.api#String" + }, + "seoOptions": { + "target": "com.squarespace.api#SeoOptions" + }, + "storePageId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.squarespace.api#PhysicalProductTagsList" + }, + "type": { + "target": "com.squarespace.api#ProductTypeV2", + "traits": { + "smithy.api#required": {} + } + }, + "url": { + "target": "smithy.api#String" + }, + "urlSlug": { + "target": "smithy.api#String" + }, + "variantAttributes": { + "target": "com.squarespace.api#PhysicalProductVariantAttributesList" + }, + "variants": { + "target": "com.squarespace.api#PhysicalProductVariantsList" + } + }, + "traits": { + "smithy.api#documentation": "A PHYSICAL product." + } + }, + "com.squarespace.api#PhysicalProductImagesList": { + "type": "list", + "member": { + "target": "com.squarespace.api#ProductImage" + }, + "traits": {} + }, + "com.squarespace.api#PhysicalProductTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#PhysicalProductVariantAttributesList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#PhysicalProductVariant": { + "type": "structure", + "members": { + "attributes": { + "target": "com.squarespace.api#PhysicalProductVariantAttributesMap" + }, + "gtin": { + "target": "smithy.api#String" + }, + "id": { + "target": "smithy.api#String" + }, + "image": { + "target": "com.squarespace.api#ProductImage" + }, + "mpn": { + "target": "smithy.api#String" + }, + "pricing": { + "target": "com.squarespace.api#FullProductPricing" + }, + "shippingMeasurements": { + "target": "com.squarespace.api#ProductMeasurements" + }, + "sku": { + "target": "smithy.api#String" + }, + "stock": { + "target": "com.squarespace.api#ProductStock" + } + }, + "traits": { + "smithy.api#documentation": "A variant of a PHYSICAL product." + } + }, + "com.squarespace.api#PhysicalProductVariantAttributesMap": { + "type": "map", + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#FullProductPricing": { + "type": "structure", + "members": { + "basePrice": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "onSale": { + "target": "smithy.api#Boolean" + }, + "salePrice": { + "target": "com.squarespace.api#MonetaryAmount" + } + }, + "traits": {} + }, + "com.squarespace.api#ProductMeasurements": { + "type": "structure", + "members": { + "dimensions": { + "target": "com.squarespace.api#ProductDimensions" + }, + "weight": { + "target": "com.squarespace.api#ProductWeight" + } + }, + "traits": { + "smithy.api#documentation": "Measurements of the variant when it's shipped. Present for PHYSICAL products only." + } + }, + "com.squarespace.api#ProductDimensions": { + "type": "structure", + "members": { + "height": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Height of the variant." + } + }, + "length": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Length of the variant." + } + }, + "unit": { + "target": "com.squarespace.api#ProductDimensionsUnit" + }, + "width": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Width of the variant." + } + } + }, + "traits": { + "smithy.api#documentation": "Physical dimensions of the variant." + } + }, + "com.squarespace.api#ProductDimensionsUnit": { + "type": "enum", + "members": { + "CENTIMETER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CENTIMETER" + } + }, + "INCH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INCH" + } + } + }, + "traits": { + "smithy.api#documentation": "Unit of measurement. Supported values: `INCH`, `CENTIMETER`." + } + }, + "com.squarespace.api#ProductWeight": { + "type": "structure", + "members": { + "unit": { + "target": "com.squarespace.api#ProductWeightUnit" + }, + "value": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Weight amount." + } + } + }, + "traits": { + "smithy.api#documentation": "Weight of the variant." + } + }, + "com.squarespace.api#ProductWeightUnit": { + "type": "enum", + "members": { + "KILOGRAM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "KILOGRAM" + } + }, + "POUND": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "POUND" + } + } + }, + "traits": { + "smithy.api#documentation": "Unit of measurement. Supported values: `KILOGRAM`, `POUND`." + } + }, + "com.squarespace.api#ProductStock": { + "type": "structure", + "members": { + "quantity": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Number of units that can be purchased." + } + }, + "unlimited": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Indicates whether the variant has unlimited stock." + } + } + }, + "traits": { + "smithy.api#documentation": "Available stock for the variant. Present for PHYSICAL products only." + } + }, + "com.squarespace.api#PhysicalProductVariantsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#PhysicalProductVariant" + }, + "traits": {} + }, + "com.squarespace.api#ServiceProduct": { + "type": "structure", + "members": { + "createdOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "smithy.api#String" + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "images": { + "target": "com.squarespace.api#ServiceProductImagesList" + }, + "isVisible": { + "target": "smithy.api#Boolean" + }, + "modifiedOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "name": { + "target": "smithy.api#String" + }, + "seoOptions": { + "target": "com.squarespace.api#SeoOptions" + }, + "storePageId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.squarespace.api#ServiceProductTagsList" + }, + "type": { + "target": "com.squarespace.api#ProductTypeV2", + "traits": { + "smithy.api#required": {} + } + }, + "url": { + "target": "smithy.api#String" + }, + "urlSlug": { + "target": "smithy.api#String" + }, + "variantAttributes": { + "target": "com.squarespace.api#ServiceProductVariantAttributesList" + }, + "variants": { + "target": "com.squarespace.api#ServiceProductVariantsList" + } + }, + "traits": { + "smithy.api#documentation": "A SERVICE product." + } + }, + "com.squarespace.api#ServiceProductImagesList": { + "type": "list", + "member": { + "target": "com.squarespace.api#ProductImage" + }, + "traits": {} + }, + "com.squarespace.api#ServiceProductTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#ServiceProductVariantAttributesList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#ServiceProductVariant": { + "type": "structure", + "members": { + "attributes": { + "target": "com.squarespace.api#ServiceProductVariantAttributesMap" + }, + "id": { + "target": "smithy.api#String" + }, + "image": { + "target": "com.squarespace.api#ProductImage" + }, + "pricing": { + "target": "com.squarespace.api#FullProductPricing" + }, + "sku": { + "target": "smithy.api#String" + }, + "stock": { + "target": "com.squarespace.api#ProductStock" + } + }, + "traits": { + "smithy.api#documentation": "A variant of a SERVICE product." + } + }, + "com.squarespace.api#ServiceProductVariantAttributesMap": { + "type": "map", + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#ServiceProductVariantsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#ServiceProductVariant" + }, + "traits": {} + }, + "com.squarespace.api#PaginatedProductListResponseV2ProductsItem": { + "type": "union", + "members": { + "DigitalProduct": { + "target": "com.squarespace.api#DigitalProduct" + }, + "GiftCardProduct": { + "target": "com.squarespace.api#GiftCardProduct" + }, + "PhysicalProduct": { + "target": "com.squarespace.api#PhysicalProduct" + }, + "ServiceProduct": { + "target": "com.squarespace.api#ServiceProduct" + } + }, + "traits": {} + }, + "com.squarespace.api#PaginatedProductListResponseV2ProductsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#PaginatedProductListResponseV2ProductsItem" + }, + "traits": {} + }, + "com.squarespace.api#GetProducts": { + "type": "operation", + "input": { + "target": "com.squarespace.api#GetProductsRequest" + }, + "output": { + "target": "com.squarespace.api#PaginatedProductListResponseV2" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/v2/commerce/products", + "code": 200 + }, + "smithy.api#documentation": "List products\n\nRetrieves information for products; products can be filtered within a date range and by product type. The response contains product information in a Product, up to 50 Products ordered by their modification date (modifiedOn), and supports dynamic cursors for pagination." + } + }, + "com.squarespace.api#CreateGiftCardProductRequest": { + "type": "structure", + "members": { + "description": { + "target": "smithy.api#String" + }, + "isVisible": { + "target": "smithy.api#Boolean" + }, + "name": { + "target": "smithy.api#String" + }, + "storePageId": { + "target": "smithy.api#String" + }, + "tags": { + "target": "com.squarespace.api#CreateGiftCardProductRequestTagsList" + }, + "type": { + "target": "smithy.api#String" + }, + "urlSlug": { + "target": "smithy.api#String" + }, + "variants": { + "target": "com.squarespace.api#CreateGiftCardProductRequestVariantsList" + } + }, + "traits": { + "smithy.api#documentation": "Request payload to create a GIFT_CARD product." + } + }, + "com.squarespace.api#CreateGiftCardProductRequestTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#CreateGiftCardProductVariantRequest": { + "type": "structure", + "members": { + "pricing": { + "target": "com.squarespace.api#SimpleProductPricing" + }, + "sku": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.squarespace.api#CreateGiftCardProductRequestVariantsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#CreateGiftCardProductVariantRequest" + }, + "traits": {} + }, + "com.squarespace.api#CreatePhysicalProductRequest": { + "type": "structure", + "members": { + "description": { + "target": "smithy.api#String" + }, + "isVisible": { + "target": "smithy.api#Boolean" + }, + "name": { + "target": "smithy.api#String" + }, + "storePageId": { + "target": "smithy.api#String" + }, + "tags": { + "target": "com.squarespace.api#CreatePhysicalProductRequestTagsList" + }, + "type": { + "target": "smithy.api#String" + }, + "urlSlug": { + "target": "smithy.api#String" + }, + "variantAttributes": { + "target": "com.squarespace.api#CreatePhysicalProductRequestVariantAttributesList" + }, + "variants": { + "target": "com.squarespace.api#CreatePhysicalProductRequestVariantsList" + } + }, + "traits": { + "smithy.api#documentation": "Request payload to create a PHYSICAL product." + } + }, + "com.squarespace.api#CreatePhysicalProductRequestTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#CreatePhysicalProductRequestVariantAttributesList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#CreatePhysicalProductVariantRequest": { + "type": "structure", + "members": { + "attributes": { + "target": "com.squarespace.api#CreatePhysicalProductVariantRequestAttributesMap" + }, + "gtin": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Global Trade Item Number (GTIN). Optional. Must be 8, 12, 13, or 14 numeric digits. Whitespace, hyphens, and underscores are stripped before validation." + } + }, + "mpn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Manufacturer Part Number (MPN). Optional. Must be alphanumeric and 70 characters or fewer. Whitespace, hyphens, and underscores are stripped before validation." + } + }, + "pricing": { + "target": "com.squarespace.api#FullProductPricing" + }, + "shippingMeasurements": { + "target": "com.squarespace.api#ProductMeasurements" + }, + "sku": { + "target": "smithy.api#String" + }, + "stock": { + "target": "com.squarespace.api#ProductStock" + } + }, + "traits": {} + }, + "com.squarespace.api#CreatePhysicalProductVariantRequestAttributesMap": { + "type": "map", + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#CreatePhysicalProductRequestVariantsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#CreatePhysicalProductVariantRequest" + }, + "traits": {} + }, + "com.squarespace.api#CreateServiceProductRequest": { + "type": "structure", + "members": { + "description": { + "target": "smithy.api#String" + }, + "isVisible": { + "target": "smithy.api#Boolean" + }, + "name": { + "target": "smithy.api#String" + }, + "storePageId": { + "target": "smithy.api#String" + }, + "tags": { + "target": "com.squarespace.api#CreateServiceProductRequestTagsList" + }, + "type": { + "target": "smithy.api#String" + }, + "urlSlug": { + "target": "smithy.api#String" + }, + "variantAttributes": { + "target": "com.squarespace.api#CreateServiceProductRequestVariantAttributesList" + }, + "variants": { + "target": "com.squarespace.api#CreateServiceProductRequestVariantsList" + } + }, + "traits": { + "smithy.api#documentation": "Request payload to create a SERVICE product." + } + }, + "com.squarespace.api#CreateServiceProductRequestTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#CreateServiceProductRequestVariantAttributesList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#CreateServiceProductVariantRequest": { + "type": "structure", + "members": { + "attributes": { + "target": "com.squarespace.api#CreateServiceProductVariantRequestAttributesMap" + }, + "pricing": { + "target": "com.squarespace.api#FullProductPricing" + }, + "sku": { + "target": "smithy.api#String" + }, + "stock": { + "target": "com.squarespace.api#ProductStock" + } + }, + "traits": {} + }, + "com.squarespace.api#CreateServiceProductVariantRequestAttributesMap": { + "type": "map", + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#CreateServiceProductRequestVariantsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#CreateServiceProductVariantRequest" + }, + "traits": {} + }, + "com.squarespace.api#CreateProductRequestBody": { + "type": "union", + "members": { + "CreateGiftCardProductRequest": { + "target": "com.squarespace.api#CreateGiftCardProductRequest" + }, + "CreatePhysicalProductRequest": { + "target": "com.squarespace.api#CreatePhysicalProductRequest" + }, + "CreateServiceProductRequest": { + "target": "com.squarespace.api#CreateServiceProductRequest" + } + }, + "traits": {} + }, + "com.squarespace.api#CreateProductRequest": { + "type": "structure", + "members": { + "body": { + "target": "com.squarespace.api#CreateProductRequestBody", + "traits": { + "smithy.api#httpPayload": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#ProductV2": { + "type": "structure", + "members": { + "createdOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "smithy.api#String" + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "images": { + "target": "com.squarespace.api#ProductV2ImagesList" + }, + "isVisible": { + "target": "smithy.api#Boolean" + }, + "modifiedOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "name": { + "target": "smithy.api#String" + }, + "seoOptions": { + "target": "com.squarespace.api#SeoOptions" + }, + "storePageId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.squarespace.api#ProductV2TagsList" + }, + "type": { + "target": "com.squarespace.api#ProductTypeV2", + "traits": { + "smithy.api#required": {} + } + }, + "url": { + "target": "smithy.api#String" + }, + "urlSlug": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.squarespace.api#ProductV2ImagesList": { + "type": "list", + "member": { + "target": "com.squarespace.api#ProductImage" + }, + "traits": {} + }, + "com.squarespace.api#ProductV2TagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#CreateProduct": { + "type": "operation", + "input": { + "target": "com.squarespace.api#CreateProductRequest" + }, + "output": { + "target": "com.squarespace.api#ProductV2" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#Conflict" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/v2/commerce/products", + "code": 200 + }, + "smithy.api#documentation": "Create product\n\nCreates a product with appropriate subresources based on product type." + } + }, + "com.squarespace.api#GetSpecificProductsRequest": { + "type": "structure", + "members": { + "productIdCsvs": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#ProductListResponseV2": { + "type": "structure", + "members": { + "products": { + "target": "com.squarespace.api#ProductListResponseV2ProductsList" + } + }, + "traits": {} + }, + "com.squarespace.api#ProductListResponseV2ProductsItem": { + "type": "union", + "members": { + "DigitalProduct": { + "target": "com.squarespace.api#DigitalProduct" + }, + "GiftCardProduct": { + "target": "com.squarespace.api#GiftCardProduct" + }, + "PhysicalProduct": { + "target": "com.squarespace.api#PhysicalProduct" + }, + "ServiceProduct": { + "target": "com.squarespace.api#ServiceProduct" + } + }, + "traits": {} + }, + "com.squarespace.api#ProductListResponseV2ProductsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#ProductListResponseV2ProductsItem" + }, + "traits": {} + }, + "com.squarespace.api#GetSpecificProducts": { + "type": "operation", + "input": { + "target": "com.squarespace.api#GetSpecificProductsRequest" + }, + "output": { + "target": "com.squarespace.api#ProductListResponseV2" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/v2/commerce/products/{productIdCsvs}", + "code": 200 + }, + "smithy.api#documentation": "Get products\n\nRetrieves information for specific products, including information for any variants or images. Up to 50 products can be retrieved per request." + } + }, + "com.squarespace.api#ChangeString": { + "type": "structure", + "members": { + "present": { + "target": "smithy.api#Boolean" + }, + "value": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "Optional; HTTPS URL to receive webhook notifications." + } + }, + "com.squarespace.api#ChangeBoolean": { + "type": "structure", + "members": { + "present": { + "target": "smithy.api#Boolean" + }, + "value": { + "target": "smithy.api#Boolean" + } + }, + "traits": {} + }, + "com.squarespace.api#ChangeUpdateProductPricing": { + "type": "structure", + "members": { + "present": { + "target": "smithy.api#Boolean" + }, + "value": { + "target": "com.squarespace.api#UpdateProductPricing" + } + }, + "traits": { + "smithy.api#documentation": "Pricing data for the product." + } + }, + "com.squarespace.api#UpdateProductPricing": { + "type": "structure", + "members": { + "basePrice": { + "target": "com.squarespace.api#ChangeMonetaryAmount" + }, + "onSale": { + "target": "com.squarespace.api#ChangeBoolean" + }, + "salePrice": { + "target": "com.squarespace.api#ChangeMonetaryAmount" + } + }, + "traits": {} + }, + "com.squarespace.api#ChangeMonetaryAmount": { + "type": "structure", + "members": { + "present": { + "target": "smithy.api#Boolean" + }, + "value": { + "target": "com.squarespace.api#MonetaryAmount" + } + }, + "traits": {} + }, + "com.squarespace.api#ChangeListString": { + "type": "structure", + "members": { + "present": { + "target": "smithy.api#Boolean" + }, + "value": { + "target": "com.squarespace.api#ChangeListStringValueList" + } + }, + "traits": { + "smithy.api#documentation": "Optional; list of event topics that trigger a webhook notification. Possible values include: extension.uninstall, order.create, order.update." + } + }, + "com.squarespace.api#ChangeListStringValueList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#ChangeSeoOptions": { + "type": "structure", + "members": { + "present": { + "target": "smithy.api#Boolean" + }, + "value": { + "target": "com.squarespace.api#SeoOptions" + } + }, + "traits": { + "smithy.api#documentation": "Options for search engine optimization." + } + }, + "com.squarespace.api#UpdateProductRequest": { + "type": "structure", + "members": { + "productId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "description": { + "target": "com.squarespace.api#ChangeString" + }, + "isVisible": { + "target": "com.squarespace.api#ChangeBoolean" + }, + "name": { + "target": "com.squarespace.api#ChangeString" + }, + "pricing": { + "target": "com.squarespace.api#ChangeUpdateProductPricing" + }, + "productAttributeNames": { + "target": "com.squarespace.api#ChangeListString" + }, + "seoData": { + "target": "com.squarespace.api#ChangeSeoOptions" + }, + "tags": { + "target": "com.squarespace.api#ChangeListString" + }, + "urlSlug": { + "target": "com.squarespace.api#ChangeString" + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#UpdateProduct": { + "type": "operation", + "input": { + "target": "com.squarespace.api#UpdateProductRequest" + }, + "output": { + "target": "com.squarespace.api#ProductV2" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#NotFound" + }, + { + "target": "com.squarespace.api#Conflict" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/v2/commerce/products/{productId}", + "code": 200 + }, + "smithy.api#documentation": "Update product\n\nUpdates information for a product. The endpoint supports partial updates." + } + }, + "com.squarespace.api#DeleteProductRequest": { + "type": "structure", + "members": { + "productId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#DeleteProduct": { + "type": "operation", + "input": { + "target": "com.squarespace.api#DeleteProductRequest" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "DELETE", + "uri": "/v2/commerce/products/{productId}", + "code": 200 + }, + "smithy.api#documentation": "Delete specified product\n\nDelete specified product" + } + }, + "com.squarespace.api#UploadProductImageRequest": { + "type": "structure", + "members": { + "productId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#UploadProductImage": { + "type": "operation", + "input": { + "target": "com.squarespace.api#UploadProductImageRequest" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#NotFound" + }, + { + "target": "com.squarespace.api#Conflict" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/v2/commerce/products/{productId}/images", + "code": 200, + "contentType": "multipart" + }, + "smithy.api#documentation": "Upload product image\n\nUploads an image for a product. Uploading an image doesn't set the product's featured image. A successful request creates a ProductImage subresource of the Product.", + "com.distilled.openapi#contentType": "multipart" + } + }, + "com.squarespace.api#UpdateProductImageRequest": { + "type": "structure", + "members": { + "productId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "imageId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "altText": { + "target": "com.squarespace.api#ChangeString" + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#UpdateProductImage": { + "type": "operation", + "input": { + "target": "com.squarespace.api#UpdateProductImageRequest" + }, + "output": { + "target": "com.squarespace.api#ProductImage" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/v2/commerce/products/{productId}/images/{imageId}", + "code": 200 + }, + "smithy.api#documentation": "Update product image\n\nUpdates information for a product image. Currently, the endpoint only supports updates to the alt text for an image." + } + }, + "com.squarespace.api#DeleteProductImageRequest": { + "type": "structure", + "members": { + "productId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "imageId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#DeleteProductImage": { + "type": "operation", + "input": { + "target": "com.squarespace.api#DeleteProductImageRequest" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "DELETE", + "uri": "/v2/commerce/products/{productId}/images/{imageId}", + "code": 200 + }, + "smithy.api#documentation": "Delete one product image\n\nDelete one product image" + } + }, + "com.squarespace.api#UpdateProductImageOrderRequest": { + "type": "structure", + "members": { + "productId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "imageId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "afterImageId": { + "target": "com.squarespace.api#ChangeString" + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#UpdateProductImageOrder": { + "type": "operation", + "input": { + "target": "com.squarespace.api#UpdateProductImageOrderRequest" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/v2/commerce/products/{productId}/images/{imageId}/order", + "code": 200 + }, + "smithy.api#documentation": "Update product image order\n\nUpdates the ordering of a product image on the product details page." + } + }, + "com.squarespace.api#GetProductImageProcessingStatusRequest": { + "type": "structure", + "members": { + "productId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "imageId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#ProductImageProcessingStatus": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + }, + "status": { + "target": "com.squarespace.api#ImageProcessingStatus" + } + }, + "traits": {} + }, + "com.squarespace.api#ImageProcessingStatus": { + "type": "enum", + "members": { + "QUEUED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "QUEUED" + } + }, + "PROCESSING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PROCESSING" + } + }, + "READY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "READY" + } + }, + "ERROR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ERROR" + } + } + }, + "traits": {} + }, + "com.squarespace.api#GetProductImageProcessingStatus": { + "type": "operation", + "input": { + "target": "com.squarespace.api#GetProductImageProcessingStatusRequest" + }, + "output": { + "target": "com.squarespace.api#ProductImageProcessingStatus" + }, + "errors": [ + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/v2/commerce/products/{productId}/images/{imageId}/status", + "code": 200 + }, + "smithy.api#documentation": "Get image processing status\n\nRetrieves the processing status for an uploaded product image. A successful request indicates that a ProductImage is processing, ready, or in an error state." + } + }, + "com.squarespace.api#CreateProductVariantRequestAttributesMap": { + "type": "map", + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Specifies attribute-value pairs for the variant. 100 char limit per key and per value with no more than six key-value pairs. Supported for PHYSICAL products only." + } + }, + "com.squarespace.api#CreateProductVariantRequest": { + "type": "structure", + "members": { + "productId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "attributes": { + "target": "com.squarespace.api#CreateProductVariantRequestAttributesMap", + "traits": { + "smithy.api#documentation": "Specifies attribute-value pairs for the variant. 100 char limit per key and per value with no more than six key-value pairs. Supported for PHYSICAL products only." + } + }, + "gtin": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Global Trade Item Number (GTIN). Optional. Must be 8, 12, 13, or 14 numeric digits. Whitespace, hyphens, and underscores are stripped before validation. Supported for PHYSICAL products only." + } + }, + "mpn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Manufacturer Part Number (MPN). Optional. Must be alphanumeric and 70 characters or fewer. Whitespace, hyphens, and underscores are stripped before validation. Supported for PHYSICAL products only." + } + }, + "pricing": { + "target": "com.squarespace.api#ProductPricing", + "traits": { + "smithy.api#required": {} + } + }, + "shippingMeasurements": { + "target": "com.squarespace.api#ProductMeasurements" + }, + "sku": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Merchant-defined code that identifies the product variant. Value must be unique among variants. Leading and trailing whitespace is removed.", + "smithy.api#required": {} + } + }, + "stock": { + "target": "com.squarespace.api#ProductStock" + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#ProductVariantV2": { + "type": "union", + "members": { + "PhysicalProductVariant": { + "target": "com.squarespace.api#PhysicalProductVariant" + }, + "GiftCardProductVariant": { + "target": "com.squarespace.api#GiftCardProductVariant" + }, + "ServiceProductVariant": { + "target": "com.squarespace.api#ServiceProductVariant" + } + }, + "traits": { + "smithy.api#documentation": "A product variant. The shape depends on the product type." + } + }, + "com.squarespace.api#CreateProductVariant": { + "type": "operation", + "input": { + "target": "com.squarespace.api#CreateProductVariantRequest" + }, + "output": { + "target": "com.squarespace.api#ProductVariantV2" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#NotFound" + }, + { + "target": "com.squarespace.api#Conflict" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/v2/commerce/products/{productId}/variants", + "code": 200 + }, + "smithy.api#documentation": "Create product variant\n\nCreates a variant of a product. Creating a variant for a physical or service product requires that the product already has at least one attribute." + } + }, + "com.squarespace.api#ChangeMapStringString": { + "type": "structure", + "members": { + "present": { + "target": "smithy.api#Boolean" + }, + "value": { + "target": "com.squarespace.api#ChangeMapStringStringValueMap" + } + }, + "traits": { + "smithy.api#documentation": "Specifies attribute-value pairs for the variant. Supported for PHYSICAL products only." + } + }, + "com.squarespace.api#ChangeMapStringStringValueMap": { + "type": "map", + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.squarespace.api#ChangeUpdateProductMeasurements": { + "type": "structure", + "members": { + "present": { + "target": "smithy.api#Boolean" + }, + "value": { + "target": "com.squarespace.api#UpdateProductMeasurements" + } + }, + "traits": { + "smithy.api#documentation": "Measurements of the variant when it's shipped. Supported for PHYSICAL products only." + } + }, + "com.squarespace.api#UpdateProductMeasurements": { + "type": "structure", + "members": { + "dimensions": { + "target": "com.squarespace.api#ChangeProductDimensions" + }, + "weight": { + "target": "com.squarespace.api#ChangeProductWeight" + } + }, + "traits": {} + }, + "com.squarespace.api#ChangeProductDimensions": { + "type": "structure", + "members": { + "present": { + "target": "smithy.api#Boolean" + }, + "value": { + "target": "com.squarespace.api#ProductDimensions" + } + }, + "traits": {} + }, + "com.squarespace.api#ChangeProductWeight": { + "type": "structure", + "members": { + "present": { + "target": "smithy.api#Boolean" + }, + "value": { + "target": "com.squarespace.api#ProductWeight" + } + }, + "traits": {} + }, + "com.squarespace.api#UpdateProductVariantRequest": { + "type": "structure", + "members": { + "productId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "variantId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "attributes": { + "target": "com.squarespace.api#ChangeMapStringString" + }, + "gtin": { + "target": "com.squarespace.api#ChangeString" + }, + "mpn": { + "target": "com.squarespace.api#ChangeString" + }, + "pricing": { + "target": "com.squarespace.api#ChangeUpdateProductPricing" + }, + "shippingMeasurements": { + "target": "com.squarespace.api#ChangeUpdateProductMeasurements" + }, + "sku": { + "target": "com.squarespace.api#ChangeString" + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#UpdateProductVariant": { + "type": "operation", + "input": { + "target": "com.squarespace.api#UpdateProductVariantRequest" + }, + "output": { + "target": "com.squarespace.api#ProductVariantV2" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#NotFound" + }, + { + "target": "com.squarespace.api#Conflict" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/v2/commerce/products/{productId}/variants/{variantId}", + "code": 200 + }, + "smithy.api#documentation": "Update product variant\n\nUpdates a variant of a product. The endpoint supports partial updates." + } + }, + "com.squarespace.api#DeleteProductVariantRequest": { + "type": "structure", + "members": { + "productId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "variantId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#DeleteProductVariant": { + "type": "operation", + "input": { + "target": "com.squarespace.api#DeleteProductVariantRequest" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.squarespace.api#NotFound" + }, + { + "target": "com.squarespace.api#Conflict" + } + ], + "traits": { + "smithy.api#http": { + "method": "DELETE", + "uri": "/v2/commerce/products/{productId}/variants/{variantId}", + "code": 200 + }, + "smithy.api#documentation": "Delete one product variant\n\nDelete one product variant" + } + }, + "com.squarespace.api#AssociateProductVariantImageRequest": { + "type": "structure", + "members": { + "productId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "variantId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "imageId": { + "target": "com.squarespace.api#ChangeString", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#AssociateProductVariantImage": { + "type": "operation", + "input": { + "target": "com.squarespace.api#AssociateProductVariantImageRequest" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/v2/commerce/products/{productId}/variants/{variantId}/image", + "code": 200 + }, + "smithy.api#documentation": "Associate variant image\n\nAssigns a product image to a product variant. Specifying imageId of null will delete the association." + } + }, + "com.squarespace.api#MemberProfile": { + "type": "structure", + "members": { + "email": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Profile email address." + } + }, + "firstName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Profile first name." + } + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique Profile id." + } + }, + "lastName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Profile last name." + } + } + }, + "traits": {} + }, + "com.squarespace.api#GetMemberProfile": { + "type": "operation", + "input": { + "target": "smithy.api#Unit" + }, + "output": { + "target": "com.squarespace.api#MemberProfile" + }, + "errors": [ + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/1.0/authorization/member", + "code": 200 + }, + "smithy.api#documentation": "Retrieves basic details about the Squarespace member who owns the provided OAuth token\n\nRetrieves basic details about the Squarespace member who owns the provided OAuth token" + } + }, + "com.squarespace.api#WebsiteProfile": { + "type": "structure", + "members": { + "currency": { + "target": "smithy.api#String" + }, + "id": { + "target": "smithy.api#String" + }, + "language": { + "target": "smithy.api#String" + }, + "location": { + "target": "com.squarespace.api#Location" + }, + "measurementStandard": { + "target": "com.squarespace.api#MeasurementStandard" + }, + "siteId": { + "target": "smithy.api#String" + }, + "timeZone": { + "target": "smithy.api#String" + }, + "title": { + "target": "smithy.api#String" + }, + "url": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.squarespace.api#Location": { + "type": "structure", + "members": { + "country": { + "target": "smithy.api#String" + }, + "region": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.squarespace.api#MeasurementStandard": { + "type": "enum", + "members": { + "IMPERIAL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IMPERIAL" + } + }, + "METRIC": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "METRIC" + } + } + }, + "traits": {} + }, + "com.squarespace.api#GetWebsiteProfile": { + "type": "operation", + "input": { + "target": "smithy.api#Unit" + }, + "output": { + "target": "com.squarespace.api#WebsiteProfile" + }, + "errors": [ + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/1.0/authorization/website", + "code": 200 + }, + "smithy.api#documentation": "Retrieves basic details about the website that owns the provided API key or OAuth token\n\nRetrieves basic details about the website that owns the provided API key or OAuth token" + } + }, + "com.squarespace.api#GetInventoryItemsRequest": { + "type": "structure", + "members": { + "cursor": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "cursor", + "smithy.api#documentation": "Identifies where the next page of results should begin. Should be the value of pagination.nextPageCursor from a previous response. If not present or empty, the endpoint returns up to 50 InventoryItems." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#PaginatedInventoryItemListResponse": { + "type": "structure", + "members": { + "inventory": { + "target": "com.squarespace.api#PaginatedInventoryItemListResponseInventoryList", + "traits": { + "smithy.api#documentation": "Array of InventoryItem resources. If the merchant site doesn't have any physical or service product variants, this array is empty." + } + }, + "pagination": { + "target": "com.squarespace.api#PaginatedInventoryItemListResponsePagination" + } + }, + "traits": {} + }, + "com.squarespace.api#InventoryItem": { + "type": "structure", + "members": { + "descriptor": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Generated description using the product's title and any available variant attributes including, but not limited to, color and size." + } + }, + "isUnlimited": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Indicates whether stock is currently tracked for the item." + } + }, + "quantity": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Current amount in stock, or the last known stock amount prior to becoming unlimited. This value is modified by purchases and returns only when `isUnlimited` is `false`." + } + }, + "sku": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Stock keeping unit (SKU) code assigned by the Squarespace merchant for the variant; used to identify an exact variant of a product using a naming scheme preferred by the merchant." + } + }, + "variantId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The product variant id, which also serves as a unique id for the InventoryItem." + } + } + }, + "traits": { + "smithy.api#documentation": "Array of InventoryItem resources. If the merchant site doesn't have any physical or service products, this array is empty." + } + }, + "com.squarespace.api#PaginatedInventoryItemListResponseInventoryList": { + "type": "list", + "member": { + "target": "com.squarespace.api#InventoryItem" + }, + "traits": { + "smithy.api#documentation": "Array of InventoryItem resources. If the merchant site doesn't have any physical or service product variants, this array is empty." + } + }, + "com.squarespace.api#PaginatedInventoryItemListResponsePagination": { + "type": "structure", + "members": { + "hasNextPage": { + "target": "smithy.api#Boolean" + }, + "nextPageCursor": { + "target": "smithy.api#String" + }, + "nextPageUrl": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.squarespace.api#GetInventoryItems": { + "type": "operation", + "input": { + "target": "com.squarespace.api#GetInventoryItemsRequest" + }, + "output": { + "target": "com.squarespace.api#PaginatedInventoryItemListResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/1.0/commerce/inventory", + "code": 200 + }, + "smithy.api#documentation": "List inventory\n\nRetrieves real-time stock information for all product variants. Stock information is stored in an InventoryItem for each product variant. The response contains up to 50 InventoryItems and supports dynamic cursors for pagination." + } + }, + "com.squarespace.api#InventoryQuantityExpression": { + "type": "structure", + "members": { + "quantity": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Quantity value for the inventory operation." + } + }, + "variantId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique id for the InventoryItem." + } + } + }, + "traits": { + "smithy.api#documentation": "Optional; array of objects. Sets the exact stock quantity for InventoryItems." + } + }, + "com.squarespace.api#AdjustInventoryStockLevelsRequestDecrementOperationsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#InventoryQuantityExpression" + }, + "traits": { + "smithy.api#documentation": "Optional; array of objects. Subtracts stock quantity for InventoryItems." + } + }, + "com.squarespace.api#AdjustInventoryStockLevelsRequestIncrementOperationsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#InventoryQuantityExpression" + }, + "traits": { + "smithy.api#documentation": "Optional; array of objects. Increments stock quantity for InventoryItems." + } + }, + "com.squarespace.api#AdjustInventoryStockLevelsRequestSetFiniteOperationsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#InventoryQuantityExpression" + }, + "traits": { + "smithy.api#documentation": "Optional; array of objects. Sets the exact stock quantity for InventoryItems." + } + }, + "com.squarespace.api#AdjustInventoryStockLevelsRequestSetUnlimitedOperationsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "Optional; array of InventoryItem ids. Marks stock quantity as \"unlimited\" for the given InventoryItems." + } + }, + "com.squarespace.api#AdjustInventoryStockLevelsRequest": { + "type": "structure", + "members": { + "idempotencyKey": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpHeader": "Idempotency-Key", + "smithy.api#required": {}, + "smithy.api#documentation": "Required for idempotent requests. Refer to the idempotency key guide for requirements." + } + }, + "decrementOperations": { + "target": "com.squarespace.api#AdjustInventoryStockLevelsRequestDecrementOperationsList", + "traits": { + "smithy.api#documentation": "Optional; array of objects. Subtracts stock quantity for InventoryItems." + } + }, + "incrementOperations": { + "target": "com.squarespace.api#AdjustInventoryStockLevelsRequestIncrementOperationsList", + "traits": { + "smithy.api#documentation": "Optional; array of objects. Increments stock quantity for InventoryItems." + } + }, + "setFiniteOperations": { + "target": "com.squarespace.api#AdjustInventoryStockLevelsRequestSetFiniteOperationsList", + "traits": { + "smithy.api#documentation": "Optional; array of objects. Sets the exact stock quantity for InventoryItems." + } + }, + "setUnlimitedOperations": { + "target": "com.squarespace.api#AdjustInventoryStockLevelsRequestSetUnlimitedOperationsList", + "traits": { + "smithy.api#documentation": "Optional; array of InventoryItem ids. Marks stock quantity as \"unlimited\" for the given InventoryItems." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#AdjustInventoryStockLevels": { + "type": "operation", + "input": { + "target": "com.squarespace.api#AdjustInventoryStockLevelsRequest" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#NotFound" + }, + { + "target": "com.squarespace.api#Conflict" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/1.0/commerce/inventory/adjustments", + "code": 200 + }, + "smithy.api#documentation": "Adjust stock quantities\n\nAdjusts stock quantities for product variants. Stock quantities can be added or subtracted, set with a given number, or marked as \"unlimited\". All quantity information is stored in InventoryItems." + } + }, + "com.squarespace.api#GetSpecificInventoryItemsRequest": { + "type": "structure", + "members": { + "variantIdCsvs": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "Specifies the InventoryItems to retrieve. Multiple InventoryItems can be retrieved by providing a comma-separated list: {id1},{id2}..., though the same sequence is not guaranteed in the response." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#InventoryItemListResponse": { + "type": "structure", + "members": { + "inventory": { + "target": "com.squarespace.api#InventoryItemListResponseInventoryList", + "traits": { + "smithy.api#documentation": "Array of InventoryItem resources. If the merchant site doesn't have any physical or service products, this array is empty." + } + } + }, + "traits": {} + }, + "com.squarespace.api#InventoryItemListResponseInventoryList": { + "type": "list", + "member": { + "target": "com.squarespace.api#InventoryItem" + }, + "traits": { + "smithy.api#documentation": "Array of InventoryItem resources. If the merchant site doesn't have any physical or service products, this array is empty." + } + }, + "com.squarespace.api#GetSpecificInventoryItems": { + "type": "operation", + "input": { + "target": "com.squarespace.api#GetSpecificInventoryItemsRequest" + }, + "output": { + "target": "com.squarespace.api#InventoryItemListResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/1.0/commerce/inventory/{variantIdCsvs}", + "code": 200 + }, + "smithy.api#documentation": "Get inventory\n\nRetrieves real-time stock information for specific product variants. Stock information is stored in an InventoryItem and up to 50 InventoryItems can be retrieved per request." + } + }, + "com.squarespace.api#GetOrdersRequest": { + "type": "structure", + "members": { + "customerId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "customerId", + "smithy.api#documentation": "Used to filter Orders by Customer ID." + } + }, + "modifiedAfter": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "modifiedAfter", + "smithy.api#documentation": "Time-boxes the request to Orders that were modified after a given ISO 8601 UTC date and time string (YYYY-MM-DDThh:mm:ss.sZ). Required when modifiedBefore is passed; cannot be used with cursor." + } + }, + "modifiedBefore": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "modifiedBefore", + "smithy.api#documentation": "Time-boxes the request to Orders that were modified before a given ISO 8601 UTC date and time string (YYYY-MM-DDThh:mm:ss.sZ). Required when modifiedAfter is passed; cannot be used with cursor." + } + }, + "cursor": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "cursor", + "smithy.api#documentation": "Identifies where the next page of results should begin. Should be the value of pagination.nextPageCursor from a previous response. Cannot be used with other parameters." + } + }, + "fulfillmentStatus": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "fulfillmentStatus", + "smithy.api#documentation": "Used to filter Orders by fulfillment status. Values may be PENDING, FULFILLED, or CANCELED." + } + }, + "paymentStates": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "paymentStates", + "smithy.api#documentation": "Used to filter Orders by payment state. Accepts a comma-separated list of values. Possible values are: NOT_CHARGED, AUTHORIZED, PAID, REFUNDED, PENDING, FAILED, REFUND_PENDING, REFUND_FAILED, PARTIALLY_PAID. If not specified, defaults to NOT_CHARGED, AUTHORIZED, PAID, and REFUNDED." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#OrderListResponse": { + "type": "structure", + "members": { + "pagination": { + "target": "com.squarespace.api#OrderListResponsePagination" + }, + "result": { + "target": "com.squarespace.api#OrderListResponseResultList" + } + }, + "traits": {} + }, + "com.squarespace.api#OrderListResponsePagination": { + "type": "structure", + "members": { + "hasNextPage": { + "target": "smithy.api#Boolean" + }, + "nextPageCursor": { + "target": "smithy.api#String" + }, + "nextPageUrl": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.squarespace.api#Order": { + "type": "structure", + "members": { + "billingAddress": { + "target": "com.squarespace.api#Address" + }, + "channel": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Where the order originated; possible values are: web and pos." + } + }, + "channelName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the third-party sales channel." + } + }, + "createdOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string; represents the moment when the order was placed." + } + }, + "customerEmail": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Email address entered at checkout or, for recurring subscription orders, the customer's current email address." + } + }, + "customerId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique customer id." + } + }, + "discountLines": { + "target": "com.squarespace.api#OrderDiscountLinesList", + "traits": { + "smithy.api#documentation": "Array of discount line items; describes the promotions redeemed during checkout." + } + }, + "discountTotal": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "externalOrderReference": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Order reference identifier used by the third-party sales channel." + } + }, + "formSubmission": { + "target": "com.squarespace.api#OrderFormSubmissionList", + "traits": { + "smithy.api#documentation": "Array of form data submitted via the checkout page." + } + }, + "fulfilledOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string; represents the moment the order was fulfilled." + } + }, + "fulfillmentStatus": { + "target": "com.squarespace.api#FulfillmentStatus" + }, + "fulfillments": { + "target": "com.squarespace.api#OrderFulfillmentsList", + "traits": { + "smithy.api#documentation": "Array of shipping fulfillments; describes shipment information for the order." + } + }, + "grandTotal": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique Order id." + } + }, + "internalNotes": { + "target": "com.squarespace.api#OrderInternalNotesList", + "traits": { + "smithy.api#documentation": "Array of internal notes added to the order by the merchant." + } + }, + "lineItems": { + "target": "com.squarespace.api#OrderLineItemsList", + "traits": { + "smithy.api#documentation": "Array of purchased line items; line items describe what product or product variant was purchased, how many of that item were purchased, and additional details." + } + }, + "modifiedOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string; represents when the order was last modified." + } + }, + "orderNumber": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique, sequential number for the Order." + } + }, + "paymentState": { + "target": "com.squarespace.api#PaymentState" + }, + "priceTaxInterpretation": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Indicates whether lineItems.unitPricePaid includes tax. Values may be EXCLUSIVE or INCLUSIVE." + } + }, + "refundedTotal": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "shippingAddress": { + "target": "com.squarespace.api#Address" + }, + "shippingLines": { + "target": "com.squarespace.api#OrderShippingLinesList", + "traits": { + "smithy.api#documentation": "Array of shipping line items; describes the shipping options chosen at checkout." + } + }, + "shippingOptionName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "the specific shipping service name selected at checkout (e.g. \"USPS Ground Advantage\", \"Royal Mail Tracked 48\")." + } + }, + "shippingOptionServiceType": { + "target": "com.squarespace.api#OrderShippingOptionServiceType", + "traits": { + "smithy.api#documentation": "The carrier service type identifier." + } + }, + "shippingTotal": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "subtotal": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "taxTotal": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "testmode": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "If true, the order is a test order created using a payment method in test mode." + } + } + }, + "traits": {} + }, + "com.squarespace.api#Address": { + "type": "structure", + "members": { + "address1": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Primary street address" + } + }, + "address2": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Secondary address line" + } + }, + "city": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "City" + } + }, + "countryCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 3166-1 alpha-2 country code" + } + }, + "firstName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "First name" + } + }, + "lastName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Last name" + } + }, + "phone": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Phone number" + } + }, + "postalCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Postal or ZIP code" + } + }, + "state": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "State or province" + } + } + }, + "traits": { + "smithy.api#documentation": "Customer's shipping address provided at checkout or, for recurring subscription orders, the customer's current mailing address." + } + }, + "com.squarespace.api#DiscountLine": { + "type": "structure", + "members": { + "amount": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A plain-English description of the promotion" + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the promotion" + } + }, + "promoCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The user-entered promo code that triggered the discount" + } + } + }, + "traits": { + "smithy.api#documentation": "Array of discount line items; describes the promotions redeemed during checkout." + } + }, + "com.squarespace.api#OrderDiscountLinesList": { + "type": "list", + "member": { + "target": "com.squarespace.api#DiscountLine" + }, + "traits": { + "smithy.api#documentation": "Array of discount line items; describes the promotions redeemed during checkout." + } + }, + "com.squarespace.api#FormItem": { + "type": "structure", + "members": { + "label": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The name of the form field" + } + }, + "value": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The value of the field, as entered by the shopper" + } + } + }, + "traits": { + "smithy.api#documentation": "Array of form data submitted via the checkout page." + } + }, + "com.squarespace.api#OrderFormSubmissionList": { + "type": "list", + "member": { + "target": "com.squarespace.api#FormItem" + }, + "traits": { + "smithy.api#documentation": "Array of form data submitted via the checkout page." + } + }, + "com.squarespace.api#FulfillmentStatus": { + "type": "enum", + "members": { + "PENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PENDING" + } + }, + "FULFILLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FULFILLED" + } + }, + "CANCELED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CANCELED" + } + } + }, + "traits": { + "smithy.api#documentation": "Current fulfillment status of the order. Value may be: PENDING, FULFILLED, or CANCELED." + } + }, + "com.squarespace.api#Fulfillment": { + "type": "structure", + "members": { + "carrierName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the carrier handling the shipment." + } + }, + "service": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Carrier's level of service for shipping." + } + }, + "shipDate": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string; represents the moment the fulfillment was shipped." + } + }, + "trackingNumber": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Carrier's parcel tracking number." + } + }, + "trackingUrl": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "URL provided by the carrier to track the shipment." + } + } + }, + "traits": { + "smithy.api#documentation": "Array of shipping fulfillments; describes shipment information for the order." + } + }, + "com.squarespace.api#OrderFulfillmentsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#Fulfillment" + }, + "traits": { + "smithy.api#documentation": "Array of shipping fulfillments; describes shipment information for the order." + } + }, + "com.squarespace.api#OrderNote": { + "type": "structure", + "members": { + "content": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Content for the note" + } + } + }, + "traits": { + "smithy.api#documentation": "Array of internal notes added to the order by the merchant." + } + }, + "com.squarespace.api#OrderInternalNotesList": { + "type": "list", + "member": { + "target": "com.squarespace.api#OrderNote" + }, + "traits": { + "smithy.api#documentation": "Array of internal notes added to the order by the merchant." + } + }, + "com.squarespace.api#LineItem": { + "type": "structure", + "members": { + "customizations": { + "target": "com.squarespace.api#LineItemCustomizationsList", + "traits": { + "smithy.api#documentation": "Array of form data submitted via a product's custom form prior to being added to the cart." + } + }, + "height": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Shipping height of the physical product variant. 0.0 when not specified or when the variant is not a physical product." + } + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique line item id." + } + }, + "imageUrl": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "URL of the primary image for the item." + } + }, + "length": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Shipping length of the physical product variant. 0.0 when not specified or when the variant is not a physical product." + } + }, + "lineItemType": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Product type of the item." + } + }, + "productId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique product id; unless null, every line item with a variantId is a variant of a product with productId." + } + }, + "productName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the purchased product." + } + }, + "quantity": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Amount of the item purchased." + } + }, + "sku": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Stock keeping unit (SKU) code assigned by the Squarespace merchant for a variant. Null for digital products." + } + }, + "unitPricePaid": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "variantId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique id of the ProductVariant sold. Populated for physical, service, or gift card line items created on or after May 28, 2019." + } + }, + "variantOptions": { + "target": "com.squarespace.api#LineItemVariantOptionsList", + "traits": { + "smithy.api#documentation": "Array of variant options; represents variant choices made by the customer. Null for download and gift card products." + } + }, + "weight": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Shipping weight of the physical product variant. 0.0 when not specified or when the variant is not a physical product." + } + }, + "width": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Shipping width of the physical product variant. 0.0 when not specified or when the variant is not a physical product." + } + } + }, + "traits": { + "smithy.api#documentation": "Array of purchased line items; line items describe what product or product variant was purchased, how many of that item were purchased, and additional details." + } + }, + "com.squarespace.api#LineItemCustomizationsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#FormItem" + }, + "traits": { + "smithy.api#documentation": "Array of form data submitted via a product's custom form prior to being added to the cart." + } + }, + "com.squarespace.api#VariantOption": { + "type": "structure", + "members": { + "optionName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The name of the option (e.g. color, size, material)" + } + }, + "value": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The shopper-selected value for the option (e.g. red, small, cotton)" + } + } + }, + "traits": { + "smithy.api#documentation": "Array of variant options; represents variant choices made by the customer. Null for download and gift card products." + } + }, + "com.squarespace.api#LineItemVariantOptionsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#VariantOption" + }, + "traits": { + "smithy.api#documentation": "Array of variant options; represents variant choices made by the customer. Null for download and gift card products." + } + }, + "com.squarespace.api#OrderLineItemsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#LineItem" + }, + "traits": { + "smithy.api#documentation": "Array of purchased line items; line items describe what product or product variant was purchased, how many of that item were purchased, and additional details." + } + }, + "com.squarespace.api#PaymentState": { + "type": "enum", + "members": { + "NOT_CHARGED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NOT_CHARGED" + } + }, + "AUTHORIZED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AUTHORIZED" + } + }, + "PAID": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PAID" + } + }, + "REFUNDED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "REFUNDED" + } + }, + "PENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PENDING" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "REFUND_PENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "REFUND_PENDING" + } + }, + "REFUND_FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "REFUND_FAILED" + } + }, + "PARTIALLY_PAID": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PARTIALLY_PAID" + } + } + }, + "traits": { + "smithy.api#documentation": "Current state of payment for the order." + } + }, + "com.squarespace.api#ShippingLine": { + "type": "structure", + "members": { + "amount": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "method": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Description of the shipping option" + } + } + }, + "traits": { + "smithy.api#documentation": "Array of shipping line items; describes the shipping options chosen at checkout." + } + }, + "com.squarespace.api#OrderShippingLinesList": { + "type": "list", + "member": { + "target": "com.squarespace.api#ShippingLine" + }, + "traits": { + "smithy.api#documentation": "Array of shipping line items; describes the shipping options chosen at checkout." + } + }, + "com.squarespace.api#OrderShippingOptionServiceType": { + "type": "enum", + "members": { + "FEDEX_GROUND": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_GROUND" + } + }, + "FEDEX_GROUND_HOME_DELIVERY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_GROUND_HOME_DELIVERY" + } + }, + "FEDEX_PRIORITY_OVERNIGHT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_PRIORITY_OVERNIGHT" + } + }, + "FEDEX_STANDARD_OVERNIGHT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_STANDARD_OVERNIGHT" + } + }, + "FEDEX_2_DAY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_2_DAY" + } + }, + "FEDEX_2_DAY_AM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_2_DAY_AM" + } + }, + "FEDEX_EXPRESS_SAVER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_EXPRESS_SAVER" + } + }, + "FEDEX_FIRST_FREIGHT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_FIRST_FREIGHT" + } + }, + "FEDEX_FREIGHT_PRIORITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_FREIGHT_PRIORITY" + } + }, + "FEDEX_FREIGHT_ECONOMY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_FREIGHT_ECONOMY" + } + }, + "FEDEX_FIRST_OVERNIGHT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_FIRST_OVERNIGHT" + } + }, + "FEDEX_SAME_DAY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_SAME_DAY" + } + }, + "FEDEX_SAME_DAY_CITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_SAME_DAY_CITY" + } + }, + "FEDEX_EUROPE_FIRST_INTERNATIONAL_PRIORITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_EUROPE_FIRST_INTERNATIONAL_PRIORITY" + } + }, + "FEDEX_INTERNATIONAL_ECONOMY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_INTERNATIONAL_ECONOMY" + } + }, + "FEDEX_INTERNATIONAL_FIRST": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_INTERNATIONAL_FIRST" + } + }, + "FEDEX_INTERNATIONAL_PRIORITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_INTERNATIONAL_PRIORITY" + } + }, + "FEDEX_INTERNATIONAL_ECONOMY_FREIGHT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_INTERNATIONAL_ECONOMY_FREIGHT" + } + }, + "FEDEX_INTERNATIONAL_PRIORITY_FREIGHT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FEDEX_INTERNATIONAL_PRIORITY_FREIGHT" + } + }, + "UPS_GROUND": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPS_GROUND" + } + }, + "UPS_NEXT_DAY_AIR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPS_NEXT_DAY_AIR" + } + }, + "UPS_NEXT_DAY_AIR_SAVER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPS_NEXT_DAY_AIR_SAVER" + } + }, + "UPS_NEXT_DAY_AIR_EARLY_AM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPS_NEXT_DAY_AIR_EARLY_AM" + } + }, + "UPS_TWO_DAY_AIR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPS_TWO_DAY_AIR" + } + }, + "UPS_THREE_DAY_SELECT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPS_THREE_DAY_SELECT" + } + }, + "UPS_TWO_DAY_AIR_AM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPS_TWO_DAY_AIR_AM" + } + }, + "USPS_UNKNOWN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "USPS_UNKNOWN" + } + }, + "USPS_FIRST_CLASS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "USPS_FIRST_CLASS" + } + }, + "USPS_PRIORITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "USPS_PRIORITY" + } + }, + "USPS_EXPRESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "USPS_EXPRESS" + } + }, + "USPS_STANDARD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "USPS_STANDARD" + } + }, + "USPS_ALL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "USPS_ALL" + } + }, + "USPS_ONLINE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "USPS_ONLINE" + } + }, + "OTHER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OTHER" + } + } + }, + "traits": { + "smithy.api#documentation": "The carrier service type identifier." + } + }, + "com.squarespace.api#OrderListResponseResultList": { + "type": "list", + "member": { + "target": "com.squarespace.api#Order" + }, + "traits": {} + }, + "com.squarespace.api#GetOrders": { + "type": "operation", + "input": { + "target": "com.squarespace.api#GetOrdersRequest" + }, + "output": { + "target": "com.squarespace.api#OrderListResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/1.0/commerce/orders", + "code": 200 + }, + "smithy.api#documentation": "List orders\n\nRetrieves information about all orders. Orders can be filtered by Customer ID and date ranges. The response contains order information in an Order, up to 50 Orders ordered by their modification date (modifiedOn), and supports dynamic cursors for pagination." + } + }, + "com.squarespace.api#AddressRequest": { + "type": "structure", + "members": { + "address1": { + "target": "smithy.api#String" + }, + "address2": { + "target": "smithy.api#String" + }, + "city": { + "target": "smithy.api#String" + }, + "countryCode": { + "target": "smithy.api#String" + }, + "firstName": { + "target": "smithy.api#String" + }, + "lastName": { + "target": "smithy.api#String" + }, + "phone": { + "target": "smithy.api#String" + }, + "postalCode": { + "target": "smithy.api#String" + }, + "state": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "Customer's shipping address." + } + }, + "com.squarespace.api#CreateDiscountLineRequest": { + "type": "structure", + "members": { + "amount": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "name": { + "target": "smithy.api#String" + }, + "promoCode": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "Array of discount line items. Describes the promotions redeemed during checkout." + } + }, + "com.squarespace.api#CreateOrderRequestDiscountLinesList": { + "type": "list", + "member": { + "target": "com.squarespace.api#CreateDiscountLineRequest" + }, + "traits": { + "smithy.api#documentation": "Array of discount line items. Describes the promotions redeemed during checkout." + } + }, + "com.squarespace.api#OrderCreateFulfillmentStatus": { + "type": "enum", + "members": { + "PENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PENDING" + } + }, + "FULFILLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FULFILLED" + } + } + }, + "traits": { + "smithy.api#documentation": "Current fulfillment status of the order. Value may be PENDING or FULFILLED." + } + }, + "com.squarespace.api#CreateOrderShipmentRequest": { + "type": "structure", + "members": { + "carrierName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the carrier handling the shipment.", + "smithy.api#required": {} + } + }, + "service": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Carrier's level of service for shipping.", + "smithy.api#required": {} + } + }, + "shipDate": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string. Represents the moment the shipment occurred.", + "smithy.api#required": {} + } + }, + "trackingNumber": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Carrier's parcel tracking number.", + "smithy.api#required": {} + } + }, + "trackingUrl": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "URL provided by carrier to track the shipment; must adhere to valid URL formatting." + } + } + }, + "traits": { + "smithy.api#documentation": "Array of shipping fulfillments; up to 100 entries. Describes shipment information for the order." + } + }, + "com.squarespace.api#CreateOrderRequestFulfillmentsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#CreateOrderShipmentRequest" + }, + "traits": { + "smithy.api#documentation": "Array of shipping fulfillments; up to 100 entries. Describes shipment information for the order." + } + }, + "com.squarespace.api#CreateOrderInventoryBehavior": { + "type": "enum", + "members": { + "DEDUCT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DEDUCT" + } + }, + "SKIP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SKIP" + } + } + }, + "traits": { + "smithy.api#documentation": "Indicates whether to deduct stock quantity for the product variant upon Order creation. Values may be DEDUCT or SKIP. Defaults to SKIP." + } + }, + "com.squarespace.api#CreateLineItemRequest": { + "type": "structure", + "members": { + "lineItemType": { + "target": "com.squarespace.api#OrderCreateLineItemType", + "traits": { + "smithy.api#required": {} + } + }, + "nonSaleUnitPrice": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "quantity": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Amount of the item purchased. 1,000,000 limit.", + "smithy.api#required": {} + } + }, + "title": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Title of the custom line item." + } + }, + "unitPricePaid": { + "target": "com.squarespace.api#MonetaryAmount", + "traits": { + "smithy.api#required": {} + } + }, + "variantId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Required if lineItemType is PHYSICAL_PRODUCT. Unique id of the ProductVariant sold." + } + } + }, + "traits": { + "smithy.api#documentation": "Array of purchased line items; cannot be empty." + } + }, + "com.squarespace.api#OrderCreateLineItemType": { + "type": "enum", + "members": { + "PHYSICAL_PRODUCT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PHYSICAL_PRODUCT" + } + }, + "CUSTOM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CUSTOM" + } + } + }, + "traits": { + "smithy.api#documentation": "Product type sold; values may be PHYSICAL_PRODUCT or CUSTOM." + } + }, + "com.squarespace.api#CreateOrderRequestLineItemsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#CreateLineItemRequest" + }, + "traits": { + "smithy.api#documentation": "Array of purchased line items; cannot be empty." + } + }, + "com.squarespace.api#TaxInterpretation": { + "type": "enum", + "members": { + "INCLUSIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INCLUSIVE" + } + }, + "EXCLUSIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EXCLUSIVE" + } + } + }, + "traits": { + "smithy.api#documentation": "Indicates that lineItems.unitPricePaid includes tax. Values may be EXCLUSIVE or INCLUSIVE." + } + }, + "com.squarespace.api#CreateShippingLineRequest": { + "type": "structure", + "members": { + "amount": { + "target": "com.squarespace.api#MonetaryAmount", + "traits": { + "smithy.api#required": {} + } + }, + "method": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Description of the shipping option.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Array of shipping line items. Describes the shipping options chosen at checkout. Currently accepts only one shipping entry." + } + }, + "com.squarespace.api#CreateOrderRequestShippingLinesList": { + "type": "list", + "member": { + "target": "com.squarespace.api#CreateShippingLineRequest" + }, + "traits": { + "smithy.api#documentation": "Array of shipping line items. Describes the shipping options chosen at checkout. Currently accepts only one shipping entry." + } + }, + "com.squarespace.api#ShopperFulfillmentNotificationBehavior": { + "type": "enum", + "members": { + "SEND": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SEND" + } + }, + "SKIP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SKIP" + } + } + }, + "traits": { + "smithy.api#documentation": "Indicates whether to send a fulfillment notification email to the customer. Value may be SEND or SKIP." + } + }, + "com.squarespace.api#CreateOrderRequest": { + "type": "structure", + "members": { + "idempotencyKey": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpHeader": "Idempotency-Key", + "smithy.api#required": {}, + "smithy.api#documentation": "Idempotency key to prevent duplicate order creation." + } + }, + "billingAddress": { + "target": "com.squarespace.api#AddressRequest" + }, + "channelName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of third-party sales channel.", + "smithy.api#required": {} + } + }, + "createdOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string. Represents the date and time when the order was placed through the third-party sales channel.", + "smithy.api#required": {} + } + }, + "customerEmail": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Email address provided at checkout on the third-party sales channel." + } + }, + "discountLines": { + "target": "com.squarespace.api#CreateOrderRequestDiscountLinesList", + "traits": { + "smithy.api#documentation": "Array of discount line items. Describes the promotions redeemed during checkout." + } + }, + "discountTotal": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "externalOrderReference": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Order reference identifier used by the third-party sales channel.", + "smithy.api#required": {} + } + }, + "fulfilledOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string. Represents the moment the order was fulfilled. Required if fulfillmentStatus is FULFILLED." + } + }, + "fulfillmentStatus": { + "target": "com.squarespace.api#OrderCreateFulfillmentStatus" + }, + "fulfillments": { + "target": "com.squarespace.api#CreateOrderRequestFulfillmentsList", + "traits": { + "smithy.api#documentation": "Array of shipping fulfillments; up to 100 entries. Describes shipment information for the order.", + "smithy.api#required": {} + } + }, + "grandTotal": { + "target": "com.squarespace.api#MonetaryAmount", + "traits": { + "smithy.api#required": {} + } + }, + "inventoryBehavior": { + "target": "com.squarespace.api#CreateOrderInventoryBehavior" + }, + "lineItems": { + "target": "com.squarespace.api#CreateOrderRequestLineItemsList", + "traits": { + "smithy.api#documentation": "Array of purchased line items; cannot be empty.", + "smithy.api#required": {} + } + }, + "priceTaxInterpretation": { + "target": "com.squarespace.api#TaxInterpretation", + "traits": { + "smithy.api#required": {} + } + }, + "shippingAddress": { + "target": "com.squarespace.api#AddressRequest" + }, + "shippingLines": { + "target": "com.squarespace.api#CreateOrderRequestShippingLinesList", + "traits": { + "smithy.api#documentation": "Array of shipping line items. Describes the shipping options chosen at checkout. Currently accepts only one shipping entry." + } + }, + "shippingTotal": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "shopperFulfillmentNotificationBehavior": { + "target": "com.squarespace.api#ShopperFulfillmentNotificationBehavior" + }, + "subtotal": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "taxTotal": { + "target": "com.squarespace.api#MonetaryAmount" + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#CreateOrder": { + "type": "operation", + "input": { + "target": "com.squarespace.api#CreateOrderRequest" + }, + "output": { + "target": "com.squarespace.api#Order" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#Conflict" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/1.0/commerce/orders", + "code": 200 + }, + "smithy.api#documentation": "Create order\n\nCreates an order using information from a third-party sales channel. A successful request creates an Order resource." + } + }, + "com.squarespace.api#GetOrderRequest": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "Specifies the Order to retrieve." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#GetOrder": { + "type": "operation", + "input": { + "target": "com.squarespace.api#GetOrderRequest" + }, + "output": { + "target": "com.squarespace.api#Order" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/1.0/commerce/orders/{id}", + "code": 200 + }, + "smithy.api#documentation": "Get order\n\nRetrieves information for a specific order. The response contains order information in an Order." + } + }, + "com.squarespace.api#FulfillOrderRequestShipmentsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#CreateOrderShipmentRequest" + }, + "traits": { + "smithy.api#documentation": "Array of shipment data." + } + }, + "com.squarespace.api#FulfillOrderRequest": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "Specifies the Order to update." + } + }, + "shipments": { + "target": "com.squarespace.api#FulfillOrderRequestShipmentsList", + "traits": { + "smithy.api#documentation": "Array of shipment data." + } + }, + "shouldSendNotification": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Indicates whether the customer should receive an email notification about the added shipments." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#FulfillOrder": { + "type": "operation", + "input": { + "target": "com.squarespace.api#FulfillOrderRequest" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#NotFound" + }, + { + "target": "com.squarespace.api#Conflict" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/1.0/commerce/orders/{id}/fulfillments", + "code": 200 + }, + "smithy.api#documentation": "Fulfill order\n\nUpdates the status of a specific order to fulfilled, with options to include shipment information and send a customer notification." + } + }, + "com.squarespace.api#GetStorePagesRequest": { + "type": "structure", + "members": { + "cursor": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "cursor" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#PaginatedStorePagesResponse": { + "type": "structure", + "members": { + "pagination": { + "target": "com.squarespace.api#PaginatedStorePagesResponsePagination" + }, + "storePages": { + "target": "com.squarespace.api#PaginatedStorePagesResponseStorePagesList" + } + }, + "traits": {} + }, + "com.squarespace.api#PaginatedStorePagesResponsePagination": { + "type": "structure", + "members": { + "hasNextPage": { + "target": "smithy.api#Boolean" + }, + "nextPageCursor": { + "target": "smithy.api#String" + }, + "nextPageUrl": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.squarespace.api#StorePage": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + }, + "isEnabled": { + "target": "smithy.api#Boolean" + }, + "title": { + "target": "smithy.api#String" + }, + "urlSlug": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.squarespace.api#PaginatedStorePagesResponseStorePagesList": { + "type": "list", + "member": { + "target": "com.squarespace.api#StorePage" + }, + "traits": {} + }, + "com.squarespace.api#GetStorePages": { + "type": "operation", + "input": { + "target": "com.squarespace.api#GetStorePagesRequest" + }, + "output": { + "target": "com.squarespace.api#PaginatedStorePagesResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/1.0/commerce/store_pages", + "code": 200 + }, + "smithy.api#documentation": "List store pages\n\nRetrieves information for all store pages on the website. The response supports dynamic cursors for pagination." + } + }, + "com.squarespace.api#GetDocumentsByUpdatedOnRequest": { + "type": "structure", + "members": { + "cursor": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "cursor", + "smithy.api#documentation": "Identifies where the next page of results should begin. Should be the value of pagination.nextPageCursor from a previous response." + } + }, + "modifiedAfter": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "modifiedAfter", + "smithy.api#documentation": "Time-boxes the request to Documents that were modified after a given ISO 8601 UTC date and time string (YYYY-MM-DDThh:mm:ss.sZ)." + } + }, + "modifiedBefore": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "modifiedBefore", + "smithy.api#documentation": "Time-boxes the request to Documents that were modified before a given ISO 8601 UTC date and time string (YYYY-MM-DDThh:mm:ss.sZ)." + } + }, + "orderId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "orderId" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#PaginatedTransactionListResponse": { + "type": "structure", + "members": { + "documents": { + "target": "com.squarespace.api#PaginatedTransactionListResponseDocumentsList", + "traits": { + "smithy.api#documentation": "Array of Document resources. If the merchant site doesn't have any payment transactions for orders or donations, this array is empty." + } + }, + "pagination": { + "target": "com.squarespace.api#PaginatedTransactionListResponsePagination" + } + }, + "traits": {} + }, + "com.squarespace.api#TransactionDocument": { + "type": "structure", + "members": { + "createdOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string; represents when the Document was created." + } + }, + "customerEmail": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Customer or donor email address. May be null for point of sale orders because email wasn't collected." + } + }, + "discounts": { + "target": "com.squarespace.api#TransactionDocumentDiscountsList", + "traits": { + "smithy.api#documentation": "Array of discounts for an order payment transaction; empty for donations." + } + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique Document id." + } + }, + "modifiedOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string; represents when the Document was last modified." + } + }, + "paymentGatewayError": { + "target": "com.squarespace.api#PaymentGatewayError" + }, + "payments": { + "target": "com.squarespace.api#TransactionDocumentPaymentsList", + "traits": { + "smithy.api#documentation": "Array of payment transactions for the order or donation." + } + }, + "salesLineItems": { + "target": "com.squarespace.api#TransactionDocumentSalesLineItemsList", + "traits": { + "smithy.api#documentation": "Array of sales items for an order payment transaction; empty for donations." + } + }, + "salesOrderId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique order id; not applicable if payment transaction is a donation." + } + }, + "shippingLineItems": { + "target": "com.squarespace.api#TransactionDocumentShippingLineItemsList", + "traits": { + "smithy.api#documentation": "Array of shipping line items." + } + }, + "total": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "totalNetPayment": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "totalNetSales": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "totalNetShipping": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "totalSales": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "totalTaxes": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "voided": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Flag; indicates order cancellation." + } + } + }, + "traits": { + "smithy.api#documentation": "Array of Document resources." + } + }, + "com.squarespace.api#TransactionDiscount": { + "type": "structure", + "members": { + "amount": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Discount description." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Discount name." + } + } + }, + "traits": { + "smithy.api#documentation": "Array of discounts for an order payment transaction; empty for donations." + } + }, + "com.squarespace.api#TransactionDocumentDiscountsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#TransactionDiscount" + }, + "traits": { + "smithy.api#documentation": "Array of discounts for an order payment transaction; empty for donations." + } + }, + "com.squarespace.api#PaymentGatewayError": { + "type": "enum", + "members": { + "GATEWAY_FEE_PROCEESING_ERROR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GATEWAY_FEE_PROCEESING_ERROR" + } + }, + "GATEWAY_API_PERMISSION_ERROR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GATEWAY_API_PERMISSION_ERROR" + } + }, + "GATEWAY_DISCONNNECTED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GATEWAY_DISCONNNECTED" + } + } + }, + "traits": { + "smithy.api#documentation": "Captures errors from the payment gateway; value is null if not applicable." + } + }, + "com.squarespace.api#TransactionPayment": { + "type": "structure", + "members": { + "amount": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "creditCardType": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Payment credit card type; possible values: VISA, MASTERCARD, DISCOVER, AMEX, JCB, and OTHER. null if credit card processing isn't available for the payment gateway." + } + }, + "externalCustomerId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique customer id for the payment transaction provided by the payment gateway. Value is null if not available." + } + }, + "externalTransactionId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique id for the payment transaction provided by the payment gateway." + } + }, + "externalTransactionProperties": { + "target": "com.squarespace.api#TransactionPaymentExternalTransactionPropertiesList", + "traits": { + "smithy.api#documentation": "Array of properties for the payment transaction provided by the payment gateway. Properties are listed in key/value pairs." + } + }, + "giftCardId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique id for a Squarespace gift card. Value is null if a gift card was not used." + } + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique payment id." + } + }, + "netAmount": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "paidOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string; represents when the payment was made." + } + }, + "processingFees": { + "target": "com.squarespace.api#TransactionPaymentProcessingFeesList", + "traits": { + "smithy.api#documentation": "Array of processing fees associated with the payment." + } + }, + "provider": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Payment gateway used for processing." + } + }, + "refundedAmount": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "refunds": { + "target": "com.squarespace.api#TransactionPaymentRefundsList", + "traits": { + "smithy.api#documentation": "Array of refunds for the payment transaction." + } + } + }, + "traits": { + "smithy.api#documentation": "Array of payment transactions for the order or donation." + } + }, + "com.squarespace.api#ExternalTransactionProperty": { + "type": "structure", + "members": { + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "Array of properties for the payment transaction provided by the payment gateway. Properties are listed in key/value pairs." + } + }, + "com.squarespace.api#TransactionPaymentExternalTransactionPropertiesList": { + "type": "list", + "member": { + "target": "com.squarespace.api#ExternalTransactionProperty" + }, + "traits": { + "smithy.api#documentation": "Array of properties for the payment transaction provided by the payment gateway. Properties are listed in key/value pairs." + } + }, + "com.squarespace.api#TransactionProcessingFee": { + "type": "structure", + "members": { + "amount": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "amountGatewayCurrency": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "exchangeRate": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Foreign exchange rate between the payment gateway's and payment's currencies; determined when the payment is processed." + } + }, + "feeRefunds": { + "target": "com.squarespace.api#TransactionProcessingFeeFeeRefundsList", + "traits": { + "smithy.api#documentation": "Array of processing fee refunds for the payment." + } + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique processing fee id." + } + }, + "netAmount": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "netAmountGatewayCurrency": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "refundedAmount": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "refundedAmountGatewayCurrency": { + "target": "com.squarespace.api#MonetaryAmount" + } + }, + "traits": { + "smithy.api#documentation": "Array of processing fees associated with the payment." + } + }, + "com.squarespace.api#TransactionProcessingFeeRefund": { + "type": "structure", + "members": { + "amount": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "amountGatewayCurrency": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "exchangeRate": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "Foreign exchange rate between the payment gateway's and payment's currencies; determined when the payment is processed." + } + }, + "externalTransactionId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique id for the processing fee refund transaction provided by the payment gateway." + } + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique processing fee refund id." + } + }, + "refundedOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string; represents when the processing fee refund was issued." + } + } + }, + "traits": { + "smithy.api#documentation": "Array of processing fee refunds for the payment." + } + }, + "com.squarespace.api#TransactionProcessingFeeFeeRefundsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#TransactionProcessingFeeRefund" + }, + "traits": { + "smithy.api#documentation": "Array of processing fee refunds for the payment." + } + }, + "com.squarespace.api#TransactionPaymentProcessingFeesList": { + "type": "list", + "member": { + "target": "com.squarespace.api#TransactionProcessingFee" + }, + "traits": { + "smithy.api#documentation": "Array of processing fees associated with the payment." + } + }, + "com.squarespace.api#TransactionRefund": { + "type": "structure", + "members": { + "amount": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "externalTransactionId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique id for the refund transaction provided by the payment gateway." + } + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique refund id." + } + }, + "refundedOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string; represents refund issue date." + } + } + }, + "traits": { + "smithy.api#documentation": "Array of refunds for the payment transaction." + } + }, + "com.squarespace.api#TransactionPaymentRefundsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#TransactionRefund" + }, + "traits": { + "smithy.api#documentation": "Array of refunds for the payment transaction." + } + }, + "com.squarespace.api#TransactionDocumentPaymentsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#TransactionPayment" + }, + "traits": { + "smithy.api#documentation": "Array of payment transactions for the order or donation." + } + }, + "com.squarespace.api#TransactionSalesLineItem": { + "type": "structure", + "members": { + "discountAmount": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique id for the sales item." + } + }, + "taxes": { + "target": "com.squarespace.api#TransactionSalesLineItemTaxesList", + "traits": { + "smithy.api#documentation": "Array of taxes for the sale item." + } + }, + "total": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "totalNetSales": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "totalSales": { + "target": "com.squarespace.api#MonetaryAmount" + } + }, + "traits": { + "smithy.api#documentation": "Array of sales items for an order payment transaction; empty for donations." + } + }, + "com.squarespace.api#TransactionTax": { + "type": "structure", + "members": { + "amount": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "jurisdiction": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Tax jurisdiction in COUNTRY:{value},STATE:{value},LOCAL:{value} format. Examples: COUNTRY:US, COUNTRY:US,STATE:NY, and COUNTRY:US,STATE:NY,LOCAL:10001." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Tax classification as defined by the Squarespace merchant." + } + }, + "rate": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Tax rate as a percent. For example, a value of 7.00 is a 7% tax." + } + } + }, + "traits": { + "smithy.api#documentation": "Array of taxes for the shipping line item." + } + }, + "com.squarespace.api#TransactionSalesLineItemTaxesList": { + "type": "list", + "member": { + "target": "com.squarespace.api#TransactionTax" + }, + "traits": { + "smithy.api#documentation": "Array of taxes for the sale item." + } + }, + "com.squarespace.api#TransactionDocumentSalesLineItemsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#TransactionSalesLineItem" + }, + "traits": { + "smithy.api#documentation": "Array of sales items for an order payment transaction; empty for donations." + } + }, + "com.squarespace.api#TransactionShippingLineItem": { + "type": "structure", + "members": { + "amount": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Description of the shipping line item as defined by the Squarespace merchant." + } + }, + "discountAmount": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique id for the shipping line item." + } + }, + "netAmount": { + "target": "com.squarespace.api#MonetaryAmount" + }, + "taxes": { + "target": "com.squarespace.api#TransactionShippingLineItemTaxesList", + "traits": { + "smithy.api#documentation": "Array of taxes for the shipping line item." + } + } + }, + "traits": { + "smithy.api#documentation": "Array of shipping line items." + } + }, + "com.squarespace.api#TransactionShippingLineItemTaxesList": { + "type": "list", + "member": { + "target": "com.squarespace.api#TransactionTax" + }, + "traits": { + "smithy.api#documentation": "Array of taxes for the shipping line item." + } + }, + "com.squarespace.api#TransactionDocumentShippingLineItemsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#TransactionShippingLineItem" + }, + "traits": { + "smithy.api#documentation": "Array of shipping line items." + } + }, + "com.squarespace.api#PaginatedTransactionListResponseDocumentsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#TransactionDocument" + }, + "traits": { + "smithy.api#documentation": "Array of Document resources. If the merchant site doesn't have any payment transactions for orders or donations, this array is empty." + } + }, + "com.squarespace.api#PaginatedTransactionListResponsePagination": { + "type": "structure", + "members": { + "hasNextPage": { + "target": "smithy.api#Boolean" + }, + "nextPageCursor": { + "target": "smithy.api#String" + }, + "nextPageUrl": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.squarespace.api#GetDocumentsByUpdatedOn": { + "type": "operation", + "input": { + "target": "com.squarespace.api#GetDocumentsByUpdatedOnRequest" + }, + "output": { + "target": "com.squarespace.api#PaginatedTransactionListResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/1.0/commerce/transactions", + "code": 200 + }, + "smithy.api#documentation": "List transactions\n\nRetrieves all financial transactions for orders and donations. Per order and donation, the response groups transactions into a Document, contains up to 50 Documents ordered by their modification date (modifiedOn), and supports dynamic cursors for pagination." + } + }, + "com.squarespace.api#GetDocumentsByIdRequest": { + "type": "structure", + "members": { + "documentIds": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "Specifies the Documents to retrieve. Multiple Documents can be retrieved by providing a comma-separated list of Document ids." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#TransactionListResponse": { + "type": "structure", + "members": { + "documents": { + "target": "com.squarespace.api#TransactionListResponseDocumentsList", + "traits": { + "smithy.api#documentation": "Array of Document resources." + } + } + }, + "traits": {} + }, + "com.squarespace.api#TransactionListResponseDocumentsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#TransactionDocument" + }, + "traits": { + "smithy.api#documentation": "Array of Document resources." + } + }, + "com.squarespace.api#GetDocumentsById": { + "type": "operation", + "input": { + "target": "com.squarespace.api#GetDocumentsByIdRequest" + }, + "output": { + "target": "com.squarespace.api#TransactionListResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/1.0/commerce/transactions/{documentIds}", + "code": 200 + }, + "smithy.api#documentation": "Get transactions\n\nRetrieves information for specific transaction Documents. The response contains up to 50 Documents. Multiple Documents can be retrieved by providing a comma-separated list of Document ids." + } + }, + "com.squarespace.api#GetProfilesRequest": { + "type": "structure", + "members": { + "sortDirection": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "sortDirection", + "smithy.api#documentation": "Identifies the sort direction of the result list; asc for ascending or dsc for descending. If not specified, the returned list is in descending order." + } + }, + "sortField": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "sortField", + "smithy.api#documentation": "Identifies the sort field of the result list. Values include: createdOn, id, email, or lastName. If not specified, the returned list is sorted by id." + } + }, + "filter": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "filter", + "smithy.api#documentation": "Semicolon separated list used to filter profile results. Values include: isCustomer and/or hasAccount, or email. The email filter cannot be used with isCustomer or hasAccount." + } + }, + "email": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "email", + "smithy.api#documentation": "Email address filter (URL-encoded, case insensitive)." + } + }, + "cursor": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "cursor", + "smithy.api#documentation": "Identifies where the next page of results should begin. Should be the value of pagination.nextPageCursor from a previous response. Cannot be used with other parameters." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#PaginatedProfileListResponse": { + "type": "structure", + "members": { + "pagination": { + "target": "com.squarespace.api#PaginatedProfileListResponsePagination" + }, + "profiles": { + "target": "com.squarespace.api#PaginatedProfileListResponseProfilesList" + } + }, + "traits": {} + }, + "com.squarespace.api#PaginatedProfileListResponsePagination": { + "type": "structure", + "members": { + "hasNextPage": { + "target": "smithy.api#Boolean" + }, + "nextPageCursor": { + "target": "smithy.api#String" + }, + "nextPageUrl": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.squarespace.api#Profile": { + "type": "structure", + "members": { + "acceptsMarketing": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Indicates whether the profile opted to receive marketing." + } + }, + "address": { + "target": "com.squarespace.api#Address" + }, + "createdOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string; represents when the profile was created." + } + }, + "email": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Profile email address." + } + }, + "firstName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Profile first name." + } + }, + "hasAccount": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Indicates whether the profile has an account with the website." + } + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique Profile id." + } + }, + "isCustomer": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Indicates whether the profile has any commerce orders or donations with the website." + } + }, + "lastName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Profile last name." + } + }, + "transactionsSummary": { + "target": "com.squarespace.api#TransactionsSummary" + } + }, + "traits": {} + }, + "com.squarespace.api#PaginatedProfileListResponseProfilesList": { + "type": "list", + "member": { + "target": "com.squarespace.api#Profile" + }, + "traits": {} + }, + "com.squarespace.api#GetProfiles": { + "type": "operation", + "input": { + "target": "com.squarespace.api#GetProfilesRequest" + }, + "output": { + "target": "com.squarespace.api#PaginatedProfileListResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/1.0/profiles", + "code": 200 + }, + "smithy.api#documentation": "List profiles\n\nRetrieves all profiles; profiles can be filtered and sorted. The response contains up to 50 Profiles and supports dynamic cursors for pagination." + } + }, + "com.squarespace.api#GetSpecificProfilesRequest": { + "type": "structure", + "members": { + "profileIdCsvs": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "Specifies the profiles to retrieve. Multiple Profiles can be retrieved by providing a comma-separated list of profile ids." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#ProfileListResponse": { + "type": "structure", + "members": { + "profiles": { + "target": "com.squarespace.api#ProfileListResponseProfilesList" + } + }, + "traits": {} + }, + "com.squarespace.api#ProfileListResponseProfilesList": { + "type": "list", + "member": { + "target": "com.squarespace.api#Profile" + }, + "traits": {} + }, + "com.squarespace.api#GetSpecificProfiles": { + "type": "operation", + "input": { + "target": "com.squarespace.api#GetSpecificProfilesRequest" + }, + "output": { + "target": "com.squarespace.api#ProfileListResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/1.0/profiles/{profileIdCsvs}", + "code": 200 + }, + "smithy.api#documentation": "Get profiles\n\nRetrieves information for specific profiles. The response contains a list of up to 50 Profiles. Multiple Profiles can be retrieved by providing a comma-separated list of profile ids." + } + }, + "com.squarespace.api#ExternalWebhookSubscriptionListResponse": { + "type": "structure", + "members": { + "webhookSubscriptions": { + "target": "com.squarespace.api#ExternalWebhookSubscriptionListResponseWebhookSubscriptionsList", + "traits": { + "smithy.api#documentation": "Array of Webhook Subscription resources. If the merchant site doesn't have any webhook subscriptions, this array is empty." + } + } + }, + "traits": {} + }, + "com.squarespace.api#ExternalWebhookSubscriptionResponse": { + "type": "structure", + "members": { + "clientId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Third-party client id." + } + }, + "createdOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string; represents when the webhook subscription was created." + } + }, + "endpointUrl": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "HTTPS URL that receives webhook notifications." + } + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique Webhook Subscription id." + } + }, + "topics": { + "target": "com.squarespace.api#ExternalWebhookSubscriptionResponseTopicsList", + "traits": { + "smithy.api#documentation": "List of event topics that trigger a webhook notification. Possible values include: extension.uninstall, order.create, order.update." + } + }, + "updatedOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string; represents when the webhook subscription was last modified." + } + }, + "websiteId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique website id." + } + } + }, + "traits": {} + }, + "com.squarespace.api#ExternalWebhookSubscriptionResponseTopicsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "List of event topics that trigger a webhook notification. Possible values include: extension.uninstall, order.create, order.update." + } + }, + "com.squarespace.api#ExternalWebhookSubscriptionListResponseWebhookSubscriptionsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#ExternalWebhookSubscriptionResponse" + }, + "traits": { + "smithy.api#documentation": "Array of Webhook Subscription resources. If the merchant site doesn't have any webhook subscriptions, this array is empty." + } + }, + "com.squarespace.api#GetWebhookSubscriptions": { + "type": "operation", + "input": { + "target": "smithy.api#Unit" + }, + "output": { + "target": "com.squarespace.api#ExternalWebhookSubscriptionListResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/1.0/webhook_subscriptions", + "code": 200 + }, + "smithy.api#documentation": "List webhook subscriptions\n\nRetrieves information for all webhook subscriptions. The response contains up to 25 Webhook Subscriptions. Requires an OAuth access token; API keys are not supported." + } + }, + "com.squarespace.api#CreateWebhookSubscriptionRequestTopicsItem": { + "type": "enum", + "members": { + "ORDER_CREATE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "order.create" + } + }, + "ORDER_UPDATE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "order.update" + } + }, + "EXTENSION_UNINSTALL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "extension.uninstall" + } + }, + "CONTACT_CREATE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "contact.create" + } + }, + "CONTACT_UPDATE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "contact.update" + } + }, + "CONTACT_DELETE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "contact.delete" + } + }, + "ADDRESS_CREATE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "address.create" + } + }, + "ADDRESS_UPDATE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "address.update" + } + }, + "ADDRESS_DELETE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "address.delete" + } + } + }, + "traits": { + "smithy.api#documentation": "Description of the event that triggered the notification.\n* `order.create` - always value for OrderCreatePayload.topic ref\n* `order.update` - always value for OrderUpdatePayload.topic\n* `extension.uninstall` - always value for ExtensionUninstallPayload.topic\n* `contact.create` - always value for ContactCreatePayload.topic\n* `contact.update` - always value for ContactUpdatePayload.topic\n* `contact.delete` - always value for ContactDeletePayload.topic\n* `address.create` - always value for AddressCreatePayload.topic\n* `address.update` - always value for AddressUpdatePayload.topic\n* `address.delete` - always value for AddressDeletePayload.topic\n" + } + }, + "com.squarespace.api#CreateWebhookSubscriptionRequestTopicsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#CreateWebhookSubscriptionRequestTopicsItem" + }, + "traits": { + "smithy.api#documentation": "List of event topics that trigger a webhook notification." + } + }, + "com.squarespace.api#CreateWebhookSubscriptionRequest": { + "type": "structure", + "members": { + "endpointUrl": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "HTTPS URL to POST webhook notifications.", + "smithy.api#required": {} + } + }, + "topics": { + "target": "com.squarespace.api#CreateWebhookSubscriptionRequestTopicsList", + "traits": { + "smithy.api#documentation": "List of event topics that trigger a webhook notification." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#ExternalCreateWebhookSubscriptionResponse": { + "type": "structure", + "members": { + "clientId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Third-party client id.", + "smithy.api#required": {} + } + }, + "createdOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string; represents when the webhook subscription was created.", + "smithy.api#required": {} + } + }, + "endpointUrl": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "HTTPS URL to POST webhook notifications.", + "smithy.api#required": {} + } + }, + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique Webhook Subscription id.", + "smithy.api#required": {} + } + }, + "secret": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Hexadecimal value used to generate a signature for a webhook notification;\nfield is only returned when creating a new subscription or rotating a secret.\nStore the secret in a safe location to verify notifications from Squarespace.\nSee the 'Verifying notifications' guide under Webhooks for details.\n", + "smithy.api#required": {}, + "smithy.api#sensitive": {} + } + }, + "topics": { + "target": "com.squarespace.api#ExternalCreateWebhookSubscriptionResponseTopicsList", + "traits": { + "smithy.api#documentation": "List of event topics that trigger a webhook notification." + } + }, + "updatedOn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ISO 8601 UTC date and time string; represents when the webhook subscription was last modified.", + "smithy.api#required": {} + } + }, + "websiteId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Unique Webhook Subscription id.", + "smithy.api#required": {} + } + } + }, + "traits": {} + }, + "com.squarespace.api#ExternalCreateWebhookSubscriptionResponseTopicsItem": { + "type": "enum", + "members": { + "ORDER_CREATE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "order.create" + } + }, + "ORDER_UPDATE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "order.update" + } + }, + "EXTENSION_UNINSTALL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "extension.uninstall" + } + }, + "CONTACT_CREATE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "contact.create" + } + }, + "CONTACT_UPDATE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "contact.update" + } + }, + "CONTACT_DELETE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "contact.delete" + } + }, + "ADDRESS_CREATE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "address.create" + } + }, + "ADDRESS_UPDATE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "address.update" + } + }, + "ADDRESS_DELETE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "address.delete" + } + } + }, + "traits": { + "smithy.api#documentation": "Description of the event that triggered the notification.\n* `order.create` - always value for OrderCreatePayload.topic ref\n* `order.update` - always value for OrderUpdatePayload.topic\n* `extension.uninstall` - always value for ExtensionUninstallPayload.topic\n* `contact.create` - always value for ContactCreatePayload.topic\n* `contact.update` - always value for ContactUpdatePayload.topic\n* `contact.delete` - always value for ContactDeletePayload.topic\n* `address.create` - always value for AddressCreatePayload.topic\n* `address.update` - always value for AddressUpdatePayload.topic\n* `address.delete` - always value for AddressDeletePayload.topic\n" + } + }, + "com.squarespace.api#ExternalCreateWebhookSubscriptionResponseTopicsList": { + "type": "list", + "member": { + "target": "com.squarespace.api#ExternalCreateWebhookSubscriptionResponseTopicsItem" + }, + "traits": { + "smithy.api#documentation": "List of event topics that trigger a webhook notification." + } + }, + "com.squarespace.api#CreateWebhookSubscription": { + "type": "operation", + "input": { + "target": "com.squarespace.api#CreateWebhookSubscriptionRequest" + }, + "output": { + "target": "com.squarespace.api#ExternalCreateWebhookSubscriptionResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#NotFound" + }, + { + "target": "com.squarespace.api#Conflict" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/1.0/webhook_subscriptions", + "code": 200 + }, + "smithy.api#documentation": "Create webhook subscription\n\nCreates a webhook subscription. A successful request returns the created Webhook Subscription resource. Requires an OAuth access token; API keys are not supported. The OAuth token must hold scopes appropriate for each subscribed event topic: order.create and order.update require website.orders or website.orders.read; contact.create, contact.update, contact.delete, address.create, address.update, and address.delete require website.contacts; extension.uninstall requires no event-specific scope." + } + }, + "com.squarespace.api#GetWebhookSubscriptionRequest": { + "type": "structure", + "members": { + "subscriptionId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "Specifies the Webhook Subscription to retrieve." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#GetWebhookSubscription": { + "type": "operation", + "input": { + "target": "com.squarespace.api#GetWebhookSubscriptionRequest" + }, + "output": { + "target": "com.squarespace.api#ExternalWebhookSubscriptionResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/1.0/webhook_subscriptions/{subscriptionId}", + "code": 200 + }, + "smithy.api#documentation": "Get webhook subscription\n\nRetrieves information for a specific webhook subscription. Requires an OAuth access token; API keys are not supported." + } + }, + "com.squarespace.api#UpdateWebhookSubscriptionRequest": { + "type": "structure", + "members": { + "subscriptionId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "Specifies the Webhook Subscription to update." + } + }, + "endpointUrl": { + "target": "com.squarespace.api#ChangeString" + }, + "topics": { + "target": "com.squarespace.api#ChangeListString" + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#UpdateWebhookSubscription": { + "type": "operation", + "input": { + "target": "com.squarespace.api#UpdateWebhookSubscriptionRequest" + }, + "output": { + "target": "com.squarespace.api#ExternalWebhookSubscriptionResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/1.0/webhook_subscriptions/{subscriptionId}", + "code": 200 + }, + "smithy.api#documentation": "Update webhook subscription\n\nUpdates information for a webhook subscription. A successful request returns the updated Webhook Subscription resource. Requires an OAuth access token; API keys are not supported. The OAuth token must hold scopes appropriate for each subscribed event topic: order.create and order.update require website.orders or website.orders.read; contact.create, contact.update, contact.delete, address.create, address.update, and address.delete require website.contacts; extension.uninstall requires no event-specific scope." + } + }, + "com.squarespace.api#DeleteWebhookSubscriptionRequest": { + "type": "structure", + "members": { + "subscriptionId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "Specifies the Webhook Subscription to delete." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#DeleteWebhookSubscription": { + "type": "operation", + "input": { + "target": "com.squarespace.api#DeleteWebhookSubscriptionRequest" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "DELETE", + "uri": "/1.0/webhook_subscriptions/{subscriptionId}", + "code": 200 + }, + "smithy.api#documentation": "Delete webhook subscription\n\nDeletes a webhook subscription. Requires an OAuth access token; API keys are not supported." + } + }, + "com.squarespace.api#RotateSubscriptionSecretRequest": { + "type": "structure", + "members": { + "subscriptionId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "Specifies the Webhook Subscription to update." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#ExternalRotateSecretResponse": { + "type": "structure", + "members": { + "secret": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Hexadecimal value used to generate a signature for a webhook notification; field is only returned when creating a new subscription or rotating a secret. Store the secret in a safe location to verify notifications from Squarespace.", + "smithy.api#sensitive": {} + } + } + }, + "traits": {} + }, + "com.squarespace.api#RotateSubscriptionSecret": { + "type": "operation", + "input": { + "target": "com.squarespace.api#RotateSubscriptionSecretRequest" + }, + "output": { + "target": "com.squarespace.api#ExternalRotateSecretResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/1.0/webhook_subscriptions/{subscriptionId}/actions/rotateSecret", + "code": 200 + }, + "smithy.api#documentation": "Rotate webhook subscription secret\n\nRotates a webhook subscription's secret. The previous secret for a subscription is no longer valid after a new one is generated. Requires an OAuth access token; API keys are not supported." + } + }, + "com.squarespace.api#SendTestNotificationForWebhookSubscriptionRequest": { + "type": "structure", + "members": { + "subscriptionId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "Specifies the Webhook Subscription to send a notification to." + } + }, + "topic": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Required; Squarespace event topic that triggers a webhook notification. Possible values include: extension.uninstall, order.create, order.update.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.squarespace.api#ExternalTestNotificationResponse": { + "type": "structure", + "members": { + "statusCode": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Status code returned by the subscribed webhook endpoint." + } + } + }, + "traits": {} + }, + "com.squarespace.api#SendTestNotificationForWebhookSubscription": { + "type": "operation", + "input": { + "target": "com.squarespace.api#SendTestNotificationForWebhookSubscriptionRequest" + }, + "output": { + "target": "com.squarespace.api#ExternalTestNotificationResponse" + }, + "errors": [ + { + "target": "com.squarespace.api#BadRequest" + }, + { + "target": "com.squarespace.api#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/1.0/webhook_subscriptions/{subscriptionId}/actions/sendTestNotification", + "code": 200 + }, + "smithy.api#documentation": "Send test notification\n\nSends a notification to a subscribed webhook endpoint for testing purposes. This is a one-time notification, and will not be retried if it fails or times out. Requires an OAuth access token; API keys are not supported." + } + }, + "com.squarespace.api#BadRequest": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#error": "client", + "smithy.api#httpError": 400, + "com.distilled.openapi#errorMatchers": [ + { + "status": 400 + } + ] + } + }, + "com.squarespace.api#Forbidden": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#error": "client", + "smithy.api#httpError": 403, + "com.distilled.openapi#errorMatchers": [ + { + "status": 403 + } + ] + } + }, + "com.squarespace.api#Conflict": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#error": "client", + "smithy.api#httpError": 409, + "com.distilled.openapi#errorMatchers": [ + { + "status": 409 + } + ] + } + }, + "com.squarespace.api#NotFound": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#error": "client", + "smithy.api#httpError": 404, + "com.distilled.openapi#errorMatchers": [ + { + "status": 404 + } + ] + } + }, + "com.squarespace.api#Squarespace": { + "type": "service", + "version": "2", + "operations": [ + { + "target": "com.squarespace.api#GetTransactionsSummaries" + }, + { + "target": "com.squarespace.api#ListDiscounts" + }, + { + "target": "com.squarespace.api#CreateDiscount" + }, + { + "target": "com.squarespace.api#GetDiscount" + }, + { + "target": "com.squarespace.api#UpdateDiscount" + }, + { + "target": "com.squarespace.api#DeleteDiscount" + }, + { + "target": "com.squarespace.api#GetContacts" + }, + { + "target": "com.squarespace.api#CreateContact" + }, + { + "target": "com.squarespace.api#QueryContacts" + }, + { + "target": "com.squarespace.api#GetContact" + }, + { + "target": "com.squarespace.api#UpdateContact" + }, + { + "target": "com.squarespace.api#DeleteContact" + }, + { + "target": "com.squarespace.api#GetAddressBook" + }, + { + "target": "com.squarespace.api#CreateAddressBookEntry" + }, + { + "target": "com.squarespace.api#GetAddressBookEntry" + }, + { + "target": "com.squarespace.api#UpdateAddressBookEntry" + }, + { + "target": "com.squarespace.api#DeleteAddressBookEntry" + }, + { + "target": "com.squarespace.api#GetFulfillmentOptions" + }, + { + "target": "com.squarespace.api#GetProducts" + }, + { + "target": "com.squarespace.api#CreateProduct" + }, + { + "target": "com.squarespace.api#GetSpecificProducts" + }, + { + "target": "com.squarespace.api#UpdateProduct" + }, + { + "target": "com.squarespace.api#DeleteProduct" + }, + { + "target": "com.squarespace.api#UploadProductImage" + }, + { + "target": "com.squarespace.api#UpdateProductImage" + }, + { + "target": "com.squarespace.api#DeleteProductImage" + }, + { + "target": "com.squarespace.api#UpdateProductImageOrder" + }, + { + "target": "com.squarespace.api#GetProductImageProcessingStatus" + }, + { + "target": "com.squarespace.api#CreateProductVariant" + }, + { + "target": "com.squarespace.api#UpdateProductVariant" + }, + { + "target": "com.squarespace.api#DeleteProductVariant" + }, + { + "target": "com.squarespace.api#AssociateProductVariantImage" + }, + { + "target": "com.squarespace.api#GetMemberProfile" + }, + { + "target": "com.squarespace.api#GetWebsiteProfile" + }, + { + "target": "com.squarespace.api#GetInventoryItems" + }, + { + "target": "com.squarespace.api#AdjustInventoryStockLevels" + }, + { + "target": "com.squarespace.api#GetSpecificInventoryItems" + }, + { + "target": "com.squarespace.api#GetOrders" + }, + { + "target": "com.squarespace.api#CreateOrder" + }, + { + "target": "com.squarespace.api#GetOrder" + }, + { + "target": "com.squarespace.api#FulfillOrder" + }, + { + "target": "com.squarespace.api#GetStorePages" + }, + { + "target": "com.squarespace.api#GetDocumentsByUpdatedOn" + }, + { + "target": "com.squarespace.api#GetDocumentsById" + }, + { + "target": "com.squarespace.api#GetProfiles" + }, + { + "target": "com.squarespace.api#GetSpecificProfiles" + }, + { + "target": "com.squarespace.api#GetWebhookSubscriptions" + }, + { + "target": "com.squarespace.api#CreateWebhookSubscription" + }, + { + "target": "com.squarespace.api#GetWebhookSubscription" + }, + { + "target": "com.squarespace.api#UpdateWebhookSubscription" + }, + { + "target": "com.squarespace.api#DeleteWebhookSubscription" + }, + { + "target": "com.squarespace.api#RotateSubscriptionSecret" + }, + { + "target": "com.squarespace.api#SendTestNotificationForWebhookSubscription" + } + ], + "traits": { + "smithy.api#title": "Commerce API" + } + } + } +} diff --git a/packages/squarespace/package.json b/packages/squarespace/package.json new file mode 100644 index 000000000..372fa3f89 --- /dev/null +++ b/packages/squarespace/package.json @@ -0,0 +1,85 @@ +{ + "name": "@distilled.cloud/squarespace", + "version": "1.0.0-rc.8", + "repository": { + "type": "git", + "url": "https://github.com/alchemy-run/distilled", + "directory": "packages/squarespace" + }, + "license": "Apache-2.0", + "type": "module", + "sideEffects": false, + "files": [ + "lib", + "src" + ], + "exports": { + ".": { + "types": "./lib/index.d.ts", + "bun": "./src/index.ts", + "worker": "./src/index.ts", + "default": "./lib/index.js" + }, + "./Credentials": { + "types": "./lib/credentials.d.ts", + "bun": "./src/credentials.ts", + "worker": "./src/credentials.ts", + "default": "./lib/credentials.js" + }, + "./Errors": { + "types": "./lib/errors.d.ts", + "bun": "./src/errors.ts", + "worker": "./src/errors.ts", + "default": "./lib/errors.js" + }, + "./Traits": { + "types": "./lib/traits.d.ts", + "bun": "./src/traits.ts", + "worker": "./src/traits.ts", + "default": "./lib/traits.js" + }, + "./Pagination": { + "types": "./lib/pagination.d.ts", + "bun": "./src/pagination.ts", + "worker": "./src/pagination.ts", + "default": "./lib/pagination.js" + }, + "./Protocol": { + "types": "./lib/protocol.d.ts", + "bun": "./src/protocol.ts", + "worker": "./src/protocol.ts", + "default": "./lib/protocol.js" + }, + "./Retry": { + "types": "./lib/retry.d.ts", + "bun": "./src/retry.ts", + "worker": "./src/retry.ts", + "default": "./lib/retry.js" + }, + "./*": { + "types": "./lib/services/*.d.ts", + "bun": "./src/services/*.ts", + "worker": "./src/services/*.ts", + "default": "./lib/services/*.js" + } + }, + "scripts": { + "build": "tsc -b", + "convert": "bun scripts/convert.ts", + "generate": "bun scripts/convert.ts && bun scripts/generate.ts", + "typecheck": "tsc -p tsconfig.json", + "specs:fetch": "git submodule update --force --init --depth=1 specs/spec-mirror-squarespace", + "specs:update": "git submodule update --remote --force --depth=1 specs/spec-mirror-squarespace" + }, + "dependencies": { + "@distilled.cloud/core": "workspace:*" + }, + "devDependencies": { + "@types/bun": "catalog:tooling", + "@types/node": "catalog:tooling", + "@effect/platform-bun": "catalog:effect" + }, + "peerDependencies": { + "effect": "catalog:effect" + } +} diff --git a/packages/squarespace/scripts/convert.ts b/packages/squarespace/scripts/convert.ts new file mode 100644 index 000000000..d9b91bf1a --- /dev/null +++ b/packages/squarespace/scripts/convert.ts @@ -0,0 +1,78 @@ +#!/usr/bin/env bun +/** + * convert — turn the Squarespace Commerce OpenAPI spec into a Smithy 2.0 + * JSON model. + * + * Input: specs/spec-mirror-squarespace/specs/openapi.json (spec submodule) + * patches/*.patch.json (RFC-6902 patches to the OpenAPI document) + * Output: .generated-specs/squarespace.json + * + * The OpenAPI→Smithy converter lives in + * `@distilled.cloud/core/codegen/openapi`; this script is Squarespace's + * pipeline config. `scripts/generate.ts` compiles the model into src/services. + */ +import * as path from "node:path"; +import { runOpenApiConvert } from "@distilled.cloud/core/codegen/openapi-cli"; + +const HTTP_METHODS = ["get", "post", "put", "patch", "delete"] as const; + +/** + * Squarespace declares `Authorization` and `User-Agent` as required + * operation headers. The protocol injects both from credentials, so they + * are dropped before conversion. `Idempotency-Key` stays as a per-call + * input (`headerParams: true`). + */ +const PROTOCOL_HEADERS = new Set(["Authorization", "User-Agent"]); + +const dropProtocolHeaders = (spec: any): void => { + const isProtocolHeader = (p: unknown): boolean => + !!p && + typeof p === "object" && + (p as { in?: unknown; name?: unknown }).in === "header" && + typeof (p as { name?: unknown }).name === "string" && + PROTOCOL_HEADERS.has((p as { name: string }).name); + + const filterList = (params: unknown): unknown => + Array.isArray(params) ? params.filter((p) => !isProtocolHeader(p)) : params; + + if (spec.components?.parameters) { + for (const [key, p] of Object.entries(spec.components.parameters)) { + if (isProtocolHeader(p)) delete spec.components.parameters[key]; + } + } + + for (const pathItem of Object.values(spec.paths ?? {})) { + if (!pathItem || typeof pathItem !== "object") continue; + if (Array.isArray(pathItem.parameters)) { + pathItem.parameters = filterList(pathItem.parameters); + } + for (const method of HTTP_METHODS) { + const op = pathItem[method]; + if (!op || typeof op !== "object") continue; + if (Array.isArray(op.parameters)) { + op.parameters = filterList(op.parameters); + } + } + } +}; + +await runOpenApiConvert({ + root: path.resolve(import.meta.dir, ".."), + specs: [ + { + name: "squarespace", + specPath: "specs/spec-mirror-squarespace/specs/openapi.json", + preprocess: dropProtocolHeaders, + }, + ], + // OpenAPI-document patches (flat patches/*.patch.json). The smithy-model + // patch chain in generate.ts is disabled (`patchesDir: false`). + patchesDir: "patches", + options: { + namespace: "com.squarespace.api", + serviceName: "Squarespace", + skipDeprecated: true, + // Idempotency-Key is a real per-call input on a few write endpoints. + headerParams: true, + }, +}); diff --git a/packages/squarespace/scripts/generate.ts b/packages/squarespace/scripts/generate.ts new file mode 100644 index 000000000..5b008281a --- /dev/null +++ b/packages/squarespace/scripts/generate.ts @@ -0,0 +1,129 @@ +#!/usr/bin/env bun +/** + * generate — turn the Smithy JSON model in .generated-specs into the + * Squarespace Effect SDK. + * + * Input: .generated-specs/squarespace.json (written by scripts/convert.ts) + * Output: src/services/squarespace.ts + src/services/index.ts + * + * The smithy→SDK compiler and CLI pipeline live in + * `@distilled.cloud/core/codegen`; this script is Squarespace's provider spec. + * Squarespace keeps the wire's camelCase member names on the TS surface, so + * no member renaming or wire dictionaries appear here. + */ +import type { SdkSpec } from "@distilled.cloud/core/codegen/generator"; +import { runGeneratorCli } from "@distilled.cloud/core/codegen/cli"; + +const NULLABLE_TRAIT = "com.distilled.openapi#nullable"; +const ERROR_MATCHERS_TRAIT = "com.distilled.openapi#errorMatchers"; +const RAW_RESPONSE_TRAIT = "com.distilled.openapi#rawResponse"; +const SENSITIVE_TRAIT = "smithy.api#sensitive"; +const PAGINATED_TRAIT = "smithy.api#paginated"; + +/** Squarespace's provider spec for the shared smithy→SDK compiler. */ +const squarespaceSpec: SdkSpec = { + nullableTrait: NULLABLE_TRAIT, + errorMatchersTrait: ERROR_MATCHERS_TRAIT, + + extraBindings: [ + { + // Sole member of a synthesized wrapper for bare array/scalar response + // bodies; as the response's only member, the response IS the payload. + trait: RAW_RESPONSE_TRAIT, + binding: "rawResponse", + pipe: "T.RawResponse()", + rootPipe: "T.RawResponseRoot()", + }, + ], + + // Sensitive strings (tokens, secrets): the schema member carries + // T.SensitiveValue; the REST protocol delivers Redacted values and accepts + // string | Redacted on input. + memberTraitPipes: { + [SENSITIVE_TRAIT]: "T.SensitiveValue", + }, + memberTsType: (m) => + SENSITIVE_TRAIT in m.traits + ? `string | Redacted.Redacted${m.nullable ? " | null" : ""}` + : undefined, + + // Unions surface as TS type unions over an opaque schema — the REST + // protocol passes union content through verbatim (wire names ARE the TS + // names for Squarespace), so no runtime case discrimination is needed. + union: ({ name, caseTargets, tsRef }) => [ + `export type ${name} = ${caseTargets.map(tsRef).join(" | ") || "unknown"};`, + `export const ${name} = /*@__PURE__*/ S.Unknown as any as S.Schema<${name}>;\n`, + ], + + // One pagination profile: Squarespace's cursor mode (inputToken `cursor`, + // outputToken `pagination.nextPageCursor`), traversed by core's + // paginateCursor. The shared OpenAPI converter only detects + // `pagination.cursor` / `.next` / `.next_page`, so the trait is stamped + // below. + paginationProfiles: { + cursor: { + strategy: "paginateCursor", + itemsFallback: "items", + }, + }, + + operationDecl: { + contextType: "SquarespaceOpContext", + commonErrorType: "SquarespaceOpError", + commonErrorClasses: ["UnknownSquarespaceError"], + protocol: "SquarespaceProtocol", + retry: "Retry.Retry", + }, + + sourceNote: ".generated-specs (specs/spec-mirror-squarespace)", + + // Sensitive member types reference Redacted; pull the import in when used. + postProcess: (code) => + code.includes("Redacted.Redacted<") + ? code.replace( + `import * as S from "@distilled.cloud/core/schema";\n`, + `import * as S from "@distilled.cloud/core/schema";\nimport * as Redacted from "effect/Redacted";\n`, + ) + : code, +}; + +const itemsMember = ( + shapes: Record, + output: any, +): string | undefined => { + for (const [name, member] of Object.entries(output?.members ?? {})) { + if (name === "pagination") continue; + const target = shapes[member?.target]; + if (target?.type === "list") return name; + } + return undefined; +}; + +runGeneratorCli({ + description: "Generate the Squarespace Effect SDK from the Smithy model", + root: `${import.meta.dir}/..`, + // patches/ holds OpenAPI-document patches consumed by scripts/convert.ts; + // there is no smithy-model patch chain. + patchesDir: false, + spec: (model) => { + const shapes = (model.shapes ?? {}) as Record; + for (const shape of Object.values(shapes)) { + if (shape?.type !== "operation") continue; + if (shape.traits?.[PAGINATED_TRAIT]) continue; + const input = shapes[shape.input?.target]; + const output = shapes[shape.output?.target]; + if (!input?.members?.cursor || !output?.members?.pagination) continue; + const items = itemsMember(shapes, output); + if (!items) continue; + shape.traits ??= {}; + shape.traits[PAGINATED_TRAIT] = { + mode: "cursor", + inputToken: "cursor", + outputToken: "pagination.nextPageCursor", + items, + ...(input.members.pageSize ? { pageSize: "pageSize" } : {}), + }; + } + return squarespaceSpec; + }, +}); diff --git a/packages/squarespace/src/credentials.ts b/packages/squarespace/src/credentials.ts new file mode 100644 index 000000000..1aad9fe10 --- /dev/null +++ b/packages/squarespace/src/credentials.ts @@ -0,0 +1,70 @@ +/** + * Squarespace credentials — hand-written. + * + * API-compatible port of the distilled v0-style credentials module: the + * `Credentials` service holds an *effect* that resolves the current + * credentials on every request (the protocol layer resolves it per request + * on the calling fiber). + * + * Commerce APIs accept an API key or OAuth access token as + * `Authorization: Bearer …`. Requests without a User-Agent are rejected. + */ +import * as Context from "effect/Context"; +import * as Effect from "effect/Effect"; +import * as Layer from "effect/Layer"; +import * as Redacted from "effect/Redacted"; +import { ConfigError } from "@distilled.cloud/core/errors"; + +export const DEFAULT_API_BASE_URL = "https://api.squarespace.com"; + +/** + * Squarespace rejects requests without a User-Agent and rate-limits + * generic client defaults more strictly. + */ +export const DEFAULT_USER_AGENT = "distilled.cloud-squarespace"; + +export interface Config { + readonly apiKey: Redacted.Redacted; + readonly apiBaseUrl: string; + readonly userAgent: string; +} + +export class Credentials extends Context.Service< + Credentials, + Effect.Effect +>()("SquarespaceCredentials") {} + +/** Layer from a plain API key + optional base URL / User-Agent. */ +export const fromApiKey = (config: { + readonly apiKey: string; + readonly apiBaseUrl?: string; + readonly userAgent?: string; +}): Layer.Layer => + Layer.succeed( + Credentials, + Effect.succeed({ + apiKey: Redacted.make(config.apiKey), + apiBaseUrl: config.apiBaseUrl ?? DEFAULT_API_BASE_URL, + userAgent: config.userAgent ?? DEFAULT_USER_AGENT, + }), + ); + +/** Reads SQUARESPACE_API_KEY (required) and optional base URL / User-Agent. */ +export const CredentialsFromEnv: Layer.Layer = Layer.succeed( + Credentials, + Effect.gen(function* () { + const apiKey = process.env.SQUARESPACE_API_KEY; + + if (!apiKey) { + return yield* new ConfigError({ + message: "SQUARESPACE_API_KEY environment variable is required", + }); + } + + return { + apiKey: Redacted.make(apiKey), + apiBaseUrl: process.env.SQUARESPACE_API_BASE_URL ?? DEFAULT_API_BASE_URL, + userAgent: process.env.SQUARESPACE_USER_AGENT ?? DEFAULT_USER_AGENT, + }; + }).pipe(Effect.orDie), +); diff --git a/packages/squarespace/src/errors.ts b/packages/squarespace/src/errors.ts new file mode 100644 index 000000000..473cec152 --- /dev/null +++ b/packages/squarespace/src/errors.ts @@ -0,0 +1,50 @@ +/** + * Squarespace-specific error types. + * + * Re-exports the common HTTP errors from core and adds the Squarespace + * fallback errors. Note the generated service module additionally defines + * its own per-status matcher classes (BadRequest/NotFound/…) for the + * statuses each operation declares — those share `_tag`s with the core + * classes here, so `catchTag` works against either. + */ +export { + BadGateway, + BadRequest, + Conflict, + ConfigError, + Forbidden, + GatewayTimeout, + InternalServerError, + Locked, + NotFound, + ServiceUnavailable, + TooManyRequests, + Unauthorized, + UnprocessableEntity, + HTTP_STATUS_MAP, + DEFAULT_ERRORS, + API_ERRORS, +} from "@distilled.cloud/core/errors"; +export type { DefaultErrors } from "@distilled.cloud/core/errors"; + +import * as Schema from "effect/Schema"; +import * as Category from "@distilled.cloud/core/category"; + +/** Unknown Squarespace error — returned when nothing else matches the failure. */ +export class UnknownSquarespaceError extends Schema.TaggedError()( + "UnknownSquarespaceError", + { + code: Schema.optional(Schema.String), + message: Schema.optional(Schema.String), + body: Schema.Unknown, + }, +).pipe(Category.withServerError) {} + +/** Schema parse error wrapper (kept for v0 surface parity). */ +export class SquarespaceParseError extends Schema.TaggedError()( + "SquarespaceParseError", + { + body: Schema.Unknown, + cause: Schema.Unknown, + }, +).pipe(Category.withParseError) {} diff --git a/packages/squarespace/src/index.ts b/packages/squarespace/src/index.ts new file mode 100644 index 000000000..2c0c48891 --- /dev/null +++ b/packages/squarespace/src/index.ts @@ -0,0 +1,36 @@ +/** + * @distilled.cloud/squarespace — Squarespace Commerce SDK for Effect. + * + * `./services` is generated by `scripts/generate.ts` from the Smithy model + * in `.generated-specs` (written by `scripts/convert.ts` from the OpenAPI + * spec). Everything else in this folder is hand-written. + * + * @example + * ```ts + * import * as Squarespace from "@distilled.cloud/squarespace"; + * + * const products = yield* Squarespace.Services.squarespace.getProducts({}); + * ``` + */ +export * from "./credentials.ts"; +export * from "./errors.ts"; +export * as T from "./traits.ts"; +export { + SquarespaceProtocol, + type SquarespaceOpError, + type SquarespaceOpContext, +} from "./protocol.ts"; +export { paginateCursor } from "./pagination.ts"; +export * as Retry from "./retry.ts"; +export * as Services from "./services/index.ts"; +// Operations (and their request/response types) are importable straight off +// the package root. The service-local typed error classes shadow the +// same-named shared ones from ./errors.ts — the ops actually raise the +// service-local classes. +export * from "./services/squarespace.ts"; +export { + BadRequest, + Conflict, + Forbidden, + NotFound, +} from "./services/squarespace.ts"; diff --git a/packages/squarespace/src/pagination.ts b/packages/squarespace/src/pagination.ts new file mode 100644 index 000000000..a53886f12 --- /dev/null +++ b/packages/squarespace/src/pagination.ts @@ -0,0 +1,8 @@ +/** + * Squarespace pagination — hand-written. + * + * Squarespace's paginated list operations are cursor-mode (`cursor` in, + * `pagination.nextPageCursor` out); generated operations pass core's + * {@link paginateCursor} strategy to `API.makePaginated`. + */ +export { paginateCursor } from "@distilled.cloud/core/pagination"; diff --git a/packages/squarespace/src/protocol.ts b/packages/squarespace/src/protocol.ts new file mode 100644 index 000000000..9e8ed3042 --- /dev/null +++ b/packages/squarespace/src/protocol.ts @@ -0,0 +1,90 @@ +/** + * SquarespaceProtocol — hand-written. + * + * Squarespace Commerce APIs speak bearer-authenticated JSON REST (no + * response envelope), so the whole protocol is one `makeRestProtocol` call + * from `core/protocol-rest`: + * + * request: credentials → `Authorization: Bearer ` + `User-Agent` + * + base URL (default https://api.squarespace.com), resolved + * from the calling fiber on every request + * + * response: 2xx JSON is the payload (sensitive members delivered as + * `Redacted`); non-2xx `{ type?, subtype?, message }` bodies map + * to the operation's typed error classes by status, then the + * shared HTTP-status classes, then {@link UnknownSquarespaceError}. + */ +import * as Effect from "effect/Effect"; +import type * as Layer from "effect/Layer"; +import * as Redacted from "effect/Redacted"; +import type * as HttpClient from "effect/unstable/http/HttpClient"; +import type * as HttpClientError from "effect/unstable/http/HttpClientError"; +import type * as API from "@distilled.cloud/core/api"; +import { + makeRestProtocol, + type RestErrorEnvelope, +} from "@distilled.cloud/core/protocol-rest"; +import type { API_ERRORS, ConfigError } from "@distilled.cloud/core/errors"; +import { Credentials, type Config } from "./credentials.ts"; +import { UnknownSquarespaceError } from "./errors.ts"; + +/** + * Error channel shared by every generated Squarespace operation. Generated + * service files annotate operations with `API.OperationMethod` explicitly so the compiler + * never infers these back out of the schema generics. + */ +export type SquarespaceOpError = + | InstanceType<(typeof API_ERRORS)[number]> + | UnknownSquarespaceError + | ConfigError + | HttpClientError.HttpClientError; + +/** Context (requirements) shared by every generated Squarespace operation. */ +export type SquarespaceOpContext = Credentials | HttpClient.HttpClient; + +/** + * Squarespace error bodies are `{ type, subtype?, message, contextId?, + * details? }`. `subtype` is the machine-readable code when present. + */ +const errorEnvelope = (body: unknown): RestErrorEnvelope | undefined => { + if (body === null || typeof body !== "object") return undefined; + const b = body as Record; + const message = typeof b.message === "string" ? b.message : undefined; + const code = + typeof b.subtype === "string" + ? b.subtype + : typeof b.type === "string" + ? b.type + : typeof b.code === "string" || typeof b.code === "number" + ? b.code + : undefined; + return { code, message }; +}; + +export const SquarespaceProtocol: Layer.Layer = + makeRestProtocol({ + // The Credentials service holds an effect — resolving it here (per + // request, on the calling fiber) picks up context-provided credentials. + credentials: Effect.gen(function* () { + const resolve = yield* Credentials; + return yield* resolve; + }), + baseUrl: (creds) => creds.apiBaseUrl, + headers: (creds) => ({ + Authorization: `Bearer ${Redacted.value(creds.apiKey)}`, + "User-Agent": creds.userAgent, + }), + errorEnvelope, + unknownError: ({ code, message, body }) => + new UnknownSquarespaceError({ + code: + typeof code === "string" + ? code + : code !== undefined + ? String(code) + : undefined, + message, + body, + }), + }); diff --git a/packages/squarespace/src/retry.ts b/packages/squarespace/src/retry.ts new file mode 100644 index 000000000..681ee0ffd --- /dev/null +++ b/packages/squarespace/src/retry.ts @@ -0,0 +1,56 @@ +/** + * Squarespace retry configuration. + * + * Defines the per-SDK `Retry` Context.Service tag that generated operations + * wire into `API.make`. Callers can install a blanket retry policy at the + * layer level and have every Squarespace API call below it pick it up: + * + * @example + * ```ts + * import * as Squarespace from "@distilled.cloud/squarespace"; + * + * myEffect.pipe(Squarespace.Retry.transient); + * Effect.provide(myEffect, Layer.succeed(Squarespace.Retry.Retry, customPolicy)); + * ``` + */ +import * as Context from "effect/Context"; +import * as Effect from "effect/Effect"; +import * as Layer from "effect/Layer"; +import { + type Policy, + throttlingFactory, + transientFactory, +} from "@distilled.cloud/core/retry"; + +export { + type Options, + type Factory, + type Policy, + makeDefault, + jittered, + capped, + throttlingOptions, + transientOptions, + throttlingFactory, + transientFactory, +} from "@distilled.cloud/core/retry"; + +/** Context tag for configuring retry behavior of Squarespace API calls. */ +export class Retry extends Context.Service()( + "SquarespaceRetry", +) {} + +/** Provides a custom retry policy to every Squarespace API call below it. */ +export const policy = (optionsOrFactory: Policy) => + Effect.provide(Layer.succeed(Retry, optionsOrFactory)); + +/** Disables all automatic retries. */ +export const none = Effect.provide( + Layer.succeed(Retry, { while: () => false }), +); + +/** Apply the throttling retry policy (retries throttling errors indefinitely). */ +export const throttling = policy(throttlingFactory); + +/** Apply the transient retry policy (retries all transient errors indefinitely). */ +export const transient = policy(transientFactory); diff --git a/packages/squarespace/src/services/index.ts b/packages/squarespace/src/services/index.ts new file mode 100644 index 000000000..055512867 --- /dev/null +++ b/packages/squarespace/src/services/index.ts @@ -0,0 +1,2 @@ +// AUTO-GENERATED by scripts/generate.ts. Do not edit. +export * as squarespace from "./squarespace.ts"; diff --git a/packages/squarespace/src/services/squarespace.ts b/packages/squarespace/src/services/squarespace.ts new file mode 100644 index 000000000..0d80d2e3f --- /dev/null +++ b/packages/squarespace/src/services/squarespace.ts @@ -0,0 +1,5935 @@ +// AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-squarespace). Do not edit. +import * as S from "@distilled.cloud/core/schema"; +import * as Redacted from "effect/Redacted"; +import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; +import * as T from "../traits.ts"; +import { + SquarespaceProtocol, + type SquarespaceOpError, + type SquarespaceOpContext, +} from "../protocol.ts"; +import { paginateCursor } from "../pagination.ts"; +import { UnknownSquarespaceError } from "../errors.ts"; +import * as Retry from "../retry.ts"; + +export type { SquarespaceOpError, SquarespaceOpContext }; + +export class BadRequest + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BadRequest", { + code: S.Number, + message: S.String, + }).pipe(C.withBadRequestError), + [{ status: 400 }], + ) {} + +export class Conflict + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("Conflict", { + code: S.Number, + message: S.String, + }).pipe(C.withConflictError), + [{ status: 409 }], + ) {} + +export class Forbidden + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("Forbidden", { + code: S.Number, + message: S.String, + }).pipe(C.withAuthError), + [{ status: 403 }], + ) {} + +export class NotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotFound", { + code: S.Number, + message: S.String, + }).pipe(C.withBadRequestError), + [{ status: 404 }], + ) {} + +/** Optional; array of objects. Sets the exact stock quantity for InventoryItems. */ +export interface InventoryQuantityExpression { + /** Quantity value for the inventory operation. */ + quantity?: number; + /** Unique id for the InventoryItem. */ + variantId?: string; +} +export const InventoryQuantityExpression = /*@__PURE__*/ S.suspend(() => + S.Struct({ + quantity: S.optional(S.Number), + variantId: S.optional(S.String), + }), +).annotate({ + identifier: "InventoryQuantityExpression", +}) as any as S.Schema; + +/** Optional; array of objects. Subtracts stock quantity for InventoryItems. */ +export type AdjustInventoryStockLevelsRequestDecrementOperationsList = + Array; +export const AdjustInventoryStockLevelsRequestDecrementOperationsList = + /*@__PURE__*/ S.Array( + InventoryQuantityExpression, + ) as any as S.Schema; + +/** Optional; array of objects. Increments stock quantity for InventoryItems. */ +export type AdjustInventoryStockLevelsRequestIncrementOperationsList = + Array; +export const AdjustInventoryStockLevelsRequestIncrementOperationsList = + /*@__PURE__*/ S.Array( + InventoryQuantityExpression, + ) as any as S.Schema; + +/** Optional; array of objects. Sets the exact stock quantity for InventoryItems. */ +export type AdjustInventoryStockLevelsRequestSetFiniteOperationsList = + Array; +export const AdjustInventoryStockLevelsRequestSetFiniteOperationsList = + /*@__PURE__*/ S.Array( + InventoryQuantityExpression, + ) as any as S.Schema; + +/** Optional; array of InventoryItem ids. Marks stock quantity as "unlimited" for the given InventoryItems. */ +export type AdjustInventoryStockLevelsRequestSetUnlimitedOperationsList = + Array; +export const AdjustInventoryStockLevelsRequestSetUnlimitedOperationsList = + /*@__PURE__*/ S.Array( + S.String, + ) as any as S.Schema; + +export interface AdjustInventoryStockLevelsRequest { + /** Required for idempotent requests. Refer to the idempotency key guide for requirements. */ + idempotencyKey: string; + /** Optional; array of objects. Subtracts stock quantity for InventoryItems. */ + decrementOperations?: AdjustInventoryStockLevelsRequestDecrementOperationsList; + /** Optional; array of objects. Increments stock quantity for InventoryItems. */ + incrementOperations?: AdjustInventoryStockLevelsRequestIncrementOperationsList; + /** Optional; array of objects. Sets the exact stock quantity for InventoryItems. */ + setFiniteOperations?: AdjustInventoryStockLevelsRequestSetFiniteOperationsList; + /** Optional; array of InventoryItem ids. Marks stock quantity as "unlimited" for the given InventoryItems. */ + setUnlimitedOperations?: AdjustInventoryStockLevelsRequestSetUnlimitedOperationsList; +} +export const AdjustInventoryStockLevelsRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + idempotencyKey: S.String.pipe(T.Header("Idempotency-Key")), + decrementOperations: S.optional( + AdjustInventoryStockLevelsRequestDecrementOperationsList, + ), + incrementOperations: S.optional( + AdjustInventoryStockLevelsRequestIncrementOperationsList, + ), + setFiniteOperations: S.optional( + AdjustInventoryStockLevelsRequestSetFiniteOperationsList, + ), + setUnlimitedOperations: S.optional( + AdjustInventoryStockLevelsRequestSetUnlimitedOperationsList, + ), + }).pipe( + T.Http({ + method: "POST", + uri: "/1.0/commerce/inventory/adjustments", + code: 200, + }), + ), +).annotate({ + identifier: "AdjustInventoryStockLevelsRequest", +}) as any as S.Schema; + +export interface AdjustInventoryStockLevelsResponse {} +export const AdjustInventoryStockLevelsResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({}), +).annotate({ + identifier: "AdjustInventoryStockLevelsResponse", +}) as any as S.Schema; + +/** Optional; HTTPS URL to receive webhook notifications. */ +export interface ChangeString { + present?: boolean; + value?: string; +} +export const ChangeString = /*@__PURE__*/ S.suspend(() => + S.Struct({ + present: S.optional(S.Boolean), + value: S.optional(S.String), + }), +).annotate({ identifier: "ChangeString" }) as any as S.Schema; + +export interface AssociateProductVariantImageRequest { + productId: string; + variantId: string; + imageId: ChangeString; +} +export const AssociateProductVariantImageRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + productId: S.String.pipe(T.Label()), + variantId: S.String.pipe(T.Label()), + imageId: ChangeString, + }).pipe( + T.Http({ + method: "POST", + uri: "/v2/commerce/products/{productId}/variants/{variantId}/image", + code: 200, + }), + ), +).annotate({ + identifier: "AssociateProductVariantImageRequest", +}) as any as S.Schema; + +export interface AssociateProductVariantImageResponse {} +export const AssociateProductVariantImageResponse = /*@__PURE__*/ S.suspend( + () => S.Struct({}), +).annotate({ + identifier: "AssociateProductVariantImageResponse", +}) as any as S.Schema; + +/** ISO 3166 alpha-2 country code string. */ +export type ContactAddressCountryCode = + | "AF" + | "AX" + | "AL" + | "DZ" + | "AS" + | "AD" + | "AO" + | "AI" + | "AQ" + | "AG" + | "AR" + | "AM" + | "AW" + | "AU" + | "AT" + | "AZ" + | "BS" + | "BH" + | "BD" + | "BB" + | "BY" + | "BE" + | "BZ" + | "BJ" + | "BM" + | "BT" + | "BO" + | "BA" + | "BW" + | "BV" + | "BR" + | "IO" + | "BN" + | "BG" + | "BF" + | "BI" + | "BQ" + | "KH" + | "CM" + | "CA" + | "CV" + | "KY" + | "CF" + | "TD" + | "CL" + | "CN" + | "CX" + | "CC" + | "CO" + | "KM" + | "CG" + | "CD" + | "CK" + | "CR" + | "CI" + | "CW" + | "HR" + | "CU" + | "CY" + | "CZ" + | "DK" + | "DJ" + | "DM" + | "DO" + | "EC" + | "EG" + | "SV" + | "GQ" + | "ER" + | "EE" + | "ET" + | "FK" + | "FO" + | "FJ" + | "FI" + | "FR" + | "GF" + | "PF" + | "TF" + | "GA" + | "GM" + | "GE" + | "DE" + | "GH" + | "GI" + | "GR" + | "GL" + | "GD" + | "GP" + | "GU" + | "GT" + | "GG" + | "GN" + | "GW" + | "GY" + | "HT" + | "HM" + | "VA" + | "HN" + | "HK" + | "HU" + | "IS" + | "IN" + | "ID" + | "IR" + | "IQ" + | "IE" + | "IM" + | "IL" + | "IT" + | "JM" + | "JP" + | "JE" + | "JO" + | "KZ" + | "KE" + | "KI" + | "XK" + | "KP" + | "KR" + | "KW" + | "KG" + | "LA" + | "LV" + | "LB" + | "LS" + | "LR" + | "LY" + | "LI" + | "LT" + | "LU" + | "MO" + | "MF" + | "MK" + | "MG" + | "MW" + | "MY" + | "MV" + | "ML" + | "MT" + | "MH" + | "MQ" + | "MR" + | "MU" + | "YT" + | "MX" + | "FM" + | "MD" + | "MC" + | "MN" + | "ME" + | "MS" + | "MA" + | "MZ" + | "MM" + | "NA" + | "NR" + | "NP" + | "NL" + | "AN" + | "NC" + | "NZ" + | "NI" + | "NE" + | "NG" + | "NU" + | "NF" + | "MP" + | "NO" + | "OM" + | "PK" + | "PW" + | "PS" + | "PA" + | "PG" + | "PY" + | "PE" + | "PH" + | "PN" + | "PL" + | "PT" + | "PR" + | "QA" + | "RE" + | "RO" + | "RU" + | "RW" + | "BL" + | "SH" + | "KN" + | "LC" + | "PM" + | "VC" + | "WS" + | "SM" + | "ST" + | "SA" + | "SN" + | "RS" + | "SC" + | "SL" + | "SG" + | "SK" + | "SI" + | "SB" + | "SO" + | "SX" + | "ZA" + | "GS" + | "ES" + | "LK" + | "SD" + | "SR" + | "SJ" + | "SS" + | "SZ" + | "SY" + | "SE" + | "CH" + | "TW" + | "TJ" + | "TZ" + | "TH" + | "TL" + | "TG" + | "TK" + | "TO" + | "TT" + | "TN" + | "TR" + | "TM" + | "TC" + | "TV" + | "UG" + | "UA" + | "AE" + | "GB" + | "US" + | "UM" + | "UY" + | "UZ" + | "VU" + | "VE" + | "VN" + | "VG" + | "VI" + | "WF" + | "EH" + | "YE" + | "ZM" + | "ZW"; +export const ContactAddressCountryCode = /*@__PURE__*/ S.String; + +/** Address properties for a contact. */ +export interface ContactAddress { + /** Address' city */ + city?: string; + /** ISO 3166 alpha-2 country code string. */ + countryCode: ContactAddressCountryCode | (string & {}); + /** Contact's first name */ + firstName?: string; + /** Contact's last name */ + lastName?: string; + /** First line of address */ + line1?: string; + /** Second line of address */ + line2?: string; + /** Contact's phone number */ + phoneNumber?: string; + /** zip/postal code */ + postalCode?: string; + /** General region (State, Province, County, etc...) */ + region?: string; +} +export const ContactAddress = /*@__PURE__*/ S.suspend(() => + S.Struct({ + city: S.optional(S.String), + countryCode: ContactAddressCountryCode, + firstName: S.optional(S.String), + lastName: S.optional(S.String), + line1: S.optional(S.String), + line2: S.optional(S.String), + phoneNumber: S.optional(S.String), + postalCode: S.optional(S.String), + region: S.optional(S.String), + }), +).annotate({ identifier: "ContactAddress" }) as any as S.Schema; + +export interface CreateAddressBookEntryRequest { + /** The contact's ID. */ + contactId: string; + address: ContactAddress; + /** Whether this entry should be the default shipping address. If this is the only address book entry for the contact after creation, it becomes the default even when set to false. */ + defaultShipping?: boolean; +} +export const CreateAddressBookEntryRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + contactId: S.String.pipe(T.Label()), + address: ContactAddress, + defaultShipping: S.optional(S.Boolean), + }).pipe( + T.Http({ + method: "POST", + uri: "/v1/contacts/{contactId}/address-book", + code: 200, + }), + ), +).annotate({ + identifier: "CreateAddressBookEntryRequest", +}) as any as S.Schema; + +/** An address book entry for a contact. */ +export interface AddressBookEntry { + address?: ContactAddress; + /** Whether this entry is the current default shipping address. When the contact has any address book entries, exactly one entry has this value set to true. */ + defaultShipping?: boolean; + /** The address book entry's ID. */ + id?: string; +} +export const AddressBookEntry = /*@__PURE__*/ S.suspend(() => + S.Struct({ + address: S.optional(ContactAddress), + defaultShipping: S.optional(S.Boolean), + id: S.optional(S.String), + }), +).annotate({ + identifier: "AddressBookEntry", +}) as any as S.Schema; + +export interface CreateAddressBookEntryResponse { + addressBookEntry?: AddressBookEntry; +} +export const CreateAddressBookEntryResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + addressBookEntry: S.optional(AddressBookEntry), + }), +).annotate({ + identifier: "CreateAddressBookEntryResponse", +}) as any as S.Schema; + +/** Primary email supplied when creating a contact. */ +export interface CreateEmail { + /** If contact's email accepts marketing */ + acceptsMarketing?: boolean; + /** The email address. */ + email: string; +} +export const CreateEmail = /*@__PURE__*/ S.suspend(() => + S.Struct({ + acceptsMarketing: S.optional(S.Boolean), + email: S.String, + }), +).annotate({ identifier: "CreateEmail" }) as any as S.Schema; + +export interface CreateContactRequest { + /** Contact's first name */ + firstName: string; + /** Contact's last name */ + lastName: string; + /** Contact's locale */ + locale: string; + primaryEmail: CreateEmail; +} +export const CreateContactRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + firstName: S.String, + lastName: S.String, + locale: S.String, + primaryEmail: CreateEmail, + }).pipe(T.Http({ method: "POST", uri: "/v1/contacts", code: 200 })), +).annotate({ + identifier: "CreateContactRequest", +}) as any as S.Schema; + +/** Marketing subscription state for the contact's email. */ +export interface AcceptsMarketing { + /** Whether the contact accepts marketing email. */ + acceptsMarketing?: boolean; + /** The date and time the contact was added to the marketing list.The value returned in the creation response is a near-real-time estimate; the Get Contact endpoint should be used to verify the exact persisted timestamp. */ + joinedOn?: string; + /** The date and time the contact left Marketing list */ + leftOn?: string; +} +export const AcceptsMarketing = /*@__PURE__*/ S.suspend(() => + S.Struct({ + acceptsMarketing: S.optional(S.Boolean), + joinedOn: S.optional(S.String), + leftOn: S.optional(S.String), + }), +).annotate({ + identifier: "AcceptsMarketing", +}) as any as S.Schema; + +/** The contact's primary email. */ +export interface Email { + acceptsMarketing?: AcceptsMarketing; + /** The date and time when the email was created. */ + createdOn?: string; + /** The email address. */ + email?: string; +} +export const Email = /*@__PURE__*/ S.suspend(() => + S.Struct({ + acceptsMarketing: S.optional(AcceptsMarketing), + createdOn: S.optional(S.String), + email: S.optional(S.String), + }), +).annotate({ identifier: "Email" }) as any as S.Schema; + +/** A contact. */ +export interface Contact { + /** The date and time when the contact was created. */ + createdOn?: string; + defaultShippingAddress?: AddressBookEntry; + /** The contact's first name. */ + firstName?: string; + /** The contact's ID. */ + id?: string; + /** The contact's last name. */ + lastName?: string; + /** The contact's locale. */ + locale?: string; + primaryEmail?: Email; +} +export const Contact = /*@__PURE__*/ S.suspend(() => + S.Struct({ + createdOn: S.optional(S.String), + defaultShippingAddress: S.optional(AddressBookEntry), + firstName: S.optional(S.String), + id: S.optional(S.String), + lastName: S.optional(S.String), + locale: S.optional(S.String), + primaryEmail: S.optional(Email), + }), +).annotate({ identifier: "Contact" }) as any as S.Schema; + +export interface CreateContactResponse { + contact?: Contact; +} +export const CreateContactResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + contact: S.optional(Contact), + }), +).annotate({ + identifier: "CreateContactResponse", +}) as any as S.Schema; + +/** Discount applies to any order. No additional conditions. */ +export interface AnyOrderCriteria { + type: string; +} +export const AnyOrderCriteria = /*@__PURE__*/ S.suspend(() => + S.Struct({ + type: S.String, + }), +).annotate({ + identifier: "AnyOrderCriteria", +}) as any as S.Schema; + +/** Specifies the possible targets for a BuyXGetYCriteria buy-side. */ +export type BuyXGetYCriteriaCriteriaAppliesTo = "PRODUCT"; +export const BuyXGetYCriteriaCriteriaAppliesTo = /*@__PURE__*/ S.String; + +/** Product ids the cart must contain. Required if criteriaAppliesTo=PRODUCT. */ +export type BuyXGetYCriteriaCriteriaProductIdsList = Array; +export const BuyXGetYCriteriaCriteriaProductIdsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** Specifies the possible targets for a BuyXGetYCriteria reward-side. */ +export type BuyXGetYCriteriaRewardAppliesTo = "PRODUCT"; +export const BuyXGetYCriteriaRewardAppliesTo = /*@__PURE__*/ S.String; + +/** Product ids eligible for the reward. Required if rewardAppliesTo=PRODUCT. */ +export type BuyXGetYCriteriaRewardProductIdsList = Array; +export const BuyXGetYCriteriaRewardProductIdsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** Discount applies when the cart contains a required quantity of qualifying items (buy side), granting a discount on a quantity of eligible items (reward side). */ +export interface BuyXGetYCriteria { + type: string; + /** Specifies the possible targets for a BuyXGetYCriteria buy-side. */ + criteriaAppliesTo?: BuyXGetYCriteriaCriteriaAppliesTo | (string & {}); + /** Product ids the cart must contain. Required if criteriaAppliesTo=PRODUCT. */ + criteriaProductIds?: BuyXGetYCriteriaCriteriaProductIdsList; + /** Quantity of eligible items the discount applies to. */ + eligibleForDiscountQuantity: number; + /** Quantity of qualifying items required at full price. */ + requiredFullPriceQuantity: number; + /** Specifies the possible targets for a BuyXGetYCriteria reward-side. */ + rewardAppliesTo?: BuyXGetYCriteriaRewardAppliesTo | (string & {}); + /** Product ids eligible for the reward. Required if rewardAppliesTo=PRODUCT. */ + rewardProductIds?: BuyXGetYCriteriaRewardProductIdsList; +} +export const BuyXGetYCriteria = /*@__PURE__*/ S.suspend(() => + S.Struct({ + type: S.String, + criteriaAppliesTo: S.optional(BuyXGetYCriteriaCriteriaAppliesTo), + criteriaProductIds: S.optional(BuyXGetYCriteriaCriteriaProductIdsList), + eligibleForDiscountQuantity: S.Number, + requiredFullPriceQuantity: S.Number, + rewardAppliesTo: S.optional(BuyXGetYCriteriaRewardAppliesTo), + rewardProductIds: S.optional(BuyXGetYCriteriaRewardProductIdsList), + }), +).annotate({ + identifier: "BuyXGetYCriteria", +}) as any as S.Schema; + +/** ISO 4217 currency code. */ +export interface MonetaryAmountCurrency { + currencyCode?: string; + defaultFractionDigits?: number; + displayName?: string; + numericCode?: number; + numericCodeAsString?: string; + symbol?: string; +} +export const MonetaryAmountCurrency = /*@__PURE__*/ S.suspend(() => + S.Struct({ + currencyCode: S.optional(S.String), + defaultFractionDigits: S.optional(S.Number), + displayName: S.optional(S.String), + numericCode: S.optional(S.Number), + numericCodeAsString: S.optional(S.String), + symbol: S.optional(S.String), + }), +).annotate({ + identifier: "MonetaryAmountCurrency", +}) as any as S.Schema; + +/** A monetary amount with currency code and decimal value. */ +export interface MonetaryAmount { + /** ISO 4217 currency code. */ + currency?: MonetaryAmountCurrency; + /** Decimal monetary value. */ + value?: number; +} +export const MonetaryAmount = /*@__PURE__*/ S.suspend(() => + S.Struct({ + currency: S.optional(MonetaryAmountCurrency), + value: S.optional(S.Number), + }), +).annotate({ identifier: "MonetaryAmount" }) as any as S.Schema; + +/** Discount applies when the cart total meets or exceeds a minimum. */ +export interface CartTotalCriteria { + type: string; + minimumCartTotal: MonetaryAmount; +} +export const CartTotalCriteria = /*@__PURE__*/ S.suspend(() => + S.Struct({ + type: S.String, + minimumCartTotal: MonetaryAmount, + }), +).annotate({ + identifier: "CartTotalCriteria", +}) as any as S.Schema; + +/** Discount applies when the cart contains a specific product. */ +export interface ProductCriteria { + type: string; + /** Identifier of the product the discount targets. */ + productId?: string; + /** Display-time snapshot of the product name at the time the discount was created. */ + productName?: string; +} +export const ProductCriteria = /*@__PURE__*/ S.suspend(() => + S.Struct({ + type: S.String, + productId: S.optional(S.String), + productName: S.optional(S.String), + }), +).annotate({ + identifier: "ProductCriteria", +}) as any as S.Schema; + +export type CreateDiscountRequestCriteria = + | AnyOrderCriteria + | BuyXGetYCriteria + | CartTotalCriteria + | ProductCriteria; +export const CreateDiscountRequestCriteria = + /*@__PURE__*/ S.Unknown as any as S.Schema; + +/** Defines how the discount applies to payment-plan payments. */ +export type PaymentPlanOptionsType = "NONE" | "ALL_PAYMENTS"; +export const PaymentPlanOptionsType = /*@__PURE__*/ S.String; + +/** Payment-plan applicability settings for this discount. When omitted from a create or update request, defaults to NONE. */ +export interface PaymentPlanOptions { + /** Defines how the discount applies to payment-plan payments. */ + type: PaymentPlanOptionsType | (string & {}); +} +export const PaymentPlanOptions = /*@__PURE__*/ S.suspend(() => + S.Struct({ + type: PaymentPlanOptionsType, + }), +).annotate({ + identifier: "PaymentPlanOptions", +}) as any as S.Schema; + +/** Defines how the discount applies to subscription payments. */ +export type SubscriptionOptionsType = + | "EXCLUDED" + | "ALL_PAYMENTS" + | "LIMITED_PAYMENTS"; +export const SubscriptionOptionsType = /*@__PURE__*/ S.String; + +/** Subscription applicability settings for this discount. When omitted from a create or update request, defaults to EXCLUDED. */ +export interface SubscriptionOptions { + /** Defines how the discount applies to subscription payments. */ + type: SubscriptionOptionsType | (string & {}); +} +export const SubscriptionOptions = /*@__PURE__*/ S.suspend(() => + S.Struct({ + type: SubscriptionOptionsType, + }), +).annotate({ + identifier: "SubscriptionOptions", +}) as any as S.Schema; + +/** Apply a fixed monetary amount off each reward item in a BUY_X_GET_Y discount. */ +export interface BuyXGetYFixedAmountTemplate { + type: string; + discountAmount: MonetaryAmount; + /** Caps how many times the discount can be applied per cart. 0 means unlimited. */ + maxApplicationsPerCart?: number; +} +export const BuyXGetYFixedAmountTemplate = /*@__PURE__*/ S.suspend(() => + S.Struct({ + type: S.String, + discountAmount: MonetaryAmount, + maxApplicationsPerCart: S.optional(S.Number), + }), +).annotate({ + identifier: "BuyXGetYFixedAmountTemplate", +}) as any as S.Schema; + +/** Apply a percentage discount off each reward item in a BUY_X_GET_Y discount. */ +export interface BuyXGetYPercentageTemplate { + type: string; + /** Percentage to subtract from each reward item. Range (0, 100]. */ + discountPercentage: number; + /** Caps how many times the discount can be applied per cart. 0 means unlimited. */ + maxApplicationsPerCart?: number; +} +export const BuyXGetYPercentageTemplate = /*@__PURE__*/ S.suspend(() => + S.Struct({ + type: S.String, + discountPercentage: S.Number, + maxApplicationsPerCart: S.optional(S.Number), + }), +).annotate({ + identifier: "BuyXGetYPercentageTemplate", +}) as any as S.Schema; + +/** Apply a fixed monetary amount off the cart total. */ +export interface FixedAmountTemplate { + type: string; + discountAmount: MonetaryAmount; +} +export const FixedAmountTemplate = /*@__PURE__*/ S.suspend(() => + S.Struct({ + type: S.String, + discountAmount: MonetaryAmount, + }), +).annotate({ + identifier: "FixedAmountTemplate", +}) as any as S.Schema; + +/** Fulfillment channel a free-shipping discount applies to. */ +export type FreeShippingTemplateAppliesToFulfillmentOptionType = + | "SHIPPING" + | "PICKUP" + | "LOCAL_DELIVERY"; +export const FreeShippingTemplateAppliesToFulfillmentOptionType = + /*@__PURE__*/ S.String; + +/** Carrier service eligible for a free-shipping discount. */ +export type SelectedShippingOptionSelectedService = + | "FEDEX_GROUND" + | "FEDEX_GROUND_HOME_DELIVERY" + | "FEDEX_PRIORITY_OVERNIGHT" + | "FEDEX_STANDARD_OVERNIGHT" + | "FEDEX_2_DAY" + | "FEDEX_2_DAY_AM" + | "FEDEX_EXPRESS_SAVER" + | "FEDEX_FIRST_OVERNIGHT" + | "FEDEX_SAME_DAY" + | "FEDEX_SAME_DAY_CITY" + | "UPS_GROUND" + | "UPS_NEXT_DAY_AIR" + | "UPS_NEXT_DAY_AIR_SAVER" + | "UPS_NEXT_DAY_AIR_EARLY_AM" + | "UPS_TWO_DAY_AIR" + | "UPS_TWO_DAY_AIR_AM" + | "UPS_THREE_DAY_SELECT" + | "USPS_PRIORITY" + | "USPS_EXPRESS" + | "USPS_STANDARD"; +export const SelectedShippingOptionSelectedService = /*@__PURE__*/ S.String; + +/** A shipping option targeted by a free-shipping discount. */ +export interface SelectedShippingOption { + /** If true, all services within the shipping option are eligible. */ + isAllServicesSelected?: boolean; + /** Carrier service eligible for a free-shipping discount. */ + selectedService?: SelectedShippingOptionSelectedService | (string & {}); + /** Identifier of the shipping option. */ + shippingOptionId: string; + /** Display-time snapshot of the shipping option name. */ + shippingOptionName: string; +} +export const SelectedShippingOption = /*@__PURE__*/ S.suspend(() => + S.Struct({ + isAllServicesSelected: S.optional(S.Boolean), + selectedService: S.optional(SelectedShippingOptionSelectedService), + shippingOptionId: S.String, + shippingOptionName: S.String, + }), +).annotate({ + identifier: "SelectedShippingOption", +}) as any as S.Schema; + +/** Waive shipping cost for eligible carts. */ +export interface FreeShippingTemplate { + type: string; + /** Fulfillment channel a free-shipping discount applies to. */ + appliesToFulfillmentOptionType?: + | FreeShippingTemplateAppliesToFulfillmentOptionType + | (string & {}); + selectedShippingOption?: SelectedShippingOption; +} +export const FreeShippingTemplate = /*@__PURE__*/ S.suspend(() => + S.Struct({ + type: S.String, + appliesToFulfillmentOptionType: S.optional( + FreeShippingTemplateAppliesToFulfillmentOptionType, + ), + selectedShippingOption: S.optional(SelectedShippingOption), + }), +).annotate({ + identifier: "FreeShippingTemplate", +}) as any as S.Schema; + +/** Apply a percentage discount off the cart total. */ +export interface PercentageTemplate { + type: string; + /** Percentage to subtract from the cart total. Range (0, 100]. */ + percentage: number; +} +export const PercentageTemplate = /*@__PURE__*/ S.suspend(() => + S.Struct({ + type: S.String, + percentage: S.Number, + }), +).annotate({ + identifier: "PercentageTemplate", +}) as any as S.Schema; + +export type CreateDiscountRequestTemplate = + | BuyXGetYFixedAmountTemplate + | BuyXGetYPercentageTemplate + | FixedAmountTemplate + | FreeShippingTemplate + | PercentageTemplate; +export const CreateDiscountRequestTemplate = + /*@__PURE__*/ S.Unknown as any as S.Schema; + +/** Trigger for a discount that is automatically applied; no promo code required. */ +export type AutoTrigger = AnyOrderCriteria; +export const AutoTrigger = AnyOrderCriteria; + +/** Trigger for a discount that is unlocked by a shopper-entered promo code. */ +export interface PromoCodeTrigger { + type: string; + /** Shopper-entered promo code. Required, non-empty, 1–50 characters; allowed characters: letters, digits, underscore, hyphen. */ + promoCode: string; +} +export const PromoCodeTrigger = /*@__PURE__*/ S.suspend(() => + S.Struct({ + type: S.String, + promoCode: S.String, + }), +).annotate({ + identifier: "PromoCodeTrigger", +}) as any as S.Schema; + +export type CreateDiscountRequestTrigger = AnyOrderCriteria | PromoCodeTrigger; +export const CreateDiscountRequestTrigger = + /*@__PURE__*/ S.Unknown as any as S.Schema; + +export interface CreateDiscountRequest { + criteria: CreateDiscountRequestCriteria; + /** If true, the discount can only be used `maxUsesAllowed` times site-wide. */ + isLimitedUses?: boolean; + /** If true, a given customer can only use this discount once. */ + isOncePerCustomer?: boolean; + /** Maximum site-wide redemptions. Required when isLimitedUses=true; null otherwise. */ + maxUsesAllowed?: number; + /** Display name for the discount. */ + name: string; + paymentPlanOptions?: PaymentPlanOptions; + subscriptionOptions?: SubscriptionOptions; + template: CreateDiscountRequestTemplate; + trigger: CreateDiscountRequestTrigger; + /** When the discount becomes active. */ + validFrom: string; + /** When the discount expires. Null = no expiry. */ + validTo?: string; +} +export const CreateDiscountRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + criteria: CreateDiscountRequestCriteria, + isLimitedUses: S.optional(S.Boolean), + isOncePerCustomer: S.optional(S.Boolean), + maxUsesAllowed: S.optional(S.Number), + name: S.String, + paymentPlanOptions: S.optional(PaymentPlanOptions), + subscriptionOptions: S.optional(SubscriptionOptions), + template: CreateDiscountRequestTemplate, + trigger: CreateDiscountRequestTrigger, + validFrom: S.String, + validTo: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/v1/commerce/discounts", code: 200 })), +).annotate({ + identifier: "CreateDiscountRequest", +}) as any as S.Schema; + +export type DiscountCriteria = + | AnyOrderCriteria + | BuyXGetYCriteria + | CartTotalCriteria + | ProductCriteria; +export const DiscountCriteria = + /*@__PURE__*/ S.Unknown as any as S.Schema; + +/** Defines the lifecycle status of a discount. */ +export type DiscountStatus = "ACTIVE" | "SCHEDULED" | "EXPIRED"; +export const DiscountStatus = /*@__PURE__*/ S.String; + +export type DiscountTemplate = + | BuyXGetYFixedAmountTemplate + | BuyXGetYPercentageTemplate + | FixedAmountTemplate + | FreeShippingTemplate + | PercentageTemplate; +export const DiscountTemplate = + /*@__PURE__*/ S.Unknown as any as S.Schema; + +export type DiscountTrigger = AnyOrderCriteria | PromoCodeTrigger; +export const DiscountTrigger = + /*@__PURE__*/ S.Unknown as any as S.Schema; + +/** Discount configured for a Commerce store. */ +export interface Discount { + criteria: DiscountCriteria; + /** Discount id. */ + id?: string; + /** If true, the discount can only be used `maxUsesAllowed` times site-wide. */ + isLimitedUses?: boolean; + /** If true, a given customer can only use this discount once. */ + isOncePerCustomer?: boolean; + /** Timestamp of the most recent redemption. Null if never redeemed. */ + lastRedeemedAt?: string; + /** Maximum site-wide redemptions. Required when isLimitedUses=true; null otherwise. */ + maxUsesAllowed?: number; + /** Display name for the discount. */ + name: string; + /** Number of times this discount has been redeemed. */ + numberOfUses?: number; + paymentPlanOptions?: PaymentPlanOptions; + /** Defines the lifecycle status of a discount. */ + status?: DiscountStatus; + subscriptionOptions?: SubscriptionOptions; + template: DiscountTemplate; + trigger: DiscountTrigger; + /** When the discount becomes active. */ + validFrom: string; + /** When the discount expires. Null = no expiry. */ + validTo?: string; + /** 24-char website id. */ + websiteId?: string; +} +export const Discount = /*@__PURE__*/ S.suspend(() => + S.Struct({ + criteria: DiscountCriteria, + id: S.optional(S.String), + isLimitedUses: S.optional(S.Boolean), + isOncePerCustomer: S.optional(S.Boolean), + lastRedeemedAt: S.optional(S.String), + maxUsesAllowed: S.optional(S.Number), + name: S.String, + numberOfUses: S.optional(S.Number), + paymentPlanOptions: S.optional(PaymentPlanOptions), + status: S.optional(DiscountStatus), + subscriptionOptions: S.optional(SubscriptionOptions), + template: DiscountTemplate, + trigger: DiscountTrigger, + validFrom: S.String, + validTo: S.optional(S.String), + websiteId: S.optional(S.String), + }), +).annotate({ identifier: "Discount" }) as any as S.Schema; + +/** Envelope for a single discount response. */ +export interface DiscountResponse { + discount: Discount; +} +export const DiscountResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + discount: Discount, + }), +).annotate({ + identifier: "DiscountResponse", +}) as any as S.Schema; + +/** Customer's shipping address. */ +export interface AddressRequest { + address1?: string; + address2?: string; + city?: string; + countryCode?: string; + firstName?: string; + lastName?: string; + phone?: string; + postalCode?: string; + state?: string; +} +export const AddressRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + address1: S.optional(S.String), + address2: S.optional(S.String), + city: S.optional(S.String), + countryCode: S.optional(S.String), + firstName: S.optional(S.String), + lastName: S.optional(S.String), + phone: S.optional(S.String), + postalCode: S.optional(S.String), + state: S.optional(S.String), + }), +).annotate({ identifier: "AddressRequest" }) as any as S.Schema; + +/** Array of discount line items. Describes the promotions redeemed during checkout. */ +export interface CreateDiscountLineRequest { + amount?: MonetaryAmount; + name?: string; + promoCode?: string; +} +export const CreateDiscountLineRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + amount: S.optional(MonetaryAmount), + name: S.optional(S.String), + promoCode: S.optional(S.String), + }), +).annotate({ + identifier: "CreateDiscountLineRequest", +}) as any as S.Schema; + +/** Array of discount line items. Describes the promotions redeemed during checkout. */ +export type CreateOrderRequestDiscountLinesList = + Array; +export const CreateOrderRequestDiscountLinesList = /*@__PURE__*/ S.Array( + CreateDiscountLineRequest, +) as any as S.Schema; + +/** Current fulfillment status of the order. Value may be PENDING or FULFILLED. */ +export type OrderCreateFulfillmentStatus = "PENDING" | "FULFILLED"; +export const OrderCreateFulfillmentStatus = /*@__PURE__*/ S.String; + +/** Array of shipping fulfillments; up to 100 entries. Describes shipment information for the order. */ +export interface CreateOrderShipmentRequest { + /** Name of the carrier handling the shipment. */ + carrierName: string; + /** Carrier's level of service for shipping. */ + service: string; + /** ISO 8601 UTC date and time string. Represents the moment the shipment occurred. */ + shipDate: string; + /** Carrier's parcel tracking number. */ + trackingNumber: string; + /** URL provided by carrier to track the shipment; must adhere to valid URL formatting. */ + trackingUrl?: string; +} +export const CreateOrderShipmentRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + carrierName: S.String, + service: S.String, + shipDate: S.String, + trackingNumber: S.String, + trackingUrl: S.optional(S.String), + }), +).annotate({ + identifier: "CreateOrderShipmentRequest", +}) as any as S.Schema; + +/** Array of shipping fulfillments; up to 100 entries. Describes shipment information for the order. */ +export type CreateOrderRequestFulfillmentsList = + Array; +export const CreateOrderRequestFulfillmentsList = /*@__PURE__*/ S.Array( + CreateOrderShipmentRequest, +) as any as S.Schema; + +/** Indicates whether to deduct stock quantity for the product variant upon Order creation. Values may be DEDUCT or SKIP. Defaults to SKIP. */ +export type CreateOrderInventoryBehavior = "DEDUCT" | "SKIP"; +export const CreateOrderInventoryBehavior = /*@__PURE__*/ S.String; + +/** Product type sold; values may be PHYSICAL_PRODUCT or CUSTOM. */ +export type OrderCreateLineItemType = "PHYSICAL_PRODUCT" | "CUSTOM"; +export const OrderCreateLineItemType = /*@__PURE__*/ S.String; + +/** Array of purchased line items; cannot be empty. */ +export interface CreateLineItemRequest { + lineItemType: OrderCreateLineItemType | (string & {}); + nonSaleUnitPrice?: MonetaryAmount; + /** Amount of the item purchased. 1,000,000 limit. */ + quantity: number; + /** Title of the custom line item. */ + title?: string; + unitPricePaid: MonetaryAmount; + /** Required if lineItemType is PHYSICAL_PRODUCT. Unique id of the ProductVariant sold. */ + variantId?: string; +} +export const CreateLineItemRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + lineItemType: OrderCreateLineItemType, + nonSaleUnitPrice: S.optional(MonetaryAmount), + quantity: S.Number, + title: S.optional(S.String), + unitPricePaid: MonetaryAmount, + variantId: S.optional(S.String), + }), +).annotate({ + identifier: "CreateLineItemRequest", +}) as any as S.Schema; + +/** Array of purchased line items; cannot be empty. */ +export type CreateOrderRequestLineItemsList = Array; +export const CreateOrderRequestLineItemsList = /*@__PURE__*/ S.Array( + CreateLineItemRequest, +) as any as S.Schema; + +/** Indicates that lineItems.unitPricePaid includes tax. Values may be EXCLUSIVE or INCLUSIVE. */ +export type TaxInterpretation = "INCLUSIVE" | "EXCLUSIVE"; +export const TaxInterpretation = /*@__PURE__*/ S.String; + +/** Array of shipping line items. Describes the shipping options chosen at checkout. Currently accepts only one shipping entry. */ +export interface CreateShippingLineRequest { + amount: MonetaryAmount; + /** Description of the shipping option. */ + method: string; +} +export const CreateShippingLineRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + amount: MonetaryAmount, + method: S.String, + }), +).annotate({ + identifier: "CreateShippingLineRequest", +}) as any as S.Schema; + +/** Array of shipping line items. Describes the shipping options chosen at checkout. Currently accepts only one shipping entry. */ +export type CreateOrderRequestShippingLinesList = + Array; +export const CreateOrderRequestShippingLinesList = /*@__PURE__*/ S.Array( + CreateShippingLineRequest, +) as any as S.Schema; + +/** Indicates whether to send a fulfillment notification email to the customer. Value may be SEND or SKIP. */ +export type ShopperFulfillmentNotificationBehavior = "SEND" | "SKIP"; +export const ShopperFulfillmentNotificationBehavior = /*@__PURE__*/ S.String; + +export interface CreateOrderRequest { + /** Idempotency key to prevent duplicate order creation. */ + idempotencyKey: string; + billingAddress?: AddressRequest; + /** Name of third-party sales channel. */ + channelName: string; + /** ISO 8601 UTC date and time string. Represents the date and time when the order was placed through the third-party sales channel. */ + createdOn: string; + /** Email address provided at checkout on the third-party sales channel. */ + customerEmail?: string; + /** Array of discount line items. Describes the promotions redeemed during checkout. */ + discountLines?: CreateOrderRequestDiscountLinesList; + discountTotal?: MonetaryAmount; + /** Order reference identifier used by the third-party sales channel. */ + externalOrderReference: string; + /** ISO 8601 UTC date and time string. Represents the moment the order was fulfilled. Required if fulfillmentStatus is FULFILLED. */ + fulfilledOn?: string; + fulfillmentStatus?: OrderCreateFulfillmentStatus | (string & {}); + /** Array of shipping fulfillments; up to 100 entries. Describes shipment information for the order. */ + fulfillments: CreateOrderRequestFulfillmentsList; + grandTotal: MonetaryAmount; + inventoryBehavior?: CreateOrderInventoryBehavior | (string & {}); + /** Array of purchased line items; cannot be empty. */ + lineItems: CreateOrderRequestLineItemsList; + priceTaxInterpretation: TaxInterpretation | (string & {}); + shippingAddress?: AddressRequest; + /** Array of shipping line items. Describes the shipping options chosen at checkout. Currently accepts only one shipping entry. */ + shippingLines?: CreateOrderRequestShippingLinesList; + shippingTotal?: MonetaryAmount; + shopperFulfillmentNotificationBehavior?: + | ShopperFulfillmentNotificationBehavior + | (string & {}); + subtotal?: MonetaryAmount; + taxTotal?: MonetaryAmount; +} +export const CreateOrderRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + idempotencyKey: S.String.pipe(T.Header("Idempotency-Key")), + billingAddress: S.optional(AddressRequest), + channelName: S.String, + createdOn: S.String, + customerEmail: S.optional(S.String), + discountLines: S.optional(CreateOrderRequestDiscountLinesList), + discountTotal: S.optional(MonetaryAmount), + externalOrderReference: S.String, + fulfilledOn: S.optional(S.String), + fulfillmentStatus: S.optional(OrderCreateFulfillmentStatus), + fulfillments: CreateOrderRequestFulfillmentsList, + grandTotal: MonetaryAmount, + inventoryBehavior: S.optional(CreateOrderInventoryBehavior), + lineItems: CreateOrderRequestLineItemsList, + priceTaxInterpretation: TaxInterpretation, + shippingAddress: S.optional(AddressRequest), + shippingLines: S.optional(CreateOrderRequestShippingLinesList), + shippingTotal: S.optional(MonetaryAmount), + shopperFulfillmentNotificationBehavior: S.optional( + ShopperFulfillmentNotificationBehavior, + ), + subtotal: S.optional(MonetaryAmount), + taxTotal: S.optional(MonetaryAmount), + }).pipe(T.Http({ method: "POST", uri: "/1.0/commerce/orders", code: 200 })), +).annotate({ + identifier: "CreateOrderRequest", +}) as any as S.Schema; + +/** Customer's shipping address provided at checkout or, for recurring subscription orders, the customer's current mailing address. */ +export interface Address { + /** Primary street address */ + address1?: string; + /** Secondary address line */ + address2?: string; + /** City */ + city?: string; + /** ISO 3166-1 alpha-2 country code */ + countryCode?: string; + /** First name */ + firstName?: string; + /** Last name */ + lastName?: string; + /** Phone number */ + phone?: string; + /** Postal or ZIP code */ + postalCode?: string; + /** State or province */ + state?: string; +} +export const Address = /*@__PURE__*/ S.suspend(() => + S.Struct({ + address1: S.optional(S.String), + address2: S.optional(S.String), + city: S.optional(S.String), + countryCode: S.optional(S.String), + firstName: S.optional(S.String), + lastName: S.optional(S.String), + phone: S.optional(S.String), + postalCode: S.optional(S.String), + state: S.optional(S.String), + }), +).annotate({ identifier: "Address" }) as any as S.Schema
; + +/** Array of discount line items; describes the promotions redeemed during checkout. */ +export interface DiscountLine { + amount?: MonetaryAmount; + /** A plain-English description of the promotion */ + description?: string; + /** Name of the promotion */ + name?: string; + /** The user-entered promo code that triggered the discount */ + promoCode?: string; +} +export const DiscountLine = /*@__PURE__*/ S.suspend(() => + S.Struct({ + amount: S.optional(MonetaryAmount), + description: S.optional(S.String), + name: S.optional(S.String), + promoCode: S.optional(S.String), + }), +).annotate({ identifier: "DiscountLine" }) as any as S.Schema; + +/** Array of discount line items; describes the promotions redeemed during checkout. */ +export type OrderDiscountLinesList = Array; +export const OrderDiscountLinesList = /*@__PURE__*/ S.Array( + DiscountLine, +) as any as S.Schema; + +/** Array of form data submitted via the checkout page. */ +export interface FormItem { + /** The name of the form field */ + label?: string; + /** The value of the field, as entered by the shopper */ + value?: string; +} +export const FormItem = /*@__PURE__*/ S.suspend(() => + S.Struct({ + label: S.optional(S.String), + value: S.optional(S.String), + }), +).annotate({ identifier: "FormItem" }) as any as S.Schema; + +/** Array of form data submitted via the checkout page. */ +export type OrderFormSubmissionList = Array; +export const OrderFormSubmissionList = /*@__PURE__*/ S.Array( + FormItem, +) as any as S.Schema; + +/** Current fulfillment status of the order. Value may be: PENDING, FULFILLED, or CANCELED. */ +export type FulfillmentStatus = "PENDING" | "FULFILLED" | "CANCELED"; +export const FulfillmentStatus = /*@__PURE__*/ S.String; + +/** Array of shipping fulfillments; describes shipment information for the order. */ +export interface Fulfillment { + /** Name of the carrier handling the shipment. */ + carrierName?: string; + /** Carrier's level of service for shipping. */ + service?: string; + /** ISO 8601 UTC date and time string; represents the moment the fulfillment was shipped. */ + shipDate?: string; + /** Carrier's parcel tracking number. */ + trackingNumber?: string; + /** URL provided by the carrier to track the shipment. */ + trackingUrl?: string; +} +export const Fulfillment = /*@__PURE__*/ S.suspend(() => + S.Struct({ + carrierName: S.optional(S.String), + service: S.optional(S.String), + shipDate: S.optional(S.String), + trackingNumber: S.optional(S.String), + trackingUrl: S.optional(S.String), + }), +).annotate({ identifier: "Fulfillment" }) as any as S.Schema; + +/** Array of shipping fulfillments; describes shipment information for the order. */ +export type OrderFulfillmentsList = Array; +export const OrderFulfillmentsList = /*@__PURE__*/ S.Array( + Fulfillment, +) as any as S.Schema; + +/** Array of internal notes added to the order by the merchant. */ +export interface OrderNote { + /** Content for the note */ + content?: string; +} +export const OrderNote = /*@__PURE__*/ S.suspend(() => + S.Struct({ + content: S.optional(S.String), + }), +).annotate({ identifier: "OrderNote" }) as any as S.Schema; + +/** Array of internal notes added to the order by the merchant. */ +export type OrderInternalNotesList = Array; +export const OrderInternalNotesList = /*@__PURE__*/ S.Array( + OrderNote, +) as any as S.Schema; + +/** Array of form data submitted via a product's custom form prior to being added to the cart. */ +export type LineItemCustomizationsList = Array; +export const LineItemCustomizationsList = /*@__PURE__*/ S.Array( + FormItem, +) as any as S.Schema; + +/** Array of variant options; represents variant choices made by the customer. Null for download and gift card products. */ +export interface VariantOption { + /** The name of the option (e.g. color, size, material) */ + optionName?: string; + /** The shopper-selected value for the option (e.g. red, small, cotton) */ + value?: string; +} +export const VariantOption = /*@__PURE__*/ S.suspend(() => + S.Struct({ + optionName: S.optional(S.String), + value: S.optional(S.String), + }), +).annotate({ identifier: "VariantOption" }) as any as S.Schema; + +/** Array of variant options; represents variant choices made by the customer. Null for download and gift card products. */ +export type LineItemVariantOptionsList = Array; +export const LineItemVariantOptionsList = /*@__PURE__*/ S.Array( + VariantOption, +) as any as S.Schema; + +/** Array of purchased line items; line items describe what product or product variant was purchased, how many of that item were purchased, and additional details. */ +export interface LineItem { + /** Array of form data submitted via a product's custom form prior to being added to the cart. */ + customizations?: LineItemCustomizationsList; + /** Shipping height of the physical product variant. 0.0 when not specified or when the variant is not a physical product. */ + height?: number; + /** Unique line item id. */ + id?: string; + /** URL of the primary image for the item. */ + imageUrl?: string; + /** Shipping length of the physical product variant. 0.0 when not specified or when the variant is not a physical product. */ + length?: number; + /** Product type of the item. */ + lineItemType?: string; + /** Unique product id; unless null, every line item with a variantId is a variant of a product with productId. */ + productId?: string; + /** Name of the purchased product. */ + productName?: string; + /** Amount of the item purchased. */ + quantity?: number; + /** Stock keeping unit (SKU) code assigned by the Squarespace merchant for a variant. Null for digital products. */ + sku?: string; + unitPricePaid?: MonetaryAmount; + /** Unique id of the ProductVariant sold. Populated for physical, service, or gift card line items created on or after May 28, 2019. */ + variantId?: string; + /** Array of variant options; represents variant choices made by the customer. Null for download and gift card products. */ + variantOptions?: LineItemVariantOptionsList; + /** Shipping weight of the physical product variant. 0.0 when not specified or when the variant is not a physical product. */ + weight?: number; + /** Shipping width of the physical product variant. 0.0 when not specified or when the variant is not a physical product. */ + width?: number; +} +export const LineItem = /*@__PURE__*/ S.suspend(() => + S.Struct({ + customizations: S.optional(LineItemCustomizationsList), + height: S.optional(S.Number), + id: S.optional(S.String), + imageUrl: S.optional(S.String), + length: S.optional(S.Number), + lineItemType: S.optional(S.String), + productId: S.optional(S.String), + productName: S.optional(S.String), + quantity: S.optional(S.Number), + sku: S.optional(S.String), + unitPricePaid: S.optional(MonetaryAmount), + variantId: S.optional(S.String), + variantOptions: S.optional(LineItemVariantOptionsList), + weight: S.optional(S.Number), + width: S.optional(S.Number), + }), +).annotate({ identifier: "LineItem" }) as any as S.Schema; + +/** Array of purchased line items; line items describe what product or product variant was purchased, how many of that item were purchased, and additional details. */ +export type OrderLineItemsList = Array; +export const OrderLineItemsList = /*@__PURE__*/ S.Array( + LineItem, +) as any as S.Schema; + +/** Current state of payment for the order. */ +export type PaymentState = + | "NOT_CHARGED" + | "AUTHORIZED" + | "PAID" + | "REFUNDED" + | "PENDING" + | "FAILED" + | "REFUND_PENDING" + | "REFUND_FAILED" + | "PARTIALLY_PAID"; +export const PaymentState = /*@__PURE__*/ S.String; + +/** Array of shipping line items; describes the shipping options chosen at checkout. */ +export interface ShippingLine { + amount?: MonetaryAmount; + /** Description of the shipping option */ + method?: string; +} +export const ShippingLine = /*@__PURE__*/ S.suspend(() => + S.Struct({ + amount: S.optional(MonetaryAmount), + method: S.optional(S.String), + }), +).annotate({ identifier: "ShippingLine" }) as any as S.Schema; + +/** Array of shipping line items; describes the shipping options chosen at checkout. */ +export type OrderShippingLinesList = Array; +export const OrderShippingLinesList = /*@__PURE__*/ S.Array( + ShippingLine, +) as any as S.Schema; + +/** The carrier service type identifier. */ +export type OrderShippingOptionServiceType = + | "FEDEX_GROUND" + | "FEDEX_GROUND_HOME_DELIVERY" + | "FEDEX_PRIORITY_OVERNIGHT" + | "FEDEX_STANDARD_OVERNIGHT" + | "FEDEX_2_DAY" + | "FEDEX_2_DAY_AM" + | "FEDEX_EXPRESS_SAVER" + | "FEDEX_FIRST_FREIGHT" + | "FEDEX_FREIGHT_PRIORITY" + | "FEDEX_FREIGHT_ECONOMY" + | "FEDEX_FIRST_OVERNIGHT" + | "FEDEX_SAME_DAY" + | "FEDEX_SAME_DAY_CITY" + | "FEDEX_EUROPE_FIRST_INTERNATIONAL_PRIORITY" + | "FEDEX_INTERNATIONAL_ECONOMY" + | "FEDEX_INTERNATIONAL_FIRST" + | "FEDEX_INTERNATIONAL_PRIORITY" + | "FEDEX_INTERNATIONAL_ECONOMY_FREIGHT" + | "FEDEX_INTERNATIONAL_PRIORITY_FREIGHT" + | "UPS_GROUND" + | "UPS_NEXT_DAY_AIR" + | "UPS_NEXT_DAY_AIR_SAVER" + | "UPS_NEXT_DAY_AIR_EARLY_AM" + | "UPS_TWO_DAY_AIR" + | "UPS_THREE_DAY_SELECT" + | "UPS_TWO_DAY_AIR_AM" + | "USPS_UNKNOWN" + | "USPS_FIRST_CLASS" + | "USPS_PRIORITY" + | "USPS_EXPRESS" + | "USPS_STANDARD" + | "USPS_ALL" + | "USPS_ONLINE" + | "OTHER"; +export const OrderShippingOptionServiceType = /*@__PURE__*/ S.String; + +export interface Order { + billingAddress?: Address; + /** Where the order originated; possible values are: web and pos. */ + channel?: string; + /** Name of the third-party sales channel. */ + channelName?: string; + /** ISO 8601 UTC date and time string; represents the moment when the order was placed. */ + createdOn?: string; + /** Email address entered at checkout or, for recurring subscription orders, the customer's current email address. */ + customerEmail?: string; + /** Unique customer id. */ + customerId?: string; + /** Array of discount line items; describes the promotions redeemed during checkout. */ + discountLines?: OrderDiscountLinesList; + discountTotal?: MonetaryAmount; + /** Order reference identifier used by the third-party sales channel. */ + externalOrderReference?: string; + /** Array of form data submitted via the checkout page. */ + formSubmission?: OrderFormSubmissionList; + /** ISO 8601 UTC date and time string; represents the moment the order was fulfilled. */ + fulfilledOn?: string; + fulfillmentStatus?: FulfillmentStatus; + /** Array of shipping fulfillments; describes shipment information for the order. */ + fulfillments?: OrderFulfillmentsList; + grandTotal?: MonetaryAmount; + /** Unique Order id. */ + id?: string; + /** Array of internal notes added to the order by the merchant. */ + internalNotes?: OrderInternalNotesList; + /** Array of purchased line items; line items describe what product or product variant was purchased, how many of that item were purchased, and additional details. */ + lineItems?: OrderLineItemsList; + /** ISO 8601 UTC date and time string; represents when the order was last modified. */ + modifiedOn?: string; + /** Unique, sequential number for the Order. */ + orderNumber?: string; + paymentState?: PaymentState; + /** Indicates whether lineItems.unitPricePaid includes tax. Values may be EXCLUSIVE or INCLUSIVE. */ + priceTaxInterpretation?: string; + refundedTotal?: MonetaryAmount; + shippingAddress?: Address; + /** Array of shipping line items; describes the shipping options chosen at checkout. */ + shippingLines?: OrderShippingLinesList; + /** the specific shipping service name selected at checkout (e.g. "USPS Ground Advantage", "Royal Mail Tracked 48"). */ + shippingOptionName?: string; + /** The carrier service type identifier. */ + shippingOptionServiceType?: OrderShippingOptionServiceType; + shippingTotal?: MonetaryAmount; + subtotal?: MonetaryAmount; + taxTotal?: MonetaryAmount; + /** If true, the order is a test order created using a payment method in test mode. */ + testmode?: boolean; +} +export const Order = /*@__PURE__*/ S.suspend(() => + S.Struct({ + billingAddress: S.optional(Address), + channel: S.optional(S.String), + channelName: S.optional(S.String), + createdOn: S.optional(S.String), + customerEmail: S.optional(S.String), + customerId: S.optional(S.String), + discountLines: S.optional(OrderDiscountLinesList), + discountTotal: S.optional(MonetaryAmount), + externalOrderReference: S.optional(S.String), + formSubmission: S.optional(OrderFormSubmissionList), + fulfilledOn: S.optional(S.String), + fulfillmentStatus: S.optional(FulfillmentStatus), + fulfillments: S.optional(OrderFulfillmentsList), + grandTotal: S.optional(MonetaryAmount), + id: S.optional(S.String), + internalNotes: S.optional(OrderInternalNotesList), + lineItems: S.optional(OrderLineItemsList), + modifiedOn: S.optional(S.String), + orderNumber: S.optional(S.String), + paymentState: S.optional(PaymentState), + priceTaxInterpretation: S.optional(S.String), + refundedTotal: S.optional(MonetaryAmount), + shippingAddress: S.optional(Address), + shippingLines: S.optional(OrderShippingLinesList), + shippingOptionName: S.optional(S.String), + shippingOptionServiceType: S.optional(OrderShippingOptionServiceType), + shippingTotal: S.optional(MonetaryAmount), + subtotal: S.optional(MonetaryAmount), + taxTotal: S.optional(MonetaryAmount), + testmode: S.optional(S.Boolean), + }), +).annotate({ identifier: "Order" }) as any as S.Schema; + +export type CreateGiftCardProductRequestTagsList = Array; +export const CreateGiftCardProductRequestTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export interface SimpleProductPricing { + basePrice?: MonetaryAmount; +} +export const SimpleProductPricing = /*@__PURE__*/ S.suspend(() => + S.Struct({ + basePrice: S.optional(MonetaryAmount), + }), +).annotate({ + identifier: "SimpleProductPricing", +}) as any as S.Schema; + +export interface CreateGiftCardProductVariantRequest { + pricing?: SimpleProductPricing; + sku?: string; +} +export const CreateGiftCardProductVariantRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + pricing: S.optional(SimpleProductPricing), + sku: S.optional(S.String), + }), +).annotate({ + identifier: "CreateGiftCardProductVariantRequest", +}) as any as S.Schema; + +export type CreateGiftCardProductRequestVariantsList = + Array; +export const CreateGiftCardProductRequestVariantsList = /*@__PURE__*/ S.Array( + CreateGiftCardProductVariantRequest, +) as any as S.Schema; + +/** Request payload to create a GIFT_CARD product. */ +export interface CreateGiftCardProductRequest { + description?: string; + isVisible?: boolean; + name?: string; + storePageId?: string; + tags?: CreateGiftCardProductRequestTagsList; + type?: string; + urlSlug?: string; + variants?: CreateGiftCardProductRequestVariantsList; +} +export const CreateGiftCardProductRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + description: S.optional(S.String), + isVisible: S.optional(S.Boolean), + name: S.optional(S.String), + storePageId: S.optional(S.String), + tags: S.optional(CreateGiftCardProductRequestTagsList), + type: S.optional(S.String), + urlSlug: S.optional(S.String), + variants: S.optional(CreateGiftCardProductRequestVariantsList), + }), +).annotate({ + identifier: "CreateGiftCardProductRequest", +}) as any as S.Schema; + +export type CreatePhysicalProductRequestTagsList = Array; +export const CreatePhysicalProductRequestTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export type CreatePhysicalProductRequestVariantAttributesList = Array; +export const CreatePhysicalProductRequestVariantAttributesList = + /*@__PURE__*/ S.Array( + S.String, + ) as any as S.Schema; + +export type CreatePhysicalProductVariantRequestAttributesMap = { + [key: string]: string | undefined; +}; +export const CreatePhysicalProductVariantRequestAttributesMap = + /*@__PURE__*/ S.Record( + S.String, + S.String, + ) as any as S.Schema; + +export interface FullProductPricing { + basePrice?: MonetaryAmount; + onSale?: boolean; + salePrice?: MonetaryAmount; +} +export const FullProductPricing = /*@__PURE__*/ S.suspend(() => + S.Struct({ + basePrice: S.optional(MonetaryAmount), + onSale: S.optional(S.Boolean), + salePrice: S.optional(MonetaryAmount), + }), +).annotate({ + identifier: "FullProductPricing", +}) as any as S.Schema; + +/** Unit of measurement. Supported values: `INCH`, `CENTIMETER`. */ +export type ProductDimensionsUnit = "CENTIMETER" | "INCH"; +export const ProductDimensionsUnit = /*@__PURE__*/ S.String; + +/** Physical dimensions of the variant. */ +export interface ProductDimensions { + /** Height of the variant. */ + height?: number; + /** Length of the variant. */ + length?: number; + unit?: ProductDimensionsUnit | (string & {}); + /** Width of the variant. */ + width?: number; +} +export const ProductDimensions = /*@__PURE__*/ S.suspend(() => + S.Struct({ + height: S.optional(S.Number), + length: S.optional(S.Number), + unit: S.optional(ProductDimensionsUnit), + width: S.optional(S.Number), + }), +).annotate({ + identifier: "ProductDimensions", +}) as any as S.Schema; + +/** Unit of measurement. Supported values: `KILOGRAM`, `POUND`. */ +export type ProductWeightUnit = "KILOGRAM" | "POUND"; +export const ProductWeightUnit = /*@__PURE__*/ S.String; + +/** Weight of the variant. */ +export interface ProductWeight { + unit?: ProductWeightUnit | (string & {}); + /** Weight amount. */ + value?: number; +} +export const ProductWeight = /*@__PURE__*/ S.suspend(() => + S.Struct({ + unit: S.optional(ProductWeightUnit), + value: S.optional(S.Number), + }), +).annotate({ identifier: "ProductWeight" }) as any as S.Schema; + +/** Measurements of the variant when it's shipped. Present for PHYSICAL products only. */ +export interface ProductMeasurements { + dimensions?: ProductDimensions; + weight?: ProductWeight; +} +export const ProductMeasurements = /*@__PURE__*/ S.suspend(() => + S.Struct({ + dimensions: S.optional(ProductDimensions), + weight: S.optional(ProductWeight), + }), +).annotate({ + identifier: "ProductMeasurements", +}) as any as S.Schema; + +/** Available stock for the variant. Present for PHYSICAL products only. */ +export interface ProductStock { + /** Number of units that can be purchased. */ + quantity?: number; + /** Indicates whether the variant has unlimited stock. */ + unlimited?: boolean; +} +export const ProductStock = /*@__PURE__*/ S.suspend(() => + S.Struct({ + quantity: S.optional(S.Number), + unlimited: S.optional(S.Boolean), + }), +).annotate({ identifier: "ProductStock" }) as any as S.Schema; + +export interface CreatePhysicalProductVariantRequest { + attributes?: CreatePhysicalProductVariantRequestAttributesMap; + /** Global Trade Item Number (GTIN). Optional. Must be 8, 12, 13, or 14 numeric digits. Whitespace, hyphens, and underscores are stripped before validation. */ + gtin?: string; + /** Manufacturer Part Number (MPN). Optional. Must be alphanumeric and 70 characters or fewer. Whitespace, hyphens, and underscores are stripped before validation. */ + mpn?: string; + pricing?: FullProductPricing; + shippingMeasurements?: ProductMeasurements; + sku?: string; + stock?: ProductStock; +} +export const CreatePhysicalProductVariantRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + attributes: S.optional(CreatePhysicalProductVariantRequestAttributesMap), + gtin: S.optional(S.String), + mpn: S.optional(S.String), + pricing: S.optional(FullProductPricing), + shippingMeasurements: S.optional(ProductMeasurements), + sku: S.optional(S.String), + stock: S.optional(ProductStock), + }), +).annotate({ + identifier: "CreatePhysicalProductVariantRequest", +}) as any as S.Schema; + +export type CreatePhysicalProductRequestVariantsList = + Array; +export const CreatePhysicalProductRequestVariantsList = /*@__PURE__*/ S.Array( + CreatePhysicalProductVariantRequest, +) as any as S.Schema; + +/** Request payload to create a PHYSICAL product. */ +export interface CreatePhysicalProductRequest { + description?: string; + isVisible?: boolean; + name?: string; + storePageId?: string; + tags?: CreatePhysicalProductRequestTagsList; + type?: string; + urlSlug?: string; + variantAttributes?: CreatePhysicalProductRequestVariantAttributesList; + variants?: CreatePhysicalProductRequestVariantsList; +} +export const CreatePhysicalProductRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + description: S.optional(S.String), + isVisible: S.optional(S.Boolean), + name: S.optional(S.String), + storePageId: S.optional(S.String), + tags: S.optional(CreatePhysicalProductRequestTagsList), + type: S.optional(S.String), + urlSlug: S.optional(S.String), + variantAttributes: S.optional( + CreatePhysicalProductRequestVariantAttributesList, + ), + variants: S.optional(CreatePhysicalProductRequestVariantsList), + }), +).annotate({ + identifier: "CreatePhysicalProductRequest", +}) as any as S.Schema; + +export type CreateServiceProductRequestTagsList = Array; +export const CreateServiceProductRequestTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export type CreateServiceProductRequestVariantAttributesList = Array; +export const CreateServiceProductRequestVariantAttributesList = + /*@__PURE__*/ S.Array( + S.String, + ) as any as S.Schema; + +export type CreateServiceProductVariantRequestAttributesMap = { + [key: string]: string | undefined; +}; +export const CreateServiceProductVariantRequestAttributesMap = + /*@__PURE__*/ S.Record( + S.String, + S.String, + ) as any as S.Schema; + +export interface CreateServiceProductVariantRequest { + attributes?: CreateServiceProductVariantRequestAttributesMap; + pricing?: FullProductPricing; + sku?: string; + stock?: ProductStock; +} +export const CreateServiceProductVariantRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + attributes: S.optional(CreateServiceProductVariantRequestAttributesMap), + pricing: S.optional(FullProductPricing), + sku: S.optional(S.String), + stock: S.optional(ProductStock), + }), +).annotate({ + identifier: "CreateServiceProductVariantRequest", +}) as any as S.Schema; + +export type CreateServiceProductRequestVariantsList = + Array; +export const CreateServiceProductRequestVariantsList = /*@__PURE__*/ S.Array( + CreateServiceProductVariantRequest, +) as any as S.Schema; + +/** Request payload to create a SERVICE product. */ +export interface CreateServiceProductRequest { + description?: string; + isVisible?: boolean; + name?: string; + storePageId?: string; + tags?: CreateServiceProductRequestTagsList; + type?: string; + urlSlug?: string; + variantAttributes?: CreateServiceProductRequestVariantAttributesList; + variants?: CreateServiceProductRequestVariantsList; +} +export const CreateServiceProductRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + description: S.optional(S.String), + isVisible: S.optional(S.Boolean), + name: S.optional(S.String), + storePageId: S.optional(S.String), + tags: S.optional(CreateServiceProductRequestTagsList), + type: S.optional(S.String), + urlSlug: S.optional(S.String), + variantAttributes: S.optional( + CreateServiceProductRequestVariantAttributesList, + ), + variants: S.optional(CreateServiceProductRequestVariantsList), + }), +).annotate({ + identifier: "CreateServiceProductRequest", +}) as any as S.Schema; + +export type CreateProductRequestBody = + | CreateGiftCardProductRequest + | CreatePhysicalProductRequest + | CreateServiceProductRequest; +export const CreateProductRequestBody = + /*@__PURE__*/ S.Unknown as any as S.Schema; + +export interface CreateProductRequest { + body: CreateProductRequestBody; +} +export const CreateProductRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + body: CreateProductRequestBody.pipe(T.HttpBody()), + }).pipe(T.Http({ method: "POST", uri: "/v2/commerce/products", code: 200 })), +).annotate({ + identifier: "CreateProductRequest", +}) as any as S.Schema; + +/** Available image sizes. Use with `images.url` and a `format` query parameter to retrieve the image at a particular width. */ +export type ProductImageAvailableFormatsList = Array; +export const ProductImageAvailableFormatsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** Product image assigned to the variant. */ +export interface ProductImage { + /** Alt text for the image; impacts SEO and appears in search results. */ + altText?: string; + /** Available image sizes. Use with `images.url` and a `format` query parameter to retrieve the image at a particular width. */ + availableFormats?: ProductImageAvailableFormatsList; + /** Unique ProductImage id. */ + id?: string; + /** Position of the image in the product's image list. */ + orderIndex?: number; + /** Image size when first uploaded. */ + originalSize?: unknown; + /** Absolute URL of the image hosted on Squarespace. */ + url?: string; +} +export const ProductImage = /*@__PURE__*/ S.suspend(() => + S.Struct({ + altText: S.optional(S.String), + availableFormats: S.optional(ProductImageAvailableFormatsList), + id: S.optional(S.String), + orderIndex: S.optional(S.Number), + originalSize: S.optional(S.Unknown), + url: S.optional(S.String), + }), +).annotate({ identifier: "ProductImage" }) as any as S.Schema; + +export type ProductV2ImagesList = Array; +export const ProductV2ImagesList = /*@__PURE__*/ S.Array( + ProductImage, +) as any as S.Schema; + +/** Options for search engine optimization. */ +export interface SeoOptions { + description?: string; + title?: string; +} +export const SeoOptions = /*@__PURE__*/ S.suspend(() => + S.Struct({ + description: S.optional(S.String), + title: S.optional(S.String), + }), +).annotate({ identifier: "SeoOptions" }) as any as S.Schema; + +export type ProductV2TagsList = Array; +export const ProductV2TagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export type ProductTypeV2 = "PHYSICAL" | "SERVICE" | "GIFT_CARD" | "DIGITAL"; +export const ProductTypeV2 = /*@__PURE__*/ S.String; + +export interface ProductV2 { + createdOn: string; + description?: string; + id: string; + images?: ProductV2ImagesList; + isVisible?: boolean; + modifiedOn: string; + name?: string; + seoOptions?: SeoOptions; + storePageId: string; + tags?: ProductV2TagsList; + type: ProductTypeV2; + url?: string; + urlSlug?: string; +} +export const ProductV2 = /*@__PURE__*/ S.suspend(() => + S.Struct({ + createdOn: S.String, + description: S.optional(S.String), + id: S.String, + images: S.optional(ProductV2ImagesList), + isVisible: S.optional(S.Boolean), + modifiedOn: S.String, + name: S.optional(S.String), + seoOptions: S.optional(SeoOptions), + storePageId: S.String, + tags: S.optional(ProductV2TagsList), + type: ProductTypeV2, + url: S.optional(S.String), + urlSlug: S.optional(S.String), + }), +).annotate({ identifier: "ProductV2" }) as any as S.Schema; + +/** Specifies attribute-value pairs for the variant. 100 char limit per key and per value with no more than six key-value pairs. Supported for PHYSICAL products only. */ +export type CreateProductVariantRequestAttributesMap = { + [key: string]: string | undefined; +}; +export const CreateProductVariantRequestAttributesMap = /*@__PURE__*/ S.Record( + S.String, + S.String, +) as any as S.Schema; + +/** Present for DIGITAL products only. Digital products don't have variants, so pricing is at the product level. */ +export interface ProductPricing { + basePrice?: MonetaryAmount; + /** Indicates whether the variant is sold according to its sale price. Present for PHYSICAL products only. */ + onSale?: boolean; + salePrice?: MonetaryAmount; +} +export const ProductPricing = /*@__PURE__*/ S.suspend(() => + S.Struct({ + basePrice: S.optional(MonetaryAmount), + onSale: S.optional(S.Boolean), + salePrice: S.optional(MonetaryAmount), + }), +).annotate({ identifier: "ProductPricing" }) as any as S.Schema; + +export interface CreateProductVariantRequest { + productId: string; + /** Specifies attribute-value pairs for the variant. 100 char limit per key and per value with no more than six key-value pairs. Supported for PHYSICAL products only. */ + attributes?: CreateProductVariantRequestAttributesMap; + /** Global Trade Item Number (GTIN). Optional. Must be 8, 12, 13, or 14 numeric digits. Whitespace, hyphens, and underscores are stripped before validation. Supported for PHYSICAL products only. */ + gtin?: string; + /** Manufacturer Part Number (MPN). Optional. Must be alphanumeric and 70 characters or fewer. Whitespace, hyphens, and underscores are stripped before validation. Supported for PHYSICAL products only. */ + mpn?: string; + pricing: ProductPricing; + shippingMeasurements?: ProductMeasurements; + /** Merchant-defined code that identifies the product variant. Value must be unique among variants. Leading and trailing whitespace is removed. */ + sku: string; + stock?: ProductStock; +} +export const CreateProductVariantRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + productId: S.String.pipe(T.Label()), + attributes: S.optional(CreateProductVariantRequestAttributesMap), + gtin: S.optional(S.String), + mpn: S.optional(S.String), + pricing: ProductPricing, + shippingMeasurements: S.optional(ProductMeasurements), + sku: S.String, + stock: S.optional(ProductStock), + }).pipe( + T.Http({ + method: "POST", + uri: "/v2/commerce/products/{productId}/variants", + code: 200, + }), + ), +).annotate({ + identifier: "CreateProductVariantRequest", +}) as any as S.Schema; + +export type PhysicalProductVariantAttributesMap = { + [key: string]: string | undefined; +}; +export const PhysicalProductVariantAttributesMap = /*@__PURE__*/ S.Record( + S.String, + S.String, +) as any as S.Schema; + +/** A variant of a PHYSICAL product. */ +export interface PhysicalProductVariant { + attributes?: PhysicalProductVariantAttributesMap; + gtin?: string; + id?: string; + image?: ProductImage; + mpn?: string; + pricing?: FullProductPricing; + shippingMeasurements?: ProductMeasurements; + sku?: string; + stock?: ProductStock; +} +export const PhysicalProductVariant = /*@__PURE__*/ S.suspend(() => + S.Struct({ + attributes: S.optional(PhysicalProductVariantAttributesMap), + gtin: S.optional(S.String), + id: S.optional(S.String), + image: S.optional(ProductImage), + mpn: S.optional(S.String), + pricing: S.optional(FullProductPricing), + shippingMeasurements: S.optional(ProductMeasurements), + sku: S.optional(S.String), + stock: S.optional(ProductStock), + }), +).annotate({ + identifier: "PhysicalProductVariant", +}) as any as S.Schema; + +/** A variant of a GIFT_CARD product. */ +export interface GiftCardProductVariant { + id?: string; + image?: ProductImage; + pricing?: SimpleProductPricing; + sku?: string; +} +export const GiftCardProductVariant = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.optional(S.String), + image: S.optional(ProductImage), + pricing: S.optional(SimpleProductPricing), + sku: S.optional(S.String), + }), +).annotate({ + identifier: "GiftCardProductVariant", +}) as any as S.Schema; + +export type ServiceProductVariantAttributesMap = { + [key: string]: string | undefined; +}; +export const ServiceProductVariantAttributesMap = /*@__PURE__*/ S.Record( + S.String, + S.String, +) as any as S.Schema; + +/** A variant of a SERVICE product. */ +export interface ServiceProductVariant { + attributes?: ServiceProductVariantAttributesMap; + id?: string; + image?: ProductImage; + pricing?: FullProductPricing; + sku?: string; + stock?: ProductStock; +} +export const ServiceProductVariant = /*@__PURE__*/ S.suspend(() => + S.Struct({ + attributes: S.optional(ServiceProductVariantAttributesMap), + id: S.optional(S.String), + image: S.optional(ProductImage), + pricing: S.optional(FullProductPricing), + sku: S.optional(S.String), + stock: S.optional(ProductStock), + }), +).annotate({ + identifier: "ServiceProductVariant", +}) as any as S.Schema; + +/** A product variant. The shape depends on the product type. */ +export type ProductVariantV2 = + | PhysicalProductVariant + | GiftCardProductVariant + | ServiceProductVariant; +export const ProductVariantV2 = + /*@__PURE__*/ S.Unknown as any as S.Schema; + +/** Description of the event that triggered the notification. * `order.create` - always value for OrderCreatePayload.topic ref * `order.update` - always value for OrderUpdatePayload.topic * `extension.uninstall` - always value for ExtensionUninstallPayload.topic * `contact.create` - always value for ContactCreatePayload.topic * `contact.update` - always value for ContactUpdatePayload.topic * `contact.delete` - always value for ContactDeletePayload.topic * `address.create` - always value for AddressCreatePayload.topic * `address.update` - always value for AddressUpdatePayload.topic * `address.delete` - always value for AddressDeletePayload.topic */ +export type CreateWebhookSubscriptionRequestTopicsItem = + | "order.create" + | "order.update" + | "extension.uninstall" + | "contact.create" + | "contact.update" + | "contact.delete" + | "address.create" + | "address.update" + | "address.delete"; +export const CreateWebhookSubscriptionRequestTopicsItem = + /*@__PURE__*/ S.String; + +/** List of event topics that trigger a webhook notification. */ +export type CreateWebhookSubscriptionRequestTopicsList = Array< + CreateWebhookSubscriptionRequestTopicsItem | (string & {}) +>; +export const CreateWebhookSubscriptionRequestTopicsList = /*@__PURE__*/ S.Array( + CreateWebhookSubscriptionRequestTopicsItem, +) as any as S.Schema; + +export interface CreateWebhookSubscriptionRequest { + /** HTTPS URL to POST webhook notifications. */ + endpointUrl: string; + /** List of event topics that trigger a webhook notification. */ + topics?: CreateWebhookSubscriptionRequestTopicsList; +} +export const CreateWebhookSubscriptionRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + endpointUrl: S.String, + topics: S.optional(CreateWebhookSubscriptionRequestTopicsList), + }).pipe( + T.Http({ method: "POST", uri: "/1.0/webhook_subscriptions", code: 200 }), + ), +).annotate({ + identifier: "CreateWebhookSubscriptionRequest", +}) as any as S.Schema; + +/** Description of the event that triggered the notification. * `order.create` - always value for OrderCreatePayload.topic ref * `order.update` - always value for OrderUpdatePayload.topic * `extension.uninstall` - always value for ExtensionUninstallPayload.topic * `contact.create` - always value for ContactCreatePayload.topic * `contact.update` - always value for ContactUpdatePayload.topic * `contact.delete` - always value for ContactDeletePayload.topic * `address.create` - always value for AddressCreatePayload.topic * `address.update` - always value for AddressUpdatePayload.topic * `address.delete` - always value for AddressDeletePayload.topic */ +export type ExternalCreateWebhookSubscriptionResponseTopicsItem = + | "order.create" + | "order.update" + | "extension.uninstall" + | "contact.create" + | "contact.update" + | "contact.delete" + | "address.create" + | "address.update" + | "address.delete"; +export const ExternalCreateWebhookSubscriptionResponseTopicsItem = + /*@__PURE__*/ S.String; + +/** List of event topics that trigger a webhook notification. */ +export type ExternalCreateWebhookSubscriptionResponseTopicsList = + Array; +export const ExternalCreateWebhookSubscriptionResponseTopicsList = + /*@__PURE__*/ S.Array( + ExternalCreateWebhookSubscriptionResponseTopicsItem, + ) as any as S.Schema; + +export interface ExternalCreateWebhookSubscriptionResponse { + /** Third-party client id. */ + clientId: string; + /** ISO 8601 UTC date and time string; represents when the webhook subscription was created. */ + createdOn: string; + /** HTTPS URL to POST webhook notifications. */ + endpointUrl: string; + /** Unique Webhook Subscription id. */ + id: string; + /** Hexadecimal value used to generate a signature for a webhook notification; field is only returned when creating a new subscription or rotating a secret. Store the secret in a safe location to verify notifications from Squarespace. See the 'Verifying notifications' guide under Webhooks for details. */ + secret: string | Redacted.Redacted; + /** List of event topics that trigger a webhook notification. */ + topics?: ExternalCreateWebhookSubscriptionResponseTopicsList; + /** ISO 8601 UTC date and time string; represents when the webhook subscription was last modified. */ + updatedOn: string; + /** Unique Webhook Subscription id. */ + websiteId: string; +} +export const ExternalCreateWebhookSubscriptionResponse = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + clientId: S.String, + createdOn: S.String, + endpointUrl: S.String, + id: S.String, + secret: S.String.pipe(T.SensitiveValue({})), + topics: S.optional(ExternalCreateWebhookSubscriptionResponseTopicsList), + updatedOn: S.String, + websiteId: S.String, + }), + ).annotate({ + identifier: "ExternalCreateWebhookSubscriptionResponse", + }) as any as S.Schema; + +export interface DeleteAddressBookEntryRequest { + /** The contact's ID. */ + contactId: string; + /** The address book entry's ID. */ + addressBookEntryId: string; +} +export const DeleteAddressBookEntryRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + contactId: S.String.pipe(T.Label()), + addressBookEntryId: S.String.pipe(T.Label()), + }).pipe( + T.Http({ + method: "DELETE", + uri: "/v1/contacts/{contactId}/address-book/{addressBookEntryId}", + code: 200, + }), + ), +).annotate({ + identifier: "DeleteAddressBookEntryRequest", +}) as any as S.Schema; + +export interface DeleteAddressBookEntryResponse {} +export const DeleteAddressBookEntryResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({}), +).annotate({ + identifier: "DeleteAddressBookEntryResponse", +}) as any as S.Schema; + +export interface DeleteContactRequest { + /** The contact's ID. */ + contactId: string; +} +export const DeleteContactRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + contactId: S.String.pipe(T.Label()), + }).pipe( + T.Http({ method: "DELETE", uri: "/v1/contacts/{contactId}", code: 200 }), + ), +).annotate({ + identifier: "DeleteContactRequest", +}) as any as S.Schema; + +export interface DeleteContactResponse {} +export const DeleteContactResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({}), +).annotate({ + identifier: "DeleteContactResponse", +}) as any as S.Schema; + +export interface DeleteDiscountRequest { + /** The discount's ID. */ + discountId: string; +} +export const DeleteDiscountRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + discountId: S.String.pipe(T.Label()), + }).pipe( + T.Http({ + method: "DELETE", + uri: "/v1/commerce/discounts/{discountId}", + code: 200, + }), + ), +).annotate({ + identifier: "DeleteDiscountRequest", +}) as any as S.Schema; + +export interface DeleteDiscountResponse {} +export const DeleteDiscountResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({}), +).annotate({ + identifier: "DeleteDiscountResponse", +}) as any as S.Schema; + +export interface DeleteProductRequest { + productId: string; +} +export const DeleteProductRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + productId: S.String.pipe(T.Label()), + }).pipe( + T.Http({ + method: "DELETE", + uri: "/v2/commerce/products/{productId}", + code: 200, + }), + ), +).annotate({ + identifier: "DeleteProductRequest", +}) as any as S.Schema; + +export interface DeleteProductResponse {} +export const DeleteProductResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({}), +).annotate({ + identifier: "DeleteProductResponse", +}) as any as S.Schema; + +export interface DeleteProductImageRequest { + productId: string; + imageId: string; +} +export const DeleteProductImageRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + productId: S.String.pipe(T.Label()), + imageId: S.String.pipe(T.Label()), + }).pipe( + T.Http({ + method: "DELETE", + uri: "/v2/commerce/products/{productId}/images/{imageId}", + code: 200, + }), + ), +).annotate({ + identifier: "DeleteProductImageRequest", +}) as any as S.Schema; + +export interface DeleteProductImageResponse {} +export const DeleteProductImageResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({}), +).annotate({ + identifier: "DeleteProductImageResponse", +}) as any as S.Schema; + +export interface DeleteProductVariantRequest { + productId: string; + variantId: string; +} +export const DeleteProductVariantRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + productId: S.String.pipe(T.Label()), + variantId: S.String.pipe(T.Label()), + }).pipe( + T.Http({ + method: "DELETE", + uri: "/v2/commerce/products/{productId}/variants/{variantId}", + code: 200, + }), + ), +).annotate({ + identifier: "DeleteProductVariantRequest", +}) as any as S.Schema; + +export interface DeleteProductVariantResponse {} +export const DeleteProductVariantResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({}), +).annotate({ + identifier: "DeleteProductVariantResponse", +}) as any as S.Schema; + +export interface DeleteWebhookSubscriptionRequest { + /** Specifies the Webhook Subscription to delete. */ + subscriptionId: string; +} +export const DeleteWebhookSubscriptionRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + subscriptionId: S.String.pipe(T.Label()), + }).pipe( + T.Http({ + method: "DELETE", + uri: "/1.0/webhook_subscriptions/{subscriptionId}", + code: 200, + }), + ), +).annotate({ + identifier: "DeleteWebhookSubscriptionRequest", +}) as any as S.Schema; + +export interface DeleteWebhookSubscriptionResponse {} +export const DeleteWebhookSubscriptionResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({}), +).annotate({ + identifier: "DeleteWebhookSubscriptionResponse", +}) as any as S.Schema; + +/** Array of shipment data. */ +export type FulfillOrderRequestShipmentsList = + Array; +export const FulfillOrderRequestShipmentsList = /*@__PURE__*/ S.Array( + CreateOrderShipmentRequest, +) as any as S.Schema; + +export interface FulfillOrderRequest { + /** Specifies the Order to update. */ + id: string; + /** Array of shipment data. */ + shipments?: FulfillOrderRequestShipmentsList; + /** Indicates whether the customer should receive an email notification about the added shipments. */ + shouldSendNotification?: boolean; +} +export const FulfillOrderRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.String.pipe(T.Label()), + shipments: S.optional(FulfillOrderRequestShipmentsList), + shouldSendNotification: S.optional(S.Boolean), + }).pipe( + T.Http({ + method: "POST", + uri: "/1.0/commerce/orders/{id}/fulfillments", + code: 200, + }), + ), +).annotate({ + identifier: "FulfillOrderRequest", +}) as any as S.Schema; + +export interface FulfillOrderResponse {} +export const FulfillOrderResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({}), +).annotate({ + identifier: "FulfillOrderResponse", +}) as any as S.Schema; + +export interface GetAddressBookRequest { + /** The contact's ID. */ + contactId: string; + /** number of contacts to retrieve per request */ + pageSize?: number; + /** where next page of results begins. should be {pagination.nextPageCursor} from previous response. */ + cursor?: string; +} +export const GetAddressBookRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + contactId: S.String.pipe(T.Label()), + pageSize: S.optional(S.Number.pipe(T.Query())), + cursor: S.optional(S.String.pipe(T.Query())), + }).pipe( + T.Http({ + method: "GET", + uri: "/v1/contacts/{contactId}/address-book", + code: 200, + }), + ), +).annotate({ + identifier: "GetAddressBookRequest", +}) as any as S.Schema; + +/** List of Address Book Entries */ +export type AddressBookAddressBookEntriesList = Array; +export const AddressBookAddressBookEntriesList = /*@__PURE__*/ S.Array( + AddressBookEntry, +) as any as S.Schema; + +/** Address settings for a contact. When there is at least one address book entry, exactly one is the default shipping address; default shipping address is always returned on the first page of paginated results). */ +export interface AddressBook { + /** List of Address Book Entries */ + addressBookEntries?: AddressBookAddressBookEntriesList; + /** The id of the address book entry that is the default shipping address. */ + defaultShippingAddressId?: string; +} +export const AddressBook = /*@__PURE__*/ S.suspend(() => + S.Struct({ + addressBookEntries: S.optional(AddressBookAddressBookEntriesList), + defaultShippingAddressId: S.optional(S.String), + }), +).annotate({ identifier: "AddressBook" }) as any as S.Schema; + +export interface PaginationDetails { + hasNextPage?: boolean; + nextPageCursor?: string; + nextPageUrl?: string; +} +export const PaginationDetails = /*@__PURE__*/ S.suspend(() => + S.Struct({ + hasNextPage: S.optional(S.Boolean), + nextPageCursor: S.optional(S.String), + nextPageUrl: S.optional(S.String), + }), +).annotate({ + identifier: "PaginationDetails", +}) as any as S.Schema; + +export interface GetAddressBookResponse { + addressBook?: AddressBook; + pagination?: PaginationDetails; +} +export const GetAddressBookResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + addressBook: S.optional(AddressBook), + pagination: S.optional(PaginationDetails), + }), +).annotate({ + identifier: "GetAddressBookResponse", +}) as any as S.Schema; + +export interface GetAddressBookEntryRequest { + /** The contact's ID. */ + contactId: string; + /** The address book entry's ID. */ + addressBookEntryId: string; +} +export const GetAddressBookEntryRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + contactId: S.String.pipe(T.Label()), + addressBookEntryId: S.String.pipe(T.Label()), + }).pipe( + T.Http({ + method: "GET", + uri: "/v1/contacts/{contactId}/address-book/{addressBookEntryId}", + code: 200, + }), + ), +).annotate({ + identifier: "GetAddressBookEntryRequest", +}) as any as S.Schema; + +export interface GetAddressBookEntryResponse { + addressBookEntry?: AddressBookEntry; +} +export const GetAddressBookEntryResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + addressBookEntry: S.optional(AddressBookEntry), + }), +).annotate({ + identifier: "GetAddressBookEntryResponse", +}) as any as S.Schema; + +export interface GetContactRequest { + /** The contact's ID. */ + contactId: string; +} +export const GetContactRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + contactId: S.String.pipe(T.Label()), + }).pipe( + T.Http({ method: "GET", uri: "/v1/contacts/{contactId}", code: 200 }), + ), +).annotate({ + identifier: "GetContactRequest", +}) as any as S.Schema; + +export interface GetContactResponse { + contact?: Contact; +} +export const GetContactResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + contact: S.optional(Contact), + }), +).annotate({ + identifier: "GetContactResponse", +}) as any as S.Schema; + +export interface GetContactsRequest { + /** number of contacts to retrieve per request */ + pageSize?: number; + /** where next page of results begins. should be {pagination.nextPageCursor} from previous response. */ + cursor?: string; +} +export const GetContactsRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + pageSize: S.optional(S.Number.pipe(T.Query())), + cursor: S.optional(S.String.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/v1/contacts", code: 200 })), +).annotate({ + identifier: "GetContactsRequest", +}) as any as S.Schema; + +/** paginated list of contacts retrieved */ +export type PaginatedGetContactsResponseContactsList = Array; +export const PaginatedGetContactsResponseContactsList = /*@__PURE__*/ S.Array( + Contact, +) as any as S.Schema; + +export type PaginatedGetContactsResponsePagination = PaginationDetails; +export const PaginatedGetContactsResponsePagination = PaginationDetails; + +export interface PaginatedGetContactsResponse { + /** paginated list of contacts retrieved */ + contacts: PaginatedGetContactsResponseContactsList; + pagination?: PaginationDetails; +} +export const PaginatedGetContactsResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + contacts: PaginatedGetContactsResponseContactsList, + pagination: S.optional(PaginationDetails), + }), +).annotate({ + identifier: "PaginatedGetContactsResponse", +}) as any as S.Schema; + +export interface GetDiscountRequest { + /** The discount's ID */ + discountId: string; +} +export const GetDiscountRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + discountId: S.String.pipe(T.Label()), + }).pipe( + T.Http({ + method: "GET", + uri: "/v1/commerce/discounts/{discountId}", + code: 200, + }), + ), +).annotate({ + identifier: "GetDiscountRequest", +}) as any as S.Schema; + +export interface GetDocumentsByIdRequest { + /** Specifies the Documents to retrieve. Multiple Documents can be retrieved by providing a comma-separated list of Document ids. */ + documentIds: string; +} +export const GetDocumentsByIdRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + documentIds: S.String.pipe(T.Label()), + }).pipe( + T.Http({ + method: "GET", + uri: "/1.0/commerce/transactions/{documentIds}", + code: 200, + }), + ), +).annotate({ + identifier: "GetDocumentsByIdRequest", +}) as any as S.Schema; + +/** Array of discounts for an order payment transaction; empty for donations. */ +export interface TransactionDiscount { + amount?: MonetaryAmount; + /** Discount description. */ + description?: string; + /** Discount name. */ + name?: string; +} +export const TransactionDiscount = /*@__PURE__*/ S.suspend(() => + S.Struct({ + amount: S.optional(MonetaryAmount), + description: S.optional(S.String), + name: S.optional(S.String), + }), +).annotate({ + identifier: "TransactionDiscount", +}) as any as S.Schema; + +/** Array of discounts for an order payment transaction; empty for donations. */ +export type TransactionDocumentDiscountsList = Array; +export const TransactionDocumentDiscountsList = /*@__PURE__*/ S.Array( + TransactionDiscount, +) as any as S.Schema; + +/** Captures errors from the payment gateway; value is null if not applicable. */ +export type PaymentGatewayError = + | "GATEWAY_FEE_PROCEESING_ERROR" + | "GATEWAY_API_PERMISSION_ERROR" + | "GATEWAY_DISCONNNECTED"; +export const PaymentGatewayError = /*@__PURE__*/ S.String; + +/** Array of properties for the payment transaction provided by the payment gateway. Properties are listed in key/value pairs. */ +export interface ExternalTransactionProperty { + key?: string; + value?: string; +} +export const ExternalTransactionProperty = /*@__PURE__*/ S.suspend(() => + S.Struct({ + key: S.optional(S.String), + value: S.optional(S.String), + }), +).annotate({ + identifier: "ExternalTransactionProperty", +}) as any as S.Schema; + +/** Array of properties for the payment transaction provided by the payment gateway. Properties are listed in key/value pairs. */ +export type TransactionPaymentExternalTransactionPropertiesList = + Array; +export const TransactionPaymentExternalTransactionPropertiesList = + /*@__PURE__*/ S.Array( + ExternalTransactionProperty, + ) as any as S.Schema; + +/** Array of processing fee refunds for the payment. */ +export interface TransactionProcessingFeeRefund { + amount?: MonetaryAmount; + amountGatewayCurrency?: MonetaryAmount; + /** Foreign exchange rate between the payment gateway's and payment's currencies; determined when the payment is processed. */ + exchangeRate?: number; + /** Unique id for the processing fee refund transaction provided by the payment gateway. */ + externalTransactionId?: string; + /** Unique processing fee refund id. */ + id?: string; + /** ISO 8601 UTC date and time string; represents when the processing fee refund was issued. */ + refundedOn?: string; +} +export const TransactionProcessingFeeRefund = /*@__PURE__*/ S.suspend(() => + S.Struct({ + amount: S.optional(MonetaryAmount), + amountGatewayCurrency: S.optional(MonetaryAmount), + exchangeRate: S.optional(S.Number), + externalTransactionId: S.optional(S.String), + id: S.optional(S.String), + refundedOn: S.optional(S.String), + }), +).annotate({ + identifier: "TransactionProcessingFeeRefund", +}) as any as S.Schema; + +/** Array of processing fee refunds for the payment. */ +export type TransactionProcessingFeeFeeRefundsList = + Array; +export const TransactionProcessingFeeFeeRefundsList = /*@__PURE__*/ S.Array( + TransactionProcessingFeeRefund, +) as any as S.Schema; + +/** Array of processing fees associated with the payment. */ +export interface TransactionProcessingFee { + amount?: MonetaryAmount; + amountGatewayCurrency?: MonetaryAmount; + /** Foreign exchange rate between the payment gateway's and payment's currencies; determined when the payment is processed. */ + exchangeRate?: number; + /** Array of processing fee refunds for the payment. */ + feeRefunds?: TransactionProcessingFeeFeeRefundsList; + /** Unique processing fee id. */ + id?: string; + netAmount?: MonetaryAmount; + netAmountGatewayCurrency?: MonetaryAmount; + refundedAmount?: MonetaryAmount; + refundedAmountGatewayCurrency?: MonetaryAmount; +} +export const TransactionProcessingFee = /*@__PURE__*/ S.suspend(() => + S.Struct({ + amount: S.optional(MonetaryAmount), + amountGatewayCurrency: S.optional(MonetaryAmount), + exchangeRate: S.optional(S.Number), + feeRefunds: S.optional(TransactionProcessingFeeFeeRefundsList), + id: S.optional(S.String), + netAmount: S.optional(MonetaryAmount), + netAmountGatewayCurrency: S.optional(MonetaryAmount), + refundedAmount: S.optional(MonetaryAmount), + refundedAmountGatewayCurrency: S.optional(MonetaryAmount), + }), +).annotate({ + identifier: "TransactionProcessingFee", +}) as any as S.Schema; + +/** Array of processing fees associated with the payment. */ +export type TransactionPaymentProcessingFeesList = + Array; +export const TransactionPaymentProcessingFeesList = /*@__PURE__*/ S.Array( + TransactionProcessingFee, +) as any as S.Schema; + +/** Array of refunds for the payment transaction. */ +export interface TransactionRefund { + amount?: MonetaryAmount; + /** Unique id for the refund transaction provided by the payment gateway. */ + externalTransactionId?: string; + /** Unique refund id. */ + id?: string; + /** ISO 8601 UTC date and time string; represents refund issue date. */ + refundedOn?: string; +} +export const TransactionRefund = /*@__PURE__*/ S.suspend(() => + S.Struct({ + amount: S.optional(MonetaryAmount), + externalTransactionId: S.optional(S.String), + id: S.optional(S.String), + refundedOn: S.optional(S.String), + }), +).annotate({ + identifier: "TransactionRefund", +}) as any as S.Schema; + +/** Array of refunds for the payment transaction. */ +export type TransactionPaymentRefundsList = Array; +export const TransactionPaymentRefundsList = /*@__PURE__*/ S.Array( + TransactionRefund, +) as any as S.Schema; + +/** Array of payment transactions for the order or donation. */ +export interface TransactionPayment { + amount?: MonetaryAmount; + /** Payment credit card type; possible values: VISA, MASTERCARD, DISCOVER, AMEX, JCB, and OTHER. null if credit card processing isn't available for the payment gateway. */ + creditCardType?: string; + /** Unique customer id for the payment transaction provided by the payment gateway. Value is null if not available. */ + externalCustomerId?: string; + /** Unique id for the payment transaction provided by the payment gateway. */ + externalTransactionId?: string; + /** Array of properties for the payment transaction provided by the payment gateway. Properties are listed in key/value pairs. */ + externalTransactionProperties?: TransactionPaymentExternalTransactionPropertiesList; + /** Unique id for a Squarespace gift card. Value is null if a gift card was not used. */ + giftCardId?: string; + /** Unique payment id. */ + id?: string; + netAmount?: MonetaryAmount; + /** ISO 8601 UTC date and time string; represents when the payment was made. */ + paidOn?: string; + /** Array of processing fees associated with the payment. */ + processingFees?: TransactionPaymentProcessingFeesList; + /** Payment gateway used for processing. */ + provider?: string; + refundedAmount?: MonetaryAmount; + /** Array of refunds for the payment transaction. */ + refunds?: TransactionPaymentRefundsList; +} +export const TransactionPayment = /*@__PURE__*/ S.suspend(() => + S.Struct({ + amount: S.optional(MonetaryAmount), + creditCardType: S.optional(S.String), + externalCustomerId: S.optional(S.String), + externalTransactionId: S.optional(S.String), + externalTransactionProperties: S.optional( + TransactionPaymentExternalTransactionPropertiesList, + ), + giftCardId: S.optional(S.String), + id: S.optional(S.String), + netAmount: S.optional(MonetaryAmount), + paidOn: S.optional(S.String), + processingFees: S.optional(TransactionPaymentProcessingFeesList), + provider: S.optional(S.String), + refundedAmount: S.optional(MonetaryAmount), + refunds: S.optional(TransactionPaymentRefundsList), + }), +).annotate({ + identifier: "TransactionPayment", +}) as any as S.Schema; + +/** Array of payment transactions for the order or donation. */ +export type TransactionDocumentPaymentsList = Array; +export const TransactionDocumentPaymentsList = /*@__PURE__*/ S.Array( + TransactionPayment, +) as any as S.Schema; + +/** Array of taxes for the shipping line item. */ +export interface TransactionTax { + amount?: MonetaryAmount; + /** Tax jurisdiction in COUNTRY:{value},STATE:{value},LOCAL:{value} format. Examples: COUNTRY:US, COUNTRY:US,STATE:NY, and COUNTRY:US,STATE:NY,LOCAL:10001. */ + jurisdiction?: string; + /** Tax classification as defined by the Squarespace merchant. */ + name?: string; + /** Tax rate as a percent. For example, a value of 7.00 is a 7% tax. */ + rate?: string; +} +export const TransactionTax = /*@__PURE__*/ S.suspend(() => + S.Struct({ + amount: S.optional(MonetaryAmount), + jurisdiction: S.optional(S.String), + name: S.optional(S.String), + rate: S.optional(S.String), + }), +).annotate({ identifier: "TransactionTax" }) as any as S.Schema; + +/** Array of taxes for the sale item. */ +export type TransactionSalesLineItemTaxesList = Array; +export const TransactionSalesLineItemTaxesList = /*@__PURE__*/ S.Array( + TransactionTax, +) as any as S.Schema; + +/** Array of sales items for an order payment transaction; empty for donations. */ +export interface TransactionSalesLineItem { + discountAmount?: MonetaryAmount; + /** Unique id for the sales item. */ + id?: string; + /** Array of taxes for the sale item. */ + taxes?: TransactionSalesLineItemTaxesList; + total?: MonetaryAmount; + totalNetSales?: MonetaryAmount; + totalSales?: MonetaryAmount; +} +export const TransactionSalesLineItem = /*@__PURE__*/ S.suspend(() => + S.Struct({ + discountAmount: S.optional(MonetaryAmount), + id: S.optional(S.String), + taxes: S.optional(TransactionSalesLineItemTaxesList), + total: S.optional(MonetaryAmount), + totalNetSales: S.optional(MonetaryAmount), + totalSales: S.optional(MonetaryAmount), + }), +).annotate({ + identifier: "TransactionSalesLineItem", +}) as any as S.Schema; + +/** Array of sales items for an order payment transaction; empty for donations. */ +export type TransactionDocumentSalesLineItemsList = + Array; +export const TransactionDocumentSalesLineItemsList = /*@__PURE__*/ S.Array( + TransactionSalesLineItem, +) as any as S.Schema; + +/** Array of taxes for the shipping line item. */ +export type TransactionShippingLineItemTaxesList = Array; +export const TransactionShippingLineItemTaxesList = /*@__PURE__*/ S.Array( + TransactionTax, +) as any as S.Schema; + +/** Array of shipping line items. */ +export interface TransactionShippingLineItem { + amount?: MonetaryAmount; + /** Description of the shipping line item as defined by the Squarespace merchant. */ + description?: string; + discountAmount?: MonetaryAmount; + /** Unique id for the shipping line item. */ + id?: string; + netAmount?: MonetaryAmount; + /** Array of taxes for the shipping line item. */ + taxes?: TransactionShippingLineItemTaxesList; +} +export const TransactionShippingLineItem = /*@__PURE__*/ S.suspend(() => + S.Struct({ + amount: S.optional(MonetaryAmount), + description: S.optional(S.String), + discountAmount: S.optional(MonetaryAmount), + id: S.optional(S.String), + netAmount: S.optional(MonetaryAmount), + taxes: S.optional(TransactionShippingLineItemTaxesList), + }), +).annotate({ + identifier: "TransactionShippingLineItem", +}) as any as S.Schema; + +/** Array of shipping line items. */ +export type TransactionDocumentShippingLineItemsList = + Array; +export const TransactionDocumentShippingLineItemsList = /*@__PURE__*/ S.Array( + TransactionShippingLineItem, +) as any as S.Schema; + +/** Array of Document resources. */ +export interface TransactionDocument { + /** ISO 8601 UTC date and time string; represents when the Document was created. */ + createdOn?: string; + /** Customer or donor email address. May be null for point of sale orders because email wasn't collected. */ + customerEmail?: string; + /** Array of discounts for an order payment transaction; empty for donations. */ + discounts?: TransactionDocumentDiscountsList; + /** Unique Document id. */ + id?: string; + /** ISO 8601 UTC date and time string; represents when the Document was last modified. */ + modifiedOn?: string; + paymentGatewayError?: PaymentGatewayError; + /** Array of payment transactions for the order or donation. */ + payments?: TransactionDocumentPaymentsList; + /** Array of sales items for an order payment transaction; empty for donations. */ + salesLineItems?: TransactionDocumentSalesLineItemsList; + /** Unique order id; not applicable if payment transaction is a donation. */ + salesOrderId?: string; + /** Array of shipping line items. */ + shippingLineItems?: TransactionDocumentShippingLineItemsList; + total?: MonetaryAmount; + totalNetPayment?: MonetaryAmount; + totalNetSales?: MonetaryAmount; + totalNetShipping?: MonetaryAmount; + totalSales?: MonetaryAmount; + totalTaxes?: MonetaryAmount; + /** Flag; indicates order cancellation. */ + voided?: boolean; +} +export const TransactionDocument = /*@__PURE__*/ S.suspend(() => + S.Struct({ + createdOn: S.optional(S.String), + customerEmail: S.optional(S.String), + discounts: S.optional(TransactionDocumentDiscountsList), + id: S.optional(S.String), + modifiedOn: S.optional(S.String), + paymentGatewayError: S.optional(PaymentGatewayError), + payments: S.optional(TransactionDocumentPaymentsList), + salesLineItems: S.optional(TransactionDocumentSalesLineItemsList), + salesOrderId: S.optional(S.String), + shippingLineItems: S.optional(TransactionDocumentShippingLineItemsList), + total: S.optional(MonetaryAmount), + totalNetPayment: S.optional(MonetaryAmount), + totalNetSales: S.optional(MonetaryAmount), + totalNetShipping: S.optional(MonetaryAmount), + totalSales: S.optional(MonetaryAmount), + totalTaxes: S.optional(MonetaryAmount), + voided: S.optional(S.Boolean), + }), +).annotate({ + identifier: "TransactionDocument", +}) as any as S.Schema; + +/** Array of Document resources. */ +export type TransactionListResponseDocumentsList = Array; +export const TransactionListResponseDocumentsList = /*@__PURE__*/ S.Array( + TransactionDocument, +) as any as S.Schema; + +export interface TransactionListResponse { + /** Array of Document resources. */ + documents?: TransactionListResponseDocumentsList; +} +export const TransactionListResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + documents: S.optional(TransactionListResponseDocumentsList), + }), +).annotate({ + identifier: "TransactionListResponse", +}) as any as S.Schema; + +export interface GetDocumentsByUpdatedOnRequest { + /** Identifies where the next page of results should begin. Should be the value of pagination.nextPageCursor from a previous response. */ + cursor?: string; + /** Time-boxes the request to Documents that were modified after a given ISO 8601 UTC date and time string (YYYY-MM-DDThh:mm:ss.sZ). */ + modifiedAfter?: string; + /** Time-boxes the request to Documents that were modified before a given ISO 8601 UTC date and time string (YYYY-MM-DDThh:mm:ss.sZ). */ + modifiedBefore?: string; + orderId?: string; +} +export const GetDocumentsByUpdatedOnRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + cursor: S.optional(S.String.pipe(T.Query())), + modifiedAfter: S.optional(S.String.pipe(T.Query())), + modifiedBefore: S.optional(S.String.pipe(T.Query())), + orderId: S.optional(S.String.pipe(T.Query())), + }).pipe( + T.Http({ method: "GET", uri: "/1.0/commerce/transactions", code: 200 }), + ), +).annotate({ + identifier: "GetDocumentsByUpdatedOnRequest", +}) as any as S.Schema; + +/** Array of Document resources. If the merchant site doesn't have any payment transactions for orders or donations, this array is empty. */ +export type PaginatedTransactionListResponseDocumentsList = + Array; +export const PaginatedTransactionListResponseDocumentsList = + /*@__PURE__*/ S.Array( + TransactionDocument, + ) as any as S.Schema; + +export type PaginatedTransactionListResponsePagination = PaginationDetails; +export const PaginatedTransactionListResponsePagination = PaginationDetails; + +export interface PaginatedTransactionListResponse { + /** Array of Document resources. If the merchant site doesn't have any payment transactions for orders or donations, this array is empty. */ + documents: PaginatedTransactionListResponseDocumentsList; + pagination?: PaginationDetails; +} +export const PaginatedTransactionListResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + documents: PaginatedTransactionListResponseDocumentsList, + pagination: S.optional(PaginationDetails), + }), +).annotate({ + identifier: "PaginatedTransactionListResponse", +}) as any as S.Schema; + +export interface GetFulfillmentOptionsRequest {} +export const GetFulfillmentOptionsRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({}).pipe( + T.Http({ + method: "GET", + uri: "/v1/fulfillments/fulfillment-options", + code: 200, + }), + ), +).annotate({ + identifier: "GetFulfillmentOptionsRequest", +}) as any as S.Schema; + +/** Carrier service identifier and display name. */ +export interface CarrierService { + /** Human-readable carrier service name. */ + description: string; + /** Carrier service identifier. */ + name: string; +} +export const CarrierService = /*@__PURE__*/ S.suspend(() => + S.Struct({ + description: S.String, + name: S.String, + }), +).annotate({ identifier: "CarrierService" }) as any as S.Schema; + +/** Available carrier services. */ +export type FulfillmentOptionAvailableServicesList = Array; +export const FulfillmentOptionAvailableServicesList = /*@__PURE__*/ S.Array( + CarrierService, +) as any as S.Schema; + +/** Fulfillment channel for this option. */ +export type FulfillmentOptionType = "SHIPPING" | "PICKUP" | "LOCAL_DELIVERY"; +export const FulfillmentOptionType = /*@__PURE__*/ S.String; + +/** Fulfillment option IDs and carrier services for a website. */ +export interface FulfillmentOption { + /** Available carrier services. */ + availableServices: FulfillmentOptionAvailableServicesList; + /** Fulfillment option id. */ + id: string; + /** Display name for the option. */ + name: string; + /** Fulfillment channel for this option. */ + type: FulfillmentOptionType; +} +export const FulfillmentOption = /*@__PURE__*/ S.suspend(() => + S.Struct({ + availableServices: FulfillmentOptionAvailableServicesList, + id: S.String, + name: S.String, + type: FulfillmentOptionType, + }), +).annotate({ + identifier: "FulfillmentOption", +}) as any as S.Schema; + +/** Fulfillment option IDs and carrier services for this website. */ +export type FulfillmentOptionsListFulfillmentOptionsList = + Array; +export const FulfillmentOptionsListFulfillmentOptionsList = + /*@__PURE__*/ S.Array( + FulfillmentOption, + ) as any as S.Schema; + +/** List of fulfillment option IDs and carrier services. */ +export interface FulfillmentOptionsList { + /** Fulfillment option IDs and carrier services for this website. */ + fulfillmentOptions: FulfillmentOptionsListFulfillmentOptionsList; +} +export const FulfillmentOptionsList = /*@__PURE__*/ S.suspend(() => + S.Struct({ + fulfillmentOptions: FulfillmentOptionsListFulfillmentOptionsList, + }), +).annotate({ + identifier: "FulfillmentOptionsList", +}) as any as S.Schema; + +export interface GetInventoryItemsRequest { + /** Identifies where the next page of results should begin. Should be the value of pagination.nextPageCursor from a previous response. If not present or empty, the endpoint returns up to 50 InventoryItems. */ + cursor?: string; +} +export const GetInventoryItemsRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + cursor: S.optional(S.String.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/1.0/commerce/inventory", code: 200 })), +).annotate({ + identifier: "GetInventoryItemsRequest", +}) as any as S.Schema; + +/** Array of InventoryItem resources. If the merchant site doesn't have any physical or service products, this array is empty. */ +export interface InventoryItem { + /** Generated description using the product's title and any available variant attributes including, but not limited to, color and size. */ + descriptor?: string; + /** Indicates whether stock is currently tracked for the item. */ + isUnlimited?: boolean; + /** Current amount in stock, or the last known stock amount prior to becoming unlimited. This value is modified by purchases and returns only when `isUnlimited` is `false`. */ + quantity?: number; + /** Stock keeping unit (SKU) code assigned by the Squarespace merchant for the variant; used to identify an exact variant of a product using a naming scheme preferred by the merchant. */ + sku?: string; + /** The product variant id, which also serves as a unique id for the InventoryItem. */ + variantId?: string; +} +export const InventoryItem = /*@__PURE__*/ S.suspend(() => + S.Struct({ + descriptor: S.optional(S.String), + isUnlimited: S.optional(S.Boolean), + quantity: S.optional(S.Number), + sku: S.optional(S.String), + variantId: S.optional(S.String), + }), +).annotate({ identifier: "InventoryItem" }) as any as S.Schema; + +/** Array of InventoryItem resources. If the merchant site doesn't have any physical or service product variants, this array is empty. */ +export type PaginatedInventoryItemListResponseInventoryList = + Array; +export const PaginatedInventoryItemListResponseInventoryList = + /*@__PURE__*/ S.Array( + InventoryItem, + ) as any as S.Schema; + +export type PaginatedInventoryItemListResponsePagination = PaginationDetails; +export const PaginatedInventoryItemListResponsePagination = PaginationDetails; + +export interface PaginatedInventoryItemListResponse { + /** Array of InventoryItem resources. If the merchant site doesn't have any physical or service product variants, this array is empty. */ + inventory: PaginatedInventoryItemListResponseInventoryList; + pagination?: PaginationDetails; +} +export const PaginatedInventoryItemListResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + inventory: PaginatedInventoryItemListResponseInventoryList, + pagination: S.optional(PaginationDetails), + }), +).annotate({ + identifier: "PaginatedInventoryItemListResponse", +}) as any as S.Schema; + +export interface GetMemberProfileRequest {} +export const GetMemberProfileRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({}).pipe( + T.Http({ method: "GET", uri: "/1.0/authorization/member", code: 200 }), + ), +).annotate({ + identifier: "GetMemberProfileRequest", +}) as any as S.Schema; + +export interface MemberProfile { + /** Profile email address. */ + email?: string; + /** Profile first name. */ + firstName?: string; + /** Unique Profile id. */ + id?: string; + /** Profile last name. */ + lastName?: string; +} +export const MemberProfile = /*@__PURE__*/ S.suspend(() => + S.Struct({ + email: S.optional(S.String), + firstName: S.optional(S.String), + id: S.optional(S.String), + lastName: S.optional(S.String), + }), +).annotate({ identifier: "MemberProfile" }) as any as S.Schema; + +export interface GetOrderRequest { + /** Specifies the Order to retrieve. */ + id: string; +} +export const GetOrderRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.String.pipe(T.Label()), + }).pipe( + T.Http({ method: "GET", uri: "/1.0/commerce/orders/{id}", code: 200 }), + ), +).annotate({ + identifier: "GetOrderRequest", +}) as any as S.Schema; + +export interface GetOrdersRequest { + /** Used to filter Orders by Customer ID. */ + customerId?: string; + /** Time-boxes the request to Orders that were modified after a given ISO 8601 UTC date and time string (YYYY-MM-DDThh:mm:ss.sZ). Required when modifiedBefore is passed; cannot be used with cursor. */ + modifiedAfter?: string; + /** Time-boxes the request to Orders that were modified before a given ISO 8601 UTC date and time string (YYYY-MM-DDThh:mm:ss.sZ). Required when modifiedAfter is passed; cannot be used with cursor. */ + modifiedBefore?: string; + /** Identifies where the next page of results should begin. Should be the value of pagination.nextPageCursor from a previous response. Cannot be used with other parameters. */ + cursor?: string; + /** Used to filter Orders by fulfillment status. Values may be PENDING, FULFILLED, or CANCELED. */ + fulfillmentStatus?: string; + /** Used to filter Orders by payment state. Accepts a comma-separated list of values. Possible values are: NOT_CHARGED, AUTHORIZED, PAID, REFUNDED, PENDING, FAILED, REFUND_PENDING, REFUND_FAILED, PARTIALLY_PAID. If not specified, defaults to NOT_CHARGED, AUTHORIZED, PAID, and REFUNDED. */ + paymentStates?: string; +} +export const GetOrdersRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + customerId: S.optional(S.String.pipe(T.Query())), + modifiedAfter: S.optional(S.String.pipe(T.Query())), + modifiedBefore: S.optional(S.String.pipe(T.Query())), + cursor: S.optional(S.String.pipe(T.Query())), + fulfillmentStatus: S.optional(S.String.pipe(T.Query())), + paymentStates: S.optional(S.String.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/1.0/commerce/orders", code: 200 })), +).annotate({ + identifier: "GetOrdersRequest", +}) as any as S.Schema; + +export type OrderListResponsePagination = PaginationDetails; +export const OrderListResponsePagination = PaginationDetails; + +export type OrderListResponseResultList = Array; +export const OrderListResponseResultList = /*@__PURE__*/ S.Array( + Order, +) as any as S.Schema; + +export interface OrderListResponse { + pagination?: PaginationDetails; + result: OrderListResponseResultList; +} +export const OrderListResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + pagination: S.optional(PaginationDetails), + result: OrderListResponseResultList, + }), +).annotate({ + identifier: "OrderListResponse", +}) as any as S.Schema; + +export interface GetProductImageProcessingStatusRequest { + productId: string; + imageId: string; +} +export const GetProductImageProcessingStatusRequest = /*@__PURE__*/ S.suspend( + () => + S.Struct({ + productId: S.String.pipe(T.Label()), + imageId: S.String.pipe(T.Label()), + }).pipe( + T.Http({ + method: "GET", + uri: "/v2/commerce/products/{productId}/images/{imageId}/status", + code: 200, + }), + ), +).annotate({ + identifier: "GetProductImageProcessingStatusRequest", +}) as any as S.Schema; + +export type ImageProcessingStatus = "QUEUED" | "PROCESSING" | "READY" | "ERROR"; +export const ImageProcessingStatus = /*@__PURE__*/ S.String; + +export interface ProductImageProcessingStatus { + id?: string; + status?: ImageProcessingStatus; +} +export const ProductImageProcessingStatus = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.optional(S.String), + status: S.optional(ImageProcessingStatus), + }), +).annotate({ + identifier: "ProductImageProcessingStatus", +}) as any as S.Schema; + +export type GetProductsRequestTypeList = Array; +export const GetProductsRequestTypeList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export interface GetProductsRequest { + modifiedAfter?: string; + modifiedBefore?: string; + cursor?: string; + query?: string; + type?: GetProductsRequestTypeList; +} +export const GetProductsRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + modifiedAfter: S.optional(S.String.pipe(T.Query())), + modifiedBefore: S.optional(S.String.pipe(T.Query())), + cursor: S.optional(S.String.pipe(T.Query())), + query: S.optional(S.String.pipe(T.Query())), + type: S.optional(GetProductsRequestTypeList.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/v2/commerce/products", code: 200 })), +).annotate({ + identifier: "GetProductsRequest", +}) as any as S.Schema; + +export type PaginatedProductListResponseV2Pagination = PaginationDetails; +export const PaginatedProductListResponseV2Pagination = PaginationDetails; + +export type DigitalProductImagesList = Array; +export const DigitalProductImagesList = /*@__PURE__*/ S.Array( + ProductImage, +) as any as S.Schema; + +export type DigitalProductTagsList = Array; +export const DigitalProductTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** Present for DIGITAL products only. */ +export interface DigitalGood { + /** Filename of the downloadable file. */ + filename?: string; + /** Unique DigitalGood id. */ + id?: string; +} +export const DigitalGood = /*@__PURE__*/ S.suspend(() => + S.Struct({ + filename: S.optional(S.String), + id: S.optional(S.String), + }), +).annotate({ identifier: "DigitalGood" }) as any as S.Schema; + +/** A DIGITAL product. */ +export interface DigitalProduct { + createdOn: string; + description?: string; + id: string; + images?: DigitalProductImagesList; + isVisible?: boolean; + modifiedOn: string; + name?: string; + seoOptions?: SeoOptions; + storePageId: string; + tags?: DigitalProductTagsList; + type: ProductTypeV2; + url?: string; + urlSlug?: string; + digitalGood?: DigitalGood; + pricing?: ProductPricing; +} +export const DigitalProduct = /*@__PURE__*/ S.suspend(() => + S.Struct({ + createdOn: S.String, + description: S.optional(S.String), + id: S.String, + images: S.optional(DigitalProductImagesList), + isVisible: S.optional(S.Boolean), + modifiedOn: S.String, + name: S.optional(S.String), + seoOptions: S.optional(SeoOptions), + storePageId: S.String, + tags: S.optional(DigitalProductTagsList), + type: ProductTypeV2, + url: S.optional(S.String), + urlSlug: S.optional(S.String), + digitalGood: S.optional(DigitalGood), + pricing: S.optional(ProductPricing), + }), +).annotate({ identifier: "DigitalProduct" }) as any as S.Schema; + +export type GiftCardProductImagesList = Array; +export const GiftCardProductImagesList = /*@__PURE__*/ S.Array( + ProductImage, +) as any as S.Schema; + +export type GiftCardProductTagsList = Array; +export const GiftCardProductTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export type GiftCardProductVariantsList = Array; +export const GiftCardProductVariantsList = /*@__PURE__*/ S.Array( + GiftCardProductVariant, +) as any as S.Schema; + +/** A GIFT_CARD product. */ +export interface GiftCardProduct { + createdOn: string; + description?: string; + id: string; + images?: GiftCardProductImagesList; + isVisible?: boolean; + modifiedOn: string; + name?: string; + seoOptions?: SeoOptions; + storePageId: string; + tags?: GiftCardProductTagsList; + type: ProductTypeV2; + url?: string; + urlSlug?: string; + variants?: GiftCardProductVariantsList; +} +export const GiftCardProduct = /*@__PURE__*/ S.suspend(() => + S.Struct({ + createdOn: S.String, + description: S.optional(S.String), + id: S.String, + images: S.optional(GiftCardProductImagesList), + isVisible: S.optional(S.Boolean), + modifiedOn: S.String, + name: S.optional(S.String), + seoOptions: S.optional(SeoOptions), + storePageId: S.String, + tags: S.optional(GiftCardProductTagsList), + type: ProductTypeV2, + url: S.optional(S.String), + urlSlug: S.optional(S.String), + variants: S.optional(GiftCardProductVariantsList), + }), +).annotate({ + identifier: "GiftCardProduct", +}) as any as S.Schema; + +export type PhysicalProductImagesList = Array; +export const PhysicalProductImagesList = /*@__PURE__*/ S.Array( + ProductImage, +) as any as S.Schema; + +export type PhysicalProductTagsList = Array; +export const PhysicalProductTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export type PhysicalProductVariantAttributesList = Array; +export const PhysicalProductVariantAttributesList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export type PhysicalProductVariantsList = Array; +export const PhysicalProductVariantsList = /*@__PURE__*/ S.Array( + PhysicalProductVariant, +) as any as S.Schema; + +/** A PHYSICAL product. */ +export interface PhysicalProduct { + createdOn: string; + description?: string; + id: string; + images?: PhysicalProductImagesList; + isVisible?: boolean; + modifiedOn: string; + name?: string; + seoOptions?: SeoOptions; + storePageId: string; + tags?: PhysicalProductTagsList; + type: ProductTypeV2; + url?: string; + urlSlug?: string; + variantAttributes?: PhysicalProductVariantAttributesList; + variants?: PhysicalProductVariantsList; +} +export const PhysicalProduct = /*@__PURE__*/ S.suspend(() => + S.Struct({ + createdOn: S.String, + description: S.optional(S.String), + id: S.String, + images: S.optional(PhysicalProductImagesList), + isVisible: S.optional(S.Boolean), + modifiedOn: S.String, + name: S.optional(S.String), + seoOptions: S.optional(SeoOptions), + storePageId: S.String, + tags: S.optional(PhysicalProductTagsList), + type: ProductTypeV2, + url: S.optional(S.String), + urlSlug: S.optional(S.String), + variantAttributes: S.optional(PhysicalProductVariantAttributesList), + variants: S.optional(PhysicalProductVariantsList), + }), +).annotate({ + identifier: "PhysicalProduct", +}) as any as S.Schema; + +export type ServiceProductImagesList = Array; +export const ServiceProductImagesList = /*@__PURE__*/ S.Array( + ProductImage, +) as any as S.Schema; + +export type ServiceProductTagsList = Array; +export const ServiceProductTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export type ServiceProductVariantAttributesList = Array; +export const ServiceProductVariantAttributesList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export type ServiceProductVariantsList = Array; +export const ServiceProductVariantsList = /*@__PURE__*/ S.Array( + ServiceProductVariant, +) as any as S.Schema; + +/** A SERVICE product. */ +export interface ServiceProduct { + createdOn: string; + description?: string; + id: string; + images?: ServiceProductImagesList; + isVisible?: boolean; + modifiedOn: string; + name?: string; + seoOptions?: SeoOptions; + storePageId: string; + tags?: ServiceProductTagsList; + type: ProductTypeV2; + url?: string; + urlSlug?: string; + variantAttributes?: ServiceProductVariantAttributesList; + variants?: ServiceProductVariantsList; +} +export const ServiceProduct = /*@__PURE__*/ S.suspend(() => + S.Struct({ + createdOn: S.String, + description: S.optional(S.String), + id: S.String, + images: S.optional(ServiceProductImagesList), + isVisible: S.optional(S.Boolean), + modifiedOn: S.String, + name: S.optional(S.String), + seoOptions: S.optional(SeoOptions), + storePageId: S.String, + tags: S.optional(ServiceProductTagsList), + type: ProductTypeV2, + url: S.optional(S.String), + urlSlug: S.optional(S.String), + variantAttributes: S.optional(ServiceProductVariantAttributesList), + variants: S.optional(ServiceProductVariantsList), + }), +).annotate({ identifier: "ServiceProduct" }) as any as S.Schema; + +export type PaginatedProductListResponseV2ProductsItem = + | DigitalProduct + | GiftCardProduct + | PhysicalProduct + | ServiceProduct; +export const PaginatedProductListResponseV2ProductsItem = + /*@__PURE__*/ S.Unknown as any as S.Schema; + +export type PaginatedProductListResponseV2ProductsList = + Array; +export const PaginatedProductListResponseV2ProductsList = /*@__PURE__*/ S.Array( + PaginatedProductListResponseV2ProductsItem, +) as any as S.Schema; + +export interface PaginatedProductListResponseV2 { + pagination?: PaginationDetails; + products: PaginatedProductListResponseV2ProductsList; +} +export const PaginatedProductListResponseV2 = /*@__PURE__*/ S.suspend(() => + S.Struct({ + pagination: S.optional(PaginationDetails), + products: PaginatedProductListResponseV2ProductsList, + }), +).annotate({ + identifier: "PaginatedProductListResponseV2", +}) as any as S.Schema; + +export interface GetProfilesRequest { + /** Identifies the sort direction of the result list; asc for ascending or dsc for descending. If not specified, the returned list is in descending order. */ + sortDirection?: string; + /** Identifies the sort field of the result list. Values include: createdOn, id, email, or lastName. If not specified, the returned list is sorted by id. */ + sortField?: string; + /** Semicolon separated list used to filter profile results. Values include: isCustomer and/or hasAccount, or email. The email filter cannot be used with isCustomer or hasAccount. */ + filter?: string; + /** Email address filter (URL-encoded, case insensitive). */ + email?: string; + /** Identifies where the next page of results should begin. Should be the value of pagination.nextPageCursor from a previous response. Cannot be used with other parameters. */ + cursor?: string; +} +export const GetProfilesRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + sortDirection: S.optional(S.String.pipe(T.Query())), + sortField: S.optional(S.String.pipe(T.Query())), + filter: S.optional(S.String.pipe(T.Query())), + email: S.optional(S.String.pipe(T.Query())), + cursor: S.optional(S.String.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/1.0/profiles", code: 200 })), +).annotate({ + identifier: "GetProfilesRequest", +}) as any as S.Schema; + +export type PaginatedProfileListResponsePagination = PaginationDetails; +export const PaginatedProfileListResponsePagination = PaginationDetails; + +/** Summary of profile's commerce transactions. If a profile has no commerce transactions, the object is still returned with null or 0 values. This information is calculated asynchronously; there may be a slight delay between when an order is created, and when it's reflected in the object. */ +export interface TransactionsSummary { + /** Count of donations submitted. */ + donationCount?: number; + /** ISO 8601 UTC date and time string; represents when the profile's first donation was submitted. */ + firstDonationSubmittedOn?: string; + /** ISO 8601 UTC date and time string; represents when the profile's first order was submitted. */ + firstOrderSubmittedOn?: string; + /** ISO 8601 UTC date and time string; represents when the profile's latest donation was submitted. */ + lastDonationSubmittedOn?: string; + /** ISO 8601 UTC date and time string; represents when the profile's latest order was submitted. */ + lastOrderSubmittedOn?: string; + /** Count of orders submitted. */ + orderCount?: number; + totalDonationAmount?: MonetaryAmount; + totalOrderAmount?: MonetaryAmount; + totalRefundAmount?: MonetaryAmount; +} +export const TransactionsSummary = /*@__PURE__*/ S.suspend(() => + S.Struct({ + donationCount: S.optional(S.Number), + firstDonationSubmittedOn: S.optional(S.String), + firstOrderSubmittedOn: S.optional(S.String), + lastDonationSubmittedOn: S.optional(S.String), + lastOrderSubmittedOn: S.optional(S.String), + orderCount: S.optional(S.Number), + totalDonationAmount: S.optional(MonetaryAmount), + totalOrderAmount: S.optional(MonetaryAmount), + totalRefundAmount: S.optional(MonetaryAmount), + }), +).annotate({ + identifier: "TransactionsSummary", +}) as any as S.Schema; + +export interface Profile { + /** Indicates whether the profile opted to receive marketing. */ + acceptsMarketing?: boolean; + address?: Address; + /** ISO 8601 UTC date and time string; represents when the profile was created. */ + createdOn?: string; + /** Profile email address. */ + email?: string; + /** Profile first name. */ + firstName?: string; + /** Indicates whether the profile has an account with the website. */ + hasAccount?: boolean; + /** Unique Profile id. */ + id?: string; + /** Indicates whether the profile has any commerce orders or donations with the website. */ + isCustomer?: boolean; + /** Profile last name. */ + lastName?: string; + transactionsSummary?: TransactionsSummary; +} +export const Profile = /*@__PURE__*/ S.suspend(() => + S.Struct({ + acceptsMarketing: S.optional(S.Boolean), + address: S.optional(Address), + createdOn: S.optional(S.String), + email: S.optional(S.String), + firstName: S.optional(S.String), + hasAccount: S.optional(S.Boolean), + id: S.optional(S.String), + isCustomer: S.optional(S.Boolean), + lastName: S.optional(S.String), + transactionsSummary: S.optional(TransactionsSummary), + }), +).annotate({ identifier: "Profile" }) as any as S.Schema; + +export type PaginatedProfileListResponseProfilesList = Array; +export const PaginatedProfileListResponseProfilesList = /*@__PURE__*/ S.Array( + Profile, +) as any as S.Schema; + +export interface PaginatedProfileListResponse { + pagination?: PaginationDetails; + profiles: PaginatedProfileListResponseProfilesList; +} +export const PaginatedProfileListResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + pagination: S.optional(PaginationDetails), + profiles: PaginatedProfileListResponseProfilesList, + }), +).annotate({ + identifier: "PaginatedProfileListResponse", +}) as any as S.Schema; + +export interface GetSpecificInventoryItemsRequest { + /** Specifies the InventoryItems to retrieve. Multiple InventoryItems can be retrieved by providing a comma-separated list: {id1},{id2}..., though the same sequence is not guaranteed in the response. */ + variantIdCsvs: string; +} +export const GetSpecificInventoryItemsRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + variantIdCsvs: S.String.pipe(T.Label()), + }).pipe( + T.Http({ + method: "GET", + uri: "/1.0/commerce/inventory/{variantIdCsvs}", + code: 200, + }), + ), +).annotate({ + identifier: "GetSpecificInventoryItemsRequest", +}) as any as S.Schema; + +/** Array of InventoryItem resources. If the merchant site doesn't have any physical or service products, this array is empty. */ +export type InventoryItemListResponseInventoryList = Array; +export const InventoryItemListResponseInventoryList = /*@__PURE__*/ S.Array( + InventoryItem, +) as any as S.Schema; + +export interface InventoryItemListResponse { + /** Array of InventoryItem resources. If the merchant site doesn't have any physical or service products, this array is empty. */ + inventory?: InventoryItemListResponseInventoryList; +} +export const InventoryItemListResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + inventory: S.optional(InventoryItemListResponseInventoryList), + }), +).annotate({ + identifier: "InventoryItemListResponse", +}) as any as S.Schema; + +export interface GetSpecificProductsRequest { + productIdCsvs: string; +} +export const GetSpecificProductsRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + productIdCsvs: S.String.pipe(T.Label()), + }).pipe( + T.Http({ + method: "GET", + uri: "/v2/commerce/products/{productIdCsvs}", + code: 200, + }), + ), +).annotate({ + identifier: "GetSpecificProductsRequest", +}) as any as S.Schema; + +export type ProductListResponseV2ProductsItem = + | DigitalProduct + | GiftCardProduct + | PhysicalProduct + | ServiceProduct; +export const ProductListResponseV2ProductsItem = + /*@__PURE__*/ S.Unknown as any as S.Schema; + +export type ProductListResponseV2ProductsList = + Array; +export const ProductListResponseV2ProductsList = /*@__PURE__*/ S.Array( + ProductListResponseV2ProductsItem, +) as any as S.Schema; + +export interface ProductListResponseV2 { + products?: ProductListResponseV2ProductsList; +} +export const ProductListResponseV2 = /*@__PURE__*/ S.suspend(() => + S.Struct({ + products: S.optional(ProductListResponseV2ProductsList), + }), +).annotate({ + identifier: "ProductListResponseV2", +}) as any as S.Schema; + +export interface GetSpecificProfilesRequest { + /** Specifies the profiles to retrieve. Multiple Profiles can be retrieved by providing a comma-separated list of profile ids. */ + profileIdCsvs: string; +} +export const GetSpecificProfilesRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + profileIdCsvs: S.String.pipe(T.Label()), + }).pipe( + T.Http({ method: "GET", uri: "/1.0/profiles/{profileIdCsvs}", code: 200 }), + ), +).annotate({ + identifier: "GetSpecificProfilesRequest", +}) as any as S.Schema; + +export type ProfileListResponseProfilesList = Array; +export const ProfileListResponseProfilesList = /*@__PURE__*/ S.Array( + Profile, +) as any as S.Schema; + +export interface ProfileListResponse { + profiles?: ProfileListResponseProfilesList; +} +export const ProfileListResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + profiles: S.optional(ProfileListResponseProfilesList), + }), +).annotate({ + identifier: "ProfileListResponse", +}) as any as S.Schema; + +export interface GetStorePagesRequest { + cursor?: string; +} +export const GetStorePagesRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + cursor: S.optional(S.String.pipe(T.Query())), + }).pipe( + T.Http({ method: "GET", uri: "/1.0/commerce/store_pages", code: 200 }), + ), +).annotate({ + identifier: "GetStorePagesRequest", +}) as any as S.Schema; + +export type PaginatedStorePagesResponsePagination = PaginationDetails; +export const PaginatedStorePagesResponsePagination = PaginationDetails; + +export interface StorePage { + id?: string; + isEnabled?: boolean; + title?: string; + urlSlug?: string; +} +export const StorePage = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.optional(S.String), + isEnabled: S.optional(S.Boolean), + title: S.optional(S.String), + urlSlug: S.optional(S.String), + }), +).annotate({ identifier: "StorePage" }) as any as S.Schema; + +export type PaginatedStorePagesResponseStorePagesList = Array; +export const PaginatedStorePagesResponseStorePagesList = /*@__PURE__*/ S.Array( + StorePage, +) as any as S.Schema; + +export interface PaginatedStorePagesResponse { + pagination?: PaginationDetails; + storePages: PaginatedStorePagesResponseStorePagesList; +} +export const PaginatedStorePagesResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + pagination: S.optional(PaginationDetails), + storePages: PaginatedStorePagesResponseStorePagesList, + }), +).annotate({ + identifier: "PaginatedStorePagesResponse", +}) as any as S.Schema; + +export type GetTransactionsSummariesRequestContactIdsList = Array; +export const GetTransactionsSummariesRequestContactIdsList = + /*@__PURE__*/ S.Array( + S.String, + ) as any as S.Schema; + +/** Field to group results by, should be a contactId */ +export type GetTransactionsSummariesRequestGroupBy = "contactId"; +export const GetTransactionsSummariesRequestGroupBy = /*@__PURE__*/ S.String; + +export interface GetTransactionsSummariesRequest { + contactIds: GetTransactionsSummariesRequestContactIdsList; + /** Field to group results by, should be a contactId */ + groupBy: GetTransactionsSummariesRequestGroupBy | (string & {}); +} +export const GetTransactionsSummariesRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + contactIds: GetTransactionsSummariesRequestContactIdsList, + groupBy: GetTransactionsSummariesRequestGroupBy, + }).pipe( + T.Http({ + method: "POST", + uri: "/v1/analytics/transaction-summaries", + code: 200, + }), + ), +).annotate({ + identifier: "GetTransactionsSummariesRequest", +}) as any as S.Schema; + +/** List of transaction summary wrappers */ +export interface TransactionsSummaryWrapper { + /** Unique contact identifier */ + contactId?: string; + transactionsSummary?: TransactionsSummary; +} +export const TransactionsSummaryWrapper = /*@__PURE__*/ S.suspend(() => + S.Struct({ + contactId: S.optional(S.String), + transactionsSummary: S.optional(TransactionsSummary), + }), +).annotate({ + identifier: "TransactionsSummaryWrapper", +}) as any as S.Schema; + +/** List of transaction summary wrappers */ +export type RetrieveTransactionsSummariesResponseTransactionsSummaryWrappersList = + Array; +export const RetrieveTransactionsSummariesResponseTransactionsSummaryWrappersList = + /*@__PURE__*/ S.Array( + TransactionsSummaryWrapper, + ) as any as S.Schema; + +export interface RetrieveTransactionsSummariesResponse { + /** List of transaction summary wrappers */ + transactionsSummaryWrappers?: RetrieveTransactionsSummariesResponseTransactionsSummaryWrappersList; +} +export const RetrieveTransactionsSummariesResponse = /*@__PURE__*/ S.suspend( + () => + S.Struct({ + transactionsSummaryWrappers: S.optional( + RetrieveTransactionsSummariesResponseTransactionsSummaryWrappersList, + ), + }), +).annotate({ + identifier: "RetrieveTransactionsSummariesResponse", +}) as any as S.Schema; + +export interface GetWebhookSubscriptionRequest { + /** Specifies the Webhook Subscription to retrieve. */ + subscriptionId: string; +} +export const GetWebhookSubscriptionRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + subscriptionId: S.String.pipe(T.Label()), + }).pipe( + T.Http({ + method: "GET", + uri: "/1.0/webhook_subscriptions/{subscriptionId}", + code: 200, + }), + ), +).annotate({ + identifier: "GetWebhookSubscriptionRequest", +}) as any as S.Schema; + +/** List of event topics that trigger a webhook notification. Possible values include: extension.uninstall, order.create, order.update. */ +export type ExternalWebhookSubscriptionResponseTopicsList = Array; +export const ExternalWebhookSubscriptionResponseTopicsList = + /*@__PURE__*/ S.Array( + S.String, + ) as any as S.Schema; + +export interface ExternalWebhookSubscriptionResponse { + /** Third-party client id. */ + clientId?: string; + /** ISO 8601 UTC date and time string; represents when the webhook subscription was created. */ + createdOn?: string; + /** HTTPS URL that receives webhook notifications. */ + endpointUrl?: string; + /** Unique Webhook Subscription id. */ + id?: string; + /** List of event topics that trigger a webhook notification. Possible values include: extension.uninstall, order.create, order.update. */ + topics?: ExternalWebhookSubscriptionResponseTopicsList; + /** ISO 8601 UTC date and time string; represents when the webhook subscription was last modified. */ + updatedOn?: string; + /** Unique website id. */ + websiteId?: string; +} +export const ExternalWebhookSubscriptionResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + clientId: S.optional(S.String), + createdOn: S.optional(S.String), + endpointUrl: S.optional(S.String), + id: S.optional(S.String), + topics: S.optional(ExternalWebhookSubscriptionResponseTopicsList), + updatedOn: S.optional(S.String), + websiteId: S.optional(S.String), + }), +).annotate({ + identifier: "ExternalWebhookSubscriptionResponse", +}) as any as S.Schema; + +export interface GetWebhookSubscriptionsRequest {} +export const GetWebhookSubscriptionsRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({}).pipe( + T.Http({ method: "GET", uri: "/1.0/webhook_subscriptions", code: 200 }), + ), +).annotate({ + identifier: "GetWebhookSubscriptionsRequest", +}) as any as S.Schema; + +/** Array of Webhook Subscription resources. If the merchant site doesn't have any webhook subscriptions, this array is empty. */ +export type ExternalWebhookSubscriptionListResponseWebhookSubscriptionsList = + Array; +export const ExternalWebhookSubscriptionListResponseWebhookSubscriptionsList = + /*@__PURE__*/ S.Array( + ExternalWebhookSubscriptionResponse, + ) as any as S.Schema; + +export interface ExternalWebhookSubscriptionListResponse { + /** Array of Webhook Subscription resources. If the merchant site doesn't have any webhook subscriptions, this array is empty. */ + webhookSubscriptions?: ExternalWebhookSubscriptionListResponseWebhookSubscriptionsList; +} +export const ExternalWebhookSubscriptionListResponse = /*@__PURE__*/ S.suspend( + () => + S.Struct({ + webhookSubscriptions: S.optional( + ExternalWebhookSubscriptionListResponseWebhookSubscriptionsList, + ), + }), +).annotate({ + identifier: "ExternalWebhookSubscriptionListResponse", +}) as any as S.Schema; + +export interface GetWebsiteProfileRequest {} +export const GetWebsiteProfileRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({}).pipe( + T.Http({ method: "GET", uri: "/1.0/authorization/website", code: 200 }), + ), +).annotate({ + identifier: "GetWebsiteProfileRequest", +}) as any as S.Schema; + +export interface Location { + country?: string; + region?: string; +} +export const Location = /*@__PURE__*/ S.suspend(() => + S.Struct({ + country: S.optional(S.String), + region: S.optional(S.String), + }), +).annotate({ identifier: "Location" }) as any as S.Schema; + +export type MeasurementStandard = "IMPERIAL" | "METRIC"; +export const MeasurementStandard = /*@__PURE__*/ S.String; + +export interface WebsiteProfile { + currency?: string; + id?: string; + language?: string; + location?: Location; + measurementStandard?: MeasurementStandard; + siteId?: string; + timeZone?: string; + title?: string; + url?: string; +} +export const WebsiteProfile = /*@__PURE__*/ S.suspend(() => + S.Struct({ + currency: S.optional(S.String), + id: S.optional(S.String), + language: S.optional(S.String), + location: S.optional(Location), + measurementStandard: S.optional(MeasurementStandard), + siteId: S.optional(S.String), + timeZone: S.optional(S.String), + title: S.optional(S.String), + url: S.optional(S.String), + }), +).annotate({ identifier: "WebsiteProfile" }) as any as S.Schema; + +export type ListDiscountsRequestSortBy = + | "CREATED_ON" + | "PROMO_CODE" + | "USES_COUNT"; +export const ListDiscountsRequestSortBy = /*@__PURE__*/ S.String; + +export type ListDiscountsRequestSortDirection = "ASCENDING" | "DESCENDING"; +export const ListDiscountsRequestSortDirection = /*@__PURE__*/ S.String; + +export type ListDiscountsRequestStatus = + | "ALL" + | "ACTIVE" + | "EXPIRED" + | "SCHEDULED"; +export const ListDiscountsRequestStatus = /*@__PURE__*/ S.String; + +export type ListDiscountsRequestCriteriaItem = + | "ANY_ORDER" + | "CART_TOTAL" + | "PRODUCT" + | "BUY_X_GET_Y"; +export const ListDiscountsRequestCriteriaItem = /*@__PURE__*/ S.String; + +export type ListDiscountsRequestCriteriaList = Array< + ListDiscountsRequestCriteriaItem | (string & {}) +>; +export const ListDiscountsRequestCriteriaList = /*@__PURE__*/ S.Array( + ListDiscountsRequestCriteriaItem, +) as any as S.Schema; + +export type ListDiscountsRequestTemplateItem = + | "FIXED_AMOUNT" + | "PERCENTAGE" + | "BUY_X_GET_Y_FIXED_AMOUNT" + | "BUY_X_GET_Y_PERCENTAGE" + | "FREE_SHIPPING"; +export const ListDiscountsRequestTemplateItem = /*@__PURE__*/ S.String; + +export type ListDiscountsRequestTemplateList = Array< + ListDiscountsRequestTemplateItem | (string & {}) +>; +export const ListDiscountsRequestTemplateList = /*@__PURE__*/ S.Array( + ListDiscountsRequestTemplateItem, +) as any as S.Schema; + +export type ListDiscountsRequestTrigger = "AUTO" | "CODE"; +export const ListDiscountsRequestTrigger = /*@__PURE__*/ S.String; + +export interface ListDiscountsRequest { + /** Sort field for the result set. */ + sortBy?: ListDiscountsRequestSortBy | (string & {}); + /** Sort direction. */ + sortDirection?: ListDiscountsRequestSortDirection | (string & {}); + /** Free-text search across a discount's name and promo code. */ + search?: string; + /** Filter by discount lifecycle status. */ + status?: ListDiscountsRequestStatus | (string & {}); + /** Filter by one or more criteria types (comma-separated). When omitted, defaults to all allowable values. */ + criteria?: ListDiscountsRequestCriteriaList; + /** Filter by one or more template types (comma-separated). When omitted, defaults to all allowable values. */ + template?: ListDiscountsRequestTemplateList; + /** Filter by one or more trigger types (comma-separated): AUTO (auto-applied) or CODE (promo code). When omitted, or when all allowable values are supplied, defaults to all allowable values. */ + trigger?: ListDiscountsRequestTrigger | (string & {}); + /** When true, only discounts with limited-use semantics (per product rules) are returned. */ + limitedUseOnly?: boolean; + /** Zero-based offset into the result set. Must be non-negative. Default 0. */ + offset?: number; + /** Page size (1–1000; default 50). */ + limit?: number; +} +export const ListDiscountsRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + sortBy: S.optional(ListDiscountsRequestSortBy.pipe(T.Query())), + sortDirection: S.optional( + ListDiscountsRequestSortDirection.pipe(T.Query()), + ), + search: S.optional(S.String.pipe(T.Query())), + status: S.optional(ListDiscountsRequestStatus.pipe(T.Query())), + criteria: S.optional(ListDiscountsRequestCriteriaList.pipe(T.Query())), + template: S.optional(ListDiscountsRequestTemplateList.pipe(T.Query())), + trigger: S.optional(ListDiscountsRequestTrigger.pipe(T.Query())), + limitedUseOnly: S.optional(S.Boolean.pipe(T.Query())), + offset: S.optional(S.Number.pipe(T.Query())), + limit: S.optional(S.Number.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/v1/commerce/discounts", code: 200 })), +).annotate({ + identifier: "ListDiscountsRequest", +}) as any as S.Schema; + +/** Discounts for this page. */ +export type PaginatedDiscountListResponseDiscountsList = Array; +export const PaginatedDiscountListResponseDiscountsList = /*@__PURE__*/ S.Array( + Discount, +) as any as S.Schema; + +/** Offset-paginated list of discounts for a website. */ +export interface PaginatedDiscountListResponse { + /** Discounts for this page. */ + discounts: PaginatedDiscountListResponseDiscountsList; + /** True when more results exist after the current window. */ + hasNextPage?: boolean; + /** True when a page of results exists before the current window. */ + hasPreviousPage?: boolean; +} +export const PaginatedDiscountListResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + discounts: PaginatedDiscountListResponseDiscountsList, + hasNextPage: S.optional(S.Boolean), + hasPreviousPage: S.optional(S.Boolean), + }), +).annotate({ + identifier: "PaginatedDiscountListResponse", +}) as any as S.Schema; + +/** Object for filtering by before and after dates */ +export interface DateFilter { + /** Filter out any dates after */ + after?: string; + /** Filter out any dates before */ + before?: string; +} +export const DateFilter = /*@__PURE__*/ S.suspend(() => + S.Struct({ + after: S.optional(S.String), + before: S.optional(S.String), + }), +).annotate({ identifier: "DateFilter" }) as any as S.Schema; + +/** Contact's marketing settings with joined on date */ +export interface AcceptsMarketingWithDate { + /** If contact's email accepts marketing */ + acceptsMarketing?: boolean; + joinedOn?: DateFilter; +} +export const AcceptsMarketingWithDate = /*@__PURE__*/ S.suspend(() => + S.Struct({ + acceptsMarketing: S.optional(S.Boolean), + joinedOn: S.optional(DateFilter), + }), +).annotate({ + identifier: "AcceptsMarketingWithDate", +}) as any as S.Schema; + +/** Object for filtering by a min and max integer */ +export interface IntegerFilter { + /** Filter out any numbers greater */ + max?: number; + /** Filter out any numbers lower */ + min?: number; +} +export const IntegerFilter = /*@__PURE__*/ S.suspend(() => + S.Struct({ + max: S.optional(S.Number), + min: S.optional(S.Number), + }), +).annotate({ identifier: "IntegerFilter" }) as any as S.Schema; + +/** Direction to sort results, ASCENDING or DESCENDING */ +export type QueryContactsRequestSortDirection = "ASCENDING" | "DESCENDING"; +export const QueryContactsRequestSortDirection = /*@__PURE__*/ S.String; + +/** Field to sort results by */ +export type QueryContactsRequestSortField = + | "ID" + | "CREATED_ON" + | "EMAIL" + | "ACCEPTS_MARKETING_JOINED_ON" + | "FIRST_NAME" + | "LAST_NAME" + | "ORDER_COUNT" + | "LAST_ORDER_ON" + | "ORDER_AMOUNT" + | "DONATION_COUNT" + | "LAST_DONATION_ON" + | "DONATION_AMOUNT"; +export const QueryContactsRequestSortField = /*@__PURE__*/ S.String; + +export interface QueryContactsRequest { + acceptsMarketingWithDate?: AcceptsMarketingWithDate; + /** The cursor for the next page of results. Use the value of `pagination.nextPageCursor` from the previous response. */ + cursor?: string; + donationAmount?: IntegerFilter; + donationCount?: IntegerFilter; + firstDonationOn?: DateFilter; + firstOrderOn?: DateFilter; + lastDonationOn?: DateFilter; + lastOrderOn?: DateFilter; + orderAmount?: IntegerFilter; + orderCount?: IntegerFilter; + /** The number of contacts to return per request. */ + pageSize?: number; + /** Search string for Name and Email address */ + searchString?: string; + /** Direction to sort results, ASCENDING or DESCENDING */ + sortDirection?: QueryContactsRequestSortDirection | (string & {}); + /** Field to sort results by */ + sortField?: QueryContactsRequestSortField | (string & {}); +} +export const QueryContactsRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + acceptsMarketingWithDate: S.optional(AcceptsMarketingWithDate), + cursor: S.optional(S.String), + donationAmount: S.optional(IntegerFilter), + donationCount: S.optional(IntegerFilter), + firstDonationOn: S.optional(DateFilter), + firstOrderOn: S.optional(DateFilter), + lastDonationOn: S.optional(DateFilter), + lastOrderOn: S.optional(DateFilter), + orderAmount: S.optional(IntegerFilter), + orderCount: S.optional(IntegerFilter), + pageSize: S.optional(S.Number), + searchString: S.optional(S.String), + sortDirection: S.optional(QueryContactsRequestSortDirection), + sortField: S.optional(QueryContactsRequestSortField), + }).pipe(T.Http({ method: "POST", uri: "/v1/contacts/query", code: 200 })), +).annotate({ + identifier: "QueryContactsRequest", +}) as any as S.Schema; + +/** paginated list of contacts retrieved */ +export type PaginatedQueryContactsResponseContactsList = Array; +export const PaginatedQueryContactsResponseContactsList = /*@__PURE__*/ S.Array( + Contact, +) as any as S.Schema; + +export type PaginatedQueryContactsResponsePagination = PaginationDetails; +export const PaginatedQueryContactsResponsePagination = PaginationDetails; + +export interface PaginatedQueryContactsResponse { + /** paginated list of contacts retrieved */ + contacts: PaginatedQueryContactsResponseContactsList; + pagination?: PaginationDetails; +} +export const PaginatedQueryContactsResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + contacts: PaginatedQueryContactsResponseContactsList, + pagination: S.optional(PaginationDetails), + }), +).annotate({ + identifier: "PaginatedQueryContactsResponse", +}) as any as S.Schema; + +export interface RotateSubscriptionSecretRequest { + /** Specifies the Webhook Subscription to update. */ + subscriptionId: string; +} +export const RotateSubscriptionSecretRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + subscriptionId: S.String.pipe(T.Label()), + }).pipe( + T.Http({ + method: "POST", + uri: "/1.0/webhook_subscriptions/{subscriptionId}/actions/rotateSecret", + code: 200, + }), + ), +).annotate({ + identifier: "RotateSubscriptionSecretRequest", +}) as any as S.Schema; + +export interface ExternalRotateSecretResponse { + /** Hexadecimal value used to generate a signature for a webhook notification; field is only returned when creating a new subscription or rotating a secret. Store the secret in a safe location to verify notifications from Squarespace. */ + secret?: string | Redacted.Redacted; +} +export const ExternalRotateSecretResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + secret: S.optional(S.String.pipe(T.SensitiveValue({}))), + }), +).annotate({ + identifier: "ExternalRotateSecretResponse", +}) as any as S.Schema; + +export interface SendTestNotificationForWebhookSubscriptionRequest { + /** Specifies the Webhook Subscription to send a notification to. */ + subscriptionId: string; + /** Required; Squarespace event topic that triggers a webhook notification. Possible values include: extension.uninstall, order.create, order.update. */ + topic: string; +} +export const SendTestNotificationForWebhookSubscriptionRequest = + /*@__PURE__*/ S.suspend(() => + S.Struct({ + subscriptionId: S.String.pipe(T.Label()), + topic: S.String, + }).pipe( + T.Http({ + method: "POST", + uri: "/1.0/webhook_subscriptions/{subscriptionId}/actions/sendTestNotification", + code: 200, + }), + ), + ).annotate({ + identifier: "SendTestNotificationForWebhookSubscriptionRequest", + }) as any as S.Schema; + +export interface ExternalTestNotificationResponse { + /** Status code returned by the subscribed webhook endpoint. */ + statusCode?: number; +} +export const ExternalTestNotificationResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + statusCode: S.optional(S.Number), + }), +).annotate({ + identifier: "ExternalTestNotificationResponse", +}) as any as S.Schema; + +export interface UpdateAddressBookEntryRequest { + /** The contact's ID. */ + contactId: string; + /** The address book entry's ID. */ + addressBookEntryId: string; + address: ContactAddress; + /** Whether this entry should be the default shipping address. When updating the entry that is currently the default, changing this value from true to false has no effect. */ + defaultShipping?: boolean; +} +export const UpdateAddressBookEntryRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + contactId: S.String.pipe(T.Label()), + addressBookEntryId: S.String.pipe(T.Label()), + address: ContactAddress, + defaultShipping: S.optional(S.Boolean), + }).pipe( + T.Http({ + method: "PUT", + uri: "/v1/contacts/{contactId}/address-book/{addressBookEntryId}", + code: 200, + }), + ), +).annotate({ + identifier: "UpdateAddressBookEntryRequest", +}) as any as S.Schema; + +export interface UpdateAddressBookEntryResponse { + addressBookEntry?: AddressBookEntry; +} +export const UpdateAddressBookEntryResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + addressBookEntry: S.optional(AddressBookEntry), + }), +).annotate({ + identifier: "UpdateAddressBookEntryResponse", +}) as any as S.Schema; + +export interface UpdateContactRequest { + /** The contact's ID. */ + contactId: string; +} +export const UpdateContactRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + contactId: S.String.pipe(T.Label()), + }).pipe( + T.Http({ method: "PATCH", uri: "/v1/contacts/{contactId}", code: 200 }), + ), +).annotate({ + identifier: "UpdateContactRequest", +}) as any as S.Schema; + +export interface PatchContactResponse { + contact?: Contact; +} +export const PatchContactResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + contact: S.optional(Contact), + }), +).annotate({ + identifier: "PatchContactResponse", +}) as any as S.Schema; + +export type UpdateDiscountRequestCriteria = + | AnyOrderCriteria + | BuyXGetYCriteria + | CartTotalCriteria + | ProductCriteria; +export const UpdateDiscountRequestCriteria = + /*@__PURE__*/ S.Unknown as any as S.Schema; + +export type UpdateDiscountRequestTemplate = + | BuyXGetYFixedAmountTemplate + | BuyXGetYPercentageTemplate + | FixedAmountTemplate + | FreeShippingTemplate + | PercentageTemplate; +export const UpdateDiscountRequestTemplate = + /*@__PURE__*/ S.Unknown as any as S.Schema; + +export type UpdateDiscountRequestTrigger = AnyOrderCriteria | PromoCodeTrigger; +export const UpdateDiscountRequestTrigger = + /*@__PURE__*/ S.Unknown as any as S.Schema; + +export interface UpdateDiscountRequest { + /** The discount's unique identifier. */ + discountId: string; + criteria: UpdateDiscountRequestCriteria; + /** If true, the discount can only be used `maxUsesAllowed` times site-wide. */ + isLimitedUses?: boolean; + /** If true, a given customer can only use this discount once. */ + isOncePerCustomer?: boolean; + /** Maximum site-wide redemptions. Required when isLimitedUses=true; null otherwise. */ + maxUsesAllowed?: number; + /** Display name for the discount. */ + name: string; + paymentPlanOptions?: PaymentPlanOptions; + subscriptionOptions?: SubscriptionOptions; + template: UpdateDiscountRequestTemplate; + trigger: UpdateDiscountRequestTrigger; + /** When the discount becomes active. */ + validFrom: string; + /** When the discount expires. Null = no expiry. */ + validTo?: string; +} +export const UpdateDiscountRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + discountId: S.String.pipe(T.Label()), + criteria: UpdateDiscountRequestCriteria, + isLimitedUses: S.optional(S.Boolean), + isOncePerCustomer: S.optional(S.Boolean), + maxUsesAllowed: S.optional(S.Number), + name: S.String, + paymentPlanOptions: S.optional(PaymentPlanOptions), + subscriptionOptions: S.optional(SubscriptionOptions), + template: UpdateDiscountRequestTemplate, + trigger: UpdateDiscountRequestTrigger, + validFrom: S.String, + validTo: S.optional(S.String), + }).pipe( + T.Http({ + method: "PUT", + uri: "/v1/commerce/discounts/{discountId}", + code: 200, + }), + ), +).annotate({ + identifier: "UpdateDiscountRequest", +}) as any as S.Schema; + +export interface ChangeBoolean { + present?: boolean; + value?: boolean; +} +export const ChangeBoolean = /*@__PURE__*/ S.suspend(() => + S.Struct({ + present: S.optional(S.Boolean), + value: S.optional(S.Boolean), + }), +).annotate({ identifier: "ChangeBoolean" }) as any as S.Schema; + +export interface ChangeMonetaryAmount { + present?: boolean; + value?: MonetaryAmount; +} +export const ChangeMonetaryAmount = /*@__PURE__*/ S.suspend(() => + S.Struct({ + present: S.optional(S.Boolean), + value: S.optional(MonetaryAmount), + }), +).annotate({ + identifier: "ChangeMonetaryAmount", +}) as any as S.Schema; + +export interface UpdateProductPricing { + basePrice?: ChangeMonetaryAmount; + onSale?: ChangeBoolean; + salePrice?: ChangeMonetaryAmount; +} +export const UpdateProductPricing = /*@__PURE__*/ S.suspend(() => + S.Struct({ + basePrice: S.optional(ChangeMonetaryAmount), + onSale: S.optional(ChangeBoolean), + salePrice: S.optional(ChangeMonetaryAmount), + }), +).annotate({ + identifier: "UpdateProductPricing", +}) as any as S.Schema; + +/** Pricing data for the product. */ +export interface ChangeUpdateProductPricing { + present?: boolean; + value?: UpdateProductPricing; +} +export const ChangeUpdateProductPricing = /*@__PURE__*/ S.suspend(() => + S.Struct({ + present: S.optional(S.Boolean), + value: S.optional(UpdateProductPricing), + }), +).annotate({ + identifier: "ChangeUpdateProductPricing", +}) as any as S.Schema; + +export type ChangeListStringValueList = Array; +export const ChangeListStringValueList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +/** Optional; list of event topics that trigger a webhook notification. Possible values include: extension.uninstall, order.create, order.update. */ +export interface ChangeListString { + present?: boolean; + value?: ChangeListStringValueList; +} +export const ChangeListString = /*@__PURE__*/ S.suspend(() => + S.Struct({ + present: S.optional(S.Boolean), + value: S.optional(ChangeListStringValueList), + }), +).annotate({ + identifier: "ChangeListString", +}) as any as S.Schema; + +/** Options for search engine optimization. */ +export interface ChangeSeoOptions { + present?: boolean; + value?: SeoOptions; +} +export const ChangeSeoOptions = /*@__PURE__*/ S.suspend(() => + S.Struct({ + present: S.optional(S.Boolean), + value: S.optional(SeoOptions), + }), +).annotate({ + identifier: "ChangeSeoOptions", +}) as any as S.Schema; + +export interface UpdateProductRequest { + productId: string; + description?: ChangeString; + isVisible?: ChangeBoolean; + name?: ChangeString; + pricing?: ChangeUpdateProductPricing; + productAttributeNames?: ChangeListString; + seoData?: ChangeSeoOptions; + tags?: ChangeListString; + urlSlug?: ChangeString; +} +export const UpdateProductRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + productId: S.String.pipe(T.Label()), + description: S.optional(ChangeString), + isVisible: S.optional(ChangeBoolean), + name: S.optional(ChangeString), + pricing: S.optional(ChangeUpdateProductPricing), + productAttributeNames: S.optional(ChangeListString), + seoData: S.optional(ChangeSeoOptions), + tags: S.optional(ChangeListString), + urlSlug: S.optional(ChangeString), + }).pipe( + T.Http({ + method: "POST", + uri: "/v2/commerce/products/{productId}", + code: 200, + }), + ), +).annotate({ + identifier: "UpdateProductRequest", +}) as any as S.Schema; + +export interface UpdateProductImageRequest { + productId: string; + imageId: string; + altText?: ChangeString; +} +export const UpdateProductImageRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + productId: S.String.pipe(T.Label()), + imageId: S.String.pipe(T.Label()), + altText: S.optional(ChangeString), + }).pipe( + T.Http({ + method: "POST", + uri: "/v2/commerce/products/{productId}/images/{imageId}", + code: 200, + }), + ), +).annotate({ + identifier: "UpdateProductImageRequest", +}) as any as S.Schema; + +export interface UpdateProductImageOrderRequest { + productId: string; + imageId: string; + afterImageId?: ChangeString; +} +export const UpdateProductImageOrderRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + productId: S.String.pipe(T.Label()), + imageId: S.String.pipe(T.Label()), + afterImageId: S.optional(ChangeString), + }).pipe( + T.Http({ + method: "POST", + uri: "/v2/commerce/products/{productId}/images/{imageId}/order", + code: 200, + }), + ), +).annotate({ + identifier: "UpdateProductImageOrderRequest", +}) as any as S.Schema; + +export interface UpdateProductImageOrderResponse {} +export const UpdateProductImageOrderResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({}), +).annotate({ + identifier: "UpdateProductImageOrderResponse", +}) as any as S.Schema; + +export type ChangeMapStringStringValueMap = { + [key: string]: string | undefined; +}; +export const ChangeMapStringStringValueMap = /*@__PURE__*/ S.Record( + S.String, + S.String, +) as any as S.Schema; + +/** Specifies attribute-value pairs for the variant. Supported for PHYSICAL products only. */ +export interface ChangeMapStringString { + present?: boolean; + value?: ChangeMapStringStringValueMap; +} +export const ChangeMapStringString = /*@__PURE__*/ S.suspend(() => + S.Struct({ + present: S.optional(S.Boolean), + value: S.optional(ChangeMapStringStringValueMap), + }), +).annotate({ + identifier: "ChangeMapStringString", +}) as any as S.Schema; + +export interface ChangeProductDimensions { + present?: boolean; + value?: ProductDimensions; +} +export const ChangeProductDimensions = /*@__PURE__*/ S.suspend(() => + S.Struct({ + present: S.optional(S.Boolean), + value: S.optional(ProductDimensions), + }), +).annotate({ + identifier: "ChangeProductDimensions", +}) as any as S.Schema; + +export interface ChangeProductWeight { + present?: boolean; + value?: ProductWeight; +} +export const ChangeProductWeight = /*@__PURE__*/ S.suspend(() => + S.Struct({ + present: S.optional(S.Boolean), + value: S.optional(ProductWeight), + }), +).annotate({ + identifier: "ChangeProductWeight", +}) as any as S.Schema; + +export interface UpdateProductMeasurements { + dimensions?: ChangeProductDimensions; + weight?: ChangeProductWeight; +} +export const UpdateProductMeasurements = /*@__PURE__*/ S.suspend(() => + S.Struct({ + dimensions: S.optional(ChangeProductDimensions), + weight: S.optional(ChangeProductWeight), + }), +).annotate({ + identifier: "UpdateProductMeasurements", +}) as any as S.Schema; + +/** Measurements of the variant when it's shipped. Supported for PHYSICAL products only. */ +export interface ChangeUpdateProductMeasurements { + present?: boolean; + value?: UpdateProductMeasurements; +} +export const ChangeUpdateProductMeasurements = /*@__PURE__*/ S.suspend(() => + S.Struct({ + present: S.optional(S.Boolean), + value: S.optional(UpdateProductMeasurements), + }), +).annotate({ + identifier: "ChangeUpdateProductMeasurements", +}) as any as S.Schema; + +export interface UpdateProductVariantRequest { + productId: string; + variantId: string; + attributes?: ChangeMapStringString; + gtin?: ChangeString; + mpn?: ChangeString; + pricing?: ChangeUpdateProductPricing; + shippingMeasurements?: ChangeUpdateProductMeasurements; + sku?: ChangeString; +} +export const UpdateProductVariantRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + productId: S.String.pipe(T.Label()), + variantId: S.String.pipe(T.Label()), + attributes: S.optional(ChangeMapStringString), + gtin: S.optional(ChangeString), + mpn: S.optional(ChangeString), + pricing: S.optional(ChangeUpdateProductPricing), + shippingMeasurements: S.optional(ChangeUpdateProductMeasurements), + sku: S.optional(ChangeString), + }).pipe( + T.Http({ + method: "POST", + uri: "/v2/commerce/products/{productId}/variants/{variantId}", + code: 200, + }), + ), +).annotate({ + identifier: "UpdateProductVariantRequest", +}) as any as S.Schema; + +export interface UpdateWebhookSubscriptionRequest { + /** Specifies the Webhook Subscription to update. */ + subscriptionId: string; + endpointUrl?: ChangeString; + topics?: ChangeListString; +} +export const UpdateWebhookSubscriptionRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + subscriptionId: S.String.pipe(T.Label()), + endpointUrl: S.optional(ChangeString), + topics: S.optional(ChangeListString), + }).pipe( + T.Http({ + method: "POST", + uri: "/1.0/webhook_subscriptions/{subscriptionId}", + code: 200, + }), + ), +).annotate({ + identifier: "UpdateWebhookSubscriptionRequest", +}) as any as S.Schema; + +export interface UploadProductImageRequest { + productId: string; +} +export const UploadProductImageRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + productId: S.String.pipe(T.Label()), + }).pipe( + T.Http({ + method: "POST", + uri: "/v2/commerce/products/{productId}/images", + code: 200, + contentType: "multipart", + }), + ), +).annotate({ + identifier: "UploadProductImageRequest", +}) as any as S.Schema; + +export interface UploadProductImageResponse {} +export const UploadProductImageResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({}), +).annotate({ + identifier: "UploadProductImageResponse", +}) as any as S.Schema; + +export type AdjustInventoryStockLevelsError = + | BadRequest + | NotFound + | Conflict + | SquarespaceOpError; +/** Adjust stock quantities Adjusts stock quantities for product variants. Stock quantities can be added or subtracted, set with a given number, or marked as "unlimited". All quantity information is stored in InventoryItems. */ +export const adjustInventoryStockLevels: API.OperationMethod< + AdjustInventoryStockLevelsRequest, + AdjustInventoryStockLevelsResponse, + AdjustInventoryStockLevelsError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: AdjustInventoryStockLevelsRequest, + output: AdjustInventoryStockLevelsResponse, + errors: [BadRequest, NotFound, Conflict, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type AssociateProductVariantImageError = + | BadRequest + | NotFound + | SquarespaceOpError; +/** Associate variant image Assigns a product image to a product variant. Specifying imageId of null will delete the association. */ +export const associateProductVariantImage: API.OperationMethod< + AssociateProductVariantImageRequest, + AssociateProductVariantImageResponse, + AssociateProductVariantImageError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: AssociateProductVariantImageRequest, + output: AssociateProductVariantImageResponse, + errors: [BadRequest, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type CreateAddressBookEntryError = + | BadRequest + | Forbidden + | NotFound + | SquarespaceOpError; +/** Create address book entry Creates a new address book entry for the contact. If this is the contact's only address book entry after creation, it becomes the default shipping address even when defaultShipping is false. Requires OAuth website scope website.contacts, or API key scope CONTACT, or OAuth website scope website.profiles (OAuth only). */ +export const createAddressBookEntry: API.OperationMethod< + CreateAddressBookEntryRequest, + CreateAddressBookEntryResponse, + CreateAddressBookEntryError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: CreateAddressBookEntryRequest, + output: CreateAddressBookEntryResponse, + errors: [BadRequest, Forbidden, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type CreateContactError = + | BadRequest + | Forbidden + | Conflict + | SquarespaceOpError; +/** Create contact Creates a new contact. Requires OAuth website scope website.contacts, or API key scope CONTACT, or OAuth website scope website.profiles (OAuth only). */ +export const createContact: API.OperationMethod< + CreateContactRequest, + CreateContactResponse, + CreateContactError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: CreateContactRequest, + output: CreateContactResponse, + errors: [BadRequest, Forbidden, Conflict, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type CreateDiscountError = + | BadRequest + | Forbidden + | Conflict + | SquarespaceOpError; +/** Create discount Creates a discount. A successful request returns the created Discount resource. Requires OAuth website scope website.discounts, or API key scope DISCOUNTS. */ +export const createDiscount: API.OperationMethod< + CreateDiscountRequest, + DiscountResponse, + CreateDiscountError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: CreateDiscountRequest, + output: DiscountResponse, + errors: [BadRequest, Forbidden, Conflict, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type CreateOrderError = BadRequest | Conflict | SquarespaceOpError; +/** Create order Creates an order using information from a third-party sales channel. A successful request creates an Order resource. */ +export const createOrder: API.OperationMethod< + CreateOrderRequest, + Order, + CreateOrderError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: CreateOrderRequest, + output: Order, + errors: [BadRequest, Conflict, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type CreateProductError = BadRequest | Conflict | SquarespaceOpError; +/** Create product Creates a product with appropriate subresources based on product type. */ +export const createProduct: API.OperationMethod< + CreateProductRequest, + ProductV2, + CreateProductError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: CreateProductRequest, + output: ProductV2, + errors: [BadRequest, Conflict, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type CreateProductVariantError = + | BadRequest + | NotFound + | Conflict + | SquarespaceOpError; +/** Create product variant Creates a variant of a product. Creating a variant for a physical or service product requires that the product already has at least one attribute. */ +export const createProductVariant: API.OperationMethod< + CreateProductVariantRequest, + ProductVariantV2, + CreateProductVariantError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: CreateProductVariantRequest, + output: ProductVariantV2, + errors: [BadRequest, NotFound, Conflict, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type CreateWebhookSubscriptionError = + | BadRequest + | NotFound + | Conflict + | SquarespaceOpError; +/** Create webhook subscription Creates a webhook subscription. A successful request returns the created Webhook Subscription resource. Requires an OAuth access token; API keys are not supported. The OAuth token must hold scopes appropriate for each subscribed event topic: order.create and order.update require website.orders or website.orders.read; contact.create, contact.update, contact.delete, address.create, address.update, and address.delete require website.contacts; extension.uninstall requires no event-specific scope. */ +export const createWebhookSubscription: API.OperationMethod< + CreateWebhookSubscriptionRequest, + ExternalCreateWebhookSubscriptionResponse, + CreateWebhookSubscriptionError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: CreateWebhookSubscriptionRequest, + output: ExternalCreateWebhookSubscriptionResponse, + errors: [BadRequest, NotFound, Conflict, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type DeleteAddressBookEntryError = + | Forbidden + | NotFound + | SquarespaceOpError; +/** Delete address book entry Deletes the address book entry for the contact. If the deleted entry was the default shipping address, another entry is assigned as the default. Requires OAuth website scope website.contacts, or API key scope CONTACT, or OAuth website scope website.profiles (OAuth only). */ +export const deleteAddressBookEntry: API.OperationMethod< + DeleteAddressBookEntryRequest, + DeleteAddressBookEntryResponse, + DeleteAddressBookEntryError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: DeleteAddressBookEntryRequest, + output: DeleteAddressBookEntryResponse, + errors: [Forbidden, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type DeleteContactError = Forbidden | NotFound | SquarespaceOpError; +/** Delete contact Deletes the contact for the given contact ID. Requires OAuth website scope website.contacts, or API key scope CONTACT, or OAuth website scope website.profiles (OAuth only). */ +export const deleteContact: API.OperationMethod< + DeleteContactRequest, + DeleteContactResponse, + DeleteContactError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: DeleteContactRequest, + output: DeleteContactResponse, + errors: [Forbidden, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type DeleteDiscountError = Forbidden | NotFound | SquarespaceOpError; +/** Delete discount Deletes the discount for the given discount ID. Deletion is permitted for any discount owned by the website, including discounts whose criteria, template, or trigger types are not supported by this API version; no type validation is performed. Requires OAuth website scope website.discounts, or API key scope DISCOUNTS. */ +export const deleteDiscount: API.OperationMethod< + DeleteDiscountRequest, + DeleteDiscountResponse, + DeleteDiscountError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: DeleteDiscountRequest, + output: DeleteDiscountResponse, + errors: [Forbidden, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type DeleteProductError = NotFound | SquarespaceOpError; +/** Delete specified product Delete specified product */ +export const deleteProduct: API.OperationMethod< + DeleteProductRequest, + DeleteProductResponse, + DeleteProductError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: DeleteProductRequest, + output: DeleteProductResponse, + errors: [NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type DeleteProductImageError = NotFound | SquarespaceOpError; +/** Delete one product image Delete one product image */ +export const deleteProductImage: API.OperationMethod< + DeleteProductImageRequest, + DeleteProductImageResponse, + DeleteProductImageError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: DeleteProductImageRequest, + output: DeleteProductImageResponse, + errors: [NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type DeleteProductVariantError = + | NotFound + | Conflict + | SquarespaceOpError; +/** Delete one product variant Delete one product variant */ +export const deleteProductVariant: API.OperationMethod< + DeleteProductVariantRequest, + DeleteProductVariantResponse, + DeleteProductVariantError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: DeleteProductVariantRequest, + output: DeleteProductVariantResponse, + errors: [NotFound, Conflict, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type DeleteWebhookSubscriptionError = NotFound | SquarespaceOpError; +/** Delete webhook subscription Deletes a webhook subscription. Requires an OAuth access token; API keys are not supported. */ +export const deleteWebhookSubscription: API.OperationMethod< + DeleteWebhookSubscriptionRequest, + DeleteWebhookSubscriptionResponse, + DeleteWebhookSubscriptionError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: DeleteWebhookSubscriptionRequest, + output: DeleteWebhookSubscriptionResponse, + errors: [NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type FulfillOrderError = + | BadRequest + | NotFound + | Conflict + | SquarespaceOpError; +/** Fulfill order Updates the status of a specific order to fulfilled, with options to include shipment information and send a customer notification. */ +export const fulfillOrder: API.OperationMethod< + FulfillOrderRequest, + FulfillOrderResponse, + FulfillOrderError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: FulfillOrderRequest, + output: FulfillOrderResponse, + errors: [BadRequest, NotFound, Conflict, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type GetAddressBookError = Forbidden | NotFound | SquarespaceOpError; +/** Get address book Returns paginated addresses for the contact. When there is at least one entry, exactly one is the default shipping address (defaultShippingAddressId and each entry's defaultShipping reflect this). The default shipping address (when present) is always included on the first page of results. Requires OAuth website scope website.contacts.read or website.contacts, or API key scope CONTACT_READONLY or CONTACT, or OAuth website scope website.profiles.read or website.profiles (OAuth only). */ +export const getAddressBook: API.OperationMethod< + GetAddressBookRequest, + GetAddressBookResponse, + GetAddressBookError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetAddressBookRequest, + output: GetAddressBookResponse, + errors: [Forbidden, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type GetAddressBookEntryError = + | Forbidden + | NotFound + | SquarespaceOpError; +/** Get address book entry Returns a single address book entry for the contact. Requires OAuth website scope website.contacts.read or website.contacts, or API key scope CONTACT_READONLY or CONTACT, or OAuth website scope website.profiles.read or website.profiles (OAuth only). */ +export const getAddressBookEntry: API.OperationMethod< + GetAddressBookEntryRequest, + GetAddressBookEntryResponse, + GetAddressBookEntryError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetAddressBookEntryRequest, + output: GetAddressBookEntryResponse, + errors: [Forbidden, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type GetContactError = Forbidden | NotFound | SquarespaceOpError; +/** Get contact Returns the contact for the given contact ID. Requires OAuth website scope website.contacts.read or website.contacts, or API key scope CONTACT_READONLY or CONTACT, or OAuth website scope website.profiles.read or website.profiles (OAuth only). */ +export const getContact: API.OperationMethod< + GetContactRequest, + GetContactResponse, + GetContactError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetContactRequest, + output: GetContactResponse, + errors: [Forbidden, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type GetContactsError = BadRequest | Forbidden | SquarespaceOpError; +/** List contacts Returns a paginated list of contacts for the website. Requires OAuth website scope website.contacts.read or website.contacts, or API key scope CONTACT_READONLY or CONTACT, or OAuth website scope website.profiles.read or website.profiles (OAuth only). */ +export const getContacts: API.PaginatedOperationMethod< + GetContactsRequest, + PaginatedGetContactsResponse, + GetContactsError, + SquarespaceOpContext, + Contact +> = /*@__PURE__*/ API.makePaginated( + () => ({ + input: GetContactsRequest, + output: PaginatedGetContactsResponse, + errors: [BadRequest, Forbidden, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, + pagination: { + mode: "cursor", + inputToken: "cursor", + outputToken: "pagination.nextPageCursor", + items: "contacts", + pageSize: "pageSize", + } as const, + }), + paginateCursor, +) as any; + +export type GetDiscountError = Forbidden | NotFound | SquarespaceOpError; +/** Get discount Returns the discount for the given discount ID. Requires OAuth website scope website.discounts.read or website.discounts, or API key scope DISCOUNTS_READONLY or DISCOUNTS. */ +export const getDiscount: API.OperationMethod< + GetDiscountRequest, + DiscountResponse, + GetDiscountError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetDiscountRequest, + output: DiscountResponse, + errors: [Forbidden, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type GetDocumentsByIdError = BadRequest | NotFound | SquarespaceOpError; +/** Get transactions Retrieves information for specific transaction Documents. The response contains up to 50 Documents. Multiple Documents can be retrieved by providing a comma-separated list of Document ids. */ +export const getDocumentsById: API.OperationMethod< + GetDocumentsByIdRequest, + TransactionListResponse, + GetDocumentsByIdError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetDocumentsByIdRequest, + output: TransactionListResponse, + errors: [BadRequest, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type GetDocumentsByUpdatedOnError = BadRequest | SquarespaceOpError; +/** List transactions Retrieves all financial transactions for orders and donations. Per order and donation, the response groups transactions into a Document, contains up to 50 Documents ordered by their modification date (modifiedOn), and supports dynamic cursors for pagination. */ +export const getDocumentsByUpdatedOn: API.PaginatedOperationMethod< + GetDocumentsByUpdatedOnRequest, + PaginatedTransactionListResponse, + GetDocumentsByUpdatedOnError, + SquarespaceOpContext, + TransactionDocument +> = /*@__PURE__*/ API.makePaginated( + () => ({ + input: GetDocumentsByUpdatedOnRequest, + output: PaginatedTransactionListResponse, + errors: [BadRequest, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, + pagination: { + mode: "cursor", + inputToken: "cursor", + outputToken: "pagination.nextPageCursor", + items: "documents", + } as const, + }), + paginateCursor, +) as any; + +export type GetFulfillmentOptionsError = + | Forbidden + | NotFound + | SquarespaceOpError; +/** Get fulfillment options Returns a list of fulfillment option IDs and carrier services that can be used with discounts. Requires OAuth website scope website.discounts.read or website.discounts, or API key scope DISCOUNTS_READONLY or DISCOUNTS. */ +export const getFulfillmentOptions: API.OperationMethod< + GetFulfillmentOptionsRequest, + FulfillmentOptionsList, + GetFulfillmentOptionsError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetFulfillmentOptionsRequest, + output: FulfillmentOptionsList, + errors: [Forbidden, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type GetInventoryItemsError = BadRequest | NotFound | SquarespaceOpError; +/** List inventory Retrieves real-time stock information for all product variants. Stock information is stored in an InventoryItem for each product variant. The response contains up to 50 InventoryItems and supports dynamic cursors for pagination. */ +export const getInventoryItems: API.PaginatedOperationMethod< + GetInventoryItemsRequest, + PaginatedInventoryItemListResponse, + GetInventoryItemsError, + SquarespaceOpContext, + InventoryItem +> = /*@__PURE__*/ API.makePaginated( + () => ({ + input: GetInventoryItemsRequest, + output: PaginatedInventoryItemListResponse, + errors: [BadRequest, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, + pagination: { + mode: "cursor", + inputToken: "cursor", + outputToken: "pagination.nextPageCursor", + items: "inventory", + } as const, + }), + paginateCursor, +) as any; + +export type GetMemberProfileError = NotFound | SquarespaceOpError; +/** Retrieves basic details about the Squarespace member who owns the provided OAuth token Retrieves basic details about the Squarespace member who owns the provided OAuth token */ +export const getMemberProfile: API.OperationMethod< + GetMemberProfileRequest, + MemberProfile, + GetMemberProfileError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetMemberProfileRequest, + output: MemberProfile, + errors: [NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type GetOrderError = BadRequest | NotFound | SquarespaceOpError; +/** Get order Retrieves information for a specific order. The response contains order information in an Order. */ +export const getOrder: API.OperationMethod< + GetOrderRequest, + Order, + GetOrderError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetOrderRequest, + output: Order, + errors: [BadRequest, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type GetOrdersError = BadRequest | SquarespaceOpError; +/** List orders Retrieves information about all orders. Orders can be filtered by Customer ID and date ranges. The response contains order information in an Order, up to 50 Orders ordered by their modification date (modifiedOn), and supports dynamic cursors for pagination. */ +export const getOrders: API.PaginatedOperationMethod< + GetOrdersRequest, + OrderListResponse, + GetOrdersError, + SquarespaceOpContext, + Order +> = /*@__PURE__*/ API.makePaginated( + () => ({ + input: GetOrdersRequest, + output: OrderListResponse, + errors: [BadRequest, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, + pagination: { + mode: "cursor", + inputToken: "cursor", + outputToken: "pagination.nextPageCursor", + items: "result", + } as const, + }), + paginateCursor, +) as any; + +export type GetProductImageProcessingStatusError = + | NotFound + | SquarespaceOpError; +/** Get image processing status Retrieves the processing status for an uploaded product image. A successful request indicates that a ProductImage is processing, ready, or in an error state. */ +export const getProductImageProcessingStatus: API.OperationMethod< + GetProductImageProcessingStatusRequest, + ProductImageProcessingStatus, + GetProductImageProcessingStatusError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetProductImageProcessingStatusRequest, + output: ProductImageProcessingStatus, + errors: [NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type GetProductsError = BadRequest | SquarespaceOpError; +/** List products Retrieves information for products; products can be filtered within a date range and by product type. The response contains product information in a Product, up to 50 Products ordered by their modification date (modifiedOn), and supports dynamic cursors for pagination. */ +export const getProducts: API.PaginatedOperationMethod< + GetProductsRequest, + PaginatedProductListResponseV2, + GetProductsError, + SquarespaceOpContext, + PaginatedProductListResponseV2ProductsItem +> = /*@__PURE__*/ API.makePaginated( + () => ({ + input: GetProductsRequest, + output: PaginatedProductListResponseV2, + errors: [BadRequest, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, + pagination: { + mode: "cursor", + inputToken: "cursor", + outputToken: "pagination.nextPageCursor", + items: "products", + } as const, + }), + paginateCursor, +) as any; + +export type GetProfilesError = BadRequest | NotFound | SquarespaceOpError; +/** List profiles Retrieves all profiles; profiles can be filtered and sorted. The response contains up to 50 Profiles and supports dynamic cursors for pagination. */ +export const getProfiles: API.PaginatedOperationMethod< + GetProfilesRequest, + PaginatedProfileListResponse, + GetProfilesError, + SquarespaceOpContext, + Profile +> = /*@__PURE__*/ API.makePaginated( + () => ({ + input: GetProfilesRequest, + output: PaginatedProfileListResponse, + errors: [BadRequest, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, + pagination: { + mode: "cursor", + inputToken: "cursor", + outputToken: "pagination.nextPageCursor", + items: "profiles", + } as const, + }), + paginateCursor, +) as any; + +export type GetSpecificInventoryItemsError = + | BadRequest + | NotFound + | SquarespaceOpError; +/** Get inventory Retrieves real-time stock information for specific product variants. Stock information is stored in an InventoryItem and up to 50 InventoryItems can be retrieved per request. */ +export const getSpecificInventoryItems: API.OperationMethod< + GetSpecificInventoryItemsRequest, + InventoryItemListResponse, + GetSpecificInventoryItemsError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetSpecificInventoryItemsRequest, + output: InventoryItemListResponse, + errors: [BadRequest, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type GetSpecificProductsError = + | BadRequest + | NotFound + | SquarespaceOpError; +/** Get products Retrieves information for specific products, including information for any variants or images. Up to 50 products can be retrieved per request. */ +export const getSpecificProducts: API.OperationMethod< + GetSpecificProductsRequest, + ProductListResponseV2, + GetSpecificProductsError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetSpecificProductsRequest, + output: ProductListResponseV2, + errors: [BadRequest, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type GetSpecificProfilesError = + | BadRequest + | NotFound + | SquarespaceOpError; +/** Get profiles Retrieves information for specific profiles. The response contains a list of up to 50 Profiles. Multiple Profiles can be retrieved by providing a comma-separated list of profile ids. */ +export const getSpecificProfiles: API.OperationMethod< + GetSpecificProfilesRequest, + ProfileListResponse, + GetSpecificProfilesError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetSpecificProfilesRequest, + output: ProfileListResponse, + errors: [BadRequest, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type GetStorePagesError = NotFound | SquarespaceOpError; +/** List store pages Retrieves information for all store pages on the website. The response supports dynamic cursors for pagination. */ +export const getStorePages: API.PaginatedOperationMethod< + GetStorePagesRequest, + PaginatedStorePagesResponse, + GetStorePagesError, + SquarespaceOpContext, + StorePage +> = /*@__PURE__*/ API.makePaginated( + () => ({ + input: GetStorePagesRequest, + output: PaginatedStorePagesResponse, + errors: [NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, + pagination: { + mode: "cursor", + inputToken: "cursor", + outputToken: "pagination.nextPageCursor", + items: "storePages", + } as const, + }), + paginateCursor, +) as any; + +export type GetTransactionsSummariesError = BadRequest | SquarespaceOpError; +/** Retrieve transaction summaries grouped by contact */ +export const getTransactionsSummaries: API.OperationMethod< + GetTransactionsSummariesRequest, + RetrieveTransactionsSummariesResponse, + GetTransactionsSummariesError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetTransactionsSummariesRequest, + output: RetrieveTransactionsSummariesResponse, + errors: [BadRequest, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type GetWebhookSubscriptionError = NotFound | SquarespaceOpError; +/** Get webhook subscription Retrieves information for a specific webhook subscription. Requires an OAuth access token; API keys are not supported. */ +export const getWebhookSubscription: API.OperationMethod< + GetWebhookSubscriptionRequest, + ExternalWebhookSubscriptionResponse, + GetWebhookSubscriptionError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetWebhookSubscriptionRequest, + output: ExternalWebhookSubscriptionResponse, + errors: [NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type GetWebhookSubscriptionsError = NotFound | SquarespaceOpError; +/** List webhook subscriptions Retrieves information for all webhook subscriptions. The response contains up to 25 Webhook Subscriptions. Requires an OAuth access token; API keys are not supported. */ +export const getWebhookSubscriptions: API.OperationMethod< + GetWebhookSubscriptionsRequest, + ExternalWebhookSubscriptionListResponse, + GetWebhookSubscriptionsError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetWebhookSubscriptionsRequest, + output: ExternalWebhookSubscriptionListResponse, + errors: [NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type GetWebsiteProfileError = NotFound | SquarespaceOpError; +/** Retrieves basic details about the website that owns the provided API key or OAuth token Retrieves basic details about the website that owns the provided API key or OAuth token */ +export const getWebsiteProfile: API.OperationMethod< + GetWebsiteProfileRequest, + WebsiteProfile, + GetWebsiteProfileError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetWebsiteProfileRequest, + output: WebsiteProfile, + errors: [NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type ListDiscountsError = BadRequest | Forbidden | SquarespaceOpError; +/** List discounts Returns a paginated list of discounts for the website. Requires OAuth website scope website.discounts.read or website.discounts, or API key scope DISCOUNTS_READONLY or DISCOUNTS. */ +export const listDiscounts: API.OperationMethod< + ListDiscountsRequest, + PaginatedDiscountListResponse, + ListDiscountsError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: ListDiscountsRequest, + output: PaginatedDiscountListResponse, + errors: [BadRequest, Forbidden, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type QueryContactsError = BadRequest | Forbidden | SquarespaceOpError; +/** Query contacts Returns a paginated list of contacts matching filters and sort options in the request body. Requires OAuth website scope website.contacts.read or website.contacts, or API key scope CONTACT_READONLY or CONTACT, or OAuth website scope website.profiles.read or website.profiles (OAuth only). */ +export const queryContacts: API.PaginatedOperationMethod< + QueryContactsRequest, + PaginatedQueryContactsResponse, + QueryContactsError, + SquarespaceOpContext, + Contact +> = /*@__PURE__*/ API.makePaginated( + () => ({ + input: QueryContactsRequest, + output: PaginatedQueryContactsResponse, + errors: [BadRequest, Forbidden, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, + pagination: { + mode: "cursor", + inputToken: "cursor", + outputToken: "pagination.nextPageCursor", + items: "contacts", + pageSize: "pageSize", + } as const, + }), + paginateCursor, +) as any; + +export type RotateSubscriptionSecretError = NotFound | SquarespaceOpError; +/** Rotate webhook subscription secret Rotates a webhook subscription's secret. The previous secret for a subscription is no longer valid after a new one is generated. Requires an OAuth access token; API keys are not supported. */ +export const rotateSubscriptionSecret: API.OperationMethod< + RotateSubscriptionSecretRequest, + ExternalRotateSecretResponse, + RotateSubscriptionSecretError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: RotateSubscriptionSecretRequest, + output: ExternalRotateSecretResponse, + errors: [NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type SendTestNotificationForWebhookSubscriptionError = + | BadRequest + | NotFound + | SquarespaceOpError; +/** Send test notification Sends a notification to a subscribed webhook endpoint for testing purposes. This is a one-time notification, and will not be retried if it fails or times out. Requires an OAuth access token; API keys are not supported. */ +export const sendTestNotificationForWebhookSubscription: API.OperationMethod< + SendTestNotificationForWebhookSubscriptionRequest, + ExternalTestNotificationResponse, + SendTestNotificationForWebhookSubscriptionError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: SendTestNotificationForWebhookSubscriptionRequest, + output: ExternalTestNotificationResponse, + errors: [BadRequest, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type UpdateAddressBookEntryError = + | BadRequest + | Forbidden + | NotFound + | SquarespaceOpError; +/** Replace address book entry Replaces an address book entry for the contact with a full JSON body. When updating the entry that is currently the default, setting "defaultShipping" from true to false has no effect. Requires OAuth website scope website.contacts, or API key scope CONTACT, or OAuth website scope website.profiles (OAuth only). */ +export const updateAddressBookEntry: API.OperationMethod< + UpdateAddressBookEntryRequest, + UpdateAddressBookEntryResponse, + UpdateAddressBookEntryError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: UpdateAddressBookEntryRequest, + output: UpdateAddressBookEntryResponse, + errors: [BadRequest, Forbidden, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type UpdateContactError = + | BadRequest + | Forbidden + | NotFound + | Conflict + | SquarespaceOpError; +/** Update contact Updates a contact using JSON merge patch. Requires OAuth website scope website.contacts, or API key scope CONTACT, or OAuth website scope website.profiles (OAuth only). */ +export const updateContact: API.OperationMethod< + UpdateContactRequest, + PatchContactResponse, + UpdateContactError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: UpdateContactRequest, + output: PatchContactResponse, + errors: [BadRequest, Forbidden, NotFound, Conflict, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type UpdateDiscountError = + | BadRequest + | Forbidden + | NotFound + | Conflict + | SquarespaceOpError; +/** Update discount Replaces the discount for the given discount ID. Requires OAuth website scope website.discounts, or API key scope DISCOUNTS. */ +export const updateDiscount: API.OperationMethod< + UpdateDiscountRequest, + DiscountResponse, + UpdateDiscountError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: UpdateDiscountRequest, + output: DiscountResponse, + errors: [BadRequest, Forbidden, NotFound, Conflict, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type UpdateProductError = + | BadRequest + | NotFound + | Conflict + | SquarespaceOpError; +/** Update product Updates information for a product. The endpoint supports partial updates. */ +export const updateProduct: API.OperationMethod< + UpdateProductRequest, + ProductV2, + UpdateProductError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: UpdateProductRequest, + output: ProductV2, + errors: [BadRequest, NotFound, Conflict, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type UpdateProductImageError = + | BadRequest + | NotFound + | SquarespaceOpError; +/** Update product image Updates information for a product image. Currently, the endpoint only supports updates to the alt text for an image. */ +export const updateProductImage: API.OperationMethod< + UpdateProductImageRequest, + ProductImage, + UpdateProductImageError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: UpdateProductImageRequest, + output: ProductImage, + errors: [BadRequest, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type UpdateProductImageOrderError = + | BadRequest + | NotFound + | SquarespaceOpError; +/** Update product image order Updates the ordering of a product image on the product details page. */ +export const updateProductImageOrder: API.OperationMethod< + UpdateProductImageOrderRequest, + UpdateProductImageOrderResponse, + UpdateProductImageOrderError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: UpdateProductImageOrderRequest, + output: UpdateProductImageOrderResponse, + errors: [BadRequest, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type UpdateProductVariantError = + | BadRequest + | NotFound + | Conflict + | SquarespaceOpError; +/** Update product variant Updates a variant of a product. The endpoint supports partial updates. */ +export const updateProductVariant: API.OperationMethod< + UpdateProductVariantRequest, + ProductVariantV2, + UpdateProductVariantError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: UpdateProductVariantRequest, + output: ProductVariantV2, + errors: [BadRequest, NotFound, Conflict, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type UpdateWebhookSubscriptionError = + | BadRequest + | NotFound + | SquarespaceOpError; +/** Update webhook subscription Updates information for a webhook subscription. A successful request returns the updated Webhook Subscription resource. Requires an OAuth access token; API keys are not supported. The OAuth token must hold scopes appropriate for each subscribed event topic: order.create and order.update require website.orders or website.orders.read; contact.create, contact.update, contact.delete, address.create, address.update, and address.delete require website.contacts; extension.uninstall requires no event-specific scope. */ +export const updateWebhookSubscription: API.OperationMethod< + UpdateWebhookSubscriptionRequest, + ExternalWebhookSubscriptionResponse, + UpdateWebhookSubscriptionError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: UpdateWebhookSubscriptionRequest, + output: ExternalWebhookSubscriptionResponse, + errors: [BadRequest, NotFound, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); + +export type UploadProductImageError = + | BadRequest + | NotFound + | Conflict + | SquarespaceOpError; +/** Upload product image Uploads an image for a product. Uploading an image doesn't set the product's featured image. A successful request creates a ProductImage subresource of the Product. */ +export const uploadProductImage: API.OperationMethod< + UploadProductImageRequest, + UploadProductImageResponse, + UploadProductImageError, + SquarespaceOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: UploadProductImageRequest, + output: UploadProductImageResponse, + errors: [BadRequest, NotFound, Conflict, UnknownSquarespaceError], + protocol: SquarespaceProtocol, + retry: Retry.Retry, +})); diff --git a/packages/squarespace/src/traits.ts b/packages/squarespace/src/traits.ts new file mode 100644 index 000000000..3c3b91cee --- /dev/null +++ b/packages/squarespace/src/traits.ts @@ -0,0 +1,44 @@ +/** + * Squarespace SDK trait surface — hand-written. + * + * Re-exports the generic protocol traits from core (so generated operations + * import everything from one place). Squarespace has no envelope of its + * own; the REST-protocol traits (SensitiveValue / RawResponse) come from + * `core/protocol-rest`. + */ +export { + Body, + Header, + Query, + Label, + Http, + ResponseCode, + HttpBody, + FormDataFile, + KeyDictionary, + UnionCases, + applyErrorMatchers, + getErrorMatchers, + type HttpTrait, + type ErrorMatcher, + bodySymbol, + headerSymbol, + querySymbol, + labelSymbol, + httpSymbol, + responseCodeSymbol, + httpBodySymbol, + formDataFileSymbol, + keyDictionarySymbol, + unionCasesSymbol, + errorMatchersSymbol, +} from "@distilled.cloud/core/trait"; + +export { + SensitiveValue, + RawResponse, + RawResponseRoot, + sensitiveValueSymbol, + rawResponseSymbol, + rawResponseRootSymbol, +} from "@distilled.cloud/core/protocol-rest"; diff --git a/packages/squarespace/tsconfig.json b/packages/squarespace/tsconfig.json new file mode 100644 index 000000000..56b16e575 --- /dev/null +++ b/packages/squarespace/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["src/**/*.ts"], + "compilerOptions": { + "composite": true, + "noEmit": false, + "outDir": "./lib", + "rootDir": "./src", + "paths": { + "@distilled.cloud/core/*": ["../core/src/*"] + } + }, + "references": [{ "path": "../core" }] +} diff --git a/packages/squarespace/tsconfig.scripts.json b/packages/squarespace/tsconfig.scripts.json new file mode 100644 index 000000000..be37c3474 --- /dev/null +++ b/packages/squarespace/tsconfig.scripts.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["scripts/**/*.ts"], + "compilerOptions": { + "composite": true, + "noEmit": false, + "emitDeclarationOnly": true, + "outDir": "./.scripts-types", + "rootDir": "./scripts", + "tsBuildInfoFile": "./.scripts-types/tsconfig.scripts.tsbuildinfo", + // Resolve @distilled.cloud/core/* to src (the bun condition), matching + // how the scripts actually run under bun. + "rewriteRelativeImportExtensions": false, + "customConditions": ["bun"] + }, + "references": [{ "path": "../core" }] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ce1acb1be..51430a490 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1187,6 +1187,25 @@ importers: specifier: catalog:tooling version: 26.4.1 + packages/squarespace: + dependencies: + '@distilled.cloud/core': + specifier: workspace:* + version: link:../core + effect: + specifier: catalog:effect + version: 4.0.0-rc.112 + devDependencies: + '@effect/platform-bun': + specifier: catalog:effect + version: 4.0.0-rc.112(effect@4.0.0-rc.112) + '@types/bun': + specifier: catalog:tooling + version: 1.4.1 + '@types/node': + specifier: catalog:tooling + version: 26.4.1 + packages/stripe: dependencies: '@distilled.cloud/core': diff --git a/stacks/distilled-submodules/SpecRepos.ts b/stacks/distilled-submodules/SpecRepos.ts index ca012b8b7..cd04c6107 100644 --- a/stacks/distilled-submodules/SpecRepos.ts +++ b/stacks/distilled-submodules/SpecRepos.ts @@ -104,6 +104,7 @@ export const SPEC_REPOS: readonly SpecRepo[] = [ { package: "render" }, { package: "resend" }, { package: "sentry" }, + { package: "squarespace" }, { package: "stripe" }, { package: "supabase" }, { package: "surrealdb" }, diff --git a/stacks/distilled-submodules/spec-repos/squarespace/fetch-specs.ts b/stacks/distilled-submodules/spec-repos/squarespace/fetch-specs.ts new file mode 100644 index 000000000..14bdc78a8 --- /dev/null +++ b/stacks/distilled-submodules/spec-repos/squarespace/fetch-specs.ts @@ -0,0 +1,136 @@ +#!/usr/bin/env bun +/** + * Fetches the Squarespace Commerce OpenAPI spec and a snapshot of vendor + * docs to ../specs/. + * + * Squarespace publishes ONE OpenAPI 3.1 document — the same file the + * Commerce API docs serve as "Download schema". There is no git repo, so + * the mirror snapshots it. Vendor docs pages are snapshotted next to it so + * generate never crawls developers.squarespace.com at convert time. + * + * Usage: + * bun run fetch-specs.ts + * + * Written to: + * ../specs/openapi.json + * ../specs/docs/*.md + */ + +const OPENAPI_SPEC_URL = + "https://developers.squarespace.com/commerce-apis/latest/schema-processor-version-version-latest.json"; +const SPECS_DIR = "../specs"; +const OUTPUT_PATH = `${SPECS_DIR}/openapi.json`; +const DOCS_DIR = `${SPECS_DIR}/docs`; +const USER_AGENT = "distilled.cloud-squarespace-spec-mirror"; + +/** First-party Commerce API docs snapshotted at fetch time. */ +const DOCS: { url: string; output: string; mustInclude: string }[] = [ + { + url: "https://developers.squarespace.com/commerce-apis/overview.md", + output: "overview.md", + mustInclude: "Commerce APIs", + }, + { + url: "https://developers.squarespace.com/commerce-apis/authentication-and-permissions.md", + output: "authentication-and-permissions.md", + mustInclude: "API key", + }, + { + url: "https://developers.squarespace.com/commerce-apis/making-requests.md", + output: "making-requests.md", + mustInclude: "User-Agent", + }, + { + url: "https://developers.squarespace.com/commerce-apis/versioning.md", + output: "versioning.md", + mustInclude: "api.squarespace.com", + }, + { + url: "https://developers.squarespace.com/commerce-apis/rate-limits.md", + output: "rate-limits.md", + mustInclude: "rate", + }, + { + url: "https://developers.squarespace.com/commerce-apis/responses-error-handling.md", + output: "responses-error-handling.md", + mustInclude: "error", + }, +]; + +import { mkdirSync } from "fs"; +import { dirname } from "path"; + +mkdirSync(SPECS_DIR, { recursive: true }); +mkdirSync(DOCS_DIR, { recursive: true }); + +const fetchText = async (url: string, accept: string): Promise => { + const response = await fetch(url, { + headers: { + accept, + "user-agent": USER_AGENT, + }, + }); + if (!response.ok) { + throw new Error( + `Failed to fetch ${url}: ${response.status} ${response.statusText}`, + ); + } + return response; +}; + +const writeFile = async (path: string, body: string): Promise => { + mkdirSync(dirname(path), { recursive: true }); + await Bun.write(path, body.endsWith("\n") ? body : `${body}\n`); +}; + +async function main() { + console.log(`Fetching OpenAPI spec from ${OPENAPI_SPEC_URL}...`); + + const response = await fetchText(OPENAPI_SPEC_URL, "application/json"); + const spec = (await response.json()) as Record; + + // Fail here rather than three steps later in the generator: a login page or + // a gutted response is still valid JSON, but it is not an OpenAPI document. + if (typeof spec.openapi !== "string" || spec.paths === undefined) { + throw new Error( + `${OPENAPI_SPEC_URL} returned JSON without \`openapi\`/\`paths\` — not an OpenAPI document`, + ); + } + + console.log(`Writing spec to ${OUTPUT_PATH}...`); + await Bun.write(OUTPUT_PATH, JSON.stringify(spec, null, 2) + "\n"); + console.log( + `Done! OpenAPI ${spec.openapi} — ${Object.keys(spec.paths as object).length} paths`, + ); + + for (const doc of DOCS) { + console.log(`Fetching ${doc.url}...`); + const docResponse = await fetchText( + doc.url, + "text/markdown, text/plain;q=0.9, text/html;q=0.5, */*;q=0.1", + ); + const text = await docResponse.text(); + if (text.trim().length === 0) { + throw new Error(`${doc.url} returned an empty document`); + } + const lowered = text.slice(0, 200).toLowerCase(); + if (lowered.includes(" { + console.error("Fatal error:", err); + process.exit(1); +}); diff --git a/stacks/distilled-submodules/spec-repos/squarespace/package.json b/stacks/distilled-submodules/spec-repos/squarespace/package.json new file mode 100644 index 000000000..d78db31bf --- /dev/null +++ b/stacks/distilled-submodules/spec-repos/squarespace/package.json @@ -0,0 +1,27 @@ +{ + "name": "squarespace-spec", + "private": true, + "type": "module", + "scripts": { + "fetch-specs": "bun run fetch-specs.ts", + "tsc": "tsc --noEmit", + "lint": "oxlint .", + "fmt": "oxfmt --write .", + "fmt:check": "oxfmt --check .", + "check": "bun run tsc && bun run lint && bun run fmt:check" + }, + "workspaces": { + "catalog": { + "@typescript/native-preview": "latest", + "oxfmt": "0.21.0", + "oxlint": "1.36.0" + } + }, + "dependencies": { + "@typescript/native-preview": "catalog:" + }, + "devDependencies": { + "oxfmt": "catalog:", + "oxlint": "catalog:" + } +} diff --git a/stacks/distilled-submodules/spec-repos/squarespace/readme.md b/stacks/distilled-submodules/spec-repos/squarespace/readme.md new file mode 100644 index 000000000..c8814c093 --- /dev/null +++ b/stacks/distilled-submodules/spec-repos/squarespace/readme.md @@ -0,0 +1,26 @@ +# spec-mirror-squarespace + +A git mirror of Squarespace's [Commerce OpenAPI spec](https://developers.squarespace.com/commerce-apis/latest/schema-processor-version-version-latest.json). The spec is fetched and committed as a JSON file so the repo serves as a versioned snapshot. First-party docs pages are snapshotted under `specs/docs/`. + +The mirror is updated every 24 hours and is designed to be used as a stable git submodule. + +## Usage as a submodule + +```sh +git submodule add https://github.com/distilled-mirror/spec-mirror-squarespace.git +``` + +## Updating specs + +From `.meta/`: + +```sh +bun install +bun run fetch-specs +``` + +--- + +This repository is managed by the `distilled-submodules` Alchemy stack in +[alchemy-run/distilled](https://github.com/alchemy-run/distilled) (`stacks/distilled-submodules`). +Its scaffolding is generated — edit it there, not here. diff --git a/tsconfig.json b/tsconfig.json index 9fe8de06a..9e1f73db9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -387,6 +387,12 @@ }, { "path": "./packages/sentry/tsconfig.scripts.json" + }, + { + "path": "./packages/squarespace/tsconfig.json" + }, + { + "path": "./packages/squarespace/tsconfig.scripts.json" } ] }