Skip to content

Commit 267cf70

Browse files
authored
Merge pull request #119 from square/release/31.0.0.20230816
Generated PR for Release: 31.0.0.20230816
2 parents 72291c9 + 5abcb44 commit 267cf70

Some content is hidden

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

48 files changed

+478
-36
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ rake
7777

7878
### Orders
7979
* [Orders]
80+
* [Order Custom Attributes]
8081

8182
### Subscriptions
8283
* [Subscriptions]
@@ -103,10 +104,13 @@ rake
103104

104105
### Bookings
105106
* [Bookings]
107+
* [Booking Custom Attributes]
106108

107109
### Business
108110
* [Merchants]
111+
* [Merchant Custom Attributes]
109112
* [Locations]
113+
* [Location Custom Attributes]
110114
* [Devices]
111115
* [Cash Drawers]
112116
* [Vendors]
@@ -162,9 +166,13 @@ The following Square APIs are [deprecated](https://developer.squareup.com/docs/b
162166
[Labor]: doc/api/labor.md
163167
[Loyalty]: doc/api/loyalty.md
164168
[Bookings]: doc/api/bookings.md
169+
[Booking Custom Attributes]: doc/api/booking-custom-attributes.md
165170
[Locations]: doc/api/locations.md
171+
[Location Custom Attributes]: doc/api/location-custom-attributes.md
166172
[Merchants]: doc/api/merchants.md
173+
[Merchant Custom Attributes]: doc/api/merchant-custom-attributes.md
167174
[Orders]: doc/api/orders.md
175+
[Order Custom Attributes]: doc/api/order-custom-attributes.md
168176
[Invoices]: doc/api/invoices.md
169177
[Apple Pay]: doc/api/apple-pay.md
170178
[Refunds]: doc/api/refunds.md

doc/api/bookings.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ bookings_api = client.bookings
1313
* [List Bookings](../../doc/api/bookings.md#list-bookings)
1414
* [Create Booking](../../doc/api/bookings.md#create-booking)
1515
* [Search Availability](../../doc/api/bookings.md#search-availability)
16+
* [Bulk Retrieve Bookings](../../doc/api/bookings.md#bulk-retrieve-bookings)
1617
* [Retrieve Business Booking Profile](../../doc/api/bookings.md#retrieve-business-booking-profile)
1718
* [List Team Member Booking Profiles](../../doc/api/bookings.md#list-team-member-booking-profiles)
1819
* [Retrieve Team Member Booking Profile](../../doc/api/bookings.md#retrieve-team-member-booking-profile)
@@ -31,6 +32,7 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ`
3132
```ruby
3233
def list_bookings(limit: nil,
3334
cursor: nil,
35+
customer_id: nil,
3436
team_member_id: nil,
3537
location_id: nil,
3638
start_at_min: nil,
@@ -43,6 +45,7 @@ def list_bookings(limit: nil,
4345
| --- | --- | --- | --- |
4446
| `limit` | `Integer` | Query, Optional | The maximum number of results per page to return in a paged response. |
4547
| `cursor` | `String` | Query, Optional | The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. |
48+
| `customer_id` | `String` | Query, Optional | The [customer](entity:Customer) for whom to retrieve bookings. If this is not set, bookings for all customers are retrieved. |
4649
| `team_member_id` | `String` | Query, Optional | The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved. |
4750
| `location_id` | `String` | Query, Optional | The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved. |
4851
| `start_at_min` | `String` | Query, Optional | The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current time is used. |
@@ -158,6 +161,49 @@ end
158161
```
159162

160163

164+
# Bulk Retrieve Bookings
165+
166+
Bulk-Retrieves a list of bookings by booking IDs.
167+
168+
To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.
169+
To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.
170+
171+
```ruby
172+
def bulk_retrieve_bookings(body:)
173+
```
174+
175+
## Parameters
176+
177+
| Parameter | Type | Tags | Description |
178+
| --- | --- | --- | --- |
179+
| `body` | [`Bulk Retrieve Bookings Request Hash`](../../doc/models/bulk-retrieve-bookings-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |
180+
181+
## Response Type
182+
183+
This method returns a `\ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Retrieve Bookings Response Hash`](../../doc/models/bulk-retrieve-bookings-response.md).
184+
185+
## Example Usage
186+
187+
```ruby
188+
body = {
189+
:booking_ids => [
190+
'booking_ids8',
191+
'booking_ids9',
192+
'booking_ids0'
193+
]
194+
}
195+
196+
197+
result = bookings_api.bulk_retrieve_bookings(body: body)
198+
199+
if result.success?
200+
puts result.data
201+
elsif result.error?
202+
warn result.errors
203+
end
204+
```
205+
206+
161207
# Retrieve Business Booking Profile
162208

163209
Retrieves a seller's booking profile.

doc/api/gift-cards.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def list_gift_cards(type: nil,
3838
| --- | --- | --- | --- |
3939
| `type` | `String` | Query, Optional | If a [type](entity:GiftCardType) is provided, the endpoint returns gift cards of the specified type.<br>Otherwise, the endpoint returns gift cards of all types. |
4040
| `state` | `String` | Query, Optional | If a [state](entity:GiftCardStatus) is provided, the endpoint returns the gift cards in the specified state.<br>Otherwise, the endpoint returns the gift cards of all states. |
41-
| `limit` | `Integer` | Query, Optional | If a limit is provided, the endpoint returns only the specified number of results per page.<br>The maximum value is 50. The default value is 30.<br>For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). |
41+
| `limit` | `Integer` | Query, Optional | If a limit is provided, the endpoint returns only the specified number of results per page.<br>The maximum value is 200. The default value is 30.<br>For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). |
4242
| `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>If a cursor is not provided, the endpoint returns the first page of the results.<br>For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). |
4343
| `customer_id` | `String` | Query, Optional | If a customer ID is provided, the endpoint returns only the gift cards linked to the specified customer. |
4444

doc/api/loyalty.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -515,16 +515,12 @@ body = {
515515
:incentive => {
516516
:type => 'POINTS_MULTIPLIER',
517517
:points_multiplier_data => {
518-
:points_multiplier => 3
518+
:multiplier => '3.0'
519519
}
520520
},
521521
:available_time => {
522522
:time_periods => [
523-
'BEGIN:VEVENT
524-
DTSTART:20220816T160000
525-
DURATION:PT2H
526-
RRULE:FREQ=WEEKLY;BYDAY=TU
527-
END:VEVENT'
523+
'BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT'
528524
]
529525
},
530526
:trigger_limit => {

doc/client.md

Lines changed: 2 additions & 2 deletions
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*: `'2023-07-20'` |
8+
| `square_version` | `String` | Square Connect API versions<br>*Default*: `'2023-08-16'` |
99
| `custom_url` | `String` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`<br>*Default*: `'https://connect.squareup.com'` |
1010
| `environment` | `string` | The API environment. <br> **Default: `production`** |
1111
| `connection` | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
@@ -25,7 +25,7 @@ The API client can be initialized as follows:
2525

2626
```ruby
2727
client = Square::Client.new(
28-
square_version: '2023-07-20',
28+
square_version: '2023-08-16',
2929
access_token: 'AccessToken',
3030
environment: 'production',
3131
custom_url: 'https://connect.squareup.com'

doc/models/archived-state.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
# Archived State
3+
4+
Defines the values for the `archived_state` query expression
5+
used in [SearchCatalogItems](../../doc/api/catalog.md#search-catalog-items)
6+
to return the archived, not archived or either type of catalog items.
7+
8+
## Enumeration
9+
10+
`Archived State`
11+
12+
## Fields
13+
14+
| Name | Description |
15+
| --- | --- |
16+
| `ARCHIVED_STATE_NOT_ARCHIVED` | Requested items are not archived with the `is_archived` attribute set to `false`. |
17+
| `ARCHIVED_STATE_ARCHIVED` | Requested items are archived with the `is_archived` attribute set to `true`. |
18+
| `ARCHIVED_STATE_ALL` | Requested items can be archived or not archived. |
19+

doc/models/booking-custom-attribute-delete-request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ request. An individual request contains a booking ID, the custom attribute to de
1212

1313
| Name | Type | Tags | Description |
1414
| --- | --- | --- | --- |
15-
| `booking_id` | `String` | Required | The ID of the target [booking](entity:Booking).<br>**Constraints**: *Minimum Length*: `1` |
15+
| `booking_id` | `String` | Required | The ID of the target [booking](entity:Booking).<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` |
1616
| `key` | `String` | Required | The key of the custom attribute to delete. This key must match the `key` of a<br>custom attribute definition in the Square seller account. If the requesting application is not<br>the definition owner, you must use the qualified key.<br>**Constraints**: *Minimum Length*: `1` |
1717

1818
## Example (as JSON)

doc/models/booking-custom-attribute-upsert-request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ and an optional idempotency key.
1313

1414
| Name | Type | Tags | Description |
1515
| --- | --- | --- | --- |
16-
| `booking_id` | `String` | Required | The ID of the target [booking](entity:Booking).<br>**Constraints**: *Minimum Length*: `1` |
16+
| `booking_id` | `String` | Required | The ID of the target [booking](entity:Booking).<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` |
1717
| `custom_attribute` | [`Custom Attribute Hash`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding<br>`CustomAttributeDefinition` object. |
1818
| `idempotency_key` | `String` | Optional | A unique identifier for this individual upsert request, used to ensure idempotency.<br>For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).<br>**Constraints**: *Maximum Length*: `45` |
1919

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
# Bulk Retrieve Bookings Request
3+
4+
Request payload for bulk retrieval of bookings.
5+
6+
## Structure
7+
8+
`Bulk Retrieve Bookings Request`
9+
10+
## Fields
11+
12+
| Name | Type | Tags | Description |
13+
| --- | --- | --- | --- |
14+
| `booking_ids` | `Array<String>` | Required | A non-empty list of [Booking](entity:Booking) IDs specifying bookings to retrieve. |
15+
16+
## Example (as JSON)
17+
18+
```json
19+
{
20+
"booking_ids": [
21+
"booking_ids4"
22+
]
23+
}
24+
```
25+
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
2+
# Bulk Retrieve Bookings Response
3+
4+
Response payload for bulk retrieval of bookings.
5+
6+
## Structure
7+
8+
`Bulk Retrieve Bookings Response`
9+
10+
## Fields
11+
12+
| Name | Type | Tags | Description |
13+
| --- | --- | --- | --- |
14+
| `bookings` | [`Hash String Retrieve Booking Response Hash`](../../doc/models/retrieve-booking-response.md) | Optional | Requested bookings returned as a map containing `booking_id` as the key and `RetrieveBookingResponse` as the value. |
15+
| `errors` | [`Array<Error Hash>`](../../doc/models/error.md) | Optional | Errors that occurred during the request. |
16+
17+
## Example (as JSON)
18+
19+
```json
20+
{
21+
"bookings": {
22+
"sc3p3m7dvctfr1": {
23+
"booking": {
24+
"all_day": false,
25+
"appointment_segments": [
26+
{
27+
"any_team_member": false,
28+
"duration_minutes": 60,
29+
"service_variation_id": "VG4FYBKK3UL6UITOEYQ6MFLS",
30+
"service_variation_version": 1641341724039,
31+
"team_member_id": "TMjiqI3PxyLMKr4k"
32+
}
33+
],
34+
"created_at": "2023-04-26T18:19:21Z",
35+
"customer_id": "4TDWKN9E8165X8Z77MRS0VFMJM",
36+
"id": "sc3p3m7dvctfr1",
37+
"location_id": "LY6WNBPVM6VGV",
38+
"start_at": "2023-05-01T14:00:00Z",
39+
"status": "ACCEPTED",
40+
"updated_at": "2023-04-26T18:19:21Z",
41+
"version": 0
42+
},
43+
"errors": []
44+
},
45+
"tdegug1dvctdef": {
46+
"errors": [
47+
{
48+
"category": "INVALID_REQUEST_ERROR",
49+
"code": "NOT_FOUND",
50+
"detail": "Specified booking was not found.",
51+
"field": "booking_id"
52+
}
53+
],
54+
"booking": {
55+
"id": "id8",
56+
"version": 86,
57+
"status": "CANCELLED_BY_SELLER",
58+
"created_at": "created_at6",
59+
"updated_at": "updated_at6"
60+
}
61+
},
62+
"tdegug1fqni3wh": {
63+
"booking": {
64+
"all_day": false,
65+
"appointment_segments": [
66+
{
67+
"any_team_member": false,
68+
"duration_minutes": 60,
69+
"service_variation_id": "VG4FYBKK3UL6UITOEYQ6MFLS",
70+
"service_variation_version": 1641341724039,
71+
"team_member_id": "TMjiqI3PxyLMKr4k"
72+
}
73+
],
74+
"created_at": "2023-04-26T18:19:30Z",
75+
"customer_id": "4TDWKN9E8165X8Z77MRS0VFMJM",
76+
"id": "tdegug1fqni3wh",
77+
"location_id": "LY6WNBPVM6VGV",
78+
"start_at": "2023-05-02T14:00:00Z",
79+
"status": "ACCEPTED",
80+
"updated_at": "2023-04-26T18:19:30Z",
81+
"version": 0
82+
},
83+
"errors": []
84+
}
85+
},
86+
"errors": []
87+
}
88+
```
89+

0 commit comments

Comments
 (0)