Set-ShopifyCustomer #
ÜBERSICHT #
Legt einen Shopify-Kunden an oder aktualisiert ihn (Upsert per E-Mail).
SYNTAX #
Set-ShopifyCustomer [-Shop] <string> [-Token] <string> [-ApiVersion] <string> [-Customer]
<hashtable> [[-MaxRetries] <int>] [[-TimeoutSec] <int>] [<CommonParameters>]
BESCHREIBUNG #
Verwendet die customerSet-Mutation (GraphQL Admin API), um einen Kunden per E-Mail-Adresse anzulegen oder zu aktualisieren. Die E-Mail dient als eindeutiger Schlüssel für den Upsert.
Die Eingabe-Hashtable verwendet flache Feldnamen, die intern auf die GraphQL-Struktur (CustomerSetInput) gemappt werden.
Das Ergebnis wird normalisiert: GIDs werden in numerische IDs umgewandelt.
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. ‘2026-01’. customerSet erfordert mindestens 2025-01.
-Customer #
Type: hashtable
Hashtable mit den Kundendaten. Muss mindestens ’email’ enthalten. Beispiel: @{ email = ‘kunde@example.com’ firstName = ‘Max’ lastName = ‘Mustermann’ tags = @(’eulanda:MATCH01’) addresses = @(@{ company = ‘Firma GmbH’ address1 = ‘Musterstrasse 1’ zip = ‘12345’ city = ‘Musterstadt’ countryCode = ‘DE’ phone = ‘+4930123456’ }) }
-MaxRetries #
Type: int
Default: 3
Maximale Anzahl Wiederholungen bei Rate-Limit.
-TimeoutSec #
Type: int
Default: 60
HTTP Timeout in Sekunden.
AUSGABEN #
pscustomobject
BEISPIELE #
# Kunde anlegen oder aktualisieren
$customer = @{
email = 'info@firma.de'
firstName = 'Max'
lastName = 'Mustermann'
tags = @('eulanda:MATCH01')
addresses = @(@{
company = 'Firma GmbH'
address1 = 'Hauptstrasse 1'
zip = '10115'
city = 'Berlin'
countryCode = 'DE'
})
}
Set-ShopifyCustomer -Shop 'mein-shop.myshopify.com' `
-Token 'shpat_abc123' -ApiVersion '2026-01' -Customer $customer
# Kunden-E-Mail aktualisieren (Upsert)
$customer = @{
email = 'info@firma.de'
firstName = 'Maximilian'
lastName = 'Mustermann'
}
Set-ShopifyCustomer -Shop $shop -Token $token -ApiVersion '2026-01' -Customer $customer