Skip to main content

Queries

  • importRestriction (Experimental) — Fetch an import restriction the catalog trips by its id. Null when no product in the caller’s catalog trips it.
  • importRestrictions (Experimental) — List the import restrictions the catalog trips, newest first: rules found in the last 21 days in countries of enabled markets with restriction screening on. Filters combine with AND.
  • market — Fetch a single market by its id.
  • marketCheckoutPreview — Preview what a shopper would pay at checkout for one order under a market’s pricing settings, as the market editor’s checkout preview does. Give id to start from a saved market, settings to try changes before saving them, and order to price your own amounts; without order, a sample $100 order is used. Nothing is saved. Returns null if no market with that id is owned by the caller. Throws a 400 error with an extension code of INVALID_MARKUP, INVALID_MARKET_SETTINGS or INVALID_PREVIEW_ORDER when the input is invalid.
  • marketListingExtensionCode (Experimental) — Get what is needed to write or edit a market’s listing extension: code Redo runs for each variant in the market to override the price it calculated, or whether the variant is published. Returns the contract’s TypeScript type definitions, starter code and a sample input. Send marketId to also get that market’s current code. Set the code with listingExtensionCode on upsertMarket. A market id from another account, or one that does not exist, is null.
  • markets — List markets, optionally filtered by whether they are live.

Mutations

  • deleteMarket — Delete a market and its countries, so their destinations can be added to another market. Returns true if an owned market was deleted, false if none matched. shopifyMarkets chooses whether the market’s Shopify markets are torn down or kept; with DELETE the teardown finishes in the background after this returns.
  • importRestrictionReopen (Experimental) — Reopen a resolved import restriction, so it counts as restricted again for every product that trips it. Reopening an open restriction does nothing. Returns the restriction, or null without changing anything when importRestriction returns null for the id.
  • importRestrictionResolve (Experimental) — Mark an import restriction resolved once the merchant holds the permit, certificate or documentation it asks for. It then stops counting as restricted for every product that trips it, so those products are published again where the store hides restricted products. Resolving again replaces the note. Returns the restriction, or null without changing anything when importRestriction returns null for the id. Throws a 400 error with an extension code of IMPORT_RESTRICTION_NOT_RESOLVABLE unless every product trips it at ACTION_NEEDED, or INVALID_RESOLUTION_NOTE when the note is empty or longer than 2000 characters.
  • productMarketPublishingRestore — Remove the merchant’s publish override for a product in a destination country, so recommendedPublish applies again. Returns the product, or null when no owned product has an import restriction or an override in that country.
  • productMarketPublishingSet — Publish or hide a product in a destination country where it trips an import restriction, overriding recommendedPublish. Returns the product, or null when no owned product trips a current import restriction in that country. The change reaches the sales channel in the background.
  • upsertMarket — Create a market, or update one when id is given. Returns null if no market with that id is owned by the caller. Adding a country sets it up on the store’s sales channel, so this can take several seconds. Removing a country tears down its Shopify market, catalog and price list. Throws a 400 error with an extension code of MARKET_COUNTRIES_REQUIRED, DUPLICATE_MARKET_COUNTRY, MARKET_COUNTRY_ADDED_AND_REMOVED, MARKET_COUNTRY_NOT_IN_MARKET, INVALID_MARKUP, INVALID_MARKET_SETTINGS, or INVALID_LISTING_EXTENSION when the input is invalid (settings are checked against the market as it would be after the update, and listingExtensionCode against the market listing contract), a 400 error with an extension code of UNEXPECTED_MARKET_RESOLUTION for a resolution no conflict needs, a 409 CONFLICT error (with an extension code of MARKET_COUNTRY_IN_USE) when a country already belongs to another market, and a 409 CONFLICT error (with an extension code of MARKET_COUNTRY_CONFLICT and a conflicts extension listing, per country, the conflicting Shopify market handle, its other countries, a reason sentence explaining the conflict, and allowedResolutions as { kind, effect } pairs whose effect says what that choice does to the merchant’s Shopify market) when a country being added is in one of the merchant’s own Shopify markets without an allowed resolution. Nothing is written when a request fails.

Objects

  • ImportRestriction (Experimental) — An import rule of a destination country that screening found products in the catalog trip. Only rules found in the last 21 days, in countries of enabled markets with restriction screening on, are visible.
  • Market — A cross-border market: a set of destination countries that share one landed-cost pricing policy.
  • MarketBreakdownLabels — Shopper-facing labels for the checkout landed-cost breakdown. A null label uses the default wording.
  • MarketCheckoutPreview — What a shopper would see at checkout for one order under a market’s pricing settings. All amounts are in the store’s currency.
  • MarketCheckoutPreviewLine — One landed-cost component in a checkout preview.
  • MarketCountry — A destination country a market sells into.
  • MarketListingExtensionCode (Experimental) — What is needed to write or edit a market’s listing extension: the market listing contract, starter code, a sample input, and optionally one market’s current code.
  • ProductImportRestriction (Experimental) — An import restriction a product trips in one destination country, as found by screening its HS code.
  • ProductMarketPublishing — Whether a product is published in one destination country where it trips an import restriction or has a publish override.

Input objects

  • MarketBreakdownLabelsInput — Custom labels for the checkout landed-cost breakdown. Each is 1–80 characters; omit a label to use the default wording.
  • MarketCheckoutPreviewOrderInput — An order to preview, in the store’s currency. Amounts are non-negative decimals; an omitted landed-cost amount is zero.
  • MarketCheckoutPreviewSettingsInput — Pricing settings to preview in place of the market’s saved ones. Omit a field to use the saved value, or the upsertMarket default when previewing without a market.
  • MarketCountryConflictResolutionInput — How to resolve a country being added that is already in a Shopify market Redo does not manage.
  • UpsertMarketInput — The settings of a market to create or update. When updating, omit a field to leave it unchanged.

Enums