Table Orders
Description
No description available
Supported Operations
Below section contains supported CRUD operations. Each operation is executed by some EndPoint behind the scene.| Method | Supported | Reference EndPoint |
|---|---|---|
| SELECT | get_orders | |
| INSERT | post_order | |
| UPDATE | put_order | |
| UPSERT | ||
| DELETE | delete_order | |
| LOOKUP | get_orders |
Examples
SSIS
Use Shopify Connector in API Source component to read data or in API Destination component to read/write data:
Read from Orders table using API Source
| Optional Parameters | |
|---|---|
| Order Id(s) - Comma separated | |
Read/write to Orders table using API Destination
| Optional Parameters | |
|---|---|
| Order Id(s) - Comma separated | |
ODBC application
Use these SQL queries in your ODBC application data source:
Update an order
<p>Updates an existing order record identified by its <code>Id</code>. You can modify attributes like <code>FulfillmentStatus</code>, <code>Phone</code>, and <code>Note</code>.</p>
UPDATE Orders
SET FulfillmentStatus = 'john.doe5@gmail.com',
Phone = '7705553111',
Note= 'This is a new note that needed to be added to the order later.'
WHERE Id=1111111111111
Read orders
<p>Gets a list of all orders from the <code>Orders</code> table.</p>
SELECT * FROM Orders
Read open orders
<p>Gets a list of orders filtered by status. Use the <code>Status</code> parameter in the <code>WITH</code> clause (e.g. 'open', 'closed', 'cancelled', 'any').</p>
SELECT * FROM Orders WITH (Status='open') --also try 'any', 'open', 'closed', 'cancelled'
Read an order by ID
<p>Gets a specific order by its unique <code>Id</code>. Supply the order ID in the <code>WHERE</code> clause.</p>
SELECT * FROM Orders Where Id=1111111111111
Read multiple orders by IDs
<p>Gets multiple orders by supplying a comma-separated list of IDs in the <code>ids</code> parameter within the <code>WITH</code> clause.</p>
SELECT * FROM Orders WITH(ids='1111111111111,2222222222222,3333333333333')
Delete an order
<p>Deletes an order record by its <code>Id</code>.</p>
DELETE Orders WHERE Id=1111111111111
Delete an order (throw error if not found)
<p>Deletes an order record by ID. Set <code>ContineOn404Error=0</code> in the <code>WITH</code> clause to throw an error if the order ID is not found.</p>
DELETE Orders WHERE Id=1111111111111 (ContineOn404Error=0)
Create an order
<p>Creates a new order record. You can specify billing/shipping addresses, customer details, and a JSON array of <code>LineItems</code> containing product details.</p>
INSERT INTO Orders (BillingAddressLine1, BillingAddressLine2, BillingAddressCity, BillingAddressCompany, BillingAddressCountry, BillingAddressFirstName, BillingAddressLastName, BillingAddressPhone, BillingAddressProvince, BillingAddressZip, BillingAddressName, BillingAddressProvinceCode, BillingAddressCountryCode, BuyerAcceptsMarketing, LineItems, CustomerId, Email, EstimatedTaxes, FinancialStatus, FulfillmentStatus, Name, Note, Phone, Currency, PresentmentCurrency, ProcessedAt, ReferringSite, ShippingAddressLine1, ShippingAddressLine2, ShippingAddressCity, ShippingAddressCompany, ShippingAddressCountry, ShippingAddressFirstName, ShippingAddressLastName, ShippingAddressPhone, ShippingAddressProvince, ShippingAddressZip, ShippingAddressName, ShippingAddressProvinceCode, ShippingAddressCountryCode, Tags, TaxesIncluded, TotalWeight, SendReceipt, SendFulfillmentReceipt)
VALUES
('123 Main Street', 'Suite #54', 'Memphis', 'Acme, Inc.', 'United States', 'John', 'Doe', '4045559876', 'Tennessee', '38101', 'John Doe', 'GA', 'US', 1, '[{"title":"Super Strong Glue","price":24.99,"grams":"100","quantity":1,"tax_lines":[{"price":13.5,"rate":0.06,"title":"State tax"}]}]', 5945175474276, 'johndoe2@gmail.com', 1, 'pending', null, '#40294', 'This order needs to be expedited, so register it in the system as so.', '4045559876', 'USD', 'USD', '2023-02-27T11:00:00', 'https://referringsite.com', '123 Main Street', 'Suite #54', 'Memphis', 'Acme, Inc.', 'United States', 'John', 'Doe', '4045559876', 'Tennessee', '38101', 'John Doe', 'GA', 'US', NULL, 1, 20, 1, 1)
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Update an order
<p>Updates an existing order record identified by its <code>Id</code>. You can modify attributes like <code>FulfillmentStatus</code>, <code>Phone</code>, and <code>Note</code>.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE Orders
SET FulfillmentStatus = ''john.doe5@gmail.com'',
Phone = ''7705553111'',
Note= ''This is a new note that needed to be added to the order later.''
WHERE Id=1111111111111';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];
Read orders
<p>Gets a list of all orders from the <code>Orders</code> table.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Orders';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];
Read open orders
<p>Gets a list of orders filtered by status. Use the <code>Status</code> parameter in the <code>WITH</code> clause (e.g. 'open', 'closed', 'cancelled', 'any').</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Orders WITH (Status=''open'') --also try ''any'', ''open'', ''closed'', ''cancelled''';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];
Read an order by ID
<p>Gets a specific order by its unique <code>Id</code>. Supply the order ID in the <code>WHERE</code> clause.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Orders Where Id=1111111111111';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];
Read multiple orders by IDs
<p>Gets multiple orders by supplying a comma-separated list of IDs in the <code>ids</code> parameter within the <code>WITH</code> clause.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Orders WITH(ids=''1111111111111,2222222222222,3333333333333'')';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];
Delete an order
<p>Deletes an order record by its <code>Id</code>.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE Orders WHERE Id=1111111111111';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];
Delete an order (throw error if not found)
<p>Deletes an order record by ID. Set <code>ContineOn404Error=0</code> in the <code>WITH</code> clause to throw an error if the order ID is not found.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE Orders WHERE Id=1111111111111 (ContineOn404Error=0)';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];
Create an order
<p>Creates a new order record. You can specify billing/shipping addresses, customer details, and a JSON array of <code>LineItems</code> containing product details.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO Orders (BillingAddressLine1, BillingAddressLine2, BillingAddressCity, BillingAddressCompany, BillingAddressCountry, BillingAddressFirstName, BillingAddressLastName, BillingAddressPhone, BillingAddressProvince, BillingAddressZip, BillingAddressName, BillingAddressProvinceCode, BillingAddressCountryCode, BuyerAcceptsMarketing, LineItems, CustomerId, Email, EstimatedTaxes, FinancialStatus, FulfillmentStatus, Name, Note, Phone, Currency, PresentmentCurrency, ProcessedAt, ReferringSite, ShippingAddressLine1, ShippingAddressLine2, ShippingAddressCity, ShippingAddressCompany, ShippingAddressCountry, ShippingAddressFirstName, ShippingAddressLastName, ShippingAddressPhone, ShippingAddressProvince, ShippingAddressZip, ShippingAddressName, ShippingAddressProvinceCode, ShippingAddressCountryCode, Tags, TaxesIncluded, TotalWeight, SendReceipt, SendFulfillmentReceipt)
VALUES
(''123 Main Street'', ''Suite #54'', ''Memphis'', ''Acme, Inc.'', ''United States'', ''John'', ''Doe'', ''4045559876'', ''Tennessee'', ''38101'', ''John Doe'', ''GA'', ''US'', 1, ''[{"title":"Super Strong Glue","price":24.99,"grams":"100","quantity":1,"tax_lines":[{"price":13.5,"rate":0.06,"title":"State tax"}]}]'', 5945175474276, ''johndoe2@gmail.com'', 1, ''pending'', null, ''#40294'', ''This order needs to be expedited, so register it in the system as so.'', ''4045559876'', ''USD'', ''USD'', ''2023-02-27T11:00:00'', ''https://referringsite.com'', ''123 Main Street'', ''Suite #54'', ''Memphis'', ''Acme, Inc.'', ''United States'', ''John'', ''Doe'', ''4045559876'', ''Tennessee'', ''38101'', ''John Doe'', ''GA'', ''US'', NULL, 1, 20, 1, 1)';
EXEC (@MyQuery) AT [LS_TO_SHOPIFY_IN_GATEWAY];