Reference

Endpoint Update a Customer


Name

put_customer

Description

Updates an existing customer. [API reference]

Related Tables

Customers

Parameters

Parameter Required Options
Name: Id

Label: Customer Id

The ID of the customer to be updated.
YES

Output Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
Id DT_I8 bigint
Email DT_WSTR nvarchar(255) 255
AcceptsMarketing DT_BOOL bit
CreatedAt DT_DBTIMESTAMP datetime
UpdatedAt DT_DBTIMESTAMP datetime
FirstName DT_WSTR nvarchar(255) 255
LastName DT_WSTR nvarchar(255) 255
OrdersCount DT_I4 int
State DT_WSTR nvarchar(255) 255
TotalSpent DT_WSTR nvarchar(50) 50
LastOrderId DT_I8 bigint
Note DT_WSTR nvarchar(4000) 4000
VerifiedEmail DT_BOOL bit
MultipassIdentifier DT_WSTR nvarchar(255) 255
TaxExempt DT_BOOL bit
TaxExemptions DT_WSTR nvarchar(4000) 4000
Tags DT_WSTR nvarchar(4000) 4000
LastOrderName DT_WSTR nvarchar(255) 255
Currency DT_WSTR nvarchar(20) 20
Phone DT_WSTR nvarchar(30) 30
AcceptsMarketingUpdatedAt DT_DBTIMESTAMP datetime
MarketingOptInLevel DT_WSTR nvarchar(255) 255
SMSMarketingConsent DT_WSTR nvarchar(255) 255
AdminGraphQLApiId DT_WSTR nvarchar(255) 255
DefaultAddressId DT_WSTR nvarchar(255) 255
DefaultAddressCustomerId DT_WSTR nvarchar(255) 255
DefaultAddressFirstName DT_WSTR nvarchar(255) 255
DefaultAddressLastName DT_WSTR nvarchar(255) 255
DefaultAddressCompany DT_WSTR nvarchar(255) 255
DefaultAddressAddress1 DT_WSTR nvarchar(255) 255
DefaultAddressAddress2 DT_WSTR nvarchar(255) 255
DefaultAddressCity DT_WSTR nvarchar(255) 255
DefaultAddressProvince DT_WSTR nvarchar(255) 255
DefaultAddressCountry DT_WSTR nvarchar(255) 255
DefaultAddressZip DT_WSTR nvarchar(255) 255
DefaultAddressPhone DT_WSTR nvarchar(255) 255
DefaultAddressName DT_WSTR nvarchar(255) 255
DefaultAddressProvinceCode DT_WSTR nvarchar(255) 255
DefaultAddressCountryCode DT_WSTR nvarchar(255) 255
DefaultAddressCountryName DT_WSTR nvarchar(255) 255
EmailMarketingConsentState DT_WSTR nvarchar(255) 255
EmailMarketingConsentOptInLevel DT_WSTR nvarchar(255) 255
EmailMarketingConsentUpdatedAt DT_DBTIMESTAMP datetime
If the column you are looking for is missing, consider customizing Shopify Connector.

Input Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
Id DT_I8 bigint
FirstName DT_WSTR nvarchar(255) 255
LastName DT_WSTR nvarchar(255) 255
Email DT_WSTR nvarchar(255) 255
Phone DT_WSTR nvarchar(30) 30
Password DT_WSTR nvarchar(255) 255
PasswordConfirmation DT_WSTR nvarchar(255) 255
SendWelcomeEmail DT_BOOL bit
MultipassIdentifier DT_WSTR nvarchar(255) 255
Note DT_NTEXT nvarchar(MAX)
Tags DT_NTEXT nvarchar(MAX)
TaxExempt DT_BOOL bit
TaxExemptions DT_WSTR nvarchar(4000) 4000
DefaultAddressFirstName DT_WSTR nvarchar(255) 255
DefaultAddressLastName DT_WSTR nvarchar(255) 255
DefaultAddressCompany DT_WSTR nvarchar(255) 255
DefaultAddressLine1 DT_WSTR nvarchar(255) 255
DefaultAddressLine2 DT_WSTR nvarchar(255) 255
DefaultAddressCity DT_WSTR nvarchar(255) 255
DefaultAddressProvince DT_WSTR nvarchar(255) 255
DefaultAddressCountry DT_WSTR nvarchar(255) 255
DefaultAddressZip DT_WSTR nvarchar(255) 255
DefaultAddressPhone DT_WSTR nvarchar(255) 255
DefaultAddressName DT_WSTR nvarchar(255) 255
DefaultAddressProvinceCode DT_WSTR nvarchar(255) 255
DefaultAddressCountryCode DT_WSTR nvarchar(255) 255
DefaultAddressCountryName DT_WSTR nvarchar(255) 255
Required columns that you need to supply are bolded.

Examples

SSIS

Use Shopify Connector in API Source or in API Destination SSIS Data Flow components to read or write data.

API Destination

This Endpoint belongs to the Customers table, therefore it is better to use it, instead of accessing the endpoint directly. Use this table and table-operation pair to update a customer:

API Destination - Shopify
Shopify Connector can be used to integrate Shopify REST API in your App / BI Tools. You can read/write data about Customers, Orders, OrderItems, Products and more.
Shopify
Customers
Update
There are no parameters to configure.
SSIS API Destination - Access table operation

ODBC application

Use these SQL queries in your ODBC application data source:

Update an existing customer record

UPDATE Customers SET
  Email = 'john.doe2@gmail.com',
  Phone = '7705553445',
  Note= 'This is a new note that needed to be added later.'
  WHERE Id=1111111111111

Update an existing customer record using RAW JSON Body (special column _rawdoc_)

Sometimes you have need to INSERT or UPDATE certain arrtibutes for which input columns not defined. In this case you can supply entire BODY JSON as input using special column name _rawdoc_

UPDATE Customers
SET _rawdoc_='{"customer":{"first_name":"John_new","last_name":"Doe_new","email":"a_new.doe@gmail.com","phone":"7705553111"}}'
WHERE Id=1111111111111

Update customers in BULK (read from external MS SQL database)

In this example we are reading customer Ids, Email, Notes from external source system (Microsoft SQL Server) and sending it to Shopify. Your column name must match with Input columns of the table you trying to update. See other BULK examples to learn more about reading from other systems using ODBC or OLEDB connection.

UPDATE Customers
SOURCE('MSSQL'
 ,'Data Source=localhost;Initial Catalog=tempdb;Integrated Security=true'
 ,'select 111 as Id, ''a@a.com''Email , ''SOLD'' as Note,0 as [$$ContineOn404Error]
  UNION
  select 222 as Id, ''b@b.com''Email , ''SOLD'' as Note,0 as [$$ContineOn404Error]
  '
)

put_customer endpoint belongs to Customers table(s), and can therefore be used via those table(s).

SQL Server

Use these SQL queries in SQL Server after you create a data source in Data Gateway:

Update an existing customer record

DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE Customers SET
  Email = ''john.doe2@gmail.com'',
  Phone = ''7705553445'',
  Note= ''This is a new note that needed to be added later.''
  WHERE Id=1111111111111';

EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];

Update an existing customer record using RAW JSON Body (special column _rawdoc_)

Sometimes you have need to INSERT or UPDATE certain arrtibutes for which input columns not defined. In this case you can supply entire BODY JSON as input using special column name _rawdoc_

DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE Customers
SET _rawdoc_=''{"customer":{"first_name":"John_new","last_name":"Doe_new","email":"a_new.doe@gmail.com","phone":"7705553111"}}''
WHERE Id=1111111111111';

EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];

Update customers in BULK (read from external MS SQL database)

In this example we are reading customer Ids, Email, Notes from external source system (Microsoft SQL Server) and sending it to Shopify. Your column name must match with Input columns of the table you trying to update. See other BULK examples to learn more about reading from other systems using ODBC or OLEDB connection.

DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE Customers
SOURCE(''MSSQL''
 ,''Data Source=localhost;Initial Catalog=tempdb;Integrated Security=true''
 ,''select 111 as Id, ''''a@a.com''''Email , ''''SOLD'''' as Note,0 as [$$ContineOn404Error]
  UNION
  select 222 as Id, ''''b@b.com''''Email , ''''SOLD'''' as Note,0 as [$$ContineOn404Error]
  ''
)';

EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];

put_customer endpoint belongs to Customers table(s), and can therefore be used via those table(s).