Skip to content

Commit d206a0a

Browse files
authored
Merge pull request square#97 from square/release/19.0.0.20220420
Generated PR for Release: 19.0.0.20220420
2 parents df89dd4 + 5ac1606 commit d206a0a

File tree

112 files changed

+1508
-206
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+1508
-206
lines changed

doc/api/catalog.md

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ body = {}
9999
body[:object_ids] = ['W62UWFY35CWMYGVWK6TWJDNI', 'AA27W3M2GGTF3H6AVPNB77CK']
100100
body[:include_related_objects] = true
101101
body[:catalog_version] = 118
102+
body[:include_deleted_objects] = false
102103

103104
result = catalog_api.batch_retrieve_catalog_objects(body: body)
104105

doc/api/locations.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ end
4646

4747
Creates a [location](https://developer.squareup.com/docs/locations-api).
4848
Creating new locations allows for separate configuration of receipt layouts, item prices,
49-
and sales reports. Developers can use locations to separate sales activity via applications
49+
and sales reports. Developers can use locations to separate sales activity through applications
5050
that integrate with Square from sales activity elsewhere in a seller's account.
51-
Locations created programmatically with the Locations API will last forever and
52-
are visible to the seller for their own management, so ensure that
51+
Locations created programmatically with the Locations API last forever and
52+
are visible to the seller for their own management. Therefore, ensure that
5353
each location has a sensible and unique name.
5454

5555
```ruby

doc/api/orders.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ body[:order][:line_items][1][:modifiers][0][:uid] = 'uid1'
106106
body[:order][:line_items][1][:modifiers][0][:catalog_object_id] = 'CHQX7Y4KY6N5KINJKZCFURPZ'
107107
body[:order][:line_items][1][:modifiers][0][:catalog_version] = 69
108108
body[:order][:line_items][1][:modifiers][0][:name] = 'name1'
109-
body[:order][:line_items][1][:modifiers][0][:base_price_money] = {}
110-
body[:order][:line_items][1][:modifiers][0][:base_price_money][:amount] = 53
111-
body[:order][:line_items][1][:modifiers][0][:base_price_money][:currency] = 'TTD'
109+
body[:order][:line_items][1][:modifiers][0][:quantity] = 'quantity7'
112110

113111
body[:order][:line_items][1][:applied_discounts] = []
114112

@@ -588,7 +586,7 @@ To be used with `PayOrder`, a payment must:
588586
- Reference the order by specifying the `order_id` when [creating the payment](../../doc/api/payments.md#create-payment).
589587
Any approved payments that reference the same `order_id` not specified in the
590588
`payment_ids` is canceled.
591-
- Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take-payments#delayed-capture).
589+
- Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture).
592590
Using a delayed capture payment with `PayOrder` completes the approved payment.
593591

594592
```ruby

doc/api/payouts.md

+146
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# Payouts
2+
3+
```ruby
4+
payouts_api = client.payouts
5+
```
6+
7+
## Class Name
8+
9+
`PayoutsApi`
10+
11+
## Methods
12+
13+
* [List Payouts](../../doc/api/payouts.md#list-payouts)
14+
* [Get Payout](../../doc/api/payouts.md#get-payout)
15+
* [List Payout Entries](../../doc/api/payouts.md#list-payout-entries)
16+
17+
18+
# List Payouts
19+
20+
Retrieves a list of all payouts for the default location.
21+
You can filter payouts by location ID, status, time range, and order them in ascending or descending order.
22+
To call this endpoint, set `PAYOUTS_READ` for the OAuth scope.
23+
24+
```ruby
25+
def list_payouts(location_id: nil,
26+
status: nil,
27+
begin_time: nil,
28+
end_time: nil,
29+
sort_order: nil,
30+
cursor: nil,
31+
limit: nil)
32+
```
33+
34+
## Parameters
35+
36+
| Parameter | Type | Tags | Description |
37+
| --- | --- | --- | --- |
38+
| `location_id` | `String` | Query, Optional | The ID of the location for which to list the payouts.<br>By default, payouts are returned for the default (main) location associated with the seller. |
39+
| `status` | [`String (Payout Status)`](../../doc/models/payout-status.md) | Query, Optional | If provided, only payouts with the given status are returned. |
40+
| `begin_time` | `String` | Query, Optional | The timestamp for the beginning of the payout creation time, in RFC 3339 format.<br>Inclusive. Default: The current time minus one year. |
41+
| `end_time` | `String` | Query, Optional | The timestamp for the end of the payout creation time, in RFC 3339 format.<br>Default: The current time. |
42+
| `sort_order` | [`String (Sort Order)`](../../doc/models/sort-order.md) | Query, Optional | The order in which payouts are listed. |
43+
| `cursor` | `String` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this cursor to retrieve the next set of results for the original query.<br>For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination).<br>If request parameters change between requests, subsequent results may contain duplicates or missing records. |
44+
| `limit` | `Integer` | Query, Optional | The maximum number of results to be returned in a single page.<br>It is possible to receive fewer results than the specified limit on a given page.<br>The default value of 100 is also the maximum allowed value. If the provided value is<br>greater than 100, it is ignored and the default value is used instead.<br>Default: `100` |
45+
46+
## Response Type
47+
48+
[`List Payouts Response Hash`](../../doc/models/list-payouts-response.md)
49+
50+
## Example Usage
51+
52+
```ruby
53+
location_id = 'location_id4'
54+
status = 'PAID'
55+
begin_time = 'begin_time2'
56+
end_time = 'end_time2'
57+
sort_order = 'DESC'
58+
cursor = 'cursor6'
59+
limit = 172
60+
61+
result = payouts_api.list_payouts(location_id: location_id, status: status, begin_time: begin_time, end_time: end_time, sort_order: sort_order, cursor: cursor, limit: limit)
62+
63+
if result.success?
64+
puts result.data
65+
elsif result.error?
66+
warn result.errors
67+
end
68+
```
69+
70+
71+
# Get Payout
72+
73+
Retrieves details of a specific payout identified by a payout ID.
74+
To call this endpoint, set `PAYOUTS_READ` for the OAuth scope.
75+
76+
```ruby
77+
def get_payout(payout_id:)
78+
```
79+
80+
## Parameters
81+
82+
| Parameter | Type | Tags | Description |
83+
| --- | --- | --- | --- |
84+
| `payout_id` | `String` | Template, Required | The ID of the payout to retrieve the information for. |
85+
86+
## Response Type
87+
88+
[`Get Payout Response Hash`](../../doc/models/get-payout-response.md)
89+
90+
## Example Usage
91+
92+
```ruby
93+
payout_id = 'payout_id6'
94+
95+
result = payouts_api.get_payout(payout_id: payout_id)
96+
97+
if result.success?
98+
puts result.data
99+
elsif result.error?
100+
warn result.errors
101+
end
102+
```
103+
104+
105+
# List Payout Entries
106+
107+
Retrieves a list of all payout entries for a specific payout.
108+
To call this endpoint, set `PAYOUTS_READ` for the OAuth scope.
109+
110+
```ruby
111+
def list_payout_entries(payout_id:,
112+
sort_order: nil,
113+
cursor: nil,
114+
limit: nil)
115+
```
116+
117+
## Parameters
118+
119+
| Parameter | Type | Tags | Description |
120+
| --- | --- | --- | --- |
121+
| `payout_id` | `String` | Template, Required | The ID of the payout to retrieve the information for. |
122+
| `sort_order` | [`String (Sort Order)`](../../doc/models/sort-order.md) | Query, Optional | The order in which payout entries are listed. |
123+
| `cursor` | `String` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this cursor to retrieve the next set of results for the original query.<br>For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination).<br>If request parameters change between requests, subsequent results may contain duplicates or missing records. |
124+
| `limit` | `Integer` | Query, Optional | The maximum number of results to be returned in a single page.<br>It is possible to receive fewer results than the specified limit on a given page.<br>The default value of 100 is also the maximum allowed value. If the provided value is<br>greater than 100, it is ignored and the default value is used instead.<br>Default: `100` |
125+
126+
## Response Type
127+
128+
[`List Payout Entries Response Hash`](../../doc/models/list-payout-entries-response.md)
129+
130+
## Example Usage
131+
132+
```ruby
133+
payout_id = 'payout_id6'
134+
sort_order = 'DESC'
135+
cursor = 'cursor6'
136+
limit = 172
137+
138+
result = payouts_api.list_payout_entries(payout_id: payout_id, sort_order: sort_order, cursor: cursor, limit: limit)
139+
140+
if result.success?
141+
puts result.data
142+
elsif result.error?
143+
warn result.errors
144+
end
145+
```
146+

doc/api/subscriptions.md

-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ end
289289
# List Subscription Events
290290

291291
Lists all events for a specific subscription.
292-
In the current implementation, only `START_SUBSCRIPTION` and `STOP_SUBSCRIPTION` (when the subscription was canceled) events are returned.
293292

294293
```ruby
295294
def list_subscription_events(subscription_id:,

doc/api/terminal.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ body[:checkout][:note] = 'A brief note'
5454
body[:checkout][:device_options] = {}
5555
body[:checkout][:device_options][:device_id] = 'dbb5d83a-7838-11ea-bc55-0242ac130003'
5656
body[:checkout][:device_options][:skip_receipt_screen] = false
57+
body[:checkout][:device_options][:collect_signature] = false
5758
body[:checkout][:device_options][:tip_settings] = {}
5859
body[:checkout][:device_options][:tip_settings][:allow_tipping] = false
5960
body[:checkout][:device_options][:tip_settings][:separate_tip_screen] = false
@@ -75,7 +76,7 @@ end
7576

7677
# Search Terminal Checkouts
7778

78-
Retrieves a filtered list of Terminal checkout requests created by the account making the request.
79+
Returns a filtered list of Terminal checkout requests created by the application making the request. Only Terminal checkout requests created for the merchant scoped to the OAuth token are returned. Terminal checkout requests are available for 30 days.
7980

8081
```ruby
8182
def search_terminal_checkouts(body:)
@@ -119,7 +120,7 @@ end
119120

120121
# Get Terminal Checkout
121122

122-
Retrieves a Terminal checkout request by `checkout_id`.
123+
Retrieves a Terminal checkout request by `checkout_id`. Terminal checkout requests are available for 30 days.
123124

124125
```ruby
125126
def get_terminal_checkout(checkout_id:)
@@ -185,7 +186,7 @@ end
185186

186187
# Create Terminal Refund
187188

188-
Creates a request to refund an Interac payment completed on a Square Terminal.
189+
Creates a request to refund an Interac payment completed on a Square Terminal. Refunds for Interac payments on a Square Terminal are supported only for Interac debit cards in Canada. Other refunds for Terminal payments should use the Refunds API. For more information, see [Refunds API](../../doc/api/refunds.md).
189190

190191
```ruby
191192
def create_terminal_refund(body:)
@@ -216,6 +217,8 @@ body[:refund][:amount_money][:amount] = 111
216217
body[:refund][:amount_money][:currency] = 'CAD'
217218
body[:refund][:reason] = 'Returning items'
218219
body[:refund][:device_id] = 'f72dfb8e-4d65-4e56-aade-ec3fb8d33291'
220+
body[:refund][:deadline_duration] = 'deadline_duration6'
221+
body[:refund][:status] = 'status6'
219222

220223
result = terminal_api.create_terminal_refund(body: body)
221224

@@ -229,7 +232,7 @@ end
229232

230233
# Search Terminal Refunds
231234

232-
Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request.
235+
Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request. Terminal refund requests are available for 30 days.
233236

234237
```ruby
235238
def search_terminal_refunds(body:)
@@ -273,7 +276,7 @@ end
273276

274277
# Get Terminal Refund
275278

276-
Retrieves an Interac Terminal refund object by ID.
279+
Retrieves an Interac Terminal refund object by ID. Terminal refund objects are available for 30 days.
277280

278281
```ruby
279282
def get_terminal_refund(terminal_refund_id:)

doc/client.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The following parameters are configurable for the API Client:
55

66
| Parameter | Type | Description |
77
| --- | --- | --- |
8-
| `square_version` | `String` | Square Connect API versions<br>*Default*: `'2022-03-16'` |
8+
| `square_version` | `String` | Square Connect API versions<br>*Default*: `'2022-04-20'` |
99
| `access_token` | `String` | The OAuth 2.0 Access Token to use for API requests. |
1010
| `custom_url` | `String` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`<br>*Default*: `'https://connect.squareup.com'` |
1111
| `environment` | `string` | The API environment. <br> **Default: `production`** |
@@ -23,7 +23,7 @@ The API client can be initialized as follows:
2323

2424
```ruby
2525
client = Square::Client.new(
26-
square_version: '2022-03-16',
26+
square_version: '2022-04-20',
2727
access_token: 'AccessToken',
2828
environment: 'production',
2929
custom_url: 'https://connect.squareup.com',
@@ -100,6 +100,7 @@ The gateway for the SDK. This class acts as a factory for the Apis and also hold
100100
| merchants | Gets MerchantsApi |
101101
| orders | Gets OrdersApi |
102102
| payments | Gets PaymentsApi |
103+
| payouts | Gets PayoutsApi |
103104
| refunds | Gets RefundsApi |
104105
| sites | Gets SitesApi |
105106
| snippets | Gets SnippetsApi |

doc/http-request.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ Represents a single Http Request.
1111
| query_url | String | | The endpoint URL for the API request. |
1212
| headers | Hash | Optional | Request headers. |
1313
| parameters | Hash | Optional | Request body. |
14+
| context | Hash | Optional | Request context for passing meta information about the request. |
1415

doc/models/activity-type.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
# Activity Type
3+
4+
## Enumeration
5+
6+
`Activity Type`
7+
8+
## Fields
9+
10+
| Name | Description |
11+
| --- | --- |
12+
| `ADJUSTMENT` | A manual adjustment applied to the seller's account by Square. |
13+
| `APP_FEE_REFUND` | A refund for an application fee on a payment. |
14+
| `APP_FEE_REVENUE` | Revenue generated from an application fee on a payment. |
15+
| `AUTOMATIC_SAVINGS` | An automatic transfer from the payment processing balance to the Square Savings account.<br>These are, generally, proportional to the seller's sales. |
16+
| `AUTOMATIC_SAVINGS_REVERSED` | An automatic transfer from the Square Savings account back to the processing balance.<br>These are, generally, proportional to the seller's refunds. |
17+
| `CHARGE` | A credit card payment capture. |
18+
| `DEPOSIT_FEE` | Any fees involved with deposits such as instant deposits. |
19+
| `DISPUTE` | The balance change due to a dispute event. |
20+
| `ESCHEATMENT` | An escheatment entry for remittance. |
21+
| `FEE` | The Square processing fee. |
22+
| `FREE_PROCESSING` | Square offers free payments processing for a variety of business scenarios, including seller<br>referrals or when Square wants to apologize (for example, for a bug, customer service, or repricing complication).<br>This entry represents a credit to the seller for the purposes of free processing. |
23+
| `HOLD_ADJUSTMENT` | An adjustment made by Square related to holding a payment. |
24+
| `INITIAL_BALANCE_CHANGE` | An external change to a seller's balance. Initial, in the sense that it<br>causes the creation of the other activity types, such as hold and refund. |
25+
| `MONEY_TRANSFER` | The balance change from a money transfer. |
26+
| `MONEY_TRANSFER_REVERSAL` | The reversal of a money transfer. |
27+
| `OPEN_DISPUTE` | The balance change for a chargeback that has been filed. |
28+
| `OTHER` | Any other type that does not belong in the rest of the types. |
29+
| `OTHER_ADJUSTMENT` | Any other type of adjustment that does not fall under existing types. |
30+
| `PAID_SERVICE_FEE` | A fee paid to a third-party merchant. |
31+
| `PAID_SERVICE_FEE_REFUND` | A fee paid to a third-party merchant. |
32+
| `REDEMPTION_CODE` | Repayment for a redemption code. |
33+
| `REFUND` | A refund for an existing card payment. |
34+
| `RELEASE_ADJUSTMENT` | An adjustment made by Square related to releasing a payment. |
35+
| `RESERVE_HOLD` | Fees paid for funding risk reserve. |
36+
| `RESERVE_RELEASE` | Fees released from risk reserve. |
37+
| `RETURNED_PAYOUT` | An entry created when Square receives a response for the ACH file that Square sent indicating that the<br>settlement of the original entry failed. |
38+
| `SQUARE_CAPITAL_PAYMENT` | A capital merchant cash advance (MCA) assessment. These are, generally,<br>proportional to the merchant's sales but can be issued for other reasons related to the MCA. |
39+
| `SQUARE_CAPITAL_REVERSED_PAYMENT` | A capital merchant cash advance (MCA) assessment refund. These are, generally,<br>proportional to the merchant's refunds but can be issued for other reasons related to the MCA. |
40+
| `SUBSCRIPTION_FEE` | A fee charged for subscription to a Square product. |
41+
| `SUBSCRIPTION_FEE_PAID_REFUND` | A Square subscription fee that has been refunded. |
42+
| `SUBSCRIPTION_FEE_REFUND` | The refund of a previously charged Square product subscription fee. |
43+
| `TAX_ON_FEE` | The tax paid on fee amounts. |
44+
| `THIRD_PARTY_FEE` | Fees collected by a third-party platform. |
45+
| `THIRD_PARTY_FEE_REFUND` | Refunded fees from a third-party platform. |
46+

doc/models/batch-retrieve-catalog-objects-request.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
| `object_ids` | `Array<String>` | Required | The IDs of the CatalogObjects to be retrieved. |
1313
| `include_related_objects` | `Boolean` | Optional | If `true`, the response will include additional objects that are related to the<br>requested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field<br>of the response. These objects are put in the `related_objects` field. Setting this to `true` is<br>helpful when the objects are needed for immediate display to a user.<br>This process only goes one level deep. Objects referenced by the related objects will not be included. For example,<br><br>if the `objects` field of the response contains a CatalogItem, its associated<br>CatalogCategory objects, CatalogTax objects, CatalogImage objects and<br>CatalogModifierLists will be returned in the `related_objects` field of the<br>response. If the `objects` field of the response contains a CatalogItemVariation,<br>its parent CatalogItem will be returned in the `related_objects` field of<br>the response.<br><br>Default value: `false` |
1414
| `catalog_version` | `Long` | Optional | The specific version of the catalog objects to be included in the response.<br>This allows you to retrieve historical versions of objects. The specified version value is matched against<br>the [CatalogObject](../../doc/models/catalog-object.md)s' `version` attribute. If not included, results will<br>be from the current version of the catalog. |
15+
| `include_deleted_objects` | `Boolean` | Optional | Indicates whether to include (`true`) or not (`false`) in the response deleted objects, namely, those with the `is_deleted` attribute set to `true`. |
1516

1617
## Example (as JSON)
1718

doc/models/bulk-create-vendors-request.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# Bulk Create Vendors Request
33

4-
Represents an input to a call to [BulkCreateVendors.](../../doc/api/vendors.md#bulk-create-vendors)
4+
Represents an input to a call to [BulkCreateVendors](../../doc/api/vendors.md#bulk-create-vendors).
55

66
## Structure
77

@@ -11,7 +11,7 @@ Represents an input to a call to [BulkCreateVendors.](../../doc/api/vendors.md#b
1111

1212
| Name | Type | Tags | Description |
1313
| --- | --- | --- | --- |
14-
| `vendors` | [`Hash Hash`](../../doc/models/vendor.md) | Required | Specifies a set of new [Vendor](entity:Vendor] objects as represented by a collection of idempotency-key/`Vendor`-object pairs. |
14+
| `vendors` | [`Hash Hash`](../../doc/models/vendor.md) | Required | Specifies a set of new [Vendor](../../doc/models/vendor.md) objects as represented by a collection of idempotency-key/`Vendor`-object pairs. |
1515

1616
## Example (as JSON)
1717

doc/models/bulk-create-vendors-response.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# Bulk Create Vendors Response
33

4-
Represents an output from a call to [BulkCreateVendors.](../../doc/api/vendors.md#bulk-create-vendors)
4+
Represents an output from a call to [BulkCreateVendors](../../doc/api/vendors.md#bulk-create-vendors).
55

66
## Structure
77

@@ -12,7 +12,7 @@ Represents an output from a call to [BulkCreateVendors.](../../doc/api/vendors.m
1212
| Name | Type | Tags | Description |
1313
| --- | --- | --- | --- |
1414
| `errors` | [`Array<Error Hash>`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. |
15-
| `responses` | [`Hash Hash`](../../doc/models/create-vendor-response.md) | Optional | A set of [CreateVendorResponse](../../doc/models/create-vendor-response.md) objects encapsulating successfully created [Vendor](../../doc/models/vendor.md)<br>objects or error responses for failed attempts. The set is represented by<br>a collection of idempotency-key/`Vendor`-object or idempotency-key/error-object pairs. The impotency keys correspond to those specified<br>in the input. |
15+
| `responses` | [`Hash Hash`](../../doc/models/create-vendor-response.md) | Optional | A set of [CreateVendorResponse](../../doc/models/create-vendor-response.md) objects encapsulating successfully created [Vendor](../../doc/models/vendor.md)<br>objects or error responses for failed attempts. The set is represented by<br>a collection of idempotency-key/`Vendor`-object or idempotency-key/error-object pairs. The idempotency keys correspond to those specified<br>in the input. |
1616

1717
## Example (as JSON)
1818

0 commit comments

Comments
 (0)