• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stripe / stripe-java / #16644

14 Nov 2024 11:58PM UTC coverage: 12.414% (-0.005%) from 12.419%
#16644

push

github

web-flow
Update generated code for beta (#1922)

* Update generated code for v1334

* Update generated code for v1335

* Update generated code for v1337

* Update generated code for v1339

* Update generated code for v1340

* Update generated code for v1343

* Update generated code for v1345

* Update generated code for v1346

* Update generated code for v1347

* Update generated code for v1348

* Update generated code for v1349

* Update generated code for v1350

* Update generated code for v1352

* Update generated code for v1353

* Update generated code for v1356

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>

2 of 79 new or added lines in 17 files covered. (2.53%)

1 existing line in 1 file now uncovered.

18857 of 151907 relevant lines covered (12.41%)

0.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

55.08
/src/main/java/com/stripe/model/Payout.java
1
// File generated from our OpenAPI spec
2
package com.stripe.model;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.exception.StripeException;
6
import com.stripe.net.ApiRequest;
7
import com.stripe.net.ApiRequestParams;
8
import com.stripe.net.ApiResource;
9
import com.stripe.net.BaseAddress;
10
import com.stripe.net.RequestOptions;
11
import com.stripe.net.StripeResponseGetter;
12
import com.stripe.param.PayoutCancelParams;
13
import com.stripe.param.PayoutCreateParams;
14
import com.stripe.param.PayoutListParams;
15
import com.stripe.param.PayoutRetrieveParams;
16
import com.stripe.param.PayoutReverseParams;
17
import com.stripe.param.PayoutUpdateParams;
18
import java.util.Map;
19
import lombok.EqualsAndHashCode;
20
import lombok.Getter;
21
import lombok.Setter;
22

23
/**
24
 * A {@code Payout} object is created when you receive funds from Stripe, or when you initiate a
25
 * payout to either a bank account or debit card of a <a
26
 * href="https://stripe.com/docs/connect/bank-debit-card-payouts">connected Stripe account</a>. You
27
 * can retrieve individual payouts, and list all payouts. Payouts are made on <a
28
 * href="https://stripe.com/docs/connect/manage-payout-schedule">varying schedules</a>, depending on
29
 * your country and industry.
30
 *
31
 * <p>Related guide: <a href="https://stripe.com/docs/payouts">Receiving payouts</a>
32
 */
33
@Getter
34
@Setter
35
@EqualsAndHashCode(callSuper = false)
36
public class Payout extends ApiResource implements MetadataStore<Payout>, BalanceTransactionSource {
1✔
37
  /**
38
   * The amount (in cents (or local equivalent)) that transfers to your bank account or debit card.
39
   */
40
  @SerializedName("amount")
41
  Long amount;
42

43
  /**
44
   * The application fee (if any) for the payout. <a
45
   * href="https://stripe.com/docs/connect/instant-payouts#monetization-and-fees">See the Connect
46
   * documentation</a> for details.
47
   */
48
  @SerializedName("application_fee")
49
  @Getter(lombok.AccessLevel.NONE)
50
  @Setter(lombok.AccessLevel.NONE)
51
  ExpandableField<ApplicationFee> applicationFee;
52

53
  /**
54
   * The amount of the application fee (if any) requested for the payout. <a
55
   * href="https://stripe.com/docs/connect/instant-payouts#monetization-and-fees">See the Connect
56
   * documentation</a> for details.
57
   */
58
  @SerializedName("application_fee_amount")
59
  Long applicationFeeAmount;
60

61
  /**
62
   * Date that you can expect the payout to arrive in the bank. This factors in delays to account
63
   * for weekends or bank holidays.
64
   */
65
  @SerializedName("arrival_date")
66
  Long arrivalDate;
67

68
  /**
69
   * Returns {@code true} if the payout is created by an <a
70
   * href="https://stripe.com/docs/payouts#payout-schedule">automated payout schedule</a> and {@code
71
   * false} if it's <a href="https://stripe.com/docs/payouts#manual-payouts">requested manually</a>.
72
   */
73
  @SerializedName("automatic")
74
  Boolean automatic;
75

76
  /**
77
   * ID of the balance transaction that describes the impact of this payout on your account balance.
78
   */
79
  @SerializedName("balance_transaction")
80
  @Getter(lombok.AccessLevel.NONE)
81
  @Setter(lombok.AccessLevel.NONE)
82
  ExpandableField<BalanceTransaction> balanceTransaction;
83

84
  /** Time at which the object was created. Measured in seconds since the Unix epoch. */
85
  @SerializedName("created")
86
  Long created;
87

88
  /**
89
   * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>,
90
   * in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
91
   */
92
  @SerializedName("currency")
93
  String currency;
94

95
  /** An arbitrary string attached to the object. Often useful for displaying to users. */
96
  @SerializedName("description")
97
  String description;
98

99
  /** ID of the bank account or card the payout is sent to. */
100
  @SerializedName("destination")
101
  @Getter(lombok.AccessLevel.NONE)
102
  @Setter(lombok.AccessLevel.NONE)
103
  ExpandableField<ExternalAccount> destination;
104

105
  /**
106
   * If the payout fails or cancels, this is the ID of the balance transaction that reverses the
107
   * initial balance transaction and returns the funds from the failed payout back in your balance.
108
   */
109
  @SerializedName("failure_balance_transaction")
110
  @Getter(lombok.AccessLevel.NONE)
111
  @Setter(lombok.AccessLevel.NONE)
112
  ExpandableField<BalanceTransaction> failureBalanceTransaction;
113

114
  /**
115
   * Error code that provides a reason for a payout failure, if available. View our <a
116
   * href="https://stripe.com/docs/api#payout_failures">list of failure codes</a>.
117
   */
118
  @SerializedName("failure_code")
119
  String failureCode;
120

121
  /** Message that provides the reason for a payout failure, if available. */
122
  @SerializedName("failure_message")
123
  String failureMessage;
124

125
  /** Unique identifier for the object. */
126
  @Getter(onMethod_ = {@Override})
127
  @SerializedName("id")
128
  String id;
129

130
  /**
131
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
132
   * object exists in test mode.
133
   */
134
  @SerializedName("livemode")
135
  Boolean livemode;
136

137
  /**
138
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
139
   * to an object. This can be useful for storing additional information about the object in a
140
   * structured format.
141
   */
142
  @Getter(onMethod_ = {@Override})
143
  @SerializedName("metadata")
144
  Map<String, String> metadata;
145

146
  /**
147
   * The method used to send this payout, which can be {@code standard} or {@code instant}. {@code
148
   * instant} is supported for payouts to debit cards and bank accounts in certain countries. Learn
149
   * more about <a href="https://stripe.com/docs/payouts/instant-payouts-banks">bank support for
150
   * Instant Payouts</a>.
151
   */
152
  @SerializedName("method")
153
  String method;
154

155
  /**
156
   * String representing the object's type. Objects of the same type share the same value.
157
   *
158
   * <p>Equal to {@code payout}.
159
   */
160
  @SerializedName("object")
161
  String object;
162

163
  /** If the payout reverses another, this is the ID of the original payout. */
164
  @SerializedName("original_payout")
165
  @Getter(lombok.AccessLevel.NONE)
166
  @Setter(lombok.AccessLevel.NONE)
167
  ExpandableField<Payout> originalPayout;
168

169
  /**
170
   * If {@code completed}, you can use the <a
171
   * href="https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout">Balance
172
   * Transactions API</a> to list all balance transactions that are paid out in this payout.
173
   *
174
   * <p>One of {@code completed}, {@code in_progress}, or {@code not_applicable}.
175
   */
176
  @SerializedName("reconciliation_status")
177
  String reconciliationStatus;
178

179
  /** If the payout reverses, this is the ID of the payout that reverses this payout. */
180
  @SerializedName("reversed_by")
181
  @Getter(lombok.AccessLevel.NONE)
182
  @Setter(lombok.AccessLevel.NONE)
183
  ExpandableField<Payout> reversedBy;
184

185
  /**
186
   * The source balance this payout came from, which can be one of the following: {@code card},
187
   * {@code fpx}, or {@code bank_account}.
188
   */
189
  @SerializedName("source_type")
190
  String sourceType;
191

192
  /** Extra information about a payout that displays on the user's bank statement. */
193
  @SerializedName("statement_descriptor")
194
  String statementDescriptor;
195

196
  /**
197
   * Current status of the payout: {@code paid}, {@code pending}, {@code in_transit}, {@code
198
   * canceled} or {@code failed}. A payout is {@code pending} until it's submitted to the bank, when
199
   * it becomes {@code in_transit}. The status changes to {@code paid} if the transaction succeeds,
200
   * or to {@code failed} or {@code canceled} (within 5 business days). Some payouts that fail might
201
   * initially show as {@code paid}, then change to {@code failed}.
202
   */
203
  @SerializedName("status")
204
  String status;
205

206
  /**
207
   * A value that generates from the beneficiary's bank that allows users to track payouts with
208
   * their bank. Banks might call this a &quot;reference number&quot; or something similar.
209
   */
210
  @SerializedName("trace_id")
211
  TraceId traceId;
212

213
  /** Can be {@code bank_account} or {@code card}. */
214
  @SerializedName("type")
215
  String type;
216

217
  /** Get ID of expandable {@code applicationFee} object. */
218
  public String getApplicationFee() {
219
    return (this.applicationFee != null) ? this.applicationFee.getId() : null;
×
220
  }
221

222
  public void setApplicationFee(String id) {
223
    this.applicationFee = ApiResource.setExpandableFieldId(id, this.applicationFee);
×
224
  }
×
225

226
  /** Get expanded {@code applicationFee}. */
227
  public ApplicationFee getApplicationFeeObject() {
228
    return (this.applicationFee != null) ? this.applicationFee.getExpanded() : null;
×
229
  }
230

231
  public void setApplicationFeeObject(ApplicationFee expandableObject) {
232
    this.applicationFee =
×
233
        new ExpandableField<ApplicationFee>(expandableObject.getId(), expandableObject);
×
234
  }
×
235

236
  /** Get ID of expandable {@code balanceTransaction} object. */
237
  public String getBalanceTransaction() {
238
    return (this.balanceTransaction != null) ? this.balanceTransaction.getId() : null;
×
239
  }
240

241
  public void setBalanceTransaction(String id) {
242
    this.balanceTransaction = ApiResource.setExpandableFieldId(id, this.balanceTransaction);
×
243
  }
×
244

245
  /** Get expanded {@code balanceTransaction}. */
246
  public BalanceTransaction getBalanceTransactionObject() {
247
    return (this.balanceTransaction != null) ? this.balanceTransaction.getExpanded() : null;
×
248
  }
249

250
  public void setBalanceTransactionObject(BalanceTransaction expandableObject) {
251
    this.balanceTransaction =
×
252
        new ExpandableField<BalanceTransaction>(expandableObject.getId(), expandableObject);
×
253
  }
×
254

255
  /** Get ID of expandable {@code destination} object. */
256
  public String getDestination() {
257
    return (this.destination != null) ? this.destination.getId() : null;
×
258
  }
259

260
  public void setDestination(String id) {
261
    this.destination = ApiResource.setExpandableFieldId(id, this.destination);
×
262
  }
×
263

264
  /** Get expanded {@code destination}. */
265
  public ExternalAccount getDestinationObject() {
266
    return (this.destination != null) ? this.destination.getExpanded() : null;
1✔
267
  }
268

269
  public void setDestinationObject(ExternalAccount expandableObject) {
270
    this.destination =
×
271
        new ExpandableField<ExternalAccount>(expandableObject.getId(), expandableObject);
×
272
  }
×
273

274
  /** Get ID of expandable {@code failureBalanceTransaction} object. */
275
  public String getFailureBalanceTransaction() {
276
    return (this.failureBalanceTransaction != null) ? this.failureBalanceTransaction.getId() : null;
×
277
  }
278

279
  public void setFailureBalanceTransaction(String id) {
280
    this.failureBalanceTransaction =
×
281
        ApiResource.setExpandableFieldId(id, this.failureBalanceTransaction);
×
282
  }
×
283

284
  /** Get expanded {@code failureBalanceTransaction}. */
285
  public BalanceTransaction getFailureBalanceTransactionObject() {
286
    return (this.failureBalanceTransaction != null)
×
287
        ? this.failureBalanceTransaction.getExpanded()
×
288
        : null;
×
289
  }
290

291
  public void setFailureBalanceTransactionObject(BalanceTransaction expandableObject) {
292
    this.failureBalanceTransaction =
×
293
        new ExpandableField<BalanceTransaction>(expandableObject.getId(), expandableObject);
×
294
  }
×
295

296
  /** Get ID of expandable {@code originalPayout} object. */
297
  public String getOriginalPayout() {
298
    return (this.originalPayout != null) ? this.originalPayout.getId() : null;
×
299
  }
300

301
  public void setOriginalPayout(String id) {
302
    this.originalPayout = ApiResource.setExpandableFieldId(id, this.originalPayout);
×
303
  }
×
304

305
  /** Get expanded {@code originalPayout}. */
306
  public Payout getOriginalPayoutObject() {
307
    return (this.originalPayout != null) ? this.originalPayout.getExpanded() : null;
×
308
  }
309

310
  public void setOriginalPayoutObject(Payout expandableObject) {
311
    this.originalPayout = new ExpandableField<Payout>(expandableObject.getId(), expandableObject);
×
312
  }
×
313

314
  /** Get ID of expandable {@code reversedBy} object. */
315
  public String getReversedBy() {
316
    return (this.reversedBy != null) ? this.reversedBy.getId() : null;
×
317
  }
318

319
  public void setReversedBy(String id) {
320
    this.reversedBy = ApiResource.setExpandableFieldId(id, this.reversedBy);
×
321
  }
×
322

323
  /** Get expanded {@code reversedBy}. */
324
  public Payout getReversedByObject() {
325
    return (this.reversedBy != null) ? this.reversedBy.getExpanded() : null;
×
326
  }
327

328
  public void setReversedByObject(Payout expandableObject) {
329
    this.reversedBy = new ExpandableField<Payout>(expandableObject.getId(), expandableObject);
×
330
  }
×
331

332
  /**
333
   * You can cancel a previously created payout if its status is {@code pending}. Stripe refunds the
334
   * funds to your available balance. You can’t cancel automatic Stripe payouts.
335
   */
336
  public Payout cancel() throws StripeException {
337
    return cancel((Map<String, Object>) null, (RequestOptions) null);
1✔
338
  }
339

340
  /**
341
   * You can cancel a previously created payout if its status is {@code pending}. Stripe refunds the
342
   * funds to your available balance. You can’t cancel automatic Stripe payouts.
343
   */
344
  public Payout cancel(RequestOptions options) throws StripeException {
345
    return cancel((Map<String, Object>) null, options);
×
346
  }
347

348
  /**
349
   * You can cancel a previously created payout if its status is {@code pending}. Stripe refunds the
350
   * funds to your available balance. You can’t cancel automatic Stripe payouts.
351
   */
352
  public Payout cancel(Map<String, Object> params) throws StripeException {
353
    return cancel(params, (RequestOptions) null);
×
354
  }
355

356
  /**
357
   * You can cancel a previously created payout if its status is {@code pending}. Stripe refunds the
358
   * funds to your available balance. You can’t cancel automatic Stripe payouts.
359
   */
360
  public Payout cancel(Map<String, Object> params, RequestOptions options) throws StripeException {
361
    String path = String.format("/v1/payouts/%s/cancel", ApiResource.urlEncodeId(this.getId()));
1✔
362
    ApiRequest request =
1✔
363
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
364
    return getResponseGetter().request(request, Payout.class);
1✔
365
  }
366

367
  /**
368
   * You can cancel a previously created payout if its status is {@code pending}. Stripe refunds the
369
   * funds to your available balance. You can’t cancel automatic Stripe payouts.
370
   */
371
  public Payout cancel(PayoutCancelParams params) throws StripeException {
372
    return cancel(params, (RequestOptions) null);
1✔
373
  }
374

375
  /**
376
   * You can cancel a previously created payout if its status is {@code pending}. Stripe refunds the
377
   * funds to your available balance. You can’t cancel automatic Stripe payouts.
378
   */
379
  public Payout cancel(PayoutCancelParams params, RequestOptions options) throws StripeException {
380
    String path = String.format("/v1/payouts/%s/cancel", ApiResource.urlEncodeId(this.getId()));
1✔
381
    ApiResource.checkNullTypedParams(path, params);
1✔
382
    ApiRequest request =
1✔
383
        new ApiRequest(
384
            BaseAddress.API,
385
            ApiResource.RequestMethod.POST,
386
            path,
387
            ApiRequestParams.paramsToMap(params),
1✔
388
            options);
389
    return getResponseGetter().request(request, Payout.class);
1✔
390
  }
391

392
  /**
393
   * To send funds to your own bank account, create a new payout object. Your <a
394
   * href="https://stripe.com/docs/api#balance">Stripe balance</a> must cover the payout amount. If
395
   * it doesn’t, you receive an “Insufficient Funds” error.
396
   *
397
   * <p>If your API key is in test mode, money won’t actually be sent, though every other action
398
   * occurs as if you’re in live mode.
399
   *
400
   * <p>If you create a manual payout on a Stripe account that uses multiple payment source types,
401
   * you need to specify the source type balance that the payout draws from. The <a
402
   * href="https://stripe.com/docs/api#balance_object">balance object</a> details available and
403
   * pending amounts by source type.
404
   */
405
  public static Payout create(Map<String, Object> params) throws StripeException {
406
    return create(params, (RequestOptions) null);
1✔
407
  }
408

409
  /**
410
   * To send funds to your own bank account, create a new payout object. Your <a
411
   * href="https://stripe.com/docs/api#balance">Stripe balance</a> must cover the payout amount. If
412
   * it doesn’t, you receive an “Insufficient Funds” error.
413
   *
414
   * <p>If your API key is in test mode, money won’t actually be sent, though every other action
415
   * occurs as if you’re in live mode.
416
   *
417
   * <p>If you create a manual payout on a Stripe account that uses multiple payment source types,
418
   * you need to specify the source type balance that the payout draws from. The <a
419
   * href="https://stripe.com/docs/api#balance_object">balance object</a> details available and
420
   * pending amounts by source type.
421
   */
422
  public static Payout create(Map<String, Object> params, RequestOptions options)
423
      throws StripeException {
424
    String path = "/v1/payouts";
1✔
425
    ApiRequest request =
1✔
426
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
427
    return getGlobalResponseGetter().request(request, Payout.class);
1✔
428
  }
429

430
  /**
431
   * To send funds to your own bank account, create a new payout object. Your <a
432
   * href="https://stripe.com/docs/api#balance">Stripe balance</a> must cover the payout amount. If
433
   * it doesn’t, you receive an “Insufficient Funds” error.
434
   *
435
   * <p>If your API key is in test mode, money won’t actually be sent, though every other action
436
   * occurs as if you’re in live mode.
437
   *
438
   * <p>If you create a manual payout on a Stripe account that uses multiple payment source types,
439
   * you need to specify the source type balance that the payout draws from. The <a
440
   * href="https://stripe.com/docs/api#balance_object">balance object</a> details available and
441
   * pending amounts by source type.
442
   */
443
  public static Payout create(PayoutCreateParams params) throws StripeException {
444
    return create(params, (RequestOptions) null);
1✔
445
  }
446

447
  /**
448
   * To send funds to your own bank account, create a new payout object. Your <a
449
   * href="https://stripe.com/docs/api#balance">Stripe balance</a> must cover the payout amount. If
450
   * it doesn’t, you receive an “Insufficient Funds” error.
451
   *
452
   * <p>If your API key is in test mode, money won’t actually be sent, though every other action
453
   * occurs as if you’re in live mode.
454
   *
455
   * <p>If you create a manual payout on a Stripe account that uses multiple payment source types,
456
   * you need to specify the source type balance that the payout draws from. The <a
457
   * href="https://stripe.com/docs/api#balance_object">balance object</a> details available and
458
   * pending amounts by source type.
459
   */
460
  public static Payout create(PayoutCreateParams params, RequestOptions options)
461
      throws StripeException {
462
    String path = "/v1/payouts";
1✔
463
    ApiResource.checkNullTypedParams(path, params);
1✔
464
    ApiRequest request =
1✔
465
        new ApiRequest(
466
            BaseAddress.API,
467
            ApiResource.RequestMethod.POST,
468
            path,
469
            ApiRequestParams.paramsToMap(params),
1✔
470
            options);
471
    return getGlobalResponseGetter().request(request, Payout.class);
1✔
472
  }
473

474
  /**
475
   * Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe
476
   * sent to you. The payouts return in sorted order, with the most recently created payouts
477
   * appearing first.
478
   */
479
  public static PayoutCollection list(Map<String, Object> params) throws StripeException {
480
    return list(params, (RequestOptions) null);
1✔
481
  }
482

483
  /**
484
   * Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe
485
   * sent to you. The payouts return in sorted order, with the most recently created payouts
486
   * appearing first.
487
   */
488
  public static PayoutCollection list(Map<String, Object> params, RequestOptions options)
489
      throws StripeException {
490
    String path = "/v1/payouts";
1✔
491
    ApiRequest request =
1✔
492
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
493
    return getGlobalResponseGetter().request(request, PayoutCollection.class);
1✔
494
  }
495

496
  /**
497
   * Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe
498
   * sent to you. The payouts return in sorted order, with the most recently created payouts
499
   * appearing first.
500
   */
501
  public static PayoutCollection list(PayoutListParams params) throws StripeException {
502
    return list(params, (RequestOptions) null);
1✔
503
  }
504

505
  /**
506
   * Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe
507
   * sent to you. The payouts return in sorted order, with the most recently created payouts
508
   * appearing first.
509
   */
510
  public static PayoutCollection list(PayoutListParams params, RequestOptions options)
511
      throws StripeException {
512
    String path = "/v1/payouts";
1✔
513
    ApiResource.checkNullTypedParams(path, params);
1✔
514
    ApiRequest request =
1✔
515
        new ApiRequest(
516
            BaseAddress.API,
517
            ApiResource.RequestMethod.GET,
518
            path,
519
            ApiRequestParams.paramsToMap(params),
1✔
520
            options);
521
    return getGlobalResponseGetter().request(request, PayoutCollection.class);
1✔
522
  }
523

524
  /**
525
   * Retrieves the details of an existing payout. Supply the unique payout ID from either a payout
526
   * creation request or the payout list. Stripe returns the corresponding payout information.
527
   */
528
  public static Payout retrieve(String payout) throws StripeException {
529
    return retrieve(payout, (Map<String, Object>) null, (RequestOptions) null);
1✔
530
  }
531

532
  /**
533
   * Retrieves the details of an existing payout. Supply the unique payout ID from either a payout
534
   * creation request or the payout list. Stripe returns the corresponding payout information.
535
   */
536
  public static Payout retrieve(String payout, RequestOptions options) throws StripeException {
537
    return retrieve(payout, (Map<String, Object>) null, options);
×
538
  }
539

540
  /**
541
   * Retrieves the details of an existing payout. Supply the unique payout ID from either a payout
542
   * creation request or the payout list. Stripe returns the corresponding payout information.
543
   */
544
  public static Payout retrieve(String payout, Map<String, Object> params, RequestOptions options)
545
      throws StripeException {
546
    String path = String.format("/v1/payouts/%s", ApiResource.urlEncodeId(payout));
1✔
547
    ApiRequest request =
1✔
548
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
549
    return getGlobalResponseGetter().request(request, Payout.class);
1✔
550
  }
551

552
  /**
553
   * Retrieves the details of an existing payout. Supply the unique payout ID from either a payout
554
   * creation request or the payout list. Stripe returns the corresponding payout information.
555
   */
556
  public static Payout retrieve(String payout, PayoutRetrieveParams params, RequestOptions options)
557
      throws StripeException {
558
    String path = String.format("/v1/payouts/%s", ApiResource.urlEncodeId(payout));
×
559
    ApiResource.checkNullTypedParams(path, params);
×
560
    ApiRequest request =
×
561
        new ApiRequest(
562
            BaseAddress.API,
563
            ApiResource.RequestMethod.GET,
564
            path,
565
            ApiRequestParams.paramsToMap(params),
×
566
            options);
567
    return getGlobalResponseGetter().request(request, Payout.class);
×
568
  }
569

570
  /**
571
   * Reverses a payout by debiting the destination bank account. At this time, you can only reverse
572
   * payouts for connected accounts to US bank accounts. If the payout is manual and in the {@code
573
   * pending} status, use {@code /v1/payouts/:id/cancel} instead.
574
   *
575
   * <p>By requesting a reversal through {@code /v1/payouts/:id/reverse}, you confirm that the
576
   * authorized signatory of the selected bank account authorizes the debit on the bank account and
577
   * that no other authorization is required.
578
   */
579
  public Payout reverse() throws StripeException {
580
    return reverse((Map<String, Object>) null, (RequestOptions) null);
1✔
581
  }
582

583
  /**
584
   * Reverses a payout by debiting the destination bank account. At this time, you can only reverse
585
   * payouts for connected accounts to US bank accounts. If the payout is manual and in the {@code
586
   * pending} status, use {@code /v1/payouts/:id/cancel} instead.
587
   *
588
   * <p>By requesting a reversal through {@code /v1/payouts/:id/reverse}, you confirm that the
589
   * authorized signatory of the selected bank account authorizes the debit on the bank account and
590
   * that no other authorization is required.
591
   */
592
  public Payout reverse(RequestOptions options) throws StripeException {
593
    return reverse((Map<String, Object>) null, options);
×
594
  }
595

596
  /**
597
   * Reverses a payout by debiting the destination bank account. At this time, you can only reverse
598
   * payouts for connected accounts to US bank accounts. If the payout is manual and in the {@code
599
   * pending} status, use {@code /v1/payouts/:id/cancel} instead.
600
   *
601
   * <p>By requesting a reversal through {@code /v1/payouts/:id/reverse}, you confirm that the
602
   * authorized signatory of the selected bank account authorizes the debit on the bank account and
603
   * that no other authorization is required.
604
   */
605
  public Payout reverse(Map<String, Object> params) throws StripeException {
606
    return reverse(params, (RequestOptions) null);
×
607
  }
608

609
  /**
610
   * Reverses a payout by debiting the destination bank account. At this time, you can only reverse
611
   * payouts for connected accounts to US bank accounts. If the payout is manual and in the {@code
612
   * pending} status, use {@code /v1/payouts/:id/cancel} instead.
613
   *
614
   * <p>By requesting a reversal through {@code /v1/payouts/:id/reverse}, you confirm that the
615
   * authorized signatory of the selected bank account authorizes the debit on the bank account and
616
   * that no other authorization is required.
617
   */
618
  public Payout reverse(Map<String, Object> params, RequestOptions options) throws StripeException {
619
    String path = String.format("/v1/payouts/%s/reverse", ApiResource.urlEncodeId(this.getId()));
1✔
620
    ApiRequest request =
1✔
621
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
622
    return getResponseGetter().request(request, Payout.class);
1✔
623
  }
624

625
  /**
626
   * Reverses a payout by debiting the destination bank account. At this time, you can only reverse
627
   * payouts for connected accounts to US bank accounts. If the payout is manual and in the {@code
628
   * pending} status, use {@code /v1/payouts/:id/cancel} instead.
629
   *
630
   * <p>By requesting a reversal through {@code /v1/payouts/:id/reverse}, you confirm that the
631
   * authorized signatory of the selected bank account authorizes the debit on the bank account and
632
   * that no other authorization is required.
633
   */
634
  public Payout reverse(PayoutReverseParams params) throws StripeException {
635
    return reverse(params, (RequestOptions) null);
1✔
636
  }
637

638
  /**
639
   * Reverses a payout by debiting the destination bank account. At this time, you can only reverse
640
   * payouts for connected accounts to US bank accounts. If the payout is manual and in the {@code
641
   * pending} status, use {@code /v1/payouts/:id/cancel} instead.
642
   *
643
   * <p>By requesting a reversal through {@code /v1/payouts/:id/reverse}, you confirm that the
644
   * authorized signatory of the selected bank account authorizes the debit on the bank account and
645
   * that no other authorization is required.
646
   */
647
  public Payout reverse(PayoutReverseParams params, RequestOptions options) throws StripeException {
648
    String path = String.format("/v1/payouts/%s/reverse", ApiResource.urlEncodeId(this.getId()));
1✔
649
    ApiResource.checkNullTypedParams(path, params);
1✔
650
    ApiRequest request =
1✔
651
        new ApiRequest(
652
            BaseAddress.API,
653
            ApiResource.RequestMethod.POST,
654
            path,
655
            ApiRequestParams.paramsToMap(params),
1✔
656
            options);
657
    return getResponseGetter().request(request, Payout.class);
1✔
658
  }
659

660
  /**
661
   * Updates the specified payout by setting the values of the parameters you pass. We don’t change
662
   * parameters that you don’t provide. This request only accepts the metadata as arguments.
663
   */
664
  @Override
665
  public Payout update(Map<String, Object> params) throws StripeException {
666
    return update(params, (RequestOptions) null);
1✔
667
  }
668

669
  /**
670
   * Updates the specified payout by setting the values of the parameters you pass. We don’t change
671
   * parameters that you don’t provide. This request only accepts the metadata as arguments.
672
   */
673
  @Override
674
  public Payout update(Map<String, Object> params, RequestOptions options) throws StripeException {
675
    String path = String.format("/v1/payouts/%s", ApiResource.urlEncodeId(this.getId()));
1✔
676
    ApiRequest request =
1✔
677
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
678
    return getResponseGetter().request(request, Payout.class);
1✔
679
  }
680

681
  /**
682
   * Updates the specified payout by setting the values of the parameters you pass. We don’t change
683
   * parameters that you don’t provide. This request only accepts the metadata as arguments.
684
   */
685
  public Payout update(PayoutUpdateParams params) throws StripeException {
686
    return update(params, (RequestOptions) null);
1✔
687
  }
688

689
  /**
690
   * Updates the specified payout by setting the values of the parameters you pass. We don’t change
691
   * parameters that you don’t provide. This request only accepts the metadata as arguments.
692
   */
693
  public Payout update(PayoutUpdateParams params, RequestOptions options) throws StripeException {
694
    String path = String.format("/v1/payouts/%s", ApiResource.urlEncodeId(this.getId()));
1✔
695
    ApiResource.checkNullTypedParams(path, params);
1✔
696
    ApiRequest request =
1✔
697
        new ApiRequest(
698
            BaseAddress.API,
699
            ApiResource.RequestMethod.POST,
700
            path,
701
            ApiRequestParams.paramsToMap(params),
1✔
702
            options);
703
    return getResponseGetter().request(request, Payout.class);
1✔
704
  }
705

706
  /**
707
   * For more details about TraceId, please refer to the <a href="https://docs.stripe.com/api">API
708
   * Reference.</a>
709
   */
710
  @Getter
711
  @Setter
712
  @EqualsAndHashCode(callSuper = false)
NEW
713
  public static class TraceId extends StripeObject {
×
714
    /**
715
     * Possible values are {@code pending}, {@code supported}, and {@code unsupported}. When {@code
716
     * payout.status} is {@code pending} or {@code in_transit}, this will be {@code pending}. When
717
     * the payout transitions to {@code paid}, {@code failed}, or {@code canceled}, this status will
718
     * become {@code supported} or {@code unsupported} shortly after in most cases. In some cases,
719
     * this may appear as {@code pending} for up to 10 days after {@code arrival_date} until
720
     * transitioning to {@code supported} or {@code unsupported}.
721
     */
722
    @SerializedName("status")
723
    String status;
724

725
    /**
726
     * The trace ID value if {@code trace_id.status} is {@code supported}, otherwise {@code nil}.
727
     */
728
    @SerializedName("value")
729
    String value;
730
  }
731

732
  @Override
733
  public void setResponseGetter(StripeResponseGetter responseGetter) {
734
    super.setResponseGetter(responseGetter);
1✔
735
    trySetResponseGetter(applicationFee, responseGetter);
1✔
736
    trySetResponseGetter(balanceTransaction, responseGetter);
1✔
737
    trySetResponseGetter(destination, responseGetter);
1✔
738
    trySetResponseGetter(failureBalanceTransaction, responseGetter);
1✔
739
    trySetResponseGetter(originalPayout, responseGetter);
1✔
740
    trySetResponseGetter(reversedBy, responseGetter);
1✔
741
    trySetResponseGetter(traceId, responseGetter);
1✔
742
  }
1✔
743
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc