Skip to content

Commit 99023f2

Browse files
authored
Merge pull request #126 from square/release/2024-12-18
Generated PR for Release: 2024-12-18
2 parents f591cd5 + 0456b5c commit 99023f2

Some content is hidden

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

57 files changed

+3114
-386
lines changed

doc/api/payments.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ CompletableFuture<ListPaymentsResponse> listPaymentsAsync(
4141
final Integer limit,
4242
final Boolean isOfflinePayment,
4343
final String offlineBeginTime,
44-
final String offlineEndTime)
44+
final String offlineEndTime,
45+
final String updatedAtBeginTime,
46+
final String updatedAtEndTime,
47+
final String sortField)
4548
```
4649

4750
## Parameters
@@ -50,7 +53,7 @@ CompletableFuture<ListPaymentsResponse> listPaymentsAsync(
5053
| --- | --- | --- | --- |
5154
| `beginTime` | `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. |
5255
| `endTime` | `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. |
53-
| `sortOrder` | `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). |
56+
| `sortOrder` | `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). |
5457
| `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). |
5558
| `locationId` | `String` | Query, Optional | Limit results to the location supplied. By default, results are returned<br>for the default (main) location associated with the seller. |
5659
| `total` | `Long` | Query, Optional | The exact amount in the `total_money` for a payment. |
@@ -60,6 +63,9 @@ CompletableFuture<ListPaymentsResponse> listPaymentsAsync(
6063
| `isOfflinePayment` | `Boolean` | Query, Optional | Whether the payment was taken offline or not.<br>**Default**: `false` |
6164
| `offlineBeginTime` | `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. |
6265
| `offlineEndTime` | `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. |
66+
| `updatedAtBeginTime` | `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. |
67+
| `updatedAtEndTime` | `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. |
68+
| `sortField` | [`String`](../../doc/models/payment-sort-field.md) | Query, Optional | The field used to sort results by. The default is `CREATED_AT`. |
6369

6470
## Response Type
6571

@@ -70,7 +76,7 @@ CompletableFuture<ListPaymentsResponse> listPaymentsAsync(
7076
```java
7177
Boolean isOfflinePayment = false;
7278

73-
paymentsApi.listPaymentsAsync(null, null, null, null, null, null, null, null, null, isOfflinePayment, null, null).thenAccept(result -> {
79+
paymentsApi.listPaymentsAsync(null, null, null, null, null, null, null, null, null, isOfflinePayment, null, null, null, null, null).thenAccept(result -> {
7480
// TODO success callback handler
7581
System.out.println(result);
7682
}).exceptionally(exception -> {

doc/api/team.md

Lines changed: 201 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ TeamApi teamApi = client.getTeamApi();
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)
@@ -64,6 +68,30 @@ CreateTeamMemberRequest body = new CreateTeamMemberRequest.Builder()
6468
"GA2Y9HSJ8KRYT"
6569
))
6670
.build())
71+
.wageSetting(new WageSetting.Builder()
72+
.jobAssignments(Arrays.asList(
73+
new JobAssignment.Builder(
74+
"SALARY"
75+
)
76+
.annualRate(new Money.Builder()
77+
.amount(3000000L)
78+
.currency("USD")
79+
.build())
80+
.weeklyHours(40)
81+
.jobId("FjS8x95cqHiMenw4f1NAUH4P")
82+
.build(),
83+
new JobAssignment.Builder(
84+
"HOURLY"
85+
)
86+
.hourlyRate(new Money.Builder()
87+
.amount(2000L)
88+
.currency("USD")
89+
.build())
90+
.jobId("VDNpRv8da51NU8qZFC5zDWpF")
91+
.build()
92+
))
93+
.isOvertimeExempt(true)
94+
.build())
6795
.build())
6896
.build();
6997

@@ -223,13 +251,168 @@ teamApi.bulkUpdateTeamMembersAsync(body).thenAccept(result -> {
223251
```
224252

225253

254+
# List Jobs
255+
256+
Lists jobs in a seller account. Results are sorted by title in ascending order.
257+
258+
```java
259+
CompletableFuture<ListJobsResponse> listJobsAsync(
260+
final String cursor)
261+
```
262+
263+
## Parameters
264+
265+
| Parameter | Type | Tags | Description |
266+
| --- | --- | --- | --- |
267+
| `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). |
268+
269+
## Response Type
270+
271+
[`ListJobsResponse`](../../doc/models/list-jobs-response.md)
272+
273+
## Example Usage
274+
275+
```java
276+
teamApi.listJobsAsync(null).thenAccept(result -> {
277+
// TODO success callback handler
278+
System.out.println(result);
279+
}).exceptionally(exception -> {
280+
// TODO failure callback handler
281+
exception.printStackTrace();
282+
return null;
283+
});
284+
```
285+
286+
287+
# Create Job
288+
289+
Creates a job in a seller account. A job defines a title and tip eligibility. Note that
290+
compensation is defined in a [job assignment](../../doc/models/job-assignment.md) in a team member's wage setting.
291+
292+
```java
293+
CompletableFuture<CreateJobResponse> createJobAsync(
294+
final CreateJobRequest body)
295+
```
296+
297+
## Parameters
298+
299+
| Parameter | Type | Tags | Description |
300+
| --- | --- | --- | --- |
301+
| `body` | [`CreateJobRequest`](../../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. |
302+
303+
## Response Type
304+
305+
[`CreateJobResponse`](../../doc/models/create-job-response.md)
306+
307+
## Example Usage
308+
309+
```java
310+
CreateJobRequest body = new CreateJobRequest.Builder(
311+
new Job.Builder()
312+
.title("Cashier")
313+
.isTipEligible(true)
314+
.build(),
315+
"idempotency-key-0"
316+
)
317+
.build();
318+
319+
teamApi.createJobAsync(body).thenAccept(result -> {
320+
// TODO success callback handler
321+
System.out.println(result);
322+
}).exceptionally(exception -> {
323+
// TODO failure callback handler
324+
exception.printStackTrace();
325+
return null;
326+
});
327+
```
328+
329+
330+
# Retrieve Job
331+
332+
Retrieves a specified job.
333+
334+
```java
335+
CompletableFuture<RetrieveJobResponse> retrieveJobAsync(
336+
final String jobId)
337+
```
338+
339+
## Parameters
340+
341+
| Parameter | Type | Tags | Description |
342+
| --- | --- | --- | --- |
343+
| `jobId` | `String` | Template, Required | The ID of the job to retrieve. |
344+
345+
## Response Type
346+
347+
[`RetrieveJobResponse`](../../doc/models/retrieve-job-response.md)
348+
349+
## Example Usage
350+
351+
```java
352+
String jobId = "job_id2";
353+
354+
teamApi.retrieveJobAsync(jobId).thenAccept(result -> {
355+
// TODO success callback handler
356+
System.out.println(result);
357+
}).exceptionally(exception -> {
358+
// TODO failure callback handler
359+
exception.printStackTrace();
360+
return null;
361+
});
362+
```
363+
364+
365+
# Update Job
366+
367+
Updates the title or tip eligibility of a job. Changes to the title propagate to all
368+
`JobAssignment`, `Shift`, and `TeamMemberWage` objects that reference the job ID. Changes to
369+
tip eligibility propagate to all `TeamMemberWage` objects that reference the job ID.
370+
371+
```java
372+
CompletableFuture<UpdateJobResponse> updateJobAsync(
373+
final String jobId,
374+
final UpdateJobRequest body)
375+
```
376+
377+
## Parameters
378+
379+
| Parameter | Type | Tags | Description |
380+
| --- | --- | --- | --- |
381+
| `jobId` | `String` | Template, Required | The ID of the job to update. |
382+
| `body` | [`UpdateJobRequest`](../../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. |
383+
384+
## Response Type
385+
386+
[`UpdateJobResponse`](../../doc/models/update-job-response.md)
387+
388+
## Example Usage
389+
390+
```java
391+
String jobId = "job_id2";
392+
UpdateJobRequest body = new UpdateJobRequest.Builder(
393+
new Job.Builder()
394+
.title("Cashier 1")
395+
.isTipEligible(true)
396+
.build()
397+
)
398+
.build();
399+
400+
teamApi.updateJobAsync(jobId, body).thenAccept(result -> {
401+
// TODO success callback handler
402+
System.out.println(result);
403+
}).exceptionally(exception -> {
404+
// TODO failure callback handler
405+
exception.printStackTrace();
406+
return null;
407+
});
408+
```
409+
410+
226411
# Search Team Members
227412

228413
Returns a paginated list of `TeamMember` objects for a business.
229-
The list can be filtered by the following:
230-
231-
- location IDs
232-
- `status`
414+
The list can be filtered by location IDs, `ACTIVE` or `INACTIVE` status, or whether
415+
the team member is the Square account owner.
233416

234417
```java
235418
CompletableFuture<SearchTeamMembersResponse> searchTeamMembersAsync(
@@ -366,8 +549,11 @@ teamApi.updateTeamMemberAsync(teamMemberId, body).thenAccept(result -> {
366549
# Retrieve Wage Setting
367550

368551
Retrieves a `WageSetting` object for a team member specified
369-
by `TeamMember.id`.
370-
Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#retrievewagesetting).
552+
by `TeamMember.id`. For more information, see
553+
[Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#retrievewagesetting).
554+
555+
Square recommends using [RetrieveTeamMember](../../doc/api/team.md#retrieve-team-member) or [SearchTeamMembers](../../doc/api/team.md#search-team-members)
556+
to get this information directly from the `TeamMember.wage_setting` field.
371557

372558
```java
373559
CompletableFuture<RetrieveWageSettingResponse> retrieveWageSettingAsync(
@@ -403,10 +589,13 @@ teamApi.retrieveWageSettingAsync(teamMemberId).thenAccept(result -> {
403589
# Update Wage Setting
404590

405591
Creates or updates a `WageSetting` object. The object is created if a
406-
`WageSetting` with the specified `team_member_id` does not exist. Otherwise,
592+
`WageSetting` with the specified `team_member_id` doesn't exist. Otherwise,
407593
it fully replaces the `WageSetting` object for the team member.
408-
The `WageSetting` is returned on a successful update.
409-
Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#create-or-update-a-wage-setting).
594+
The `WageSetting` is returned on a successful update. For more information, see
595+
[Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#create-or-update-a-wage-setting).
596+
597+
Square recommends using [CreateTeamMember](../../doc/api/team.md#create-team-member) or [UpdateTeamMember](../../doc/api/team.md#update-team-member)
598+
to manage the `TeamMember.wage_setting` field directly.
410599

411600
```java
412601
CompletableFuture<UpdateWageSettingResponse> updateWageSettingAsync(
@@ -433,21 +622,21 @@ UpdateWageSettingRequest body = new UpdateWageSettingRequest.Builder(
433622
new WageSetting.Builder()
434623
.jobAssignments(Arrays.asList(
435624
new JobAssignment.Builder(
436-
"Manager",
437625
"SALARY"
438626
)
627+
.jobTitle("Manager")
439628
.annualRate(new Money.Builder()
440629
.amount(3000000L)
441630
.currency("USD")
442631
.build())
443632
.weeklyHours(40)
444633
.build(),
445634
new JobAssignment.Builder(
446-
"Cashier",
447635
"HOURLY"
448636
)
637+
.jobTitle("Cashier")
449638
.hourlyRate(new Money.Builder()
450-
.amount(1200L)
639+
.amount(2000L)
451640
.currency("USD")
452641
.build())
453642
.build()

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-
| `squareVersion` | `String` | Square Connect API versions<br>*Default*: `"2024-11-20"` |
8+
| `squareVersion` | `String` | Square Connect API versions<br>*Default*: `"2024-12-18"` |
99
| `customUrl` | `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
| `httpClientConfig` | [`Consumer<HttpClientConfiguration.Builder>`](http-client-configuration-builder.md) | Set up Http Client Configuration instance. |
@@ -19,7 +19,7 @@ The API client can be initialized as follows:
1919
SquareClient client = new SquareClient.Builder()
2020
.httpClientConfig(configBuilder -> configBuilder
2121
.timeout(0))
22-
.squareVersion("2024-11-20")
22+
.squareVersion("2024-12-18")
2323
.bearerAuthCredentials(new BearerAuthModel.Builder(
2424
"AccessToken"
2525
)
@@ -45,7 +45,7 @@ public class Program {
4545
SquareClient client = new SquareClient.Builder()
4646
.httpClientConfig(configBuilder -> configBuilder
4747
.timeout(0))
48-
.squareVersion("2024-11-20")
48+
.squareVersion("2024-12-18")
4949
.bearerAuthCredentials(new BearerAuthModel.Builder(
5050
"AccessToken"
5151
)

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 | Getter |
1313
| --- | --- | --- | --- | --- |
14-
| `TeamMembers` | [`Map<String, CreateTeamMemberRequest>`](../../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. | Map<String, CreateTeamMemberRequest> getTeamMembers() |
14+
| `TeamMembers` | [`Map<String, CreateTeamMemberRequest>`](../../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). | Map<String, CreateTeamMemberRequest> getTeamMembers() |
1515

1616
## Example (as JSON)
1717

0 commit comments

Comments
 (0)