Mirra
Integrations

Shopify

SDK reference for shopify operations

Overview

Shopify store management — products, orders, customers, inventory, collections, pages, blogs, articles, themes, menus, redirects, and discount codes

  • Category: commerce
  • Auth Required: Yes
  • Supported Modes: standard, delegated

Operations

updateVariant

Update a single product variant — price, compare-at price, SKU, barcode, taxability, inventory policy, and variant option values. Variant edits are product-scoped in the Shopify Admin API, so both productId and variantId are required. Use inventoryPolicy "continue" to keep selling a variant when it is out of stock, or "deny" to stop selling it when inventory reaches zero.

Arguments:

  • productId (string, required): The ID of the product the variant belongs to.
  • variantId (string, required): The ID of the variant to update.
  • price (string, optional): New price as a decimal string (e.g. "19.99").
  • compareAtPrice (string, optional): New compare-at ("was") price as a decimal string. Pass an empty string to clear it.
  • sku (string, optional): New SKU (stock keeping unit) for the variant.
  • barcode (string, optional): New barcode (ISBN, UPC, GTIN, etc.) for the variant.
  • taxable (boolean, optional): Whether the variant is subject to tax.
  • inventoryPolicy (string, optional): Inventory policy: "continue" to keep selling when out of stock, or "deny" to stop selling when out of stock.
  • options (array, optional): New variant option values in order (e.g. ["Large", "Red"]) to replace the variant's current option values. Must match the number of product options.

Returns:

ShopifyVariant - Returns the updated variant with id, title, price, compareAtPrice, sku, inventoryQuantity, inventoryPolicy, option values, barcode, and taxable.

Response Fields:

FieldTypeDescription
idstringVariant ID
titlestringVariant title
pricestringPrice
compareAtPricestringCompare-at price (optional)
skustringSKU
inventoryQuantitynumberInventory quantity
inventoryItemIdstringInventory item ID (for inventory operations) (optional)
option1stringOption 1 value (optional)
option2stringOption 2 value (optional)
option3stringOption 3 value (optional)
barcodestringBarcode (optional)
taxablebooleanIs taxable
inventoryPolicystringInventory policy: "continue" (keep selling when out of stock) or "deny" (stop selling when out of stock) (optional)

Example:

const result = await mirra.shopify.updateVariant({
  productId: "abc123",
  variantId: "abc123"
});

refundOrder

Refund an order — either specific line items (partial refund) or all refundable items. Money is actually returned to the customer: the operation computes the suggested refund (transactions, taxes, and amounts) for the requested items, then creates the refund against the original payment. Optionally restock the refunded items and refund shipping.

Arguments:

  • orderId (string, required): The ID of the order to refund.
  • lineItems (array, optional): Line items to refund, each an object { lineItemId: string, quantity: number }. Omit to refund all remaining refundable items on the order.
  • refundShipping (boolean, optional): Whether to also refund the full remaining shipping amount. Defaults to false.
  • note (string, optional): An optional note describing the reason for the refund (shown in the Shopify admin).
  • notify (boolean, optional): Whether to send the customer a refund notification email. Defaults to false.
  • restock (boolean, optional): Whether to restock the refunded items back into inventory. Defaults to true.

Returns:

ShopifyRefund - Returns the created refund: { id, orderId, note, totalRefunded, currency, createdAt }.

Response Fields:

FieldTypeDescription
idstringRefund ID
orderIdstringID of the refunded order
notestringRefund note, or null (optional)
totalRefundedstringTotal amount refunded
currencystringCurrency code of the refund, or null (optional)
createdAtstringRefund creation timestamp (ISO 8601)

Example:

const result = await mirra.shopify.refundOrder({
  orderId: "abc123"
});

fulfillOrder

Fulfill an order (mark items as shipped) and optionally attach tracking. Fulfills either specific line items (split/partial fulfillment) or all remaining unfulfilled items. Resolves the order's fulfillment orders automatically. Tracking number, carrier, and URL are optional; set notifyCustomer to email the customer a shipping confirmation.

Arguments:

  • orderId (string, required): The ID of the order to fulfill.
  • lineItems (array, optional): Line items to fulfill, each an object { lineItemId: string, quantity: number }. Omit to fulfill all remaining unfulfilled items.
  • trackingNumber (string, optional): Tracking number for the shipment.
  • trackingCompany (string, optional): Shipping carrier name (e.g. "UPS", "USPS", "FedEx").
  • trackingUrl (string, optional): A URL where the customer can track the shipment.
  • notifyCustomer (boolean, optional): Whether to send the customer a shipping notification email. Defaults to false.

Returns:

ShopifyFulfillment - Returns the created fulfillment: { id, orderId, status, trackingNumber, trackingCompany, trackingUrl, createdAt }.

Response Fields:

FieldTypeDescription
idstringFulfillment ID
orderIdstringID of the fulfilled order
statusstringFulfillment status (e.g. success, cancelled)
trackingNumberstringTracking number, or null (optional)
trackingCompanystringShipping carrier, or null (optional)
trackingUrlstringTracking URL, or null (optional)
createdAtstringFulfillment creation timestamp (ISO 8601)

Example:

const result = await mirra.shopify.fulfillOrder({
  orderId: "abc123"
});

updateFulfillmentTracking

Update the tracking information on an existing fulfillment (for example to add a tracking number after the fact, correct the carrier, or replace the tracking URL). Optionally notify the customer of the updated tracking.

Arguments:

  • fulfillmentId (string, required): The ID of the fulfillment to update.
  • trackingNumber (string, optional): The tracking number to set on the fulfillment.
  • trackingCompany (string, optional): Shipping carrier name (e.g. "UPS", "USPS", "FedEx").
  • trackingUrl (string, optional): A URL where the customer can track the shipment.
  • notifyCustomer (boolean, optional): Whether to send the customer an updated-tracking notification email. Defaults to false.

Returns:

ShopifyFulfillment - Returns the updated fulfillment: { id, orderId, status, trackingNumber, trackingCompany, trackingUrl, createdAt }.

Response Fields:

FieldTypeDescription
idstringFulfillment ID
orderIdstringID of the fulfilled order
statusstringFulfillment status (e.g. success, cancelled)
trackingNumberstringTracking number, or null (optional)
trackingCompanystringShipping carrier, or null (optional)
trackingUrlstringTracking URL, or null (optional)
createdAtstringFulfillment creation timestamp (ISO 8601)

Example:

const result = await mirra.shopify.updateFulfillmentTracking({
  fulfillmentId: "abc123"
});

createCollection

Create a manual (custom) collection — a hand-picked grouping of products. Supports a theme template suffix (e.g. "preview" or "landing") so the collection can render with a custom theme template, and a visibility flag that publishes (or hides) the collection on the Online Store sales channel. Products are added separately via addProductsToCollection; a product can belong to multiple collections at once.

Arguments:

  • title (string, required): The collection title.
  • descriptionHtml (string, optional): The collection description as HTML.
  • templateSuffix (string, optional): Theme template suffix to render the collection with a custom template, e.g. "preview" renders templates/collection.preview.liquid. Omit for the default template.
  • published (boolean, optional): Whether the collection is visible on the Online Store sales channel. true publishes it, false hides it. Defaults to false.
  • sortOrder (string, optional): How products are ordered within the collection (e.g. "MANUAL", "BEST_SELLING", "ALPHA_ASC", "PRICE_DESC", "CREATED").
  • imageUrl (string, optional): URL of an image to use as the collection image.
  • imageAlt (string, optional): Alt text for the collection image.

Returns:

ShopifyCollection - Returns the created collection with id, title, bodyHtml, handle, sortOrder, collectionType ("custom"), imageUrl, and productsCount.

Response Fields:

FieldTypeDescription
idstringCollection ID
titlestringCollection title
bodyHtmlstringHTML description
handlestringURL handle
sortOrderstringSort order
publishedAtstringPublished timestamp (optional)
updatedAtstringLast update timestamp
collectionTypestringType: "custom" or "smart"
imageUrlstringCollection image URL (optional)
imageAltstringImage alt text (optional)
productsCountnumberNumber of products in collection (optional)

Example:

const result = await mirra.shopify.createCollection({
  title: "example"
});

updateCollection

Update a manual (custom) collection — title, description, theme template suffix, sort order, image, and visibility on the Online Store sales channel. Only the provided fields are changed.

Arguments:

  • collectionId (string, required): The ID of the collection to update.
  • title (string, optional): New collection title.
  • descriptionHtml (string, optional): New collection description as HTML.
  • templateSuffix (string, optional): New theme template suffix (e.g. "preview" / "landing"). Pass an empty string to reset to the default template.
  • published (boolean, optional): Whether the collection is visible on the Online Store sales channel. true publishes it, false hides it.
  • sortOrder (string, optional): How products are ordered within the collection (e.g. "MANUAL", "BEST_SELLING", "ALPHA_ASC", "PRICE_DESC", "CREATED").
  • imageUrl (string, optional): New collection image URL.
  • imageAlt (string, optional): New alt text for the collection image.

Returns:

ShopifyCollection - Returns the updated collection with id, title, bodyHtml, handle, sortOrder, collectionType, imageUrl, and productsCount.

Response Fields:

FieldTypeDescription
idstringCollection ID
titlestringCollection title
bodyHtmlstringHTML description
handlestringURL handle
sortOrderstringSort order
publishedAtstringPublished timestamp (optional)
updatedAtstringLast update timestamp
collectionTypestringType: "custom" or "smart"
imageUrlstringCollection image URL (optional)
imageAltstringImage alt text (optional)
productsCountnumberNumber of products in collection (optional)

Example:

const result = await mirra.shopify.updateCollection({
  collectionId: "abc123"
});

deleteCollection

Delete a collection. This removes the collection grouping only — the products that belonged to it are not deleted.

Arguments:

  • collectionId (string, required): The ID of the collection to delete.

Returns:

object - Returns { deleted: true, collectionId }.

Response Fields:

FieldTypeDescription
deletedbooleanWhether deletion was successful
collectionIdstringDeleted collection ID

Example:

const result = await mirra.shopify.deleteCollection({
  collectionId: "abc123"
});

addProductsToCollection

Add one or more products to a manual (custom) collection. This is additive — a product keeps its membership in any other collections (e.g. its category collection) and also joins this one, so the same product can appear in multiple collections at once.

Arguments:

  • collectionId (string, required): The ID of the collection to add products to.
  • productIds (array, required): Array of product IDs to add to the collection.

Returns:

object - Returns { collectionId, productIds, added: true }.

Response Fields:

FieldTypeDescription
collectionIdstringCollection ID
productIdsarrayProduct IDs added to the collection
addedbooleanWhether the products were added

Example:

const result = await mirra.shopify.addProductsToCollection({
  collectionId: "abc123",
  productIds: []
});

removeProductsFromCollection

Remove one or more products from a manual (custom) collection. The products themselves are not deleted and remain in any other collections they belong to.

Arguments:

  • collectionId (string, required): The ID of the collection to remove products from.
  • productIds (array, required): Array of product IDs to remove from the collection.

Returns:

object - Returns { collectionId, productIds, removed: true }.

Response Fields:

FieldTypeDescription
collectionIdstringCollection ID
productIdsarrayProduct IDs removed from the collection
removedbooleanWhether the products were removed

Example:

const result = await mirra.shopify.removeProductsFromCollection({
  collectionId: "abc123",
  productIds: []
});

publishCollection

Publish or unpublish an existing collection on the Online Store sales channel, making it visible (or hidden) on the storefront. Use this to make a collection live after creating it, or to retry publishing a collection that was created but not yet published (e.g. when createCollection succeeded but its publish step was skipped). Requires the read_publications and write_publications scopes — if the store has not granted them, the merchant must reconnect Shopify and approve the expanded permissions before publishing will work.

Arguments:

  • collectionId (string, required): The ID of the collection to publish or unpublish.
  • published (boolean, optional): true (the default) publishes the collection on the Online Store sales channel; false unpublishes (hides) it from the storefront.

Returns:

object - Returns { collectionId, published }.

Example:

const result = await mirra.shopify.publishCollection({
  collectionId: "abc123"
});

listProducts

List products in the Shopify store with optional filtering and pagination. Returns up to 50 products per page. Use the nextPageInfo cursor from the response to fetch subsequent pages.

Arguments:

  • limit (number, optional): Number of products to return per page (1-250). Defaults to 50.
  • pageInfo (string, optional): Cursor for pagination. Use the nextPageInfo value from a previous response to get the next page.
  • status (string, optional): Filter by product status: "active", "archived", or "draft".
  • vendor (string, optional): Filter by product vendor name.
  • productType (string, optional): Filter by product type.
  • collectionId (string, optional): Filter by collection ID to list products in a specific collection.

Returns:

AdapterOperationResult - Returns { products: NormalizedShopifyProduct[], nextPageInfo, previousPageInfo, totalRetrieved }. Each product includes id, title, bodyHtml, vendor, productType, status, handle, tags, variants, images, options.

Response Fields:

FieldTypeDescription
productsShopifyNormalizedProduct[]List of products
products item fields (ShopifyNormalizedProduct)
FieldTypeDescription
idstringProduct ID
titlestringProduct title
bodyHtmlstringHTML description
vendorstringVendor name
productTypestringProduct type
statusstringStatus (active, archived, draft)
handlestringURL handle
tagsstringComma-separated tags
createdAtstringCreation timestamp (ISO 8601)
updatedAtstringLast update timestamp (ISO 8601)
publishedAtstringPublished timestamp (ISO 8601) (optional)
variantsShopifyVariant[]Product variants
imagesShopifyImage[]Product images
templateSuffixstringTemplate suffix for custom templates (optional)
publishedScopestringPublished scope (e.g., web)
optionsobject[]Product options (e.g., Size, Color) with id, name, values[]

| nextPageInfo | string | Cursor for next page (optional) | | previousPageInfo | string | Cursor for previous page (optional) | | totalRetrieved | number | Number of products retrieved |

Example:

const result = await mirra.shopify.listProducts({});

getProduct

Get a single product by its Shopify product ID. Returns full product details including all variants, images, and options.

Arguments:

  • productId (string, required): The Shopify product ID.

Returns:

AdapterOperationResult - Returns a single NormalizedShopifyProduct with id, title, bodyHtml, vendor, productType, status, handle, tags, variants (with price, sku, inventory), images, and options.

Response Fields:

FieldTypeDescription
idstringProduct ID
titlestringProduct title
bodyHtmlstringHTML description
vendorstringVendor name
productTypestringProduct type
statusstringStatus (active, archived, draft)
handlestringURL handle
tagsstringComma-separated tags
createdAtstringCreation timestamp (ISO 8601)
updatedAtstringLast update timestamp (ISO 8601)
publishedAtstringPublished timestamp (ISO 8601) (optional)
variantsShopifyVariant[]Product variants
variants item fields (ShopifyVariant)
FieldTypeDescription
idstringVariant ID
titlestringVariant title
pricestringPrice
compareAtPricestringCompare-at price (optional)
skustringSKU
inventoryQuantitynumberInventory quantity
inventoryItemIdstringInventory item ID (for inventory operations) (optional)
option1stringOption 1 value (optional)
option2stringOption 2 value (optional)
option3stringOption 3 value (optional)
barcodestringBarcode (optional)
taxablebooleanIs taxable
inventoryPolicystringInventory policy: "continue" (keep selling when out of stock) or "deny" (stop selling when out of stock) (optional)

| images | ShopifyImage[] | Product images |

images item fields (ShopifyImage)
FieldTypeDescription
idstringImage ID
srcstringImage URL
altstringAlt text (optional)
widthnumberWidth in pixels
heightnumberHeight in pixels
positionnumberDisplay position

| templateSuffix | string | Template suffix for custom templates (optional) | | publishedScope | string | Published scope (e.g., web) | | options | object[] | Product options (e.g., Size, Color) with id, name, values[] |

Example:

const result = await mirra.shopify.getProduct({
  productId: "abc123"
});

createProduct

Create a new product in the Shopify store. At minimum, a title is required. Set status to "draft" to create without publishing.

Arguments:

  • title (string, required): The product title.
  • bodyHtml (string, optional): HTML description of the product.
  • vendor (string, optional): The product vendor.
  • productType (string, optional): The product type for categorization.
  • tags (string, optional): Comma-separated list of tags.
  • status (string, optional): Product status: "active", "archived", or "draft". Defaults to "active".

Returns:

AdapterOperationResult - Returns the created NormalizedShopifyProduct.

Response Fields:

FieldTypeDescription
idstringProduct ID
titlestringProduct title
bodyHtmlstringHTML description
vendorstringVendor name
productTypestringProduct type
statusstringStatus (active, archived, draft)
handlestringURL handle
tagsstringComma-separated tags
createdAtstringCreation timestamp (ISO 8601)
updatedAtstringLast update timestamp (ISO 8601)
publishedAtstringPublished timestamp (ISO 8601) (optional)
variantsShopifyVariant[]Product variants
variants item fields (ShopifyVariant)
FieldTypeDescription
idstringVariant ID
titlestringVariant title
pricestringPrice
compareAtPricestringCompare-at price (optional)
skustringSKU
inventoryQuantitynumberInventory quantity
inventoryItemIdstringInventory item ID (for inventory operations) (optional)
option1stringOption 1 value (optional)
option2stringOption 2 value (optional)
option3stringOption 3 value (optional)
barcodestringBarcode (optional)
taxablebooleanIs taxable
inventoryPolicystringInventory policy: "continue" (keep selling when out of stock) or "deny" (stop selling when out of stock) (optional)

| images | ShopifyImage[] | Product images |

images item fields (ShopifyImage)
FieldTypeDescription
idstringImage ID
srcstringImage URL
altstringAlt text (optional)
widthnumberWidth in pixels
heightnumberHeight in pixels
positionnumberDisplay position

| templateSuffix | string | Template suffix for custom templates (optional) | | publishedScope | string | Published scope (e.g., web) | | options | object[] | Product options (e.g., Size, Color) with id, name, values[] |

Example:

const result = await mirra.shopify.createProduct({
  title: "example"
});

updateProduct

Update an existing product. Only the fields you provide will be updated; omitted fields remain unchanged.

Arguments:

  • productId (string, required): The Shopify product ID to update.
  • title (string, optional): New product title.
  • bodyHtml (string, optional): New HTML description.
  • vendor (string, optional): New vendor name.
  • productType (string, optional): New product type.
  • tags (string, optional): New comma-separated tags (replaces existing tags).
  • status (string, optional): New status: "active", "archived", or "draft".

Returns:

AdapterOperationResult - Returns the updated NormalizedShopifyProduct.

Response Fields:

FieldTypeDescription
idstringProduct ID
titlestringProduct title
bodyHtmlstringHTML description
vendorstringVendor name
productTypestringProduct type
statusstringStatus (active, archived, draft)
handlestringURL handle
tagsstringComma-separated tags
createdAtstringCreation timestamp (ISO 8601)
updatedAtstringLast update timestamp (ISO 8601)
publishedAtstringPublished timestamp (ISO 8601) (optional)
variantsShopifyVariant[]Product variants
variants item fields (ShopifyVariant)
FieldTypeDescription
idstringVariant ID
titlestringVariant title
pricestringPrice
compareAtPricestringCompare-at price (optional)
skustringSKU
inventoryQuantitynumberInventory quantity
inventoryItemIdstringInventory item ID (for inventory operations) (optional)
option1stringOption 1 value (optional)
option2stringOption 2 value (optional)
option3stringOption 3 value (optional)
barcodestringBarcode (optional)
taxablebooleanIs taxable
inventoryPolicystringInventory policy: "continue" (keep selling when out of stock) or "deny" (stop selling when out of stock) (optional)

| images | ShopifyImage[] | Product images |

images item fields (ShopifyImage)
FieldTypeDescription
idstringImage ID
srcstringImage URL
altstringAlt text (optional)
widthnumberWidth in pixels
heightnumberHeight in pixels
positionnumberDisplay position

| templateSuffix | string | Template suffix for custom templates (optional) | | publishedScope | string | Published scope (e.g., web) | | options | object[] | Product options (e.g., Size, Color) with id, name, values[] |

Example:

const result = await mirra.shopify.updateProduct({
  productId: "abc123"
});

deleteProduct

Permanently delete a product from the Shopify store. This action cannot be undone.

Arguments:

  • productId (string, required): The Shopify product ID to delete.

Returns:

AdapterOperationResult - Returns { deleted: true, productId } on success.

Response Fields:

FieldTypeDescription
deletedbooleanWhether deletion was successful
productIdstringDeleted product ID

Example:

const result = await mirra.shopify.deleteProduct({
  productId: "abc123"
});

listOrders

List orders from the Shopify store with optional filtering. Returns up to 50 orders per page sorted by creation date descending. By default returns open orders.

Arguments:

  • limit (number, optional): Number of orders to return per page (1-250). Defaults to 50.
  • pageInfo (string, optional): Cursor for pagination from a previous response.
  • status (string, optional): Filter by order status: "open", "closed", "cancelled", or "any". Defaults to "any".
  • financialStatus (string, optional): Filter by financial status: "authorized", "pending", "paid", "partially_paid", "refunded", "voided", "partially_refunded", "any", "unpaid".
  • fulfillmentStatus (string, optional): Filter by fulfillment status: "shipped", "partial", "unshipped", "any", "unfulfilled".
  • sinceId (string, optional): Return orders after this order ID.
  • createdAtMin (string, optional): Return orders created after this date (ISO 8601 format).
  • createdAtMax (string, optional): Return orders created before this date (ISO 8601 format).

Returns:

AdapterOperationResult - Returns { orders: NormalizedShopifyOrder[], nextPageInfo, previousPageInfo, totalRetrieved }. Each order includes id, orderNumber, email, totalPrice, currency, financialStatus, fulfillmentStatus, lineItems, customer info.

Response Fields:

FieldTypeDescription
ordersShopifyNormalizedOrder[]List of orders
orders item fields (ShopifyNormalizedOrder)
FieldTypeDescription
idstringOrder ID
orderNumbernumberHuman-readable order number
namestringOrder name (e.g., #1001)
emailstringCustomer email
totalPricestringTotal price
subtotalPricestringSubtotal price
totalTaxstringTotal tax
totalDiscountsstringTotal discounts
totalShippingstringTotal shipping charged to the customer (shipping revenue, not the merchant's carrier cost)
currencystringCurrency code (e.g., USD)
financialStatusstringFinancial status (paid, pending, etc.)
fulfillmentStatusstringFulfillment status (optional)
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
closedAtstringClosed timestamp (optional)
cancelledAtstringCancelled timestamp (optional)
cancelReasonstringCancellation reason (optional)
notestringOrder note (optional)
tagsstringComma-separated tags
customerFirstNamestringCustomer first name
customerLastNamestringCustomer last name
customerEmailstringCustomer email
lineItemsShopifyLineItem[]Order line items
totalLineItemsQuantitynumberTotal quantity of all line items
shippingAddressCitystringShipping city (optional)
shippingAddressCountrystringShipping country (optional)

| nextPageInfo | string | Cursor for next page (optional) | | previousPageInfo | string | Cursor for previous page (optional) | | totalRetrieved | number | Number of orders retrieved |

Example:

const result = await mirra.shopify.listOrders({});

getOrder

Get a single order by its Shopify order ID. Returns full order details including line items and customer information.

Arguments:

  • orderId (string, required): The Shopify order ID.

Returns:

AdapterOperationResult - Returns a single NormalizedShopifyOrder with full details.

Response Fields:

FieldTypeDescription
idstringOrder ID
orderNumbernumberHuman-readable order number
namestringOrder name (e.g., #1001)
emailstringCustomer email
totalPricestringTotal price
subtotalPricestringSubtotal price
totalTaxstringTotal tax
totalDiscountsstringTotal discounts
totalShippingstringTotal shipping charged to the customer (shipping revenue, not the merchant's carrier cost)
currencystringCurrency code (e.g., USD)
financialStatusstringFinancial status (paid, pending, etc.)
fulfillmentStatusstringFulfillment status (optional)
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
closedAtstringClosed timestamp (optional)
cancelledAtstringCancelled timestamp (optional)
cancelReasonstringCancellation reason (optional)
notestringOrder note (optional)
tagsstringComma-separated tags
customerFirstNamestringCustomer first name
customerLastNamestringCustomer last name
customerEmailstringCustomer email
lineItemsShopifyLineItem[]Order line items
lineItems item fields (ShopifyLineItem)
FieldTypeDescription
idstringLine item ID
titlestringProduct title
quantitynumberQuantity ordered
pricestringUnit price
skustringSKU
variantTitlestringVariant title (optional)
vendorstringVendor (optional)
productIdstringProduct ID (optional)
variantIdstringVariant ID (optional)
fulfillmentStatusstringFulfillment status (optional)

| totalLineItemsQuantity | number | Total quantity of all line items | | shippingAddressCity | string | Shipping city (optional) | | shippingAddressCountry | string | Shipping country (optional) |

Example:

const result = await mirra.shopify.getOrder({
  orderId: "abc123"
});

getPaymentsBalance

Get the store's Shopify Payments balance and recent payouts (bank deposits). Useful for profit/cashflow tracking: the balance is funds not yet paid out, and each payout breaks down gross charges vs. processing fees. Requires the read_shopify_payments_payouts scope — if the store has not granted it, the merchant must reconnect Shopify and approve the expanded permissions. NOTE: this only works for stores that use Shopify Payments; stores on an external gateway (PayPal, Stripe, etc.) have no Shopify Payments account and the operation returns empty balance/payouts with an explanatory note.

Arguments:

  • limit (number, optional): Number of recent payouts to return, most recent first (1-50). Defaults to 10.

Returns:

AdapterOperationResult - Returns { balance: { amount, currency }[], payouts: NormalizedShopifyPayout[], totalRetrieved, note? }. balance may list multiple currencies. Each payout includes amount (net deposited), status, issuedAt, and gross/fee breakdown fields.

Response Fields:

FieldTypeDescription
balanceShopifyBalance[]Per-currency balances not yet paid out
balance item fields (ShopifyBalance)
FieldTypeDescription
amountstringBalance amount not yet paid out
currencystringCurrency code (e.g., USD)

| payouts | ShopifyPayout[] | Recent payouts, most recent first |

payouts item fields (ShopifyPayout)
FieldTypeDescription
idstringPayout ID
statusstringPayout status (scheduled, in_transit, paid, failed, canceled)
issuedAtstringWhen the payout was issued (ISO 8601)
amountstringNet amount deposited to the bank account
currencystringCurrency code (e.g., USD)
chargesGrossstringGross sales from charges included in this payout
chargesFeestringProcessing fees on those charges
refundsFeestringFees on refunds in this payout
adjustmentsGrossstringGross from adjustments (e.g. chargeback reversals)
adjustmentsFeestringFees on adjustments

| totalRetrieved | number | Number of payouts retrieved | | note | string | Present only when the store does not use Shopify Payments (optional) |

Example:

const result = await mirra.shopify.getPaymentsBalance({});

createOrder

Create a new order in the Shopify store. Requires at least one line item. Can optionally include customer, shipping address, and financial details.

Arguments:

  • lineItems (array, required): Array of line items. Each item needs either variant_id or title+price+quantity. Example: [{ variant_id: "123", quantity: 2 }] or [{ title: "Custom Item", price: "10.00", quantity: 1 }].
  • email (string, optional): Customer email address for the order.
  • note (string, optional): An optional note attached to the order.
  • tags (string, optional): Comma-separated tags for the order.
  • financialStatus (string, optional): Financial status: "pending", "authorized", "partially_paid", "paid", "partially_refunded", "refunded", "voided". Defaults to "pending".
  • shippingAddress (object, optional): Shipping address object with first_name, last_name, address1, address2, city, province, country, zip, phone.
  • customerId (string, optional): Associate the order with an existing customer by their Shopify customer ID.

Returns:

AdapterOperationResult - Returns the created NormalizedShopifyOrder.

Response Fields:

FieldTypeDescription
idstringOrder ID
orderNumbernumberHuman-readable order number
namestringOrder name (e.g., #1001)
emailstringCustomer email
totalPricestringTotal price
subtotalPricestringSubtotal price
totalTaxstringTotal tax
totalDiscountsstringTotal discounts
totalShippingstringTotal shipping charged to the customer (shipping revenue, not the merchant's carrier cost)
currencystringCurrency code (e.g., USD)
financialStatusstringFinancial status (paid, pending, etc.)
fulfillmentStatusstringFulfillment status (optional)
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
closedAtstringClosed timestamp (optional)
cancelledAtstringCancelled timestamp (optional)
cancelReasonstringCancellation reason (optional)
notestringOrder note (optional)
tagsstringComma-separated tags
customerFirstNamestringCustomer first name
customerLastNamestringCustomer last name
customerEmailstringCustomer email
lineItemsShopifyLineItem[]Order line items
lineItems item fields (ShopifyLineItem)
FieldTypeDescription
idstringLine item ID
titlestringProduct title
quantitynumberQuantity ordered
pricestringUnit price
skustringSKU
variantTitlestringVariant title (optional)
vendorstringVendor (optional)
productIdstringProduct ID (optional)
variantIdstringVariant ID (optional)
fulfillmentStatusstringFulfillment status (optional)

| totalLineItemsQuantity | number | Total quantity of all line items | | shippingAddressCity | string | Shipping city (optional) | | shippingAddressCountry | string | Shipping country (optional) |

Example:

const result = await mirra.shopify.createOrder({
  lineItems: []
});

cancelOrder

Cancel an existing order. The order must be open. Optionally specify a reason for cancellation.

Arguments:

  • orderId (string, required): The Shopify order ID to cancel.
  • reason (string, optional): Cancellation reason: "customer", "fraud", "inventory", "declined", or "other".
  • email (boolean, optional): Whether to send a cancellation email to the customer. Defaults to true.

Returns:

AdapterOperationResult - Returns the cancelled NormalizedShopifyOrder with updated cancelledAt and cancelReason fields.

Response Fields:

FieldTypeDescription
idstringOrder ID
orderNumbernumberHuman-readable order number
namestringOrder name (e.g., #1001)
emailstringCustomer email
totalPricestringTotal price
subtotalPricestringSubtotal price
totalTaxstringTotal tax
totalDiscountsstringTotal discounts
totalShippingstringTotal shipping charged to the customer (shipping revenue, not the merchant's carrier cost)
currencystringCurrency code (e.g., USD)
financialStatusstringFinancial status (paid, pending, etc.)
fulfillmentStatusstringFulfillment status (optional)
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
closedAtstringClosed timestamp (optional)
cancelledAtstringCancelled timestamp (optional)
cancelReasonstringCancellation reason (optional)
notestringOrder note (optional)
tagsstringComma-separated tags
customerFirstNamestringCustomer first name
customerLastNamestringCustomer last name
customerEmailstringCustomer email
lineItemsShopifyLineItem[]Order line items
lineItems item fields (ShopifyLineItem)
FieldTypeDescription
idstringLine item ID
titlestringProduct title
quantitynumberQuantity ordered
pricestringUnit price
skustringSKU
variantTitlestringVariant title (optional)
vendorstringVendor (optional)
productIdstringProduct ID (optional)
variantIdstringVariant ID (optional)
fulfillmentStatusstringFulfillment status (optional)

| totalLineItemsQuantity | number | Total quantity of all line items | | shippingAddressCity | string | Shipping city (optional) | | shippingAddressCountry | string | Shipping country (optional) |

Example:

const result = await mirra.shopify.cancelOrder({
  orderId: "abc123"
});

closeOrder

Close an open order. A closed order is one that has no more work to be done (e.g., fully fulfilled and paid).

Arguments:

  • orderId (string, required): The Shopify order ID to close.

Returns:

AdapterOperationResult - Returns the closed NormalizedShopifyOrder with updated closedAt field.

Response Fields:

FieldTypeDescription
idstringOrder ID
orderNumbernumberHuman-readable order number
namestringOrder name (e.g., #1001)
emailstringCustomer email
totalPricestringTotal price
subtotalPricestringSubtotal price
totalTaxstringTotal tax
totalDiscountsstringTotal discounts
totalShippingstringTotal shipping charged to the customer (shipping revenue, not the merchant's carrier cost)
currencystringCurrency code (e.g., USD)
financialStatusstringFinancial status (paid, pending, etc.)
fulfillmentStatusstringFulfillment status (optional)
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
closedAtstringClosed timestamp (optional)
cancelledAtstringCancelled timestamp (optional)
cancelReasonstringCancellation reason (optional)
notestringOrder note (optional)
tagsstringComma-separated tags
customerFirstNamestringCustomer first name
customerLastNamestringCustomer last name
customerEmailstringCustomer email
lineItemsShopifyLineItem[]Order line items
lineItems item fields (ShopifyLineItem)
FieldTypeDescription
idstringLine item ID
titlestringProduct title
quantitynumberQuantity ordered
pricestringUnit price
skustringSKU
variantTitlestringVariant title (optional)
vendorstringVendor (optional)
productIdstringProduct ID (optional)
variantIdstringVariant ID (optional)
fulfillmentStatusstringFulfillment status (optional)

| totalLineItemsQuantity | number | Total quantity of all line items | | shippingAddressCity | string | Shipping city (optional) | | shippingAddressCountry | string | Shipping country (optional) |

Example:

const result = await mirra.shopify.closeOrder({
  orderId: "abc123"
});

listCustomers

List customers from the Shopify store with optional pagination. Returns up to 50 customers per page.

Arguments:

  • limit (number, optional): Number of customers to return per page (1-250). Defaults to 50.
  • pageInfo (string, optional): Cursor for pagination from a previous response.
  • sinceId (string, optional): Return customers after this customer ID.
  • createdAtMin (string, optional): Return customers created after this date (ISO 8601 format).
  • createdAtMax (string, optional): Return customers created before this date (ISO 8601 format).

Returns:

AdapterOperationResult - Returns { customers: NormalizedShopifyCustomer[], nextPageInfo, previousPageInfo, totalRetrieved }.

Response Fields:

FieldTypeDescription
customersShopifyNormalizedCustomer[]List of customers
customers item fields (ShopifyNormalizedCustomer)
FieldTypeDescription
idstringCustomer ID
firstNamestringFirst name
lastNamestringLast name
emailstringEmail address
phonestringPhone number (optional)
ordersCountnumberNumber of orders
totalSpentstringTotal amount spent
tagsstringComma-separated tags
statestringAccount state
verifiedEmailbooleanWhether email is verified
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
notestringCustomer note (optional)
defaultAddressCitystringDefault address city (optional)
defaultAddressCountrystringDefault address country (optional)
taxExemptbooleanWhether customer is tax exempt
addressesobject[]Customer addresses with id, firstName, lastName, address1, address2, city, province, country, zip, phone

| nextPageInfo | string | Cursor for next page (optional) | | previousPageInfo | string | Cursor for previous page (optional) | | totalRetrieved | number | Number of customers retrieved |

Example:

const result = await mirra.shopify.listCustomers({});

getCustomer

Get a single customer by their Shopify customer ID. Returns full customer details including addresses.

Arguments:

  • customerId (string, required): The Shopify customer ID.

Returns:

AdapterOperationResult - Returns a single NormalizedShopifyCustomer with full details including addresses.

Response Fields:

FieldTypeDescription
idstringCustomer ID
firstNamestringFirst name
lastNamestringLast name
emailstringEmail address
phonestringPhone number (optional)
ordersCountnumberNumber of orders
totalSpentstringTotal amount spent
tagsstringComma-separated tags
statestringAccount state
verifiedEmailbooleanWhether email is verified
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
notestringCustomer note (optional)
defaultAddressCitystringDefault address city (optional)
defaultAddressCountrystringDefault address country (optional)
taxExemptbooleanWhether customer is tax exempt
addressesobject[]Customer addresses with id, firstName, lastName, address1, address2, city, province, country, zip, phone

Example:

const result = await mirra.shopify.getCustomer({
  customerId: "abc123"
});

createCustomer

Create a new customer in the Shopify store. At minimum, either an email or a phone number is required.

Arguments:

  • firstName (string, optional): Customer first name.
  • lastName (string, optional): Customer last name.
  • email (string, optional): Customer email address. Required if phone is not provided.
  • phone (string, optional): Customer phone number in E.164 format. Required if email is not provided.
  • tags (string, optional): Comma-separated tags for the customer.
  • note (string, optional): A note about the customer.
  • addresses (array, optional): Array of address objects with address1, city, province, country, zip, phone.

Returns:

AdapterOperationResult - Returns the created NormalizedShopifyCustomer.

Response Fields:

FieldTypeDescription
idstringCustomer ID
firstNamestringFirst name
lastNamestringLast name
emailstringEmail address
phonestringPhone number (optional)
ordersCountnumberNumber of orders
totalSpentstringTotal amount spent
tagsstringComma-separated tags
statestringAccount state
verifiedEmailbooleanWhether email is verified
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
notestringCustomer note (optional)
defaultAddressCitystringDefault address city (optional)
defaultAddressCountrystringDefault address country (optional)
taxExemptbooleanWhether customer is tax exempt
addressesobject[]Customer addresses with id, firstName, lastName, address1, address2, city, province, country, zip, phone

Example:

const result = await mirra.shopify.createCustomer({});

updateCustomer

Update an existing customer. Only the fields you provide will be updated.

Arguments:

  • customerId (string, required): The Shopify customer ID to update.
  • firstName (string, optional): New first name.
  • lastName (string, optional): New last name.
  • email (string, optional): New email address.
  • phone (string, optional): New phone number in E.164 format.
  • tags (string, optional): New comma-separated tags (replaces existing).
  • note (string, optional): New note about the customer.

Returns:

AdapterOperationResult - Returns the updated NormalizedShopifyCustomer.

Response Fields:

FieldTypeDescription
idstringCustomer ID
firstNamestringFirst name
lastNamestringLast name
emailstringEmail address
phonestringPhone number (optional)
ordersCountnumberNumber of orders
totalSpentstringTotal amount spent
tagsstringComma-separated tags
statestringAccount state
verifiedEmailbooleanWhether email is verified
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
notestringCustomer note (optional)
defaultAddressCitystringDefault address city (optional)
defaultAddressCountrystringDefault address country (optional)
taxExemptbooleanWhether customer is tax exempt
addressesobject[]Customer addresses with id, firstName, lastName, address1, address2, city, province, country, zip, phone

Example:

const result = await mirra.shopify.updateCustomer({
  customerId: "abc123"
});

searchCustomers

Search customers by a query string. Searches across email, name, and other fields. Returns up to 50 results.

Arguments:

  • query (string, required): Search query string. Examples: "email:john@example.com", "first_name:John", or freeform text like "john doe".
  • limit (number, optional): Number of results to return (1-250). Defaults to 50.

Returns:

AdapterOperationResult - Returns { customers: NormalizedShopifyCustomer[], totalRetrieved }.

Response Fields:

FieldTypeDescription
customersShopifyNormalizedCustomer[]Search results
customers item fields (ShopifyNormalizedCustomer)
FieldTypeDescription
idstringCustomer ID
firstNamestringFirst name
lastNamestringLast name
emailstringEmail address
phonestringPhone number (optional)
ordersCountnumberNumber of orders
totalSpentstringTotal amount spent
tagsstringComma-separated tags
statestringAccount state
verifiedEmailbooleanWhether email is verified
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
notestringCustomer note (optional)
defaultAddressCitystringDefault address city (optional)
defaultAddressCountrystringDefault address country (optional)
taxExemptbooleanWhether customer is tax exempt
addressesobject[]Customer addresses with id, firstName, lastName, address1, address2, city, province, country, zip, phone

| totalRetrieved | number | Number of customers found |

Example:

const result = await mirra.shopify.searchCustomers({
  query: "example"
});

getInventoryLevels

Get inventory levels. With no arguments, returns levels for all inventory items (up to limit). Optionally narrow by inventoryItemIds and/or filter by locationIds. Each returned level includes the locationId needed for adjustInventory.

Arguments:

  • inventoryItemIds (string, optional): Comma-separated list of inventory item IDs to query. Omit to return levels for all items.
  • locationIds (string, optional): Comma-separated list of location IDs to filter results to. Omit to return levels at all locations.
  • limit (number, optional): Number of results to return (1-250). Defaults to 50.

Returns:

AdapterOperationResult - Returns { inventoryLevels: NormalizedShopifyInventoryLevel[], totalRetrieved }. Each level includes inventoryItemId, locationId, available quantity, and updatedAt.

Response Fields:

FieldTypeDescription
inventoryLevelsShopifyNormalizedInventoryLevel[]Inventory levels
inventoryLevels item fields (ShopifyNormalizedInventoryLevel)
FieldTypeDescription
inventoryItemIdstringInventory item ID
locationIdstringLocation ID
availablenumberAvailable quantity (optional)
updatedAtstringLast update timestamp

| totalRetrieved | number | Number of levels retrieved |

Example:

const result = await mirra.shopify.getInventoryLevels({});

adjustInventory

Adjust the available inventory quantity for an item at a specific location. The adjustment is relative (e.g., +5 adds 5 units, -3 removes 3 units).

Arguments:

  • inventoryItemId (string, required): The inventory item ID to adjust.
  • locationId (string, required): The location ID where the inventory is stored.
  • adjustment (number, required): The quantity adjustment. Positive to add stock, negative to remove.

Returns:

AdapterOperationResult - Returns the updated NormalizedShopifyInventoryLevel with the new available quantity.

Response Fields:

FieldTypeDescription
inventoryItemIdstringInventory item ID
locationIdstringLocation ID
availablenumberAvailable quantity (optional)
updatedAtstringLast update timestamp

Example:

const result = await mirra.shopify.adjustInventory({
  inventoryItemId: "abc123",
  locationId: "abc123",
  adjustment: 10
});

listCollections

List collections in the Shopify store. Returns both custom collections and smart collections combined, sorted by title.

Arguments:

  • limit (number, optional): Maximum number of collections to return per type (1-250). Defaults to 50. Note: up to this many custom collections AND this many smart collections may be returned.
  • pageInfo (string, optional): Cursor for pagination from a previous response.

Returns:

AdapterOperationResult - Returns { collections: NormalizedShopifyCollection[], totalRetrieved }. Each collection includes id, title, bodyHtml, handle, sortOrder, collectionType ("custom" or "smart"), imageUrl.

Response Fields:

FieldTypeDescription
collectionsShopifyNormalizedCollection[]List of collections
collections item fields (ShopifyNormalizedCollection)
FieldTypeDescription
idstringCollection ID
titlestringCollection title
bodyHtmlstringHTML description
handlestringURL handle
sortOrderstringSort order
publishedAtstringPublished timestamp (optional)
updatedAtstringLast update timestamp
collectionTypestringType: "custom" or "smart"
imageUrlstringCollection image URL (optional)
imageAltstringImage alt text (optional)
productsCountnumberNumber of products in collection (optional)

| totalRetrieved | number | Number of collections retrieved |

Example:

const result = await mirra.shopify.listCollections({});

listPages

List pages in the Shopify store with optional pagination.

Arguments:

  • limit (number, optional): Number of pages per page, 1-250, default 50
  • pageInfo (string, optional): Cursor for pagination

Returns:

AdapterOperationResult - Returns { pages: NormalizedShopifyPage[], nextPageInfo, previousPageInfo, totalRetrieved }.

Response Fields:

FieldTypeDescription
pagesShopifyNormalizedPage[]List of pages
pages item fields (ShopifyNormalizedPage)
FieldTypeDescription
idstringPage ID
titlestringPage title
handlestringURL handle
bodyHtmlstringHTML content
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
publishedAtstringPublished timestamp (optional)
templateSuffixstringTemplate suffix (optional)

| nextPageInfo | string | Cursor for next page (optional) | | previousPageInfo | string | Cursor for previous page (optional) | | totalRetrieved | number | Number of pages retrieved |

Example:

const result = await mirra.shopify.listPages({});

getPage

Get a single page by ID.

Arguments:

  • pageId (string, required): The Shopify page ID.

Returns:

AdapterOperationResult - Returns a single NormalizedShopifyPage with full details.

Response Fields:

FieldTypeDescription
idstringPage ID
titlestringPage title
handlestringURL handle
bodyHtmlstringHTML content
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
publishedAtstringPublished timestamp (optional)
templateSuffixstringTemplate suffix (optional)

Example:

const result = await mirra.shopify.getPage({
  pageId: "abc123"
});

createPage

Create a new page in the Shopify store.

Arguments:

  • title (string, required): The page title.
  • bodyHtml (string, optional): HTML body content of the page.
  • author (string, optional): The author of the page.
  • templateSuffix (string, optional): The template suffix for the page.
  • published (boolean, optional): Whether the page is published. Defaults to true.

Returns:

AdapterOperationResult - Returns the created NormalizedShopifyPage.

Response Fields:

FieldTypeDescription
idstringPage ID
titlestringPage title
handlestringURL handle
bodyHtmlstringHTML content
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
publishedAtstringPublished timestamp (optional)
templateSuffixstringTemplate suffix (optional)

Example:

const result = await mirra.shopify.createPage({
  title: "example"
});

updatePage

Update a page.

Arguments:

  • pageId (string, required): The Shopify page ID to update.
  • title (string, optional): New page title.
  • bodyHtml (string, optional): New HTML body content.
  • author (string, optional): New author name.
  • templateSuffix (string, optional): New template suffix.
  • published (boolean, optional): Whether the page is published.

Returns:

AdapterOperationResult - Returns the updated NormalizedShopifyPage.

Response Fields:

FieldTypeDescription
idstringPage ID
titlestringPage title
handlestringURL handle
bodyHtmlstringHTML content
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
publishedAtstringPublished timestamp (optional)
templateSuffixstringTemplate suffix (optional)

Example:

const result = await mirra.shopify.updatePage({
  pageId: "abc123"
});

deletePage

Permanently delete a page.

Arguments:

  • pageId (string, required): The Shopify page ID to delete.

Returns:

AdapterOperationResult - Returns { deleted: true, pageId }.

Response Fields:

FieldTypeDescription
deletedbooleanWhether deletion was successful
pageIdstringDeleted page ID

Example:

const result = await mirra.shopify.deletePage({
  pageId: "abc123"
});

listBlogs

List blogs in the Shopify store.

Arguments:

  • limit (number, optional): Number of blogs per page, 1-250, default 50
  • pageInfo (string, optional): Cursor for pagination

Returns:

AdapterOperationResult - Returns { blogs: NormalizedShopifyBlog[], nextPageInfo, previousPageInfo, totalRetrieved }.

Response Fields:

FieldTypeDescription
blogsShopifyNormalizedBlog[]List of blogs
blogs item fields (ShopifyNormalizedBlog)
FieldTypeDescription
idstringBlog ID
titlestringBlog title
handlestringURL handle
commentablestringComment policy
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
tagsstringComma-separated tags

| nextPageInfo | string | Cursor for next page (optional) | | previousPageInfo | string | Cursor for previous page (optional) | | totalRetrieved | number | Number of blogs retrieved |

Example:

const result = await mirra.shopify.listBlogs({});

getBlog

Get a blog by ID.

Arguments:

  • blogId (string, required): The Shopify blog ID.

Returns:

AdapterOperationResult - Returns a single NormalizedShopifyBlog with full details.

Response Fields:

FieldTypeDescription
idstringBlog ID
titlestringBlog title
handlestringURL handle
commentablestringComment policy
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
tagsstringComma-separated tags

Example:

const result = await mirra.shopify.getBlog({
  blogId: "abc123"
});

createBlog

Create a blog.

Arguments:

  • title (string, required): The blog title.
  • commentable (string, optional): Comment policy: no, moderate, yes

Returns:

AdapterOperationResult - Returns the created NormalizedShopifyBlog.

Response Fields:

FieldTypeDescription
idstringBlog ID
titlestringBlog title
handlestringURL handle
commentablestringComment policy
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
tagsstringComma-separated tags

Example:

const result = await mirra.shopify.createBlog({
  title: "example"
});

updateBlog

Update a blog.

Arguments:

  • blogId (string, required): The Shopify blog ID to update.
  • title (string, optional): New blog title.
  • commentable (string, optional): New comment policy: no, moderate, yes

Returns:

AdapterOperationResult - Returns the updated NormalizedShopifyBlog.

Response Fields:

FieldTypeDescription
idstringBlog ID
titlestringBlog title
handlestringURL handle
commentablestringComment policy
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
tagsstringComma-separated tags

Example:

const result = await mirra.shopify.updateBlog({
  blogId: "abc123"
});

deleteBlog

Delete a blog.

Arguments:

  • blogId (string, required): The Shopify blog ID to delete.

Returns:

AdapterOperationResult - Returns { deleted: true, blogId }.

Response Fields:

FieldTypeDescription
deletedbooleanWhether deletion was successful
blogIdstringDeleted blog ID

Example:

const result = await mirra.shopify.deleteBlog({
  blogId: "abc123"
});

listArticles

List articles in a blog.

Arguments:

  • blogId (string, required): The blog ID to list articles from.
  • limit (number, optional): Number of articles per page, 1-250, default 50
  • pageInfo (string, optional): Cursor for pagination

Returns:

AdapterOperationResult - Returns { articles: NormalizedShopifyArticle[], nextPageInfo, previousPageInfo, totalRetrieved }.

Response Fields:

FieldTypeDescription
articlesShopifyNormalizedArticle[]List of articles
articles item fields (ShopifyNormalizedArticle)
FieldTypeDescription
idstringArticle ID
blogIdstringParent blog ID
titlestringArticle title
authorstringAuthor name
handlestringURL handle
bodyHtmlstringHTML content
summarystringArticle summary
tagsstringComma-separated tags
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
publishedAtstringPublished timestamp (optional)
imageUrlstringImage URL (optional)
imageAltstringImage alt text (optional)

| nextPageInfo | string | Cursor for next page (optional) | | previousPageInfo | string | Cursor for previous page (optional) | | totalRetrieved | number | Number of articles retrieved |

Example:

const result = await mirra.shopify.listArticles({
  blogId: "abc123"
});

getArticle

Get an article by ID.

Arguments:

  • articleId (string, required): The Shopify article ID.

Returns:

AdapterOperationResult - Returns a single NormalizedShopifyArticle with full details.

Response Fields:

FieldTypeDescription
idstringArticle ID
blogIdstringParent blog ID
titlestringArticle title
authorstringAuthor name
handlestringURL handle
bodyHtmlstringHTML content
summarystringArticle summary
tagsstringComma-separated tags
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
publishedAtstringPublished timestamp (optional)
imageUrlstringImage URL (optional)
imageAltstringImage alt text (optional)

Example:

const result = await mirra.shopify.getArticle({
  articleId: "abc123"
});

createArticle

Create an article in a blog.

Arguments:

  • blogId (string, required): The blog ID to create the article in.
  • title (string, required): The article title.
  • author (string, optional): The article author.
  • bodyHtml (string, optional): HTML body content of the article.
  • summary (string, optional): Summary or excerpt of the article.
  • tags (string, optional): Comma-separated list of tags.
  • published (boolean, optional): Whether the article is published.
  • imageUrl (string, optional): URL of the article featured image.
  • imageAlt (string, optional): Alt text for the article featured image.

Returns:

AdapterOperationResult - Returns the created NormalizedShopifyArticle.

Response Fields:

FieldTypeDescription
idstringArticle ID
blogIdstringParent blog ID
titlestringArticle title
authorstringAuthor name
handlestringURL handle
bodyHtmlstringHTML content
summarystringArticle summary
tagsstringComma-separated tags
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
publishedAtstringPublished timestamp (optional)
imageUrlstringImage URL (optional)
imageAltstringImage alt text (optional)

Example:

const result = await mirra.shopify.createArticle({
  blogId: "abc123",
  title: "example"
});

updateArticle

Update an article.

Arguments:

  • articleId (string, required): The Shopify article ID to update.
  • title (string, optional): New article title.
  • author (string, optional): New author name.
  • bodyHtml (string, optional): New HTML body content.
  • summary (string, optional): New summary or excerpt.
  • tags (string, optional): New comma-separated tags.
  • published (boolean, optional): Whether the article is published.

Returns:

AdapterOperationResult - Returns the updated NormalizedShopifyArticle.

Response Fields:

FieldTypeDescription
idstringArticle ID
blogIdstringParent blog ID
titlestringArticle title
authorstringAuthor name
handlestringURL handle
bodyHtmlstringHTML content
summarystringArticle summary
tagsstringComma-separated tags
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
publishedAtstringPublished timestamp (optional)
imageUrlstringImage URL (optional)
imageAltstringImage alt text (optional)

Example:

const result = await mirra.shopify.updateArticle({
  articleId: "abc123"
});

deleteArticle

Delete an article.

Arguments:

  • articleId (string, required): The Shopify article ID to delete.

Returns:

AdapterOperationResult - Returns { deleted: true, articleId }.

Response Fields:

FieldTypeDescription
deletedbooleanWhether deletion was successful
articleIdstringDeleted article ID

Example:

const result = await mirra.shopify.deleteArticle({
  articleId: "abc123"
});

listThemes

List all themes in the Shopify store.

Returns:

AdapterOperationResult - Returns { themes: NormalizedShopifyTheme[], totalRetrieved }.

Response Fields:

FieldTypeDescription
themesShopifyNormalizedTheme[]List of themes
themes item fields (ShopifyNormalizedTheme)
FieldTypeDescription
idstringTheme ID
namestringTheme name
rolestringTheme role (main, unpublished, demo)
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
processingbooleanWhether theme is being processed

| totalRetrieved | number | Number of themes retrieved |

Example:

const result = await mirra.shopify.listThemes();

getTheme

Get a theme by ID.

Arguments:

  • themeId (string, required): The Shopify theme ID.

Returns:

AdapterOperationResult - Returns a single NormalizedShopifyTheme with full details.

Response Fields:

FieldTypeDescription
idstringTheme ID
namestringTheme name
rolestringTheme role (main, unpublished, demo)
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
processingbooleanWhether theme is being processed

Example:

const result = await mirra.shopify.getTheme({
  themeId: "abc123"
});

publishTheme

Publish (activate) a theme as the main theme.

Arguments:

  • themeId (string, required): The Shopify theme ID to publish.

Returns:

AdapterOperationResult - Returns the updated NormalizedShopifyTheme with role set to main.

Response Fields:

FieldTypeDescription
idstringTheme ID
namestringTheme name
rolestringTheme role (main, unpublished, demo)
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
processingbooleanWhether theme is being processed

Example:

const result = await mirra.shopify.publishTheme({
  themeId: "abc123"
});

listThemeFiles

List files in a theme.

Arguments:

  • themeId (string, required): The Shopify theme ID.
  • filenames (string, optional): Comma-separated glob patterns like templates/*.json

Returns:

AdapterOperationResult - Returns { files: NormalizedShopifyThemeFile[], totalRetrieved }.

Response Fields:

FieldTypeDescription
filesShopifyNormalizedThemeFile[]List of theme files
files item fields (ShopifyNormalizedThemeFile)
FieldTypeDescription
filenamestringFile path
contentTypestringMIME type
sizenumberFile size in bytes
checksumMd5stringMD5 checksum (optional)
bodystringFile content (optional)

| totalRetrieved | number | Number of files retrieved |

Example:

const result = await mirra.shopify.listThemeFiles({
  themeId: "abc123"
});

getThemeFile

Get a single theme file with its content.

Arguments:

  • themeId (string, required): The Shopify theme ID.
  • filename (string, required): The filename/path of the theme file (e.g., "templates/index.json").

Returns:

AdapterOperationResult - Returns a single NormalizedShopifyThemeFile with filename, body content, and metadata.

Response Fields:

FieldTypeDescription
filenamestringFile path
contentTypestringMIME type
sizenumberFile size in bytes
checksumMd5stringMD5 checksum (optional)
bodystringFile content (optional)

Example:

const result = await mirra.shopify.getThemeFile({
  themeId: "abc123",
  filename: "example"
});

upsertThemeFiles

Create or update theme files.

Arguments:

  • themeId (string, required): The Shopify theme ID.
  • files (array, required): Array of {filename, body} objects

Returns:

AdapterOperationResult - Returns { files: NormalizedShopifyThemeFile[], totalRetrieved } with the created or updated files.

Response Fields:

FieldTypeDescription
upsertedFilesstring[]List of upserted file paths
totalUpsertednumberNumber of files upserted

Example:

const result = await mirra.shopify.upsertThemeFiles({
  themeId: "abc123",
  files: []
});

deleteThemeFiles

Delete theme files.

Arguments:

  • themeId (string, required): The Shopify theme ID.
  • filenames (array, required): Array of filenames to delete

Returns:

AdapterOperationResult - Returns { deleted: true, filenames } with the list of deleted files.

Response Fields:

FieldTypeDescription
deletedFilesstring[]List of deleted file paths
totalDeletednumberNumber of files deleted

Example:

const result = await mirra.shopify.deleteThemeFiles({
  themeId: "abc123",
  filenames: []
});

listMenus

List navigation menus.

Arguments:

  • limit (number, optional): Number of menus per page, 1-250, default 50
  • pageInfo (string, optional): Cursor for pagination

Returns:

AdapterOperationResult - Returns { menus: NormalizedShopifyMenu[], nextPageInfo, previousPageInfo, totalRetrieved }.

Response Fields:

FieldTypeDescription
menusShopifyNormalizedMenu[]List of menus
menus item fields (ShopifyNormalizedMenu)
FieldTypeDescription
idstringMenu ID
titlestringMenu title
handlestringURL handle
itemsobject[]Menu items, each with id, title, type, url, resourceId, and nested items[]

| nextPageInfo | string | Cursor for next page (optional) | | previousPageInfo | string | Cursor for previous page (optional) | | totalRetrieved | number | Number of menus retrieved |

Example:

const result = await mirra.shopify.listMenus({});

getMenu

Get a menu by ID.

Arguments:

  • menuId (string, required): The Shopify menu ID.

Returns:

AdapterOperationResult - Returns a single NormalizedShopifyMenu with full details.

Response Fields:

FieldTypeDescription
idstringMenu ID
titlestringMenu title
handlestringURL handle
itemsobject[]Menu items, each with id, title, type, url, resourceId, and nested items[]

Example:

const result = await mirra.shopify.getMenu({
  menuId: "abc123"
});

createMenu

Create a navigation menu.

Arguments:

  • title (string, required): The menu title.
  • handle (string, optional): The menu handle (URL-friendly identifier).
  • items (array, optional): Array of menu item objects with title, url, type, resourceId

Returns:

AdapterOperationResult - Returns the created NormalizedShopifyMenu.

Response Fields:

FieldTypeDescription
idstringMenu ID
titlestringMenu title
handlestringURL handle
itemsobject[]Menu items, each with id, title, type, url, resourceId, and nested items[]

Example:

const result = await mirra.shopify.createMenu({
  title: "example"
});

updateMenu

Update a menu.

Arguments:

  • menuId (string, required): The Shopify menu ID to update.
  • title (string, optional): New menu title.
  • handle (string, optional): New menu handle.
  • items (array, optional): New array of menu item objects with title, url, type, resourceId

Returns:

AdapterOperationResult - Returns the updated NormalizedShopifyMenu.

Response Fields:

FieldTypeDescription
idstringMenu ID
titlestringMenu title
handlestringURL handle
itemsobject[]Menu items, each with id, title, type, url, resourceId, and nested items[]

Example:

const result = await mirra.shopify.updateMenu({
  menuId: "abc123"
});

deleteMenu

Delete a menu.

Arguments:

  • menuId (string, required): The Shopify menu ID to delete.

Returns:

AdapterOperationResult - Returns { deleted: true, menuId }.

Response Fields:

FieldTypeDescription
deletedbooleanWhether deletion was successful
menuIdstringDeleted menu ID

Example:

const result = await mirra.shopify.deleteMenu({
  menuId: "abc123"
});

listRedirects

List URL redirects.

Arguments:

  • limit (number, optional): Number of redirects per page, 1-250, default 50
  • pageInfo (string, optional): Cursor for pagination

Returns:

AdapterOperationResult - Returns { redirects: NormalizedShopifyRedirect[], nextPageInfo, previousPageInfo, totalRetrieved }.

Response Fields:

FieldTypeDescription
redirectsShopifyNormalizedRedirect[]List of redirects
redirects item fields (ShopifyNormalizedRedirect)
FieldTypeDescription
idstringRedirect ID
pathstringSource path
targetstringTarget URL

| nextPageInfo | string | Cursor for next page (optional) | | previousPageInfo | string | Cursor for previous page (optional) | | totalRetrieved | number | Number of redirects retrieved |

Example:

const result = await mirra.shopify.listRedirects({});

createRedirect

Create a URL redirect.

Arguments:

  • path (string, required): The old path to redirect from
  • target (string, required): The new URL to redirect to

Returns:

AdapterOperationResult - Returns the created NormalizedShopifyRedirect.

Response Fields:

FieldTypeDescription
idstringRedirect ID
pathstringSource path
targetstringTarget URL

Example:

const result = await mirra.shopify.createRedirect({
  path: "example",
  target: "example"
});

updateRedirect

Update a redirect.

Arguments:

  • redirectId (string, required): The Shopify redirect ID to update.
  • path (string, optional): New path to redirect from.
  • target (string, optional): New URL to redirect to.

Returns:

AdapterOperationResult - Returns the updated NormalizedShopifyRedirect.

Response Fields:

FieldTypeDescription
idstringRedirect ID
pathstringSource path
targetstringTarget URL

Example:

const result = await mirra.shopify.updateRedirect({
  redirectId: "abc123"
});

deleteRedirect

Delete a redirect.

Arguments:

  • redirectId (string, required): The Shopify redirect ID to delete.

Returns:

AdapterOperationResult - Returns { deleted: true, redirectId }.

Response Fields:

FieldTypeDescription
deletedbooleanWhether deletion was successful
redirectIdstringDeleted redirect ID

Example:

const result = await mirra.shopify.deleteRedirect({
  redirectId: "abc123"
});

createCoupon

Create a discount code (coupon) that customers can enter at checkout for a percentage or fixed-amount discount off their entire order. The coupon is active immediately unless startsAt is provided.

Arguments:

  • code (string, required): The coupon code customers type at checkout, e.g. "SUMMER20". Case-insensitive at checkout.
  • valueType (string, required): The discount type: "percentage" for a percent off, or "fixed_amount" for a flat currency amount off.
  • value (number, required): The discount amount. For valueType "percentage", a percent from 1-100 (e.g. 20 = 20% off). For valueType "fixed_amount", the currency amount off the order (e.g. 10 = $10 off in the store currency).
  • title (string, optional): Admin-facing title for the discount shown in the Shopify dashboard. Defaults to the code if omitted.
  • startsAt (string, optional): When the coupon becomes active (ISO 8601). Defaults to now.
  • endsAt (string, optional): When the coupon expires (ISO 8601). Omit for no expiry. Must be after startsAt.
  • usageLimit (number, optional): Maximum total number of times this coupon can be used across all customers. Omit for unlimited.
  • appliesOncePerCustomer (boolean, optional): If true, each customer can use the coupon only once. Defaults to false.
  • minimumSubtotal (number, optional): Minimum order subtotal (in the store currency) required to use the coupon. Omit for no minimum.

Returns:

AdapterOperationResult - Returns the created discount code: { id, code, title, status, valueType, value, startsAt, endsAt, usageLimit, appliesOncePerCustomer, minimumSubtotal }.

Response Fields:

FieldTypeDescription
idstringDiscount code node ID
codestringThe coupon code customers enter at checkout
titlestringAdmin-facing discount title
statusstringDiscount status (active, scheduled, expired)
valueTypestringDiscount type (percentage or fixed_amount)
valuestringDiscount value — the percent for percentage coupons, or currency amount for fixed_amount coupons
startsAtstringActivation timestamp (ISO 8601) (optional)
endsAtstringExpiry timestamp (ISO 8601) (optional)
usageLimitnumberMaximum total redemptions, or null for unlimited (optional)
appliesOncePerCustomerbooleanWhether each customer can use it only once
minimumSubtotalstringMinimum order subtotal required, or null for none (optional)

Example:

const result = await mirra.shopify.createCoupon({
  code: "example",
  valueType: "example",
  value: 10
});