// Type definitions for shopify-api-node 2.10.0 // Project: shopify-api-node // Definitions by: Rich Buggy /*~ This is the module template file for class modules. *~ You should rename it to index.d.ts and place it in a folder with the same name as the module. *~ For example, if you were writing a file for "super-greeter", this *~ file should be 'super-greeter/index.d.ts' */ /*~ Note that ES6 modules cannot directly export class objects. *~ This file should be imported using the CommonJS-style: *~ import x = require('someLibrary'); *~ *~ Refer to the documentation to understand common *~ workarounds for this limitation of ES6 modules. */ /*~ This declaration specifies that the class constructor function *~ is the exported object from the file */ export = Shopify; /*~ Write your module's methods and properties in this class */ type onCallLimitsFn = (limits: Shopify.ICallLimits) => void; declare class Shopify { constructor( config: Shopify.IPublicShopifyConfig | Shopify.IPrivateShopifyConfig ); callLimits: Shopify.ICallLimits; callGraphqlLimits: Shopify.ICallLimits; accessScope: { list: () => Promise; }; apiPermission: { delete: () => Promise; }; // abandonedCheckouts applicationCharge: { activate: (id: number, params?: any) => Promise; create: ( params: Shopify.ICreateApplicationCharge ) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; }; applicationCredit: { create: ( params: Shopify.ICreateApplicationCredit ) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; }; article: { authors: () => Promise; count: (blogId: number, params?: any) => Promise; create: ( blogId: number, params: Shopify.ICreateArticle ) => Promise; delete: (blogId: number, id: number) => Promise; get: ( blogId: number, id: number, params?: any ) => Promise; list: (blogId: number, params?: any) => Promise; tags: (blogId?: number, params?: any) => Promise; update: ( blogId: number, id: number, params: Shopify.IUpdateArticle ) => Promise; }; asset: { create: (themeId: number, params: any) => Promise; delete: (themeId: number, params: any) => Promise; get: (themeId: number, params?: any) => Promise; list: (themeId: number, params?: any) => Promise; update: ( themeId: number, params: Shopify.IUpdateAsset ) => Promise; }; balance: { list: () => Promise; transactions: () => Promise; }; blog: { count: () => Promise; create: (params: Shopify.ICreateBlog) => Promise; delete: (id: number) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; update: (id: number, params: any) => Promise; }; carrierService: { create: ( params: Shopify.ICreateCarrierService ) => Promise; delete: (id: number) => Promise; get: (id: number) => Promise; list: () => Promise; update: ( id: number, params: Shopify.IUpdateCarrierService ) => Promise; }; checkout: { complete: (token: string) => Promise; count: (params?: any) => Promise; create: (params?: any) => Promise; get: (token: string) => Promise; list: (params?: any) => Promise; shippingRates: (token: string) => Promise; update: (token: any, params: any) => Promise; }; collect: { count: (params?: any) => Promise; create: (params: Shopify.ICreateCollect) => Promise; delete: (id: number) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; }; collection: { get: (id: number, params?: any) => Promise; products: (id: number, params?: any) => Promise; }; collectionListing: { get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; productIds: (id: number, params?: any) => Promise; }; comment: { approve: (id: number) => Promise; count: (params?: any) => Promise; create: (params: Shopify.ICreateComment) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; notSpam: (id: number) => Promise; remove: (id: number) => Promise; restore: (id: number) => Promise; spam: (id: number) => Promise; update: ( id: number, params: Shopify.IUpdateComment ) => Promise; }; country: { count: () => Promise; create: (params: Shopify.ICreateCountry) => Promise; delete: (id: number) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; update: ( id: number, params: Shopify.IUpdateCountry ) => Promise; }; currency: { list: () => Promise; }; customCollection: { count: (params?: any) => Promise; create: (params: any) => Promise; delete: (id: number) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; update: (id: number, params: any) => Promise; }; customer: { accountActivationUrl: (id: number) => Promise; count: (params?: any) => Promise; create: (params: any) => Promise; delete: (id: number) => Promise; get: (id: number, params?: any) => Promise; list: (params: any) => Promise; search: (params: any) => Promise; update: (id: number, params: any) => Promise; }; customerAddress: { create: ( customerId: number, params: any ) => Promise; default: ( customerId: number, id: number ) => Promise; delete: (customerId: number, id: number) => Promise; get: (customerId: number, id: number) => Promise; list: ( customerId: number, params?: any ) => Promise; set: (customerId: number, params: any) => Promise; update: ( customerId: number, id: number, params: any ) => Promise; }; customerSavedSearch: { count: (params?: any) => Promise; create: (params: any) => Promise; customers: (id: number, params?: any) => Promise; delete: (id: number) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; update: (id: number, params: any) => Promise; }; discountCode: { create: ( priceRuleId: number, params: any ) => Promise; delete: (priceRuleId: number, id: number) => Promise; get: (priceRuleId: number, id: number) => Promise; list: ( priceRuleId: number, params?: any ) => Promise; lookup: (params: any) => Promise; update: ( priceRuleId: number, id: number, params?: any ) => Promise; }; discountCodeCreationJob: { create: ( priceRuleId: number, params: any[] ) => Promise; discountCodes: (priceRuleId: number, id: number) => Promise; get: ( priceRuleId: number, id: number ) => Promise; }; dispute: { get: (id: number) => Promise; list: (params?: any) => Promise; }; draftOrder: { complete: (id: number, params?: any) => Promise; count: () => Promise; create: (params: any) => Promise; delete: (id: number) => Promise; get: (id: number) => Promise; list: (params?: any) => Promise; sendInvoice: (id: number, params?: any) => Promise; update: (id: number, params?: any) => Promise; }; event: { count: (params?: any) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; }; fulfillment: { cancel: (orderId: number, id: number) => Promise; complete: (orderId: number, id: number) => Promise; count: (orderId: number, params?: any) => Promise; create: (orderId: number, params: any) => Promise; get: ( orderId: number, id: number, params?: any ) => Promise; list: (orderId: number, params?: any) => Promise; open: (orderId: number, id: number) => Promise; update: ( orderId: number, id: number, params: any ) => Promise; }; fulfillmentEvent: { create: ( orderId: number, fulfillmentId: number, params: any ) => Promise; delete: ( orderId: number, fulfillmentId: number, id: number ) => Promise; get: ( orderId: number, fulfillmentId: number, id: number ) => Promise; list: ( orderId: number, fulfillmentId: number, params?: any ) => Promise; update: ( orderId: number, fulfillmentId: number, id: number, params: any ) => Promise; }; fulfillmentService: { create: (params: any) => Promise; delete: (id: number) => Promise; get: (id: number) => Promise; list: (params?: any) => Promise; update: (id: number, params: any) => Promise; }; giftCard: { count: (params?: any) => Promise; create: (params: any) => Promise; disable: (id: number) => Promise; get: (id: number) => Promise; list: (params?: any) => Promise; search: (params: any) => Promise; update: (id: number, params: any) => Promise; }; giftCardAdjustment: { create: ( giftCardId: number, params: any ) => Promise; get: ( giftCardId: number, id: number ) => Promise; list: (giftCardId: number) => Promise; }; graphql: (data: string, variables?: any) => Promise; inventoryItem: { get: (id: number) => Promise; list: (params?: any) => Promise; update: (id: number, params: any) => Promise; }; inventoryLevel: { adjust: (params: any) => Promise; connect: (params: any) => Promise; delete: (params: any) => Promise; list: (params: any) => Promise; set: (params: any) => Promise; }; location: { count: () => Promise; get: (id: number) => Promise; inventoryLevels: ( id: number, params?: any ) => Promise; list: () => Promise; }; marketingEvent: { count: (params?: any) => Promise; create: (params: any) => Promise; delete: (id: number) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; update: (id: number, params: any) => Promise; engagements: (id: number, params: any) => Promise; }; metafield: { count: (params?: any) => Promise; create: (params: any) => Promise; delete: (id: number) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; update: (id: number, params: any) => Promise; }; on: (event: 'callLimits', callback: onCallLimitsFn) => Shopify; order: { cancel: (id: number, params?: any) => Promise; close: (id: number) => Promise; count: (params?: any) => Promise; create: (params: any) => Promise; delete: (id: number) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; open: (id: number) => Promise; update: (id: number, params: any) => Promise; }; orderRisk: { create: (orderId: number, params: any) => Promise; delete: (orderId: number, id: number) => Promise; get: (orderId: number, id: number) => Promise; list: (orderId: number) => Promise; update: ( orderId: number, id: number, params: any ) => Promise; }; page: { count: (params?: any) => Promise; create: (params: any) => Promise; delete: (id: number) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; update: (id: number, params: any) => Promise; }; payment: { count: (checkoutToken: string) => Promise; create: (checkoutToken: string, params: any) => Promise; get: (checkoutToken: string, id: number) => Promise; list: (checkoutToken?: string) => Promise; }; payout: { get: (id: number) => Promise; list: (params?: any) => Promise; }; policy: { list: (params?: any) => Promise; }; priceRule: { create: (params: any) => Promise; delete: (id: number) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; update: (id: number, params: any) => Promise; }; product: { count: (params?: any) => Promise; create: (params: any) => Promise; delete: (id: number) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; update: (id: number, params: any) => Promise; }; productImage: { count: (productId: number, params?: any) => Promise; create: (productId: number, params: any) => Promise; delete: (productId: number, id: number) => Promise; get: ( productId: number, id: number, params?: any ) => Promise; list: (productId: number, params?: any) => Promise; update: ( productId: number, id: number, params: any ) => Promise; }; productListing: { count: () => Promise; create: ( productId: number, params: any ) => Promise; delete: (productId: number) => Promise; get: (productId: number) => Promise; list: (params?: any) => Promise; productIds: (params?: any) => Promise; }; productResourceFeedback: { create: ( productId: number, params: any ) => Promise; list: ( productId: number, params?: any ) => Promise; }; productVariant: { count: (productId: number) => Promise; create: ( productId: number, params: any ) => Promise; delete: (productId: number, id: number) => Promise; get: (id: number, params?: any) => Promise; list: ( productId: number, params?: any ) => Promise; update: (id: number, params: any) => Promise; }; province: { count: (countryId: number, params?: any) => Promise; get: ( countryId: number, id: number, params?: any ) => Promise; list: (countryId: number, params?: any) => Promise; update: ( countryId: number, id: number, params: any ) => Promise; }; recurringApplicationCharge: { activate: ( id: number, params: any ) => Promise; create: ( params: Shopify.ICreateRecurringApplicationCharge ) => Promise; delete: (id: number) => Promise; get: ( id: number, params?: any ) => Promise; list: (params?: any) => Promise; customize: ( id: number, params: any ) => Promise; }; redirect: { count: (params?: any) => Promise; create: (params: Shopify.ICreateRedirect) => Promise; delete: (id: number) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; update: ( id: number, params: Shopify.IUpdateRedirect ) => Promise; }; refund: { calculate: (orderId: number, params: any) => Promise; create: (orderId: number, params: any) => Promise; get: ( orderId: number, id: number, params?: any ) => Promise; list: (orderId: number, params?: any) => Promise; }; report: { create: (params: any) => Promise; delete: (id: number) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; update: (id: number, params: any) => Promise; }; resourceFeedback: { create: (params: any) => Promise; list: () => Promise; }; scriptTag: { count: (params?: any) => Promise; create: (params: Shopify.ICreateScriptTag) => Promise; delete: (id: number) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; update: ( id: number, params: Shopify.IUpdateScriptTag ) => Promise; }; shippingZone: { list: (params?: any) => Promise; }; shop: { get: (params?: any) => Promise; }; smartCollection: { count: (params?: any) => Promise; create: (params: any) => Promise; delete: (id: number) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; order: (id: number, params: any) => Promise; products: (id: number, params: any) => Promise; update: (id: number, params: any) => Promise; }; storefrontAccessToken: { create: (params: any) => Promise; delete: (id: number) => Promise; list: () => Promise; }; tenderTransaction: { list: (params?: any) => Promise; }; theme: { create: (params: any) => Promise; delete: (id: number) => Promise; get: (id: number, params: any) => Promise; list: (params?: any) => Promise; update: (id: number, params: any) => Promise; }; transaction: { count: (orderId: number) => Promise; create: (orderId: number, params: any) => Promise; get: ( orderId: number, id: number, params?: any ) => Promise; list: (orderId: number, params?: any) => Promise; }; usageCharge: { create: ( recurringApplicationChargeId: number, params: Shopify.ICreateUsageCharge ) => Promise; get: ( recurringApplicationChargeId: number, id: number, params?: any ) => Promise; list: ( recurringApplicationChargeId: number, params?: any ) => Promise; }; user: { current: () => Promise; get: (id: number) => Promise; list: () => Promise; }; webhook: { count: (params?: any) => Promise; create: (params: Shopify.ICreateWebhook) => Promise; delete: (id: number) => Promise; get: (id: number, params?: any) => Promise; list: (params?: any) => Promise; update: ( id: number, params: Shopify.IUpdateWebhook ) => Promise; }; } /*~ If you want to expose types from your module as well, you can *~ place them in this block. */ declare namespace Shopify { export interface IAutoLimit { bucketSize: number; calls: number; interval: number; } export interface IPublicShopifyConfig { accessToken: string; apiVersion?: string; autoLimit?: boolean | IAutoLimit; presentmentPrices?: boolean; shopName: string; timeout?: number; } export interface IPrivateShopifyConfig { apiKey: string; apiVersion?: string; autoLimit?: boolean | IAutoLimit; password: string; presentmentPrices?: boolean; shopName: string; timeout?: number; } export interface ICallLimits { remaining: number; current: number; max: number; } interface IAccessScope { handle: string; } interface ICheckout { abandoned_checkout_url: string; applied_discount?: ICheckoutDiscount[]; billing_address?: ICustomerAddress; buyer_accepts_marketing: boolean; cancel_reason?: 'customer' | 'fraud' | 'inventory' | 'other' | null; cart_token: string; closed_at: string | null; completed_at: string | null; created_at: string; currency: string; customer: ICustomer; customer_id: number; customer_locale: string; discount_code?: string; discount_codes?: ICheckoutDiscount[]; device_id: number | null; email: string; gateway: string | null; gift_cards?: ICheckoutGiftCard; id: number; landing_site: string; line_items: ICheckoutLineItem[]; location_id: number | null; // In API response but not documented note: string | null; note_attributes: any[]; order?: ICheckoutOrder; payment_due: string; payment_url?: string; phone: string | null; presentment_currency: string; referring_site: string; request_details?: ICheckoutRequestDetails; requires_shipping?: boolean; reservation_time?: number; reservation_time_left?: number; shipping_address: ICustomerAddress; shipping_lines: ICheckoutShippingLine[]; shipping_rates?: ICheckoutShippingRate[]; shipping_rate?: ICheckoutShippingRate[]; source_indentifier: string | null; source_name: string | null; source_url: string | null; subtotal_price: string; tax_lines: ICheckoutTaxLine[]; taxes_included: boolean; token: string; total_discounts: string; total_line_items_price: string; total_price: string; total_tax: string; total_weight: number; updated_at: string; user_id: number | null; // In API response but not documented web_url?: string; } interface ICheckoutLineItem { applied_discounts: any[]; compare_at_price: string; destination_location_id: number; discount_codes: any[]; fulfillment_service: 'api' | 'custom' | 'legacy' | 'manual'; fulfillment_status?: 'fulfilled' | 'partial' | null; gift_card: boolean; grams: number; key: string; line_price: string; name: string; origin_location_id: number; price: string; product_id: number; properties: any | null; quantity: number; requires_shipping: boolean; sku: string; taxable: boolean; tax_lines: ICheckoutTaxLine[]; title: string; variant_id: number; variant_title: string; vendor: string; } interface ICheckoutShippingLine { api_client_id: number | null; applied_discounts: any[]; carrier_identifier: any | null; carrier_service_id: number | null; code: string; delivery_category: any | null; id: string; markup: string; phone: string | null; price: string; requested_fulfillment_service_id: number | null; source: string; tax_lines: any[]; title: string; validation_context: any | null; } interface ICheckoutTaxLine { compare_at: number; position: number; price: string; rate: number; source: string; title: string; zone: string; } interface IApplicationCharge { confirmation_url: string; created_at: string; id: number; name: string; price: string; return_url: string; status: 'accepted' | 'declined' | 'expired' | 'pending'; test: boolean | null; updated_at: string; } interface ICreateApplicationCharge { name: string; price: string; return_url: string; status: 'accepted' | 'declined' | 'expired' | 'pending'; test?: true; } interface IApplicationCredit { amount: string; description: string; id: number; test: boolean | null; } interface ICreateApplicationCredit { description: string; amount: string; test?: true; } interface IArticle { author: string; blog_id: number; body_html: string; created_at: string; id: number; handle: string; image: IImage; metafields: IObjectMetafield[]; published: boolean; published_at: string; summary_html: string | null; tags: string; template_suffix: string | null; title: string; updated_at: string; user_id: number; } interface ICreateArticle { author: string; body_html: string; handle?: string; image?: IBase64Image; metafields?: ICreateObjectMetafield[]; published?: boolean; published_at?: string; summary_html?: string | null; tags?: string; template_suffix?: string | null; title: string; user_id?: number; } interface IUpdateArticle { author: string; body_html: string; handle?: string; image?: IBase64Image; metafields?: ICreateObjectMetafield[]; published?: boolean; published_at?: string; summary_html?: string | null; tags?: string; template_suffix?: string | null; title: string; user_id?: number; } interface IImage { created_at: string; height: number; src: string; updated_at?: string; width: number; alt: string | null; } interface IBase64Image { attachment: string; } interface IObjectMetafield { key: string; namespace: string; value: string | number; value_type: 'string' | 'integer'; description: string | null; } interface ICreateObjectMetafield { key: string; namespace: string; value: string | number; value_type: 'string' | 'integer'; description?: string | null; } interface IAsset { attachment?: string; content_type: string; created_at: string; key: string; public_url: string; size: number; source_key: string; src: string; theme_id: number; updated_at: string; value?: string; } interface IUpdateAsset { attachment?: string; key: string; source_key?: string; src?: string; value?: string; } type BalanceTransactionType = | 'charge' | 'refund' | 'dispute' | 'reserve' | 'adjustment' | 'credit' | 'debit' | 'payout' | 'payout_failure' | 'payout_cancellation'; type BalanceTransactionSourceType = | 'charge' | 'refund' | 'dispute' | 'reserve' | 'adjustment' | 'payout'; interface IBalanceTransaction { id: number; type: BalanceTransactionType; test: boolean; payout_id: number; payout_status: string; currency: string; amount: string; fee: string; net: string; source_id: number; source_type: BalanceTransactionSourceType; source_order_transaction_id: number; source_order_id: number; processed_at: string; } interface IBalance { currency: string; amount: string; } interface IBlog { commentable: 'moderate' | 'no' | 'yes'; created_at: string; feedburner: string | null; feedburner_location: string | null; handle: string; id: number; metafield: IObjectMetafield[]; tags: string; template_suffix: string | null; title: string; updated_at: string; } interface ICreateBlog { commentable?: 'moderate' | 'no' | 'yes'; feedburner?: string | null; feedburner_location?: string | null; handle?: string; metafield?: ICreateObjectMetafield[]; tags?: string; template_suffix?: string | null; title: string; } interface ICarrierService { id: number; active: boolean; callback_url: string; carrier_service_type: string; // I think this could be restricted to "api" or "legacy" name: string; service_discovery: boolean; format: 'json' | 'xml'; } interface ICreateCarrierService { active?: boolean; callback_url: string; carrier_service_type?: string; name: string; service_discovery: boolean; format?: 'json' | 'xml'; } interface IUpdateCarrierService { active?: boolean; callback_url?: string; carrier_service_type?: string; name?: string; service_discovery?: boolean; format?: 'json' | 'xml'; } interface ICheckoutDiscount { amount: string; applicable: boolean; description: string; non_applicable_reason: string; title: string; value: string; value_type: 'fixed_amount' | 'percentage'; } interface ICheckoutGiftCard { amount_used: string; balance: string; id: string; last_characters: string; } interface ICheckoutShippingRateCheckout { subtotal_price: string; total_price: string; total_tax: string; } interface ICheckoutShippingRate { checkout: ICheckoutShippingRateCheckout; delivery_range: string[]; handle: string; price: string; requires_phone: boolean; title: string; } interface ICheckoutOrder { id: number; name: string; status_url: string; } interface ICheckoutRequestDetails { accept_language: string; ip_address: string; user_agent: string; } interface ICollect { collection_id: number; created_at: string; featured: boolean; id: number; position: number; product_id: number; sort_value: string; updated_at: string; } interface ICreateCollect { collection_id: number; featured?: boolean; position?: number; product_id: number; sort_value?: string; } interface ICollection { admin_graphql_api_id: string; body_html: string; collection_type: string; handle: string; id: number; image: IImage; products_count: number; published_at: string; published_scope: string; sort_order: string; template_suffix: string | null; title: string; updated_at: string; } type CollectionListingSortOrder = | 'alpha-asc' | 'alpha-desc' | 'best-selling' | 'created' | 'created-desc' | 'manual' | 'price-asc' | 'price-desc'; interface ICollectionListingImage extends IImage { position: number; product_it: number; variant_ids: number[]; } interface ICollectionListing { collection_id: string; body_html: string; default_product_image: ICollectionListingImage; image: IImage; handle: string; published_at: string; title: string; sort_order: CollectionListingSortOrder; updated_at: string; } type CommentStatus = 'published' | 'removed' | 'spam' | 'unapproved'; interface IComment { article_id: number; author: string; blog_id: number; body: string; body_html: string; created_at: string; email: string; id: number; ip: string; published_at: string; status: CommentStatus; updated_at: string; user_agent: string; } interface ICreateComment { article_id?: number; author: string; blog_id?: number; body?: string; body_html?: string; email: string; ip?: string; published_at?: string; status?: CommentStatus; user_agent?: string; } interface IUpdateComment { article_id?: number; author?: string; blog_id?: number; body?: string; body_html?: string; email?: string; ip?: string; published_at?: string; status?: CommentStatus; user_agent?: string; } interface ICountry { code: string; id: number; name: string; provinces: IProvince[]; tax: number; tax_name: string; } interface ICreateCountry { code: string; name?: string; tax?: number; tax_name?: string; } interface IUpdateCountry { code?: string; name?: string; tax?: number; tax_name?: string; } interface ICurrencyExchangeAdjustment { id: number; adjustment: string; original_amount: string; final_amount: string; currency: string; } interface ICurrency { currency: string; rate_updated_at: string; enabled: boolean; } type CustomerCollectionSortOrder = | 'alpha-asc' | 'alpha-desc' | 'best-selling' | 'created' | 'created-desc' | 'manual' | 'price-asc' | 'price-desc'; interface ICustomCollection { body_html: string | null; handle: string; image: IImage; id: number; metafield?: IObjectMetafield; // From https://help.shopify.com/api/reference/customcollection but not visible in test API call published?: string; // From https://help.shopify.com/api/reference/customcollection but not visible in test API call published_at: string; published_scope: string; sort_order: CustomerCollectionSortOrder; template_suffix: string | null; title: string; updated_at: string; } type CustomerState = 'declined' | 'disabled' | 'enabled' | 'invited'; interface ICustomer { accepts_marketing: boolean; addresses?: ICustomerAddress[]; created_at: string; currency: string; default_address: ICustomerAddress; email: string; first_name: string; id: number; last_name: string; metafield?: IObjectMetafield; // From https://help.shopify.com/api/reference/customer but not visible in test API call phone: string; multipass_identifier: null; last_order_id: number | null; last_order_name: string | null; note: string | null; orders_count: number; state: CustomerState; tags: string; tax_exempt: boolean; total_spent: string; updated_at: string; verified_email: boolean; } interface ICustomerAddress { address1: string; address2?: string; city: string; company: string | null; country: string; country_code: string; country_name: string; customer_id: number; default: boolean; first_name: string; id: number; last_name: string; latitude: string; longitude: string; name: string; phone: string | null; province: string; province_code: string; zip: string; } interface ICustomerSavedSearch { created_at: string; id: number; name: string; query: string; updated_at: string; } type AllocationMethod = 'across' | 'each' | 'one'; type TargetSelection = 'all' | 'entitled' | 'explicit'; type TargetType = 'line_item' | 'shipping_line'; type DiscountApplicationType = 'manual' | 'script' | 'discount_code'; type ValueType = 'fixed_amount' | 'percentage'; interface IDiscountApplication { allocation_method: AllocationMethod; code: string; description: string; target_selection: TargetSelection; target_type: TargetType; title: string; type: DiscountApplicationType; value: string; value_type: ValueType; } interface IDiscountCode { created_at: string; id: number; code: string; price_rule_id: number; updated_at: string; usage_count: number; } interface IDiscountCodeCreation { codes_count: number; completed_at: string; created_at: string; failed_count: number; id: number; imported_count: number; price_rule_id: number; started_at: string; status: string; updated_at: string; } type DisputeReason = | 'bank_not_process' | 'credit_not_processed' | 'customer_initiated' | 'debit_not_authorized' | 'duplicate' | 'fraudulent' | 'general' | 'incorrect_account_details' | 'insufficient_funds' | 'product_not_received' | 'product_unacceptable' | 'subscription_cancelled' | 'unrecognized' | 'credit_not_processed'; type DisputeStatus = | 'needs_response' | 'under_review' | 'charge_refunded' | 'accepted' | 'won' | 'lost'; interface IDispute { id: number; order_id: number; type: 'inquiry' | 'chargeback'; currency: string; amount: string; reason: DisputeReason; network_reason_code: number; status: DisputeStatus; evidence_due_by: string; evidence_sent_on: string; finalized_on: string; } interface IDraftOrderNoteAttribute { name: string; value: string; } type DraftOrderDiscountValueType = 'fixed_amount' | 'percentage'; interface IDraftOrderDiscount { amount: string; description: string; non_applicable_reason: string; title: string; value: string; value_type: DraftOrderDiscountValueType; } type DraftOrderLineItemFulfullmentService = | 'api' | 'custom' | 'legacy' | 'manual'; type DraftOrderLineItemFulfullmentStatus = 'fulfilled' | 'partial'; interface IDraftOrderLineItem { applied_discounts: any[] | null; discount_codes: any[]; fulfillment_service: DraftOrderLineItemFulfullmentService; fulfillment_status?: DraftOrderLineItemFulfullmentStatus | null; gift_card: boolean; grams: number; key: string; line_price: string; name: string; origin_location_id: number; price: string; product_id: number; properties: any | null; quantity: number; requires_shipping: boolean; sku: string; taxable: boolean; tax_lines: ICheckoutTaxLine[]; title: string; variant_id: number; variant_title: string; vendor: string; } interface IDraftOrder { applied_discount: IDraftOrderDiscount[]; billing_address: ICustomerAddress; completed_at: string | null; created_at: string; currency: string; customer: ICustomer | null; email: string; id: number; invoice_sent_at: string | null; invoice_url: string; line_items: IDraftOrderLineItem[]; name: string; note: string; note_attributes: IDraftOrderNoteAttribute[]; order_id: number | null; shipping_address: ICustomerAddress; shipping_line: string; status: string; subtotal_price: string; tags: string; tax_exempt: boolean; tax_lines: string; taxes_included: boolean; total_tax: string; total_price: string; updated_at: string; } interface IEvent { arguments: any[]; author: string; body: string | null; created_at: string; id: number; description: string; path: string; message: string; subject_id: number; subject_type: | 'Article' | 'Blog' | 'Collection' | 'Comment' | 'Order' | 'Page' | 'Product' | 'ApiPermission'; verb: string; } type IFulfillmentStatus = | 'cancelled' | 'error' | 'failure' | 'open' | 'pending' | 'success'; interface IFulfillmentReceipt { textcase: boolean; authorization: string; } interface IFulfillmentLineItemProperty { name: string; value: string; } interface IFulfillmentLineItemTaxLine { title: string; price: string; rate: number; } interface IFulfillmentLineItem { id: number; variant_id: number; title: string; quantity: number; price: string; grams: number; sku: string; variant_title: string; vendor: any | null; fulfillment_service: string; product_id: number; requires_shipping: boolean; taxable: boolean; gift_card: boolean; name: string; variant_inventory_management: string; properties: IFulfillmentLineItemProperty[]; product_exists: boolean; fulfillable_quantity: number; total_discount: string; fulfillment_status: IFulfillmentStatus; tax_lines: IFulfillmentLineItemTaxLine[]; } interface IFulfillment { created_at: string; id: number; line_items: IFulfillmentLineItem[]; notify_customer: boolean; order_id: number; receipt: IFulfillmentReceipt; service: string; shipment_status: string | null; status: IFulfillmentStatus; tracking_company: string; tracking_numbers: string[]; tracking_url: string; tracking_urls: string[]; updated_at: string; variant_inventory_management: string; } type FulfillmentEventStatus = | 'confirmed' | 'delivered' | 'failure' | 'in_transit' | 'out_for_delivery'; interface IFulfillmentEvent { address1: string | null; city: string | null; country: string | null; created_at: string; estimated_delivery_at: string | null; fulfillment_id: number; id: number; happened_at: string; latitude: string | null; longitude: string; message: string | null; order_id: number; province: string | null; shop_id: number; status: FulfillmentEventStatus; updated_at: string; zip: string | null; } interface IFulfillmentService { callback_url: string; email: string | null; format: 'json'; handle: string; id: number; include_pending_stock: boolean; inventory_management: boolean; location_id: number; name: string; provider_id: number | null; requires_shipping_method: boolean; service_name: string | null; tracking_support: boolean; } interface IGiftCard { id: number; api_client_id: number; user_id: number; order_id: number; customer_id: number; line_item_id: number; balance: string; currency: string; code: string; last_characters: string; note: string; template_suffix: string; created_at: string; updated_at: string; disabled_at: string; expires_on: string; } interface IGiftCardAdjustment { id: number; number: number; amount: number; note: string; remote_transaction_ref: string; remote_transaction_url: string; api_client_id: number; user_id: number; order_transaction_id: number; created_at: string; processed_at: string; } interface IInventoryItem { id: number; sku: string; tracked: boolean; created_at: string; updated_at: string; requires_shipping: boolean; country_code_of_origin: string; harmonized_system_code: string; } interface IInventoryLevel { inventory_item_id: number; location_id: number; available: number | null; updated_at: string; } type LineItemFulfillmentStatus = | 'fulfilled' | 'not_eligible' | 'partial' | null; interface ILineItemProperty { name: string; value: string; } interface ILineItemDiscountAllocation { amount: string; discount_application_index: number; } interface ILineItemTaxLine { title: string; price: string; rate: number; price_set: IOrderAdjustmentAmountSet; } interface ILineItem { discount_allocations: ILineItemDiscountAllocation[]; fulfillable_quantity: number; fulfillment_service: string; fulfillment_status: LineItemFulfillmentStatus; gift_card: boolean; grams: number; id: number; name: string; price: string; price_set: IOrderAdjustmentAmountSet; product_id: number; properties: ILineItemProperty[]; quantity: number; require_shipping: boolean; sku: string; tax_lines: ILineItemTaxLine[]; taxable: boolean; tip_payment_gateway: string; tip_payment_method: string; title: string; total_discount: string; total_discount_set: IOrderAdjustmentAmountSet; variant_id: number; variant_title: string; vendor: string; } interface ILocation { id: number; active: boolean; admin_graphql_api_id: string; address1: string; address2: string | null; city: string; country: string; country_code: string; country_name: string; created_at: string; deleted_at: string; legacy: boolean; name: string; phone: string; province: string; province_code: string; updated_at: string; zip: string; } interface IMarketingEventMarketedResources { id: number; type: | 'product' | 'collection' | 'price_rule' | 'discount' | 'page' | 'article' | 'shop'; } type MarketingEventEventType = | 'ad' | 'post' | 'message' | 'retargeting' | 'sem' | 'transactional' | 'affiliate' | 'loyalty' | 'newsletter' | 'abandoned_cart' | 'receipt'; type MarketingEventMarketingChannel = | 'search' | 'display' | 'social' | 'email' | 'referral'; type MarketingEventBudgetType = 'daily' | 'lifetime'; interface IMarketingEvent { breadcrumb_id: any | null; budget: string; budget_type: MarketingEventBudgetType; currency: string; description: string | null; ended_at: string | null; event_target: string; event_type: MarketingEventEventType; id: number; manage_url: string; marketed_resources: IMarketingEventMarketedResources[]; marketing_channel: MarketingEventMarketingChannel; paid: boolean; preview_url: string; referring_domain: string; remote_id: string; scheduled_to_end_at: string | null; started_at: string; utm_campaign: string; utm_medium: string; utm_source: string; } type MetaFieldValueType = 'string' | 'integer'; interface IMetafield { created_at: string; description: string | null; id: number; key: string; namespace: string; owner_id: number; owner_resource: string; value: string | number; value_type: MetaFieldValueType; updated_at: string; } type OrderCancelReason = | 'customer' | 'declined' | 'fraud' | 'inventory' | 'other'; interface IOrderClientDetails { accept_language: string | null; browser_height: number | null; browser_ip: string | null; browser_width: number | null; session_hash: string | null; user_agent: string | null; } interface IOrderCustomer { accepts_marketing: boolean; created_at: string; default_address: ICustomerAddress; email: string; first_name: string; id: number; last_name: string; phone: string; multipass_identifier: null; last_order_id: number | null; last_order_name: string | null; note: string | null; orders_count: number; state: CustomerState; tags: string; total_spent: string; updated_at: string; } type OrderDiscountCodeType = 'fixed_amount' | 'percentage' | 'shipping'; type OrderFinancialStatus = | 'authorized' | 'paid' | 'partially_paid' | 'partially_refunded' | 'pending' | 'refunded' | 'voided'; type OrderFulfillmentStatus = 'fulfilled' | 'partial' | 'restocked' | null; type OrderProcessingMethod = | 'checkout' | 'direct' | 'express' | 'manual' | 'offsite'; interface IOrderDiscountCode { amount: number; code: string; type: OrderDiscountCodeType; } interface IOrderFulfillmentLineItemTaxLine { title: string; price: string; rate: number; } interface IOrderFulfillmentLineItemProperty { name: string; value: string; } interface IOrderFulfillmentLineItem { id: number; variant_id: number; title: string; quantity: number; price: string; grams: number; sku: string; variant_title: string; vendor: string | null; fulfillment_service: string; product_id: number; requires_shipping: boolean; taxable: boolean; gift_card: boolean; name: string; variant_inventory_management: string; product_exists: boolean; fulfillable_quantity: number; total_discount: string; fulfillment_status: 'fulfilled' | 'partial' | null; tax_lines: IOrderFulfillmentLineItemTaxLine[]; properties: IOrderFulfillmentLineItemProperty[]; } interface IOrderFulfillment { created_at: string; id: number; location_id: number | null; line_items: IOrderFulfillmentLineItem[]; notify_customer: boolean; order_id: number; receipt: IFulfillmentReceipt; service: string; shipment_status: FulfillmentEventStatus; status: IFulfillmentStatus; tracking_company: string; tracking_number: string; tracking_numbers: string[]; tracking_url: string; tracking_urls: string[]; updated_at: string; variant_inventory_management: string; } interface IOrderLineItemProperty { name: string; value: string; } interface IOrderTaxLine { title: string; price: string; price_set: IOrderAdjustmentAmountSet; rate: number; } interface IOrderLineItemNote { name: string; value: string; } interface IOrderLineItem { fulfillable_quantity: number; fulfillment_service: string; fulfillment_status: OrderFulfillmentStatus; grams: number; id: number; price: string; price_set: IOrderAdjustmentAmountSet; product_id: number | null; quantity: number; requires_shipping: boolean; sku: string; title: string; variant_id: number | null; variant_title: string; vendor: string; name: string; gift_card: boolean; properties: IOrderLineItemProperty[]; taxable: boolean; tax_lines: IOrderTaxLine[]; total_discount: string; total_discount_set: IOrderAdjustmentAmountSet; } interface IOrderShippingLineTaxLine { title: string; price: string; rate: number; } interface IOrderShippingLine { code: string; discounted_price: string; discounted_price_set: IOrderAdjustmentAmountSet; price: string; price_set: IOrderAdjustmentAmountSet; source: string; title: string; tax_lines: IOrderShippingLineTaxLine[]; carrier_identifier: string | null; requested_fulfillment_service_id: string | null; } interface IPaymentDetails { avs_result_code: string | null; credit_card_bin: string | null; credit_card_company: string; credit_card_number: string; cvv_result_code: string | null; } interface IOrder { app_id: number; billing_address: ICustomerAddress; browser_ip: string | null; buyer_accepts_marketing: boolean; cancel_reason: OrderCancelReason; cancelled_at: string | null; cart_token: string; client_details: IOrderClientDetails; closed_at: string | null; confirmed: boolean; created_at: string; currency: string; customer?: IOrderCustomer; customer_locale: string; discount_applications: IDiscountApplication[]; discount_codes: IOrderDiscountCode[]; email: string; financial_status: OrderFinancialStatus; fulfillments: IOrderFulfillment[]; fulfillment_status: OrderFulfillmentStatus; gateway: string; id: number; landing_site: string; line_items: IOrderLineItem[]; location_id: number | null; name: string; note: string | null; note_attributes: IOrderLineItemNote[]; number: number; order_number: number; order_status_url: string; payment_details?: IPaymentDetails; payment_gateway_names: string[]; phone: string; presentment_currency: string; processed_at: string; processing_method: OrderProcessingMethod; referring_site: string; refunds: IRefund[]; shipping_address: ICustomerAddress; shipping_lines: IOrderShippingLine[]; source_identifier: string | null; source_name: | 'web' | 'pos' | 'shopify_draft_order' | 'iphone' | 'android' | string; subtotal_price: string; subtotal_price_set: IOrderAdjustmentAmountSet; tags: string; tax_lines: IOrderTaxLine[]; taxes_included: boolean; test: boolean; token: string; total_discounts: string; total_discounts_set: IOrderAdjustmentAmountSet; total_line_items_price: string; total_line_items_price_set: IOrderAdjustmentAmountSet; total_price: string; total_price_set: IOrderAdjustmentAmountSet; total_shipping_price_set: IOrderAdjustmentAmountSet; total_tax: string; total_tax_set: IOrderAdjustmentAmountSet; total_tip_received: string; total_weight: number; updated_at: string; user_id: number | null; } type OrderRisksRecommendation = 'accept' | 'investigate' | 'cancel'; interface IOrderRisk { cause_cancel: boolean; checkout_id: number | null; display: boolean; id: number; order_id: number; merchant_message: string; message: string; recommendation: OrderRisksRecommendation; score: number; source: string; } interface IPage { author: string; body_html: string; created_at: string; handle: string; id: number; metafield: IObjectMetafield[]; published_at: string; shop_id: number; template_suffix: string | null; title: string; updated_at: string; } interface IPayout { id: number; status: 'scheduled' | 'in_transit' | 'paid' | 'failed' | 'canceled'; date: string; currency: string; amount: string; } interface IPolicy { title: string; body: string; url: string; created_at: string; updated_at: string; } interface IPriceRulePrerequisiteSubtotalRange { prerequisite_subtotal_range: string; } type PriceRuleTargetType = 'line_item' | 'shipping_line'; type PriceRuleTargetSelection = 'all' | 'entitled'; type PriceRuleAllocationMethod = 'each' | 'across'; type PriceRuleValueType = 'fixed_amount' | 'percentage'; type PriceRuleCustomerSelection = 'all' | 'prerequisite'; interface IPriceRule { created_at: string; id: number; title: string; target_type: PriceRuleTargetType; target_selection: PriceRuleTargetSelection; allocation_method: PriceRuleAllocationMethod; value_type: PriceRuleValueType; value: string; once_per_customer: boolean; usage_limit: number | null; customer_selection: PriceRuleCustomerSelection; prerequisite_saved_search_ids: number[]; prerequisite_subtotal_range: IPriceRulePrerequisiteSubtotalRange | null; prerequisite_shipping_price_range: string; entitled_product_ids: number[]; entitled_variant_ids: number[]; entitled_collection_ids: number[]; entitled_country_ids: number[]; starts_at: string; ends_at: string; } interface IProductOption { id: number; name: string; position: number; product_id: number; values: string[]; } interface IProduct { body_html: string; created_at: string; handle: string; id: number; image: IProductImage; images: IProductImage[]; options: IProductOption[]; product_type: string; published_at: string; published_scope: string; tags: string; template_suffix: string | null; title: string; metafields_global_title_tag?: string; metafields_global_description_tag?: string; updated_at: string; variants: IProductVariant[]; vendor: string; } interface IProductImage { created_at: string; id: number; position: number; product_id: number; variant_ids: number[]; src: string; width: number; height: number; updated_at: string; alt: string | null; } type ProductVariantInventoryPolicy = 'deny' | 'continue'; type ProductVariantWeightUnit = 'g' | 'kg' | 'oz' | 'lb'; interface IProductVariant { barcode: string; compare_at_price: string; created_at: string; fulfillment_service: string; grams: number; id: number; image_id: number | null; inventory_item_id: number; inventory_management: string; inventory_policy: ProductVariantInventoryPolicy; inventory_quantity: number; old_inventory_quantity: number; option1: string | null; option2: string | null; option3: string | null; presentment_prices: IProductVariantPresentmentPriceSet[]; position: number; price: string; product_id: number; requires_shipping: boolean; sku: string; taxable: boolean; tax_code: string | null; title: string; updated_at: string; weight: number; weight_unit: ProductVariantWeightUnit; } interface IProductVariantOption { option_id: number; name: string; value: string; } interface IProductVariantPresentmentPriceSet { price: IOrderAdjustmentMoney; compare_at_price: IOrderAdjustmentMoney; } interface IProductListingVariant extends IProductVariant { available: boolean; option_values: IProductVariantOption[]; } interface IProductListing { product_id: number; body_html: string; created_at: string; handle: string; images: IProductImage[]; options: IProductOption[]; product_type: string; published_at: string; tags: string; title: string; updated_at: string; variants: IProductListingVariant[]; } interface IProvince { code: string; country_id: number; id: number; name: string; shipping_zone_id: NumberConstructor; tax: number; tax_name: string; tax_type: string | null; tax_percentage: number; } type RecurringApplicationChargeStatus = | 'accepted' | 'active' | 'cancelled' | 'declined' | 'expired' | 'frozen' | 'pending'; interface IRecurringApplicationCharge { activated_on: string | null; billing_on: string | null; cancelled_on: string | null; capped_amount: number; confirmation_url: string; created_at: string; id: number; name: string; price: string; return_url: string; status: RecurringApplicationChargeStatus; terms: string; test: boolean | null; trial_days: number; trial_ends_on: string; updated_at: string; } interface ICreateRecurringApplicationCharge { capped_amount?: number; name: string; price: number; return_url: string; terms?: string; test?: boolean | null; trial_days?: number; trial_ends_on?: string; } interface IRedirect { id: string; path: string; target: string; } interface ICreateRedirect { path: string; target: string; } interface IUpdateRedirect { path?: string; target?: string; } interface IRefundLineItem { id: number; line_item: ILineItem; line_item_id: number; quantity: number; restock_type: 'no_restock' | 'cancel' | 'return' | 'legacy_restock'; location_id: number; subtotal: string; total_tax: string; subtotal_set: IOrderAdjustmentAmountSet; total_tax_set: IOrderAdjustmentAmountSet; } interface IOrderAdjustmentMoney { amount: number | string; currency_code: string; } interface IOrderAdjustmentAmountSet { shop_money: IOrderAdjustmentMoney; presentment_money: IOrderAdjustmentMoney; } interface IOrderAdjustment { id: number; order_id: number; refund_id: number; amount: string; tax_amount: string; kind: string; reason: string; amount_set: IOrderAdjustmentAmountSet; tax_amount_set: IOrderAdjustmentAmountSet; } interface IRefund { created_at: string; id: number; note: string; order_adjustments: IOrderAdjustment[]; order_id: number; processed_at: string; refund_line_items: IRefundLineItem[]; restock: string; transactions: ITransaction[]; user_id: string; } interface IReport { category: string; id: number; name: string; shopify_ql: string; updated_at: string; } type ResourceFeedbackState = 'requires_action' | 'success'; interface IResourceFeedback { shop_id: number; created_at: string; updated_at: string; resource_id: number; resource_type: string; state: ResourceFeedbackState; messages: string[]; feedback_generated_at: string; } type ScriptTagDisplayScope = 'online_store' | 'order_status' | 'all'; type ScriptTagEvent = 'onload'; interface IScriptTag { created_at: string; event: ScriptTagEvent; id: number; src: string; display_scope: ScriptTagDisplayScope; updated_at: string; } interface ICreateScriptTag { event: ScriptTagEvent; src: string; display_scope?: ScriptTagDisplayScope; } interface IUpdateScriptTag { event: ScriptTagEvent; src: string; display_scope?: ScriptTagDisplayScope; } interface ICarrierShippingRateProvider { carrier_service_id: number; flat_rate_modified: string; id: number; percentage_modified: number; service_filter: any; shipping_zone_id: number; } interface IPriceBasedShippingRate { id: number; max_order_subtotal: string | null; min_order_subtotal: string | null; name: string; price: string; shipping_zone_id: number; } interface IWeightBasedShippingRate { id: number; name: string; price: string; shipping_zone_id: number; weight_high: number; weight_low: number; } interface IShippingZoneCountry { code: string; country_id: number; id: number; name: string; tax: number; tax_name: string; tax_percentage: number; tax_type: any | null; shipping_zone_id: number; provinces: IProvince[]; } interface IShippingZone { id: number; name: string; countries: IShippingZoneCountry[]; carrier_shipping_rate_providers: ICarrierShippingRateProvider[]; price_based_shipping_rates: IPriceBasedShippingRate[]; weight_based_shipping_rates: IWeightBasedShippingRate[]; } interface IShop { address1: string; address2: string; city: string; country: string; country_code: string; country_name: string; created_at: string; county_taxes: string; customer_email: string | null; currency: string; domain: string; eligible_for_card_reader_giveaway: boolean; eligible_for_payments: boolean; enabled_presentment_currencies: string[]; email: string; finances: boolean; force_ssl: boolean; google_apps_domain: string | null; google_apps_login_enabled: any | null; has_discounts: boolean; has_gift_cards: boolean; has_storefront: boolean; iana_timezone: string; id: number; latitude: number; longitude: number; money_format: string; money_in_emails_format: string; money_with_currency_format: string; money_with_currency_in_emails_format: string; myshopify_domain: string; name: string; password_enabled: boolean; phone: string | null; plan_display_name: string; plan_name: string; pre_launch_enabled: boolean; primary_locale: string; primary_location_id: number; province: string; province_code: string; requires_extra_payments_agreement: boolean; setup_required: boolean; shop_owner: string; source: string | null; tax_shipping: boolean | null; taxes_included: true | null; timezone: string; updated_at: string; weight_unit: string; zip: string; } export type SmartCollectionRuleTextColumn = | 'title' | 'tag' | 'type' | 'variant_title' | 'vendor'; export type SmartCollectionRuleTextRelation = | 'contains' | 'equals' | 'ends_with' | 'not_contains' | 'not_equals' | 'starts_with'; export type SmartCollectionRuleNumberColumn = | 'variant_compare_at_price' | 'variant_inventory' | 'variant_price' | 'variant_weight'; export type TSmartCollectionRuleNumberRelation = | 'equals' | 'greater_than' | 'less_than' | 'not_equals'; interface ISmartCollectionRule { column: SmartCollectionRuleTextColumn | SmartCollectionRuleNumberColumn; relation: | SmartCollectionRuleTextRelation | TSmartCollectionRuleNumberRelation; condition: string; } type SmartCollectionSortOrder = | 'alpha-asc' | 'alpha-desc' | 'best-selling' | 'created' | 'created-desc' | 'manual' | 'price-asc' | 'price-desc'; interface ISmartCollection { body_html: string; disjunctive: boolean; handle: string; id: number; image?: IImage; published_at: string; published_scope: string; rules: ISmartCollectionRule[]; sort_order: SmartCollectionSortOrder; template_suffix: string | null; title: string; updated_at: string; } interface IStorefrontAccessToken { id: string; access_token: string; access_scope: string; created_at: string; title: string; } type ThemeRole = 'main' | 'unpublished'; interface ITheme { created_at: string; id: number; name: string; previewable: boolean; processing: boolean; role: ThemeRole; theme_store_id: number; updated_at: string; } type TenderTransactionPaymentMethod = | 'credit_card' | 'cash' | 'android_pay' | 'apple_pay' | 'google_pay' | 'samsung_pay' | 'shopify_pay' | 'amazon' | 'klarna' | 'paypal' | 'unknown' | 'other'; interface ITenderTransactionPaymentDetails { credit_card_number: string; credit_card_company: string; } interface ITenderTransaction { id: number; order_id: number; amount: string; currency: string; user_id: number; test: boolean; processed_at: string; remote_reference: string; payment_details: ITenderTransactionPaymentDetails; payment_method: TenderTransactionPaymentMethod; } type TransactionErrorCode = | 'call_issuer' | 'card_declined' | 'expired_card' | 'incorrect_address' | 'incorrect_cvc' | 'incorrect_number' | 'incorrect_zip' | 'invalid_cvc' | 'invalid_expiry_date' | 'invalid_number' | 'pick_up_card' | 'processing_error'; type TransactionKind = | 'authorization' | 'capture' | 'refund' | 'sale' | 'void'; type TransactionSourceName = 'android' | 'iphone' | 'pos' | 'web'; type TransactionStatus = 'error' | 'failure' | 'pending' | 'success'; interface ITRansactionReceipt { testcase: boolean; authorization: string; balance_transaction?: { [k: string]: any; }; } interface ITransaction { amount: string; authorization: string; created_at: string; currency: string; currency_exchange_adjustment: ICurrencyExchangeAdjustment; device_id: string; error_code: TransactionErrorCode; gateway: string; id: number; kind: TransactionKind; location_id: number; message: string; order_id: number; payment_details: IPaymentDetails; parent_id: number; processed_at: string; receipt: ITRansactionReceipt; source_name: TransactionSourceName; status: TransactionStatus; test: boolean; user_id: number; } interface IUsageCharge { balance_remaining: number; balance_used: number; billing_on: string; created_at: string; description: string; id: number; price: string; risk_level: number; recurring_application_charge_id: number; updated_at: string; } interface ICreateUsageCharge { description: string; price: number; } type UserPermissions = | 'applications' | 'customers' | 'dashboard' | 'full' | 'gift_cards' | 'links' | 'marketing' | 'order' | 'pages' | 'preferences' | 'products' | 'reports' | 'themes'; type UserType = 'regular' | 'restricted'; interface IUser { account_owner: boolean; bio: string; email: string; first_name: string; id: number; im: string; last_name: string; permissions: UserPermissions[]; phone: string; pin: string; receive_announcements: number; screen_name: string; url: string; user_type: UserType; } type ICartLineItem = ICheckoutLineItem; interface ICart { id: string; token: string; line_items: Shopify.ICartLineItem[]; note: string | null; updated_at: string; created_at: string; } export type IDeletedItem = { id: number; }; export type WebhookTopic = | 'app/uninstalled' | 'carts/create' | 'carts/update' | 'checkouts/create' | 'checkouts/delete' | 'checkouts/update' | 'collection_listings/add' | 'collection_listings/remove' | 'collection_listings/update' | 'collections/create' | 'collections/delete' | 'collections/update' | 'customer_groups/create' | 'customer_groups/delete' | 'customer_groups/update' | 'customers/create' | 'customers/delete' | 'customers/disable' | 'customers/enable' | 'customers/update' | 'draft_orders/create' | 'draft_orders/delete' | 'draft_orders/update' | 'fulfillment_events/create' | 'fulfillment_events/delete' | 'fulfillments/create' | 'fulfillments/update' | 'inventory_items/create' | 'inventory_items/update' | 'inventory_items/delete' | 'inventory_levels/connect' | 'inventory_levels/update' | 'inventory_levels/disconnect' | 'locations/create' | 'locations/update' | 'locations/delete' | 'order_transactions/create' | 'orders/cancelled' | 'orders/create' | 'orders/delete' | 'orders/fulfilled' | 'orders/paid' | 'orders/partially_fulfilled' | 'orders/updated' | 'product_listings/add' | 'product_listings/remove' | 'product_listings/update' | 'products/create' | 'products/delete' | 'products/update' | 'refunds/create' | 'shop/update' | 'themes/create' | 'themes/delete' | 'themes/publish' | 'themes/update'; type WebhookFormat = 'json' | 'xml'; export interface IWebhook { address: string; created_at: string; fields: string[]; format: WebhookFormat; id: number; metafield_namespaces: string[]; topic: WebhookTopic; updated_at: string; } export interface ICreateWebhook { address: string; fields?: string[]; format?: WebhookFormat; metafield_namespaces?: string[]; topic: WebhookTopic; } export interface IUpdateWebhook { address: string; fields?: string[]; format?: WebhookFormat; metafield_namespaces?: string[]; topic: WebhookTopic; } export type WebhookType = T extends 'app/uninstalled' ? IShop : T extends 'carts/create' ? ICart : T extends 'carts/update' ? ICart : T extends 'checkouts/create' ? ICheckout : T extends 'checkouts/update' ? ICheckout : T extends 'checkouts/delete' ? IDeletedItem : T extends 'collections/create' ? ISmartCollection | ICustomCollection : T extends 'collections/update' ? ISmartCollection | ICustomCollection : T extends 'collections/delete' ? IDeletedItem : T extends 'collection_listings/add' ? ICollectionListing : T extends 'collection_listings/remove' ? ICollectionListing : T extends 'collection_listings/update' ? ICollectionListing : T extends 'customers/create' ? ICustomer : T extends 'customers/disable' ? ICustomer : T extends 'customers/enable' ? ICustomer : T extends 'customers/update' ? ICustomer : T extends 'customers/delete' ? IDeletedItem : T extends 'customer_groups/create' ? ICustomerSavedSearch : T extends 'customer_groups/update' ? ICustomerSavedSearch : T extends 'customer_groups/delete' ? IDeletedItem : T extends 'draft_orders/create' ? IDraftOrder : T extends 'draft_orders/update' ? IDraftOrder : T extends 'draft_orders/delete' ? IDeletedItem : T extends 'fulfillments/create' ? IFulfillment : T extends 'fulfillments/update' ? IFulfillment : T extends 'fulfillment_events/create' ? IFulfillmentEvent : T extends 'fulfillment_events/delete' ? IDeletedItem : T extends 'inventory_items/create' ? IInventoryItem : T extends 'inventory_items/update' ? IInventoryItem : T extends 'inventory_items/delete' ? IDeletedItem : T extends 'inventory_levels/connect' ? IInventoryLevel : T extends 'inventory_levels/update' ? IInventoryLevel : T extends 'inventory_levels/disconnect' ? IInventoryLevel : T extends 'locations/create' ? ILocation : T extends 'locations/update' ? ILocation : T extends 'locations/delete' ? IDeletedItem : T extends 'orders/cancelled' ? IOrder : T extends 'orders/create' ? IOrder : T extends 'orders/fulfilled' ? IOrder : T extends 'orders/paid' ? IOrder : T extends 'orders/partially_fulfilled' ? IOrder : T extends 'orders/updated' ? IOrder : T extends 'orders/delete' ? IDeletedItem : T extends 'order_transactions/create' ? ITransaction : T extends 'products/create' ? IProduct : T extends 'products/update' ? IProduct : T extends 'products/delete' ? IDeletedItem : T extends 'product_listings/add' ? IProductListing : T extends 'product_listings/remove' ? IProductListing : T extends 'product_listings/update' ? IProductListing : T extends 'refunds/create' ? IRefund : T extends 'shop/update' ? IShop : T extends 'themes/create' ? ITheme : T extends 'themes/publish' ? ITheme : T extends 'themes/update' ? ITheme : T extends 'themes/delete' ? IDeletedItem : any; interface ICarrierAddress { country: string; postal_code: string; province?: string; city: string; name?: string; address1?: string; address2?: string; address3?: string; phone?: string; fax?: string; email?: string; address_type?: string; company_name?: string; } interface ICarrierItem { name?: string; sku?: string; quantity: number; grams?: number; price: number; vendor?: string; requires_shipping: boolean; taxable: boolean; fulfillment_service?: string; properties?: ILineItemProperty; product_id: number; variant_id: number; } interface ICarrierRequestBody { origin: ICarrierAddress; destination: ICarrierAddress; items: ICarrierItem[]; currency: string; locale: string; } export interface ICarrierRequest { rate: ICarrierRequestBody; } export interface ICarrierResponse { service_name: string; description?: string; service_code: string; currency: string; total_price: number; phone_required?: boolean; min_delivery_date?: string; max_delivery_date?: string; } }