TDV Adapter for Shopify

Build 22.0.8462

Orders

Create, update, delete, and query orders.

Table-Specific Information

Select

The adapter uses the Shopify API to process search criteria that refer to the Id, FinancialStatus, FulfillmentStatus, CreatedAt, ProcessedAt and UpdatedAt columns. The supported SQL operators are '=' and 'IN' for Id, '=' for FinancialStatus, and FulfillmentStatus, and '>' and '<' for the CreatedAt, ProcessedAt, and UpdatedAt columns. The adapter processes other filters client-side within the adapter.

For example, the following queries are processed server side:

SELECT * FROM Orders

SELECT * FROM Orders WHERE Id='123'

SELECT * FROM Orders WHERE FinancialStatus = 'pending'

SELECT * FROM Orders WHERE CreatedAt > '2017-10-25'

Insert

  • Create a simple order with only a product variant Id using aggregates.

    INSERT INTO Orders(LineAggregate) VALUES('[{\"variant_id\":\"4236041945111\",\"quantity\":2}]')

  • Create a simple order with only a product variant Id using temporary table. The temporary table you are populating is dynamic and will be created at run time the first time you insert to it. Temporary tables are denoted by a # appearing in their name. When using a temporary table to insert, the temporary table must be named in the format [TableName]#TEMP, where TableName is the name of the table you will be inserting to. For instance:

    INSERT INTO OrdersItems#Temp (ItemVariantId,ItemQuantity) VALUES ('123',2)

    Once your temporary table is populated, it is now time to insert to the actual table in Shopify. You can do this by performing an INSERT to the actual table and setting as a value for LinesAggregate the name of the temporary table. For instance:

    INSERT INTO Orders (LineAggregate) VALUES ('OrdersItems#Temp')

  • Create a simple order, sending the order receipt and fulfillment receipt to the customer using aggregates.

    INSERT INTO Orders(Email, FulfillmentStatus, SendReceipt, SendFulfillmentReceipt, LineAggregate) VALUES('foo@example.com', 'fulfilled', true, true, '[{\"variant_id\":\"4236041945111\",\"quantity\":2},{\"variant_id\":\"4236069011479\",\"quantity\":3}]')

  • Create a simple order, sending the order receipt and fulfillment receipt to the customer using temporary table.

    INSERT INTO OrdersItems#Temp (ItemVariantId,ItemQuantity) VALUES ('4236041945111',2)
    INSERT INTO OrdersItems#Temp (ItemVariantId,ItemQuantity) VALUES ('4236069011479',3)
    INSERT INTO Orders (Email, FulfillmentStatus, SendReceipt, SendFulfillmentReceipt,LineAggregate) VALUES ('foo@example.com', 'fulfilled', true, true,'OrdersItems#Temp')

  • Create a simple order, with taxes using aggregates.

    INSERT INTO Orders(LineAggregate, TaxAggregate) VALUES('[{\"variant_id\":\"4236041945111\",\"quantity\":2},{\"variant_id\":\"4236069011479\",\"quantity\":3}]', '[{\"price\":10.2,\"rate\":0.06,\"title\":\"State Tax\"}]')

  • Create a simple order, with taxes using temporary table.

    INSERT INTO OrdersItems#Temp (ItemVariantId,ItemQuantity) VALUES ('4236041945111',2)
    INSERT INTO OrdersItems#Temp (ItemVariantId,ItemQuantity) VALUES ('4236069011479',3)
    INSERT INTO TaxItems#Temp (TaxItemPrice, TaxItemRate,TaxItemTitle) VALUES (10.2, 0.06, 'State Tax')
    INSERT INTO Orders (LineAggregate,TaxAggregate) VALUES ('OrdersItems#Temp','TaxItems#Temp')

  • Create a simple order, with multiple taxes using aggregates.

    INSERT INTO Orders(LineAggregate, TaxAggregate) VALUES('[{\"variant_id\":\"4236041945111\",\"quantity\":2},{\"variant_id\":\"4236069011479\",\"quantity\":3}]', '[{\"price\":10.2,\"rate\":0.06,\"title\":\"State Tax\"},{\"price\":4.25,\"rate\":0.025,\"title\":\"County Tax\"}]')

  • Create a simple order, with multiple taxes using temporary table.

    INSERT INTO OrdersItems#Temp (ItemVariantId,ItemQuantity) VALUES ('4236041945111',2)
    INSERT INTO OrdersItems#Temp (ItemVariantId,ItemQuantity) VALUES ('4236069011479',3)
    INSERT INTO TaxItems#Temp (TaxItemPrice, TaxItemRate,TaxItemTitle) VALUES (10.2, 0.06, 'State Tax')
    INSERT INTO TaxItems#Temp (TaxItemPrice, TaxItemRate,TaxItemTitle) VALUES (4.25, 0.025, 'County Tax')
    INSERT INTO Orders (LineAggregate,TaxAggregate) VALUES ('OrdersItems#Temp','TaxItems#Temp')

  • Create a simple partially paid order containing a captured transaction using aggregates.

    INSERT INTO Orders(LineAggregate, FinancialStatus, TransactionAggregate) VALUES('[{\"title\":\"Big Brown Bear Boots\",\"price\":25.99,\"quantity\":2}]', 'partially_paid', '[{\"status\":\"success\",\"kind\":\"capture\",\"amount\":52.57,\"gateway\":\"bogus\"}]')

  • Create a simple partially paid order containing a captured transaction using temporary table.

    INSERT INTO OrdersItems#Temp (ItemTitle,ItemQuantity,ItemPrice) VALUES ('Big Brown Bear Boots',2,25.99)
    INSERT INTO Transactions#Temp (TransactionItemAmount, TransactionItemKind, TransactionItemStatus, TransactionItemGateway) VALUES (52.57, 'capture', 'success', 'bogus')
    INSERT INTO Orders (LineAggregate,FinancialStatus,TransactionAggregate) VALUES ('OrdersItems#Temp','partially_paid','Transactions#Temp')

  • Create a more comprehensive order using aggregates.

    INSERT INTO Orders(LineAggregate) VALUES([{\"title\":\"Big Brown Bear Boots\",\"price\":74.99,\"grams\":1300,\"quantity\":3}])

  • Create a more comprehensive order using temporary table.

    INSERT INTO OrdersItems#Temp (ItemTitle,ItemPrice,ItemGrams,ItemQuantity) VALUES ('Big Brown Bear Boots', 74.99, 1300, 3)
    INSERT INTO Orders (LineAggregate) VALUES ('OrdersItems#Temp')

  • Create a pending order with an existing customer using aggregates.

    INSERT INTO Orders(LineAggregate, CustomerId, FinancialStatus) VALUES('[{\"variant_id\":\"123\",\"quantity\":3}]', '456', 'pending')

  • Create a pending order with an existing customer using temporary table.

    INSERT INTO OrdersItems#Temp (ItemVariantId, ItemQuantity) VALUES ('123', 3)
    INSERT INTO Orders (LineAggregate,CustomerId, FinancialStatus) VALUES ('OrdersItems#Temp','456', 'pending')

  • Create a partially paid order with a new customer and addresses using aggregates.

    INSERT INTO Orders(LineAggregate, CustomerFirstName, CustomerLastName, CustomerEmail, FinancialStatus) VALUES('[{\"variant_id\":\"123\",\"quantity\":3}]', 'Paul', 'Norman', 'paul.norman@example.com', 'partially_paid')

  • Create a partially paid order with a new customer and addresses using temporary.

    INSERT INTO OrdersItems#Temp (ItemVariantId, ItemQuantity) VALUES ('123', 3)
    INSERT INTO Orders(LineAggregate, CustomerFirstName, CustomerLastName, CustomerEmail, FinancialStatus) VALUES('OrdersItems#Temp', 'Paul', 'Norman', 'paul.norman@example.com', 'partially_paid')

  • Close an order (you must specify the Id of the order).

      INSERT INTO Orders(Id, Operation) VALUES('123', 'Close')
      

  • Reopen an order (you must specify the Id of the order).

      INSERT INTO Orders(Id, Operation) VALUES('123', 'Open')
      

  • Cancel an order (you must specify the Id of the order).

      INSERT INTO Orders(Id, Operation) VALUES('123', 'Cancel')
      

Update

Only columns BuyerAcceptsMarketing, Email, Phone, Note, Tags, ShippingAddressFirstName, ShippingAddressLastName, ShippingAddressAddress1, ShippingAddressAddress2, ShippingAddressPhone, ShippingAddressCity, ShippingAddressCompany, ShippingAddressZip, ShippingAddressProvince, ShippingAddressCountry, ShippingAddressLatitude, ShippingAddressLongitude, ShippingAddressName, ShippingAddressCountryCode, ShippingAddressProvinceCode and ShippingAddressDefault can be updated.

  • Update the shipping address of an existing order.

    UPDATE Orders SET ShippingAddressAddress1='123 Ship Street', ShippingAddressCity='Shipsville' WHERE Id='123'

  • Update an order's tags.

    UPDATE Orders SET Tags='External, Inbound, Outbound' WHERE Id='123'

Delete

You must specify the Id of the order when deleting an item from this table.

DELETE FROM Orders WHERE Id='123'

Columns

Name Type ReadOnly References Description
Id [KEY] Long True

A unique numeric identifier for the order.

Number Long True

A unique identifier for the order, used by the shop owner and customer.

CustomerId Long False

Customers.Id

A unique numeric identifier for the customer.

CustomerFirstName String False

The first name of the customer.

CustomerLastName String False

The last name of the customer.

Currency String False

The three letter code (ISO 4217) for the currency used for the payment.

Email String False

The customer's email address.

Name String True

The customer's order name as represented by a number.

TotalDiscounts Decimal True

The total amount of the discounts to be applied to the price of the order.

TotalOrderItemsPrice Decimal True

The sum of all the prices of all the items in the order.

TotalPrice Decimal True

The sum of all the prices of all the items in the order, taxes and discounts included.

SubtotalPrice Decimal True

Price of the order before shipping and taxes.

TotalTax Decimal False

The sum of all the taxes applied to the order.

TotalWeight Integer True

The sum of all the weights of the line items in the order, in grams.

BrowserIp String True

The IP address of the browser used by the customer when placing the order.

BuyerAcceptsMarketing Boolean False

Indicates whether or not the person who placed the order would like to receive email updates from the shop.

CancelReason String True

The reason why the order was canceled.

CartToken String True

Unique identifier for a particular cart that is attached to a particular order.

OrderStatusUrl String True

The URL pointing to the order status web page.

Token String True

Unique identifier for a particular order.

TaxesIncluded Boolean False

States whether or not taxes are included in the order subtotal.

SourceName String True

Where the order originated.

ReferringSite String True

The website that the customer clicked on to come to the shop.

ProcessingMethod String True

States the type of payment processing method.

Phone String False

The customer's phone number.

Note String False

The text of an optional note that a shop owner can attach to the order.

LocationId Long True

The unique numeric identifier for the physical location at which the order was processed.

LandingSite String True

The URL for the page where the buyer landed when entering the shop.

Tags String False

Additional short descriptors.

FulfillmentStatus String False

The fulfillment status of the order.

FinancialStatus String False

The financial status of the order.

CustomerLocale String True

The customer locale of the order.

InvoiceSentAt Datetime True

This auto-generated property is the date and time when the invoice was emailed to the customer. Only available for draft orders.

InvoiceUrl String True

The URL for the invoice. Only available for draft orders.

TaxExempt Boolean True

States whether or not taxes are exempt for this order. Only available for draft orders.

DiscountCodes String True

Applicable discount codes that can be applied to the order.

LineAggregate String False

A JSON aggregate of line items associated with the order.

TaxAggregate String False

A JSON aggregate of tax line items associated with the order. Note, these taxes are applied on the order, not on individual items. If you want them to be applied on individual items, use them in LineAggregate. Tax lines must be associated with either order or line item but not both.

ShippingAggregate String False

A JSON aggregate of shipping line items associated with the order.

NoteAttributesAggregate String False

A JSON aggregate of note attributes associated with the order.

DiscountApplicationsAggregate String True

An ordered list of stacked discount applications.

BillingAddressFirstName String False

The first name of the person associated with the payment method.

BillingAddressLastName String False

The last name of the person associated with the payment method.

BillingAddressAddress1 String False

The street address of the billing address.

BillingAddressAddress2 String False

An optional additional field for the street address of the billing address.

BillingAddressPhone String False

The phone number at the billing address.

BillingAddressCity String False

The city of the billing address.

BillingAddressCompany String False

The company of the person associated with the billing address.

BillingAddressZip String False

The zip or postal code of the billing address.

BillingAddressProvince String False

The name of the state or province of the billing address.

BillingAddressCountry String False

The name of the country of the billing address.

BillingAddressLatitude Double False

The latitude of the billing address.

BillingAddressLongitude Double False

The longitude of the billing address.

BillingAddressName String False

The full name of the person associated with the payment method.

BillingAddressCountryCode String False

The two-letter code for the country of the billing address.

BillingAddressProvinceCode String False

The two-letter abbreviation of the state or province of the billing address.

BillingAddressDefault Boolean False

Whether this address is the default one or not.

ShippingAddressFirstName String False

The first name of the person associated with the shipping method.

ShippingAddressLastName String False

The last name of the person associated with the shipping method.

ShippingAddressAddress1 String False

The street address of the shipping address.

ShippingAddressAddress2 String False

An optional additional field for the street address of the shipping address.

ShippingAddressPhone String False

The phone number at the shipping address.

ShippingAddressCity String False

The city of the shipping address.

ShippingAddressCompany String False

The company of the person associated with the shipping address.

ShippingAddressZip String False

The zip or postal code of the shipping address.

ShippingAddressProvince String False

The name of the state or province of the shipping address.

ShippingAddressCountry String False

The name of the country of the shipping address.

ShippingAddressLatitude Double False

The latitude of the shipping address.

ShippingAddressLongitude Double False

The longitude of the shipping address.

ShippingAddressName String False

The full name of the person associated with the shipping method.

ShippingAddressCountryCode String False

The two-letter code for the country of the shipping address.

ShippingAddressProvinceCode String False

The two-letter abbreviation of the state or province of the shipping address.

ShippingAddressDefault Boolean False

Whether this address is the default one or not.

AppliedDiscountTitle String False

The title of the applied discount for this order. Only available for draft orders.

AppliedDiscountDescription String False

The description of the applied discount for order. Only available for draft orders.

AppliedDiscountValue Decimal False

The value of the applied discount for this order. Only available for draft orders.

AppliedDiscountValueType String False

The value type of the applied discount for order. Only available for draft orders.

AppliedDiscountAmount Decimal False

The amount of the applied discount for this order. Only available for draft orders.

PaymentTermsAmount Long True

The amount that is owed according to the payment terms.

PaymentTermsCurrency String True

The presentment currency for the payment.

PaymentTermsPaymentTermsName String True

The name of the selected payment terms template for the order.

PaymentTermsPaymentTermsType String True

The type of selected payment terms template for the order.

PaymentTermsDueInDays Integer True

The number of days between the invoice date and due date that is defined in the selected payment terms template.

PaymentTermsPaymentSchedules String True

An array of schedules associated to the payment terms.

ProcessedAt Datetime True

The date and time when the order was imported, in ISO 8601 format.

CreatedAt Datetime True

The date and time when the order was created.

ClosedAt Datetime True

The date and time when the order was closed.

CancelledAt Datetime True

The date and time when the order was canceled.

UpdatedAt Datetime True

The date and time when the order was last modified.

SendReceipt Boolean False

Determines whether an order confirmation will be sent to the customer.

The default value is false.

SendFulfillmentReceipt Boolean False

Determines whether a fulfillment confirmation will be sent to the customer.

The default value is false.

InventoryBehaviour String False

Determines which inventory updating behavior is used. The following values are available: default, decrement_ignoring_policy, decrementobeying_policy

The allowed values are default, decrement_ignoring_policy, decrementobeying_policy.

The default value is default.

Operation String False

An operation to apply to the Order. Valid values for order: Close, Open, or Cancel.

The allowed values are Close, Open, Cancel.

TotalShippingPriceSetShopMoneyAmount Double True

The amount of the shop money in the total shipping price set.

TotalShippingPriceSetShopMoneyCurrencyCode String True

The currency code of the shop money in the total shipping price set.

Pseudo-Columns

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.

Name Type Description
Status String

Filter orders by their status. Valid values are: open: show only open orders, closed: show only closed orders, cancelled: show only canceled orders, any: show orders of any status,default: open.

Copyright (c) 2023 CData Software, Inc. - All rights reserved.
Build 22.0.8462