Set-ShopifyProductStatus

EulandaXtools — Funktionsreferenz

Set-ShopifyProductStatus

ÜBERSICHT

Ändert den Status eines Shopify-Produkts (active, draft, archived).

SYNTAX

Set-ShopifyProductStatus [-Shop] <string> [-Token] <string> [-ApiVersion] <string> [-ProductId]
    <long> [-Status] <string> [[-MaxRetries] <int>] [[-TimeoutSec] <int>] [<CommonParameters>]

BESCHREIBUNG

Führt eine minimale productUpdate-Mutation per GraphQL aus, die nur die Product-Id und den neuen Status enthält. Damit können Produkte archiviert, als Entwurf markiert oder reaktiviert werden, ohne andere Felder zu berühren.

PARAMETER

-Shop

Type: string

Shopify-Shop-Domain, z.B. 'mein-shop.myshopify.com'.

-Token

Type: string

Admin API Access Token (shpat_...) der Custom App.

-ApiVersion

Type: string

API-Version, z.B. '2025-01'.

-ProductId

Type: long

Shopify Product-Id des zu ändernden Produkts.

-Status

Type: string

Neuer Status: 'active', 'draft' oder 'archived'.

-MaxRetries

Type: int
Default: 3

Maximale Anzahl Wiederholungen bei Rate-Limit.

-TimeoutSec

Type: int
Default: 60

HTTP Timeout in Sekunden.

AUSGABEN

pscustomobject

BEISPIELE

# Produkt archivieren
Set-ShopifyProductStatus -Shop 'mein-shop.myshopify.com' `
  -Token 'shpat_abc123' -ApiVersion '2025-01' `
  -ProductId 1234567890 -Status 'archived'
# Archiviertes Produkt reaktivieren
Set-ShopifyProductStatus -Shop $shop -Token $token `
  -ApiVersion '2025-01' -ProductId $id -Status 'active'