Reference

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
UPDATE
UPSERT
DELETE
LOOKUP get_order

Examples

SSIS

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

Read from Orders table using API Source

API Source - FastSpring
Read and write FastSpring data effortlessly. Integrate, manage, and automate orders, subscriptions, quotes, products, and accounts — almost no coding required.
FastSpring
Orders
There are no parameters to configure.
SSIS API Source - Read from table or endpoint

Read/write to Orders table using API Destination

API Destination - FastSpring
Read and write FastSpring data effortlessly. Integrate, manage, and automate orders, subscriptions, quotes, products, and accounts — almost no coding required.
FastSpring
Orders
Select
There are no parameters to configure.
SSIS API Destination - Access table operation

ODBC application

Use these SQL queries in your ODBC application data source:

Read orders

SELECT * FROM Orders

Read single order by ID

SELECT * FROM Orders WHERE Id='zzzzzzzzzz'

Read orders with date range

SELECT * FROM Orders WITH(StartDate='2020-01-01', EndDate='2021-12-31')

Read orders placed in last 30 days

SELECT * FROM Orders 
--WHERE Currency='USD' AND TotalInPayoutCurrency>=1599
WITH(StartDate='today-30day', EndDate='today') --try today, yesterday, yearstart, yearend, monthstart, monthend, yearstart-1y so on

List orders for a subscription

SELECT * FROM Orders 
WHERE SubscriptionId_1='iBPfMFS6TZSxrLzSOrq8PQ' 
	OR SubscriptionId_2='iBPfMFS6TZSxrLzSOrq8PQ'
	OR SubscriptionId_3='iBPfMFS6TZSxrLzSOrq8PQ' 
ORDER BY OrderDate

Get all accounts

SELECT *
FROM Accounts	

SELECT "Id"
	, "ContactFirst"
	, "ContactLast"
	, "ContactEmail"
	, "ContactCompany"
	, "ContactPhone"
	, "ContactSubscribed"
	, "AddressLine1"
	, "AddressLine2"
	, "City"
	, "Region"
	, "RegionCustom"
	, "PostalCode"
	, "AddressCompany"
	, "Language"
	, "Country"
	, "LookupGlobal"
	, "Url"
	, "PaymentMethods"
	, "PaymentActive"
	, "Orders"
	, "Subscriptions"
	, "Charges"
	, "Subscribed"
	, "TaxExemptionData"
FROM Accounts

--Use WITH clause --OR-- Key column(s) in WHERE clause
--WHERE [Id] = 'abcd'

--search by one or more parameters below
/*
WITH(
	  Email='X'
	, CustomKey='X'
	, GlobalKey='X'
	, OrderID='X'
	, OrderReference='X'
	, SubscriptionId='X'
	, Products='PROD-1,PROD-2,PROD-3'
	, Refunds='true'
	, SubscriptionStatus='active'
)
*/

SQL Server

Use these SQL queries in SQL Server after you create a data source in Data Gateway:

Read orders

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Orders';

EXEC (@MyQuery) AT [LS_TO_FASTSPRING_IN_GATEWAY];

Read single order by ID

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Orders WHERE Id=''zzzzzzzzzz''';

EXEC (@MyQuery) AT [LS_TO_FASTSPRING_IN_GATEWAY];

Read orders with date range

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Orders WITH(StartDate=''2020-01-01'', EndDate=''2021-12-31'')';

EXEC (@MyQuery) AT [LS_TO_FASTSPRING_IN_GATEWAY];

Read orders placed in last 30 days

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Orders 
--WHERE Currency=''USD'' AND TotalInPayoutCurrency>=1599
WITH(StartDate=''today-30day'', EndDate=''today'') --try today, yesterday, yearstart, yearend, monthstart, monthend, yearstart-1y so on';

EXEC (@MyQuery) AT [LS_TO_FASTSPRING_IN_GATEWAY];

List orders for a subscription

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Orders 
WHERE SubscriptionId_1=''iBPfMFS6TZSxrLzSOrq8PQ'' 
	OR SubscriptionId_2=''iBPfMFS6TZSxrLzSOrq8PQ''
	OR SubscriptionId_3=''iBPfMFS6TZSxrLzSOrq8PQ'' 
ORDER BY OrderDate';

EXEC (@MyQuery) AT [LS_TO_FASTSPRING_IN_GATEWAY];

Get all accounts

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT *
FROM Accounts	

SELECT "Id"
	, "ContactFirst"
	, "ContactLast"
	, "ContactEmail"
	, "ContactCompany"
	, "ContactPhone"
	, "ContactSubscribed"
	, "AddressLine1"
	, "AddressLine2"
	, "City"
	, "Region"
	, "RegionCustom"
	, "PostalCode"
	, "AddressCompany"
	, "Language"
	, "Country"
	, "LookupGlobal"
	, "Url"
	, "PaymentMethods"
	, "PaymentActive"
	, "Orders"
	, "Subscriptions"
	, "Charges"
	, "Subscribed"
	, "TaxExemptionData"
FROM Accounts

--Use WITH clause --OR-- Key column(s) in WHERE clause
--WHERE [Id] = ''abcd''

--search by one or more parameters below
/*
WITH(
	  Email=''X''
	, CustomKey=''X''
	, GlobalKey=''X''
	, OrderID=''X''
	, OrderReference=''X''
	, SubscriptionId=''X''
	, Products=''PROD-1,PROD-2,PROD-3''
	, Refunds=''true''
	, SubscriptionStatus=''active''
)
*/';

EXEC (@MyQuery) AT [LS_TO_FASTSPRING_IN_GATEWAY];