CData Cloud は、クラウドホスト型のソリューションで、複数の標準サービスやプロトコルにまたがるSquare へのアクセスを実現します。SQL Server データベースに接続できるアプリケーションであれば、CData Cloud を介してSquare に接続できます。
CData Cloud により、他のOData エンドポイントや標準SQL Server と同じように、Square への接続を標準化し、構成することができます。
このページでは、CData Cloud でのSquare への接続の確立 のガイド、利用可能なリソースに関する情報、および使用可能な接続プロパティのリファレンスについて説明します。
接続の確立 は、CData Cloud にデータベースを作成するためのSquare への認証方法と必要な接続プロパティの設定方法について示します。
利用可能な標準サービスを経由してSquare からデータにアクセスする方法と、CData Cloud の管理については、CData Cloud ドキュメント で詳しく説明します。
Database タブで対応するアイコンを選択して、Square に接続します。必須プロパティはSettings にリストされています。Advanced タブには、通常は必要ない接続プロパティが表示されます。
上記のいずれの方法も、CData Square ドライバーに組み込まれたOAuth 機能を使用します。
接続の前に
サンドボックスに接続するには、サンドボックスのアクセストークンを取得してOAuthAccessToken 接続プロパティをそのトークンに設定します。
以下のサブセクションでは、3つの一般的な認証フローでのSquare への認証について詳しく説明します。
カスタムOAuth アプリケーションの作成方法と、組み込みOAuth 認証情報を持つ認証フローでもカスタムOAuth アプリケーションを作成したほうがよい場合の説明については、カスタムOAuth アプリケーションの作成 を参照してください。
Square で利用可能な接続文字列プロパティの全リストは、Connection を参照してください。
アクセストークンの期限が切れたときは、Cloud は自動でアクセストークンをリフレッシュします。
OAuth アクセストークンの自動リフレッシュ:
Cloud がOAuth アクセストークンを自動的にリフレッシュするようにするには、次のように設定します。
OAuth アクセストークンの手動リフレッシュ:
OAuth アクセストークンを手動でリフレッシュするために必要な唯一の値は、OAuth リフレッシュトークンです。
OAuth リフレッシュトークンを保存し、OAuth アクセストークンの有効期限が切れた後に手動でリフレッシュできるようにします。
デフォルトでは、Cloud はサーバーとのTLS のネゴシエーションを試みます。サーバー証明書は、デフォルトのシステム信頼済み証明書ストアで検証されます。SSLServerCert 接続プロパティを使用して、証明書の検証方法をオーバーライドできます。
別の証明書を指定するには、SSLServerCert 接続プロパティを参照してください。
HTTP プロキシへの認証には、以下のように設定します。
次のプロパティを設定します。
The CData Cloud models the Square APIs as relational tables, views, and stored procedures. These are defined in schema files, which are simple, text-based configuration files.
テーブル describes the available tables such as Vendors, Invoices or Subscriptions.
ビュー describes the available views. Views are statically defined to entities such as Payouts, SubscriptionEvents, and LocationBookingProfiles.
ストアドプロシージャ are function-like interfaces to Square. Stored procedures allow you to execute operations to Square, including attaching documents or images to an invoice and canceling a subscription.
The Cloud offloads as much of the SELECT statement processing as possible to the Square APIs and then processes the rest of the query within the Cloud. The following sections document API limitations, requirements, or particularities.
You can query tables/views from different business locations by specifying multiple LocationIds in the "IN" operator. Note however that for tables/views like Customers, Employees, Orders, and OrderItems, this is not possible.
SELECT * FROM Transactions WHERE LocationId IN ('CBASEDbVhLxAJeGrBRLi-BxZ3XcgAQ','CBASEGJDarn_hucmacLdA_iGNGwgAQ','CBASEFsuPlSmrLHXu9a5Lmlv4D4gAQ')
Cloud はSquare のデータを、標準のSQL ステートメントを使用してクエリできるリレーショナルデータベースのテーブルのリストとしてモデル化します。
| Name | Description |
| Cards | Creates, updates, deletes, and retrieves customer‑linked or merchant‑linked cards in Square. Includes cardholder details, billing address, expiration dates, brand information, and card usage status. |
| CatalogCategories | Query the available catalog categories. |
| CatalogDiscounts | Query the available catalog discounts. |
| CatalogImages | Query the available catalog images. |
| CatalogItems | Retrieves detailed information about each item in a Square seller's catalog, including names, descriptions, pricing variations, availability, and location settings. |
| CatalogItemVariations | Query the available item variations. |
| CatalogModifierLists | Query the available catalog modifier lists. |
| CatalogModifiers | Retrieves detailed information about modifiers associated with Square catalog items, including pricing, availability, and location-specific settings. Modifiers represent add‑ons, options, or customizations that can be applied to an item during checkout. |
| CatalogTaxes | Query the available catalog taxes. |
| CustomerGroups | Retrieves, creates, updates, deletes customer groups of a business. |
| Customers | Create, update, delete, and query the available customers in Square. |
| DeviceCodes | Creates and lists DeviceCode that can be used to login to a Square Terminal device to enter the connected terminal mode. |
| GiftCardActivities | Creates and lists gift card activities. |
| GiftCards | Retrieves, creates, and updates gift card records in Square, including card type, balance, state, account details, and customer associations. |
| InventoryChanges | Query historical physical counts and adjustments on inventory items. |
| Invoices | Create, configure, and publish invoices for orders that were created. |
| Locations | Query Location information for a Merchant. |
| PaymentLinks | Lists, Creates, Updates, Deletes payment links. |
| Payments | Retrieves card payments processed through Square. Does not include cash or other non‑card tenders. |
| Refunds | Creates and retrieves details for refunds issued by a merchant or their staff within a specified date range. Includes refund amounts, payment references, processing fees, destination details, and status tracking. |
| Shifts | Create, update, delete, and query the available shifts in Square. |
| Subscriptions | Creates and manages customer subscriptions in Square, including plan details, billing settings, payment methods, and subscription lifecycle status. |
| Teams | Query the available list of TeamMember for a business in Square. |
| Vendors | Create, update, and query the available Vendors in Square. |
Creates, updates, deletes, and retrieves customer‑linked or merchant‑linked cards in Square. Includes cardholder details, billing address, expiration dates, brand information, and card usage status.
The Cloud uses the Square API to process search criteria , while other filters are processed client side within the Cloud.
Select all Cards:
SELECT * FROM Cards
Select a Card using its Id:
SELECT * FROM Cards WHERE Id = 'ccof:CA4SENQvtCYtXFkIKLHESty7dn0oAg';
Select all Cards from a specific customer:
SELECT * FROM Cards WHERE CustomerId = 'CBASEPlKoFeu4nWm0MX_oHdklAIgAQ'
Select all Cards matching a 'ReferenceId':
SELECT * FROM Cards WHERE ReferenceId = 'myrefid';
By default, only enabled cards are returned. To fetch disabled cards also, use the 'IncludeDisabled' pseudo-column:
SELECT * FROM Cards WHERE IncludeDisabled = true;
To create a card, you will need to specify CustomerId, IdempotencyKey and SourceId.
INSERT INTO Cards (IdempotencyKey, SourceId, CustomerId, BillingAddressAddressLine1, BillingAddressAddressLine2, BillingAddressLocality, BillingAddressPostalCode, BillingAddressCountry, CardholderName) VALUES ('aa8f236c-13a6-42fe-a17e-4edf6caa2035', 'fake-card-nonce-ok', 'CBASEPlKoFeu4nWm0MX_oHdklAIgAQ', '500 Electric Ave', 'Suite 600', 'New York', '94103', 'US', 'CardholderName')
Use the DELETE operation to disable a Card. Cards can be disabled using their Id.
DELETE FROM Cards WHERE Id = 'eKoFeu4nWm0MX_oed'
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
Unique Id for the card, generated by Square. |
| BillingAddressAddressLine1 | String | False |
The first line of the billing address. |
| BillingAddressAddressLine2 | String | False |
The second line of the address, if applicable. |
| BillingAddressAddressLine3 | String | False |
The third line of the address, if applicable. |
| BillingAddressAdministrativeDistrictLevel1 | String | False |
Top‑level administrative region in the billing address (for example, U.S. state). |
| BillingAddressCountry | String | False |
The address's country, in the two-letter format of ISO 3166. |
| BillingAddressLocality | String | False |
The city or town of the address. |
| BillingAddressSubLocality | String | False |
A civil region within the address's locality, if applicable. |
| BillingAddressPostalCode | String | False |
The address's postal code. |
| Bin | String | True |
The first six digits of the card number, known as the Bank Identification Number (BIN). |
| CardBrand | String | True |
The card's brand. |
| CardType | String | True |
Card classification, such as CREDIT or DEBIT. |
| CardholderName | String | False |
The name of the cardholder. |
| CustomerId | String | False |
The Id of a customer created using the Customers API to be associated with the card. |
| MerchantId | String | True |
The Id of the merchant associated with the card. |
| Enabled | Boolean | True |
Indicates whether or not a card can be used for payments. |
| ExpMonth | Integer | False |
The expiration month of the associated card as an integer between 1 and 12. |
| ExpYear | Integer | False |
The four-digit year of the card's expiration date. |
| Fingerprint | String | True |
The unique string fingerprint for the card. The fingerprint is based on the credit card number and is unique to the merchant. If a card is used at multiple locations for the same merchant, it will have the same fingerprint in each case. |
| Last4 | String | True |
The last 4 digits of the card number. |
| PrepaidType | String | True |
Indicates whether the card is prepaid or not. |
| ReferenceId | String | False |
An optional, user-defined reference Id that associates this card with another entity in an external system. |
| Version | Int64 | False |
Current version number of the card. |
| IdempotencyKey | String | False |
A unique string that identifies this CreateCard request. |
| SourceId | String | False |
The Id of the source which represents the card information to be stored. This can be a card nonce or a payment Id. |
| VerificationToken | String | False |
An identifying token generated by Payments.verifyBuyer(). |
| CardCoBrand | String | True |
Current version number of the card. |
| BillingAddressAdministrativeDistrictLevel2 | String | False |
A civil entity within the address's administrative_district_level_1. In the US, this is the county. |
| BillingAddressAdministrativeDistrictLevel3 | String | False |
A civil entity within the address's administrative_district_level_2, if applicable. |
| BillingAddressSubLocality2 | String | False |
A civil region within the address's sublocality, if applicable. |
| BillingAddressSubLocality3 | String | False |
A civil region within the address's sublocality_2, if applicable. |
| BillingAddressFirstName | String | False |
First name in the billing address. |
| BillingAddressLastName | String | False |
Last name in the billing address. |
| IssuerAlert | String | True |
An alert from the issuing bank about the card status. Alerts can indicate whether future charges to the card are likely to fail. |
| IssuerAlertAt | Datetime | True |
The timestamp of when the current issuer alert was received and processed. |
| HsaFsa | Boolean | True |
Indicates whether the card is linked to a Health Savings Account (HSA) or Flexible Spending Account (FSA), based on the card BIN. |
Pseudo column fields are used in the WHERE clause of SELECT statements (unless stated otherwise) and offer a more granular control over the tuples that are returned from the data source.
| Name | Type | Description |
| IncludeDisabled | Boolean |
When set to true, includes disabled cards in query results. By default, only enabled cards are returned. |
Query the available catalog categories.
Retrieve all catalog categories:
SELECT * FROM CatalogCategories
To create an item, you will need to specify the Name column.
INSERT INTO CatalogCategories (Name) VALUES ('Cat Created 2') Modify the details of an existing CatalogCategories by providing the Id of the Categories:
UPDATE CatalogCategories SET Name = 'Cat Updated' WHERE ID = '1234'
Delete a category object by providing the Id of the Categories:
DELETE FROM CatalogCategories WHERE Id = '32123'
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | False |
The category's ID. |
| Name | String | False |
The category's name. |
| UpdatedAt | Datetime | False |
Last modification timestamp. |
| IsDeleted | Boolean | False |
If true, the object has been deleted from the database. When deleted, the UpdatedAt field will equal the deletion time. |
| PresentAtAllLocations | Boolean | False |
If true, this object is present at all locations (including future locations), except where specified in the AbsentAtLocationIds field. If false, this object is not present at any locations (including future locations), except where specified in the PresentAtLocationIds field. If not specified, defaults to true. |
| PresentAtLocationIds | String | False |
A list of locations where the object is present, even if PresentAtAllLocations is false. |
| AbsentAtLocationIds | String | False |
A list of locations where the object is not present, even if PresentAtAllLocations is true. |
| Version | Int64 | False |
The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting. |
| CreatedAt | Datetime | True |
Created timestamp. |
| CategoryIsTopLevel | Boolean | False |
Is Top Level. |
| CatalogV1Ids | String | True |
The Connect v1 IDs for this object at each location where it is present, where they differ from the object's Connect V2 ID. |
Query the available catalog discounts.
Retrieve all catalog discounts:
SELECT * FROM CatalogDiscounts
To create an item, you will need to specify the DiscountType, Name, Amount and Currency columns.
INSERT INTO CatalogDiscounts (PINRequired, DiscountType, Name, Amount, Currency) VALUES (false, 'FIXED_PERCENTAGE', 'Special_Discount1', '200000', 'USD')
To Update an item, you will need to specify the Id column.
UPDATE CatalogDiscounts SET amount = 1234, currency = 'USD' WHERE Id = '1234'
Delete a discount object by providing the Id of the discount object:
DELETE FROM CatalogDiscounts WHERE Id = '32123'
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | False |
The discount's ID. |
| Name | String | False |
The discount's name. |
| UpdatedAt | Datetime | False |
Last modification timestamp. |
| IsDeleted | Boolean | False |
If true, the object has been deleted from the database. When deleted, the UpdatedAt field will equal the deletion time. |
| DiscountType | String | False |
Indicates whether the discount is a fixed amount or percentage, or entered at the time of sale. |
| Percentage | String | False |
The percentage of the discount as a string representation of a decimal number, using a . as the decimal separator and without a % sign. A value of 7.5 corresponds to 7.5%. Specify a percentage of 0 if DiscountType is VARIABLE_PERCENTAGE. |
| Amount | Integer | False |
The discount's amount. |
| Currency | String | False |
The discount's money currency. |
| PinRequired | Boolean | False |
Indicates whether a mobile staff member needs to enter their PIN to apply the discount to a payment in the Square Point of Sale app. |
| LabelColor | String | False |
The color of the discount's display label in the Square Point of Sale app. |
| PresentAtAllLocations | Boolean | False |
If true, this object is present at all locations (including future locations), except where specified in the AbsentAtLocationIds field. If false, this object is not present at any locations (including future locations), except where specified in the PresentAtLocationIds field. If not specified, defaults to true. |
| PresentAtLocationIds | String | False |
A list of locations where the object is present, even if PresentAtAllLocations is false. |
| AbsentAtLocationIds | String | False |
A list of locations where the object is not present, even if PresentAtAllLocations is true. |
| Version | Int64 | False |
The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting. |
| CreatedAt | Datetime | True |
Created timestamp. |
| CatalogV1Ids | String | True |
The Connect v1 IDs for this object at each location where it is present, where they differ from the object's Connect V2 ID. |
Query the available catalog images.
Retrieve all catalog images:
SELECT * FROM CatalogImages
Modify the details of an existing catalog by providing the Id of the Images:
UPDATE CatalogImages SET Name = 'Cat Updated' WHERE ID = '1234'
Delete a category object by providing the Id of the Images:
DELETE FROM CatalogImages WHERE Id = '32123'
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | False |
The image file ID. |
| Name | String | False |
The internal name of this image. |
| UpdatedAt | Datetime | False |
Last modification timestamp. |
| IsDeleted | Boolean | False |
If true, the object has been deleted from the database. When deleted, the UpdatedAt field will equal the deletion time. |
| URL | String | False |
The URL of this image. |
| Caption | String | False |
A caption that describes what is shown in the image. Displayed in the Square Online Store. |
| PresentAtAllLocations | Boolean | False |
If true, this object is present at all locations (including future locations), except where specified in the AbsentAtLocationIds field. If false, this object is not present at any locations (including future locations), except where specified in the PresentAtLocationIds field. If not specified, defaults to true. |
| PresentAtLocationIds | String | False |
A list of locations where the object is present, even if PresentAtAllLocations is false. |
| AbsentAtLocationIds | String | False |
A list of locations where the object is not present, even if PresentAtAllLocations is true. |
| Version | Int64 | False |
The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting. |
| CreatedAt | Datetime | True |
Created timestamp. |
Retrieves detailed information about each item in a Square seller's catalog, including names, descriptions, pricing variations, availability, and location settings.
Retrieve all catalog items:
SELECT * FROM CatalogItems
To create an item, you will need to specify the Name and Variations columns. All the fields that are not read-only can be specified. You can supply a value to the Variations by passing aggregates or using #TEMP tables.
INSERT INTO CatalogItemVariations#TEMP (Name, PricingType) VALUES ('variationname1', 'VARIABLE_PRICING');
INSERT INTO CatalogItemVariations#TEMP (Name, PricingType) VALUES ('variationname2', 'VARIABLE_PRICING');
INSERT INTO CatalogItemVariations#TEMP (Name, PricingType) VALUES ('variationname3', 'VARIABLE_PRICING');
INSERT INTO CatalogItems (Name, DescriptionHtml, Variations) VALUES ('newname2', 'item desc', CatalogItemVariations#TEMP); Creating an item, by specifying aggregate columns. You must supply the TemporaryItemId pseudo-column with the value of the 'item_id' field of the variations.
INSERT INTO CatalogItems (Name, DescriptionHtml, TemporaryItemId, Variations) VALUES ('newname', 'item desc', '#temporaryId', '[ { "type": "ITEM_VARIATION", "is_deleted": false, "catalog_v1_ids": [ { "catalog_v1_id": "2255feb6-157b-4d8c-b8da-79a30523c67c", "location_id": "9J0M984DXGA7W" } ], "present_at_all_locations": false, "present_at_location_ids": [ "9J0M984DXGA7W" ], "id": "#red", "item_variation_data": { "item_id": "#temporaryId", "name": "Small 55", "sku": "1", "ordinal": 1, "pricing_type": "FIXED_PRICING", "price_money": { "amount": 200, "currency": "USD" }, "channels": [ "CH_0RauN49qbI5pcbqhVJDJi5H7qfkJuvBygSTD3QlQuYC" ] } } ]');
Modify the details of an existing catalog by providing the Id of the Items object:
UPDATE CatalogItems SET DescriptionHtml = 'TestDesc1', Name = 'TestName1', Abbreviation = 'TestAbbreviation1', AvailableForPickup = true WHERE ID = 'KAT75OWHFBAMA3GYS2LU32L5';
INSERT INTO CatalogItemVariations#TEMP (Id, PricingType, PriceMoneyAmount, PriceMoneyCurrency, Version) VALUES ('QXSMA2IIPLOU4L5LNVSWCLD6', 'FIXED_PRICING', 10, 'USD', 1690797325339);
UPDATE CatalogItems SET Variations = 'CatalogItemVariations#TEMP', DescriptionHtml = 'TestDesc1', Name = 'TestName1', Abbreviation = 'TestAbbreviation1', AvailableForPickup = true WHERE ID = 'KAT75OWHFBAMA3GYS2LU32L5';
Delete a item object by providing the Id of the customer:
DELETE FROM CatalogItems WHERE Id = '5XZRRMRESJ6N6CGQQ6BFA7AG'
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
The item's Id. |
| Name | String | False |
The item's name. |
| UpdatedAt | Datetime | True |
Date and time when the item was last modified. |
| IsDeleted | Boolean | False |
If true, the object has been deleted from the database. When deleted, the UpdatedAt field will equal the deletion time. |
| DescriptionHtml | String | False |
The item's description as expressed in valid HTML elements. |
| DescriptionPlaintext | String | True |
A server-generated plaintext version of the description_html field, without formatting tags. |
| Abbreviation | String | False |
The text of the item's display label in the Square Point of Sale app. Only up to the first five characters of the string are used. |
| LabelColor | String | False |
The color of the item's display label in the Square Point of Sale app. |
| AvailableOnline | Boolean | False |
If true, the item can be added to shipping orders from the merchant's online store. |
| AvailableForPickup | Boolean | False |
If true, the item can be added to pickup orders from the merchant's online store. |
| AvailableElectronically | Boolean | False |
If true, the item can be added to electronically fulfilled orders from the merchant's online store. |
| Categories | String | False |
The list of categories. |
| TaxIds | String | False |
A set of tax identifiers indicating the CatalogTaxes that are enabled for this item. |
| ModifierListInfo | String | False |
Info about the modifier lists that apply to this item. |
| ProductType | String | False |
The product type of the item. May not be changed once an item has been created. |
| SkipModifierScreen | Boolean | False |
If true, the Square Point of Sale app will immediately add the item to the cart with the pre-selected modifiers, and merchants can edit modifiers by drilling down onto the item's details. |
| PresentAtAllLocations | Boolean | False |
If true, this object is present at all locations (including future locations), except where specified in the AbsentAtLocationIds field. If false, this object is not present at any locations (including future locations), except where specified in the PresentAtLocationIds field. If not specified, defaults to true. |
| PresentAtLocationIds | String | False |
A list of locations where the object is present, even if PresentAtAllLocations is false. |
| AbsentAtLocationIds | String | False |
A list of locations where the object is not present, even if PresentAtAllLocations is true. |
| Version | Int64 | False |
The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting. |
| ImageIds | String | False |
A list of image object identifiers that are linked to the item. |
| Variations | String | False |
It represents a product for sale in the Catalog object model. While updating, provide the whole Variations aggregate object otherwise it will override with the new value. |
| CreatedAt | Datetime | True |
Date and time when the item was first created in the catalog. |
| CatalogV1Ids | String | True |
The Connect v1 IDs for this object at each location where it is present, where they differ from the object's Connect V2 ID. |
| Channels | String | True |
A list of identifiers representing channels, such as a Square Online site, where the item can be made visible or available. |
| EcomAvailable | Boolean | False |
True if the item can be sold through Square’s eCommerce integrations. |
| EcomImageURIs | String | True |
List of image URIs associated with the item for Square Online listings. |
| EcomVisibility | String | True |
Specifies whether the item is visible to customers in the online store (for example, public or hidden). |
| IsTaxable | Boolean | False |
Indicates whether the item is taxable (true) or non-taxable (false). |
| Visibility | String | False |
Defines how the item is displayed in sales channels (for example, visible to all or hidden from customers). |
| ItemOptions | String | False |
List of item options identifiers for this item. Used to manage and group item variations in a specified order. |
| SortName | String | False |
A name to sort the item by. If this name is unspecified, namely, the sort_name field is absent, the regular name field is used for sorting. Its value must not be empty. |
| IsArchived | Boolean | False |
Indicates whether this item is archived (true) or not (false). |
| EcomSeoDataPageTitle | String | False |
The SEO title used for the Square Online store. |
| EcomSeoDataPageDescription | String | False |
The SEO title description for the Square Online store. |
| EcomSeoDataPagePermalink | String | False |
The SEO title permalink for the Square Online store. |
| FoodAndBeverageDetailsCalorieCount | Integer | False |
The calorie count (in the unit of kcal) for the FOOD_AND_BEV type of items. |
| FoodAndBeverageDetailsDietaryPreferences | String | False |
The dietary preferences for the FOOD_AND_BEV item. |
| FoodAndBeverageDetailsIngredients | String | False |
The ingredients for the FOOD_AND_BEV type item. |
| ReportingCategoryId | String | False |
The Id of the object's reporting category. |
| ReportingCategoryOrdinal | Int64 | False |
The order of the object within the context of the reporting category. |
Pseudo column fields are used in the WHERE clause of SELECT statements (unless stated otherwise) and offer a more granular control over the tuples that are returned from the data source.
| Name | Type | Description |
| TemporaryItemId | String |
When inserting variations using aggregates, supply it with the value of the 'item_id' of the variations. |
Query the available item variations.
Retrieve all catalog item variations:
SELECT * FROM CatalogItemVariations
To create an item variation, you will need to specify the ItemId, PricingType, PriceMoneyAmount and PriceMoneyCurrency column, or ItemId and PricingType if PricingType is set to VARIABLE_PRICING.
All the fields that are not read-only can be specified.
INSERT INTO CatalogItemVariations (ItemId, PricingType, PriceMoneyAmount, PriceMoneyCurrency) VALUES ('2I2UELJL4543VQJF4D4EU3EJO', 'FIXED_PRICING', 1, 'USD') Creating an item variation, by specifying aggregate columns.
INSERT INTO CatalogItemVariations (ItemId, Name, PricingType, PriceMoneyAmount, PriceMoneyCurrency, SKU, Upc, Ordinal, LocationOverrides, TrackInventory, InventoryAlertType, InventoryAlertThreshold, UserData, ServiceDuration, PresentAtAllLocations, AbsentAtLocationIds) VALUES ('YC77SWXPJLTUFUHCCYSGYMYD', 'MyItemVariations14', 'FIXED_PRICING', 1, 'USD', 'testSKU', 'testUPC', '2',
'[
{
"inventory_alert_threshold": 1,
"location_id": "92BYHNBR6W77E",
}
]',
true, 'LOW_QUANTITY', 3, 'test', 3, false,
'[
"92BYHNBR6W77E"
]')
Create an Item variation using TEMP Table.
INSERT INTO catalogitemvariations (name, PricingType, itemid, pricemoneyamount, pricemoneycurrency) VALUES ('hello', 'FIXED_PRICING', 'GZSJP2V2SE4KS2ZU7AJCLX5P', 19900, USD
INSERT INTO catalogitemvariations (name, PricingType, itemid, pricemoneyamount, pricemoneycurrency) VALUES ('test55', 'FIXED_PRICING', 'RSQPFRKIZZFWO3IV3UX3M5LM', 20001, USD
INSERT INTO CatalogItems (Name, Description, ModifierListInfo) VALUES ('Jeep Rentals NEW', 'Our Daily Jeep Rates', 'CatalogItemVariations#TEMP'
To Update an item, you will need to specify the Id column.
UPDATE CatalogItemVariations SET name = 'TestName1', PricingType = 'FIXED_PRICING', PriceMoneyAmount = 1010, PriceMoneyCurrency = 'USD', ItemId = 'OLCXWRVE7JD22TCS6NIRST6G', UserData = 'SEASONAL = TRUE' WHERE id = 'WNT7535N7AEJHJBMLRGGZXIK'
Delete a discount object by providing the Id of the discount object:
DELETE FROM CatalogItemVariations WHERE Id = '32123'
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | False |
The item variation's ID. |
| ItemId [KEY] | String | False |
The ID of the CatalogItem associated with this item variation. |
| Name | String | False |
The item variation's name. |
| UpdatedAt | Datetime | True |
Last modification timestamp. |
| IsDeleted | Boolean | False |
If true, the object has been deleted from the database. When deleted, the UpdatedAt field will equal the deletion time. |
| Sku | String | False |
The item variation's SKU. |
| Upc | String | False |
The item variation's UPC. |
| Ordinal | Integer | False |
The order in which this item variation should be displayed. |
| PricingType | String | False |
Indicates whether the item variation's price is fixed or determined at the time of sale. |
| PriceMoneyAmount | Integer | False |
The item variation's price amount, if fixed pricing is used. |
| PriceMoneyCurrency | String | False |
The item variation's price currency, if fixed pricing is used. |
| LocationOverrides | String | False |
Per-location price and inventory overrides. |
| TrackInventory | Boolean | False |
If true, inventory tracking is active for the variation. |
| InventoryAlertType | String | False |
Indicates whether the item variation displays an alert when its inventory quantity is less than or equal to its InventoryAlertThreshold. |
| InventoryAlertThreshold | Integer | False |
If the inventory quantity for the variation is less than or equal to this value and InventoryAlertType is LOW_QUANTITY, the variation displays an alert in the merchant dashboard. |
| UserData | String | False |
Arbitrary user metadata to associate with the item variation. |
| ServiceDuration | Integer | False |
If the CatalogItem that owns this item variation is of type APPOINTMENTS_SERVICE, then this is the duration of the service in milliseconds. |
| CatalogMeasurementUnitId | String | True |
Represents the unit used to measure a CatalogItemVariation and specifies the precision for decimal quantities. |
| MeasurementUnitId | String | False |
ID of the 'CatalogMeasurementUnit' that is used to measure the quantity sold of this item variation. If left unset, the item will be sold in whole quantities. |
| PresentAtAllLocations | Boolean | False |
If true, this object is present at all locations (including future locations), except where specified in the AbsentAtLocationIds field. If false, this object is not present at any locations (including future locations), except where specified in the PresentAtLocationIds field. If not specified, defaults to true. |
| PresentAtLocationIds | String | False |
A list of locations where the object is present, even if PresentAtAllLocations is false. |
| AbsentAtLocationIds | String | False |
A list of locations where the object is not present, even if PresentAtAllLocations is true. |
| Version | Int64 | False |
The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting. |
| Type | String | False |
The item variation's type. |
| CreatedAt | Datetime | True |
Created timestamp. |
| CatalogV1Ids | String | True |
The Connect v1 IDs for this object at each location where it is present, where they differ from the object's Connect V2 ID. |
| Channels | String | True |
A list of IDs representing channels, such as a Square Online site, where the item can be made visible or available. |
Query the available catalog modifier lists.
Retrieve all catalog modifier lists:
SELECT * FROM CatalogModifierLists
To create an item, you will need to specify the Name column and modifier object.
INSERT INTO CatalogModifierLists (Name, selectiontype, Modifiers) VALUES ('Type', 'MULTIPLE', '[\n" +
"\t{\n" +
"\t \"id\" : \"DSVHFBTUXMNTKUFSXMODS7HO\",\n" +
" \"type\": \"MODIFIER\",\n" +
" \"version\": 1489411961853,\n" +
" \"modifier_data\":{\n" +
"\t \"name\" : \"4 floor\",\n" +
"\t \"on_by_default\": false,\n" +
" \"price_money\": {\n" +
" \"currency\": \"USD\",\n" +
" \"amount\": 23900\n" +
" }\n" +
" }\n" +
" }]' Create a modifierlist object using TEMP table.
INSERT INTO CatalogModifiers#TEMP (Id, Type, Version, Name, PriceMoneyCurrency, PriceMoneyAmount) VALUES ('Y2R6VS3ZCF4GCLO2IJBJWMYR', 'MODIFIER', 1591591604813, '4 door', 'USD', 23900)
INSERT INTO CatalogModifierLists (Name, SelectionType, Modifiers) VALUES ('Type Updated', 'MULTIPLE', 'CatalogModifiers#TEMP' To Update an item, you will need to specify the Id column.
UPDATE CatalogModifierLists SET Name = 'list1' WHERE Id = '1234'
Delete a modifierlist object by providing the Id of the modifierlist:
DELETE FROM CatalogModifierLists WHERE Id = '32123'
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | False |
The CatalogModifierList's ID. |
| Name | String | False |
The CatalogModifierList's name. |
| UpdatedAt | Datetime | False |
Last modification timestamp. |
| IsDeleted | Boolean | False |
If true, the object has been deleted from the database. When deleted, the UpdatedAt field will equal the deletion time. |
| Modifiers | String | False |
The options included in the CatalogModifierList. Each CatalogObject must have type MODIFIER and contain CatalogModifier data. |
| PresentAtAllLocations | Boolean | False |
If true, this object is present at all locations (including future locations), except where specified in the AbsentAtLocationIds field. If false, this object is not present at any locations (including future locations), except where specified in the PresentAtLocationIds field. If not specified, defaults to true. |
| PresentAtLocationIds | String | False |
A list of locations where the object is present, even if PresentAtAllLocations is false. |
| AbsentAtLocationIds | String | False |
A list of locations where the object is not present, even if PresentAtAllLocations is true. |
| SelectionType | String | False |
Indicates whether multiple options from the modifier list can be applied to a single CatalogItem.. |
| Version | Int64 | False |
The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting. |
| CreatedAt | Datetime | True |
Created timestamp. |
| CatalogV1Ids | String | True |
The Connect v1 IDs for this object at each location where it is present, where they differ from the object's Connect V2 ID. |
Retrieves detailed information about modifiers associated with Square catalog items, including pricing, availability, and location-specific settings. Modifiers represent add‑ons, options, or customizations that can be applied to an item during checkout.
To retrieve all catalog modifiers:
SELECT * FROM CatalogModifiers;
To create a modifier, provide the Id of the modifier list you want to add the modifier into:
INSERT INTO CatalogModifiers (Name, PriceMoneyAmount, PriceMoneyCurrency, CatalogModifierListId, OnByDefault, PresentAtLocationIds) values ('Test', 1243, 'USD', 'RI7JDHAXMAWFJVT6JQZ7MHVX', false, '[\"92BYHNBR6W77E\"]');
To modify the details of an existing catalog modifier, provide the Id of the modifier and the Id of its corresponding modifier list:
UPDATE CatalogModifiers Set Name = 'Test', PriceMoneyAmount = 97, PresentAtLocationIds = '[\"92BYHNBR6W77E\", \"9J0M984DXGA7W\"]' where Id = 'JAB5HHFFEZX5JNJHV6RNSHLL' AND CatalogModifierListId = 'RIBNJ7ZR5DUURES7TFYVDDH2';
To delete a catalog modifier object, provide the Id of the object:
DELETE FROM CatalogModifiers WHERE Id = '32123';
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | False |
Unique identifier for the modifier. Used to reference the modifier in orders, updates, or inventory adjustments. |
| Name | String | False |
Display name of the modifier as shown in Point of Sale, online store, or receipts. |
| UpdatedAt | Datetime | False |
Date and time when the modifier was last updated, such as a price change or name edit. |
| IsDeleted | Boolean | False |
If true, the object has been deleted from the database. When deleted, the UpdatedAt field will equal the deletion time. |
| PriceMoneyAmount | Integer | False |
Monetary amount added or subtracted from the base item price when the modifier is selected. |
| PriceMoneyCurrency | String | False |
The modifier's price currency. |
| PresentAtAllLocations | Boolean | False |
If true, this object is present at all locations (including future locations), except where specified in the AbsentAtLocationIds field. If false, this object is not present at any locations (including future locations), except where specified in the PresentAtLocationIds field. If not specified, defaults to true. |
| PresentAtLocationIds | String | False |
A list of locations where the object is present, even if PresentAtAllLocations is false. |
| AbsentAtLocationIds | String | False |
A list of locations where the object is not present, even if PresentAtAllLocations is true. |
| Version | Int64 | False |
The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting. |
| CreatedAt | Datetime | True |
Date and time when the modifier was created in the catalog. |
| CatalogV1Ids | String | True |
The Connect v1 IDs for this object at each location where it is present, where they differ from the object's Connect V2 ID. |
| OnByDefault | Boolean | False |
If true, this CatalogModifier should be selected by default for this CatalogItem. |
| Ordinal | Integer | True |
The position of this CatalogItemModifierListInfo object within the modifier_list_info list applied to a CatalogItem instance |
| Type | String | True |
The catalog object type to be modified. |
| CatalogModifierListId | String | False |
The catalog modifier list's Id in which the catalog modifier object belongs to. |
Query the available catalog taxes.
Retrieve all catalog taxes:
SELECT * FROM CatalogTaxes
To create an item, you will need to specify the Name column.
INSERT INTO CatalogTaxes (Name) VALUES ('Cat Created 2') Modify the details of an existing CatalogTaxes by providing the Id of the tax:
UPDATE CatalogTaxes SET Name = 'Cat Updated' WHERE ID = '1234'
Delete a category object by providing the Id of the Categories:
DELETE FROM CatalogTaxes WHERE Id = '32123'
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | False |
The Id of the tax. |
| Name | String | False |
The tax's name. |
| UpdatedAt | Datetime | False |
Last modification timestamp. |
| IsDeleted | Boolean | False |
If true, the object has been deleted from the database. When deleted, the UpdatedAt field will equal the deletion time. |
| CalculationPhase | String | False |
Whether the tax is calculated based on a payment's subtotal or total. |
| InclusionType | String | False |
Whether the tax is ADDITIVE or INCLUSIVE. |
| Percentage | String | False |
The percentage of the discount as a string representation of a decimal number, using a . as the decimal separator and without a % sign. A value of 7.5 corresponds to 7.5%. |
| AppliesToCustomAmounts | Boolean | False |
If true, the fee applies to custom amounts entered into the Square Point of Sale app that are not associated with a particular CatalogItem. |
| Enabled | Boolean | False |
If true, the tax will be shown as enabled in the Square Point of Sale app. |
| PresentAtAllLocations | Boolean | False |
If true, this object is present at all locations (including future locations), except where specified in the AbsentAtLocationIds field. If false, this object is not present at any locations (including future locations), except where specified in the PresentAtLocationIds field. If not specified, defaults to true. |
| PresentAtLocationIds | String | False |
A list of locations where the object is present, even if PresentAtAllLocations is false. |
| AbsentAtLocationIds | String | False |
A list of locations where the object is not present, even if PresentAtAllLocations is true. |
| Version | Int64 | False |
The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting. |
| CreatedAt | Datetime | True |
Created timestamp. |
| CatalogV1Ids | String | True |
The Connect v1 IDs for this object at each location where it is present, where they differ from the object's Connect V2 ID. |
Retrieves, creates, updates, deletes customer groups of a business.
The Cloud uses the Square API to process search criteria that refer to the Id column, while other filters are processed client side within the Cloud.
Retrieve all CustomerGroups.
SELECT * from CustomerGroups
Retrieve a specific customer group as identified by the Id column.
SELECT * from CustomerGroups where id = '6Q87X9N44ACHCSX1NJSEQMAVAJ'
To create a customer group, you will need to specify the name value of the group.
INSERT INTO CustomerGroups(Name) values('TestName') Modify the details of an existing Customer group by providing the Id of the Customer group.
UPDATE CustomerGroups SET Name = 'Name@01' where id = '6Q87X9N44ACHCSX1NJSEQMAVAJ'
Delete a customer group by providing the Id of the customer group.
DELETE from CustomerGroups where id = '2T3JZYXKYBV2YN48JSNXPKFAQF'
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
A unique Square-generated ID for the customer group. |
| Name | String | False |
The name of the customer group. |
| CreatedAt | Datetime | True |
The timestamp when the customer group was created, in RFC 3339 format. |
| UpdatedAt | Datetime | True |
The timestamp when the customer group was last updated, in RFC 3339 format. |
Create, update, delete, and query the available customers in Square.
The Cloud uses the Square API to process search criteria that refer to the Id column, while other filters are processed client side within the Cloud.
Retrieve all customers:
SELECT * FROM Customers
Retrieve only one customer:
SELECT * FROM Customers WHERE Id = '0SY145EEWD0YXCW489VV386KH8'
To create a customer, you will need to specify at least one of the following values: GivenName, FamilyName, CompanyName, EmailAddress, and PhoneNumber.
INSERT INTO Customers (GivenName, FamilyName, Email, PhoneNumber, AddressLine1, AddressLine2, AddressLocality, AddressAdministrativeDistrictLevel1, AddressPostalCode, AddressCountry) VALUES ('John', 'Doe', '[email protected]', '1-212-555-4240', '500 Electric Ave', 'Suite 600', 'New York', 'NY', '10003', 'US')
Modify the details of an existing customer by providing the Id of the customer:
UPDATE Customers SET GivenName = 'Amelia', FamilyName = 'Earhart' WHERE Id = '32123'
Delete a customer from a business, along with any linked cards on file, by providing the Id of the customer:
DELETE FROM Customers WHERE Id = '32123'
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
The Id of the customer. |
| GivenName | String | False |
The customer's given (i.e., first) name. |
| FamilyName | String | False |
The customer's family (i.e., last) name. |
| Nickname | String | False |
The customer's nickname. |
| String | False |
The customer's email address. | |
| CompanyName | String | False |
The name of the customer's company. |
| PhoneNumber | String | False |
The customer's phone number. |
| AddressLine1 | String | False |
The first line of the address. |
| AddressLine2 | String | False |
The second line of the address. |
| AddressLine3 | String | False |
The third line of the address. |
| AddressLocality | String | False |
The city or town of the address. |
| AddressSubLocality | String | False |
A civil region within the address's locality. |
| AddressSubLocality2 | String | False |
A civil region within the address's sublocality. |
| AddressSubLocality3 | String | False |
A civil region within the address's sublocality_2. |
| AddressAdministrativeDistrictLevel1 | String | False |
A civil entity within the address's country. In the US, this is the state. |
| AddressAdministrativeDistrictLevel2 | String | False |
A civil entity within the address's administrative_district_level_1. In the US, this is the county. |
| AddressAdministrativeDistrictLevel3 | String | False |
A civil entity within the address's administrative_district_level_2. |
| AddressPostalCode | String | False |
The address's postal code. |
| AddressCountry | String | False |
The address's country, in ISO 3166-1-alpha-2 format. |
| AddressFirstName | String | False |
Optional first name when it's representing recipient. |
| AddressLastName | String | False |
Optional last name when it's representing recipient. |
| AddressOrganization | String | False |
Optional organization name when it's representing recipient. |
| Birthday | String | False |
The birthday associated with the customer profile, in RFC 3339 format. Year is optional, timezone and times are not allowed |
| CreatedAt | Datetime | True |
The time when the customer was created. |
| UpdatedAt | Datetime | True |
The time when the customer was last updated. |
| ReferenceId | String | False |
A second ID you can set to associate the customer with an entity in another system. |
| Note | String | False |
A note to associate with the customer. |
| CardsAggregate | String | True |
The non-confidential details of the customer's cards on file. |
| Preferences | String | True |
The customer's preferences. |
| Segments | String | True |
The IDs of segments the customer belongs to. |
| CreationSource | String | True |
The method used to create the customer profile. |
| GroupIds | String | True |
The IDs of customer groups the customer belongs to. |
| Version | Int64 | False |
The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting. |
| TaxIds | String | True |
The tax ID associated with the customer profile. |
Creates and lists DeviceCode that can be used to login to a Square Terminal device to enter the connected terminal mode.
The Cloud uses the Square API to process search criteria that refer to the Id column, while other filters are processed client side within the Cloud.
Retrieve all DeviceCodes associated with the merchant.
SELECT * from DeviceCodes
Retrieve a DeviceCode with the associated ID.
SELECT * from DeviceCodes where id = 'E4RB0XKDX01A1'
To create a device code, you will need to specify the targeting product type of the device code.
INSERT INTO DeviceCodes(ProductType, Name) Values('TERMINAL_API','TestName@001')
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
The unique id for this device code. |
| Name | String | False |
An optional user-defined name for the device code. |
| Code | String | True |
The unique code that can be used to login. |
| DeviceId | String | True |
The unique id of the device that used this code. Populated when the device is paired up. |
| ProductType | String | False |
The targeting product type of the device code. |
| LocationId | String | False |
The location assigned to this code. |
| PairBy | String | True |
When this DeviceCode will expire and no longer login. Timestamp in RFC 3339 format. |
| CreatedAt | String | True |
When this DeviceCode was created. Timestamp in RFC 3339 format. |
| StatusChangedAt | String | True |
When this DeviceCode's status was last changed. Timestamp in RFC 3339 format. |
| PairedAt | String | True |
When this DeviceCode was paired. Timestamp in RFC 3339 format. |
| Status | String | True |
The pairing status of the device code. |
Creates and lists gift card activities.
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
The Square-assigned ID of the gift card activity. |
| Type | String | False |
The type of gift card activity. |
| LocationId | String | False |
The ID of the business location where the activity occurred. |
| GiftCardId | String | False |
The gift card ID. When creating a gift card activity, gift_card_id is not required if gift_card_gan is specified. |
| GiftCardAccountNumber | String | False |
The gift card account number (GAN). When creating a gift card activity, gift_card_gan is not required if gift_card_id is specified. |
| GiftCardBalanceMoneyAmount | Int64 | True |
The final balance amount on the gift card after the action is completed. |
| GiftCardBalanceMoneyCurrency | String | True |
The type of balance amount currency, in ISO 4217 format. |
| CreatedAt | Datetime | True |
The timestamp when the gift card activity was created, in RFC 3339 format. |
| GiftCardActivityLoadMoneyAmount | Int64 | False |
The amount of money added to the gift card. This value is a positive integer. |
| GiftCardActivityLoadMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. |
| GiftCardActivityLoadOrderId | String | False |
The ID of the order that contains the GIFT_CARD line item. |
| GiftCardActivityLoadLineItemUid | String | False |
The UID of the GIFT_CARD line item in the order that represents the additional funds for the gift card. |
| GiftCardActivityLoadReferenceId | String | False |
A client-specified ID that associates the gift card activity with an entity in another system. |
| GiftCardActivityLoadBuyerPaymentInstrumentIds | String | False |
The payment instrument IDs used to process the order for the additional funds, such as a credit card ID or bank account ID. |
| GiftCardActivityActivateMoneyAmount | Int64 | False |
The amount of money added to the gift card. This value is a positive integer. |
| GiftCardActivityActivateMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. |
| GiftCardActivityActivateOrderId | String | False |
The ID of the order that contains the GIFT_CARD line item. |
| GiftCardActivityActivateLineItemUid | String | False |
The UID of the GIFT_CARD line item in the order that represents the gift card purchase. |
| GiftCardActivityActivateReferenceId | String | False |
A client-specified ID that associates the gift card activity with an entity in another system. |
| GiftCardActivityActivateBuyerPaymentInstrumentIds | String | False |
The payment instrument IDs used to process the gift card purchase, such as a credit card ID or bank account ID. |
| GiftCardActivityRedeemMoneyAmount | Int64 | False |
The amount of money deducted from the gift card for the redemption. This value is a positive integer. |
| GiftCardActivityRedeemMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. |
| GiftCardActivityRedeemMoneyPaymentId | String | False |
The ID of the payment that represents the gift card redemption. |
| GiftCardActivityRedeemMoneyReferenceId | String | False |
A client-specified ID that associates the gift card activity with an entity in another system. |
| GiftCardActivityRedeemMoneyStatus | String | False |
The status of the gift card redemption. |
| GiftCardActivityClearBalanceReason | String | False |
The reason the gift card balance was cleared. |
| GiftCardActivityDeactivateReason | String | False |
The reason the gift card was deactivated. |
| GiftCardActivityAdjustIncrementMoneyAmount | Int64 | False |
The amount of money added to the gift card balance. This value is a positive integer. |
| GiftCardActivityAdjustIncrementMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. |
| GiftCardActivityAdjustIncrementReason | String | False |
The reason the gift card balance was adjusted. |
| GiftCardActivityAdjustDecrementMoneyAmount | Int64 | False |
The amount of money deducted from the gift card balance. This value is a positive integer. |
| GiftCardActivityAdjustDecrementMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. |
| GiftCardActivityAdjustDecrementReason | String | False |
The reason the gift card balance was adjusted. |
| GiftCardActivityRefundRedeemActivityId | String | False |
The ID of the refunded REDEEM gift card activity. |
| GiftCardActivityRefundMoneyAmount | Int64 | False |
The amount of money added to the gift card for the refund. This value is a positive integer. |
| GiftCardActivityRefundMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. |
| GiftCardActivityRefundReferenceId | String | False |
A client-specified ID that associates the gift card activity with an entity in another system. |
| GiftCardActivityRefundPaymentId | String | False |
The ID of the refunded payment. |
| GiftCardActivityUnlinkedActivityRefundMoneyAmount | Int64 | False |
The amount added to the gift card for the refund. This value is a positive integer. |
| GiftCardActivityUnlinkedActivityRefundMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. |
| GiftCardActivityUnlinkedActivityRefundReferenceId | String | False |
A client-specified ID that associates the gift card activity with an entity in another system. |
| GiftCardActivityUnlinkedActivityRefundPaymentId | String | False |
The ID of the refunded payment. |
| GiftCardActivityImportMoneyAmount | Int64 | False |
The balance amount on the imported gift card. |
| GiftCardActivityImportMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. |
| GiftCardActivityBlockReason | String | False |
The reason the gift card was blocked. |
| GiftCardActivityUnblockReason | String | False |
The reason the gift card was unblocked. |
| GiftCardActivityImportReversalMoneyAmount | Int64 | False |
The amount of money cleared from the third-party gift card when the import was reversed. |
| GiftCardActivityImportReversalMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. |
| GiftCardActivityTransferBalanceToTransferFromGiftCardId | String | False |
The ID of the gift card from which the specified amount was transferred. |
| GiftCardActivityTransferBalanceToMoneyAmount | Int64 | False |
The amount of money added to the gift card balance for the transfer. This value is a positive integer. |
| GiftCardActivityTransferBalanceToMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. |
| GiftCardActivityTransferBalanceFromTransferToGiftCardId | String | False |
The ID of the gift card to which the specified amount was transferred. |
| GiftCardActivityTransferBalanceFromMoneyAmount | Int64 | False |
The amount of money deducted from the gift card for the transfer. This value is a positive integer. |
| GiftCardActivityTransferBalanceFromMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. |
Retrieves, creates, and updates gift card records in Square, including card type, balance, state, account details, and customer associations.
The Cloud uses the Square API to process search criteria that refer to the Id column, while other filters are processed client side within the Cloud.
Retrieve all GiftCards:
SELECT * from GiftCards
Retrieve a gift card using the gift card ID:
SELECT * from GiftCards where id = 'gftc:3c0c38e043a742c58431e3cca603c5b9'
To create a gift card, you need to specify the LocationId and gift card type. LocationId is a pseudocolumn used only while creating a new gift card:
INSERT INTO GiftCards(LocationId, Type) VALUES('92BYHNBR6W77E','DIGITAL')
The LocationId column is only allowed for INSERT operations.
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
The Square-assigned Id of the gift card. |
| Type | String | False |
The gift card type (for example, physical or digital). |
| GiftCardAccountNumberSource | String | False |
The source that generated the gift card account number (GAN). The default value is SQUARE. |
| State | String | True |
The current status of the gift card (for example, active, inactive, redeemed, or deactivated). |
| BalanceMoneyAmount | Int64 | True |
The current gift card balance amount. This balance is always greater than or equal to zero. |
| BalanceMoneyCurrency | String | True |
The currency code for the balance amount, in ISO 4217 format (for example, USD or CAD). |
| GiftCardAccountNumber | String | False |
The gift card account number (GAN). Buyers can use the GAN to make purchases or check the gift card balance. |
| CreatedAt | Datetime | True |
The timestamp when the gift card was created, in RFC 3339 format. In the case of a digital gift card, it is the time when you create a card (using the Square Point of Sale application, Seller Dashboard, or Gift Cards API). |
| CustomerIds | String | True |
The Ids of the customer profiles to whom this gift card is linked. |
Pseudo column fields are used in the WHERE clause of SELECT statements (unless stated otherwise) and offer a more granular control over the tuples that are returned from the data source.
| Name | Type | Description |
| LocationId | String |
The Id of the location where the gift card should be registered for reporting purposes. Allowed only for performing INSERT operations. |
Query historical physical counts and adjustments on inventory items.
The Cloud uses the Square API to process search criteria that refer to the Type, CatalogObjectId, State and LocationId column, while other filters are processed client side within the Cloud.
Select all the inventory changes:
SELECT * FROM InventoryChanges
Select all the inventory changes from a specific location ID:
SELECT * FROM InventoryChanges WHERE LocationId = 'Sandbox_Location_Id'
Select all the inventory changes with a specific type:
SELECT * FROM InventoryChanges WHERE Type = 'ADJUSTMENT'
Select all the inventory changes in a specific state:
SELECT * FROM InventoryChanges WHERE State = 'IN_STOCK'
Select all the inventory changes for a specific catalog object:
SELECT * FROM InventoryChanges WHERE CatalogObjectId = '5QJP4XMEN5TQ4W4UY7YL'
To create an inventory change, you will need to specify the Type, CatalogObjectId, Quantity column.
Insert an inventory change of type 'PHYSICAL_COUNT' :
INSERT INTO InventoryChanges (Type, CatalogObjectId, State, Quantity) VALUES ('PHYSICAL_COUNT', '5QJP4XMEN5TQ4W4UY7YL', 'IN_STOCK', 16)
Insert an inventory change of type 'ADJUSTMENT' :
INSERT INTO InventoryChanges (Type, CatalogObjectId, FromState, ToState, Quantity) VALUES ('ADJUSTMENT', '5QJP4XMEN5TQ4W4UY7YL', 'IN_STOCK', 'SOLD', 5)
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | False |
A unique Id generated by Square for the inventory change record. |
| ReferenceId | String | False |
An optional Id provided by the application to tie the inventory change to an external system. |
| Type | String | False |
Indicates how the inventory change was applied. 使用できる値は次のとおりです。PHYSICAL_COUNT, ADJUSTMENT |
| CatalogObjectId | String | False |
Id of the catalog object being tracked. |
| CatalogObjectType | String | False |
The CatalogObjectType of the CatalogObject being tracked. Tracking is only supported for the ITEM_VARIATION type. |
| State | String | False |
The current InventoryState for the related quantity of items. |
| LocationId | String | False |
The Square Id of the location where the related quantity of items are being tracked. |
| Quantity | String | False |
The number of items affected by the physical count as a decimal string. |
| EmployeeId | String | False |
The Square Id of the Employee responsible for the physical count. |
| OccurredAt | Datetime | False |
A client-generated timestamp in RFC 3339 format that indicates when the physical count took place. For write actions, the occurred_at timestamp cannot be older than 24 hours or in the future relative to the time of the request. |
| CreatedAt | Datetime | False |
A read-only timestamp in RFC 3339 format that indicates when Square received the physical count. |
| FromState | String | False |
Inventory state of the related quantity of items before the adjustment. |
| ToState | String | False |
Inventory state of the related quantity of items before the adjustment. |
| TotalPriceMoneyAmount | Integer | False |
The amount of the total price paid for goods associated with the adjustment. Present if and only if to_state is SOLD. Always non-negative. |
| TotalPriceMoneyCurrency | String | False |
The currency of the total price paid for goods associated with the adjustment. Present if and only if to_state is SOLD. Always non-negative. |
| TransactionId | String | False |
The read-only Square Id of the [Transaction][#type-transaction] that caused the adjustment. Only relevant for payment-related state transitions. |
| RefundId | String | False |
The read-only Square Id of the Transaction that caused the adjustment. Only relevant for payment-related state transitions. |
| PurchaseOrderId | String | False |
The read-only Square Id of the Refund that caused the adjustment. Only relevant for refund-related state transitions. |
| GoodsReceiptId | String | False |
The read-only Square Id of the Square goods receipt that caused the adjustment. Only relevant for state transitions from the Square for Retail app. |
| FromLocationId | String | False |
The Square Id of the location where the related quantity of items were tracked before the transfer. |
| ToLocationId | String | False |
The Square Id of the location where the related quantity of items were tracked before the transfer. |
| TeamMemberId | String | False |
The Square-generated Id of the team member responsible for the physical count. |
| SourceProduct | String | True |
The product type of the application. 使用できる値は次のとおりです。SQUARE_POS, EXTERNAL_API, BILLING, APPOINTMENTS, INVOICES, ONLINE_STORE, PAYROLL, DASHBOARD, ITEM_LIBRARY_IMPORT, OTHER |
| SourceApplicationId | String | True |
The Square-assigned Id of the application. This field is used only if the product type is EXTERNAL_API. |
| SourceName | String | True |
The display name of the application. |
| AdjustmentGroupId | String | True |
A unique Id generated by Square for the adjustment group. |
| AdjustmentGroupRootAdjustmentId | String | True |
The inventory adjustment Id for the composed variation. |
| AdjustmentGroupFromState | String | True |
Representative from_state for adjustments within the group. 使用できる値は次のとおりです。CUSTOM, IN_STOCK, SOLD, RETURNED_BY_CUSTOMER, RESERVED_FOR_SALE, SOLD_ONLINE, ORDERED_FROM_VENDOR, RECEIVED_FROM_VENDOR, IN_TRANSIT_TO, NONE, WASTE, UNLINKED_RETURN, COMPOSED, DECOMPOSED, SUPPORTED_BY_NEWER_VERSION, IN_TRANSIT |
| AdjustmentGroupToState | String | True |
Representative to_state for adjustments within group. 使用できる値は次のとおりです。CUSTOM, IN_STOCK, SOLD, RETURNED_BY_CUSTOMER, RESERVED_FOR_SALE, SOLD_ONLINE, ORDERED_FROM_VENDOR, RECEIVED_FROM_VENDOR, IN_TRANSIT_TO, NONE, WASTE, UNLINKED_RETURN, COMPOSED, DECOMPOSED, SUPPORTED_BY_NEWER_VERSION, IN_TRANSIT |
| MeasurementUnitMeasurementUnitCustomUnitName | String | True |
The name of the custom unit. |
| MeasurementUnitMeasurementUnitCustomUnitAbbreviation | String | True |
The abbreviation of the custom unit. |
| MeasurementUnitMeasurementUnitAreaUnit | String | True |
Represents a standard area unit. 使用できる値は次のとおりです。IMPERIAL_ACRE, IMPERIAL_SQUARE_INCH, IMPERIAL_SQUARE_FOOT, IMPERIAL_SQUARE_YARD, IMPERIAL_SQUARE_MILE, METRIC_SQUARE_CENTIMETER, METRIC_SQUARE_METER, METRIC_SQUARE_KILOMETER |
| MeasurementUnitMeasurementUnitLengthUnit | String | True |
Represents a standard length unit. 使用できる値は次のとおりです。IMPERIAL_INCH, IMPERIAL_FOOT, IMPERIAL_YARD, IMPERIAL_MILE, METRIC_MILLIMETER, METRIC_CENTIMETER, METRIC_METER, METRIC_KILOMETER |
| MeasurementUnitMeasurementUnitVolumeUnit | String | True |
Represents a standard volume unit. 使用できる値は次のとおりです。GENERIC_FLUID_OUNCE, GENERIC_SHOT, GENERIC_CUP, GENERIC_PINT, GENERIC_QUART, GENERIC_GALLON, IMPERIAL_CUBIC_INCH, IMPERIAL_CUBIC_FOOT, IMPERIAL_CUBIC_YARD, METRIC_MILLILITER, METRIC_LITER |
| MeasurementUnitMeasurementUnitWeightUnit | String | True |
Represents a standard weight unit. 使用できる値は次のとおりです。IMPERIAL_WEIGHT_OUNCE, IMPERIAL_POUND, IMPERIAL_STONE, METRIC_MILLIGRAM, METRIC_GRAM, METRIC_KILOGRAM |
| MeasurementUnitMeasurementUnitGenericUnit | String | True |
Reserved for API integrations that lack the ability to specify a real measurement unit. 使用できる値は次のとおりです。UNIT |
| MeasurementUnitMeasurementUnitTimeUnit | String | True |
Represents a standard time unit. 使用できる値は次のとおりです。GENERIC_MILLISECOND, GENERIC_SECOND, GENERIC_MINUTE, GENERIC_HOUR, GENERIC_DAY |
| MeasurementUnitMeasurementUnitType | String | True |
Represents the type of the measurement unit. 使用できる値は次のとおりです。TYPE_CUSTOM, TYPE_AREA, TYPE_LENGTH, TYPE_VOLUME, TYPE_WEIGHT, TYPE_GENERIC |
| MeasurementUnitPrecision | Integer | True |
An integer between 0 and 5 that represents the maximum number of positions allowed after the decimal in quantities measured with this unit. |
| MeasurementUnitId | String | True |
The Id of the CatalogMeasurementUnit object representing the catalog measurement unit associated with the inventory change. |
Create, configure, and publish invoices for orders that were created.
The Cloud uses the Square API to process search criteria that refer to the Id column, while other filters are processed client side within the Cloud.
Retrieve all invoices from a location specified in the filter.
SELECT * from Invoices where locationid = '92BYHNBR6W77E'
Retrieve an invoice by invoice ID.
SELECT * from Invoices where id = 'inv:0-ChCEwgC9pIyJcHaTpPUDOxHLEL0M'
To create a draft invoice for an order, you will need to specify OrderId, DeliveryMethod columns and PaymentRequests pseudo columns.
INSERT INTO Invoices(OrderId,AcceptedPaymentMethodCashAppPay,DeliveryMethod,PaymentRequestsRequestType,PaymentRequestsDueDate) VALUES('ASXK4JVIMPx33BTJ2iLEzaTXwxZZY',true,'EMAIL','BALANCE','2024-10-12') To update an invoice, you will need to set current version number of the invoice in the query.
UPDATE Invoices SET Title = 'Testing@001', Version = 7 where id = 'inv:0-ChC4p4-kE0gkhzWD2-NPhXiuEL0M'
Delete the specified invoice.
DELETE from invoices where id = 'inv:0-ChCFV-a1tLofCBvdpj5UA4qgEL0M'
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
The Square-assigned Id of the invoice. |
| Version | Int32 | False |
The Square-assigned version number, which is incremented each time an update is committed to the invoice. |
| LocationId | String | False |
The Id of the location for which the invoice is associated with. |
| OrderId | String | False |
The Id of the order for which the invoice is created. |
| PrimaryRecipientCustomerId | String | False |
The Id of the customer who receives the invoice. |
| PrimaryRecipientGivenName | String | True |
The recipient's given (first) name. |
| PrimaryRecipientFamilyName | String | True |
The recipient's family (last) name. |
| PrimaryRecipientEmail | String | True |
The recipient's email address. |
| PrimaryRecipientAddress | String | True |
The recipient's physical address. |
| PrimaryRecipientPhoneNumber | String | True |
The recipient's phone number. |
| PrimaryRecipientCompanyName | String | True |
The name of the recipient's company. |
| PrimaryRecipientTaxIds | String | True |
The recipient's tax identification numbers. The country of the seller account determines whether this field is available for the customer. |
| PaymentRequests | String | False |
The payment schedule for the invoice, represented by one or more payment requests that define payment settings, such as amount due and due date. |
| DeliveryMethod | String | False |
The delivery method that Square uses to send the invoice, reminders, and receipts to the customer. |
| InvoiceNumber | String | False |
A user-friendly invoice number that is displayed on the invoice. The value is unique within a location. |
| Title | String | False |
The title of the invoice, which is displayed on the invoice. |
| Description | String | False |
The description of the invoice, which is displayed on the invoice. |
| ScheduledAt | Datetime | False |
The timestamp when the invoice is scheduled for processing, in RFC 3339 format. |
| PublicUrl | String | True |
The URL of the Square-hosted invoice page. |
| NextPaymentMoneyAmount | Int64 | True |
The current amount due for the invoice. In addition to the amount due on the next payment request, this includes any overdue payment amounts. |
| NextPaymentMoneyCurrency | String | True |
The type of currency of the current amount due for the invoice, in ISO 4217 format. |
| Status | String | True |
Current state of the invoice (for example, draft, unpaid, paid, or canceled). |
| Timezone | String | True |
The time zone used to interpret calendar dates on the invoice, such as due_date. When an invoice is created, this field is set to the timezone specified for the seller location. The value cannot be changed. |
| CreatedAt | Datetime | True |
The timestamp when the invoice was created, in RFC 3339 format. |
| UpdatedAt | Datetime | True |
The timestamp when the invoice was last updated, in RFC 3339 format. |
| AcceptedPaymentMethodCard | Boolean | False |
Indicates whether credit card or debit card payments are accepted. |
| AcceptedPaymentMethodSquareGiftCard | Boolean | False |
Indicates whether Square gift card payments are accepted. |
| AcceptedPaymentMethodBankAccount | Boolean | False |
Indicates whether ACH bank transfer payments are accepted. |
| AcceptedPaymentMethodBuyNowPayLater | Boolean | False |
Indicates whether Afterpay (also known as Clearpay) payments are accepted. |
| AcceptedPaymentMethodCashAppPay | Boolean | False |
Indicates whether Cash App payments are accepted. |
| CustomFields | String | False |
Additional seller-defined fields that are displayed on the invoice. |
| SubscriptionId | String | True |
The Id of the subscription associated with the invoice. |
| SaleOrServiceDate | Datetime | False |
The date of the sale or the date that the service is rendered, in YYYY-MM-DD format. |
| PaymentConditions | String | False |
France only. The payment terms and conditions that are displayed on the invoice. For countries other than France, Square returns an INVALID_REQUEST_ERROR with a BAD_REQUEST code. |
| StorePaymentMethodEnabled | Boolean | False |
Indicates whether to allow a customer to save a credit or debit card as a card on file or a bank transfer as a bank account on file. |
| Attachments | String | True |
Metadata about the attachments on the invoice. |
Pseudo column fields are used in the WHERE clause of SELECT statements (unless stated otherwise) and offer a more granular control over the tuples that are returned from the data source.
| Name | Type | Description |
| PaymentRequestsRequestType | String |
Identifies the payment request type. This type defines how the payment request amount is determined. 使用できる値は次のとおりです。BALANCE, DEPOSIT, INSTALLMENT |
| PaymentRequestsDueDate | Date |
The due date (in the invoice's time zone) for the payment request, in YYYY-MM-DD format. |
| IdempotencyKey | String |
A unique string that identifies the CreateInvoice request. Keys can be any valid string but must be unique for every CreateInvoice request. |
Query Location information for a Merchant.
Retrieve all Locations:
SELECT * FROM Locations
To create a location, you will need to specify Address and Name.
INSERT INTO locations (Address, Name) VALUES ('{ "address_line_1": "1234 Peachtree St. NE", "locality": "Atlanta", "administrative_district_level_1": "GA", "postal_code": "30309"}', 'Midtown')
A location can be updated by providing the Id.
UPDATE locations set name='testlocation' where id='LNX1YQ5C29K9A'
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
The location's unique ID. |
| Name | String | False |
The location's name. Location names are set by the account owner and displayed in the dashboard as the location's nickname |
| Address | String | False |
The location's physical address. |
| TimeZone | String | False |
The IANA Timezone Database identifier for the location's timezone. |
| Capabilities | String | True |
Indicates which Square features are enabled for the location. |
| Status | String | False |
The location's status. |
| CreatedAt | Datetime | True |
The time when the location was created, in RFC 3339 format. |
| MerchantId | String | True |
The identifier of the merchant that owns the location. |
| Country | String | True |
The location's country, in ISO 3166-1-alpha-2 format. |
| LanguageCode | String | False |
The language associated with the location in BCP 47 format. |
| Currency | String | True |
The currency used for all transactions at this location, specified in ISO 4217 format. |
| PhoneNumber | String | False |
The location's phone_number. |
| BusinessName | String | False |
The location's business_name which is shown to its customers. |
| Type | String | False |
The location's type, as set by the account owner in the Square dashboard. |
| WebsiteUrl | String | False |
The location's website, as set by the account owner in the Square dashboard. |
| BusinessHours | String | False |
The hours of operation for the location. |
| Coordinates | String | False |
The physical coordinates (latitude and longitude) of the location. |
| MCC | String | False |
A four-digit number that describes the kind of goods or services sold at the location. The merchant category code (MCC) of the location as standardized by ISO 18245. |
Lists, Creates, Updates, Deletes payment links.
The Cloud uses the Square API to process search criteria that refer to the Id column, while other filters are processed client side within the Cloud.
Retrieve all payment links.
SELECT * from PaymentLinks
Retrieve a particular payment link.
SELECT * from PaymentLinks where id = 'CB45QHA2FDP6C24Q'
To create a payment link, you will need to specify the Quick Pay columns exposed as pseudo columns.
INSERT INTO PaymentLinks(QuickPayName,QuickPayPriceMoney,QuickPayPriceCurrency,QuickPayLocationId, Description) VALUES('TestPaymentLink@001',350,'USD','92BYHNBR6W77E', 'Hello!!') To update a payment link, you will need to set current version number of the payment link in the query.
UPDATE PaymentLinks SET Description = 'Demo Description', Version = 4 where Id = 'UN6GN576E3SHVL3R'
Delete a payment link.
DELETE from PaymentLinks where Id = 'CB45QHA2FDP6C24Q'
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
The Square-assigned ID of the payment link. |
| Version | Int32 | False |
The Square-assigned version number, which is incremented each time an update is committed to the payment link. |
| Description | String | False |
The optional description of the payment_link object. It is primarily for use by your application and is not used anywhere. |
| OrderId | String | True |
The ID of the order associated with the payment link. |
| CheckoutAllowTipping | Boolean | False |
Indicates whether the payment allows tipping. |
| CheckoutCustomFields | String | False |
The custom fields requesting information from the buyer. |
| CheckoutSubscriptionPlanId | String | False |
The ID of the subscription plan for the buyer to pay and subscribe. |
| CheckoutRedirectUrl | String | False |
The confirmation page URL to redirect the buyer to after Square processes the payment. |
| CheckoutMerchantSupportEmail | String | False |
The email address that buyers can use to contact the seller. |
| CheckoutAskForShippingAddress | Boolean | False |
Indicates whether to include the address fields in the payment form. |
| CheckoutPaymentMethodApplePay | Boolean | False |
Whether Apple Pay is accepted at checkout. |
| CheckoutPaymentMethodGooglePay | Boolean | False |
Whether Google Pay is accepted at checkout. |
| CheckoutPaymentMethodCashAppPay | Boolean | False |
Whether Cash App Pay is accepted at checkout. |
| CheckoutPaymentMethodAfterPayClearPay | Boolean | False |
Whether Afterpay/Clearpay is accepted at checkout. |
| CheckoutAppFeeMoneyAmount | Int64 | False |
The amount of money that the developer is taking as a fee for facilitating the payment on behalf of the seller. |
| CheckoutAppFeeMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. |
| CheckoutShippingFeeName | String | False |
The name for the shipping fee. |
| CheckoutShippingFeeChargeAmount | Int64 | False |
The amount for the shipping fee. |
| CheckoutShippingFeeChargeCurrency | String | False |
The currency for the shipping fee. |
| CheckoutEnableCoupon | Boolean | False |
Indicates whether to include the Add coupon section for the buyer to provide a Square marketing coupon in the payment form. |
| CheckoutEnableLoyalty | Boolean | False |
Indicates whether to include the REWARDS section for the buyer to opt in to loyalty, redeem rewards in the payment form, or both. |
| PrePoulatedDataBuyerEmail | String | False |
The buyer email to prepopulate in the payment form. |
| PrePoulatedDataBuyerPhoneNumber | String | False |
The buyer phone number to prepopulate in the payment form. |
| PrePoulatedDataBuyerAddress | String | False |
The buyer address to prepopulate in the payment form. |
| Url | String | True |
The shortened URL of the payment link. |
| LongUrl | String | True |
The long URL of the payment link. |
| CreatedAt | Datetime | False |
The timestamp when the payment link was created, in RFC 3339 format. |
| UpdatedAt | Datetime | False |
The timestamp when the payment link was last updated, in RFC 3339 format. |
| PaymentNote | String | False |
An optional note. After Square processes the payment, this note is added to the resulting Payment. |
Pseudo column fields are used in the WHERE clause of SELECT statements (unless stated otherwise) and offer a more granular control over the tuples that are returned from the data source.
| Name | Type | Description |
| QuickPayName | String |
The ad hoc item name. In the resulting Order, this name appears as the line item name. |
| QuickPayPriceMoney | Int64 |
The price amount of the item, in the smallest denomination of the currency indicated by currency. |
| QuickPayPriceCurrency | String |
The type of currency, in ISO 4217 format. |
| QuickPayLocationId | String |
The ID of the business location the checkout is associated with. |
Retrieves card payments processed through Square. Does not include cash or other non‑card tenders.
The following queries show the filters that are processed server side, while other filters are processed client side within the Cloud.
Retrieve all Payments:
Retrieve a single payment by providing a valid Id:
SELECT * FROM Payments WHERE Id = '5xNDT7Sd6qFHsLyKlugpZIqeV'
Filter by the creation date of a Payment:
SELECT * FROM Payments WHERE CreatedAt > '2015-08-15' SELECT * FROM Payments WHERE CreatedAt < '2015-08-15'
To create a Payment, you will need to specify IdempotencyKey, SourceId, MoneyAmount and MoneyCurrency.
INSERT INTO Payments (IdempotencyKey,SourceId, MoneyAmount,MoneyCurrency) VALUES ('390a7d22-49d6-4ff3-ae1e-755455d03b50','cnon:card-nonce-ok',100, 'USD')
A Payment can be updated by providing the Id.
UPDATE payments set IdempotencyKey='b741f5a5-c041-4bd6-9e79-dfefcf69c4b7', MoneyAmount =200 , BuyerEmailAddress= '[email protected]' where Id='390a7d22-49d6-4ff3-ae1e-755455d03b50'
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | False |
Unique Square‑assigned identifier for the payment. Used for refunds, disputes, or reporting. |
| MoneyAmount | Int64 | False |
The amount of money, in the smallest denomination of the currency indicated by currency. For example, when currency is USD, amount is in cents. |
| MoneyCurrency | String | False |
The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. |
| AppFeeMoneyAmount | Int64 | False |
The amount the developer is taking as a fee for facilitating the payment on behalf of the seller. |
| AppFeeMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. |
| ApprovedMoneyAmount | Int64 | False |
The initial amount of money approved for this payment. The amount the developer is taking as a fee for facilitating the payment on behalf of the seller. |
| ApprovedMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. |
| BankAccountOwnershipType | String | False |
The ownership type of the bank account performing the transfer. 使用できる値は次のとおりです。INDIVIDUAL, COMPANY, UNKNOWN |
| ACHDetailsAccountNumberSuffix | String | False |
The last few digits of the bank account number. |
| ACHDetailsAccountType | String | False |
The type of bank account performing the transfer. 使用できる値は次のとおりです。CHECKING, SAVINGS, UNKNOWN |
| ACHDetailsRoutingNumber | String | False |
The routing number for the bank account. |
| BankName | String | False |
The name of the bank associated with the bank account. |
| BankAccountCountry | String | False |
The two-letter ISO code representing the country the bank account is located in. |
| BankAccountFingerprint | String | False |
Uniquely identifies the bank account for this seller and can be used to determine if payments are from the same bank account. |
| BankAccountStatementDescription | String | False |
The statement description as sent to the bank. |
| BankAccountTransferType | String | False |
The type of bank transfer method. 使用できる値は次のとおりです。ACH, UNKNOWN |
| BillingAddressLine1 | String | False |
The first line of the address. |
| BillingAddressLine2 | String | False |
The second line of the address, if any. |
| BillingAddressLine3 | String | False |
The third line of the address, if any. |
| BillingAddressAdministrativeDistrictLevel1 | String | False |
A civil entity within the address's country. In the US, this is the state. |
| BillingAddressAdministrativeDistrictLevel2 | String | False |
A civil entity within the address's administrative_district_level_1. In the US, this is the county. |
| BillingAddressAdministrativeDistrictLevel3 | String | False |
A civil entity within the address's administrative_district_level_2, if any. |
| BillingAddressCountry | String | False |
The address's country, in ISO 3166-1-alpha-2 format. |
| BillingAddressFirstName | String | False |
Optional first name when it's representing recipient. |
| BillingAddressLastName | String | False |
Optional last name when it's representing recipient. |
| BillingAddressLocality | String | False |
The city or town of the address. |
| BillingAddressOrganization | String | False |
Optional organization name when it's representing recipient. |
| BillingAddressPostalCode | String | False |
The address's postal code. |
| BillingAddressSubLocality | String | False |
A civil region within the address's locality, if any. |
| BillingAddressSubLocality2 | String | False |
A civil region within the address's sublocality, if any. |
| BillingAddressSubLocality3 | String | False |
A civil region within the address's sublocality_2, if any. |
| BuyerEmailAddress | String | False |
The buyer's email address. |
| Capabilities | String | False |
Actions that can be performed on this payment. For example, EDIT_AMOUNT_UP, EDIT_AMOUNT_DOWN, EDIT_TIP_AMOUNT_UP, or EDIT_TIP_AMOUNT_DOWN. |
| CardDetailsApplicationCryptogram | String | False |
For EMV payments, the cryptogram generated for the payment. |
| CardDetailsApplicationIdentifier | String | False |
For EMV payments, the application Id identifies the EMV application used for the payment. |
| CardDetailsApplicationName | String | False |
For EMV payments, the human-readable name of the EMV application used for the payment. |
| CardDetailsAuthResultCode | String | False |
The status code returned by the card issuer that describes the payment's authorization status. |
| CardDetailsAverageStatus | String | False |
The status code returned from the Address Verification System (AVS) check. 使用できる値は次のとおりです。AVS_ACCEPTED, AVS_REJECTED, AVS_NOT_CHECKED |
| CardId | String | False |
Unique Id for this card. Generated by Square. |
| CardBillingAddressLine1 | String | False |
The first line of the address. |
| CardBillingAddressLine2 | String | False |
The second line of the address, if any. |
| CardBillingAddressLine3 | String | False |
The third line of the address, if any. |
| CardBillingAddressAdministrativeDistrictLevel1 | String | False |
A civil entity within the address's country. In the US, this is the state. |
| CardBillingAddressAdministrativeDistrictLevel2 | String | False |
A civil entity within the address's administrative_district_level_1. In the US, this is the county. |
| CardBillingAddressAdministrativeDistrictLevel3 | String | False |
A civil entity within the address's administrative_district_level_2, if any. |
| CardBillingAddressCountry | String | False |
The address's country, in ISO 3166-1-alpha-2 format. |
| CardBillingAddressFirstName | String | False |
Optional first name when it's representing recipient. |
| CardBillingAddressLastName | String | False |
Optional last name when it's representing recipient. |
| CardBillingAddressLocality | String | False |
The city or town of the address. |
| CardBillingAddressOrganization | String | False |
Optional organization name when it's representing recipient. |
| CardBillingAddressPostalCode | String | False |
The address's postal code. |
| CardBillingAddressSubLocality | String | False |
A civil region within the address's locality, if any. |
| CardBillingAddressSubLocality2 | String | False |
A civil region within the address's sublocality, if any. |
| CardBillingAddressSubLocality3 | String | False |
A civil region within the address's sublocality_2, if any. |
| CardBin | String | False |
The first six digits of the card number, known as the Bank Identification Number (BIN). Only the Payments API returns this field. |
| CardType | String | False |
The type of the card. The Card object includes this field only in response to Payments API calls. 使用できる値は次のとおりです。UNKNOWN_CARD_TYPE, CREDIT, DEBIT |
| CardholderName | String | False |
The name of the cardholder. |
| CardCustomerId | String | False |
The Id of a customer created using the Customers API to be associated with the card. |
| CardEnabled | Boolean | False |
Indicates whether or not a card can be used for payments. |
| CardExpiryMonth | Int64 | False |
The expiration month of the associated card as an integer between 1 and 12. |
| CardExpiryYear | Int64 | False |
The four-digit year of the card's expiration date. |
| CardFingerprint | String | False |
Intended as a Square-assigned identifier, based on the card number, to identify the card across multiple locations within a single application. |
| CardLast4 | String | False |
The last 4 digits of the card number. |
| CardPrepaidType | String | False |
Indicates whether the Card is prepaid or not. The Card object includes this field only in response to Payments API calls |
| CardReferenceId | String | False |
An optional user-defined reference Id that associates this card with another entity in an external system. |
| CardVersion | Int64 | False |
Current version number of the card. Increments with each card update. |
| CardTimelineAuthorizedAt | Datetime | False |
The timestamp when the payment was authorized, in RFC 3339 format. |
| CardTimelineCapturedAt | Datetime | False |
The timestamp when the payment was captured, in RFC 3339 format. |
| CardTimelineVoidedAt | Datetime | False |
The timestamp when the payment was voided, in RFC 3339 format. |
| CardCVVStatus | String | False |
The status code returned from the Card Verification Value (CVV) check. 使用できる値は次のとおりです。CVV_ACCEPTED, CVV_REJECTED, CVV_NOT_CHECKED |
| CardDeviceId | String | False |
The Square-issued Id of the device. |
| CardDeviceInstallationId | String | False |
The Square-issued installation Id for the device. |
| CardDeviceName | String | False |
The name of the device set by the seller. |
| CardEntryMethod | String | False |
The method used to enter the card's details for the payment. 使用できる値は次のとおりです。KEYED, SWIPED, EMV, ON_FILE, CONTACTLESS |
| RefundRequiresCardPresence | Boolean | False |
Whether the card must be physically present for the payment to be refunded. If set to true, the card must be present. |
| CardStatementDescription | String | False |
The statement description sent to the card networks. |
| CardStatus | String | False |
The card payment's current state. 使用できる値は次のとおりです。AUTHORIZED, CAPTURED, VOIDED, FAILED |
| CardVerificationMethod | String | False |
For EMV payments, the method used to verify the cardholder's identity. 使用できる値は次のとおりです。PIN, SIGNATURE, PIN_AND_SIGNATURE, ON_DEVICE, NONE |
| CardVerificationResults | String | False |
For EMV payments, the results of the cardholder verification. 使用できる値は次のとおりです。SUCCESS, FAILURE, UNKNOWN |
| CashBuyerSupplierMoneyAmount | Int64 | False |
The amount of money, in the smallest denomination of the currency indicated by currency. |
| CashBuyerSupplierMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. |
| CashChangeBackMoneyAmount | Int64 | False |
The amount of change due back to the buyer. This read-only field is calculated from the amount_money and buyer_supplied_money fields. |
| CashChangeBackMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. |
| CreatedAt | Datetime | False |
The timestamp of when the payment was created, in RFC 3339 format. |
| CustomerId | String | False |
The Customer Id of the customer associated with the payment. |
| DelayAction | String | False |
The action to be applied to the payment when the delay_duration has elapsed. |
| DelayDuration | String | False |
The duration of time after the payment's creation when Square automatically applies the delay_action to the payment. |
| DelayedUntil | Datetime | False |
The timestamp of when the delay_action is automatically applied, in RFC 3339 format. |
| EmployeeId | String | False |
An optional Id of the employee associated with taking the payment. |
| ExternalDetailsSource | String | False |
A description of the external payment source. For example, 'Food Delivery Service'. |
| ExternalDetailsType | String | False |
The type of external payment the seller received. 使用できる値は次のとおりです。CHECK, BANK_TRANSFER, OTHER_GIFT_CARD, CRYPTO, SQUARE_CASH, SOCIAL, EXTERNAL, EMONEY, CARD, STORED_BALANCE, OTHER |
| ExternalDetailsSourceFeeMoneyAmount | Int64 | False |
The fees paid to the source. The amount_money minus this field is the net amount seller receives. |
| ExternalDetailsSourceFeeMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. |
| ExternalDetailsSourceId | String | False |
An Id to associate the payment to its originating source. |
| LocationId | String | False |
The Id of the location associated with the payment. |
| Note | String | False |
An optional note to include when creating a payment. |
| OrderId | String | False |
The Id of the order associated with the payment. |
| ProcessingFee | String | False |
The processing fees and fee adjustments assessed by Square for this payment. |
| ReceiptNumber | String | False |
The payment's receipt number. The field is missing if a payment is canceled. |
| ReceiptURL | String | False |
The URL for the payment's receipt. The field is only populated for COMPLETED payments. |
| ReferenceId | String | False |
An optional Id that associates the payment with an entity in another system. |
| RefundIds | String | False |
A list of refund_ids identifying refunds for the payment. |
| RefundedMoneyAmount | Int64 | False |
The total amount of the payment refunded to date. |
| RefundedMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. |
| RiskEvaluationCreatedAt | Datetime | False |
Provides information about the risk associated with the payment, as determined by Square. |
| RiskEvaluationLevel | String | False |
The risk level associated with the payment. 使用できる値は次のとおりです。PENDING, NORMAL, MODERATE, HIGH |
| ShippingAddressLine1 | String | False |
The first line of the address. |
| ShippingAddressLine2 | String | False |
The second line of the address, if any. |
| ShippingAddressLine3 | String | False |
The third line of the address, if any. |
| ShippingAddressAdministrativeDistrictLevel1 | String | False |
A civil entity within the address's country. In the US, this is the state. |
| ShippingAddressAdministrativeDistrictLevel2 | String | False |
A civil entity within the address's administrative_district_level_1. In the US, this is the county. |
| ShippingAddressAdministrativeDistrictLevel3 | String | False |
A civil entity within the address's administrative_district_level_2, if any. |
| ShippingAddressCountry | String | False |
The address's country, in ISO 3166-1-alpha-2 format. |
| ShippingAddressFirstName | String | False |
Optional first name when it's representing recipient. |
| ShippingAddressLastName | String | False |
Optional last name when it's representing recipient. |
| ShippingAddressLocality | String | False |
The city or town of the address. |
| ShippingAddressOrganization | String | False |
Optional organization name when it's representing recipient. |
| ShippingAddressPostalCode | String | False |
The address's postal code. |
| ShippingAddressSubLocality | String | False |
A civil region within the address's locality, if any. |
| ShippingAddressSubLocality2 | String | False |
A civil region within the address's sublocality, if any. |
| ShippingAddressSubLocality3 | String | False |
A civil region within the address's sublocality_2, if any. |
| SourceType | String | False |
The source type for this payment. 使用できる値は次のとおりです。CARD, BANK_ACCOUNT, CASH, EXTERNAL, WALLET, BUY_NOW_PAY_LATER, SQUARE_ACCOUNT |
| StatementDescriptionIdentifier | String | False |
Additional payment information that gets added to the customer's card statement as part of the statement description. |
| Status | String | False |
Indicates whether the payment is APPROVED, PENDING, COMPLETED, CANCELED, or FAILED. |
| TipMoneyAmount | Int64 | False |
The amount designated as a tip. |
| TipMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. |
| TotalMoneyAmount | Int64 | False |
The total amount for the payment, including amount_money and tip_money. |
| TotalMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. |
| UpdatedAt | Datetime | False |
The timestamp of when the payment was last updated, in RFC 3339 format. |
| VersionToken | String | False |
Used for optimistic concurrency. This opaque token identifies a specific version of the Payment object. |
| TeamMemberId | String | False |
An optional Id of the TeamMember associated with taking the payment. |
| ApplicationDetailsApplicationId | String | False |
The Square Id assigned to the application used to take the payment. |
| ApplicationDetailsSquareProduct | String | False |
The Square product, such as Square Point of Sale (POS), Square Invoices, or Square Virtual Terminal. |
| BuyNowPayLaterDetailsBrand | String | False |
The brand used for the Buy Now Pay Later payment. The brand can be AFTERPAY, CLEARPAY or UNKNOWN. |
| BuyNowAfterPayEmailAddress | String | False |
Email address on the buyer's Afterpay account. |
| BuyNowClearPayEmailAddress | String | False |
Email address on the buyer's Clearpay account. |
| CardBrand | String | False |
The card's brand. 使用できる値は次のとおりです。OTHER_BRAND, VISA, MASTERCARD, AMERICAN_EXPRESS, DISCOVER, DISCOVER_DINERS, JCB, CHINA_UNIONPAY, SQUARE_GIFT_CARD, SQUARE_CAPITAL_CARD, INTERAC, EFTPOS, FELICA, EBT |
| SquareAccountPaymentSourceToken | String | False |
Unique identifier for the payment source used for this payment. |
| SquareAccountErrors | String | False |
Information about errors encountered during the request. |
| WalletDetailsBrand | String | False |
The brand used for the WALLET payment. The brand can be CASH_APP, PAYPAY, ALIPAY, RAKUTEN_PAY, AU_PAY, D_BARAI, MERPAY, WECHAT_PAY or UNKNOWN. |
| WalletDetailsBuyerFullName | String | False |
The name of the Cash App account holder. |
| WalletDetailsBuyerCountryCode | String | False |
The country of the Cash App account holder, in ISO 3166-1-alpha-2 format. |
| WalletDetailsBuyerCashTag | String | False |
$Cashtag of the Cash App account holder. |
| WalletDetailsStatus | String | False |
The status of the WALLET payment. The status can be AUTHORIZED, CAPTURED, VOIDED, or FAILED. |
Pseudo column fields are used in the WHERE clause of SELECT statements (unless stated otherwise) and offer a more granular control over the tuples that are returned from the data source.
| Name | Type | Description |
| IdempotencyKey | String |
A unique string that identifies this CreatePayment request. Keys can be any valid string but must be unique for every CreatePayment request. |
| SourceId | String |
The Id for the source of funds for this payment. |
| AutoComplete | Boolean |
If set to true, this payment will be completed when possible. If set to false, this payment is held in an approved state until either explicitly completed (captured) or canceled (voided). |
Creates and retrieves details for refunds issued by a merchant or their staff within a specified date range. Includes refund amounts, payment references, processing fees, destination details, and status tracking.
By default this table returns all refunds initiated by a merchant or any of the merchants mobile staff starting from January 1, 2013, as in the following query:
SELECT * FROM Refunds WHERE Id = '12345' SELECT * FROM Refunds WHERE Status = 'COMPLETED' AND LocationId = '92BYHNBR6W77E' SELECT * FROM Refunds WHERE LocationId = '9J0M984DXGA7W' // To get the refund for a given location
To insert a Refund, specify the PaymentId, RefundedMoneyAmount, RefundedMoneyCurrency.
INSERT INTO Refunds (PaymentId, RefundedMoneyAmount, RefundedMoneyCurrency) VALUES ('UNOE3kv2BZwqHlJ830RCt5YCuaB', 100, 'USD')
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | False |
The unique Id for this refund, generated by Square. |
| RefundedMoneyAmount | Int64 | False |
The amount of money, in the smallest denomination of the currency indicated by currency. For example, when currency is USD, amount is in cents. |
| RefundedMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. |
| RefundedAppFeeMoneyAmount | Int64 | False |
The amount of money, in the smallest denomination of the currency indicated by currency. For example, when currency is USD, amount is in cents. |
| RefundedAppFeeMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. |
| CreatedAt | Datetime | False |
The time when the merchant initiated the refund for Square to process. |
| LocationId | String | False |
The Id of the location. |
| OrderId | String | False |
The ID of the order associated with the refund. |
| PaymentId | String | False |
The ID of the payment associated with this refund. |
| ProcessingFeeMoneyAmount | Int64 | False |
Processing fees and fee adjustments assessed by Square for this refund. The amount of money, in the smallest denomination of the currency indicated by currency. For example, when currency is USD, amount is in cents. |
| ProcessingFeeMoneyCurrency | String | False |
Processing fees and fee adjustments assessed by Square for this refund. The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. |
| ProcessingFeeEffectiveAt | Datetime | False |
Processing fees and fee adjustments assessed by Square for this refund. The timestamp of when the fee takes effect, in RFC 3339 format. |
| ProcessingFeeType | String | False |
Processing fees and fee adjustments assessed by Square for this refund. The type of fee assessed or adjusted. The fee type can be INITIAL or ADJUSTMENT. |
| Reason | String | False |
The merchant-specified reason for the refund. |
| Status | String | False |
The refund's status. 使用できる値は次のとおりです。COMPLETED, FAILED, PENDING, REJECTED |
| UpdatedAt | Datetime | False |
The timestamp of when the refund was last updated, in RFC 3339 format. |
| Unlinked | Boolean | True |
Flag indicating whether or not the refund is linked to an existing payment in Square. |
| DestinationType | String | False |
The destination type for this refund. 使用できる値は次のとおりです。CARD, BANK_ACCOUNT, WALLET, BUY_NOW_PAY_LATER, CASH, EXTERNAL, SQUARE_ACCOUNT |
| DestinationDetailsCardDetailsCardId | String | True |
Unique Id for this card, generated by Square. |
| DestinationDetailsCardDetailsCardLast4 | String | True |
The last 4 digits of the card number. |
| DestinationDetailsCardDetailsCardCardholderName | String | True |
The name of the cardholder. |
| DestinationDetailsCardDetailsCardCustomerId | String | True |
The Id of a customer to be associated with the card. |
| DestinationDetailsCardDetailsCardMerchantId | String | True |
The Id of the merchant associated with the card. |
| DestinationDetailsCardDetailsCardReferenceId | String | True |
An optional user-defined reference Id that associates this card with another entity in an external system. For example, a customer ID from an external customer management system. |
| DestinationDetailsCardDetailsCardBin | String | True |
The first six digits of the card number, known as the Bank Identification Number (BIN). Only the Payments API returns this field. |
| DestinationDetailsCardDetailsCardVersion | Int64 | True |
Current version number of the card. Increments with each card update. Requests to update an existing Card object will be rejected unless the version in the request matches the current version for the Card. |
| DestinationDetailsCardDetailsEntryMethod | String | True |
The method used to enter the card's details for the refund. |
| DestinationDetailsCardDetailsAuthResultCode | String | True |
The authorization code provided by the issuer when a refund is approved. |
| DestinationDetailsCashDetailsSellerSuppliedMoneyAmount | Int64 | True |
The amount of money, in the smallest denomination of the currency indicated by currency. For example, when currency is USD, amount is in cents. Monetary amounts can be positive or negative. |
| DestinationDetailsCashDetailsSellerSuppliedMoneyCurrency | String | True |
The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. |
| DestinationDetailsCashDetailsChangeBackMoneyAmount | Int64 | True |
The amount of money, in the smallest denomination of the currency indicated by currency. For example, when currency is USD, amount is in cents. Monetary amounts can be positive or negative. |
| DestinationDetailsCashDetailsChangeBackMoneyCurrency | String | True |
The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. |
| DestinationDetailsExternalDetailsType | String | True |
The type of external refund the seller paid to the buyer. |
| DestinationDetailsExternalDetailsSource | String | True |
A description of the external refund source. |
| DestinationDetailsExternalDetailsSourceId | String | True |
Id linking the refund to its originating external source. |
| TeamMemberId | String | True |
Id of the team member associated with processing the refund, if applicable. |
| TerminalRefundId | String | True |
ID of the refund processed through Square Terminal, if applicable. |
Create, update, delete, and query the available shifts in Square.
The Cloud uses the Square API to process search criteria that refer to the Id column, while other filters are processed client side within the Cloud.
Retrieve all shifts:
SELECT * FROM Shifts
Retrieve only one Shift:
SELECT * FROM Customers WHERE Id = 'T35HMQSN89SV4'
The StartAt column supports the =, >, >=, <, <= operators.
SELECT Id, StartAt FROM Shifts WHERE StartAt = '2025-07-03 05:26:00.0'; SELECT Id, StartAt FROM Shifts WHERE StartAt > '2025-07-03 05:26:00.0'; SELECT Id, StartAt FROM Shifts WHERE StartAt >= '2025-07-03 05:26:00.0'; SELECT Id, StartAt FROM Shifts WHERE StartAt < '2025-07-03 05:26:00.0'; SELECT Id, StartAt FROM Shifts WHERE StartAt <= '2025-07-03 05:26:00.0'; SELECT Id, StartAt FROM Shifts WHERE StartAt >= '2025-03-21 01:38:00.0' AND StartAt < '2025-07-03 05:26:00.0';
The EndAt column supports the =, >, >=, <, <= operators.
SELECT Id, EndAt FROM Shifts WHERE EndAt = '2025-07-03 05:26:00.0'; SELECT Id, EndAt FROM Shifts WHERE EndAt > '2025-07-03 05:26:00.0'; SELECT Id, EndAt FROM Shifts WHERE EndAt >= '2025-07-03 05:26:00.0'; SELECT Id, EndAt FROM Shifts WHERE EndAt < '2025-07-03 05:26:00.0'; SELECT Id, EndAt FROM Shifts WHERE EndAt <= '2025-07-03 05:26:00.0'; SELECT Id, EndAt FROM Shifts WHERE EndAt > '2025-07-04T02:22:00-07:00' AND EndAt <= '2025-07-04T03:42:00-07:00';
The resultset can be filtered using both StartAt and EndAt together.
SELECT Id, StartAt, EndAt FROM Shifts WHERE StartAt >= '2025-03-21 01:38:00.0' AND EndAt < '2025-07-04 06:42:00.0';
To create a Shift, you will need to specify the following values: TeamMemberId, LocationId, and StartAt.
INSERT INTO Shifts(TeamMemberId, LocationId, StartAt, WageTitle, WageHourlyRateAmount, WageHourlyRateCurrency, WageTipEligible, DeclaredCashTipMoneyAmount, DeclaredCashTipMoneyCurrency, Breaks) VALUES ('TMpveKF7plf5H7eZ','92BYHNBR6W77E', '2025-07-03T07:20:14.382-04:00', 'insert1', 100, 'USD', true, 500, 'USD', '[{"start_at": "2025-07-03T07:20:00-04:00", "end_at": "2025-07-03T07:21:00-04:00", "break_type_id": "REGS1EQR1TPZ5", "name": "Tea Break", "expected_duration": "PT5M", "is_paid": true}]');
Modify the details of an existing Shift by providing the Id of the Shift:
UPDATE Shifts SET Version=1, LocationId='92BYHNBR6W77E', StartAt='2025-07-03T07:50:40.017-04:00', TeamMemberId='TMyvF-_wObMpErVh', WageTitle='updated', WageHourlyRateAmount = 2043, WageHourlyRateCurrency = 'USD' where Id='RX3KS4G3VH00N';
Delete a Shift by providing the Id of the shift:
DELETE FROM Shifts WHERE Id = 'T35HMQSN89SV4'
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
The UUID for this object. |
| Breaks | String | False |
A list of all the paid or unpaid breaks that were taken during this shift. |
| CreatedAt | Datetime | True |
A read-only timestamp in RFC 3339 format; presented in UTC. |
| DeclaredCashTipMoneyAmount | Integer | False |
The amount of money, in the smallest denomination of the currency indicated by currency. For example, when currency is USD, amount is in cents. Monetary amounts can be positive or negative. See the specific field description to determine the meaning of the sign in a particular case. |
| DeclaredCashTipMoneyCurrency | String | False |
The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. 使用できる値は次のとおりです。UNKNOWN_CURRENCY, AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BOV, BRL, BSD, BTN, BWP, BYR, BZD, CAD, CDF, CHE, CHF, CHW, CLF, CLP, CNY, COP, COU, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRO, MUR, MVR, MWK, MXN, MXV, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SLE, SOS, SRD, SSP, STD, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USN, USS, UYI, UYU, UZS, VEF, VND, VUV, WST, XAF, XAG, XAU, XBA, XBB, XBC, XBD, XCD, XDR, XOF, XPD, XPF, XPT, XTS, XXX, YER, ZAR, ZMK, ZMW, BTC, XUS |
| EndAt | Datetime | False |
RFC 3339; shifted to the timezone + offset. Precision up to the minute is respected; seconds are truncated. |
| LocationId | String | False |
The ID of the location this shift occurred at. The location should be based on where the employee clocked in. |
| StartAt | Datetime | False |
RFC 3339; shifted to the location timezone + offset. Precision up to the minute is respected; seconds are truncated. |
| Status | String | False |
Describes the working state of the current Shift. 使用できる値は次のとおりです。OPEN, CLOSED |
| TeamMemberId | String | False |
The ID of the team member this shift belongs to. |
| TimeZone | String | False |
The read-only convenience value that is calculated from the location based on the location_id. Format: the IANA timezone database identifier for the location timezone. |
| UpdatedAt | Datetime | True |
A read-only timestamp in RFC 3339 format; presented in UTC. |
| Version | Integer | False |
Used for resolving concurrency issues. The request fails if the version provided does not match the server version at the time of the request. If not provided, Square executes a blind write; potentially overwriting data from another write. |
| WageTitle | String | False |
The name of the job performed during this shift. |
| WageHourlyRateAmount | Integer | False |
The amount of money, in the smallest denomination of the currency indicated by currency. For example, when currency is USD, amount is in cents. Monetary amounts can be positive or negative. See the specific field description to determine the meaning of the sign in a particular case. |
| WageHourlyRateCurrency | String | False |
The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. 使用できる値は次のとおりです。UNKNOWN_CURRENCY, AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BOV, BRL, BSD, BTN, BWP, BYR, BZD, CAD, CDF, CHE, CHF, CHW, CLF, CLP, CNY, COP, COU, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRO, MUR, MVR, MWK, MXN, MXV, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SLE, SOS, SRD, SSP, STD, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USN, USS, UYI, UYU, UZS, VEF, VND, VUV, WST, XAF, XAG, XAU, XBA, XBB, XBC, XBD, XCD, XDR, XOF, XPD, XPF, XPT, XTS, XXX, YER, ZAR, ZMK, ZMW, BTC, XUS |
| WageJobId | String | True |
The id of the job performed during this shift. Square labor-reporting UIs might group shifts together by id. This cannot be used to retrieve the job. |
| WageTipEligible | Boolean | False |
Whether team members are eligible for tips when working this job. |
Creates and manages customer subscriptions in Square, including plan details, billing settings, payment methods, and subscription lifecycle status.
The Cloud uses the Square API to process search criteria that refer to the Id column, while other filters are processed client side within the Cloud.
Retrieve all subscriptions.
SELECT * from Subscriptions
Retrieve a specific subscription.
SELECT * FROM Subscriptions where id = 'f29e36f4-9732-4d31-8d23-d1ca6b2273f5'
To create a subscription, you will need to specify the LocationId, CustomerId, PlanVariationId columns and pseudo columns: Ordinal and OrderTemplateId.
INSERT INTO Subscriptions(LocationId, CustomerId,PlanVariationId,Ordinal,OrderTemplateId) VALUES('92BYHNBR6W77E','73VZQE9T08ZVVDPBBJ42JED0Y8','AF3H4KOG4HK54EPPTE7YIAK7',0,'saE29DtJG5iMpoGhg5ho2er0KjAZY'); Updates a subscription.
UPDATE Subscriptions SET Note = 'New Note' where id = '52eb5160-1eeb-45c3-bf81-b02beb1824d2'
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
The Square-assigned Id of the subscription. |
| LocationId | String | True |
The Id of the location associated with the subscription. |
| CustomerId | String | True |
The Id of the subscribing customer's Square profile. |
| PlanVariationId | String | True |
The Id for the specific subscription plan variation the customer is subscribed to. |
| SourceName | String | False |
The name used to identify the place (physical or digital) that a subscription originates. If unset, the name defaults to the name of the application that created the subscription. |
| StartDate | Datetime | True |
The YYYY-MM-DD-formatted date to start the subscription. |
| CanceledDate | Datetime | False |
The YYYY-MM-DD-formatted date to cancel the subscription, when the subscription status changes to CANCELED and the subscription billing stops. |
| ChargedThroughDate | Datetime | True |
The YYYY-MM-DD-formatted date up to when the subscriber is invoiced for the subscription. |
| Note | String | False |
An optional note to include when creating a payment. |
| Status | String | True |
The current status of the subscription. |
| TaxPercentage | String | False |
The tax amount applied when billing the subscription. |
| InvoiceIds | String | True |
The Ids of the invoices created for the subscription, listed in order when the invoices were created. |
| PriceOverrideMoneyAmount | Int64 | False |
The amount of money, in the smallest denomination of the currency indicated by currency, which overrides the cost of a subscription plan variation with STATIC pricing. |
| PriceOverrideMoneyCurrency | String | False |
The type of currency (in ISO 4217 format) used to indicate the type of currency for the amount which overrides the cost of a subscription plan variation with STATIC pricing. |
| Version | Int64 | False |
The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting. |
| CreatedAt | Datetime | True |
The timestamp when the subscription was created, in RFC 3339 format. |
| CardId | String | False |
The Id of the subscriber's card used to charge for the subscription. |
| Timezone | String | True |
Timezone used in date calculations for the subscription. Defaults to the timezone of the location based on location_id. |
| Phases | String | False |
Array of subscription phases, each defining a pricing and billing schedule for a portion of the subscription term. |
| Actions | String | False |
The list of scheduled actions for this subscription. |
| MonthlyBillingAnchorDate | Integer | True |
The day of the month on which the subscription issues invoices and publishes orders. |
Pseudo column fields are used in the WHERE clause of SELECT statements (unless stated otherwise) and offer a more granular control over the tuples that are returned from the data source.
| Name | Type | Description |
| Ordinal | Int64 |
Index of the subscription phase within the overall subscription plan. |
| OrderTemplateId | String |
Id of the order template used to generate recurring orders for billing. |
Query the available list of TeamMember for a business in Square.
The Cloud uses the Square API to process search criteria that refer to the Id, LocationId and Status column, while other filters are processed client side within the Cloud.
Retrieve a specific team member:
SELECT * FROM Teams WHERE Id = '1ccaibDk3FapStf997Qi'
Retrieve the team member for a specific location:
SELECT * FROM Teams WHERE LocationId = ' 92BYHNBR6W77E'Please note that team members may belong to multiple LocationIds which may lead to multiple values in the LocationId column. Also the team members with the value of the 'AssignmentType' field as 'ALL_CURRENT_AND_FUTURE_LOCATIONS' will have NULL as the value for the LocationId field even though those team members have access to data in all LocationIds. This is a behavior of the Square API.
Retrieve list of team members for specified locations:
SELECT * FROM Teams WHERE LocationId IN ('92BYHNBR6W77E', '92BYHNBR6W77EABCD', '92BYHNBR6W77EABCDEFGH')
Retrieve list of Active team members:
SELECT * FROM Teams WHERE Status = 'ACTIVE'
Retrieve list of Active team members in a given location:
SELECT * FROM Teams WHERE LocationId = '92BYHNBR6W77E' AND Status = 'ACTIVE'
To create a Team, you will need to specify IdempotencyKey and FirstName or LastName.
INSERT INTO Teams (IdempotencyKey, FirstName) VALUES ('b741f5a5-c041-4bd6-9e79-dfefcf69c4b7','testing')
A Team can be updated by providing the Id.
UPDATE teams set FirstName='testteams' where id='TMiAkBLr8BOrtOCr'
Maximum BatchSize supported by Teams is 25.
A Team can be Bulk updated by providing the Id.
INSERT INTO Teams#TEMP (FirstName,LastName,Id) VALUES ('UpdatedFirstName1','UpdatedLastName1','TMD64VkEfI47Vm3G')
INSERT INTO Teams#TEMP (FirstName,LastName,Id) VALUES ('UpdatedFirstName2','UpdatedLastName2','TMHxLjeRSHhwzx3T')
UPDATE Teams (FirstName,LastName,Id) SELECT FirstName, LastName,Id FROM Teams#TEMP
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | False |
The Id of the team member. |
| FirstName | String | False |
The first name of the team member. |
| LastName | String | False |
The last name of the team member. |
| String | False |
The email address of the team member. | |
| Status | String | False |
Whether the team member is ACTIVE or INACTIVE. 使用できる値は次のとおりです。ACTIVE, INACTIVE |
| CreatedAt | Datetime | False |
The time when the team member entity was created. |
| UpdatedAt | Datetime | False |
The time when the team member entity was last updated. |
| PhoneNumber | String | False |
The phone number of the team member. |
| ReferenceId | String | False |
A second ID used to associate the team member with an entity in another system. |
| IsOwner | Boolean | False |
Whether the team member is the owner of the Square account. |
| AssignmentType | String | False |
The current assignment type of the team member. |
| LocationId | String | False |
The locations that the team member is assigned to. |
Pseudo column fields are used in the WHERE clause of SELECT statements (unless stated otherwise) and offer a more granular control over the tuples that are returned from the data source.
| Name | Type | Description |
| IdempotencyKey | String |
A unique string that identifies this CreatePayment request. Keys can be any valid string but must be unique for every CreatePayment request. |
Create, update, and query the available Vendors in Square.
The Cloud uses the Square API to process the following search criteria:
List all vendors. This will list both active and inactive vendors.
SELECT * from Vendors;
Retrieve a vendor through its 'Id':
SELECT * from Vendors WHERE Id = 'F5MMNGPNW2IZVRB2';
Retrieve a vendor through its 'Name':
SELECT * from Vendors WHERE Name = 'new-vendor';
List only active vendors:
SELECT * FROM Vendors WHERE Status = 'ACTIVE';
List only inactive vendors:
SELECT * FROM Vendors WHERE Status = 'INACTIVE';
To create a Vendor, the field 'Name' is required.
INSERT INTO Vendors (Name, AddressAddressLine1, AddressAddressLine2, AddressAddressLine3, AddressLocality, AddressSublocality, AddressSublocality2, AddressSublocality3, AddressAdministrativeDistrictLevel1, AddressAdministrativeDistrictLevel2, AddressAdministrativeDistrictLevel3, AddressPostalCode, AddressCountry, AddressFirstName, AddressLastName, AccountNumber, Note, Status) VALUES ('insert_4', 'a', 'b', 'c', 'locality', 'sub', 'sub2', 'sub3', 'AddressAdministrativeDistrictLevel1', 'AddressAdministrativeDistrictLevel2', 'AddressAdministrativeDistrictLevel3', '134003', 'IN', 'AddressFirstName', 'AddressLastName', '1234567890', 'this is a note.', 'ACTIVE');
INSERT INTO Vendors (Name, AccountNumber, Note, Status, Contacts) VALUES ('insert_8', '1234567890', 'this is a note.', 'ACTIVE', '[{"ordinal": 0, "name": "first_contact", "phone_number": "1234567890", "removed": false}, {"ordinal": 1, "name": "first_contact2", "phone_number": "1234567891", "removed": false}]');
To update a Vendor record, the field 'Version' is required. The value which should be supplied to this field must be the same one the record currently has.
UPDATE Vendors SET Name = 'updated', AddressAddressLine1 = 'updated', AddressAddressLine2 = 'updated', AddressAddressLine3 = 'updated', AddressLocality = 'updated', AddressSublocality = 'updated', AddressSublocality2 = 'updated', AddressSublocality3 = 'updated', AddressAdministrativeDistrictLevel1 = 'updated', AddressAdministrativeDistrictLevel2 = 'updated', AddressAdministrativeDistrictLevel3 = 'updated', AddressPostalCode = 'updated', AddressCountry = 'AU', AddressFirstName = 'updated', AddressLastName = 'updated', Contacts = '[{"ordinal": 2,"email_address": "[email protected]","name": "updated1","phone_number": "5645645645","removed": false}, {"ordinal": 3,"email_address": "[email protected]","name": "updated2","phone_number": "1233211233","removed": false}]', AccountNumber = '9346', Note = 'updated', Version = 3, Status = 'INACTIVE' WHERE Id = 'YEA4LD6WXX6BJUZT';
Maximum BatchSize supported by Vendors is 100.
You can create Vendors in bulk using TEMP tables.
INSERT INTO Vendors#TEMP (Name, AddressCountry) VALUES ('s1', 'IN');
INSERT INTO Vendors#TEMP (Name, AddressCountry) VALUES ('s2', 'IN');
INSERT INTO Vendors (Name, AddressCountry) SELECT Name, Contacts FROM Vendors#TEMP;
Maximum BatchSize supported by Vendors is 100.
Vendors van be updated in bulk using their Ids.
INSERT INTO Vendors#TEMP (Id, Version, AddressCountry) VALUES ('SUKM5RFPH6T4CWTW',5,'IN');
INSERT INTO Vendors#TEMP (Id, Version, AddressCountry) VALUES ('RCWAADSCRNBVER3W',9,'IN');
UPDATE Vendors (Id, Version, AddressCountry) SELECT Id, Version, AddressCountry FROM Vendors#TEMP;
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
A unique Square-generated ID for the Vendor. |
| CreatedAt | Datetime | True |
An RFC 3339-formatted timestamp that indicates when the Vendor was created. |
| UpdatedAt | Datetime | True |
An RFC 3339-formatted timestamp that indicates when the Vendor was last updated. |
| Name | String | False |
The name of the Vendor. |
| AddressAddressLine1 | String | False |
The first line of the address. |
| AddressAddressLine2 | String | False |
The second line of the address, if any. |
| AddressAddressLine3 | String | False |
The third line of the address, if any. |
| AddressLocality | String | False |
The city or town of the address. |
| AddressSublocality | String | False |
A civil region within the address's locality, if any. |
| AddressSublocality2 | String | False |
A civil region within the address's sublocality, if any. |
| AddressSublocality3 | String | False |
A civil region within the address's Sublocality2, if any. |
| AddressAdministrativeDistrictLevel1 | String | False |
A civil entity within the address's country. In the US, this is the state. |
| AddressAdministrativeDistrictLevel2 | String | False |
A civil entity within the address's AdministrativeDistrictLevel1. In the US, this is the county. |
| AddressAdministrativeDistrictLevel3 | String | False |
A civil entity within the address's AdministrativeDistrictLevel2, if any. |
| AddressPostalCode | String | False |
The address's postal code. |
| AddressCountry | String | False |
The address's country, in the two-letter format of ISO 3166. For example, US or FR. 使用できる値は次のとおりです。ZZ, AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MH, MK, ML, MM, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PS, PT, PW, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VI, VN, VU, WF, WS, YE, YT, ZA, ZM, ZW |
| AddressFirstName | String | False |
Optional first name when it's representing recipient. |
| AddressLastName | String | False |
Optional last name when it's representing recipient. |
| Contacts | String | False |
The contacts of the Vendor. |
| AccountNumber | String | False |
The account number of the Vendor. |
| Note | String | False |
A note detailing information about the Vendor. |
| Version | Integer | False |
The version of the Vendor. This column must not be set when executing INSERT operations. |
| Status | String | False |
The status of the Vendor. |
ビューは、データを示すという点でテーブルに似ていますが、ビューは読み取り専用です。
クエリは、ビューに対して通常のテーブルと同様に実行することができます。
| Name | Description |
| BankAccounts | Query the Bank Accounts of the merchant. |
| Bookings | Lists all bookings. |
| BusinessBookingProfile | Retrieves a seller's booking profile. |
| Catalog | Returns a list of all CatalogObjects. |
| LocationBookingProfiles | Lists location booking profiles of a seller. |
| Merchants | Query the available merchants in Square. |
| OrderDiscounts | Returns all discounts applied to a specific Square order, including fixed and percentage-based discounts, their scope, and related catalog details. |
| OrderEntries | A list of OrderEntries that fit the query conditions. |
| OrderItems | The order items included in the order. Every order has at least one order item. |
| Orders | Orders specify products for purchase, along with discounts, taxes, and other settings to apply to the purchase. |
| OrderTaxes | Returns all taxes applied to a specific Square order, including percentage‑based and fixed‑amount taxes, their scope, and related catalog details. |
| PayoutEntries | Retrieves a list of all payout entries for a specific payout. |
| Payouts | Retrieves a list of all payouts for the default location. |
| Sites | Lists the Square Online sites that belong to a seller. |
| SubscriptionEvents | Returns all events that have occurred for a specific Square subscription, including plan changes, phase transitions, cancellations, and other subscription lifecycle updates. |
| TeamMemberBookingProfiles | Lists booking profiles for team members. |
Query the Bank Accounts of the merchant.
| Name | Type | Description |
| Id [KEY] | String | The Square-issued Id of the bank account. |
| LocationId | String | The Id of the location. |
| BankName | String | The name of the bank that manages the account. |
| Name | String | The name associated with the bank account. |
| Type | String | The type of the bank account. For example, savings or checking. |
| Country | String | The ISO 3166 Alpha 2 country code where the bank account is based. |
| AccountNumberSuffix | String | The last few digits of the bank account number. |
| CurrencyCode | String | The code of the currency associated with the bank account. |
| PrimaryBankIdentificationNumber | String | Primary identifier for the bank. |
| Status | String | The current verification status of this BankAccount object. |
| Creditable | Boolean | Indicates whether it is possible for Square to send money to this bank account. |
| Debitable | Boolean | Indicates whether it is possible for Square to take money from this bank account. |
| Version | Int64 | The current version of the BankAccount. |
Lists all bookings.
The Cloud uses the Square API to process search criteria that refer to the Id column, while other filters are processed client side within the Cloud.
Retrieve all the bookings.
SELECT * from Bookings
Retrieve a booking.
SELECT * from Bookings where Id = 'zkras0xv0xwswx'
| Name | Type | Description |
| Id [KEY] | String | A unique ID of this object representing a booking. |
| LocationId | String | The ID of the Location object representing the location where the booked service is provided. |
| CustomerId | String | The ID of the Customer object representing the customer receiving the booked service. |
| CustomerNote | String | The free-text field for the customer to supply notes about the booking. |
| SellerNote | String | The free-text field for the seller to supply notes about the booking. |
| Status | String | The status of the booking, describing where the booking stands with respect to the booking state machine. |
| AppointmentSegmentsDurationMinutes | Int32 | The time span in minutes of an appointment segment for this booking. |
| AppointmentSegmentsServiceVariationId | String | The ID of the CatalogItemVariation object representing the service booked in this segment. |
| AppointmentSegmentsTeamMemberId | String | The ID of the TeamMember object representing the team member booked in this segment. |
| AppointmentSegmentsServiceVariationVersion | Int64 | The current version of the item variation representing the service booked in this segment. |
| AppointmentSegmentsIntermissionMinutes | Int32 | Time between the end of this segment and the beginning of the subsequent segment. |
| AppointmentSegmentsAnyTeamMember | Boolean | Whether the customer accepts any team member, instead of a specific one, to serve this segment. |
| AppointmentSegmentsResourceIds | String | The IDs of the seller-accessible resources used for this appointment segment. |
| TransitionTimeMinutes | Int32 | Additional time at the end of a booking. |
| AllDay | Boolean | Whether the booking is of a full business day. |
| LocationType | String | The type of location where the booking is held. |
| CreatorType | String | The seller-accessible type of the creator of the booking. |
| CreatorTeamMemberId | String | The ID of the team member who created the booking, when the booking creator is of the TEAM_MEMBER type. Access to this field requires seller-level permissions. |
| CreatorCustomerId | String | The ID of the customer who created the booking, when the booking creator is of the CUSTOMER type. Access to this field requires seller-level permissions. |
| Version | Int32 | The revision number for the booking used for optimistic concurrency. |
| CreatedAt | Datetime | The RFC 3339 timestamp specifying the creation time of this booking. |
| UpdatedAt | Datetime | The RFC 3339 timestamp specifying the most recent update time of this booking. |
| StartAt | Datetime | The RFC 3339 timestamp specifying the starting time of this booking. |
| Source | String | The source of the booking. Access to this field requires seller-level permissions. |
Retrieves a seller's booking profile.
The Cloud will execute all filters to this view client-side, in memory.
Retrieve a seller's booking profile attached to your Square account.
SELECT * from BusinessBookingProfile
| Name | Type | Description |
| SellerId [KEY] | String | The ID of the seller. |
| CreatedAt | Datetime | The RFC 3339 timestamp specifying the booking's creation time. |
| BookingEnabled | Boolean | Indicates whether the seller is open for booking. |
| CustomerTimezoneChoice | String | The Square online booking site and all notifications to customers uses either the seller location’s time zone or the time zone the customer chooses at booking. |
| BookingPolicy | String | The policy for the seller to automatically accept booking requests (ACCEPT_ALL) or not (REQUIRES_ACCEPTANCE). |
| AllowUserCancel | Boolean | Indicates whether customers can cancel or reschedule their own bookings (true) or not (false). |
| BusinessAppointmentSettings | String | Settings for appointment-type bookings. |
| SupportSellerLevelWrites | Boolean | Indicates whether the seller's subscription to Square Appointments supports creating, updating or canceling an appointment through the API (true) or not (false) using seller permission. |
Returns a list of all CatalogObjects.
The Cloud will execute all filters to this view client-side, in memory.
Retrieve the list of all CatalogObjects.
SELECT * from Catalog
| Name | Type | Description |
| Id [KEY] | String | A unique identifier to reference this object in the catalog. |
| Type | String | The catalog type of this object.
使用できる値は次のとおりです。ITEM, IMAGE, CATEGORY, ITEM_VARIATION, TAX, DISCOUNT, MODIFIER_LIST, MODIFIER, PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT, SUBSCRIPTION_PLAN_VARIATION, ITEM_OPTION, ITEM_OPTION_VAL, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNTS_SETTINGS, SUBSCRIPTION_PLAN, AVAILABILITY_PERIOD |
| UpdatedAt | Datetime | Last modification timestamp in RFC 3339 format. |
| Version | Int64 | The version of the object. |
| IsDeleted | Boolean | If true, the object has been deleted from the database. When deleted, the UpdatedAt field will equal the deletion time. |
| PresentAtAllLocations | Boolean | If true, this object is present at all locations (including future locations), except where specified in the AbsentAtLocationIds field. If false, this object is not present at any locations (including future locations), except where specified in the PresentAtLocationIds field. If not specified, defaults to true. |
| PresentAtLocationIds | String | A list of locations where the object is present, even if PresentAtAllLocations is false. |
| AbsentAtLocationIds | String | A list of locations where the object is not present, even if PresentAtAllLocations is true. |
| ItemData | String | Structured data for a CatalogItem, set for CatalogObjects of type ITEM. This field is populated only if the Catalog type is ITEM. |
| CategoryData | String | Structured data for a CatalogCategory, set for CatalogObjects of type CATEGORY. This field is populated only if the Catalog type is CATEGORY. |
| ItemVariationData | String | Structured data for a CatalogItemVariation, set for CatalogObjects of type ITEM_VARIATION. This field is populated only if the Catalog type is ITEM_VARIATION. |
| TaxData | String | Structured data for a CatalogTax, set for CatalogObjects of type TAX. This field is populated only if the Catalog type is TAX. |
| DiscountData | String | Structured data for a CatalogDiscount, set for CatalogObjects of type DISCOUNT. This field is populated only if the Catalog type is DISCOUNT. |
| ModifierListData | String | Structured data for a CatalogModifierList, set for CatalogObjects of type MODIFIER_LIST. This field is populated only if the Catalog type is MODIFIER_LIST. |
| ModifierData | String | Structured data for a CatalogModifier, set for CatalogObjects of type MODIFIER. This field is populated only if the Catalog type is MODIFIER. |
| TimePeriodData | String | Structured data for a CatalogTimePeriod, set for CatalogObjects of type TIME_PERIOD. This field is populated only if the Catalog type is TIME_PERIOD. |
| ProductSetData | String | Structured data for a CatalogProductSet, set for CatalogObjects of type PRODUCT_SET. This field is populated only if the Catalog type is PRODUCT_SET. |
| PricingRuleData | String | Structured data for a CatalogPricingRule, set for CatalogObjects of type PRICING_RULE. This field is populated only if the Catalog type is PRICING_RULE. |
| ImageData | String | Structured data for a CatalogImage, set for CatalogObjects of type IMAGE. This field is populated only if the Catalog type is IMAGE. |
| MeasurementUnitData | String | Structured data for a CatalogMeasurementUnit, set for CatalogObjects of type MEASUREMENT_UNIT. This field is populated only if the Catalog type is MEASUREMENT_UNIT. |
| SubscriptionPlanData | String | Structured data for a CatalogSubscriptionPlan, set for CatalogObjects of type SUBSCRIPTION_PLAN. This field is populated only if the Catalog type is SUBSCRIPTION_PLAN. |
| ItemOptionData | String | Structured data for a CatalogItemOption, set for CatalogObjects of type ITEM_OPTION. This field is populated only if the Catalog type is ITEM_OPTION. |
| ItemOptionValueData | String | Structured data for a CatalogItemOptionValue, set for CatalogObjects of type ITEM_OPTION_VAL. This field is populated only if the Catalog type is ITEM_OPTION_VAL. |
| CustomAttributeDefinitionData | String | Structured data for a CatalogCustomAttributeDefinition, set for CatalogObjects of type CUSTOM_ATTRIBUTE_DEFINITION. This field is populated only if the Catalog type is CUSTOM_ATTRIBUTE_DEFINITION. |
| SubscriptionPlanVariationData | String | Structured data for a CatalogSubscriptionPlanVariation, set for CatalogObjects of type SUBSCRIPTION_PLAN_VARIATION. This field is populated only if the Catalog type is SUBSCRIPTION_PLAN_VARIATION. |
Lists location booking profiles of a seller.
The Cloud uses the Square API to process search criteria that refer to the LocationId column, while other filters are processed client side within the Cloud.
Retrieve all the LocationBookingProfiles of a seller attached to your Square account.
SELECT * from LocationBookingProfiles
Retrieve the LocationBookingProfile for a particular location.
SELECT * from LocationBookingProfiles where LocationId = '92BYHNBR6W77E'
| Name | Type | Description |
| LocationId [KEY] | String | The Id of the location. |
| BookingSiteUrl | String | URL for the online booking site for this location. |
| OnlineBookingEnabled | Boolean | Indicates whether the location is enabled for online booking. |
Query the available merchants in Square.
The Cloud uses the Square API to process search criteria that refer to the Id column, while other filters are processed client side within the Cloud.
Retrieve all the merchants in your Square account.
SELECT * FROM Merchants
Specify Id in the WHERE clause using the = operator:
SELECT * FROM Merchants WHERE Id = 'CD215R7H3340KCD'
| Name | Type | Description |
| Id [KEY] | String | The Id of the merchant. |
| BusinessName | String | The merchant's business name. |
| Country | String | The merchant's country. |
| Currency | String | The merchant's currency. |
| Status | String | The merchant's status. |
| LanguageCode | String | Code of the language. |
| MainLocationId | String | The ID of the main Location for this merchant. |
| CreatedAt | Datetime | The time when the location was created, in RFC 3339 format. |
Returns all discounts applied to a specific Square order, including fixed and percentage-based discounts, their scope, and related catalog details.
The Cloud uses the Square API to process search criteria that refer to the OrderId and LocationId, while other filters are processed client side within the Cloud.
Retrieve all the OrderDiscounts found in every order of your Square account.
SELECT * FROM OrderDiscounts
You can retrieve all order OrderDiscounts from an order by specifying the OrderId.
SELECT * FROM OrderDiscounts WHERE OrderId = 'TzratjkPk9rhOuLYvSXeznmVvIx5PVlZpg72GfPQGBxckDeeWNBN8yqnf11qTrg3W3AelXC1kB'
You can also use the IN operator to specify multiple OrderIds in the WHERE clause.
SELECT * FROM OrderDiscounts WHERE OrderId IN ('XKKB7LD30TpfNyW3e843ziklKh4vWEvweQyL5l4ESJLH3N2XXNBN8yqnf11qTrg3W3AelXC1kB', 'pxICohrEXPDtoUitiZhG1um5uhp5WI7CRMHknbuKpaj53PXfWNBN8yqnf11qTrg3W3AelXC1kB', '6j8avtXB5fIaPZ9H12beiZP7sCSiqguGhHpwmECsEaENswJnWNBN8yqnf11qTrg3W3AelXC1kB')
| Name | Type | Description |
| Id | String | A unique Id that identifies the discount only within this order. |
| LocationId | String | Id of the seller location where the order was placed. |
| AppliedAmount | Integer | Actual monetary amount of the discount applied to the order or line item, expressed in the smallest currency unit (for example, cents). |
| AppliedCurrency | String | The type of currency, in ISO 4217 format. |
| AmountMoneyAmount | Integer | Declared fixed amount for the discount in the smallest currency unit. Not set for percentage-based discounts. |
| AmountMoneyCurrency | String | The type of currency, in ISO 4217 format. |
| Name | String | Display name of the discount, as shown in receipts, invoices, or customer‑facing order summaries. |
| Percentage | String | The percentage of the discount. |
| Scope | String | Indicates the level at which the discount applies.
使用できる値は次のとおりです。OTHER_DISCOUNT_SCOPE, LINE_ITEM, ORDER |
| Type | String | The type of discount.
使用できる値は次のとおりです。UNKNOWN_DISCOUNT, FIXED_PERCENTAGE, FIXED_AMOUNT, VARIABLE_PERCENTAGE, VARIABLE_AMOUNT |
| CatalogObjectId | String | Identifier of the catalog discount object associated with this discount, if applicable. |
| CatalogVersion | Int64 | The version of the catalog object that this discount references. |
| OrderId | String | Unique identifier of the order that the discount is associated with. |
A list of OrderEntries that fit the query conditions.
The Cloud uses the Square API to process list of OrderEntries that fit the query conditions;.
Retrieve all the OrderEntries found in your Square account.
SELECT * FROM OrderEntries
| Name | Type | Description |
| LocationId | String | The Id of the location. |
| CreatedAt | Datetime | Created timestamp. |
| LineItems | String | Order Line Items. |
| OrderId | String | The Id of the Order. |
| Source | String | The origination details of the order. |
| UpdatedAt | Datetime | The time when the location was updated, in RFC 3339 format |
| Version | Integer | The version number, which is incremented each time an update is committed to the order. |
The order items included in the order. Every order has at least one order item.
The Cloud uses the Square API to process search criteria that refer to the OrderId column, while other filters are processed client side within the Cloud.
Retrieve all the OrderItems found in every order of your Square account. Only orders that have been successfully charged are included in the response.
SELECT * FROM OrderItems
You can retrieve all order items from an order by specifying the OrderId.
SELECT * FROM OrderItems WHERE OrderId = 'TzratjkPk9rhOuLYvSXeznmVvIx5PVlZpg72GfPQGBxckDeeWNBN8yqnf11qTrg3W3AelXC1kB'
You can also use the IN operator to specify multiple OrderIds in the WHERE clause.
SELECT * FROM OrderItems WHERE OrderId IN ('XKKB7LD30TpfNyW3e843ziklKh4vWEvweQyL5l4ESJLH3N2XXNBN8yqnf11qTrg3W3AelXC1kB', 'pxICohrEXPDtoUitiZhG1um5uhp5WI7CRMHknbuKpaj53PXfWNBN8yqnf11qTrg3W3AelXC1kB', '6j8avtXB5fIaPZ9H12beiZP7sCSiqguGhHpwmECsEaENswJnWNBN8yqnf11qTrg3W3AelXC1kB')
| Name | Type | Description |
| OrderId [KEY] | String | The order's unique ID. |
| OrderItemNumber [KEY] | Integer | The nth item of the order. |
| LocationId | String | The Id of the location. |
| Name | String | The name of the order item. |
| Quantity | String | The quantity purchased, as a string representation of a number. |
| Note | String | The note of the order item. |
| CatalogObjectId | String | The CatalogItemVariation id applied to this order item. |
| VariationName | String | The name of the variation applied to this order item. |
| Taxes | String | The taxes applied to this order item. |
| Discounts | String | The discounts applied to this order item. |
| Modifiers | String | The CatalogModifiers applied to this order item. |
| BasePriceMoneyAmount | Integer | The base price for a single unit of the order item. |
| BasePriceMoneyCurrency | String | The currency of the base price for a single unit of the order item. |
| GrossSalesMoneyAmount | Integer | The gross sales amount of money calculated as (item base price + modifiers price) * quantity. |
| GrossSalesMoneyCurrency | String | The currency of the gross sales. |
| TotalTaxMoney | Integer | The total tax amount of money to collect for the order item. |
| TotalTaxMoneyCurrency | String | The currency of the total tax amount of money to collect for the order item. |
| TotalDiscountMoneyAmount | Integer | The total discount amount of money to collect for the order item. |
| TotalDiscountMoneyCurrency | String | The currency of the total discount amount of money to collect for the order item. |
| TotalMoneyAmount | Integer | The total amount of money to collect for this order item. |
| TotalMoneyCurrency | String | The currency of the total amount of money to collect for this order item. |
Orders specify products for purchase, along with discounts, taxes, and other settings to apply to the purchase.
The Cloud uses the Square API to process search criteria that refer to the Id column, while other filters are processed client side within the Cloud.
Retrieve all the orders in your Square account. Only orders that have been successfully charged are included in the response.
SELECT * FROM Orders
Specify multiple Ids in the WHERE clause using the IN operator:
SELECT * FROM Orders WHERE Id IN ('XKKB7LD30TpfNyW3e843ziklKh4vWEvweQyL5l4ESJLH3N2XXNBN8yqnf11qTrg3W3AelXC1kB', 'pxICohrEXPDtoUitiZhG1um5uhp5WI7CRMHknbuKpaj53PXfWNBN8yqnf11qTrg3W3AelXC1kB', '6j8avtXB5fIaPZ9H12beiZP7sCSiqguGhHpwmECsEaENswJnWNBN8yqnf11qTrg3W3AelXC1kB')
| Name | Type | Description |
| Id [KEY] | String | The order's unique ID |
| ReferenceId | String | A client specified identifier to associate an entity in another system with this order |
| LocationId | String | The Id of the location |
| CreatedAt | Datetime | The time when the location was created in RFC 3339 format |
| CustomerId | String | The ID of the customer associated with the order |
| Discounts | String | The list of all discounts associated with the order |
| LineItems | String | The line items included in the order |
| NetDueAmount | Integer | The amount of money in the smallest denomination of the currency indicated by currency |
| NetDueCurrency | String | The type of currency in ISO 4217 format |
| NetDiscountAmount | Integer | The amount of money in the smallest denomination of the currency indicated by currency |
| NetDiscountCurrency | String | The type of currency in ISO 4217 format |
| NetServiceChargeAmount | Integer | The amount of money in the smallest denomination of the currency indicated by currency |
| NetServiceChargeCurrency | String | The type of currency in ISO 4217 format |
| NetTaxAmount | Integer | The amount of money in the smallest denomination of the currency indicated by currency |
| NetTaxCurrency | String | The type of currency in ISO 4217 format |
| NetTipAmount | Integer | The amount of money in the smallest denomination of the currency indicated by currency |
| NetTipCurrency | String | The type of currency in ISO 4217 format |
| NetTotalAmount | Integer | The amount of money in the smallest denomination of the currency indicated by currency |
| NetTotalCurrency | String | The type of currency in ISO 4217 format |
| PricingAutoApplyDiscounts | Boolean | The option to determine whether pricing rule-based discounts are automatically applied to an order |
| SourceName | String | The name used to identify the place physical or digital that an order originates |
| State | String | The current state of the order |
| Taxes | String | The list of all taxes associated with the order |
| Tenders | String | The tenders that were used to pay for the order |
| TotalDiscountAmount | Integer | The amount of money, in the smallest denomination of the currency indicated by currency |
| TotalDiscountCurrency | String | The type of currency in ISO 4217 format |
| TotalAmount | Integer | The amount of money, in the smallest denomination of the currency indicated by currency |
| TotalCurrency | String | The type of currency in ISO 4217 format |
| ServiceChargeAmount | Integer | The amount of money, in the smallest denomination of the currency indicated by currency |
| ServiceChargeCurrency | String | The type of currency in ISO 4217 format |
| TaxAmount | Integer | The total amount of tax money to collect for the order |
| TaxCurrency | String | The type of currency, in ISO 4217 format |
| TipAmount | Integer | The total amount of tip money to collect for the order |
| TipCurrency | String | The type of currency, in ISO 4217 format |
| UpdatedAt | Datetime | The time when the location was updated, in RFC 3339 format |
| Version | Int64 | The version number, which is incremented each time an update is committed to the order |
Pseudo column fields are used in the WHERE clause of SELECT statements (unless stated otherwise) and offer a more granular control over the tuples that are returned from the data source.
| Name | Type | Description |
| FulfillmentState | String | A list of fulfillment states to filter for. The list returns orders if any of its fulfillments match any of the fulfillment states listed in this field. |
| FulfillmentType | String | A list of fulfillment types to filter for. The list returns orders if any of its fulfillments match any of the fulfillment types listed in this field. |
Returns all taxes applied to a specific Square order, including percentage‑based and fixed‑amount taxes, their scope, and related catalog details.
The Cloud uses the Square API to process search criteria that refer to the OrderId and LocationId column, while other filters are processed client side within the Cloud.
Retrieve all the OrderTaxes found in every order of your Square account.
SELECT * FROM OrderTaxes
You can retrieve all order OrderTaxes from an order by specifying the OrderId.
SELECT * FROM OrderTaxes WHERE OrderId = 'TzratjkPk9rhOuLYvSXeznmVvIx5PVlZpg72GfPQGBxckDeeWNBN8yqnf11qTrg3W3AelXC1kB'
You can also use the IN operator to specify multiple OrderIds in the WHERE clause.
SELECT * FROM OrderTaxes WHERE OrderId IN ('XKKB7LD30TpfNyW3e843ziklKh4vWEvweQyL5l4ESJLH3N2XXNBN8yqnf11qTrg3W3AelXC1kB', 'pxICohrEXPDtoUitiZhG1um5uhp5WI7CRMHknbuKpaj53PXfWNBN8yqnf11qTrg3W3AelXC1kB', '6j8avtXB5fIaPZ9H12beiZP7sCSiqguGhHpwmECsEaENswJnWNBN8yqnf11qTrg3W3AelXC1kB')
| Name | Type | Description |
| Id | String | A unique Id that identifies the tax only within this order. |
| LocationId | String | Id of the seller location where the order was placed. |
| AppliedAmount | Int64 | Actual monetary amount of tax applied to the order or line item, expressed in the smallest currency unit (for example, cents). |
| AppliedCurrency | String | The type of currency, in ISO 4217 format. |
| Name | String | Display name of the tax, as shown in receipts, invoices, or order summaries. |
| Percentage | String | The percentage of the tax. |
| Scope | String | Indicates the level at which the discount applies.
使用できる値は次のとおりです。OTHER_DISCOUNT_SCOPE, LINE_ITEM, ORDER |
| Type | String | Indicates the calculation method used to apply the tax.
使用できる値は次のとおりです。UNKNOWN_DISCOUNT, FIXED_PERCENTAGE, FIXED_AMOUNT, VARIABLE_PERCENTAGE, VARIABLE_AMOUNT |
| CatalogObjectId | String | Identifier of the catalog tax object associated with this tax, if applicable. |
| CatalogVersion | Int64 | The version of the catalog object that this tax references. |
| OrderId | String | Unique identifier of the order that the tax is associated with. |
Retrieves a list of all payout entries for a specific payout.
The Cloud uses the Square API to process the PayoutId filter, while other filters are processed client side within the Cloud.
Retrieves a list of all payout entries for a specific payout. PayoutId is required to fetch PayoutEntries:
SELECT * FROM PayoutEntries where PayoutId='po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6'
| Name | Type | Description |
| PayoutId | String | The ID of the payout to retrieve the information for. |
| Id [KEY] | String | A unique ID for the payout entry. |
| Type | String | The type of activity associated with this payout entry. |
| FeeAmountMoneyAmount | Integer | The amount of money, in the smallest denomination of the currency indicated by currency. |
| FeeAmountMoneyCurrencyCode | String | The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. |
| GrossAmountMoneyAmount | Integer | The amount of money, in the smallest denomination of the currency indicated by currency. |
| GrossAmountMoneyCurrencyCode | String | The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. |
| NetAmountMoneyAmount | Integer | The amount of money, in the smallest denomination of the currency indicated by currency. |
| NetAmountMoneyCurrencyCode | String | The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. |
| TypeChargeDetailsPaymentId | String | The ID of the payment associated with this activity. |
| TypeRefundDetailsPaymentId | String | The ID of the payment associated with this activity. |
| TypeRefundDetailsRefundId | String | The ID of the refund associated with this activity. |
| EffectiveAt | Datetime | The timestamp of when the payout entry affected the balance, in RFC 3339 format. |
| TypeAppFeeRevenueDetailsPaymentId | String | The ID of the payment associated with this activity. |
| TypeAppFeeRevenueDetailsLocationId | String | The ID of the location of the merchant associated with the payment activity. |
| TypeAppFeeRefundDetailsPaymentId | String | Details of a refund for an app fee on a payment. |
| TypeAppFeeRefundDetailsLocationId | String | The ID of the location of the merchant associated with the payment refund activity. |
| TypeAppFeeRefundDetailsRefundId | String | The ID of the refund associated with this activity. |
| TypeAutomaticSavingsDetailsPaymentId | String | The ID of the payment associated with this activity. |
| TypeAutomaticSavingsDetailsPayoutId | String | The ID of the payout associated with this activity. |
| TypeAutomaticSavingsReversedDetailsPaymentId | String | The ID of the payment associated with this activity. |
| TypeAutomaticSavingsReversedDetailsPayoutId | String | The ID of the payout associated with this activity. |
| TypeDepositFeeDetailsPayoutId | String | The ID of the payout that triggered this deposit fee activity. |
| TypeDisputeDetailsPaymentId | String | The ID of the payment associated with this activity. |
| TypeDisputeDetailsDisputeId | String | The ID of the dispute associated with this activity. |
| TypeFeeDetailsPaymentId | String | The ID of the payment associated with this activity This will only be populated when a principal LedgerEntryToken is also populated. |
| TypeFreeProcessingDetailsPaymentId | String | The ID of the payment associated with this activity. |
| TypeHoldAdjustmentDetailsPaymentId | String | The ID of the payment associated with this activity. |
| TypeOpenDisputeDetailsPaymentId | String | The ID of the payment associated with this activity. |
| TypeOpenDisputeDetailsDisputeId | String | The ID of the dispute associated with this activity. |
| TypeOtherDetailsPaymentId | String | The ID of the payment associated with this activity. |
| TypeOtherAdjustmentDetailsPaymentId | String | The ID of the payment associated with this activity. |
| TypeReleaseAdjustmentDetailsPaymentId | String | The ID of the payment associated with this activity. |
| TypeReleaseHoldDetailsPaymentId | String | The ID of the payment associated with this activity. |
| TypeReleaseReleaseDetailsPaymentId | String | The ID of the payment associated with this activity. |
| TypeSquareCapitalPaymentDetailsPaymentId | String | The ID of the payment associated with this activity. |
| TypeSquareCapitalReversedPaymentDetailsPaymentId | String | The ID of the payment associated with this activity. |
| TypeTaxOnFeeDetailsPaymentId | String | The ID of the payment associated with this activity. |
| TypeTaxOnFeeDetailsTaxRateDescription | String | The description of the tax rate being applied. For example: |
| TypeThirdPartyFeeDetailsPaymentId | String | The ID of the payment associated with this activity. |
| TypeThirdPartyFeeRefundDetailsPaymentId | String | The ID of the payment associated with this activity. |
| TypeThirdPartyFeeRefundDetailsRefundId | String | The public refund id associated with this activity. |
Retrieves a list of all payouts for the default location.
Retrieve the list of all payouts for the default location:
SELECT * FROM Payouts
| Name | Type | Description |
| Id [KEY] | String | A unique ID for the payout. |
| Status | String | The status for the payout. |
| LocationId | String | The ID of the location associated with the payout. |
| CreatedAt | Datetime | The timestamp of when the payout was created and submitted for deposit to the seller's banking destination, in RFC 3339 format. |
| UpdatedAt | Datetime | The timestamp of when the payout was last updated, in RFC 3339 format. |
| AmountMoneyAmount | String | The amount of money, in the smallest denomination of the currency indicated by currency. |
| AmountMoneyCurrencyCode | String | The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. |
| DestinationId | String | Square issued unique ID (also known as the instrument ID) associated with this destination. |
| DestinationType | String | Type of the destination such as a bank account or debit card. |
| Version | Int64 | The version number, which is incremented each time an update is made to this payout record. The version number helps developers receive event notifications or feeds out of order. |
| Type | String | Indicates the payout type. |
| PayoutFeeAmount | String | The money amount of the payout fee. |
| PayoutFeeCurrencyCode | String | The type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. |
| PayoutFeeEffectiveAt | Datetime | The timestamp of when the fee takes effect, in RFC 3339 format. |
| PayoutFeeType | String | The timestamp of when the fee takes effect, in RFC 3339 format. |
| ArrivalDate | Date | The calendar date, in ISO 8601 format (YYYY-MM-DD), when the payout is due to arrive in the seller’s banking destination. |
| EndToEndId | String | A unique ID for each Payout object that might also appear on the seller’s bank statement. |
Lists the Square Online sites that belong to a seller.
The Cloud will execute all filters to this view client-side, in memory.
Retrieve all the sites in your Square account.
SELECT * FROM Sites
| Name | Type | Description |
| Id [KEY] | String | The Square-assigned ID of the site. |
| SiteTitle | String | The title of the site. |
| Domain | String | The domain of the site (without the protocol). |
| IsPublished | Boolean | Indicates whether the site is published. |
| CreatedAt | Datetime | The timestamp of when the site was created, in RFC 3339 format. |
| UpdatedAt | Datetime | The timestamp of when the site was last updated, in RFC 3339 format. |
Returns all events that have occurred for a specific Square subscription, including plan changes, phase transitions, cancellations, and other subscription lifecycle updates.
The Cloud will execute all filters to this view client-side, in memory.
Retrieve the list of all subscription events for a subscription id. The Subscription Id is required to access the view.
SELECT * from SubscriptionEvents where Id = 'fd9d6200-bb12-43c5-9973-070bfc6f5e05'
| Name | Type | Description |
| Id [KEY] | String | Unique Id of the subscription event. |
| SubscriptionEventType | String | Type of event that occurred for the subscription, such as creation, plan change, pause, resume, or cancellation. |
| PlanVariationId | String | The Id of the subscription plan variation associated with the subscription. |
| EffectiveDate | Datetime | The YYYY-MM-DD-formatted date when the subscription event occurred. |
| InfoDetail | String | A human-readable explanation providing context for the event (for example, 'Customer upgraded from Basic to Premium plan.'). |
| InfoCode | String | An info code indicating the subscription event that occurred. |
| PhasesUID | String | The Id of the subscription phase. |
| PhasesOrdinal | Int64 | The index of the phase in total subscription plan. |
| PhasesOrderTemplateId | String | The Id of the order to be used in billing. |
| PhasesPlanPhaseUID | String | UID of the plan's phase as defined in the catalog. |
| SubscriptionId | String | The Id of the subscription associated with the event. |
Lists booking profiles for team members.
The Cloud uses the Square API to process search criteria that refer to the TeamMemberId column, while other filters are processed client side within the Cloud.
Retrieve all the booking profiles for team members.
SELECT * from TeamMemberBookingProfiles
Retrieve a particular team member's booking profile.
SELECT * from TeamMemberBookingProfiles where teammemberid = '_77Nq6SzK0cH2YRX-q9a'
| Name | Type | Description |
| TeamMemberId [KEY] | String | The ID of the TeamMember object for the team member associated with the booking profile. |
| Description | String | The description of the team member. |
| DisplayName | String | The display name of the team member. |
| IsBookable | Boolean | Indicates whether the team member can be booked through the Bookings API or the seller's online booking channel or site (true) or not (false). |
| ProfileImageUrl | String | The URL of the team member's image for the bookings profile. |
ストアドプロシージャはファンクションライクなインターフェースで、Square の単純なSELECT/INSERT/UPDATE/DELETE 処理にとどまらずCloud の機能を拡張します。
ストアドプロシージャは、パラメータのリストを受け取り、目的の機能を実行し、プロシージャが成功したか失敗したかを示すとともにSquare から関連するレスポンスデータを返します。
| Name | Description |
| AddItemImage | Uploads an image file to be represented by a CatalogImage object linked to an existing CatalogObject instance. |
| CancelInvoice | Cancels an invoice. |
| CancelPayment | Cancels (voids) a payment. |
| CancelPaymentByIdempotencyKey | Cancels (voids) a payment identified by the idempotency key that is specified in the request. |
| CancelSubscription | Schedules a CANCEL action to cancel an active subscription. |
| CaptureTransaction | Captures a transaction that was created with the Charge stored procedure with a DelayCapture value of true. |
| Charge | Charges a card represented by a card nonce or a customer's card on file. |
| CompletePayment | Completes (captures) a payment. |
| CreateCatalogImage | Uploads an image file to be represented by a CatalogImage object linked to an existing CatalogObject instance. |
| CreateInvoiceAttachment | Uploads a file and attaches it to an invoice. |
| Createorder | Creates an Order that can then be referenced as OrderId in a request to the Charge endpoint. |
| DeleteInvoiceAttachment | Removes an attachment from an invoice and permanently deletes the file. |
| PublishInvoice | Publishes the specified draft invoice. |
| VoidTransaction | Cancels a transaction that was created with the Charge stored procedure with a DelayCapture value of true. |
Uploads an image file to be represented by a CatalogImage object linked to an existing CatalogObject instance.
You cannot attach an image to a new item without item variations. To create itemVariations, you must insert data in a temporary table called 'CatalogItemVariations#TEMP'.
Example: Create a catalog item variation
INSERT INTO CatalogItemVariations#TEMP (Id, Name, PriceMoneyAmount, PriceMoneyCurrency, PricingType) VALUES ('#456', 'Image Test Variation', '250000', 'USD', 'FIXED_PRICING')
After creating at least one item variation, you can execute the stored procedure.
EXECUTE AddItemImage ObjectId = '#123', ImageId = 'MMMY47ZSOGZ27RHPPDCTVSK2', ItemDataName = 'CreateItem', ItemDataProductType = 'APPOINTMENTS_SERVICE', ItemDataVariations = 'CatalogItemVariations#TEMP'
| Name | Type | Required | Description |
| ObjectId | String | True | Unique ID of the CatalogObject to attach to this CatalogImage. Leave this field empty to create unattached images |
| AbsentAtLocationIds | String | False | A comma separated list of locations where the object is not present, even if present_at_all_locations is true. This can include locations that are deactivated. |
| CatalogV1Ids | String | False | The Connect v1 IDs for this object at each location where it is present, where they differ from the object's Connect V2 ID. The field will only be present for objects that have been created or modified by legacy APIs. |
| ImageId | String | True | Identifies the CatalogImage attached to this CatalogObject. |
| ItemDataAbbreviation | String | False | The text of the item's display label in the Square Point of Sale app. Only up to the first five characters of the string are used. |
| ItemDataAvailableElectronically | Boolean | False | If true, the item can be added to electronically fulfilled orders from the merchant's online store. |
| ItemDataAvailableForPickUp | Boolean | False | If true, the item can be added to pickup orders from the merchant's online store. |
| ItemDataAvailableOnline | Boolean | False | If true, the item can be added to shipping orders from the merchant's online store. |
| ItemDataCategoryId | String | False | The ID of the item's category, if any. |
| ItemDataDescription | String | False | The item's description. |
| ItemDataLabelColor | String | False | The color of the item's display label in the Square Point of Sale app. This must be a valid hex color code. |
| ItemDataModifierListInfo | String | False | A set of CatalogItemModifierListInfo objects representing the modifier lists that apply to this item, along with the overrides and min and max limits that are specific to this item |
| ItemDataName | String | False | The item's name. |
| ItemDataProductType | String | False | The product type of the item. May not be changed once an item has been created. Only items of product type REGULAR or APPOINTMENTS_SERVICE may be created by this API; |
| ItemDataSkipModifierScreen | Boolean | False | If false, the Square Point of Sale app will present the CatalogItem's details screen immediately, allowing the merchant to choose CatalogModifiers before adding the item to the cart. This is the default behavior. If true, the Square Point of Sale app will immediately add the item to the cart with the pre-selected modifiers, and merchants can edit modifiers by drilling down onto the item's details. |
| ItemDataTaxIds | String | False | A set of IDs indicating the taxes enabled for this item. When updating an item, any taxes listed here will be added to the item. |
| ItemDataVariations | String | False | A list of CatalogItemVariation objects for this item. An item must have at least one variation. |
| PresentAtAllLocations | Boolean | False | If true, this object is present at all locations (including future locations), except where specified in the absent_at_location_ids field. If false, this object is not present at any locations (including future locations), except where specified in the present_at_location_ids field. If not specified, defaults to true. |
| PresentAtAllLocationIds | String | False | A comma separated list of locations where the object is present, even if present_at_all_locations is false. This can include locations that are deactivated. |
| ObjectVersion | Integer | False | The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting. |
| Name | Type | Description |
| Success | Boolean | Whether or not the image was attached to the item. |
| ImageId | String | Id of the Image. |
| ObjectId | String | Id of the Catalog Object to which the image is attached. |
Cancels an invoice.
To execute this stored procedure, you need to provide the Id of the invoice and its current version number to cancel.
EXECUTE CancelInvoice InvoiceId = 'inv:0-ChAALv-Dv-66y_I0TT0hCN2UEL0M', InvoiceVersion = 8
| Name | Type | Required | Description |
| InvoiceId | String | True | The ID of the invoice to cancel. |
| InvoiceVersion | String | True | The version of the invoice to cancel. |
| Name | Type | Description |
| * | String | All the output mentioned in the response. |
| Success | String | Whether the operation was successful. |
Cancels (voids) a payment.
You need to provide the PaymentId to execute the stored procedure.
EXECUTE CancelPayment PaymentId = 'fd9d6200-bb12-43c5-9973-070bfc6f5e05'
| Name | Type | Required | Description |
| PaymentId | String | False | The unique ID identifying the payment to be cancel. |
| Name | Type | Description |
| Success | Boolean | Whether the operation is successful or not. |
Cancels (voids) a payment identified by the idempotency key that is specified in the request.
EXEC CancelPaymentByIdempotencyKey
| Name | Type | Required | Description |
| IdempotencyKey | String | False | The idempotency key identifying the payment to be canceled. |
| Name | Type | Description |
| Success | Boolean | Whether the operation is successful or not |
Schedules a CANCEL action to cancel an active subscription.
You need to provide the subscription id of an ACTIVE subscription to execute the stored procedure.
EXECUTE CancelSubscription Id = 'fd9d6200-bb12-43c5-9973-070bfc6f5e05'
| Name | Type | Required | Description |
| Id | String | False | The ID of the subscription to cancel. |
| Name | Type | Description |
| Success | Boolean | Whether the cancellation of the ACTIVE subscription was successful or not. |
| Status | String | The current status of the subscription. |
Captures a transaction that was created with the Charge stored procedure with a DelayCapture value of true.
| Name | Type | Required | Description |
| TransactionId | String | True | The transaction's unique ID, issued by Square payments servers. |
| Name | Type | Description |
| Success | Boolean | Whether the transaction was captured. |
Charges a card represented by a card nonce or a customer's card on file.
You must include in your query either of the following:
Note: If you provide the OrderId, the AmountMoney value must exactly match the TotalMoneyAmount value of the order you have created.
EXECUTE Charge OrderId = 'XKKB7LD30TpfNyW3e843ziklKh4vWEvweQyL5l4ESJLH3N2XXNBN8yqnf11qTrg3W3AelXC1kB', AmountMoney = 55555, AmountMoneyCurrency = 'USD', CardNonce = 'fake-card-nonce-ok', ReferenceId = 'some optional reference id', Note = 'some optional note', ShippingAddressLine1 = '123 Main St', ShippingAddressLocality = 'San Francisco', ShippingAddressAdministrativeDistrictLevel1 = 'CA', ShippingAddressPostalCode = '94114', ShippingAddressCountry= 'US', BillingAddressLine1= '500 Electric Ave', BillingAddressLine2 = 'Suite 600', BillingAddressAdministrativeDistrictLevel1 = 'NY', BillingAddressLocality = 'New York', BillingAddressPostalCode = '10003', BillingAddressCountry = 'US'
| Name | Type | Required | Description |
| IdempotencyKey | String | False | A value you specify that uniquely identifies this transaction among transactions you've created. |
| AmountMoney | String | True | The amount of money to charge. |
| AmountMoneyCurrency | String | True | The value of currency must match the currency associated with the business that is charging the card. |
| CardNonce | String | False | A nonce generated from the SqPaymentForm that represents the card to charge. |
| CustomerCardId | String | False | The ID of the customer card on file to charge. |
| DelayCapture | Boolean | False | If true, the request will only perform an Auth on the provided card. You can then later perform either a Capture or a Void. |
| ReferenceId | String | False | An optional ID you can associate with the transaction for your own purposes. |
| Note | String | False | An optional note to associate with the transaction. |
| CustomerId | String | False | The ID of the customer to associate this transaction with. |
| BuyerEmailAddress | String | False | The buyer's email address, if available. This value is optional, but this transaction is ineligible for chargeback protection if it is not provided. |
| OrderId | String | False | The ID of the order to associate with this transaction. |
| BillingAddressLine1 | String | False | The first line of the address. |
| BillingAddressLine2 | String | False | The second line of the address. |
| BillingAddressLine3 | String | False | The third line of the address. |
| BillingAddressLocality | String | False | The city or town of the address. |
| BillingAddressSubLocality | String | False | A civil region within the address's locality. |
| BillingAddressSubLocality2 | String | False | A civil region within the address's sublocality. |
| BillingAddressSubLocality3 | String | False | A civil region within the address's sublocality_2. |
| BillingAddressAdministrativeDistrictLevel1 | String | False | A civil entity within the address's country. In the US, this is the state. |
| BillingAddressAdministrativeDistrictLevel2 | String | False | A civil entity within the address's administrative_district_level_1. In the US, this is the county. |
| BillingAddressAdministrativeDistrictLevel3 | String | False | A civil entity within the address's administrative_district_level_2. |
| BillingAddressPostalCode | String | False | The address's postal code. |
| BillingAddressCountry | String | False | The address's country, in ISO 3166-1-alpha-2 format. |
| BillingAddressFirstName | String | False | Optional first name when it's representing recipient. |
| BillingAddressLastName | String | False | Optional last name when it's representing recipient. |
| BillingAddressOrganization | String | False | Optional organization name when it's representing recipient. |
| ShippingAddressLine1 | String | False | The first line of the address. |
| ShippingAddressLine2 | String | False | The second line of the address. |
| ShippingAddressLine3 | String | False | The third line of the address. |
| ShippingAddressLocality | String | False | The city or town of the address. |
| ShippingAddressSubLocality | String | False | A civil region within the address's locality. |
| ShippingAddressSubLocality2 | String | False | A civil region within the address's sublocality. |
| ShippingAddressSubLocality3 | String | False | A civil region within the address's sublocality_2. |
| ShippingAddressAdministrativeDistrictLevel1 | String | False | A civil entity within the address's country. In the US, this is the state. |
| ShippingAddressAdministrativeDistrictLevel2 | String | False | A civil entity within the address's administrative_district_level_1. In the US, this is the county. |
| ShippingAddressAdministrativeDistrictLevel3 | String | False | A civil entity within the address's administrative_district_level_2. |
| ShippingAddressPostalCode | String | False | The address's postal code. |
| ShippingAddressCountry | String | False | The address's country, in ISO 3166-1-alpha-2 format. |
| ShippingAddressFirstName | String | False | Optional first name when it's representing recipient. |
| ShippingAddressLastName | String | False | Optional last name when it's representing recipient. |
| ShippingAddressOrganization | String | False | Optional organization name when it's representing recipient. |
| Name | Type | Description |
| Success | Boolean | Whether the transaction was successful. |
| TransactionId | String | The transaction's unique ID, issued by Square payments servers. |
Completes (captures) a payment.
You need to provide the PaymentId to execute the stored procedure.
EXECUTE CompletePayment PaymentId = 'fd9d6200-bb12-43c5-9973-070bfc6f5e05'
| Name | Type | Required | Description |
| PaymentId | String | False | The unique ID identifying the payment to be completed. |
| Name | Type | Description |
| Success | Boolean | Whether the operation is successful or not. |
Uploads an image file to be represented by a CatalogImage object linked to an existing CatalogObject instance.
If you want to create an image without attaching to any Catalog Object
EXECUTE CreateCatalogImage ImageFile = 'C:\\users\\image.png', ImageDataCaption = 'Test Image'
You can upload and attach image to a catalog object by specifying the objectid.
EXECUTE CreateCatalogImage ImageFile = 'C:\\users\\image.png', ImageDataCaption = 'Test Image', ObjectId = 'KGV3QARAJSYCIX4VUJZX64ZX'
You can also suppy the image using its base64 representation using the FileData and FileName parameters.
EXECUTE CreateCatalogImage FileName = 'TestFile.png', FileData = 'iVBORw0KGgoAAAANSUhEUgAAAw8AAAFoCAMAAAAmbDcvAAAABGdBTUEAALGPC==', ImageDataCaption = 'Sample Test Image';
You can also suppy the image by providing an instance of InputStream using the Content and FileName parameters.
In order to specify the value for ImageCatalogV1Ids, you need to create a well defined JSON structure
EXECUTE CreateCatalogImage ImageFile = 'C:\\users\\image.png', ImageDataCaption = 'Test Image', ImageCatalogV1Ids = '[{"catalog_v1_id":"KGV3QARAJSYCIX4VUJZX64ZX","location_id":"29BYHNBR6W77E"}]'
| Name | Type | Required | Description |
| ImageFile | String | False | An image file in JPEG, PJPEG, PNG, or GIF format. |
| ObjectId | String | False | Unique ID of the CatalogObject to attach to this CatalogImage. Leave this field empty to create unattached images |
| ImageAbsentAtLocationIds | String | False | A comma separated list of locations where the object is not present, even if present_at_all_locations is true. This can include locations that are deactivated. |
| ImageCatalogV1Ids | String | False | The Connect v1 IDs for this object at each location where it is present, where they differ from the object's Connect V2 ID. The field will only be present for objects that have been created or modified by legacy APIs. |
| ImageDataCaption | String | True | A caption that describes what is shown in the image. |
| ImageDataName | String | False | The internal name to identify this image in calls to the Square API. |
| ImageDataUrl | String | False | The URL of this image, generated by Square after an image is uploaded using the CreateCatalogImage endpoint. |
| PresentAtAllLocations | Boolean | False | If true, this object is present at all locations (including future locations), except where specified in the absent_at_location_ids field. If false, this object is not present at any locations (including future locations), except where specified in the present_at_location_ids field. If not specified, defaults to true. |
| PresentAtAllLocationIds | String | False | A comma separated list of locations where the object is present, even if present_at_all_locations is false. This can include locations that are deactivated. |
| ObjectVersion | Integer | False | The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting. |
| FileName | String | False | The file name including extension when using Content. |
| FileData | String | False | Base64 string representation of the image content to be used along with FileName. Only used if ImageFile and Content are not set. |
| Name | Type | Description |
| Success | Boolean | Whether or not the image was attached to the item. |
| ImageId | String | Id of the Image. |
| ImageUrl | String | The url of the uploaded image. |
| ImageCaption | String | The caption of the uploaded image. |
| CreatedAt | Datetime | The time at which the image is uploaded. |
| IsDeleted | Boolean | Tells whether the image is deleted or not. |
| PresentAtAllLocations | Boolean | Tells whether the uploaded image is present at all locations or not. |
| Type | String | The type of the uploaded image. |
| UpdatedAt | Datetime | The time at which the uploaded image is updated. |
| Version | String | The version of the uploaded image. |
Uploads a file and attaches it to an invoice.
To execute this stored procedure, you need to provide the InvoiceId for which the attachment will be created and the file path of the attachment.
EXECUTE CreateInvoiceAttachment InvoiceId = 'inv:0-ChAALv-Dv-66y_I0TT0hCN2UEL0M', File = 'D:\\Pictures\\Screenshots\\Screenshot123.png', Description = 'Test Description'
In place of 'File', you can also provide 'FileData' and 'FileName'. The 'FileData' parameter must be populated with the Base64 representation of the file. The 'FileName' parameter must include the file's name, containing its extension.
EXECUTE CreateInvoiceAttachment InvoiceId = 'inv:0-ChBcwd8ZKFkladTOqRCGP3mtEL0M', Description = 'Test', FileName = 'Test.png', FileData = 'iVBORw0KGgoAAAANSUhEUgAAAw8AAAFoCAMAAAAmbDcvAAAABGdBTUEAALGPC==';
You can also provide an instance of an input stream where the file data will be read from. You must also provide a value to the 'FileName' parameter.
| Name | Type | Required | Description |
| InvoiceId | String | True | The ID of the invoice to attach the file to. |
| File | String | False | A file of following content types is allowed: image/gif, image/jpeg, application/pdf, image/png, image/tiff, image/bmp. |
| Description | String | False | The description of the attachment to display on the invoice. |
| FileData | String | False | Base64 string representation of the file content. Only used if File and InputStream are not set. |
| FileName | String | False | The file name along with its extension. Set this when uploading the file using either InputStream or FileData. A file of following content types is allowed: image/gif, image/jpeg, application/pdf, image/png, image/tiff, image/bmp. |
| Name | Type | Description |
| Success | Boolean | Whether or not the file was attached to the invoice. |
| * | String | The fields of the newly created invoice attachment object. |
Creates an Order that can then be referenced as OrderId in a request to the Charge endpoint.
You cannot create an order without order items. To create orderItems, either you must insert data in a temporary table called 'OrderItem#TEMP' or you need to create the JSON structure.
Example: Create three order items
Insert INTO OrderItem#TEMP (Name, Quantity, BasePriceMoneyAmount, BasePriceMoneyCurrency) VALUES ('New York Strip Steak', '1', 1599, 'USD')
Insert INTO OrderItem#TEMP (Name, Quantity, BasePriceMoneyAmount, BasePriceMoneyCurrency) VALUES ('New York Strip Steak-Special', '1', 2599, 'USD')
Insert INTO OrderItem#TEMP (quantity, CatalogObjectId, Modifiers, Discounts) VALUES ('2', 'BEMYCSMIJL46OCDV4KYIKXIB', '[\n" +
" {\n" +
" \"catalog_object_id\": \"CHQX7Y4KY6N5KINJKZCFURPZ\"\n" +
" }\n" +
" ]', '[\n" +
" {\n" +
" \"name\": \"Sale - $1.00 off\",\n" +
" \"amount_money\": {\n" +
" \"amount\": 100,\n" +
" \"currency\": \"USD\"\n" +
" }\n" +
" }\n" +
" ]')
The columns available for this temporary table are the following:
The last three columns are aggregates. You need to create the JSON structure to provide the values to insert. For more information about the specific JSON structure, visit the following link: https://docs.connect.squareup.com/api/connect/v2#type-createorderrequestlineitem
After creating at least one order item, you can execute the stored procedure.
If you want to charge this order, you must set AutoCharge to 'true'.
Note: For adding more than one values to "Taxes" and "Discounts", you can use the OrderTaxes#TEMP and OrderDiscounts#TEMP tables or create the JSON structure to provide the values to insert. Please refer the columns available for OrderTaxes and OrderDiscounts from Orders View
INSERT INTO OrderTaxes#TEMP (TaxName, TaxPercentage) VALUES ('State Sales Tax', '9')
INSERT INTO OrderTaxes#TEMP (TaxName, TaxPercentage) VALUES ('Central Sales Tax', '9')
INSERT INTO OrderDiscounts#TEMP (DiscountName, DiscountPercentage) VALUES ('Labor Day Sale', '5')
INSERT INTO OrderDiscounts#TEMP (DiscountName, DiscountPercentage) VALUES ('New Year Sale', '10')
EXECUTE CreateOrder AutoCharge = true, CardNonce = 'fake-card-nonce-ok', ReferenceId = 'my-order-001', OrderLineItems = 'OrderItem#TEMP', OrderTaxes = 'OrderTaxes#TEMP', OrderDiscounts = 'OrderDiscounts#TEMP'
EXECUTE CreateOrder AutoCharge = true, CardNonce = 'fake-card-nonce-ok', ReferenceId = 'my-order-001', OrderLineItems = 'OrderItem#TEMP', OrderTaxes = '[{"OrderTaxName":"State Sales Tax","OrderTaxPercentage": 9}]', OrderDiscounts = '[{"OrderDiscountName":"Labor Day Sale","OrderDiscountPercentage":5}]'
To create Order with OrderLineItems using JSON structure.
EXECUTE CreateOrder AutoCharge = true, CardNonce = 'fake-card-nonce-ok', ReferenceId = 'my-order-001', OrderLineItems = [{\"modifiers\": [{\"catalog_object_id\": \"CHQX7Y4KY6N5KINJKZCFURPZ\" }], \"name\" : \"New York Strip Steak\", \"quantity\" : \"1\", \"base_price_money\" : {\"amount\": 1599, \"currency\" : \"USD\" } }]
| Name | Type | Required | Description |
| AutoCharge | Boolean | False | Charge the order automatically |
| CardNonce | String | False | A nonce generated from the SqPaymentForm that represents the card to charge. |
| CustomerCardId | String | False | The ID of the customer card on file to charge. |
| CustomerId | String | False | The ID of the customer to associate this transaction with. |
| IdempotencyKey | String | False | A value you specify that uniquely identifies this order among orders you've created. |
| ReferenceId | String | False | An optional ID you can associate with the transaction for your own purposes. |
| OrderLineItems | String | False | The aggregate for the order line items. |
| OrderTaxAmountMoneyAmount | Integer | False | Only used for ad hoc taxes. The monetary amount of the tax. This column input will not be accepted if OrderTaxes column is added. |
| OrderTaxAmountMoneyCurrency | String | False | Only used for ad hoc taxes. The currency of the tax monetary amount. This column input will not be accepted if OrderTaxes column is added. |
| OrderTaxAppliedMoneyAmount | Integer | False | Only used for ad hoc taxes. The applied amount by the tax. This column input will not be accepted if OrderTaxes column is added. |
| OrderTaxAppliedMoneyCurrency | String | False | Only used for ad hoc taxes. The currency of the tax applied amount. This column input will not be accepted if OrderTaxes column is added. |
| OrderTaxCatalogObjectId | String | False | Only used for catalog taxes. The catalog object ID of an existing CatalogTax. This column input will not be accepted if OrderTaxes column is added. |
| OrderTaxName | String | False | Only used for ad hoc taxes. The tax's name. Do not provide a value for this field if you set catalogobjectid. This column input will not be accepted if OrderTaxes column is added. |
| OrderTaxPercentage | String | False | Only used for ad hoc taxes. The percentage of the tax, as a string representation of a decimal number. This column input will not be accepted if OrderTaxes column is added. |
| OrderTaxScope | String | False | Only used for ad hoc taxes. Indicates the level at which the tax applies. Possible values are OTHER_TAX_SCOPE, LINE_ITEM, ORDER. This column input will not be accepted if OrderTaxes column is added. |
| OrderTaxType | String | False | Only used for ad hoc taxes. The type of the tax. This column input will not be accepted if OrderTaxes column is added. |
| OrderTaxUID | String | False | Only used for ad hoc taxes. Unique ID that identifies the tax only within this order. This column input will not be accepted if OrderTaxes column is added. |
| OrderTaxes | String | False | The aggregate for the order taxes. |
| OrderDiscountAmountMoneyAmount | Integer | False | Only used for ad hoc discounts. The monetary amount of the discount. This column input will not be accepted if OrderDiscounts column is added. |
| OrderDiscountAmountMoneyCurrency | String | False | Only used for ad hoc discounts. The currency of the discount monetary amount. This column input will not be accepted if OrderDiscounts column is added. |
| OrderDiscountAppliedMoneyAmount | Integer | False | Only used for ad hoc discounts. The applied amount of the discount. This column input will not be accepted if OrderDiscounts column is added. |
| OrderDiscountAppliedMoneyCurrency | String | False | Only used for ad hoc discounts. The currency of the discount applied amount. This column input will not be accepted if OrderDiscounts column is added. |
| OrderDiscountCatalogObjectId | String | False | Only used for catalog discounts. The catalog object ID from exsiting CatalogDiscount. This column input will not be accepted if OrderDiscounts column is added. |
| OrderDiscountName | String | False | Only used for ad hoc discounts. The discount's name. This column input will not be accepted if OrderDiscounts column is added. |
| OrderDiscountPercentage | String | False | Only used for ad hoc discounts. The percentage of the discount, as a string representation of a decimal number. This column input will not be accepted if OrderDiscounts column is added. |
| OrderDiscountScope | String | False | Only used for ad hoc discounts. Indicates the level at which the discount applies. Possible values are OTHER_DISCOUNT_SCOPE, LINE_ITEM, ORDER. This column input will not be accepted if OrderDiscounts column is added. |
| OrderDiscountType | String | False | Only used for ad hoc discounts. The type of the discount. This column input will not be accepted if OrderDiscounts column is added. |
| OrderDiscountUID | String | False | Only used for ad hoc discounts. Unique ID that identifies the discount only within this order. This column input will not be accepted if OrderDiscounts column is added. |
| OrderDiscounts | String | False | The aggregate for the order discounts. |
| Name | Type | Description |
| Success | Boolean | Whether the transaction was successful. |
| OrderId | String | The transaction's unique ID, issued by Square payments servers. |
| Charged | Boolean | Whether the order is charged or not. |
| TransactionId | String | The transaction ID created after charging the order. |
Removes an attachment from an invoice and permanently deletes the file.
You must provide the Attachment Id of the attachment to delete along with its corresponding Invoice Id.
EXECUTE DeleteInvoiceAttachment InvoiceId = 'inv:0-ChC4p4-kE0gkhzWD2-NPhXiuEL0M' , AttachmentId = 'inva:0-ChAhhI2nQl9f_k2_vf6gR_Kq'
| Name | Type | Required | Description |
| InvoiceId | String | True | The ID of the invoice to delete the attachment from. |
| AttachmentId | String | True | The ID of the attachment to delete. |
| Name | Type | Description |
| Success | Boolean | Whether or not the attachment is removed from the invoice and deleted permanently. |
Publishes the specified draft invoice.
To execute this stored procedure, you need to provide the InvoiceId and its corresponding version number to publish. This version number must match the current version of the invoice; otherwise, the request is rejected.
EXEC PublishInvoice InvoiceId = 'inv:0-ChAALv-Dv-66y_I0TT0hCN2UEL0M', InvoiceVersion = 7
| Name | Type | Required | Description |
| InvoiceId | String | True | The ID of the invoice to publish. |
| InvoiceVersion | Int32 | True | The version of the invoice to publish. This must match the current version of the invoice; otherwise, the request is rejected. |
Cancels a transaction that was created with the Charge stored procedure with a DelayCapture value of true.
| Name | Type | Required | Description |
| TransactionId | String | True | The transaction's unique ID, issued by Square payments servers. |
| Name | Type | Description |
| Success | Boolean | Whether the transaction was canceled. |
このセクションで説明されているシステムテーブルをクエリして、スキーマ情報、データソース機能に関する情報、およびバッチ操作の統計にアクセスできます。
以下のテーブルは、Square のデータベースメタデータを返します。
以下のテーブルは、データソースへの接続方法およびクエリ方法についての情報を返します。
次のテーブルは、データ変更クエリのクエリ統計を返します。
利用可能なデータベースをリストします。
次のクエリは、接続文字列で決定されるすべてのデータベースを取得します。
SELECT * FROM sys_catalogs
| Name | Type | Description |
| CatalogName | String | データベース名。 |
利用可能なスキーマをリストします。
次のクエリは、すべての利用可能なスキーマを取得します。
SELECT * FROM sys_schemas
| Name | Type | Description |
| CatalogName | String | データベース名。 |
| SchemaName | String | スキーマ名。 |
利用可能なテーブルをリストします。
次のクエリは、利用可能なテーブルおよびビューを取得します。
SELECT * FROM sys_tables
| Name | Type | Description |
| CatalogName | String | テーブルまたはビューを含むデータベース。 |
| SchemaName | String | テーブルまたはビューを含むスキーマ。 |
| TableName | String | テーブル名またはビュー名。 |
| TableType | String | テーブルの種類(テーブルまたはビュー)。 |
| Description | String | テーブルまたはビューの説明。 |
| IsUpdateable | Boolean | テーブルが更新可能かどうか。 |
利用可能なテーブルおよびビューのカラムについて説明します。
次のクエリは、Payments テーブルのカラムとデータ型を返します。
SELECT ColumnName, DataTypeName FROM sys_tablecolumns WHERE TableName='Payments'
| Name | Type | Description |
| CatalogName | String | テーブルまたはビューを含むデータベースの名前。 |
| SchemaName | String | テーブルまたはビューを含むスキーマ。 |
| TableName | String | カラムを含むテーブルまたはビューの名前。 |
| ColumnName | String | カラム名。 |
| DataTypeName | String | データ型の名前。 |
| DataType | Int32 | データ型を示す整数値。この値は、実行時に環境に基づいて決定されます。 |
| Length | Int32 | カラムのストレージサイズ。 |
| DisplaySize | Int32 | 指定されたカラムの通常の最大幅(文字数)。 |
| NumericPrecision | Int32 | 数値データの最大桁数。文字データおよび日時データの場合は、カラムの長さ(文字数)。 |
| NumericScale | Int32 | カラムのスケール(小数点以下の桁数)。 |
| IsNullable | Boolean | カラムがNull を含められるかどうか。 |
| Description | String | カラムの簡単な説明。 |
| Ordinal | Int32 | カラムのシーケンスナンバー。 |
| IsAutoIncrement | String | カラムに固定増分値が割り当てられるかどうか。 |
| IsGeneratedColumn | String | 生成されたカラムであるかどうか。 |
| IsHidden | Boolean | カラムが非表示かどうか。 |
| IsArray | Boolean | カラムが配列かどうか。 |
| IsReadOnly | Boolean | カラムが読み取り専用かどうか。 |
| IsKey | Boolean | sys_tablecolumns から返されたフィールドがテーブルの主キーであるかどうか。 |
| ColumnType | String | スキーマ内のカラムの役割または分類。可能な値は、SYSTEM、LINKEDCOLUMN、NAVIGATIONKEY、REFERENCECOLUMN、およびNAVIGATIONPARENTCOLUMN が含まれます。 |
利用可能なストアドプロシージャをリストします。
次のクエリは、利用可能なストアドプロシージャを取得します。
SELECT * FROM sys_procedures
| Name | Type | Description |
| CatalogName | String | ストアドプロシージャを含むデータベース。 |
| SchemaName | String | ストアドプロシージャを含むスキーマ。 |
| ProcedureName | String | ストアドプロシージャの名前。 |
| Description | String | ストアドプロシージャの説明。 |
| ProcedureType | String | PROCEDURE やFUNCTION などのプロシージャのタイプ。 |
ストアドプロシージャパラメータについて説明します。
次のクエリは、RefreshOAuthAccessToken ストアドプロシージャのすべての入力パラメータについての情報を返します。
SELECT * FROM sys_procedureparameters WHERE ProcedureName = 'RefreshOAuthAccessToken' AND Direction = 1 OR Direction = 2
パラメータに加えて結果セットのカラムを含めるには、IncludeResultColumns 擬似カラムをTrue に設定します。
SELECT * FROM sys_procedureparameters WHERE ProcedureName = 'RefreshOAuthAccessToken' AND IncludeResultColumns='True'
| Name | Type | Description |
| CatalogName | String | ストアドプロシージャを含むデータベースの名前。 |
| SchemaName | String | ストアドプロシージャを含むスキーマの名前。 |
| ProcedureName | String | パラメータを含むストアドプロシージャの名前。 |
| ColumnName | String | ストアドプロシージャパラメータの名前。 |
| Direction | Int32 | パラメータのタイプに対応する整数値:input (1)。input/output (2)、またはoutput(4)。input/output タイプパラメータは、入力パラメータと出力パラメータの両方になれます。 |
| DataType | Int32 | データ型を示す整数値。この値は、実行時に環境に基づいて決定されます。 |
| DataTypeName | String | データ型の名前。 |
| NumericPrecision | Int32 | 数値データの場合は最大精度。文字データおよび日時データの場合は、カラムの長さ(文字数)。 |
| Length | Int32 | 文字データの場合は、許可される文字数。数値データの場合は、許可される桁数。 |
| NumericScale | Int32 | 数値データの小数点以下の桁数。 |
| IsNullable | Boolean | パラメータがNull を含められるかどうか。 |
| IsRequired | Boolean | プロシージャの実行にパラメータが必要かどうか。 |
| IsArray | Boolean | パラメータが配列かどうか。 |
| Description | String | パラメータの説明。 |
| Ordinal | Int32 | パラメータのインデックス。 |
| Values | String | このパラメータで設定できる値は、このカラムに表示されるものに限られます。指定できる値はカンマ区切りです。 |
| SupportsStreams | Boolean | パラメータがファイルを表すかどうか。ファイルは、ファイルパスとして渡すことも、ストリームとして渡すこともできます。 |
| IsPath | Boolean | パラメータがスキーマ作成操作のターゲットパスかどうか。 |
| Default | String | 何も値が指定されていない場合に、このパラメータで使用される値。 |
| SpecificName | String | 複数のストアドプロシージャが同じ名前を持つ場合、それぞれの同名のストアドプロシージャを一意に識別するラベル。特定の名前を持つプロシージャが1つだけの場合は、その名前がここに単純に反映されます。 |
| IsCDataProvided | Boolean | プロシージャがネイティブのSquare プロシージャではなく、CData によって追加 / 実装されているかどうか。 |
| Name | Type | Description |
| IncludeResultColumns | Boolean | 出力にパラメータに加えて結果セットのカラムを含めるかどうか。デフォルトはFalse です。 |
主キーおよび外部キーについて説明します。
次のクエリは、Payments テーブルの主キーを取得します。
SELECT * FROM sys_keycolumns WHERE IsKey='True' AND TableName='Payments'
| Name | Type | Description |
| CatalogName | String | キーを含むデータベースの名前。 |
| SchemaName | String | キーを含むスキーマの名前。 |
| TableName | String | キーを含むテーブルの名前。 |
| ColumnName | String | キーカラムの名前 |
| IsKey | Boolean | カラムがTableName フィールドで参照されるテーブル内の主キーかどうか。 |
| IsForeignKey | Boolean | カラムがTableName フィールドで参照される外部キーかどうか。 |
| PrimaryKeyName | String | 主キーの名前。 |
| ForeignKeyName | String | 外部キーの名前。 |
| ReferencedCatalogName | String | 主キーを含むデータベース。 |
| ReferencedSchemaName | String | 主キーを含むスキーマ。 |
| ReferencedTableName | String | 主キーを含むテーブル。 |
| ReferencedColumnName | String | 主キーのカラム名。 |
外部キーについて説明します。
次のクエリは、他のテーブルを参照するすべての外部キーを取得します。
SELECT * FROM sys_foreignkeys WHERE ForeignKeyType = 'FOREIGNKEY_TYPE_IMPORT'
| 名前 | タイプ | 説明 |
| CatalogName | String | キーを含むデータベースの名前。 |
| SchemaName | String | キーを含むスキーマの名前。 |
| TableName | String | キーを含むテーブルの名前。 |
| ColumnName | String | キーカラムの名前 |
| PrimaryKeyName | String | 主キーの名前。 |
| ForeignKeyName | String | 外部キーの名前。 |
| ReferencedCatalogName | String | 主キーを含むデータベース。 |
| ReferencedSchemaName | String | 主キーを含むスキーマ。 |
| ReferencedTableName | String | 主キーを含むテーブル。 |
| ReferencedColumnName | String | 主キーのカラム名。 |
| ForeignKeyType | String | 外部キーがインポート(他のテーブルを指す)キーかエクスポート(他のテーブルから参照される)キーかを指定します。 |
主キーについて説明します。
次のクエリは、すべてのテーブルとビューから主キーを取得します。
SELECT * FROM sys_primarykeys
| Name | Type | Description |
| CatalogName | String | キーを含むデータベースの名前。 |
| SchemaName | String | キーを含むスキーマの名前。 |
| TableName | String | キーを含むテーブルの名前。 |
| ColumnName | String | キーカラムの名前。 |
| KeySeq | String | 主キーのシーケンス番号。 |
| KeyName | String | 主キーの名前。 |
利用可能なインデックスについて説明します。インデックスをフィルタリングすることで、より高速なクエリ応答時間でセレクティブクエリを記述できます。
次のクエリは、主キーでないすべてのインデックスを取得します。
SELECT * FROM sys_indexes WHERE IsPrimary='false'
| Name | Type | Description |
| CatalogName | String | インデックスを含むデータベースの名前。 |
| SchemaName | String | インデックスを含むスキーマの名前。 |
| TableName | String | インデックスを含むテーブルの名前。 |
| IndexName | String | インデックス名。 |
| ColumnName | String | インデックスに関連付けられたカラムの名前。 |
| IsUnique | Boolean | インデックスが固有の場合はTrue。そうでない場合はFalse。 |
| IsPrimary | Boolean | インデックスが主キーの場合はTrue。そうでない場合はFalse。 |
| Type | Int16 | インデックスタイプに対応する整数値:statistic (0)、clustered (1)、hashed (2)、またはother (3)。 |
| SortOrder | String | 並べ替え順序:A が昇順、D が降順。 |
| OrdinalPosition | Int16 | インデックスのカラムのシーケンスナンバー。 |
利用可能な接続プロパティと、接続文字列に設定されている接続プロパティに関する情報を返します。
次のクエリは、接続文字列に設定されている、あるいはデフォルト値で設定されているすべての接続プロパティを取得します。
SELECT * FROM sys_connection_props WHERE Value <> ''
| Name | Type | Description |
| Name | String | 接続プロパティ名。 |
| ShortDescription | String | 簡単な説明。 |
| Type | String | 接続プロパティのデータ型。 |
| Default | String | 明示的に設定されていない場合のデフォルト値。 |
| Values | String | 可能な値のカンマ区切りリスト。別な値が指定されていると、検証エラーがスローされます。 |
| Value | String | 設定した値またはあらかじめ設定されたデフォルト。 |
| Required | Boolean | プロパティが接続に必要かどうか。 |
| Category | String | 接続プロパティのカテゴリ。 |
| IsSessionProperty | String | プロパティが、現在の接続に関する情報を保存するために使用されるセッションプロパティかどうか。 |
| Sensitivity | String | プロパティの機密度。これは、プロパティがロギングおよび認証フォームで難読化されているかどうかを通知します。 |
| PropertyName | String | キャメルケースの短縮形の接続プロパティ名。 |
| Ordinal | Int32 | パラメータのインデックス。 |
| CatOrdinal | Int32 | パラメータカテゴリのインデックス。 |
| Hierarchy | String | このプロパティと一緒に設定する必要がある、関連のある依存プロパティを表示します。 |
| Visible | Boolean | プロパティが接続UI に表示されるかどうかを通知します。 |
| ETC | String | プロパティに関するその他のさまざまな情報。 |
Cloud がデータソースにオフロードできるSELECT クエリ処理について説明します。
SQL 構文の詳細については、SQL 準拠 を参照してください。
以下はSQL 機能のサンプルデータセットです。 SELECT 機能のいくつかの側面がサポートされている場合には、カンマ区切りのリストで返されます。サポートされていない場合、カラムにはNO が入ります。
| 名前 | 説明 | 有効な値 |
| AGGREGATE_FUNCTIONS | サポートされている集計関数。 | AVG, COUNT, MAX, MIN, SUM, DISTINCT |
| COUNT | COUNT 関数がサポートされているかどうか。 | YES, NO |
| IDENTIFIER_QUOTE_OPEN_CHAR | 識別子をエスケープするための開始文字。 | [ |
| IDENTIFIER_QUOTE_CLOSE_CHAR | 識別子をエスケープするための終了文字。 | ] |
| SUPPORTED_OPERATORS | サポートされているSQL 演算子。 | =, >, <, >=, <=, <>, !=, LIKE, NOT LIKE, IN, NOT IN, IS NULL, IS NOT NULL, AND, OR |
| GROUP_BY | GROUP BY がサポートされているかどうか。サポートされている場合、どのレベルでサポートされているか。 | NO, NO_RELATION, EQUALS_SELECT, SQL_GB_COLLATE |
| OJ_CAPABILITIES | サポートされている外部結合の種類。 | NO, LEFT, RIGHT, FULL, INNER, NOT_ORDERED, ALL_COMPARISON_OPS |
| OUTER_JOINS | 外部結合がサポートされているかどうか。 | YES, NO |
| SUBQUERIES | サブクエリがサポートされているかどうか。サポートされていれば、どのレベルでサポートされているか。 | NO, COMPARISON, EXISTS, IN, CORRELATED_SUBQUERIES, QUANTIFIED |
| STRING_FUNCTIONS | サポートされている文字列関数。 | LENGTH, CHAR, LOCATE, REPLACE, SUBSTRING, RTRIM, LTRIM, RIGHT, LEFT, UCASE, SPACE, SOUNDEX, LCASE, CONCAT, ASCII, REPEAT, OCTET, BIT, POSITION, INSERT, TRIM, UPPER, REGEXP, LOWER, DIFFERENCE, CHARACTER, SUBSTR, STR, REVERSE, PLAN, UUIDTOSTR, TRANSLATE, TRAILING, TO, STUFF, STRTOUUID, STRING, SPLIT, SORTKEY, SIMILAR, REPLICATE, PATINDEX, LPAD, LEN, LEADING, KEY, INSTR, INSERTSTR, HTML, GRAPHICAL, CONVERT, COLLATION, CHARINDEX, BYTE |
| NUMERIC_FUNCTIONS | サポートされている数値関数。 | ABS, ACOS, ASIN, ATAN, ATAN2, CEILING, COS, COT, EXP, FLOOR, LOG, MOD, SIGN, SIN, SQRT, TAN, PI, RAND, DEGREES, LOG10, POWER, RADIANS, ROUND, TRUNCATE |
| TIMEDATE_FUNCTIONS | サポートされている日付および時刻関数。 | NOW, CURDATE, DAYOFMONTH, DAYOFWEEK, DAYOFYEAR, MONTH, QUARTER, WEEK, YEAR, CURTIME, HOUR, MINUTE, SECOND, TIMESTAMPADD, TIMESTAMPDIFF, DAYNAME, MONTHNAME, CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, EXTRACT |
| REPLICATION_SKIP_TABLES | レプリケーション中にスキップされたテーブルを示します。 | |
| REPLICATION_TIMECHECK_COLUMNS | レプリケーション中に更新判断のカラムとして使用するかどうかを、(指定された順に)チェックするカラムのリストを含む文字列の配列。 | |
| IDENTIFIER_PATTERN | 識別子としてどの文字列が有効かを示す文字列値。 | |
| SUPPORT_TRANSACTION | プロバイダーが、コミットやロールバックなどのトランザクションをサポートしているかどうかを示します。 | YES, NO |
| DIALECT | 使用するSQL ダイアレクトを示します。 | |
| KEY_PROPERTIES | Uniform データベースを特定するプロパティを示します。 | |
| SUPPORTS_MULTIPLE_SCHEMAS | プロバイダー用に複数のスキームが存在するかどうかを示します。 | YES, NO |
| SUPPORTS_MULTIPLE_CATALOGS | プロバイダー用に複数のカタログが存在するかどうかを示します。 | YES, NO |
| DATASYNCVERSION | このドライバーにアクセスするために必要な、CData Sync のバージョン。 | Standard, Starter, Professional, Enterprise |
| DATASYNCCATEGORY | このドライバーのCData Sync カテゴリ。 | Source, Destination, Cloud Destination |
| SUPPORTSENHANCEDSQL | API で提供されている以上の、追加SQL 機能がサポートされているかどうか。 | TRUE, FALSE |
| SUPPORTS_BATCH_OPERATIONS | バッチ操作がサポートされているかどうか。 | YES, NO |
| SQL_CAP | このドライバーでサポートされているすべてのSQL 機能。 | SELECT, INSERT, DELETE, UPDATE, TRANSACTIONS, ORDERBY, OAUTH, ASSIGNEDID, LIMIT, LIKE, BULKINSERT, COUNT, BULKDELETE, BULKUPDATE, GROUPBY, HAVING, AGGS, OFFSET, REPLICATE, COUNTDISTINCT, JOINS, DROP, CREATE, DISTINCT, INNERJOINS, SUBQUERIES, ALTER, MULTIPLESCHEMAS, GROUPBYNORELATION, OUTERJOINS, UNIONALL, UNION, UPSERT, GETDELETED, CROSSJOINS, GROUPBYCOLLATE, MULTIPLECATS, FULLOUTERJOIN, MERGE, JSONEXTRACT, BULKUPSERT, SUM, SUBQUERIESFULL, MIN, MAX, JOINSFULL, XMLEXTRACT, AVG, MULTISTATEMENTS, FOREIGNKEYS, CASE, LEFTJOINS, COMMAJOINS, WITH, LITERALS, RENAME, NESTEDTABLES, EXECUTE, BATCH, BASIC, INDEX |
| PREFERRED_CACHE_OPTIONS | 使用したいcacheOptions を指定する文字列値。 | |
| ENABLE_EF_ADVANCED_QUERY | ドライバーがEntity Framework の高度なクエリをサポートしているかどうかを示します。サポートしていなければ、クエリはクライアントサイドで処理されます。 | YES, NO |
| PSEUDO_COLUMNS | 利用可能な疑似カラムを示す文字列の配列。 | |
| MERGE_ALWAYS | 値がtrue であれば、CData Sync 内でMerge Model が強制的に実行されます。 | TRUE, FALSE |
| REPLICATION_MIN_DATE_QUERY | レプリケート開始日時を返すSELECT クエリ。 | |
| REPLICATION_MIN_FUNCTION | サーバーサイドでmin を実行するために使用する式名を、プロバイダーが指定できるようになります。 | |
| REPLICATION_START_DATE | レプリケート開始日を、プロバイダーが指定できるようになります。 | |
| REPLICATION_MAX_DATE_QUERY | レプリケート終了日時を返すSELECT クエリ。 | |
| REPLICATION_MAX_FUNCTION | サーバーサイドでmax を実行するために使用する式名を、プロバイダーが指定できるようになります。 | |
| IGNORE_INTERVALS_ON_INITIAL_REPLICATE | 初回のレプリケートで、レプリケートをチャンクに分割しないテーブルのリスト。 | |
| CHECKCACHE_USE_PARENTID | CheckCache 構文を親キーカラムに対して実行するかどうかを示します。 | TRUE, FALSE |
| CREATE_SCHEMA_PROCEDURES | スキーマファイルの生成に使用できる、ストアドプロシージャを示します。 |
次のクエリは、WHERE 句で使用できる演算子を取得します。
SELECT * FROM sys_sqlinfo WHERE Name = 'SUPPORTED_OPERATORS'
WHERE 句では、個々のテーブルの制限や要件が異なる場合がありますので注意してください。詳しくは、データモデル セクションを参照してください。
| Name | Type | Description |
| NAME | String | SQL 構文のコンポーネント、またはサーバー上で処理できる機能。 |
| VALUE | String | サポートされるSQL またはSQL 構文の詳細。 |
試行された変更に関する情報を返します。
次のクエリは、バッチ処理で変更された行のId を取得します。
SELECT * FROM sys_identity
| Name | Type | Description |
| Id | String | データ変更処理から返された、データベース生成Id。 |
| Batch | String | バッチの識別子。1 は単一処理。 |
| Operation | String | バッチ内の処理の結果:INSERTED、UPDATED、またはDELETED。 |
| Message | String | SUCCESS、またはバッチ内の更新が失敗した場合のエラーメッセージ。 |
利用可能なシステム情報を説明します。
次のクエリは、すべてのカラムを取得します。
SELECT * FROM sys_information
| Name | Type | Description |
| Product | String | 製品名。 |
| Version | String | 製品のバージョン番号。 |
| Datasource | String | 製品が接続するデータソースの名前。 |
| NodeId | String | 製品がインストールされているマシンの固有識別子。 |
| HelpURL | String | 製品のヘルプドキュメントのURL。 |
| License | String | 製品のライセンス情報。(この情報が利用できない場合、この項目は空白のままか「N/A」と表示されます。) |
| Location | String | 製品のライブラリが格納されているファイルパスの場所。 |
| Environment | String | 製品が現在稼働している環境またはランタイムのバージョン。 |
| DataSyncVersion | String | 本コネクタを使用するために必要なCData Sync のティア。 |
| DataSyncCategory | String | CData Sync 機能のカテゴリ(例:Source、Destination)。 |
| プロパティ | 説明 |
| LocationId | The Id of a business location that will be set as default. |
| UseSandbox | A boolean indicating whether you are using a Sandbox account. The provider makes requests to the production environment by default. |
| プロパティ | 説明 |
| OAuthClientId | カスタムOAuth アプリケーションに割り当てられたクライアントID(コンシューマーキーとも呼ばれます)を指定します。このID は、認証時にOAuth 認可サーバーにアプリケーションを識別させるために必要です。 |
| OAuthClientSecret | カスタムOAuth アプリケーションに割り当てられたクライアントシークレットを指定します。この機密情報は、OAuth 認可サーバーに対してアプリケーションを認証するために使用されます。(カスタムOAuth アプリケーションのみ) |
| Scope | データへの適切なアクセスを確実にするために、認証ユーザーのアプリケーションへのアクセス範囲を指定します。 カスタムOAuth アプリケーションが必要な場合は、通常、アプリケーションの作成時に指定します。 |
| プロパティ | 説明 |
| SSLServerCert | TLS/SSL を使用して接続する際に、サーバーが受け入れ可能な証明書を指定します。 |
| プロパティ | 説明 |
| Verbosity | ログファイルのVerbosity レベルを指定し、記録される情報の詳細度を制御します。サポートされる値の範囲は1から5までです。 |
| プロパティ | 説明 |
| BrowsableSchemas | レポートされるスキーマを利用可能なすべてのスキーマのサブセットに制限するオプション設定。例えば、 BrowsableSchemas=SchemaA,SchemaB,SchemaC です。 |
| プロパティ | 説明 |
| MaxRows | 集計やGROUP BY を含まないクエリで返される最大行数を指定します。 |
| PageSize | The number of results to return per page of data retrieved from Square. |
| PseudoColumns | テーブルカラムとして公開する擬似カラムを、'TableName=ColumnName;TableName=ColumnName' の形式の文字列で指定します。 |
| Timeout | provider がタイムアウトエラーを返すまでにサーバーからの応答を待機する最大時間を秒単位で指定します。 |
このセクションでは、本プロバイダーの接続文字列で設定可能なAuthentication プロパティの全リストを提供します。
| プロパティ | 説明 |
| LocationId | The Id of a business location that will be set as default. |
| UseSandbox | A boolean indicating whether you are using a Sandbox account. The provider makes requests to the production environment by default. |
The Id of a business location that will be set as default.
string
""
The Id of one of your business locations that will be set as default. This can also be set in the search criteria of the query. A value set in the query overrides the value set in this connection property. You can retrieve the Ids for your Locations by querying the Locations table.
A boolean indicating whether you are using a Sandbox account. The provider makes requests to the production environment by default.
bool
false
If you are using a production account, this property can be left blank.
このセクションでは、本プロバイダーの接続文字列で設定可能なOAuth プロパティの全リストを提供します。
| プロパティ | 説明 |
| OAuthClientId | カスタムOAuth アプリケーションに割り当てられたクライアントID(コンシューマーキーとも呼ばれます)を指定します。このID は、認証時にOAuth 認可サーバーにアプリケーションを識別させるために必要です。 |
| OAuthClientSecret | カスタムOAuth アプリケーションに割り当てられたクライアントシークレットを指定します。この機密情報は、OAuth 認可サーバーに対してアプリケーションを認証するために使用されます。(カスタムOAuth アプリケーションのみ) |
| Scope | データへの適切なアクセスを確実にするために、認証ユーザーのアプリケーションへのアクセス範囲を指定します。 カスタムOAuth アプリケーションが必要な場合は、通常、アプリケーションの作成時に指定します。 |
カスタムOAuth アプリケーションに割り当てられたクライアントID(コンシューマーキーとも呼ばれます)を指定します。このID は、認証時にOAuth 認可サーバーにアプリケーションを識別させるために必要です。
string
""
このプロパティは2つのケースで必要となります:
(ドライバーが埋め込みOAuth 資格情報を提供する場合、この値はすでにCloud によって設定されており、手動で入力する必要がないことがあります。)
OAuthClientId は、認証付きの接続を構成する際に、OAuthClientSecret やOAuthSettingsLocation などの他のOAuth 関連プロパティと一緒に使用されるのが一般的です。
OAuthClientId は、ユーザーがOAuth 経由で認証を行う前に設定する必要がある、主要な接続パラメータの1つです。 この値は、通常、ID プロバイダーのアプリケーション登録設定で確認できます。 Client ID、Application ID、Consumer Key などとラベル付けされた項目を探してください。
クライアントID は、クライアントシークレットのような機密情報とは見なされませんが、アプリケーションの識別情報の一部であるため、慎重に取り扱う必要があります。公開リポジトリや共有設定ファイルでこの値を露出させないようにしてください。
接続設定時にこのプロパティを使用する方法の詳細については、接続の確立 を参照してください。
カスタムOAuth アプリケーションに割り当てられたクライアントシークレットを指定します。この機密情報は、OAuth 認可サーバーに対してアプリケーションを認証するために使用されます。(カスタムOAuth アプリケーションのみ)
string
""
このプロパティ(アプリケーションシークレットまたはコンシューマシークレットとも呼ばれます)は、安全なクライアント認証を必要とするすべてのフローでカスタムOAuth アプリケーションを使用する場合に必要です。たとえば、Web ベースのOAuth、サービスベースの接続、証明書ベースの認可フローなどが該当します。 組み込みOAuth アプリケーションを使用する場合は必要ありません。
クライアントシークレットは、OAuth フローのトークン交換ステップで使用されます。このステップでは、ドライバーが認可サーバーにアクセストークンを要求します。 この値が欠落しているか正しくない場合、認証はinvalid_client またはunauthorized_client エラーで失敗します。
OAuthClientSecret は、ユーザーがOAuth 経由で認証を行う前に設定する必要がある、主要な接続パラメータの1つです。この値は、OAuth アプリケーションを登録する際にID プロバイダーから取得できます。
Notes:
接続設定時にこのプロパティを使用する方法の詳細については、接続の確立 を参照してください。
データへの適切なアクセスを確実にするために、認証ユーザーのアプリケーションへのアクセス範囲を指定します。 カスタムOAuth アプリケーションが必要な場合は、通常、アプリケーションの作成時に指定します。
string
""
スコープは、認証ユーザーがどのようなアクセス権を持つかを定義するために設定されます。例えば、読み取り、読み取りと書き込み、機密情報への制限付きアクセスなどです。システム管理者は、スコープを使用して機能またはセキュリティクリアランスによるアクセスを選択的に有効化できます。
InitiateOAuth がGETANDREFRESH に設定されている場合、要求するスコープを変更したい場合はこのプロパティを使用する必要があります。
InitiateOAuth がREFRESH またはOFF のいずれかに設定されている場合、このプロパティまたはScope 入力を使用して、要求するスコープを変更できます。
このセクションでは、本プロバイダーの接続文字列で設定可能なSSL プロパティの全リストを提供します。
| プロパティ | 説明 |
| SSLServerCert | TLS/SSL を使用して接続する際に、サーバーが受け入れ可能な証明書を指定します。 |
TLS/SSL を使用して接続する際に、サーバーが受け入れ可能な証明書を指定します。
string
""
TLS/SSL 接続を使用している場合は、このプロパティを使用して、サーバーが受け入れるTLS/SSL 証明書を指定できます。このプロパティに値を指定すると、マシンによって信頼されていない他の証明書はすべて拒否されます。
このプロパティは、次のフォームを取ります:
| 説明 | 例 |
| フルPEM 証明書(例では省略されています) | -----BEGIN CERTIFICATE----- MIIChTCCAe4CAQAwDQYJKoZIhv......Qw== -----END CERTIFICATE----- |
| 証明書を保有するローカルファイルへのパス。 | C:\cert.cer |
| 公開鍵(例では省略されています) | -----BEGIN RSA PUBLIC KEY----- MIGfMA0GCSq......AQAB -----END RSA PUBLIC KEY----- |
| MD5 Thumbprint(hex 値はスペースまたはコロン区切り) | ecadbdda5a1529c58a1e9e09828d70e4 |
| SHA1 Thumbprint(hex 値はスペースまたはコロン区切り) | 34a929226ae0819f2ec14b4a3d904f801cbb150d |
Note:'*' を使用してすべての証明書を受け入れるように指定することも可能ですが、セキュリティ上の懸念があるため推奨されません。
このセクションでは、本プロバイダーの接続文字列で設定可能なLogging プロパティの全リストを提供します。
| プロパティ | 説明 |
| Verbosity | ログファイルのVerbosity レベルを指定し、記録される情報の詳細度を制御します。サポートされる値の範囲は1から5までです。 |
ログファイルのVerbosity レベルを指定し、記録される情報の詳細度を制御します。サポートされる値の範囲は1から5までです。
string
"1"
このプロパティは、Cloud がログファイルに含める詳細レベルを定義します。 Verbosity レベルを高くするとログに記録される情報の詳細が増えますが、ログファイルが大きくなり取り込まれるデータが増えるためパフォーマンスが低下する可能性があります。
デフォルトのVerbosity レベルは1で、通常の運用にはこれが推奨されます。 より高いVerbosity レベルは主にデバッグを目的としています。 各レベルの詳細については、ログ を参照してください。
LogModules プロパティと組み合わせることで、Verbosity は特定の情報カテゴリに対するログの詳細度を調整できます。
このセクションでは、本プロバイダーの接続文字列で設定可能なSchema プロパティの全リストを提供します。
| プロパティ | 説明 |
| BrowsableSchemas | レポートされるスキーマを利用可能なすべてのスキーマのサブセットに制限するオプション設定。例えば、 BrowsableSchemas=SchemaA,SchemaB,SchemaC です。 |
レポートされるスキーマを利用可能なすべてのスキーマのサブセットに制限するオプション設定。例えば、 BrowsableSchemas=SchemaA,SchemaB,SchemaC です。
string
""
利用可能なデータベーススキーマをすべてリストすると余分な時間がかかり、パフォーマンスが低下します。 接続文字列にスキーマのリストを指定することで、時間を節約しパフォーマンスを向上させることができます。
このセクションでは、本プロバイダーの接続文字列で設定可能なMiscellaneous プロパティの全リストを提供します。
| プロパティ | 説明 |
| MaxRows | 集計やGROUP BY を含まないクエリで返される最大行数を指定します。 |
| PageSize | The number of results to return per page of data retrieved from Square. |
| PseudoColumns | テーブルカラムとして公開する擬似カラムを、'TableName=ColumnName;TableName=ColumnName' の形式の文字列で指定します。 |
| Timeout | provider がタイムアウトエラーを返すまでにサーバーからの応答を待機する最大時間を秒単位で指定します。 |
集計やGROUP BY を含まないクエリで返される最大行数を指定します。
int
-1
このプロパティのデフォルト値である-1 は、クエリに明示的にLIMIT 句が含まれていない限り、行の制限が適用されないことを意味します。 (クエリにLIMIT 句が含まれている場合、クエリで指定された値がMaxRows 設定よりも優先されます。)
MaxRows を0より大きい整数に設定することで、クエリがデフォルトで過度に大きな結果セットを返さないようにします。
このプロパティは、非常に大きなデータセットを返す可能性のあるクエリを実行する際に、パフォーマンスを最適化し、過剰なリソース消費を防ぐのに役立ちます。
The number of results to return per page of data retrieved from Square.
string
"500"
Note that the PageSize must be between 1 and 1000. For order-related endpoints, it is recommended to set the PageSize between 1 and 300. If the PageSize is not specified within this range and there are more than 1,000 records, the API may throw a timeout exception.
テーブルカラムとして公開する擬似カラムを、'TableName=ColumnName;TableName=ColumnName' の形式の文字列で指定します。
string
""
このプロパティを使用すると、Cloud がテーブルカラムとして公開する擬似カラムを定義できます。
個々の擬似カラムを指定するには、以下の形式を使用します。
Table1=Column1;Table1=Column2;Table2=Column3
すべてのテーブルのすべての擬似カラムを含めるには、次を使用してください:
*=*
provider がタイムアウトエラーを返すまでにサーバーからの応答を待機する最大時間を秒単位で指定します。
int
60
タイムアウトは、クエリや操作全体ではなくサーバーとの個々の通信に適用されます。 例えば、各ページング呼び出しがタイムアウト制限内に完了する場合、クエリは60秒を超えて実行を続けることができます。
タイムアウトはデフォルトで60秒に設定されています。タイムアウトを無効にするには、このプロパティを0に設定します。
タイムアウトを無効にすると、操作が成功するか、サーバー側のタイムアウト、ネットワークの中断、またはサーバーのリソース制限などの他の条件で失敗するまで無期限に実行されます。
Note: このプロパティは慎重に使用してください。長時間実行される操作がパフォーマンスを低下させたり、応答しなくなる可能性があるためです。
LZMA from 7Zip LZMA SDK
LZMA SDK is placed in the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute the original LZMA SDK code, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
LZMA2 from XZ SDK
Version 1.9 and older are in the public domain.
Xamarin.Forms
Xamarin SDK
The MIT License (MIT)
Copyright (c) .NET Foundation Contributors
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
NSIS 3.10
Copyright (C) 1999-2025 Contributors THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
1. DEFINITIONS
"Contribution" means:
a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and b) in the case of each subsequent Contributor:
i) changes to the Program, and
ii) additions to the Program;
where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
"Contributor" means any person or entity that distributes the Program.
"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
"Program" means the Contributions distributed in accordance with this Agreement.
"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
2. GRANT OF RIGHTS
a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
3. REQUIREMENTS
A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
a) it complies with the terms and conditions of this Agreement; and
b) its license agreement:
i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
When the Program is made available in source code form:
a) it must be made available under this Agreement; and
b) a copy of this Agreement must be included with each copy of the Program.
Contributors may not remove or alter any copyright notices contained within the Program.
Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
4. COMMERCIAL DISTRIBUTION
Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
5. NO WARRANTY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
6. DISCLAIMER OF LIABILITY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. GENERAL
If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.