Skip to content

Commit 4fae940

Browse files
authored
Merge pull request #139 from square/release/2024-12-18
Generated PR for Release: 2024-12-18
2 parents 5932fed + c4bb2d8 commit 4fae940

39 files changed

+1083
-274
lines changed

doc/api/payments.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ def list_payments(begin_time: nil,
4040
limit: nil,
4141
is_offline_payment: false,
4242
offline_begin_time: nil,
43-
offline_end_time: nil)
43+
offline_end_time: nil,
44+
updated_at_begin_time: nil,
45+
updated_at_end_time: nil,
46+
sort_field: nil)
4447
```
4548

4649
## Parameters
@@ -49,7 +52,7 @@ def list_payments(begin_time: nil,
4952
| --- | --- | --- | --- |
5053
| `begin_time` | `String` | Query, Optional | Indicates the start of the time range to retrieve payments for, in RFC 3339 format. <br>The range is determined using the `created_at` field for each Payment.<br>Inclusive. Default: The current time minus one year. |
5154
| `end_time` | `String` | Query, Optional | Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The<br>range is determined using the `created_at` field for each Payment.<br><br>Default: The current time. |
52-
| `sort_order` | `String` | Query, Optional | The order in which results are listed by `Payment.created_at`:<br><br>- `ASC` - Oldest to newest.<br>- `DESC` - Newest to oldest (default). |
55+
| `sort_order` | `String` | Query, Optional | The order in which results are listed by `ListPaymentsRequest.sort_field`:<br><br>- `ASC` - Oldest to newest.<br>- `DESC` - Newest to oldest (default). |
5356
| `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><br>For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). |
5457
| `location_id` | `String` | Query, Optional | Limit results to the location supplied. By default, results are returned<br>for the default (main) location associated with the seller. |
5558
| `total` | `Integer` | Query, Optional | The exact amount in the `total_money` for a payment. |
@@ -59,6 +62,9 @@ def list_payments(begin_time: nil,
5962
| `is_offline_payment` | `TrueClass \| FalseClass` | Query, Optional | Whether the payment was taken offline or not.<br>**Default**: `false` |
6063
| `offline_begin_time` | `String` | Query, Optional | Indicates the start of the time range for which to retrieve offline payments, in RFC 3339<br>format for timestamps. The range is determined using the<br>`offline_payment_details.client_created_at` field for each Payment. If set, payments without a<br>value set in `offline_payment_details.client_created_at` will not be returned.<br><br>Default: The current time. |
6164
| `offline_end_time` | `String` | Query, Optional | Indicates the end of the time range for which to retrieve offline payments, in RFC 3339<br>format for timestamps. The range is determined using the<br>`offline_payment_details.client_created_at` field for each Payment. If set, payments without a<br>value set in `offline_payment_details.client_created_at` will not be returned.<br><br>Default: The current time. |
65+
| `updated_at_begin_time` | `String` | Query, Optional | Indicates the start of the time range to retrieve payments for, in RFC 3339 format. The<br>range is determined using the `updated_at` field for each Payment. |
66+
| `updated_at_end_time` | `String` | Query, Optional | Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The<br>range is determined using the `updated_at` field for each Payment. |
67+
| `sort_field` | [`String (Payment Sort Field)`](../../doc/models/payment-sort-field.md) | Query, Optional | The field used to sort results by. The default is `CREATED_AT`. |
6268

6369
## Response Type
6470

doc/api/team.md

Lines changed: 196 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ team_api = client.team
1313
* [Create Team Member](../../doc/api/team.md#create-team-member)
1414
* [Bulk Create Team Members](../../doc/api/team.md#bulk-create-team-members)
1515
* [Bulk Update Team Members](../../doc/api/team.md#bulk-update-team-members)
16+
* [List Jobs](../../doc/api/team.md#list-jobs)
17+
* [Create Job](../../doc/api/team.md#create-job)
18+
* [Retrieve Job](../../doc/api/team.md#retrieve-job)
19+
* [Update Job](../../doc/api/team.md#update-job)
1620
* [Search Team Members](../../doc/api/team.md#search-team-members)
1721
* [Retrieve Team Member](../../doc/api/team.md#retrieve-team-member)
1822
* [Update Team Member](../../doc/api/team.md#update-team-member)
@@ -62,6 +66,28 @@ body = {
6266
'YSGH2WBKG94QZ',
6367
'GA2Y9HSJ8KRYT'
6468
]
69+
},
70+
:wage_setting => {
71+
:job_assignments => [
72+
{
73+
:pay_type => 'SALARY',
74+
:annual_rate => {
75+
:amount => 3000000,
76+
:currency => 'USD'
77+
},
78+
:weekly_hours => 40,
79+
:job_id => 'FjS8x95cqHiMenw4f1NAUH4P'
80+
},
81+
{
82+
:pay_type => 'HOURLY',
83+
:hourly_rate => {
84+
:amount => 2000,
85+
:currency => 'USD'
86+
},
87+
:job_id => 'VDNpRv8da51NU8qZFC5zDWpF'
88+
}
89+
],
90+
:is_overtime_exempt => true
6591
}
6692
}
6793
}
@@ -218,13 +244,165 @@ end
218244
```
219245

220246

247+
# List Jobs
248+
249+
Lists jobs in a seller account. Results are sorted by title in ascending order.
250+
251+
```ruby
252+
def list_jobs(cursor: nil)
253+
```
254+
255+
## Parameters
256+
257+
| Parameter | Type | Tags | Description |
258+
| --- | --- | --- | --- |
259+
| `cursor` | `String` | Query, Optional | The pagination cursor returned by the previous call to this endpoint. Provide this<br>cursor to retrieve the next page of results for your original request. For more information,<br>see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). |
260+
261+
## Response Type
262+
263+
This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Jobs Response Hash`](../../doc/models/list-jobs-response.md).
264+
265+
## Example Usage
266+
267+
```ruby
268+
result = team_api.list_jobs
269+
270+
if result.success?
271+
puts result.data
272+
elsif result.error?
273+
warn result.errors
274+
end
275+
```
276+
277+
278+
# Create Job
279+
280+
Creates a job in a seller account. A job defines a title and tip eligibility. Note that
281+
compensation is defined in a [job assignment](../../doc/models/job-assignment.md) in a team member's wage setting.
282+
283+
```ruby
284+
def create_job(body:)
285+
```
286+
287+
## Parameters
288+
289+
| Parameter | Type | Tags | Description |
290+
| --- | --- | --- | --- |
291+
| `body` | [`Create Job Request Hash`](../../doc/models/create-job-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |
292+
293+
## Response Type
294+
295+
This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Job Response Hash`](../../doc/models/create-job-response.md).
296+
297+
## Example Usage
298+
299+
```ruby
300+
body = {
301+
:job => {
302+
:title => 'Cashier',
303+
:is_tip_eligible => true
304+
},
305+
:idempotency_key => 'idempotency-key-0'
306+
}
307+
308+
309+
result = team_api.create_job(body: body)
310+
311+
if result.success?
312+
puts result.data
313+
elsif result.error?
314+
warn result.errors
315+
end
316+
```
317+
318+
319+
# Retrieve Job
320+
321+
Retrieves a specified job.
322+
323+
```ruby
324+
def retrieve_job(job_id:)
325+
```
326+
327+
## Parameters
328+
329+
| Parameter | Type | Tags | Description |
330+
| --- | --- | --- | --- |
331+
| `job_id` | `String` | Template, Required | The ID of the job to retrieve. |
332+
333+
## Response Type
334+
335+
This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Job Response Hash`](../../doc/models/retrieve-job-response.md).
336+
337+
## Example Usage
338+
339+
```ruby
340+
job_id = 'job_id2'
341+
342+
343+
result = team_api.retrieve_job(job_id: job_id)
344+
345+
if result.success?
346+
puts result.data
347+
elsif result.error?
348+
warn result.errors
349+
end
350+
```
351+
352+
353+
# Update Job
354+
355+
Updates the title or tip eligibility of a job. Changes to the title propagate to all
356+
`JobAssignment`, `Shift`, and `TeamMemberWage` objects that reference the job ID. Changes to
357+
tip eligibility propagate to all `TeamMemberWage` objects that reference the job ID.
358+
359+
```ruby
360+
def update_job(job_id:,
361+
body:)
362+
```
363+
364+
## Parameters
365+
366+
| Parameter | Type | Tags | Description |
367+
| --- | --- | --- | --- |
368+
| `job_id` | `String` | Template, Required | The ID of the job to update. |
369+
| `body` | [`Update Job Request Hash`](../../doc/models/update-job-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |
370+
371+
## Response Type
372+
373+
This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Job Response Hash`](../../doc/models/update-job-response.md).
374+
375+
## Example Usage
376+
377+
```ruby
378+
job_id = 'job_id2'
379+
380+
body = {
381+
:job => {
382+
:title => 'Cashier 1',
383+
:is_tip_eligible => true
384+
}
385+
}
386+
387+
388+
result = team_api.update_job(
389+
job_id: job_id,
390+
body: body
391+
)
392+
393+
if result.success?
394+
puts result.data
395+
elsif result.error?
396+
warn result.errors
397+
end
398+
```
399+
400+
221401
# Search Team Members
222402

223403
Returns a paginated list of `TeamMember` objects for a business.
224-
The list can be filtered by the following:
225-
226-
- location IDs
227-
- `status`
404+
The list can be filtered by location IDs, `ACTIVE` or `INACTIVE` status, or whether
405+
the team member is the Square account owner.
228406

229407
```ruby
230408
def search_team_members(body:)
@@ -362,8 +540,11 @@ end
362540
# Retrieve Wage Setting
363541

364542
Retrieves a `WageSetting` object for a team member specified
365-
by `TeamMember.id`.
366-
Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#retrievewagesetting).
543+
by `TeamMember.id`. For more information, see
544+
[Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#retrievewagesetting).
545+
546+
Square recommends using [RetrieveTeamMember](../../doc/api/team.md#retrieve-team-member) or [SearchTeamMembers](../../doc/api/team.md#search-team-members)
547+
to get this information directly from the `TeamMember.wage_setting` field.
367548

368549
```ruby
369550
def retrieve_wage_setting(team_member_id:)
@@ -398,10 +579,13 @@ end
398579
# Update Wage Setting
399580

400581
Creates or updates a `WageSetting` object. The object is created if a
401-
`WageSetting` with the specified `team_member_id` does not exist. Otherwise,
582+
`WageSetting` with the specified `team_member_id` doesn't exist. Otherwise,
402583
it fully replaces the `WageSetting` object for the team member.
403-
The `WageSetting` is returned on a successful update.
404-
Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#create-or-update-a-wage-setting).
584+
The `WageSetting` is returned on a successful update. For more information, see
585+
[Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#create-or-update-a-wage-setting).
586+
587+
Square recommends using [CreateTeamMember](../../doc/api/team.md#create-team-member) or [UpdateTeamMember](../../doc/api/team.md#update-team-member)
588+
to manage the `TeamMember.wage_setting` field directly.
405589

406590
```ruby
407591
def update_wage_setting(team_member_id:,
@@ -428,19 +612,19 @@ body = {
428612
:wage_setting => {
429613
:job_assignments => [
430614
{
431-
:job_title => 'Manager',
432615
:pay_type => 'SALARY',
616+
:job_title => 'Manager',
433617
:annual_rate => {
434618
:amount => 3000000,
435619
:currency => 'USD'
436620
},
437621
:weekly_hours => 40
438622
},
439623
{
440-
:job_title => 'Cashier',
441624
:pay_type => 'HOURLY',
625+
:job_title => 'Cashier',
442626
:hourly_rate => {
443-
:amount => 1200,
627+
:amount => 2000,
444628
:currency => 'USD'
445629
}
446630
}

doc/client.md

Lines changed: 3 additions & 3 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*: `'2024-11-20'` |
8+
| `square_version` | `String` | Square Connect API versions<br>*Default*: `'2024-12-18'` |
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: '2024-11-20',
28+
square_version: '2024-12-18',
2929
bearer_auth_credentials: BearerAuthCredentials.new(
3030
access_token: 'AccessToken'
3131
),
@@ -55,7 +55,7 @@ require 'square'
5555
include Square
5656

5757
client = Square::Client.new(
58-
square_version: '2024-11-20',
58+
square_version: '2024-12-18',
5959
bearer_auth_credentials: BearerAuthCredentials.new(
6060
access_token: 'AccessToken'
6161
),

doc/models/bulk-create-team-members-request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Represents a bulk create request for `TeamMember` objects.
1111

1212
| Name | Type | Tags | Description |
1313
| --- | --- | --- | --- |
14-
| `team_members` | [`Hash String Create Team Member Request Hash`](../../doc/models/create-team-member-request.md) | Required | The data used to create the `TeamMember` objects. Each key is the `idempotency_key` that maps to the `CreateTeamMemberRequest`. The maximum number of create objects is 25. |
14+
| `team_members` | [`Hash String Create Team Member Request Hash`](../../doc/models/create-team-member-request.md) | Required | The data used to create the `TeamMember` objects. Each key is the `idempotency_key` that maps to the `CreateTeamMemberRequest`.<br>The maximum number of create objects is 25.<br><br>If you include a team member's `wage_setting`, you must provide `job_id` for each job assignment. To get job IDs,<br>call [ListJobs](api-endpoint:Team-ListJobs). |
1515

1616
## Example (as JSON)
1717

0 commit comments

Comments
 (0)