Endpoint Update a Customer
Name
put_customer
Description
Updates an existing customer. [API reference]
Related Tables
Parameters
| Parameter | Required | Options |
|---|---|---|
|
Name:
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
|
||
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
|
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 | |
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 |
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:
| There are no parameters to configure. |
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 a customer using raw JSON body
<p>Updates a customer by supplying the entire JSON body in the special <code>_rawdoc_</code> column. This allows updating attributes not exposed as standard columns.</p>
UPDATE Customers
SET _rawdoc_='{"customer":{"first_name":"John_new","last_name":"Doe_new","email":"a_new.doe@gmail.com","phone":"7705553111"}}'
WHERE Id=1111111111111
Bulk update customers using SQL Server data
<p>Bulk updates customers by reading data from an external SQL Server database. The source query must return the <code>Id</code> of the customer to update along with the fields to change (e.g. <code>Email</code>, <code>Note</code>).</p>
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 a customer using raw JSON body
<p>Updates a customer by supplying the entire JSON body in the special <code>_rawdoc_</code> column. This allows updating attributes not exposed as standard columns.</p>
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];
Bulk update customers using SQL Server data
<p>Bulk updates customers by reading data from an external SQL Server database. The source query must return the <code>Id</code> of the customer to update along with the fields to change (e.g. <code>Email</code>, <code>Note</code>).</p>
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).