Class: SquareConnect::V1TransactionsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/square_connect/api/v1_transactions_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ V1TransactionsApi

Returns a new instance of V1TransactionsApi.



16
17
18
# File 'lib/square_connect/api/v1_transactions_api.rb', line 16

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/square_connect/api/v1_transactions_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#create_refund(location_id, body, opts = {}) ⇒ V1Refund

Issues a refund for a previously processed payment. You must issue a refund within 60 days of the associated payment. Issues a refund for a previously processed payment. You must issue a refund within 60 days of the associated payment.

Parameters:

  • location_id

    The ID of the original payment's associated location.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



26
27
28
29
# File 'lib/square_connect/api/v1_transactions_api.rb', line 26

def create_refund(location_id, body, opts = {})
  data, _status_code, _headers = create_refund_with_http_info(location_id, body, opts)
  return data
end

#create_refund_with_http_info(location_id, body, opts = {}) ⇒ Array<(V1Refund, Fixnum, Hash)>

Issues a refund for a previously processed payment. You must issue a refund within 60 days of the associated payment. Issues a refund for a previously processed payment. You must issue a refund within 60 days of the associated payment.

Parameters:

  • location_id

    The ID of the original payment&#39;s associated location.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Refund, Fixnum, Hash)>)

    V1Refund data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/square_connect/api/v1_transactions_api.rb', line 37

def create_refund_with_http_info(location_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1TransactionsApi.create_refund ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1TransactionsApi.create_refund" if location_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1TransactionsApi.create_refund" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/refunds".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Refund')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1TransactionsApi#create_refund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_bank_accounts(location_id, opts = {}) ⇒ Array<V1BankAccount>

Provides non-confidential details for all of a location’s associated bank accounts. This endpoint does not provide full bank account numbers, and there is no way to obtain a full bank account number with the Connect API. Provides non-confidential details for all of a location’s associated bank accounts. This endpoint does not provide full bank account numbers, and there is no way to obtain a full bank account number with the Connect API.

Parameters:

  • location_id

    The ID of the location to list bank accounts for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



82
83
84
85
# File 'lib/square_connect/api/v1_transactions_api.rb', line 82

def list_bank_accounts(location_id, opts = {})
  data, _status_code, _headers = list_bank_accounts_with_http_info(location_id, opts)
  return data
end

#list_bank_accounts_with_http_info(location_id, opts = {}) ⇒ Array<(Array<V1BankAccount>, Fixnum, Hash)>

Provides non-confidential details for all of a location&#39;s associated bank accounts. This endpoint does not provide full bank account numbers, and there is no way to obtain a full bank account number with the Connect API. Provides non-confidential details for all of a location&#39;s associated bank accounts. This endpoint does not provide full bank account numbers, and there is no way to obtain a full bank account number with the Connect API.

Parameters:

  • location_id

    The ID of the location to list bank accounts for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<V1BankAccount>, Fixnum, Hash)>)

    Array<V1BankAccount> data, response status code and response headers



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/square_connect/api/v1_transactions_api.rb', line 92

def list_bank_accounts_with_http_info(location_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1TransactionsApi.list_bank_accounts ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1TransactionsApi.list_bank_accounts" if location_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/bank-accounts".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<V1BankAccount>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1TransactionsApi#list_bank_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_orders(location_id, opts = {}) ⇒ Array<V1Order>

Provides summary information for a merchant’s online store orders. Provides summary information for a merchant’s online store orders.

Parameters:

  • location_id

    The ID of the location to list online store orders for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :order (String)

    TThe order in which payments are listed in the response.

  • :limit (Integer)

    The maximum number of payments to return in a single response. This value cannot exceed 200.

  • :batch_token (String)

    A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Returns:



138
139
140
141
# File 'lib/square_connect/api/v1_transactions_api.rb', line 138

def list_orders(location_id, opts = {})
  data, _status_code, _headers = list_orders_with_http_info(location_id, opts)
  return data
end

#list_orders_with_http_info(location_id, opts = {}) ⇒ Array<(Array<V1Order>, Fixnum, Hash)>

Provides summary information for a merchant&#39;s online store orders. Provides summary information for a merchant&#39;s online store orders.

Parameters:

  • location_id

    The ID of the location to list online store orders for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :order (String)

    TThe order in which payments are listed in the response.

  • :limit (Integer)

    The maximum number of payments to return in a single response. This value cannot exceed 200.

  • :batch_token (String)

    A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Returns:

  • (Array<(Array<V1Order>, Fixnum, Hash)>)

    Array<V1Order> data, response status code and response headers



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/square_connect/api/v1_transactions_api.rb', line 151

def list_orders_with_http_info(location_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1TransactionsApi.list_orders ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1TransactionsApi.list_orders" if location_id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  if !opts[:'limit'].nil? && opts[:'limit'] > 200
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling V1TransactionsApi.list_orders, must be smaller than or equal to 200.'
  end

  # resource path
  local_var_path = "/v1/{location_id}/orders".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'batch_token'] = opts[:'batch_token'] if !opts[:'batch_token'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<V1Order>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1TransactionsApi#list_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_payments(location_id, opts = {}) ⇒ Array<V1Payment>

Provides summary information for all payments taken by a merchant or any of the merchant’s mobile staff during a date range. Date ranges cannot exceed one year in length. See Date ranges for details of inclusive and exclusive dates. Provides summary information for all payments taken by a merchant or any of the merchant’s mobile staff during a date range. Date ranges cannot exceed one year in length. See Date ranges for details of inclusive and exclusive dates.

Parameters:

  • location_id

    The ID of the location to list payments for. If you specify me, this endpoint returns payments aggregated from all of the business&#39;s locations.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :order (String)

    The order in which payments are listed in the response.

  • :begin_time (String)

    The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.

  • :end_time (String)

    The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.

  • :limit (Integer)

    The maximum number of payments to return in a single response. This value cannot exceed 200.

  • :batch_token (String)

    A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Returns:



209
210
211
212
# File 'lib/square_connect/api/v1_transactions_api.rb', line 209

def list_payments(location_id, opts = {})
  data, _status_code, _headers = list_payments_with_http_info(location_id, opts)
  return data
end

#list_payments_with_http_info(location_id, opts = {}) ⇒ Array<(Array<V1Payment>, Fixnum, Hash)>

Provides summary information for all payments taken by a merchant or any of the merchant&#39;s mobile staff during a date range. Date ranges cannot exceed one year in length. See Date ranges for details of inclusive and exclusive dates. Provides summary information for all payments taken by a merchant or any of the merchant&#39;s mobile staff during a date range. Date ranges cannot exceed one year in length. See Date ranges for details of inclusive and exclusive dates.

Parameters:

  • location_id

    The ID of the location to list payments for. If you specify me, this endpoint returns payments aggregated from all of the business&#39;s locations.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :order (String)

    The order in which payments are listed in the response.

  • :begin_time (String)

    The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.

  • :end_time (String)

    The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.

  • :limit (Integer)

    The maximum number of payments to return in a single response. This value cannot exceed 200.

  • :batch_token (String)

    A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Returns:

  • (Array<(Array<V1Payment>, Fixnum, Hash)>)

    Array<V1Payment> data, response status code and response headers



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/square_connect/api/v1_transactions_api.rb', line 224

def list_payments_with_http_info(location_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1TransactionsApi.list_payments ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1TransactionsApi.list_payments" if location_id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  if !opts[:'limit'].nil? && opts[:'limit'] > 200
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling V1TransactionsApi.list_payments, must be smaller than or equal to 200.'
  end

  # resource path
  local_var_path = "/v1/{location_id}/payments".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'begin_time'] = opts[:'begin_time'] if !opts[:'begin_time'].nil?
  query_params[:'end_time'] = opts[:'end_time'] if !opts[:'end_time'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'batch_token'] = opts[:'batch_token'] if !opts[:'batch_token'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<V1Payment>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1TransactionsApi#list_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_refunds(location_id, opts = {}) ⇒ Array<V1Refund>

Provides the details for all refunds initiated by a merchant or any of the merchant’s mobile staff during a date range. Date ranges cannot exceed one year in length. Provides the details for all refunds initiated by a merchant or any of the merchant’s mobile staff during a date range. Date ranges cannot exceed one year in length.

Parameters:

  • location_id

    The ID of the location to list refunds for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :order (String)

    TThe order in which payments are listed in the response.

  • :begin_time (String)

    The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.

  • :end_time (String)

    The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.

  • :limit (Integer)

    The maximum number of payments to return in a single response. This value cannot exceed 200.

  • :batch_token (String)

    A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Returns:



284
285
286
287
# File 'lib/square_connect/api/v1_transactions_api.rb', line 284

def list_refunds(location_id, opts = {})
  data, _status_code, _headers = list_refunds_with_http_info(location_id, opts)
  return data
end

#list_refunds_with_http_info(location_id, opts = {}) ⇒ Array<(Array<V1Refund>, Fixnum, Hash)>

Provides the details for all refunds initiated by a merchant or any of the merchant&#39;s mobile staff during a date range. Date ranges cannot exceed one year in length. Provides the details for all refunds initiated by a merchant or any of the merchant&#39;s mobile staff during a date range. Date ranges cannot exceed one year in length.

Parameters:

  • location_id

    The ID of the location to list refunds for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :order (String)

    TThe order in which payments are listed in the response.

  • :begin_time (String)

    The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.

  • :end_time (String)

    The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.

  • :limit (Integer)

    The maximum number of payments to return in a single response. This value cannot exceed 200.

  • :batch_token (String)

    A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Returns:

  • (Array<(Array<V1Refund>, Fixnum, Hash)>)

    Array<V1Refund> data, response status code and response headers



299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/square_connect/api/v1_transactions_api.rb', line 299

def list_refunds_with_http_info(location_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1TransactionsApi.list_refunds ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1TransactionsApi.list_refunds" if location_id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  if !opts[:'limit'].nil? && opts[:'limit'] > 200
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling V1TransactionsApi.list_refunds, must be smaller than or equal to 200.'
  end

  # resource path
  local_var_path = "/v1/{location_id}/refunds".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'begin_time'] = opts[:'begin_time'] if !opts[:'begin_time'].nil?
  query_params[:'end_time'] = opts[:'end_time'] if !opts[:'end_time'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'batch_token'] = opts[:'batch_token'] if !opts[:'batch_token'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<V1Refund>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1TransactionsApi#list_refunds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_settlements(location_id, opts = {}) ⇒ Array<V1Settlement>

Provides summary information for all deposits and withdrawals initiated by Square to a merchant’s bank account during a date range. Date ranges cannot exceed one year in length. Provides summary information for all deposits and withdrawals initiated by Square to a merchant’s bank account during a date range. Date ranges cannot exceed one year in length.

Parameters:

  • location_id

    The ID of the location to list settlements for. If you specify me, this endpoint returns payments aggregated from all of the business&#39;s locations.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :order (String)

    TThe order in which payments are listed in the response.

  • :begin_time (String)

    The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.

  • :end_time (String)

    The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.

  • :limit (Integer)

    The maximum number of payments to return in a single response. This value cannot exceed 200.

  • :status (String)

    Provide this parameter to retrieve only settlements with a particular status (SENT or FAILED).

  • :batch_token (String)

    A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Returns:



360
361
362
363
# File 'lib/square_connect/api/v1_transactions_api.rb', line 360

def list_settlements(location_id, opts = {})
  data, _status_code, _headers = list_settlements_with_http_info(location_id, opts)
  return data
end

#list_settlements_with_http_info(location_id, opts = {}) ⇒ Array<(Array<V1Settlement>, Fixnum, Hash)>

Provides summary information for all deposits and withdrawals initiated by Square to a merchant&#39;s bank account during a date range. Date ranges cannot exceed one year in length. Provides summary information for all deposits and withdrawals initiated by Square to a merchant&#39;s bank account during a date range. Date ranges cannot exceed one year in length.

Parameters:

  • location_id

    The ID of the location to list settlements for. If you specify me, this endpoint returns payments aggregated from all of the business&#39;s locations.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :order (String)

    TThe order in which payments are listed in the response.

  • :begin_time (String)

    The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.

  • :end_time (String)

    The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.

  • :limit (Integer)

    The maximum number of payments to return in a single response. This value cannot exceed 200.

  • :status (String)

    Provide this parameter to retrieve only settlements with a particular status (SENT or FAILED).

  • :batch_token (String)

    A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Returns:

  • (Array<(Array<V1Settlement>, Fixnum, Hash)>)

    Array<V1Settlement> data, response status code and response headers



376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
# File 'lib/square_connect/api/v1_transactions_api.rb', line 376

def list_settlements_with_http_info(location_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1TransactionsApi.list_settlements ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1TransactionsApi.list_settlements" if location_id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  if !opts[:'limit'].nil? && opts[:'limit'] > 200
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling V1TransactionsApi.list_settlements, must be smaller than or equal to 200.'
  end

  if opts[:'status'] && !['SENT', 'FAILED'].include?(opts[:'status'])
    fail ArgumentError, 'invalid value for "status", must be one of SENT, FAILED'
  end
  # resource path
  local_var_path = "/v1/{location_id}/settlements".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'begin_time'] = opts[:'begin_time'] if !opts[:'begin_time'].nil?
  query_params[:'end_time'] = opts[:'end_time'] if !opts[:'end_time'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'batch_token'] = opts[:'batch_token'] if !opts[:'batch_token'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<V1Settlement>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1TransactionsApi#list_settlements\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#retrieve_bank_account(location_id, bank_account_id, opts = {}) ⇒ V1BankAccount

Provides non-confidential details for a merchant’s associated bank account. This endpoint does not provide full bank account numbers, and there is no way to obtain a full bank account number with the Connect API. Provides non-confidential details for a merchant’s associated bank account. This endpoint does not provide full bank account numbers, and there is no way to obtain a full bank account number with the Connect API.

Parameters:

  • location_id

    The ID of the bank account&#39;s associated location.

  • bank_account_id

    The bank account&#39;s Square-issued ID. You obtain this value from Settlement objects returned.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



436
437
438
439
# File 'lib/square_connect/api/v1_transactions_api.rb', line 436

def (location_id, , opts = {})
  data, _status_code, _headers = (location_id, , opts)
  return data
end

#retrieve_bank_account_with_http_info(location_id, bank_account_id, opts = {}) ⇒ Array<(V1BankAccount, Fixnum, Hash)>

Provides non-confidential details for a merchant&#39;s associated bank account. This endpoint does not provide full bank account numbers, and there is no way to obtain a full bank account number with the Connect API. Provides non-confidential details for a merchant&#39;s associated bank account. This endpoint does not provide full bank account numbers, and there is no way to obtain a full bank account number with the Connect API.

Parameters:

  • location_id

    The ID of the bank account&#39;s associated location.

  • bank_account_id

    The bank account&#39;s Square-issued ID. You obtain this value from Settlement objects returned.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1BankAccount, Fixnum, Hash)>)

    V1BankAccount data, response status code and response headers



447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
# File 'lib/square_connect/api/v1_transactions_api.rb', line 447

def (location_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1TransactionsApi.retrieve_bank_account ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1TransactionsApi.retrieve_bank_account" if location_id.nil?
  # verify the required parameter 'bank_account_id' is set
  fail ArgumentError, "Missing the required parameter 'bank_account_id' when calling V1TransactionsApi.retrieve_bank_account" if .nil?
  # resource path
  local_var_path = "/v1/{location_id}/bank-accounts/{bank_account_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'bank_account_id' + '}', .to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1BankAccount')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1TransactionsApi#retrieve_bank_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#retrieve_order(location_id, order_id, opts = {}) ⇒ V1Order

Provides comprehensive information for a single online store order, including the order’s history. Provides comprehensive information for a single online store order, including the order’s history.

Parameters:

  • location_id

    The ID of the order&#39;s associated location.

  • order_id

    The order&#39;s Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



493
494
495
496
# File 'lib/square_connect/api/v1_transactions_api.rb', line 493

def retrieve_order(location_id, order_id, opts = {})
  data, _status_code, _headers = retrieve_order_with_http_info(location_id, order_id, opts)
  return data
end

#retrieve_order_with_http_info(location_id, order_id, opts = {}) ⇒ Array<(V1Order, Fixnum, Hash)>

Provides comprehensive information for a single online store order, including the order&#39;s history. Provides comprehensive information for a single online store order, including the order&#39;s history.

Parameters:

  • location_id

    The ID of the order&#39;s associated location.

  • order_id

    The order&#39;s Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Order, Fixnum, Hash)>)

    V1Order data, response status code and response headers



504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
# File 'lib/square_connect/api/v1_transactions_api.rb', line 504

def retrieve_order_with_http_info(location_id, order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1TransactionsApi.retrieve_order ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1TransactionsApi.retrieve_order" if location_id.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling V1TransactionsApi.retrieve_order" if order_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/orders/{order_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'order_id' + '}', order_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1TransactionsApi#retrieve_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#retrieve_payment(location_id, payment_id, opts = {}) ⇒ V1Payment

Provides comprehensive information for a single payment. Provides comprehensive information for a single payment.

Parameters:

  • location_id

    The ID of the payment&#39;s associated location.

  • payment_id

    The payment&#39;s Square-issued ID. You obtain this value from Payment objects returned by the List Payments endpoint, or Settlement objects returned by the List Settlements endpoint.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



550
551
552
553
# File 'lib/square_connect/api/v1_transactions_api.rb', line 550

def retrieve_payment(location_id, payment_id, opts = {})
  data, _status_code, _headers = retrieve_payment_with_http_info(location_id, payment_id, opts)
  return data
end

#retrieve_payment_with_http_info(location_id, payment_id, opts = {}) ⇒ Array<(V1Payment, Fixnum, Hash)>

Provides comprehensive information for a single payment. Provides comprehensive information for a single payment.

Parameters:

  • location_id

    The ID of the payment&#39;s associated location.

  • payment_id

    The payment&#39;s Square-issued ID. You obtain this value from Payment objects returned by the List Payments endpoint, or Settlement objects returned by the List Settlements endpoint.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Payment, Fixnum, Hash)>)

    V1Payment data, response status code and response headers



561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
# File 'lib/square_connect/api/v1_transactions_api.rb', line 561

def retrieve_payment_with_http_info(location_id, payment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1TransactionsApi.retrieve_payment ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1TransactionsApi.retrieve_payment" if location_id.nil?
  # verify the required parameter 'payment_id' is set
  fail ArgumentError, "Missing the required parameter 'payment_id' when calling V1TransactionsApi.retrieve_payment" if payment_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/payments/{payment_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'payment_id' + '}', payment_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Payment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1TransactionsApi#retrieve_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#retrieve_settlement(location_id, settlement_id, opts = {}) ⇒ V1Settlement

Provides comprehensive information for a single settlement, including the entries that contribute to the settlement’s total. Provides comprehensive information for a single settlement, including the entries that contribute to the settlement’s total.

Parameters:

  • location_id

    The ID of the settlements&#39;s associated location.

  • settlement_id

    The settlement&#39;s Square-issued ID. You obtain this value from Settlement objects returned by the List Settlements endpoint.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



607
608
609
610
# File 'lib/square_connect/api/v1_transactions_api.rb', line 607

def retrieve_settlement(location_id, settlement_id, opts = {})
  data, _status_code, _headers = retrieve_settlement_with_http_info(location_id, settlement_id, opts)
  return data
end

#retrieve_settlement_with_http_info(location_id, settlement_id, opts = {}) ⇒ Array<(V1Settlement, Fixnum, Hash)>

Provides comprehensive information for a single settlement, including the entries that contribute to the settlement&#39;s total. Provides comprehensive information for a single settlement, including the entries that contribute to the settlement&#39;s total.

Parameters:

  • location_id

    The ID of the settlements&#39;s associated location.

  • settlement_id

    The settlement&#39;s Square-issued ID. You obtain this value from Settlement objects returned by the List Settlements endpoint.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Settlement, Fixnum, Hash)>)

    V1Settlement data, response status code and response headers



618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
# File 'lib/square_connect/api/v1_transactions_api.rb', line 618

def retrieve_settlement_with_http_info(location_id, settlement_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1TransactionsApi.retrieve_settlement ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1TransactionsApi.retrieve_settlement" if location_id.nil?
  # verify the required parameter 'settlement_id' is set
  fail ArgumentError, "Missing the required parameter 'settlement_id' when calling V1TransactionsApi.retrieve_settlement" if settlement_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/settlements/{settlement_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'settlement_id' + '}', settlement_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Settlement')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1TransactionsApi#retrieve_settlement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_order(location_id, order_id, body, opts = {}) ⇒ V1Order

Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions: Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions:

Parameters:

  • location_id

    The ID of the order&#39;s associated location.

  • order_id

    The order&#39;s Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



665
666
667
668
# File 'lib/square_connect/api/v1_transactions_api.rb', line 665

def update_order(location_id, order_id, body, opts = {})
  data, _status_code, _headers = update_order_with_http_info(location_id, order_id, body, opts)
  return data
end

#update_order_with_http_info(location_id, order_id, body, opts = {}) ⇒ Array<(V1Order, Fixnum, Hash)>

Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions: Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions:

Parameters:

  • location_id

    The ID of the order&#39;s associated location.

  • order_id

    The order&#39;s Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Order, Fixnum, Hash)>)

    V1Order data, response status code and response headers



677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
# File 'lib/square_connect/api/v1_transactions_api.rb', line 677

def update_order_with_http_info(location_id, order_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1TransactionsApi.update_order ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1TransactionsApi.update_order" if location_id.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling V1TransactionsApi.update_order" if order_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1TransactionsApi.update_order" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/orders/{order_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'order_id' + '}', order_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1TransactionsApi#update_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end