Set-ShopifyOrderMetafield

EulandaXtools — Funktionsreferenz

Set-ShopifyOrderMetafield

ÜBERSICHT

Setzt ein Metafield an einer Shopify-Bestellung.

SYNTAX

Set-ShopifyOrderMetafield [-Shop] <string> [-Token] <string> [-ApiVersion] <string> [-OrderId]
    <long> [-Namespace] <string> [-Key] <string> [-Value] <string> [-Type] <string> [[-MaxRetries]
    <int>] [[-TimeoutSec] <int>] [<CommonParameters>]

BESCHREIBUNG

Erstellt oder aktualisiert ein Metafield an der angegebenen Order über die GraphQL Admin API (metafieldsSet Mutation).

Für Dokumenten-Verknüpfungen wird Type 'file_reference' verwendet und als Value die Shopify GID (z.B. 'gid://shopify/GenericFile/123').

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'.

-OrderId

Type: long

Shopify-Order-ID (numerisch).

-Namespace

Type: string

Namespace des Metafields, z.B. 'custom'.

-Key

Type: string

Schlüssel des Metafields, z.B. 'invoice_pdf'.

-Value

Type: string

Wert des Metafields. Für file_reference: GID-String.

-Type

Type: string

Datentyp des Metafields, z.B. 'file_reference', 'single_line_text_field'.

-MaxRetries

Type: int
Default: 3

Maximale Anzahl Wiederholungen bei Rate-Limit.

-TimeoutSec

Type: int
Default: 60

HTTP Timeout in Sekunden.

AUSGABEN

pscustomobject -- Das erstellte Metafield-Objekt.

BEISPIELE

Set-ShopifyOrderMetafield -Shop 'mein-shop.myshopify.com' `
  -Token 'shpat_abc123' -ApiVersion '2025-01' `
  -OrderId 5551234567890 -Namespace 'custom' -Key 'invoice_pdf' `
  -Value 'gid://shopify/GenericFile/123456789' -Type 'file_reference'