SQL examples for SQL Server
The ZappySys API Driver is a user-friendly interface designed to facilitate the seamless integration of various applications with the Stripe API. With its intuitive design and robust functionality, the ZappySys API Driver simplifies the process of configuring specific API endpoints to efficiently read or write data from Stripe.
On this page you will find some SQL examples which can be used for API ODBC Driver or Data Gateway API Connector.
Get all Customers
Read all customers
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Customers';
EXEC (@MyQuery) AT [LS_TO_STRIPE_IN_GATEWAY];
Learn more about this SQL query.
Get a Customer
Read a customer
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Customers
WHERE Id = ''abc''';
EXEC (@MyQuery) AT [LS_TO_STRIPE_IN_GATEWAY];
Learn more about this SQL query.
Get Customers (Filter by Date)
Using date time requires yyyy-MM-dd format usage
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Customers
WHERE Created > ''2010-01-01''';
EXEC (@MyQuery) AT [LS_TO_STRIPE_IN_GATEWAY];
Learn more about this SQL query.
Insert a Customer
Insert a customer
DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO Customers
([Name]
, [Email]
, [Description]
, [Phone]
, [Balance]
, [AddressLine1]
, [AddressLine2]
, [AddressCity]
, [AddressState]
, [AddressCountry]
, [AddressPostalCode]
, [InvoicePrefix]
)
VALUES(''Cust-1''
, ''email@abc.com''
, ''Some desc''
, ''+1 222-333-4444''
, 0
, ''55 Main St.''
, ''Suite 100''
, ''New York''
, ''NY''
, ''USA''
, ''07204'' --JSON fragment
, ''INVC''
)';
EXEC (@MyQuery) AT [LS_TO_STRIPE_IN_GATEWAY];
Learn more about this SQL query.
Update a Customer
Update a customer
DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE Customers
SET Name=''Cust1-Updated''
, Email=''a-updated@b.com''
, Phone=''+1 800-123-2345''
, Description=''Desc-updated''
, AddressLine1=''Line-1-upd''
, AddressLine2=''Line-2-upd''
, AddressCity=''SomeCity''
, AddressState=''NY''
, AddressCountry=''USA''
, AddressPostalCode=''112233''
, ShippingPhone=''+1 800-123-2345''
, ShippingName=''SHName-upd''
, ShippingAddressLine1=''Line-1-upd''
, ShippingAddressLine2=''Line-2-upd''
, ShippingAddressCity=''SomeCity''
, ShippingAddressState=''NY''
, ShippingAddressCountry=''USA''
, ShippingAddressPostalCode=''112233''
, Balance=100
WHERE Id=''cus_IcUG2lD69ZHuol''';
EXEC (@MyQuery) AT [LS_TO_STRIPE_IN_GATEWAY];
Learn more about this SQL query.
Delete a Customer
Delete a customer by Id
DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE FROM Customers
WHERE Id = ''abc''';
EXEC (@MyQuery) AT [LS_TO_STRIPE_IN_GATEWAY];
Learn more about this SQL query.
Get all Products
Read all products
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Products';
EXEC (@MyQuery) AT [LS_TO_STRIPE_IN_GATEWAY];
Learn more about this SQL query.
Get a Product
Read a product
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Products
WHERE Id = ''abc''';
EXEC (@MyQuery) AT [LS_TO_STRIPE_IN_GATEWAY];
Learn more about this SQL query.
Update a Product
Read a product
DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE Products
SET [name] = ''new name''
WHERE Id = ''abc''';
EXEC (@MyQuery) AT [LS_TO_STRIPE_IN_GATEWAY];
Learn more about this SQL query.
Inserts a Product
Inserts a product
DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO Products
( [Name]
, [Caption]
, [Description]
, [Type]
--, [UnitLabel] --only when product type=service
, [Active]
, [PackageDimensionsHeight]
, [PackageDimensionsWidth]
, [PackageDimensionsLength]
, [PackageDimensionsWeight]
, [URL]
, [Image1]
, [Image2]
, [Image3]
)
VALUES(''SSIS PowerPack 3''
, ''SSIS Caption 3''
, ''SSIS PowerPack description long ....''
, ''good'' --or service
--, ''Unit label'' --only when product type=service
, ''True'' --active ?
, ''12''
, ''13''
, ''14''
, ''1000''
, ''https://zappysys.com/products/ssis-powerpack/''
, ''https://zappysys.com/images/tech/web-api-logo.png''
, ''https://zappysys.com/images/tech/xml-logo.png''
, ''https://zappysys.com/images/tech/salesforce-logo.png''
)';
EXEC (@MyQuery) AT [LS_TO_STRIPE_IN_GATEWAY];
Learn more about this SQL query.
Update a Product
Product Update example. When supply Image1,Image2... it will reset previous images.
DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE Products
SET [Name]=''SSIS PowerPack 3 - Updated''
, [Caption]=''Caption-updated''
, [Description]=''Desc-updated''
--, [UnitLabel] --only when product type=service
, [Active]=''true''
, [PackageDimensionsHeight]=12
, [PackageDimensionsWidth]=13
, [PackageDimensionsLength]=14
, [PackageDimensionsWeight]=1122
, [URL]=''https://zappysys.com/products/ssis-powerpack/?updated=1''
, [Image1]=''https://zappysys.com/images/tech/web-api-logo.png?updated=1''
, [Image2]=''https://zappysys.com/images/tech/xml-logo.png?updated=1''
WHERE Id=''prod_MiSJzGZ8PDM9uh''';
EXEC (@MyQuery) AT [LS_TO_STRIPE_IN_GATEWAY];
Learn more about this SQL query.
Delete a Product
Delete a product
DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE FROM Products
WHERE Id = ''abc''';
EXEC (@MyQuery) AT [LS_TO_STRIPE_IN_GATEWAY];
Learn more about this SQL query.
Get all Invoices
Read all invoices
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Invoices';
EXEC (@MyQuery) AT [LS_TO_STRIPE_IN_GATEWAY];
Learn more about this SQL query.
Get an Invoice
Read an invoice
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Invoices
WHERE Id = ''abc''';
EXEC (@MyQuery) AT [LS_TO_STRIPE_IN_GATEWAY];
Learn more about this SQL query.
Get all Invoice Line Items
Read all Invoice Line Items
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM InvoiceItems';
EXEC (@MyQuery) AT [LS_TO_STRIPE_IN_GATEWAY];
Learn more about this SQL query.
Get an Invoice Line Item
Read an invoice line item by Id
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM InvoiceItems
WHERE Id = ''abc''';
EXEC (@MyQuery) AT [LS_TO_STRIPE_IN_GATEWAY];
Learn more about this SQL query.
Insert an Invoice
Insert an invoice
DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO Invoices([Customer],[AmountRemaining])
VALUES (''cus_LqWX1s0E32JJeZL'', 12345)';
EXEC (@MyQuery) AT [LS_TO_STRIPE_IN_GATEWAY];
Learn more about this SQL query.
Update an Invoice
Update an invoice
DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE Invoices
SET [DaysUntilDue] = 20
WHERE Id = ''abc''';
EXEC (@MyQuery) AT [LS_TO_STRIPE_IN_GATEWAY];
Learn more about this SQL query.
Delete an invoice
Delete an invoice
DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE FROM Invoices
WHERE Id = ''abc''';
EXEC (@MyQuery) AT [LS_TO_STRIPE_IN_GATEWAY];
Learn more about this SQL query.
Getting Started with Examples
ZappySys API Driver is a powerful software solution designed to facilitate the extraction and integration of data from a wide range of sources through APIs. Its intuitive design and extensive feature set make it an essential asset for any organization dealing with complex data integration tasks.
To get started with examples using ZappySys API Driver, please click on the following applications:
Key features of the ZappySys API Driver include:
The API ODBC driver facilitates the reading and writing of data from numerous popular online services (refer to the complete list here) using familiar SQL language without learning complexity of REST API calls. The driver allows querying nested structure and output as a flat table. You can also create your own ODBC / Data Gateway API connector file and use it with this driver.
Intuitive Configuration: The interface is designed to be user-friendly, enabling users to easily set up the specific API endpoints within Stripe without requiring extensive technical expertise or programming knowledge.
Customizable Endpoint Setup: Users can conveniently configure the API endpoint settings, including the HTTP request method, endpoint URL, and any necessary parameters, to precisely target the desired data within Stripe.
Data Manipulation Capabilities: The ZappySys API Driver allows for seamless data retrieval and writing, enabling users to fetch data from Stripe and perform various data manipulation operations as needed, all through an intuitive and straightforward interface.
Secure Authentication Integration: The driver provides secure authentication integration, allowing users to securely connect to the Stripe API by inputting the necessary authentication credentials, such as API tokens or other authentication keys.
Error Handling Support: The interface is equipped with comprehensive error handling support, ensuring that any errors or exceptions encountered during the data retrieval or writing process are efficiently managed and appropriately communicated to users for prompt resolution.
Data Visualization and Reporting: The ZappySys API Driver facilitates the seamless processing and presentation of the retrieved data from Stripe, enabling users to generate comprehensive reports and visualizations for further analysis and decision-making purposes.
Overall, the ZappySys API Driver serves as a powerful tool for streamlining the integration of applications with Stripe, providing users with a convenient and efficient way to access and manage data, all through a user-friendly and intuitive interface.