If you have feedback about the new SDKs, or just want to talk to other Square Developers, request an invite to the new slack community for Square Developers
This repository contains the released C# client SDK. Check out our API specification repository for the specification and template files we used to generate this.
- .NET Standard 2.0
Option 1: Obtain from NuGet package manager (Recommended)
PM> Install-Package Square.Connect
- [RestSharp] (https://www.nuget.org/packages/RestSharp) - 106.3.1 or later
- [Json.NET] (https://www.nuget.org/packages/Newtonsoft.Json/) - 11.0.2 or later
Option 1: Run the following command to generate the DLL
- [Mac/Linux]
/bin/sh build.sh
- [Windows]
build.bat
Option 2: Import the Square.Connect/Square.Connect.csproj
to your solution and build from VS
Then include the DLLs (under the bin
folder) in the C# project,
- Square.Connect.dll
Use the namespaces:
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;
using System;
using System.Diagnostics;
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;
namespace Example
{
public class Example
{
public Example()
{
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
}
// Retrieving your location IDs
public void RetrieveLocations()
{
LocationsApi _locationsApi = new LocationsApi();
var response = _locationsApi.ListLocations();
}
// Charge the card nonce
public void ChargeNonce()
{
// Every payment you process for a given business have a unique idempotency key.
// If you're unsure whether a particular payment succeeded, you can reattempt
// it with the same idempotency key without worrying about double charging
// the buyer.
string idempotencyKey = Guid.NewGuid().ToString();
// Monetary amounts are specified in the smallest unit of the applicable currency.
// This amount is in cents. It's also hard-coded for $1, which is not very useful.
int amount = 100;
string currency = "USD";
Money money = new Money(amount, Money.ToCurrencyEnum(currency));
string nonce = "YOUR_NONCE";
string locationId = "YOUR_LOCATION_ID";
ChargeRequest body = new ChargeRequest(AmountMoney: money, IdempotencyKey: idempotencyKey, CardNonce: nonce);
TransactionsApi transactionsApi = new TransactionsApi();
var response = transactionsApi.Charge(locationId, body);
}
}
}
More examples are available at connect-api-examples
All URIs are relative to Square Connect Documentation
Class | Method | HTTP request |
---|---|---|
ApplePayApi | RegisterDomain | POST /v2/apple-pay/domains |
CatalogApi | BatchDeleteCatalogObjects | POST /v2/catalog/batch-delete |
CatalogApi | BatchRetrieveCatalogObjects | POST /v2/catalog/batch-retrieve |
CatalogApi | BatchUpsertCatalogObjects | POST /v2/catalog/batch-upsert |
CatalogApi | CatalogInfo | GET /v2/catalog/info |
CatalogApi | DeleteCatalogObject | DELETE /v2/catalog/object/{object_id} |
CatalogApi | ListCatalog | GET /v2/catalog/list |
CatalogApi | RetrieveCatalogObject | GET /v2/catalog/object/{object_id} |
CatalogApi | SearchCatalogObjects | POST /v2/catalog/search |
CatalogApi | UpdateItemModifierLists | POST /v2/catalog/update-item-modifier-lists |
CatalogApi | UpdateItemTaxes | POST /v2/catalog/update-item-taxes |
CatalogApi | UpsertCatalogObject | POST /v2/catalog/object |
CheckoutApi | CreateCheckout | POST /v2/locations/{location_id}/checkouts |
CustomersApi | CreateCustomer | POST /v2/customers |
CustomersApi | CreateCustomerCard | POST /v2/customers/{customer_id}/cards |
CustomersApi | DeleteCustomer | DELETE /v2/customers/{customer_id} |
CustomersApi | DeleteCustomerCard | DELETE /v2/customers/{customer_id}/cards/{card_id} |
CustomersApi | ListCustomers | GET /v2/customers |
CustomersApi | RetrieveCustomer | GET /v2/customers/{customer_id} |
CustomersApi | SearchCustomers | POST /v2/customers/search |
CustomersApi | UpdateCustomer | PUT /v2/customers/{customer_id} |
EmployeesApi | ListEmployees | GET /v2/employees |
EmployeesApi | RetrieveEmployee | GET /v2/employees/{id} |
InventoryApi | BatchChangeInventory | POST /v2/inventory/batch-change |
InventoryApi | BatchRetrieveInventoryChanges | POST /v2/inventory/batch-retrieve-changes |
InventoryApi | BatchRetrieveInventoryCounts | POST /v2/inventory/batch-retrieve-counts |
InventoryApi | RetrieveInventoryAdjustment | GET /v2/inventory/adjustment/{adjustment_id} |
InventoryApi | RetrieveInventoryChanges | GET /v2/inventory/{catalog_object_id}/changes |
InventoryApi | RetrieveInventoryCount | GET /v2/inventory/{catalog_object_id} |
InventoryApi | RetrieveInventoryPhysicalCount | GET /v2/inventory/physical-count/{physical_count_id} |
LaborApi | CreateBreakType | POST /v2/labor/break-types |
LaborApi | CreateShift | POST /v2/labor/shifts |
LaborApi | DeleteBreakType | DELETE /v2/labor/break-types/{id} |
LaborApi | DeleteShift | DELETE /v2/labor/shifts/{id} |
LaborApi | GetBreakType | GET /v2/labor/break-types/{id} |
LaborApi | GetEmployeeWage | GET /v2/labor/employee-wages/{id} |
LaborApi | GetShift | GET /v2/labor/shifts/{id} |
LaborApi | ListBreakTypes | GET /v2/labor/break-types |
LaborApi | ListEmployeeWages | GET /v2/labor/employee-wages |
LaborApi | ListWorkweekConfigs | GET /v2/labor/workweek-configs |
LaborApi | SearchShifts | POST /v2/labor/shifts/search |
LaborApi | UpdateBreakType | PUT /v2/labor/break-types/{id} |
LaborApi | UpdateShift | PUT /v2/labor/shifts/{id} |
LaborApi | UpdateWorkweekConfig | PUT /v2/labor/workweek-configs/{id} |
LocationsApi | ListLocations | GET /v2/locations |
MobileAuthorizationApi | CreateMobileAuthorizationCode | POST /mobile/authorization-code |
OAuthApi | ObtainToken | POST /oauth2/token |
OAuthApi | RenewToken | POST /oauth2/clients/{client_id}/access-token/renew |
OAuthApi | RevokeToken | POST /oauth2/revoke |
OrdersApi | BatchRetrieveOrders | POST /v2/locations/{location_id}/orders/batch-retrieve |
OrdersApi | CreateOrder | POST /v2/locations/{location_id}/orders |
ReportingApi | ListAdditionalRecipientReceivableRefunds | GET /v2/locations/{location_id}/additional-recipient-receivable-refunds |
ReportingApi | ListAdditionalRecipientReceivables | GET /v2/locations/{location_id}/additional-recipient-receivables |
TransactionsApi | CaptureTransaction | POST /v2/locations/{location_id}/transactions/{transaction_id}/capture |
TransactionsApi | Charge | POST /v2/locations/{location_id}/transactions |
TransactionsApi | CreateRefund | POST /v2/locations/{location_id}/transactions/{transaction_id}/refund |
TransactionsApi | ListRefunds | GET /v2/locations/{location_id}/refunds |
TransactionsApi | ListTransactions | GET /v2/locations/{location_id}/transactions |
TransactionsApi | RetrieveTransaction | GET /v2/locations/{location_id}/transactions/{transaction_id} |
TransactionsApi | VoidTransaction | POST /v2/locations/{location_id}/transactions/{transaction_id}/void |
V1EmployeesApi | CreateEmployee | POST /v1/me/employees |
V1EmployeesApi | CreateEmployeeRole | POST /v1/me/roles |
V1EmployeesApi | CreateTimecard | POST /v1/me/timecards |
V1EmployeesApi | DeleteTimecard | DELETE /v1/me/timecards/{timecard_id} |
V1EmployeesApi | ListCashDrawerShifts | GET /v1/{location_id}/cash-drawer-shifts |
V1EmployeesApi | ListEmployeeRoles | GET /v1/me/roles |
V1EmployeesApi | ListEmployees | GET /v1/me/employees |
V1EmployeesApi | ListTimecardEvents | GET /v1/me/timecards/{timecard_id}/events |
V1EmployeesApi | ListTimecards | GET /v1/me/timecards |
V1EmployeesApi | RetrieveCashDrawerShift | GET /v1/{location_id}/cash-drawer-shifts/{shift_id} |
V1EmployeesApi | RetrieveEmployee | GET /v1/me/employees/{employee_id} |
V1EmployeesApi | RetrieveEmployeeRole | GET /v1/me/roles/{role_id} |
V1EmployeesApi | RetrieveTimecard | GET /v1/me/timecards/{timecard_id} |
V1EmployeesApi | UpdateEmployee | PUT /v1/me/employees/{employee_id} |
V1EmployeesApi | UpdateEmployeeRole | PUT /v1/me/roles/{role_id} |
V1EmployeesApi | UpdateTimecard | PUT /v1/me/timecards/{timecard_id} |
V1ItemsApi | AdjustInventory | POST /v1/{location_id}/inventory/{variation_id} |
V1ItemsApi | ApplyFee | PUT /v1/{location_id}/items/{item_id}/fees/{fee_id} |
V1ItemsApi | ApplyModifierList | PUT /v1/{location_id}/items/{item_id}/modifier-lists/{modifier_list_id} |
V1ItemsApi | CreateCategory | POST /v1/{location_id}/categories |
V1ItemsApi | CreateDiscount | POST /v1/{location_id}/discounts |
V1ItemsApi | CreateFee | POST /v1/{location_id}/fees |
V1ItemsApi | CreateItem | POST /v1/{location_id}/items |
V1ItemsApi | CreateModifierList | POST /v1/{location_id}/modifier-lists |
V1ItemsApi | CreateModifierOption | POST /v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options |
V1ItemsApi | CreatePage | POST /v1/{location_id}/pages |
V1ItemsApi | CreateVariation | POST /v1/{location_id}/items/{item_id}/variations |
V1ItemsApi | DeleteCategory | DELETE /v1/{location_id}/categories/{category_id} |
V1ItemsApi | DeleteDiscount | DELETE /v1/{location_id}/discounts/{discount_id} |
V1ItemsApi | DeleteFee | DELETE /v1/{location_id}/fees/{fee_id} |
V1ItemsApi | DeleteItem | DELETE /v1/{location_id}/items/{item_id} |
V1ItemsApi | DeleteModifierList | DELETE /v1/{location_id}/modifier-lists/{modifier_list_id} |
V1ItemsApi | DeleteModifierOption | DELETE /v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options/{modifier_option_id} |
V1ItemsApi | DeletePage | DELETE /v1/{location_id}/pages/{page_id} |
V1ItemsApi | DeletePageCell | DELETE /v1/{location_id}/pages/{page_id}/cells |
V1ItemsApi | DeleteVariation | DELETE /v1/{location_id}/items/{item_id}/variations/{variation_id} |
V1ItemsApi | ListCategories | GET /v1/{location_id}/categories |
V1ItemsApi | ListDiscounts | GET /v1/{location_id}/discounts |
V1ItemsApi | ListFees | GET /v1/{location_id}/fees |
V1ItemsApi | ListInventory | GET /v1/{location_id}/inventory |
V1ItemsApi | ListItems | GET /v1/{location_id}/items |
V1ItemsApi | ListModifierLists | GET /v1/{location_id}/modifier-lists |
V1ItemsApi | ListPages | GET /v1/{location_id}/pages |
V1ItemsApi | RemoveFee | DELETE /v1/{location_id}/items/{item_id}/fees/{fee_id} |
V1ItemsApi | RemoveModifierList | DELETE /v1/{location_id}/items/{item_id}/modifier-lists/{modifier_list_id} |
V1ItemsApi | RetrieveItem | GET /v1/{location_id}/items/{item_id} |
V1ItemsApi | RetrieveModifierList | GET /v1/{location_id}/modifier-lists/{modifier_list_id} |
V1ItemsApi | UpdateCategory | PUT /v1/{location_id}/categories/{category_id} |
V1ItemsApi | UpdateDiscount | PUT /v1/{location_id}/discounts/{discount_id} |
V1ItemsApi | UpdateFee | PUT /v1/{location_id}/fees/{fee_id} |
V1ItemsApi | UpdateItem | PUT /v1/{location_id}/items/{item_id} |
V1ItemsApi | UpdateModifierList | PUT /v1/{location_id}/modifier-lists/{modifier_list_id} |
V1ItemsApi | UpdateModifierOption | PUT /v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options/{modifier_option_id} |
V1ItemsApi | UpdatePage | PUT /v1/{location_id}/pages/{page_id} |
V1ItemsApi | UpdatePageCell | PUT /v1/{location_id}/pages/{page_id}/cells |
V1ItemsApi | UpdateVariation | PUT /v1/{location_id}/items/{item_id}/variations/{variation_id} |
V1LocationsApi | ListLocations | GET /v1/me/locations |
V1LocationsApi | RetrieveBusiness | GET /v1/me |
V1TransactionsApi | CreateRefund | POST /v1/{location_id}/refunds |
V1TransactionsApi | ListBankAccounts | GET /v1/{location_id}/bank-accounts |
V1TransactionsApi | ListOrders | GET /v1/{location_id}/orders |
V1TransactionsApi | ListPayments | GET /v1/{location_id}/payments |
V1TransactionsApi | ListRefunds | GET /v1/{location_id}/refunds |
V1TransactionsApi | ListSettlements | GET /v1/{location_id}/settlements |
V1TransactionsApi | RetrieveBankAccount | GET /v1/{location_id}/bank-accounts/{bank_account_id} |
V1TransactionsApi | RetrieveOrder | GET /v1/{location_id}/orders/{order_id} |
V1TransactionsApi | RetrievePayment | GET /v1/{location_id}/payments/{payment_id} |
V1TransactionsApi | RetrieveSettlement | GET /v1/{location_id}/settlements/{settlement_id} |
V1TransactionsApi | UpdateOrder | PUT /v1/{location_id}/orders/{order_id} |
- Model.AdditionalRecipient
- Model.AdditionalRecipientReceivable
- Model.AdditionalRecipientReceivableRefund
- Model.Address
- Model.BatchChangeInventoryRequest
- Model.BatchChangeInventoryResponse
- Model.BatchDeleteCatalogObjectsRequest
- Model.BatchDeleteCatalogObjectsResponse
- Model.BatchRetrieveCatalogObjectsRequest
- Model.BatchRetrieveCatalogObjectsResponse
- Model.BatchRetrieveInventoryChangesRequest
- Model.BatchRetrieveInventoryChangesResponse
- Model.BatchRetrieveInventoryCountsRequest
- Model.BatchRetrieveInventoryCountsResponse
- Model.BatchRetrieveOrdersRequest
- Model.BatchRetrieveOrdersResponse
- Model.BatchUpsertCatalogObjectsRequest
- Model.BatchUpsertCatalogObjectsResponse
- Model.BreakType
- Model.CaptureTransactionRequest
- Model.CaptureTransactionResponse
- Model.Card
- Model.CatalogCategory
- Model.CatalogDiscount
- Model.CatalogIdMapping
- Model.CatalogImage
- Model.CatalogInfoRequest
- Model.CatalogInfoResponse
- Model.CatalogInfoResponseLimits
- Model.CatalogItem
- Model.CatalogItemModifierListInfo
- Model.CatalogItemVariation
- Model.CatalogModifier
- Model.CatalogModifierList
- Model.CatalogModifierOverride
- Model.CatalogObject
- Model.CatalogObjectBatch
- Model.CatalogQuery
- Model.CatalogQueryExact
- Model.CatalogQueryItemsForModifierList
- Model.CatalogQueryItemsForTax
- Model.CatalogQueryPrefix
- Model.CatalogQueryRange
- Model.CatalogQuerySortedAttribute
- Model.CatalogQueryText
- Model.CatalogTax
- Model.CatalogV1Id
- Model.ChargeRequest
- Model.ChargeRequestAdditionalRecipient
- Model.ChargeResponse
- Model.Checkout
- Model.CreateBreakTypeRequest
- Model.CreateBreakTypeResponse
- Model.CreateCheckoutRequest
- Model.CreateCheckoutResponse
- Model.CreateCustomerCardRequest
- Model.CreateCustomerCardResponse
- Model.CreateCustomerRequest
- Model.CreateCustomerResponse
- Model.CreateMobileAuthorizationCodeRequest
- Model.CreateMobileAuthorizationCodeResponse
- Model.CreateOrderRequest
- Model.CreateOrderRequestDiscount
- Model.CreateOrderRequestLineItem
- Model.CreateOrderRequestModifier
- Model.CreateOrderRequestTax
- Model.CreateOrderResponse
- Model.CreateRefundRequest
- Model.CreateRefundResponse
- Model.CreateShiftRequest
- Model.CreateShiftResponse
- Model.Customer
- Model.CustomerCreationSourceFilter
- Model.CustomerFilter
- Model.CustomerGroupInfo
- Model.CustomerPreferences
- Model.CustomerQuery
- Model.CustomerSort
- Model.DateRange
- Model.DeleteBreakTypeRequest
- Model.DeleteBreakTypeResponse
- Model.DeleteCatalogObjectRequest
- Model.DeleteCatalogObjectResponse
- Model.DeleteCustomerCardRequest
- Model.DeleteCustomerCardResponse
- Model.DeleteCustomerRequest
- Model.DeleteCustomerResponse
- Model.DeleteShiftRequest
- Model.DeleteShiftResponse
- Model.Device
- Model.Employee
- Model.EmployeeWage
- Model.Error
- Model.GetBreakTypeRequest
- Model.GetBreakTypeResponse
- Model.GetEmployeeWageRequest
- Model.GetEmployeeWageResponse
- Model.GetShiftRequest
- Model.GetShiftResponse
- Model.InventoryAdjustment
- Model.InventoryChange
- Model.InventoryCount
- Model.InventoryPhysicalCount
- Model.InventoryTransfer
- Model.ItemVariationLocationOverrides
- Model.ListAdditionalRecipientReceivableRefundsRequest
- Model.ListAdditionalRecipientReceivableRefundsResponse
- Model.ListAdditionalRecipientReceivablesRequest
- Model.ListAdditionalRecipientReceivablesResponse
- Model.ListBreakTypesRequest
- Model.ListBreakTypesResponse
- Model.ListCatalogRequest
- Model.ListCatalogResponse
- Model.ListCustomersRequest
- Model.ListCustomersResponse
- Model.ListEmployeeWagesRequest
- Model.ListEmployeeWagesResponse
- Model.ListEmployeesRequest
- Model.ListEmployeesResponse
- Model.ListLocationsRequest
- Model.ListLocationsResponse
- Model.ListRefundsRequest
- Model.ListRefundsResponse
- Model.ListTransactionsRequest
- Model.ListTransactionsResponse
- Model.ListWorkweekConfigsRequest
- Model.ListWorkweekConfigsResponse
- Model.Location
- Model.ModelBreak
- Model.Money
- Model.ObtainTokenRequest
- Model.ObtainTokenResponse
- Model.Order
- Model.OrderFulfillment
- Model.OrderFulfillmentPickupDetails
- Model.OrderFulfillmentRecipient
- Model.OrderLineItem
- Model.OrderLineItemDiscount
- Model.OrderLineItemModifier
- Model.OrderLineItemTax
- Model.OrderSource
- Model.Refund
- Model.RegisterDomainRequest
- Model.RegisterDomainResponse
- Model.RenewTokenRequest
- Model.RenewTokenResponse
- Model.RetrieveCatalogObjectRequest
- Model.RetrieveCatalogObjectResponse
- Model.RetrieveCustomerRequest
- Model.RetrieveCustomerResponse
- Model.RetrieveEmployeeRequest
- Model.RetrieveEmployeeResponse
- Model.RetrieveInventoryAdjustmentRequest
- Model.RetrieveInventoryAdjustmentResponse
- Model.RetrieveInventoryChangesRequest
- Model.RetrieveInventoryChangesResponse
- Model.RetrieveInventoryCountRequest
- Model.RetrieveInventoryCountResponse
- Model.RetrieveInventoryPhysicalCountRequest
- Model.RetrieveInventoryPhysicalCountResponse
- Model.RetrieveTransactionRequest
- Model.RetrieveTransactionResponse
- Model.RevokeTokenRequest
- Model.RevokeTokenResponse
- Model.SearchCatalogObjectsRequest
- Model.SearchCatalogObjectsResponse
- Model.SearchCustomersRequest
- Model.SearchCustomersResponse
- Model.SearchShiftsRequest
- Model.SearchShiftsResponse
- Model.Shift
- Model.ShiftFilter
- Model.ShiftQuery
- Model.ShiftSort
- Model.ShiftWage
- Model.ShiftWorkday
- Model.SourceApplication
- Model.Tender
- Model.TenderCardDetails
- Model.TenderCashDetails
- Model.TimeRange
- Model.Transaction
- Model.UpdateBreakTypeRequest
- Model.UpdateBreakTypeResponse
- Model.UpdateCustomerRequest
- Model.UpdateCustomerResponse
- Model.UpdateItemModifierListsRequest
- Model.UpdateItemModifierListsResponse
- Model.UpdateItemTaxesRequest
- Model.UpdateItemTaxesResponse
- Model.UpdateShiftRequest
- Model.UpdateShiftResponse
- Model.UpdateWorkweekConfigRequest
- Model.UpdateWorkweekConfigResponse
- Model.UpsertCatalogObjectRequest
- Model.UpsertCatalogObjectResponse
- Model.V1AdjustInventoryRequest
- Model.V1ApplyFeeRequest
- Model.V1ApplyModifierListRequest
- Model.V1BankAccount
- Model.V1CashDrawerEvent
- Model.V1CashDrawerShift
- Model.V1Category
- Model.V1CreateCategoryRequest
- Model.V1CreateDiscountRequest
- Model.V1CreateEmployeeRoleRequest
- Model.V1CreateFeeRequest
- Model.V1CreateItemRequest
- Model.V1CreateModifierListRequest
- Model.V1CreateModifierOptionRequest
- Model.V1CreatePageRequest
- Model.V1CreateRefundRequest
- Model.V1CreateVariationRequest
- Model.V1DeleteCategoryRequest
- Model.V1DeleteDiscountRequest
- Model.V1DeleteFeeRequest
- Model.V1DeleteItemRequest
- Model.V1DeleteModifierListRequest
- Model.V1DeleteModifierOptionRequest
- Model.V1DeletePageCellRequest
- Model.V1DeletePageRequest
- Model.V1DeleteTimecardRequest
- Model.V1DeleteTimecardResponse
- Model.V1DeleteVariationRequest
- Model.V1Discount
- Model.V1Employee
- Model.V1EmployeeRole
- Model.V1Fee
- Model.V1InventoryEntry
- Model.V1Item
- Model.V1ItemImage
- Model.V1ListBankAccountsRequest
- Model.V1ListBankAccountsResponse
- Model.V1ListCashDrawerShiftsRequest
- Model.V1ListCashDrawerShiftsResponse
- Model.V1ListCategoriesRequest
- Model.V1ListCategoriesResponse
- Model.V1ListDiscountsRequest
- Model.V1ListDiscountsResponse
- Model.V1ListEmployeeRolesRequest
- Model.V1ListEmployeeRolesResponse
- Model.V1ListEmployeesRequest
- Model.V1ListEmployeesResponse
- Model.V1ListFeesRequest
- Model.V1ListFeesResponse
- Model.V1ListInventoryRequest
- Model.V1ListInventoryResponse
- Model.V1ListItemsRequest
- Model.V1ListItemsResponse
- Model.V1ListLocationsRequest
- Model.V1ListLocationsResponse
- Model.V1ListModifierListsRequest
- Model.V1ListModifierListsResponse
- Model.V1ListOrdersRequest
- Model.V1ListOrdersResponse
- Model.V1ListPagesRequest
- Model.V1ListPagesResponse
- Model.V1ListPaymentsRequest
- Model.V1ListPaymentsResponse
- Model.V1ListRefundsRequest
- Model.V1ListRefundsResponse
- Model.V1ListSettlementsRequest
- Model.V1ListSettlementsResponse
- Model.V1ListTimecardEventsRequest
- Model.V1ListTimecardEventsResponse
- Model.V1ListTimecardsRequest
- Model.V1ListTimecardsResponse
- Model.V1Merchant
- Model.V1MerchantLocationDetails
- Model.V1ModifierList
- Model.V1ModifierOption
- Model.V1Money
- Model.V1Order
- Model.V1OrderHistoryEntry
- Model.V1Page
- Model.V1PageCell
- Model.V1Payment
- Model.V1PaymentDiscount
- Model.V1PaymentItemDetail
- Model.V1PaymentItemization
- Model.V1PaymentModifier
- Model.V1PaymentSurcharge
- Model.V1PaymentTax
- Model.V1PhoneNumber
- Model.V1Refund
- Model.V1RemoveFeeRequest
- Model.V1RemoveModifierListRequest
- Model.V1RetrieveBankAccountRequest
- Model.V1RetrieveBusinessRequest
- Model.V1RetrieveCashDrawerShiftRequest
- Model.V1RetrieveEmployeeRequest
- Model.V1RetrieveEmployeeRoleRequest
- Model.V1RetrieveItemRequest
- Model.V1RetrieveModifierListRequest
- Model.V1RetrieveOrderRequest
- Model.V1RetrievePaymentRequest
- Model.V1RetrieveSettlementRequest
- Model.V1RetrieveTimecardRequest
- Model.V1Settlement
- Model.V1SettlementEntry
- Model.V1Tender
- Model.V1Timecard
- Model.V1TimecardEvent
- Model.V1UpdateCategoryRequest
- Model.V1UpdateDiscountRequest
- Model.V1UpdateEmployeeRequest
- Model.V1UpdateEmployeeRoleRequest
- Model.V1UpdateFeeRequest
- Model.V1UpdateItemRequest
- Model.V1UpdateModifierListRequest
- Model.V1UpdateModifierOptionRequest
- Model.V1UpdateOrderRequest
- Model.V1UpdatePageCellRequest
- Model.V1UpdatePageRequest
- Model.V1UpdateTimecardRequest
- Model.V1UpdateVariationRequest
- Model.V1Variation
- Model.VoidTransactionRequest
- Model.VoidTransactionResponse
- Model.WorkweekConfig
- Type: OAuth
- Flow: accessCode
- Authorization URL:
https://connect.squareup.com/oauth2/authorize
- Scopes:
- BANK_ACCOUNTS_READ: HTTP Method: `GET` Grants read access to bank account information associated with the targeted Square account. For example, to call the Connect v1 ListBankAccounts endpoint.
- CUSTOMERS_READ: HTTP Method: `GET` Grants read access to customer information. For example, to call the ListCustomers endpoint.
- CUSTOMERS_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to customer information. For example, to create and update customer profiles.
- EMPLOYEES_READ: HTTP Method: `GET` Grants read access to employee profile information. For example, to call the Connect v1 Employees API.
- EMPLOYEES_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to employee profile information. For example, to create and modify employee profiles.
- INVENTORY_READ: HTTP Method: `GET` Grants read access to inventory information. For example, to call the RetrieveInventoryCount endpoint.
- INVENTORY_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to inventory information. For example, to call the BatchChangeInventory endpoint.
- ITEMS_READ: HTTP Method: `GET` Grants read access to business and location information. For example, to obtain a location ID for subsequent activity.
- ITEMS_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to product catalog information. For example, to modify or add to a product catalog.
- MERCHANT_PROFILE_READ: HTTP Method: `GET` Grants read access to business and location information. For example, to obtain a location ID for subsequent activity.
- ORDERS_READ: HTTP Method: `GET` Grants read access to order information. For example, to call the BatchRetrieveOrders endpoint.
- ORDERS_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to order information. For example, to call the CreateCheckout endpoint.
- PAYMENTS_READ: HTTP Method: `GET` Grants read access to transaction and refund information. For example, to call the RetrieveTransaction endpoint.
- PAYMENTS_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to transaction and refunds information. For example, to process payments with the Transactions or Checkout API.
- PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS: HTTP Method: `POST`, `PUT`, `DELETE` Allow third party applications to deduct a portion of each transaction amount. Required to use multiparty transaction functionality with the Transactions API.
- PAYMENTS_WRITE_IN_PERSON: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to transaction and refunds information. For example, to process in-person payments.
- SETTLEMENTS_READ: HTTP Method: `GET` Grants read access to settlement (deposit) information. For example, to call the Connect v1 ListSettlements endpoint.
- TIMECARDS_READ: HTTP Method: `GET` Grants read access to employee timecard information. For example, to call the Connect v1 ListTimecards endpoint.
- TIMECARDS_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to employee timecard information. For example, to create and modify timecards.
- TIMECARDS_SETTINGS_READ: HTTP Method: `GET` Grants read access to employee timecard settings information. For example, to call the GetBreakType endpoint.
- TIMECARDS_SETTINGS_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to employee timecard settings information. For example, to call the UpdateBreakType endpoint.
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
V1 Endpoints return pagination information via HTTP headers. In order to obtain
response headers and extract the batch_token
parameter you will need to follow
the following steps:
-
Use the full information endpoint methods of each API to get the ApiResponse object. They are named as their simple counterpart with a
WithHttpInfo
suffix. HenceListEmployeeRoles
would be calledListEmployeeRolesWithHttpInfo
. This method returns anApiResponse<List<V1EmployeeRole>>
object. -
Use
string batchToken = response.BatchToken
to get the token and proceed to get the following page if a token is present.
using System;
using System.Diagnostics;
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;
namespace Example
{
public class ListEmployeeRolesExample
{
public void main()
{
// Configure OAuth2 access token for authorization: oauth2
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new V1EmployeesApi();
var order = order_example; // string | The order in which employees are listed in the response, based on their created_at field.Default value: ASC (optional)
var limit = 56; // int? | The maximum integer number of employee entities to return in a single response. Default 100, maximum 200. (optional)
string batchToken = null;
try
{
do {
// Provides summary information for all of a business's employee roles.
ApiResponse<List<V1EmployeeRole>> response = apiInstance.ListEmployeeRolesWithHttpInfo(order, limit, batchToken);
batchToken = response.BatchToken
Debug.WriteLine(response.Data);
} while (batchToken != null);
}
catch (Exception e)
{
Debug.Print("Exception when calling V1EmployeesApi.ListEmployeeRolesWithHttpInfo: " + e.Message );
}
}
}
}
Send bug reports, feature requests, and code contributions to the API specifications repository, as this repository contains only the generated SDK code.
Copyright 2017 Square, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.