Endpoint Create a Customer
Name
post_customer
Description
Creates a new customer. [API reference]
Related Tables
Parameters
| Parameter | Required | Options | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| There are no parameters | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 |
|---|---|---|---|---|
| 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 create a customer:
| There are no parameters to configure. |
ODBC application
Use these SQL queries in your ODBC application data source:
Create a customer
<p>Creates a new customer record. You can specify details such as <code>FirstName</code>, <code>LastName</code>, <code>Email</code>, <code>Phone</code>, and address fields like <code>DefaultAddressCity</code> and <code>DefaultAddressCountry</code>.</p>
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')
Create a customer using raw JSON body
<p>Creates a customer by supplying the entire JSON body in the special <code>_rawdoc_</code> column. This is useful for setting attributes or nested structures that are not mapped to specific input columns.</p>
INSERT INTO Customers(_rawdoc_)
VALUES('{"customer":{"first_name":"John","last_name":"Doe","email":"a.doe@gmail.com","phone":"7705553111"}}')
Bulk create customers using SQL Server data
<p>Bulk creates customers by reading data from an external SQL Server database using the <code>SOURCE</code> clause. The column names in the source query must match the input columns of the <code>Customers</code> table (e.g. <code>FirstName</code>, <code>LastName</code>, <code>Email</code>).</p>
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'
)
Bulk create customers using raw JSON body from SQL Server
<p>Bulk creates customers by reading raw JSON bodies from an external SQL Server database. The source query should return a column named <code>_rawdoc_</code> containing the JSON for each customer.</p>
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:
Create a customer
<p>Creates a new customer record. You can specify details such as <code>FirstName</code>, <code>LastName</code>, <code>Email</code>, <code>Phone</code>, and address fields like <code>DefaultAddressCity</code> and <code>DefaultAddressCountry</code>.</p>
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];
Create a customer using raw JSON body
<p>Creates a customer by supplying the entire JSON body in the special <code>_rawdoc_</code> column. This is useful for setting attributes or nested structures that are not mapped to specific input columns.</p>
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];
Bulk create customers using SQL Server data
<p>Bulk creates customers by reading data from an external SQL Server database using the <code>SOURCE</code> clause. The column names in the source query must match the input columns of the <code>Customers</code> table (e.g. <code>FirstName</code>, <code>LastName</code>, <code>Email</code>).</p>
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];
Bulk create customers using raw JSON body from SQL Server
<p>Bulk creates customers by reading raw JSON bodies from an external SQL Server database. The source query should return a column named <code>_rawdoc_</code> containing the JSON for each customer.</p>
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).