|
| 1 | +# Payouts |
| 2 | + |
| 3 | +```java |
| 4 | +PayoutsApi payoutsApi = client.getPayoutsApi(); |
| 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 | +```java |
| 25 | +CompletableFuture<ListPayoutsResponse> listPayoutsAsync( |
| 26 | + final String locationId, |
| 27 | + final String status, |
| 28 | + final String beginTime, |
| 29 | + final String endTime, |
| 30 | + final String sortOrder, |
| 31 | + final String cursor, |
| 32 | + final Integer limit) |
| 33 | +``` |
| 34 | + |
| 35 | +## Parameters |
| 36 | + |
| 37 | +| Parameter | Type | Tags | Description | |
| 38 | +| --- | --- | --- | --- | |
| 39 | +| `locationId` | `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. | |
| 40 | +| `status` | [`String`](../../doc/models/payout-status.md) | Query, Optional | If provided, only payouts with the given status are returned. | |
| 41 | +| `beginTime` | `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. | |
| 42 | +| `endTime` | `String` | Query, Optional | The timestamp for the end of the payout creation time, in RFC 3339 format.<br>Default: The current time. | |
| 43 | +| `sortOrder` | [`String`](../../doc/models/sort-order.md) | Query, Optional | The order in which payouts are listed. | |
| 44 | +| `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. | |
| 45 | +| `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` | |
| 46 | + |
| 47 | +## Response Type |
| 48 | + |
| 49 | +[`ListPayoutsResponse`](../../doc/models/list-payouts-response.md) |
| 50 | + |
| 51 | +## Example Usage |
| 52 | + |
| 53 | +```java |
| 54 | +String locationId = "location_id4"; |
| 55 | +String status = "PAID"; |
| 56 | +String beginTime = "begin_time2"; |
| 57 | +String endTime = "end_time2"; |
| 58 | +String sortOrder = "DESC"; |
| 59 | +String cursor = "cursor6"; |
| 60 | +Integer limit = 172; |
| 61 | + |
| 62 | +payoutsApi.listPayoutsAsync(locationId, status, beginTime, endTime, sortOrder, cursor, limit).thenAccept(result -> { |
| 63 | + // TODO success callback handler |
| 64 | +}).exceptionally(exception -> { |
| 65 | + // TODO failure callback handler |
| 66 | + return null; |
| 67 | +}); |
| 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 | +```java |
| 77 | +CompletableFuture<GetPayoutResponse> getPayoutAsync( |
| 78 | + final String payoutId) |
| 79 | +``` |
| 80 | + |
| 81 | +## Parameters |
| 82 | + |
| 83 | +| Parameter | Type | Tags | Description | |
| 84 | +| --- | --- | --- | --- | |
| 85 | +| `payoutId` | `String` | Template, Required | The ID of the payout to retrieve the information for. | |
| 86 | + |
| 87 | +## Response Type |
| 88 | + |
| 89 | +[`GetPayoutResponse`](../../doc/models/get-payout-response.md) |
| 90 | + |
| 91 | +## Example Usage |
| 92 | + |
| 93 | +```java |
| 94 | +String payoutId = "payout_id6"; |
| 95 | + |
| 96 | +payoutsApi.getPayoutAsync(payoutId).thenAccept(result -> { |
| 97 | + // TODO success callback handler |
| 98 | +}).exceptionally(exception -> { |
| 99 | + // TODO failure callback handler |
| 100 | + return null; |
| 101 | +}); |
| 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 | +```java |
| 111 | +CompletableFuture<ListPayoutEntriesResponse> listPayoutEntriesAsync( |
| 112 | + final String payoutId, |
| 113 | + final String sortOrder, |
| 114 | + final String cursor, |
| 115 | + final Integer limit) |
| 116 | +``` |
| 117 | + |
| 118 | +## Parameters |
| 119 | + |
| 120 | +| Parameter | Type | Tags | Description | |
| 121 | +| --- | --- | --- | --- | |
| 122 | +| `payoutId` | `String` | Template, Required | The ID of the payout to retrieve the information for. | |
| 123 | +| `sortOrder` | [`String`](../../doc/models/sort-order.md) | Query, Optional | The order in which payout entries are listed. | |
| 124 | +| `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. | |
| 125 | +| `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` | |
| 126 | + |
| 127 | +## Response Type |
| 128 | + |
| 129 | +[`ListPayoutEntriesResponse`](../../doc/models/list-payout-entries-response.md) |
| 130 | + |
| 131 | +## Example Usage |
| 132 | + |
| 133 | +```java |
| 134 | +String payoutId = "payout_id6"; |
| 135 | +String sortOrder = "DESC"; |
| 136 | +String cursor = "cursor6"; |
| 137 | +Integer limit = 172; |
| 138 | + |
| 139 | +payoutsApi.listPayoutEntriesAsync(payoutId, sortOrder, cursor, limit).thenAccept(result -> { |
| 140 | + // TODO success callback handler |
| 141 | +}).exceptionally(exception -> { |
| 142 | + // TODO failure callback handler |
| 143 | + return null; |
| 144 | +}); |
| 145 | +``` |
| 146 | + |
0 commit comments