README.md in square_connect-2.20190724.0.325 vs README.md in square_connect-2.20190724.0.330

- old
+ new

@@ -1,778 +1,173 @@ -Square Connect Ruby SDKs [![Build Status](https://travis-ci.org/square/connect-ruby-sdk.svg?branch=master)](https://travis-ci.org/square/connect-ruby-sdk)[![Gem Version](https://badge.fury.io/rb/square_connect.svg)](https://badge.fury.io/rb/square_connect) +![Square logo] + +# Square Connect Ruby SDK - RETIRED + +--- + +[![Build Status](https://travis-ci.org/square/connect-ruby-sdk.svg?branch=master)](https://travis-ci.org/square/connect-ruby-sdk) +[![Gem Version](https://badge.fury.io/rb/square_connect.svg)](https://badge.fury.io/rb/square_connect) +[![Apache-2 license](https://img.shields.io/badge/license-Apache2-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0) ================== -**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](https://squ.re/2GYvF2B)** +## NOTICE: Square Connect Ruby SDK retired -This repository contains the released Ruby client SDK. Check out our [API -specification repository](https://github.com/square/connect-api-specification) -for the specification and template files we used to generate this. +The Square Connect Ruby SDK is retired (EOL) as of 2019-08-15 and will no longer +receive bug fixes or product updates. To continue receiving API and SDK +improvements, please follow the instructions below to migrate to the new +[Square Ruby SDK gem]. -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: -- API version: 2.0 -- Package version: 2.20190724.0 -- Build package: io.swagger.codegen.languages.RubyClientCodegen +The old Connect SDK documentation is available under the +[`/docs` folder](./docs/README.md). -For more information, please visit [https://squareup.com/developers](https://squareup.com/developers) +<br/> --- -## NOTICE: New Beta Ruby SDK Availability -Square is pleased to announce early access to the beta release of **square.rb**, the new Square Ruby SDK gem. The new **square.rb** gem lets you take payments and run a business with Square APIs including Catalog, Customers, Employees, Inventory, Labor, Locations, Orders, and more. This new gem will eventually replace the square_connect gem and this repo. - You can read more about the release in our [blog post](https://developer.squareup.com/blog/announcing-square's-new-ruby-sdk/), or check out the new Square Ruby SDK gem on [GitHub](https://github.com/square/square-ruby-sdk#readme). Or just give **square.rb** a try! You can install the gem from your terminal with the command: -```ruby -gem install square.rb -``` +* [Migrate to the Square Ruby SDK](#migrate-to-the-square-ruby-sdk) + * [Update your bundle](#update-your-bundle) + * [Update your code](#update-your-code) +* [Example code migration](#example-code-migration) +* [Ask the Community](#ask-the-community) + --- -## Installation of Square Connect Ruby SDK +<br/> -### Option1: RubyGems -The Ruby SDK is published as a gem. Simply run: +## Migrate to the Square Ruby SDK -``` -$ gem install square_connect -``` +Follow the instructions below to migrate your apps from the deprecated +`square_connect` gem to the new `square.rb` gem. -Or add this line to your Gemfile: +### Update your bundle -``` -gem 'square_connect' -``` +1. Find the line in your `Gemfile` starting with `gem: 'square_connect'` and + change the entire line to `gem: 'square.rb'`. +1. Run `bundle` to update your `Gemfile.lock`. -### Option 2: Install from Git +### Update your code -If the Ruby gem is hosted at a git repository: https://github.com/square/connect-ruby-sdk, then add the following in the Gemfile: +1. Change all instances of `require 'square_connect'` to `require 'square'`. +1. Replace models with plain Ruby Hash equivalents. +1. Update client instantiation to follow the method outlined below. +1. Update code for accessing response data to follow the method outlined below. +1. Check `response.success?` or `response.error?` rather than rescuing + exceptions for flow control. - gem 'square_connect', :git => 'https://github.com/square/connect-ruby-sdk.git' +To simplify your code, we also recommend that you use method chaining to access +APIs instead of explicitly instantiating multiple clients. -### Option 3: Include the Ruby code directly +#### Client instantiation -Include the Ruby code directly using `-I` as follows: +```ruby +require 'square' -```shell -ruby -Ilib script.rb +square = Square::Client.new(access_token: 'YOUR ACCESS TOKEN') + +response = square.API.ENDPOINT(body: BODY) ``` -## Getting Started +#### Accessing response data -Please follow the [installation](#installation) procedure and then run the following code: ```ruby -# Load the gem -require 'square_connect' - -# Setup authorization -SquareConnect.configure do |config| - # Configure OAuth2 access token for authorization: oauth2 - config.access_token = 'YOUR ACCESS TOKEN' +if response.success? + p response.data +else + warn response.errors end - -# The SDK throws an exception if a Connect endpoint responds with anything besides 200 (success). -# This block catches any exceptions that occur from the request. -locations_api = SquareConnect::LocationsApi.new -begin - locations = locations_api.list_locations.locations -rescue SquareConnect::ApiError => e - puts "Error encountered while loading the locations: #{e.message}" -end ``` -## Documentation for API Endpoints +<br/> -All URIs are relative to *https://connect.squareup.com* +--- -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SquareConnect::ApplePayApi* | [**register_domain**](docs/ApplePayApi.md#register_domain) | **POST** /v2/apple-pay/domains | RegisterDomain -*SquareConnect::CatalogApi* | [**batch_delete_catalog_objects**](docs/CatalogApi.md#batch_delete_catalog_objects) | **POST** /v2/catalog/batch-delete | BatchDeleteCatalogObjects -*SquareConnect::CatalogApi* | [**batch_retrieve_catalog_objects**](docs/CatalogApi.md#batch_retrieve_catalog_objects) | **POST** /v2/catalog/batch-retrieve | BatchRetrieveCatalogObjects -*SquareConnect::CatalogApi* | [**batch_upsert_catalog_objects**](docs/CatalogApi.md#batch_upsert_catalog_objects) | **POST** /v2/catalog/batch-upsert | BatchUpsertCatalogObjects -*SquareConnect::CatalogApi* | [**catalog_info**](docs/CatalogApi.md#catalog_info) | **GET** /v2/catalog/info | CatalogInfo -*SquareConnect::CatalogApi* | [**delete_catalog_object**](docs/CatalogApi.md#delete_catalog_object) | **DELETE** /v2/catalog/object/{object_id} | DeleteCatalogObject -*SquareConnect::CatalogApi* | [**list_catalog**](docs/CatalogApi.md#list_catalog) | **GET** /v2/catalog/list | ListCatalog -*SquareConnect::CatalogApi* | [**retrieve_catalog_object**](docs/CatalogApi.md#retrieve_catalog_object) | **GET** /v2/catalog/object/{object_id} | RetrieveCatalogObject -*SquareConnect::CatalogApi* | [**search_catalog_objects**](docs/CatalogApi.md#search_catalog_objects) | **POST** /v2/catalog/search | SearchCatalogObjects -*SquareConnect::CatalogApi* | [**update_item_modifier_lists**](docs/CatalogApi.md#update_item_modifier_lists) | **POST** /v2/catalog/update-item-modifier-lists | UpdateItemModifierLists -*SquareConnect::CatalogApi* | [**update_item_taxes**](docs/CatalogApi.md#update_item_taxes) | **POST** /v2/catalog/update-item-taxes | UpdateItemTaxes -*SquareConnect::CatalogApi* | [**upsert_catalog_object**](docs/CatalogApi.md#upsert_catalog_object) | **POST** /v2/catalog/object | UpsertCatalogObject -*SquareConnect::CheckoutApi* | [**create_checkout**](docs/CheckoutApi.md#create_checkout) | **POST** /v2/locations/{location_id}/checkouts | CreateCheckout -*SquareConnect::CustomersApi* | [**create_customer**](docs/CustomersApi.md#create_customer) | **POST** /v2/customers | CreateCustomer -*SquareConnect::CustomersApi* | [**create_customer_card**](docs/CustomersApi.md#create_customer_card) | **POST** /v2/customers/{customer_id}/cards | CreateCustomerCard -*SquareConnect::CustomersApi* | [**delete_customer**](docs/CustomersApi.md#delete_customer) | **DELETE** /v2/customers/{customer_id} | DeleteCustomer -*SquareConnect::CustomersApi* | [**delete_customer_card**](docs/CustomersApi.md#delete_customer_card) | **DELETE** /v2/customers/{customer_id}/cards/{card_id} | DeleteCustomerCard -*SquareConnect::CustomersApi* | [**list_customers**](docs/CustomersApi.md#list_customers) | **GET** /v2/customers | ListCustomers -*SquareConnect::CustomersApi* | [**retrieve_customer**](docs/CustomersApi.md#retrieve_customer) | **GET** /v2/customers/{customer_id} | RetrieveCustomer -*SquareConnect::CustomersApi* | [**search_customers**](docs/CustomersApi.md#search_customers) | **POST** /v2/customers/search | SearchCustomers -*SquareConnect::CustomersApi* | [**update_customer**](docs/CustomersApi.md#update_customer) | **PUT** /v2/customers/{customer_id} | UpdateCustomer -*SquareConnect::EmployeesApi* | [**list_employees**](docs/EmployeesApi.md#list_employees) | **GET** /v2/employees | ListEmployees -*SquareConnect::EmployeesApi* | [**retrieve_employee**](docs/EmployeesApi.md#retrieve_employee) | **GET** /v2/employees/{id} | RetrieveEmployee -*SquareConnect::InventoryApi* | [**batch_change_inventory**](docs/InventoryApi.md#batch_change_inventory) | **POST** /v2/inventory/batch-change | BatchChangeInventory -*SquareConnect::InventoryApi* | [**batch_retrieve_inventory_changes**](docs/InventoryApi.md#batch_retrieve_inventory_changes) | **POST** /v2/inventory/batch-retrieve-changes | BatchRetrieveInventoryChanges -*SquareConnect::InventoryApi* | [**batch_retrieve_inventory_counts**](docs/InventoryApi.md#batch_retrieve_inventory_counts) | **POST** /v2/inventory/batch-retrieve-counts | BatchRetrieveInventoryCounts -*SquareConnect::InventoryApi* | [**retrieve_inventory_adjustment**](docs/InventoryApi.md#retrieve_inventory_adjustment) | **GET** /v2/inventory/adjustment/{adjustment_id} | RetrieveInventoryAdjustment -*SquareConnect::InventoryApi* | [**retrieve_inventory_changes**](docs/InventoryApi.md#retrieve_inventory_changes) | **GET** /v2/inventory/{catalog_object_id}/changes | RetrieveInventoryChanges -*SquareConnect::InventoryApi* | [**retrieve_inventory_count**](docs/InventoryApi.md#retrieve_inventory_count) | **GET** /v2/inventory/{catalog_object_id} | RetrieveInventoryCount -*SquareConnect::InventoryApi* | [**retrieve_inventory_physical_count**](docs/InventoryApi.md#retrieve_inventory_physical_count) | **GET** /v2/inventory/physical-count/{physical_count_id} | RetrieveInventoryPhysicalCount -*SquareConnect::LaborApi* | [**create_break_type**](docs/LaborApi.md#create_break_type) | **POST** /v2/labor/break-types | CreateBreakType -*SquareConnect::LaborApi* | [**create_shift**](docs/LaborApi.md#create_shift) | **POST** /v2/labor/shifts | CreateShift -*SquareConnect::LaborApi* | [**delete_break_type**](docs/LaborApi.md#delete_break_type) | **DELETE** /v2/labor/break-types/{id} | DeleteBreakType -*SquareConnect::LaborApi* | [**delete_shift**](docs/LaborApi.md#delete_shift) | **DELETE** /v2/labor/shifts/{id} | DeleteShift -*SquareConnect::LaborApi* | [**get_break_type**](docs/LaborApi.md#get_break_type) | **GET** /v2/labor/break-types/{id} | GetBreakType -*SquareConnect::LaborApi* | [**get_employee_wage**](docs/LaborApi.md#get_employee_wage) | **GET** /v2/labor/employee-wages/{id} | GetEmployeeWage -*SquareConnect::LaborApi* | [**get_shift**](docs/LaborApi.md#get_shift) | **GET** /v2/labor/shifts/{id} | GetShift -*SquareConnect::LaborApi* | [**list_break_types**](docs/LaborApi.md#list_break_types) | **GET** /v2/labor/break-types | ListBreakTypes -*SquareConnect::LaborApi* | [**list_employee_wages**](docs/LaborApi.md#list_employee_wages) | **GET** /v2/labor/employee-wages | ListEmployeeWages -*SquareConnect::LaborApi* | [**list_workweek_configs**](docs/LaborApi.md#list_workweek_configs) | **GET** /v2/labor/workweek-configs | ListWorkweekConfigs -*SquareConnect::LaborApi* | [**search_shifts**](docs/LaborApi.md#search_shifts) | **POST** /v2/labor/shifts/search | SearchShifts -*SquareConnect::LaborApi* | [**update_break_type**](docs/LaborApi.md#update_break_type) | **PUT** /v2/labor/break-types/{id} | UpdateBreakType -*SquareConnect::LaborApi* | [**update_shift**](docs/LaborApi.md#update_shift) | **PUT** /v2/labor/shifts/{id} | UpdateShift -*SquareConnect::LaborApi* | [**update_workweek_config**](docs/LaborApi.md#update_workweek_config) | **PUT** /v2/labor/workweek-configs/{id} | UpdateWorkweekConfig -*SquareConnect::LocationsApi* | [**list_locations**](docs/LocationsApi.md#list_locations) | **GET** /v2/locations | ListLocations -*SquareConnect::MobileAuthorizationApi* | [**create_mobile_authorization_code**](docs/MobileAuthorizationApi.md#create_mobile_authorization_code) | **POST** /mobile/authorization-code | CreateMobileAuthorizationCode -*SquareConnect::OAuthApi* | [**obtain_token**](docs/OAuthApi.md#obtain_token) | **POST** /oauth2/token | ObtainToken -*SquareConnect::OAuthApi* | [**renew_token**](docs/OAuthApi.md#renew_token) | **POST** /oauth2/clients/{client_id}/access-token/renew | RenewToken -*SquareConnect::OAuthApi* | [**revoke_token**](docs/OAuthApi.md#revoke_token) | **POST** /oauth2/revoke | RevokeToken -*SquareConnect::OrdersApi* | [**batch_retrieve_orders**](docs/OrdersApi.md#batch_retrieve_orders) | **POST** /v2/locations/{location_id}/orders/batch-retrieve | BatchRetrieveOrders -*SquareConnect::OrdersApi* | [**create_order**](docs/OrdersApi.md#create_order) | **POST** /v2/locations/{location_id}/orders | CreateOrder -*SquareConnect::OrdersApi* | [**search_orders**](docs/OrdersApi.md#search_orders) | **POST** /v2/orders/search | SearchOrders -*SquareConnect::ReportingApi* | [**list_additional_recipient_receivable_refunds**](docs/ReportingApi.md#list_additional_recipient_receivable_refunds) | **GET** /v2/locations/{location_id}/additional-recipient-receivable-refunds | ListAdditionalRecipientReceivableRefunds -*SquareConnect::ReportingApi* | [**list_additional_recipient_receivables**](docs/ReportingApi.md#list_additional_recipient_receivables) | **GET** /v2/locations/{location_id}/additional-recipient-receivables | ListAdditionalRecipientReceivables -*SquareConnect::TransactionsApi* | [**capture_transaction**](docs/TransactionsApi.md#capture_transaction) | **POST** /v2/locations/{location_id}/transactions/{transaction_id}/capture | CaptureTransaction -*SquareConnect::TransactionsApi* | [**charge**](docs/TransactionsApi.md#charge) | **POST** /v2/locations/{location_id}/transactions | Charge -*SquareConnect::TransactionsApi* | [**create_refund**](docs/TransactionsApi.md#create_refund) | **POST** /v2/locations/{location_id}/transactions/{transaction_id}/refund | CreateRefund -*SquareConnect::TransactionsApi* | [**list_refunds**](docs/TransactionsApi.md#list_refunds) | **GET** /v2/locations/{location_id}/refunds | ListRefunds -*SquareConnect::TransactionsApi* | [**list_transactions**](docs/TransactionsApi.md#list_transactions) | **GET** /v2/locations/{location_id}/transactions | ListTransactions -*SquareConnect::TransactionsApi* | [**retrieve_transaction**](docs/TransactionsApi.md#retrieve_transaction) | **GET** /v2/locations/{location_id}/transactions/{transaction_id} | RetrieveTransaction -*SquareConnect::TransactionsApi* | [**void_transaction**](docs/TransactionsApi.md#void_transaction) | **POST** /v2/locations/{location_id}/transactions/{transaction_id}/void | VoidTransaction -*SquareConnect::V1EmployeesApi* | [**create_employee**](docs/V1EmployeesApi.md#create_employee) | **POST** /v1/me/employees | CreateEmployee -*SquareConnect::V1EmployeesApi* | [**create_employee_role**](docs/V1EmployeesApi.md#create_employee_role) | **POST** /v1/me/roles | CreateEmployeeRole -*SquareConnect::V1EmployeesApi* | [**create_timecard**](docs/V1EmployeesApi.md#create_timecard) | **POST** /v1/me/timecards | CreateTimecard -*SquareConnect::V1EmployeesApi* | [**delete_timecard**](docs/V1EmployeesApi.md#delete_timecard) | **DELETE** /v1/me/timecards/{timecard_id} | DeleteTimecard -*SquareConnect::V1EmployeesApi* | [**list_cash_drawer_shifts**](docs/V1EmployeesApi.md#list_cash_drawer_shifts) | **GET** /v1/{location_id}/cash-drawer-shifts | ListCashDrawerShifts -*SquareConnect::V1EmployeesApi* | [**list_employee_roles**](docs/V1EmployeesApi.md#list_employee_roles) | **GET** /v1/me/roles | ListEmployeeRoles -*SquareConnect::V1EmployeesApi* | [**list_employees**](docs/V1EmployeesApi.md#list_employees) | **GET** /v1/me/employees | ListEmployees -*SquareConnect::V1EmployeesApi* | [**list_timecard_events**](docs/V1EmployeesApi.md#list_timecard_events) | **GET** /v1/me/timecards/{timecard_id}/events | ListTimecardEvents -*SquareConnect::V1EmployeesApi* | [**list_timecards**](docs/V1EmployeesApi.md#list_timecards) | **GET** /v1/me/timecards | ListTimecards -*SquareConnect::V1EmployeesApi* | [**retrieve_cash_drawer_shift**](docs/V1EmployeesApi.md#retrieve_cash_drawer_shift) | **GET** /v1/{location_id}/cash-drawer-shifts/{shift_id} | RetrieveCashDrawerShift -*SquareConnect::V1EmployeesApi* | [**retrieve_employee**](docs/V1EmployeesApi.md#retrieve_employee) | **GET** /v1/me/employees/{employee_id} | RetrieveEmployee -*SquareConnect::V1EmployeesApi* | [**retrieve_employee_role**](docs/V1EmployeesApi.md#retrieve_employee_role) | **GET** /v1/me/roles/{role_id} | RetrieveEmployeeRole -*SquareConnect::V1EmployeesApi* | [**retrieve_timecard**](docs/V1EmployeesApi.md#retrieve_timecard) | **GET** /v1/me/timecards/{timecard_id} | RetrieveTimecard -*SquareConnect::V1EmployeesApi* | [**update_employee**](docs/V1EmployeesApi.md#update_employee) | **PUT** /v1/me/employees/{employee_id} | UpdateEmployee -*SquareConnect::V1EmployeesApi* | [**update_employee_role**](docs/V1EmployeesApi.md#update_employee_role) | **PUT** /v1/me/roles/{role_id} | UpdateEmployeeRole -*SquareConnect::V1EmployeesApi* | [**update_timecard**](docs/V1EmployeesApi.md#update_timecard) | **PUT** /v1/me/timecards/{timecard_id} | UpdateTimecard -*SquareConnect::V1ItemsApi* | [**adjust_inventory**](docs/V1ItemsApi.md#adjust_inventory) | **POST** /v1/{location_id}/inventory/{variation_id} | AdjustInventory -*SquareConnect::V1ItemsApi* | [**apply_fee**](docs/V1ItemsApi.md#apply_fee) | **PUT** /v1/{location_id}/items/{item_id}/fees/{fee_id} | ApplyFee -*SquareConnect::V1ItemsApi* | [**apply_modifier_list**](docs/V1ItemsApi.md#apply_modifier_list) | **PUT** /v1/{location_id}/items/{item_id}/modifier-lists/{modifier_list_id} | ApplyModifierList -*SquareConnect::V1ItemsApi* | [**create_category**](docs/V1ItemsApi.md#create_category) | **POST** /v1/{location_id}/categories | CreateCategory -*SquareConnect::V1ItemsApi* | [**create_discount**](docs/V1ItemsApi.md#create_discount) | **POST** /v1/{location_id}/discounts | CreateDiscount -*SquareConnect::V1ItemsApi* | [**create_fee**](docs/V1ItemsApi.md#create_fee) | **POST** /v1/{location_id}/fees | CreateFee -*SquareConnect::V1ItemsApi* | [**create_item**](docs/V1ItemsApi.md#create_item) | **POST** /v1/{location_id}/items | CreateItem -*SquareConnect::V1ItemsApi* | [**create_modifier_list**](docs/V1ItemsApi.md#create_modifier_list) | **POST** /v1/{location_id}/modifier-lists | CreateModifierList -*SquareConnect::V1ItemsApi* | [**create_modifier_option**](docs/V1ItemsApi.md#create_modifier_option) | **POST** /v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options | CreateModifierOption -*SquareConnect::V1ItemsApi* | [**create_page**](docs/V1ItemsApi.md#create_page) | **POST** /v1/{location_id}/pages | CreatePage -*SquareConnect::V1ItemsApi* | [**create_variation**](docs/V1ItemsApi.md#create_variation) | **POST** /v1/{location_id}/items/{item_id}/variations | CreateVariation -*SquareConnect::V1ItemsApi* | [**delete_category**](docs/V1ItemsApi.md#delete_category) | **DELETE** /v1/{location_id}/categories/{category_id} | DeleteCategory -*SquareConnect::V1ItemsApi* | [**delete_discount**](docs/V1ItemsApi.md#delete_discount) | **DELETE** /v1/{location_id}/discounts/{discount_id} | DeleteDiscount -*SquareConnect::V1ItemsApi* | [**delete_fee**](docs/V1ItemsApi.md#delete_fee) | **DELETE** /v1/{location_id}/fees/{fee_id} | DeleteFee -*SquareConnect::V1ItemsApi* | [**delete_item**](docs/V1ItemsApi.md#delete_item) | **DELETE** /v1/{location_id}/items/{item_id} | DeleteItem -*SquareConnect::V1ItemsApi* | [**delete_modifier_list**](docs/V1ItemsApi.md#delete_modifier_list) | **DELETE** /v1/{location_id}/modifier-lists/{modifier_list_id} | DeleteModifierList -*SquareConnect::V1ItemsApi* | [**delete_modifier_option**](docs/V1ItemsApi.md#delete_modifier_option) | **DELETE** /v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options/{modifier_option_id} | DeleteModifierOption -*SquareConnect::V1ItemsApi* | [**delete_page**](docs/V1ItemsApi.md#delete_page) | **DELETE** /v1/{location_id}/pages/{page_id} | DeletePage -*SquareConnect::V1ItemsApi* | [**delete_page_cell**](docs/V1ItemsApi.md#delete_page_cell) | **DELETE** /v1/{location_id}/pages/{page_id}/cells | DeletePageCell -*SquareConnect::V1ItemsApi* | [**delete_variation**](docs/V1ItemsApi.md#delete_variation) | **DELETE** /v1/{location_id}/items/{item_id}/variations/{variation_id} | DeleteVariation -*SquareConnect::V1ItemsApi* | [**list_categories**](docs/V1ItemsApi.md#list_categories) | **GET** /v1/{location_id}/categories | ListCategories -*SquareConnect::V1ItemsApi* | [**list_discounts**](docs/V1ItemsApi.md#list_discounts) | **GET** /v1/{location_id}/discounts | ListDiscounts -*SquareConnect::V1ItemsApi* | [**list_fees**](docs/V1ItemsApi.md#list_fees) | **GET** /v1/{location_id}/fees | ListFees -*SquareConnect::V1ItemsApi* | [**list_inventory**](docs/V1ItemsApi.md#list_inventory) | **GET** /v1/{location_id}/inventory | ListInventory -*SquareConnect::V1ItemsApi* | [**list_items**](docs/V1ItemsApi.md#list_items) | **GET** /v1/{location_id}/items | ListItems -*SquareConnect::V1ItemsApi* | [**list_modifier_lists**](docs/V1ItemsApi.md#list_modifier_lists) | **GET** /v1/{location_id}/modifier-lists | ListModifierLists -*SquareConnect::V1ItemsApi* | [**list_pages**](docs/V1ItemsApi.md#list_pages) | **GET** /v1/{location_id}/pages | ListPages -*SquareConnect::V1ItemsApi* | [**remove_fee**](docs/V1ItemsApi.md#remove_fee) | **DELETE** /v1/{location_id}/items/{item_id}/fees/{fee_id} | RemoveFee -*SquareConnect::V1ItemsApi* | [**remove_modifier_list**](docs/V1ItemsApi.md#remove_modifier_list) | **DELETE** /v1/{location_id}/items/{item_id}/modifier-lists/{modifier_list_id} | RemoveModifierList -*SquareConnect::V1ItemsApi* | [**retrieve_item**](docs/V1ItemsApi.md#retrieve_item) | **GET** /v1/{location_id}/items/{item_id} | RetrieveItem -*SquareConnect::V1ItemsApi* | [**retrieve_modifier_list**](docs/V1ItemsApi.md#retrieve_modifier_list) | **GET** /v1/{location_id}/modifier-lists/{modifier_list_id} | RetrieveModifierList -*SquareConnect::V1ItemsApi* | [**update_category**](docs/V1ItemsApi.md#update_category) | **PUT** /v1/{location_id}/categories/{category_id} | UpdateCategory -*SquareConnect::V1ItemsApi* | [**update_discount**](docs/V1ItemsApi.md#update_discount) | **PUT** /v1/{location_id}/discounts/{discount_id} | UpdateDiscount -*SquareConnect::V1ItemsApi* | [**update_fee**](docs/V1ItemsApi.md#update_fee) | **PUT** /v1/{location_id}/fees/{fee_id} | UpdateFee -*SquareConnect::V1ItemsApi* | [**update_item**](docs/V1ItemsApi.md#update_item) | **PUT** /v1/{location_id}/items/{item_id} | UpdateItem -*SquareConnect::V1ItemsApi* | [**update_modifier_list**](docs/V1ItemsApi.md#update_modifier_list) | **PUT** /v1/{location_id}/modifier-lists/{modifier_list_id} | UpdateModifierList -*SquareConnect::V1ItemsApi* | [**update_modifier_option**](docs/V1ItemsApi.md#update_modifier_option) | **PUT** /v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options/{modifier_option_id} | UpdateModifierOption -*SquareConnect::V1ItemsApi* | [**update_page**](docs/V1ItemsApi.md#update_page) | **PUT** /v1/{location_id}/pages/{page_id} | UpdatePage -*SquareConnect::V1ItemsApi* | [**update_page_cell**](docs/V1ItemsApi.md#update_page_cell) | **PUT** /v1/{location_id}/pages/{page_id}/cells | UpdatePageCell -*SquareConnect::V1ItemsApi* | [**update_variation**](docs/V1ItemsApi.md#update_variation) | **PUT** /v1/{location_id}/items/{item_id}/variations/{variation_id} | UpdateVariation -*SquareConnect::V1LocationsApi* | [**list_locations**](docs/V1LocationsApi.md#list_locations) | **GET** /v1/me/locations | ListLocations -*SquareConnect::V1LocationsApi* | [**retrieve_business**](docs/V1LocationsApi.md#retrieve_business) | **GET** /v1/me | RetrieveBusiness -*SquareConnect::V1TransactionsApi* | [**create_refund**](docs/V1TransactionsApi.md#create_refund) | **POST** /v1/{location_id}/refunds | CreateRefund -*SquareConnect::V1TransactionsApi* | [**list_bank_accounts**](docs/V1TransactionsApi.md#list_bank_accounts) | **GET** /v1/{location_id}/bank-accounts | ListBankAccounts -*SquareConnect::V1TransactionsApi* | [**list_orders**](docs/V1TransactionsApi.md#list_orders) | **GET** /v1/{location_id}/orders | ListOrders -*SquareConnect::V1TransactionsApi* | [**list_payments**](docs/V1TransactionsApi.md#list_payments) | **GET** /v1/{location_id}/payments | ListPayments -*SquareConnect::V1TransactionsApi* | [**list_refunds**](docs/V1TransactionsApi.md#list_refunds) | **GET** /v1/{location_id}/refunds | ListRefunds -*SquareConnect::V1TransactionsApi* | [**list_settlements**](docs/V1TransactionsApi.md#list_settlements) | **GET** /v1/{location_id}/settlements | ListSettlements -*SquareConnect::V1TransactionsApi* | [**retrieve_bank_account**](docs/V1TransactionsApi.md#retrieve_bank_account) | **GET** /v1/{location_id}/bank-accounts/{bank_account_id} | RetrieveBankAccount -*SquareConnect::V1TransactionsApi* | [**retrieve_order**](docs/V1TransactionsApi.md#retrieve_order) | **GET** /v1/{location_id}/orders/{order_id} | RetrieveOrder -*SquareConnect::V1TransactionsApi* | [**retrieve_payment**](docs/V1TransactionsApi.md#retrieve_payment) | **GET** /v1/{location_id}/payments/{payment_id} | RetrievePayment -*SquareConnect::V1TransactionsApi* | [**retrieve_settlement**](docs/V1TransactionsApi.md#retrieve_settlement) | **GET** /v1/{location_id}/settlements/{settlement_id} | RetrieveSettlement -*SquareConnect::V1TransactionsApi* | [**update_order**](docs/V1TransactionsApi.md#update_order) | **PUT** /v1/{location_id}/orders/{order_id} | UpdateOrder +<br/> +## Example code migration -## Documentation for Models +As a specific example, consider the following code for creating a new customer +from the following Hash: - - [SquareConnect::AdditionalRecipient](docs/AdditionalRecipient.md) - - [SquareConnect::AdditionalRecipientReceivable](docs/AdditionalRecipientReceivable.md) - - [SquareConnect::AdditionalRecipientReceivableRefund](docs/AdditionalRecipientReceivableRefund.md) - - [SquareConnect::Address](docs/Address.md) - - [SquareConnect::BatchChangeInventoryRequest](docs/BatchChangeInventoryRequest.md) - - [SquareConnect::BatchChangeInventoryResponse](docs/BatchChangeInventoryResponse.md) - - [SquareConnect::BatchDeleteCatalogObjectsRequest](docs/BatchDeleteCatalogObjectsRequest.md) - - [SquareConnect::BatchDeleteCatalogObjectsResponse](docs/BatchDeleteCatalogObjectsResponse.md) - - [SquareConnect::BatchRetrieveCatalogObjectsRequest](docs/BatchRetrieveCatalogObjectsRequest.md) - - [SquareConnect::BatchRetrieveCatalogObjectsResponse](docs/BatchRetrieveCatalogObjectsResponse.md) - - [SquareConnect::BatchRetrieveInventoryChangesRequest](docs/BatchRetrieveInventoryChangesRequest.md) - - [SquareConnect::BatchRetrieveInventoryChangesResponse](docs/BatchRetrieveInventoryChangesResponse.md) - - [SquareConnect::BatchRetrieveInventoryCountsRequest](docs/BatchRetrieveInventoryCountsRequest.md) - - [SquareConnect::BatchRetrieveInventoryCountsResponse](docs/BatchRetrieveInventoryCountsResponse.md) - - [SquareConnect::BatchRetrieveOrdersRequest](docs/BatchRetrieveOrdersRequest.md) - - [SquareConnect::BatchRetrieveOrdersResponse](docs/BatchRetrieveOrdersResponse.md) - - [SquareConnect::BatchUpsertCatalogObjectsRequest](docs/BatchUpsertCatalogObjectsRequest.md) - - [SquareConnect::BatchUpsertCatalogObjectsResponse](docs/BatchUpsertCatalogObjectsResponse.md) - - [SquareConnect::BreakType](docs/BreakType.md) - - [SquareConnect::BusinessHours](docs/BusinessHours.md) - - [SquareConnect::BusinessHoursPeriod](docs/BusinessHoursPeriod.md) - - [SquareConnect::CaptureTransactionRequest](docs/CaptureTransactionRequest.md) - - [SquareConnect::CaptureTransactionResponse](docs/CaptureTransactionResponse.md) - - [SquareConnect::Card](docs/Card.md) - - [SquareConnect::CardBrand](docs/CardBrand.md) - - [SquareConnect::CatalogCategory](docs/CatalogCategory.md) - - [SquareConnect::CatalogDiscount](docs/CatalogDiscount.md) - - [SquareConnect::CatalogDiscountType](docs/CatalogDiscountType.md) - - [SquareConnect::CatalogIdMapping](docs/CatalogIdMapping.md) - - [SquareConnect::CatalogImage](docs/CatalogImage.md) - - [SquareConnect::CatalogInfoRequest](docs/CatalogInfoRequest.md) - - [SquareConnect::CatalogInfoResponse](docs/CatalogInfoResponse.md) - - [SquareConnect::CatalogInfoResponseLimits](docs/CatalogInfoResponseLimits.md) - - [SquareConnect::CatalogItem](docs/CatalogItem.md) - - [SquareConnect::CatalogItemModifierListInfo](docs/CatalogItemModifierListInfo.md) - - [SquareConnect::CatalogItemOption](docs/CatalogItemOption.md) - - [SquareConnect::CatalogItemOptionForItem](docs/CatalogItemOptionForItem.md) - - [SquareConnect::CatalogItemOptionValue](docs/CatalogItemOptionValue.md) - - [SquareConnect::CatalogItemOptionValueForItemVariation](docs/CatalogItemOptionValueForItemVariation.md) - - [SquareConnect::CatalogItemProductType](docs/CatalogItemProductType.md) - - [SquareConnect::CatalogItemVariation](docs/CatalogItemVariation.md) - - [SquareConnect::CatalogMeasurementUnit](docs/CatalogMeasurementUnit.md) - - [SquareConnect::CatalogModifier](docs/CatalogModifier.md) - - [SquareConnect::CatalogModifierList](docs/CatalogModifierList.md) - - [SquareConnect::CatalogModifierListSelectionType](docs/CatalogModifierListSelectionType.md) - - [SquareConnect::CatalogModifierOverride](docs/CatalogModifierOverride.md) - - [SquareConnect::CatalogObject](docs/CatalogObject.md) - - [SquareConnect::CatalogObjectBatch](docs/CatalogObjectBatch.md) - - [SquareConnect::CatalogObjectType](docs/CatalogObjectType.md) - - [SquareConnect::CatalogPricingRule](docs/CatalogPricingRule.md) - - [SquareConnect::CatalogPricingType](docs/CatalogPricingType.md) - - [SquareConnect::CatalogProductSet](docs/CatalogProductSet.md) - - [SquareConnect::CatalogQuery](docs/CatalogQuery.md) - - [SquareConnect::CatalogQueryExact](docs/CatalogQueryExact.md) - - [SquareConnect::CatalogQueryItemVariationsForItemOptionValues](docs/CatalogQueryItemVariationsForItemOptionValues.md) - - [SquareConnect::CatalogQueryItemsForItemOptions](docs/CatalogQueryItemsForItemOptions.md) - - [SquareConnect::CatalogQueryItemsForModifierList](docs/CatalogQueryItemsForModifierList.md) - - [SquareConnect::CatalogQueryItemsForTax](docs/CatalogQueryItemsForTax.md) - - [SquareConnect::CatalogQueryPrefix](docs/CatalogQueryPrefix.md) - - [SquareConnect::CatalogQueryRange](docs/CatalogQueryRange.md) - - [SquareConnect::CatalogQuerySortedAttribute](docs/CatalogQuerySortedAttribute.md) - - [SquareConnect::CatalogQueryText](docs/CatalogQueryText.md) - - [SquareConnect::CatalogTax](docs/CatalogTax.md) - - [SquareConnect::CatalogTimePeriod](docs/CatalogTimePeriod.md) - - [SquareConnect::CatalogV1Id](docs/CatalogV1Id.md) - - [SquareConnect::ChargeRequest](docs/ChargeRequest.md) - - [SquareConnect::ChargeRequestAdditionalRecipient](docs/ChargeRequestAdditionalRecipient.md) - - [SquareConnect::ChargeResponse](docs/ChargeResponse.md) - - [SquareConnect::Checkout](docs/Checkout.md) - - [SquareConnect::Coordinates](docs/Coordinates.md) - - [SquareConnect::Country](docs/Country.md) - - [SquareConnect::CreateBreakTypeRequest](docs/CreateBreakTypeRequest.md) - - [SquareConnect::CreateBreakTypeResponse](docs/CreateBreakTypeResponse.md) - - [SquareConnect::CreateCheckoutRequest](docs/CreateCheckoutRequest.md) - - [SquareConnect::CreateCheckoutResponse](docs/CreateCheckoutResponse.md) - - [SquareConnect::CreateCustomerCardRequest](docs/CreateCustomerCardRequest.md) - - [SquareConnect::CreateCustomerCardResponse](docs/CreateCustomerCardResponse.md) - - [SquareConnect::CreateCustomerRequest](docs/CreateCustomerRequest.md) - - [SquareConnect::CreateCustomerResponse](docs/CreateCustomerResponse.md) - - [SquareConnect::CreateMobileAuthorizationCodeRequest](docs/CreateMobileAuthorizationCodeRequest.md) - - [SquareConnect::CreateMobileAuthorizationCodeResponse](docs/CreateMobileAuthorizationCodeResponse.md) - - [SquareConnect::CreateOrderRequest](docs/CreateOrderRequest.md) - - [SquareConnect::CreateOrderRequestDiscount](docs/CreateOrderRequestDiscount.md) - - [SquareConnect::CreateOrderRequestLineItem](docs/CreateOrderRequestLineItem.md) - - [SquareConnect::CreateOrderRequestModifier](docs/CreateOrderRequestModifier.md) - - [SquareConnect::CreateOrderRequestTax](docs/CreateOrderRequestTax.md) - - [SquareConnect::CreateOrderResponse](docs/CreateOrderResponse.md) - - [SquareConnect::CreateRefundRequest](docs/CreateRefundRequest.md) - - [SquareConnect::CreateRefundResponse](docs/CreateRefundResponse.md) - - [SquareConnect::CreateShiftRequest](docs/CreateShiftRequest.md) - - [SquareConnect::CreateShiftResponse](docs/CreateShiftResponse.md) - - [SquareConnect::Currency](docs/Currency.md) - - [SquareConnect::Customer](docs/Customer.md) - - [SquareConnect::CustomerCreationSource](docs/CustomerCreationSource.md) - - [SquareConnect::CustomerCreationSourceFilter](docs/CustomerCreationSourceFilter.md) - - [SquareConnect::CustomerFilter](docs/CustomerFilter.md) - - [SquareConnect::CustomerGroupInfo](docs/CustomerGroupInfo.md) - - [SquareConnect::CustomerInclusionExclusion](docs/CustomerInclusionExclusion.md) - - [SquareConnect::CustomerPreferences](docs/CustomerPreferences.md) - - [SquareConnect::CustomerQuery](docs/CustomerQuery.md) - - [SquareConnect::CustomerSort](docs/CustomerSort.md) - - [SquareConnect::CustomerSortField](docs/CustomerSortField.md) - - [SquareConnect::DateRange](docs/DateRange.md) - - [SquareConnect::DayOfWeek](docs/DayOfWeek.md) - - [SquareConnect::DeleteBreakTypeRequest](docs/DeleteBreakTypeRequest.md) - - [SquareConnect::DeleteBreakTypeResponse](docs/DeleteBreakTypeResponse.md) - - [SquareConnect::DeleteCatalogObjectRequest](docs/DeleteCatalogObjectRequest.md) - - [SquareConnect::DeleteCatalogObjectResponse](docs/DeleteCatalogObjectResponse.md) - - [SquareConnect::DeleteCustomerCardRequest](docs/DeleteCustomerCardRequest.md) - - [SquareConnect::DeleteCustomerCardResponse](docs/DeleteCustomerCardResponse.md) - - [SquareConnect::DeleteCustomerRequest](docs/DeleteCustomerRequest.md) - - [SquareConnect::DeleteCustomerResponse](docs/DeleteCustomerResponse.md) - - [SquareConnect::DeleteShiftRequest](docs/DeleteShiftRequest.md) - - [SquareConnect::DeleteShiftResponse](docs/DeleteShiftResponse.md) - - [SquareConnect::Device](docs/Device.md) - - [SquareConnect::Employee](docs/Employee.md) - - [SquareConnect::EmployeeStatus](docs/EmployeeStatus.md) - - [SquareConnect::EmployeeWage](docs/EmployeeWage.md) - - [SquareConnect::Error](docs/Error.md) - - [SquareConnect::ErrorCategory](docs/ErrorCategory.md) - - [SquareConnect::ErrorCode](docs/ErrorCode.md) - - [SquareConnect::GetBreakTypeRequest](docs/GetBreakTypeRequest.md) - - [SquareConnect::GetBreakTypeResponse](docs/GetBreakTypeResponse.md) - - [SquareConnect::GetEmployeeWageRequest](docs/GetEmployeeWageRequest.md) - - [SquareConnect::GetEmployeeWageResponse](docs/GetEmployeeWageResponse.md) - - [SquareConnect::GetShiftRequest](docs/GetShiftRequest.md) - - [SquareConnect::GetShiftResponse](docs/GetShiftResponse.md) - - [SquareConnect::InventoryAdjustment](docs/InventoryAdjustment.md) - - [SquareConnect::InventoryAlertType](docs/InventoryAlertType.md) - - [SquareConnect::InventoryChange](docs/InventoryChange.md) - - [SquareConnect::InventoryChangeType](docs/InventoryChangeType.md) - - [SquareConnect::InventoryCount](docs/InventoryCount.md) - - [SquareConnect::InventoryPhysicalCount](docs/InventoryPhysicalCount.md) - - [SquareConnect::InventoryState](docs/InventoryState.md) - - [SquareConnect::InventoryTransfer](docs/InventoryTransfer.md) - - [SquareConnect::ItemVariationLocationOverrides](docs/ItemVariationLocationOverrides.md) - - [SquareConnect::ListAdditionalRecipientReceivableRefundsRequest](docs/ListAdditionalRecipientReceivableRefundsRequest.md) - - [SquareConnect::ListAdditionalRecipientReceivableRefundsResponse](docs/ListAdditionalRecipientReceivableRefundsResponse.md) - - [SquareConnect::ListAdditionalRecipientReceivablesRequest](docs/ListAdditionalRecipientReceivablesRequest.md) - - [SquareConnect::ListAdditionalRecipientReceivablesResponse](docs/ListAdditionalRecipientReceivablesResponse.md) - - [SquareConnect::ListBreakTypesRequest](docs/ListBreakTypesRequest.md) - - [SquareConnect::ListBreakTypesResponse](docs/ListBreakTypesResponse.md) - - [SquareConnect::ListCatalogRequest](docs/ListCatalogRequest.md) - - [SquareConnect::ListCatalogResponse](docs/ListCatalogResponse.md) - - [SquareConnect::ListCustomersRequest](docs/ListCustomersRequest.md) - - [SquareConnect::ListCustomersResponse](docs/ListCustomersResponse.md) - - [SquareConnect::ListEmployeeWagesRequest](docs/ListEmployeeWagesRequest.md) - - [SquareConnect::ListEmployeeWagesResponse](docs/ListEmployeeWagesResponse.md) - - [SquareConnect::ListEmployeesRequest](docs/ListEmployeesRequest.md) - - [SquareConnect::ListEmployeesResponse](docs/ListEmployeesResponse.md) - - [SquareConnect::ListLocationsRequest](docs/ListLocationsRequest.md) - - [SquareConnect::ListLocationsResponse](docs/ListLocationsResponse.md) - - [SquareConnect::ListRefundsRequest](docs/ListRefundsRequest.md) - - [SquareConnect::ListRefundsResponse](docs/ListRefundsResponse.md) - - [SquareConnect::ListTransactionsRequest](docs/ListTransactionsRequest.md) - - [SquareConnect::ListTransactionsResponse](docs/ListTransactionsResponse.md) - - [SquareConnect::ListWorkweekConfigsRequest](docs/ListWorkweekConfigsRequest.md) - - [SquareConnect::ListWorkweekConfigsResponse](docs/ListWorkweekConfigsResponse.md) - - [SquareConnect::Location](docs/Location.md) - - [SquareConnect::LocationCapability](docs/LocationCapability.md) - - [SquareConnect::LocationStatus](docs/LocationStatus.md) - - [SquareConnect::LocationType](docs/LocationType.md) - - [SquareConnect::MeasurementUnit](docs/MeasurementUnit.md) - - [SquareConnect::MeasurementUnitArea](docs/MeasurementUnitArea.md) - - [SquareConnect::MeasurementUnitCustom](docs/MeasurementUnitCustom.md) - - [SquareConnect::MeasurementUnitGeneric](docs/MeasurementUnitGeneric.md) - - [SquareConnect::MeasurementUnitLength](docs/MeasurementUnitLength.md) - - [SquareConnect::MeasurementUnitVolume](docs/MeasurementUnitVolume.md) - - [SquareConnect::MeasurementUnitWeight](docs/MeasurementUnitWeight.md) - - [SquareConnect::ModelBreak](docs/ModelBreak.md) - - [SquareConnect::Money](docs/Money.md) - - [SquareConnect::ObtainTokenRequest](docs/ObtainTokenRequest.md) - - [SquareConnect::ObtainTokenResponse](docs/ObtainTokenResponse.md) - - [SquareConnect::Order](docs/Order.md) - - [SquareConnect::OrderEntry](docs/OrderEntry.md) - - [SquareConnect::OrderFulfillment](docs/OrderFulfillment.md) - - [SquareConnect::OrderFulfillmentPickupDetails](docs/OrderFulfillmentPickupDetails.md) - - [SquareConnect::OrderFulfillmentPickupDetailsScheduleType](docs/OrderFulfillmentPickupDetailsScheduleType.md) - - [SquareConnect::OrderFulfillmentRecipient](docs/OrderFulfillmentRecipient.md) - - [SquareConnect::OrderFulfillmentState](docs/OrderFulfillmentState.md) - - [SquareConnect::OrderFulfillmentType](docs/OrderFulfillmentType.md) - - [SquareConnect::OrderLineItem](docs/OrderLineItem.md) - - [SquareConnect::OrderLineItemDiscount](docs/OrderLineItemDiscount.md) - - [SquareConnect::OrderLineItemDiscountScope](docs/OrderLineItemDiscountScope.md) - - [SquareConnect::OrderLineItemDiscountType](docs/OrderLineItemDiscountType.md) - - [SquareConnect::OrderLineItemModifier](docs/OrderLineItemModifier.md) - - [SquareConnect::OrderLineItemTax](docs/OrderLineItemTax.md) - - [SquareConnect::OrderLineItemTaxScope](docs/OrderLineItemTaxScope.md) - - [SquareConnect::OrderLineItemTaxType](docs/OrderLineItemTaxType.md) - - [SquareConnect::OrderMoneyAmounts](docs/OrderMoneyAmounts.md) - - [SquareConnect::OrderQuantityUnit](docs/OrderQuantityUnit.md) - - [SquareConnect::OrderReturn](docs/OrderReturn.md) - - [SquareConnect::OrderReturnDiscount](docs/OrderReturnDiscount.md) - - [SquareConnect::OrderReturnLineItem](docs/OrderReturnLineItem.md) - - [SquareConnect::OrderReturnLineItemModifier](docs/OrderReturnLineItemModifier.md) - - [SquareConnect::OrderReturnServiceCharge](docs/OrderReturnServiceCharge.md) - - [SquareConnect::OrderReturnTax](docs/OrderReturnTax.md) - - [SquareConnect::OrderRoundingAdjustment](docs/OrderRoundingAdjustment.md) - - [SquareConnect::OrderServiceCharge](docs/OrderServiceCharge.md) - - [SquareConnect::OrderServiceChargeCalculationPhase](docs/OrderServiceChargeCalculationPhase.md) - - [SquareConnect::OrderSource](docs/OrderSource.md) - - [SquareConnect::OrderState](docs/OrderState.md) - - [SquareConnect::Product](docs/Product.md) - - [SquareConnect::Refund](docs/Refund.md) - - [SquareConnect::RefundStatus](docs/RefundStatus.md) - - [SquareConnect::RegisterDomainRequest](docs/RegisterDomainRequest.md) - - [SquareConnect::RegisterDomainResponse](docs/RegisterDomainResponse.md) - - [SquareConnect::RegisterDomainResponseStatus](docs/RegisterDomainResponseStatus.md) - - [SquareConnect::RenewTokenRequest](docs/RenewTokenRequest.md) - - [SquareConnect::RenewTokenResponse](docs/RenewTokenResponse.md) - - [SquareConnect::RetrieveCatalogObjectRequest](docs/RetrieveCatalogObjectRequest.md) - - [SquareConnect::RetrieveCatalogObjectResponse](docs/RetrieveCatalogObjectResponse.md) - - [SquareConnect::RetrieveCustomerRequest](docs/RetrieveCustomerRequest.md) - - [SquareConnect::RetrieveCustomerResponse](docs/RetrieveCustomerResponse.md) - - [SquareConnect::RetrieveEmployeeRequest](docs/RetrieveEmployeeRequest.md) - - [SquareConnect::RetrieveEmployeeResponse](docs/RetrieveEmployeeResponse.md) - - [SquareConnect::RetrieveInventoryAdjustmentRequest](docs/RetrieveInventoryAdjustmentRequest.md) - - [SquareConnect::RetrieveInventoryAdjustmentResponse](docs/RetrieveInventoryAdjustmentResponse.md) - - [SquareConnect::RetrieveInventoryChangesRequest](docs/RetrieveInventoryChangesRequest.md) - - [SquareConnect::RetrieveInventoryChangesResponse](docs/RetrieveInventoryChangesResponse.md) - - [SquareConnect::RetrieveInventoryCountRequest](docs/RetrieveInventoryCountRequest.md) - - [SquareConnect::RetrieveInventoryCountResponse](docs/RetrieveInventoryCountResponse.md) - - [SquareConnect::RetrieveInventoryPhysicalCountRequest](docs/RetrieveInventoryPhysicalCountRequest.md) - - [SquareConnect::RetrieveInventoryPhysicalCountResponse](docs/RetrieveInventoryPhysicalCountResponse.md) - - [SquareConnect::RetrieveTransactionRequest](docs/RetrieveTransactionRequest.md) - - [SquareConnect::RetrieveTransactionResponse](docs/RetrieveTransactionResponse.md) - - [SquareConnect::RevokeTokenRequest](docs/RevokeTokenRequest.md) - - [SquareConnect::RevokeTokenResponse](docs/RevokeTokenResponse.md) - - [SquareConnect::SearchCatalogObjectsRequest](docs/SearchCatalogObjectsRequest.md) - - [SquareConnect::SearchCatalogObjectsResponse](docs/SearchCatalogObjectsResponse.md) - - [SquareConnect::SearchCustomersRequest](docs/SearchCustomersRequest.md) - - [SquareConnect::SearchCustomersResponse](docs/SearchCustomersResponse.md) - - [SquareConnect::SearchOrdersCustomerFilter](docs/SearchOrdersCustomerFilter.md) - - [SquareConnect::SearchOrdersDateTimeFilter](docs/SearchOrdersDateTimeFilter.md) - - [SquareConnect::SearchOrdersFilter](docs/SearchOrdersFilter.md) - - [SquareConnect::SearchOrdersFulfillmentFilter](docs/SearchOrdersFulfillmentFilter.md) - - [SquareConnect::SearchOrdersQuery](docs/SearchOrdersQuery.md) - - [SquareConnect::SearchOrdersRequest](docs/SearchOrdersRequest.md) - - [SquareConnect::SearchOrdersResponse](docs/SearchOrdersResponse.md) - - [SquareConnect::SearchOrdersSort](docs/SearchOrdersSort.md) - - [SquareConnect::SearchOrdersSortField](docs/SearchOrdersSortField.md) - - [SquareConnect::SearchOrdersSourceFilter](docs/SearchOrdersSourceFilter.md) - - [SquareConnect::SearchOrdersStateFilter](docs/SearchOrdersStateFilter.md) - - [SquareConnect::SearchShiftsRequest](docs/SearchShiftsRequest.md) - - [SquareConnect::SearchShiftsResponse](docs/SearchShiftsResponse.md) - - [SquareConnect::Shift](docs/Shift.md) - - [SquareConnect::ShiftFilter](docs/ShiftFilter.md) - - [SquareConnect::ShiftFilterStatus](docs/ShiftFilterStatus.md) - - [SquareConnect::ShiftQuery](docs/ShiftQuery.md) - - [SquareConnect::ShiftSort](docs/ShiftSort.md) - - [SquareConnect::ShiftSortField](docs/ShiftSortField.md) - - [SquareConnect::ShiftStatus](docs/ShiftStatus.md) - - [SquareConnect::ShiftWage](docs/ShiftWage.md) - - [SquareConnect::ShiftWorkday](docs/ShiftWorkday.md) - - [SquareConnect::ShiftWorkdayMatcher](docs/ShiftWorkdayMatcher.md) - - [SquareConnect::SortOrder](docs/SortOrder.md) - - [SquareConnect::SourceApplication](docs/SourceApplication.md) - - [SquareConnect::StandardUnitDescription](docs/StandardUnitDescription.md) - - [SquareConnect::StandardUnitDescriptionGroup](docs/StandardUnitDescriptionGroup.md) - - [SquareConnect::TaxCalculationPhase](docs/TaxCalculationPhase.md) - - [SquareConnect::TaxInclusionType](docs/TaxInclusionType.md) - - [SquareConnect::Tender](docs/Tender.md) - - [SquareConnect::TenderCardDetails](docs/TenderCardDetails.md) - - [SquareConnect::TenderCardDetailsEntryMethod](docs/TenderCardDetailsEntryMethod.md) - - [SquareConnect::TenderCardDetailsStatus](docs/TenderCardDetailsStatus.md) - - [SquareConnect::TenderCashDetails](docs/TenderCashDetails.md) - - [SquareConnect::TenderType](docs/TenderType.md) - - [SquareConnect::TimeRange](docs/TimeRange.md) - - [SquareConnect::Transaction](docs/Transaction.md) - - [SquareConnect::TransactionProduct](docs/TransactionProduct.md) - - [SquareConnect::UpdateBreakTypeRequest](docs/UpdateBreakTypeRequest.md) - - [SquareConnect::UpdateBreakTypeResponse](docs/UpdateBreakTypeResponse.md) - - [SquareConnect::UpdateCustomerRequest](docs/UpdateCustomerRequest.md) - - [SquareConnect::UpdateCustomerResponse](docs/UpdateCustomerResponse.md) - - [SquareConnect::UpdateItemModifierListsRequest](docs/UpdateItemModifierListsRequest.md) - - [SquareConnect::UpdateItemModifierListsResponse](docs/UpdateItemModifierListsResponse.md) - - [SquareConnect::UpdateItemTaxesRequest](docs/UpdateItemTaxesRequest.md) - - [SquareConnect::UpdateItemTaxesResponse](docs/UpdateItemTaxesResponse.md) - - [SquareConnect::UpdateShiftRequest](docs/UpdateShiftRequest.md) - - [SquareConnect::UpdateShiftResponse](docs/UpdateShiftResponse.md) - - [SquareConnect::UpdateWorkweekConfigRequest](docs/UpdateWorkweekConfigRequest.md) - - [SquareConnect::UpdateWorkweekConfigResponse](docs/UpdateWorkweekConfigResponse.md) - - [SquareConnect::UpsertCatalogObjectRequest](docs/UpsertCatalogObjectRequest.md) - - [SquareConnect::UpsertCatalogObjectResponse](docs/UpsertCatalogObjectResponse.md) - - [SquareConnect::V1AdjustInventoryRequest](docs/V1AdjustInventoryRequest.md) - - [SquareConnect::V1AdjustInventoryRequestAdjustmentType](docs/V1AdjustInventoryRequestAdjustmentType.md) - - [SquareConnect::V1ApplyFeeRequest](docs/V1ApplyFeeRequest.md) - - [SquareConnect::V1ApplyModifierListRequest](docs/V1ApplyModifierListRequest.md) - - [SquareConnect::V1BankAccount](docs/V1BankAccount.md) - - [SquareConnect::V1BankAccountType](docs/V1BankAccountType.md) - - [SquareConnect::V1CashDrawerEvent](docs/V1CashDrawerEvent.md) - - [SquareConnect::V1CashDrawerEventEventType](docs/V1CashDrawerEventEventType.md) - - [SquareConnect::V1CashDrawerShift](docs/V1CashDrawerShift.md) - - [SquareConnect::V1CashDrawerShiftEventType](docs/V1CashDrawerShiftEventType.md) - - [SquareConnect::V1Category](docs/V1Category.md) - - [SquareConnect::V1CreateCategoryRequest](docs/V1CreateCategoryRequest.md) - - [SquareConnect::V1CreateDiscountRequest](docs/V1CreateDiscountRequest.md) - - [SquareConnect::V1CreateEmployeeRoleRequest](docs/V1CreateEmployeeRoleRequest.md) - - [SquareConnect::V1CreateFeeRequest](docs/V1CreateFeeRequest.md) - - [SquareConnect::V1CreateItemRequest](docs/V1CreateItemRequest.md) - - [SquareConnect::V1CreateModifierListRequest](docs/V1CreateModifierListRequest.md) - - [SquareConnect::V1CreateModifierOptionRequest](docs/V1CreateModifierOptionRequest.md) - - [SquareConnect::V1CreatePageRequest](docs/V1CreatePageRequest.md) - - [SquareConnect::V1CreateRefundRequest](docs/V1CreateRefundRequest.md) - - [SquareConnect::V1CreateRefundRequestType](docs/V1CreateRefundRequestType.md) - - [SquareConnect::V1CreateVariationRequest](docs/V1CreateVariationRequest.md) - - [SquareConnect::V1DeleteCategoryRequest](docs/V1DeleteCategoryRequest.md) - - [SquareConnect::V1DeleteDiscountRequest](docs/V1DeleteDiscountRequest.md) - - [SquareConnect::V1DeleteFeeRequest](docs/V1DeleteFeeRequest.md) - - [SquareConnect::V1DeleteItemRequest](docs/V1DeleteItemRequest.md) - - [SquareConnect::V1DeleteModifierListRequest](docs/V1DeleteModifierListRequest.md) - - [SquareConnect::V1DeleteModifierOptionRequest](docs/V1DeleteModifierOptionRequest.md) - - [SquareConnect::V1DeletePageCellRequest](docs/V1DeletePageCellRequest.md) - - [SquareConnect::V1DeletePageRequest](docs/V1DeletePageRequest.md) - - [SquareConnect::V1DeleteTimecardRequest](docs/V1DeleteTimecardRequest.md) - - [SquareConnect::V1DeleteTimecardResponse](docs/V1DeleteTimecardResponse.md) - - [SquareConnect::V1DeleteVariationRequest](docs/V1DeleteVariationRequest.md) - - [SquareConnect::V1Discount](docs/V1Discount.md) - - [SquareConnect::V1DiscountColor](docs/V1DiscountColor.md) - - [SquareConnect::V1DiscountDiscountType](docs/V1DiscountDiscountType.md) - - [SquareConnect::V1Employee](docs/V1Employee.md) - - [SquareConnect::V1EmployeeRole](docs/V1EmployeeRole.md) - - [SquareConnect::V1EmployeeRolePermissions](docs/V1EmployeeRolePermissions.md) - - [SquareConnect::V1EmployeeStatus](docs/V1EmployeeStatus.md) - - [SquareConnect::V1Fee](docs/V1Fee.md) - - [SquareConnect::V1FeeAdjustmentType](docs/V1FeeAdjustmentType.md) - - [SquareConnect::V1FeeCalculationPhase](docs/V1FeeCalculationPhase.md) - - [SquareConnect::V1FeeInclusionType](docs/V1FeeInclusionType.md) - - [SquareConnect::V1FeeType](docs/V1FeeType.md) - - [SquareConnect::V1InventoryEntry](docs/V1InventoryEntry.md) - - [SquareConnect::V1Item](docs/V1Item.md) - - [SquareConnect::V1ItemColor](docs/V1ItemColor.md) - - [SquareConnect::V1ItemImage](docs/V1ItemImage.md) - - [SquareConnect::V1ItemType](docs/V1ItemType.md) - - [SquareConnect::V1ItemVisibility](docs/V1ItemVisibility.md) - - [SquareConnect::V1ListBankAccountsRequest](docs/V1ListBankAccountsRequest.md) - - [SquareConnect::V1ListBankAccountsResponse](docs/V1ListBankAccountsResponse.md) - - [SquareConnect::V1ListCashDrawerShiftsRequest](docs/V1ListCashDrawerShiftsRequest.md) - - [SquareConnect::V1ListCashDrawerShiftsResponse](docs/V1ListCashDrawerShiftsResponse.md) - - [SquareConnect::V1ListCategoriesRequest](docs/V1ListCategoriesRequest.md) - - [SquareConnect::V1ListCategoriesResponse](docs/V1ListCategoriesResponse.md) - - [SquareConnect::V1ListDiscountsRequest](docs/V1ListDiscountsRequest.md) - - [SquareConnect::V1ListDiscountsResponse](docs/V1ListDiscountsResponse.md) - - [SquareConnect::V1ListEmployeeRolesRequest](docs/V1ListEmployeeRolesRequest.md) - - [SquareConnect::V1ListEmployeeRolesResponse](docs/V1ListEmployeeRolesResponse.md) - - [SquareConnect::V1ListEmployeesRequest](docs/V1ListEmployeesRequest.md) - - [SquareConnect::V1ListEmployeesRequestStatus](docs/V1ListEmployeesRequestStatus.md) - - [SquareConnect::V1ListEmployeesResponse](docs/V1ListEmployeesResponse.md) - - [SquareConnect::V1ListFeesRequest](docs/V1ListFeesRequest.md) - - [SquareConnect::V1ListFeesResponse](docs/V1ListFeesResponse.md) - - [SquareConnect::V1ListInventoryRequest](docs/V1ListInventoryRequest.md) - - [SquareConnect::V1ListInventoryResponse](docs/V1ListInventoryResponse.md) - - [SquareConnect::V1ListItemsRequest](docs/V1ListItemsRequest.md) - - [SquareConnect::V1ListItemsResponse](docs/V1ListItemsResponse.md) - - [SquareConnect::V1ListLocationsRequest](docs/V1ListLocationsRequest.md) - - [SquareConnect::V1ListLocationsResponse](docs/V1ListLocationsResponse.md) - - [SquareConnect::V1ListModifierListsRequest](docs/V1ListModifierListsRequest.md) - - [SquareConnect::V1ListModifierListsResponse](docs/V1ListModifierListsResponse.md) - - [SquareConnect::V1ListOrdersRequest](docs/V1ListOrdersRequest.md) - - [SquareConnect::V1ListOrdersResponse](docs/V1ListOrdersResponse.md) - - [SquareConnect::V1ListPagesRequest](docs/V1ListPagesRequest.md) - - [SquareConnect::V1ListPagesResponse](docs/V1ListPagesResponse.md) - - [SquareConnect::V1ListPaymentsRequest](docs/V1ListPaymentsRequest.md) - - [SquareConnect::V1ListPaymentsResponse](docs/V1ListPaymentsResponse.md) - - [SquareConnect::V1ListRefundsRequest](docs/V1ListRefundsRequest.md) - - [SquareConnect::V1ListRefundsResponse](docs/V1ListRefundsResponse.md) - - [SquareConnect::V1ListSettlementsRequest](docs/V1ListSettlementsRequest.md) - - [SquareConnect::V1ListSettlementsRequestStatus](docs/V1ListSettlementsRequestStatus.md) - - [SquareConnect::V1ListSettlementsResponse](docs/V1ListSettlementsResponse.md) - - [SquareConnect::V1ListTimecardEventsRequest](docs/V1ListTimecardEventsRequest.md) - - [SquareConnect::V1ListTimecardEventsResponse](docs/V1ListTimecardEventsResponse.md) - - [SquareConnect::V1ListTimecardsRequest](docs/V1ListTimecardsRequest.md) - - [SquareConnect::V1ListTimecardsResponse](docs/V1ListTimecardsResponse.md) - - [SquareConnect::V1Merchant](docs/V1Merchant.md) - - [SquareConnect::V1MerchantAccountType](docs/V1MerchantAccountType.md) - - [SquareConnect::V1MerchantBusinessType](docs/V1MerchantBusinessType.md) - - [SquareConnect::V1MerchantLocationDetails](docs/V1MerchantLocationDetails.md) - - [SquareConnect::V1ModifierList](docs/V1ModifierList.md) - - [SquareConnect::V1ModifierListSelectionType](docs/V1ModifierListSelectionType.md) - - [SquareConnect::V1ModifierOption](docs/V1ModifierOption.md) - - [SquareConnect::V1Money](docs/V1Money.md) - - [SquareConnect::V1Order](docs/V1Order.md) - - [SquareConnect::V1OrderHistoryEntry](docs/V1OrderHistoryEntry.md) - - [SquareConnect::V1OrderHistoryEntryAction](docs/V1OrderHistoryEntryAction.md) - - [SquareConnect::V1OrderState](docs/V1OrderState.md) - - [SquareConnect::V1Page](docs/V1Page.md) - - [SquareConnect::V1PageCell](docs/V1PageCell.md) - - [SquareConnect::V1PageCellObjectType](docs/V1PageCellObjectType.md) - - [SquareConnect::V1PageCellPlaceholderType](docs/V1PageCellPlaceholderType.md) - - [SquareConnect::V1Payment](docs/V1Payment.md) - - [SquareConnect::V1PaymentDiscount](docs/V1PaymentDiscount.md) - - [SquareConnect::V1PaymentItemDetail](docs/V1PaymentItemDetail.md) - - [SquareConnect::V1PaymentItemization](docs/V1PaymentItemization.md) - - [SquareConnect::V1PaymentItemizationItemizationType](docs/V1PaymentItemizationItemizationType.md) - - [SquareConnect::V1PaymentModifier](docs/V1PaymentModifier.md) - - [SquareConnect::V1PaymentSurcharge](docs/V1PaymentSurcharge.md) - - [SquareConnect::V1PaymentSurchargeType](docs/V1PaymentSurchargeType.md) - - [SquareConnect::V1PaymentTax](docs/V1PaymentTax.md) - - [SquareConnect::V1PaymentTaxInclusionType](docs/V1PaymentTaxInclusionType.md) - - [SquareConnect::V1PhoneNumber](docs/V1PhoneNumber.md) - - [SquareConnect::V1Refund](docs/V1Refund.md) - - [SquareConnect::V1RefundType](docs/V1RefundType.md) - - [SquareConnect::V1RemoveFeeRequest](docs/V1RemoveFeeRequest.md) - - [SquareConnect::V1RemoveModifierListRequest](docs/V1RemoveModifierListRequest.md) - - [SquareConnect::V1RetrieveBankAccountRequest](docs/V1RetrieveBankAccountRequest.md) - - [SquareConnect::V1RetrieveBusinessRequest](docs/V1RetrieveBusinessRequest.md) - - [SquareConnect::V1RetrieveCashDrawerShiftRequest](docs/V1RetrieveCashDrawerShiftRequest.md) - - [SquareConnect::V1RetrieveEmployeeRequest](docs/V1RetrieveEmployeeRequest.md) - - [SquareConnect::V1RetrieveEmployeeRoleRequest](docs/V1RetrieveEmployeeRoleRequest.md) - - [SquareConnect::V1RetrieveItemRequest](docs/V1RetrieveItemRequest.md) - - [SquareConnect::V1RetrieveModifierListRequest](docs/V1RetrieveModifierListRequest.md) - - [SquareConnect::V1RetrieveOrderRequest](docs/V1RetrieveOrderRequest.md) - - [SquareConnect::V1RetrievePaymentRequest](docs/V1RetrievePaymentRequest.md) - - [SquareConnect::V1RetrieveSettlementRequest](docs/V1RetrieveSettlementRequest.md) - - [SquareConnect::V1RetrieveTimecardRequest](docs/V1RetrieveTimecardRequest.md) - - [SquareConnect::V1Settlement](docs/V1Settlement.md) - - [SquareConnect::V1SettlementEntry](docs/V1SettlementEntry.md) - - [SquareConnect::V1SettlementEntryType](docs/V1SettlementEntryType.md) - - [SquareConnect::V1SettlementStatus](docs/V1SettlementStatus.md) - - [SquareConnect::V1Tender](docs/V1Tender.md) - - [SquareConnect::V1TenderCardBrand](docs/V1TenderCardBrand.md) - - [SquareConnect::V1TenderEntryMethod](docs/V1TenderEntryMethod.md) - - [SquareConnect::V1TenderType](docs/V1TenderType.md) - - [SquareConnect::V1Timecard](docs/V1Timecard.md) - - [SquareConnect::V1TimecardEvent](docs/V1TimecardEvent.md) - - [SquareConnect::V1TimecardEventEventType](docs/V1TimecardEventEventType.md) - - [SquareConnect::V1UpdateCategoryRequest](docs/V1UpdateCategoryRequest.md) - - [SquareConnect::V1UpdateDiscountRequest](docs/V1UpdateDiscountRequest.md) - - [SquareConnect::V1UpdateEmployeeRequest](docs/V1UpdateEmployeeRequest.md) - - [SquareConnect::V1UpdateEmployeeRoleRequest](docs/V1UpdateEmployeeRoleRequest.md) - - [SquareConnect::V1UpdateFeeRequest](docs/V1UpdateFeeRequest.md) - - [SquareConnect::V1UpdateItemRequest](docs/V1UpdateItemRequest.md) - - [SquareConnect::V1UpdateModifierListRequest](docs/V1UpdateModifierListRequest.md) - - [SquareConnect::V1UpdateModifierListRequestSelectionType](docs/V1UpdateModifierListRequestSelectionType.md) - - [SquareConnect::V1UpdateModifierOptionRequest](docs/V1UpdateModifierOptionRequest.md) - - [SquareConnect::V1UpdateOrderRequest](docs/V1UpdateOrderRequest.md) - - [SquareConnect::V1UpdateOrderRequestAction](docs/V1UpdateOrderRequestAction.md) - - [SquareConnect::V1UpdatePageCellRequest](docs/V1UpdatePageCellRequest.md) - - [SquareConnect::V1UpdatePageRequest](docs/V1UpdatePageRequest.md) - - [SquareConnect::V1UpdateTimecardRequest](docs/V1UpdateTimecardRequest.md) - - [SquareConnect::V1UpdateVariationRequest](docs/V1UpdateVariationRequest.md) - - [SquareConnect::V1Variation](docs/V1Variation.md) - - [SquareConnect::V1VariationInventoryAlertType](docs/V1VariationInventoryAlertType.md) - - [SquareConnect::V1VariationPricingType](docs/V1VariationPricingType.md) - - [SquareConnect::VoidTransactionRequest](docs/VoidTransactionRequest.md) - - [SquareConnect::VoidTransactionResponse](docs/VoidTransactionResponse.md) - - [SquareConnect::WebhookEvents](docs/WebhookEvents.md) - - [SquareConnect::Weekday](docs/Weekday.md) - - [SquareConnect::WorkweekConfig](docs/WorkweekConfig.md) +```ruby +new_customer = { + given_name: 'Ava', + address: { + address_line_1: '555 Electric Ave', + locality: 'Los Angeles', + country: 'US' + } +} +``` +With the deprecated `square_connect` gem, this is how you instantiate a client +for the Customers API, format the request, and call the endpoint: -## Documentation for Authorization +```ruby +require 'square_connect' +# Instantiate the client +SquareConnect.configure do |config| + config.access_token = 'YOUR ACCESS TOKEN' +end -### oauth2 +api_instance = SquareConnect::CustomersApi.new -- **Type**: OAuth -- **Flow**: accessCode -- **Authorization URL**: `https://connect.squareup.com/oauth2/authorize` -- **Scopes**: - - BANK_ACCOUNTS_READ: __HTTP Method__: &#x60;GET&#x60; 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__: &#x60;GET&#x60; Grants read access to customer information. For example, to call the ListCustomers endpoint. - - CUSTOMERS_WRITE: __HTTP Method__: &#x60;POST&#x60;, &#x60;PUT&#x60;, &#x60;DELETE&#x60; Grants write access to customer information. For example, to create and update customer profiles. - - EMPLOYEES_READ: __HTTP Method__: &#x60;GET&#x60; Grants read access to employee profile information. For example, to call the Connect v1 Employees API. - - EMPLOYEES_WRITE: __HTTP Method__: &#x60;POST&#x60;, &#x60;PUT&#x60;, &#x60;DELETE&#x60; Grants write access to employee profile information. For example, to create and modify employee profiles. - - INVENTORY_READ: __HTTP Method__: &#x60;GET&#x60; Grants read access to inventory information. For example, to call the RetrieveInventoryCount endpoint. - - INVENTORY_WRITE: __HTTP Method__: &#x60;POST&#x60;, &#x60;PUT&#x60;, &#x60;DELETE&#x60; Grants write access to inventory information. For example, to call the BatchChangeInventory endpoint. - - ITEMS_READ: __HTTP Method__: &#x60;GET&#x60; Grants read access to product catalog information. For example, to get an item or a list of items. - - ITEMS_WRITE: __HTTP Method__: &#x60;POST&#x60;, &#x60;PUT&#x60;, &#x60;DELETE&#x60; Grants write access to product catalog information. For example, to modify or add to a product catalog. - - MERCHANT_PROFILE_READ: __HTTP Method__: &#x60;GET&#x60; Grants read access to business and location information. For example, to obtain a location ID for subsequent activity. - - ORDERS_READ: __HTTP Method__: &#x60;GET&#x60; Grants read access to order information. For example, to call the BatchRetrieveOrders endpoint. - - ORDERS_WRITE: __HTTP Method__: &#x60;POST&#x60;, &#x60;PUT&#x60;, &#x60;DELETE&#x60; Grants write access to order information. For example, to call the CreateCheckout endpoint. - - PAYMENTS_READ: __HTTP Method__: &#x60;GET&#x60; Grants read access to transaction and refund information. For example, to call the RetrieveTransaction endpoint. - - PAYMENTS_WRITE: __HTTP Method__: &#x60;POST&#x60;, &#x60;PUT&#x60;, &#x60;DELETE&#x60; 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__: &#x60;POST&#x60;, &#x60;PUT&#x60;, &#x60;DELETE&#x60; 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__: &#x60;POST&#x60;, &#x60;PUT&#x60;, &#x60;DELETE&#x60; Grants write access to transaction and refunds information. For example, to process in-person payments. - - SETTLEMENTS_READ: __HTTP Method__: &#x60;GET&#x60; Grants read access to settlement (deposit) information. For example, to call the Connect v1 ListSettlements endpoint. - - TIMECARDS_READ: __HTTP Method__: &#x60;GET&#x60; Grants read access to employee timecard information. For example, to call the Connect v1 ListTimecards endpoint. - - TIMECARDS_WRITE: __HTTP Method__: &#x60;POST&#x60;, &#x60;PUT&#x60;, &#x60;DELETE&#x60; Grants write access to employee timecard information. For example, to create and modify timecards. - - TIMECARDS_SETTINGS_READ: __HTTP Method__: &#x60;GET&#x60; Grants read access to employee timecard settings information. For example, to call the GetBreakType endpoint. - - TIMECARDS_SETTINGS_WRITE: __HTTP Method__: &#x60;POST&#x60;, &#x60;PUT&#x60;, &#x60;DELETE&#x60; Grants write access to employee timecard settings information. For example, to call the UpdateBreakType endpoint. +# Create the models +address = SquareConnect::Address.new(new_customer[:address]) -### oauth2ClientSecret +body = SquareConnect::CreateCustomerRequest.new( + given_name: new_customer[:given_name], + address: address +) -- **Type**: API key -- **API key parameter name**: Authorization -- **Location**: HTTP header +begin + # Call the endpoint + response = api_instance.create_customer(body) + # Handle the response and warn on errors + p response.customer.to_hash +rescue SquareConnect::ApiError + warn response.errors +end +``` -## Pagination of V1 Endpoints +Now consider equivalent code using the new `square.rb` gem: -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: +```ruby +require 'square' -1. Use the full information endpoint methods of each API to get the response HTTP -Headers. They are named as their simple counterpart with a `with_http_info` suffix. -Hence `listEmployeeRoles` would be called `list_employee_roles_with_http_info`. This -method returns an array with 3 parameters: `response`, `http_status`, and -`http_headers`. -2. Use `batch_token = api_client.get_v1_batch_token_from_headers(http_headers)` -to extract the token and proceed to get the following page if a token is present. +# Instantiate the client +square = Square::Client.new(access_token: 'YOUR ACCESS TOKEN') -### Example +# Call the endpoint +response = square.customers.create_customer(body: new_customer) -```ruby -# load the gem -require 'square_connect' -# setup authorization -SquareConnect.configure do |config| - # Configure OAuth2 access token for authorization: oauth2 - config.access_token = 'YOUR ACCESS TOKEN' +# Handle the response and warn on errors +if response.success? + p response.data +else + warn response.errors end +``` -api_instance = SquareConnect::V1EmployeesApi.new -api_client = api_instance.api_client +That's it! -opts = { - order: "order_example", # String | The order in which employees are listed in the response, based on their created_at field.Default value: ASC - limit: 56 # Integer | The maximum integer number of employee entities to return in a single response. Default 100, maximum 200. -} +What was once a multi-block process can be handled in 2 lines of code and an +`if/else` block. Migrating to the `square.rb` gem reduces boilerplate and lets +you focus on the parts of your code that really matter. -roles = [] -begin - result, status, headers = api_instance.list_employee_roles_with_http_info(opts) - roles = roles + result - opts[:batch_token] = api_client.get_v1_batch_token_from_headers(headers) -rescue SquareConnect::ApiError => e - puts "Exception when calling V1EmployeesApi#list_employee_roles_with_http_info: #{e}" -end while opts[:batch_token] +<br/> -p roles -``` +--- -Contributing ------------- +<br/> -Send bug reports, feature requests, and code contributions to the [API -specifications repository](https://github.com/square/connect-api-specification), -as this repository contains only the generated SDK code. +## Ask the community -License -------- +Please join us in our [Square developer community] if you have any questions! -``` -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. -``` +[//]: # "Link anchor definitions" +[Square Logo]: https://docs.connect.squareup.com/images/github/github-square-logo.svg +[Square Ruby SDK gem]: https://github.com/square/square-ruby-sdk +[Square developer community]: https://squ.re/slack