Shopify Connector
Documentation
Version: 2
Documentation
Endpoint

Create a Customer


Name

post_customer

Description

Creates a new customer. [API reference]

Related Tables

Customers

Parameters

Parameter Label Required Options Description
There are no parameters

Output Columns

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

Input Columns

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

Examples

SSIS

Use Shopify Connector in API Source component to read data or in API Destination component to read/write data:

Insert into Customers table using API Destination

This Endpoint belongs to Customers table, therefore you cannot work with it directly. Use this table and table-operation pair instead:

Shopify
Customers
Insert
SSIS API Destination - Access table operation

ODBC application

Use these SQL queries in your ODBC application data source:

Insert a new customer record

INSERT INTO Customers
(FirstName, LastName, Email, Phone, Password, PasswordConfirmation, SendWelcomeEmail, MultipassIdentifier, Note, Tags, TaxExempt, TaxExemptions, DefaultAddressFirstName, DefaultAddressLastName, DefaultAddressCompany, DefaultAddressLine1, DefaultAddressLine2, DefaultAddressCity, DefaultAddressProvince, DefaultAddressCountry, DefaultAddressZip, DefaultAddressPhone, DefaultAddressName, DefaultAddressProvinceCode, DefaultAddressCountryCode, DefaultAddressCountryName)
VALUES
('John', 'Doe', 'john.doe@gmail.com', '7705553543', 'myNewP@ssword123', 'myNewP@ssword123', 1, null, 'This is a note on the customer account.', null, 0, null, 'John', 'Doe', 'John Doe Corp.', '123 Main Street', null, 'Atlanta', 'Georgia', 'United States', '30135', '7705553543', 'John Doe', 'GA', 'US', 'United States')

Insert a new 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_

INSERT INTO Customers(_rawdoc_)
VALUES('{"customer":{"first_name":"John","last_name":"Doe","email":"a.doe@gmail.com","phone":"7705553111"}}')

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

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

INSERT INTO Customers(FirstName, LastName, Email, Phone)
SOURCE('MSSQL'
  ,'Data Source=localhost;Initial Catalog=tempdb;Integrated Security=true'
  ,'select ''John'' as FirstName, ''Doe'' as LastName, ''a.doe@gmail.com'' as Email, ''7705553111'' as Phone'
)

Insert customers in BULK using RAW JSON Body (read from external MS SQL database)

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

INSERT INTO Customers
SOURCE('MSSQL'
	,'Data Source=localhost;Initial Catalog=tempdb;Integrated Security=true'
	,'select ''{"customer":{"first_name":"Cust1","last_name":"Doe1","email":"a.doe@gmail.com","phone":"7705553111"}}'' as _rawdoc_
	 UNION 
	 select ''{"customer":{"first_name":"Cust2","last_name":"Doe2","email":"b.doe@gmail.com","phone":"7705553222"}}'' as _rawdoc_
	 '
	)

post_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:

Insert a new customer record

DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO Customers
(FirstName, LastName, Email, Phone, Password, PasswordConfirmation, SendWelcomeEmail, MultipassIdentifier, Note, Tags, TaxExempt, TaxExemptions, DefaultAddressFirstName, DefaultAddressLastName, DefaultAddressCompany, DefaultAddressLine1, DefaultAddressLine2, DefaultAddressCity, DefaultAddressProvince, DefaultAddressCountry, DefaultAddressZip, DefaultAddressPhone, DefaultAddressName, DefaultAddressProvinceCode, DefaultAddressCountryCode, DefaultAddressCountryName)
VALUES
(''John'', ''Doe'', ''john.doe@gmail.com'', ''7705553543'', ''myNewP@ssword123'', ''myNewP@ssword123'', 1, null, ''This is a note on the customer account.'', null, 0, null, ''John'', ''Doe'', ''John Doe Corp.'', ''123 Main Street'', null, ''Atlanta'', ''Georgia'', ''United States'', ''30135'', ''7705553543'', ''John Doe'', ''GA'', ''US'', ''United States'')';

EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];

Insert a new 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) = 'INSERT INTO Customers(_rawdoc_)
VALUES(''{"customer":{"first_name":"John","last_name":"Doe","email":"a.doe@gmail.com","phone":"7705553111"}}'')';

EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];

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

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

DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO Customers(FirstName, LastName, Email, Phone)
SOURCE(''MSSQL''
  ,''Data Source=localhost;Initial Catalog=tempdb;Integrated Security=true''
  ,''select ''''John'''' as FirstName, ''''Doe'''' as LastName, ''''a.doe@gmail.com'''' as Email, ''''7705553111'''' as Phone''
)';

EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];

Insert customers in BULK using RAW JSON Body (read from external MS SQL database)

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

DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO Customers
SOURCE(''MSSQL''
	,''Data Source=localhost;Initial Catalog=tempdb;Integrated Security=true''
	,''select ''''{"customer":{"first_name":"Cust1","last_name":"Doe1","email":"a.doe@gmail.com","phone":"7705553111"}}'''' as _rawdoc_
	 UNION 
	 select ''''{"customer":{"first_name":"Cust2","last_name":"Doe2","email":"b.doe@gmail.com","phone":"7705553222"}}'''' as _rawdoc_
	 ''
	)';

EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];

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