Android™ Stripe: Retrieve a Payout

Back to Index

Retrieves the details of an existing payout. Supply the unique payout ID from either a payout creation request or the payout list, and Stripe will return the corresponding payout information.

Documentation: https://stripe.com/docs/api/curl#retrieve_payout

CURL Command

curl https://api.stripe.com/v1/payouts/po_1BnETKGswQrCoh0XeUopRyDR \
   -u STRIPE_SECRET_KEY:

Android™ Example

// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;

import android.app.Activity;
import com.chilkatsoft.*;

import android.widget.TextView;
import android.os.Bundle;

public class SimpleActivity extends Activity {

  private static final String TAG = "Chilkat";

  // Called when the activity is first created.
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    CkRest rest = new CkRest();
    boolean success;

    //  URL: https://api.stripe.com/v1/payouts/po_1BnETKGswQrCoh0XeUopRyDR
    boolean bTls = true;
    int port = 443;
    boolean bAutoReconnect = true;
    success = rest.Connect("api.stripe.com",port,bTls,bAutoReconnect);
    if (success != true) {
        Log.i(TAG, "ConnectFailReason: " + String.valueOf(rest.get_ConnectFailReason()));
        Log.i(TAG, rest.lastErrorText());
        return;
        }

    rest.SetAuthBasic("STRIPE_SECRET_KEY","");

    CkStringBuilder sbResponseBody = new CkStringBuilder();
    success = rest.FullRequestNoBodySb("GET","/v1/payouts/po_1BnETKGswQrCoh0XeUopRyDR",sbResponseBody);
    if (success != true) {
        Log.i(TAG, rest.lastErrorText());
        return;
        }

    CkJsonObject jsonResponse = new CkJsonObject();
    jsonResponse.LoadSb(sbResponseBody);

    String id;
    String object;
    int amount;
    int arrival_date;
    boolean automatic;
    String balance_transaction;
    int created;
    String currency;
    String description;
    String destination;
    boolean failure_balance_transaction;
    boolean failure_code;
    boolean failure_message;
    boolean livemode;
    String method;
    String source_type;
    boolean statement_descriptor;
    String status;
    String type;

    id = jsonResponse.stringOf("id");
    object = jsonResponse.stringOf("object");
    amount = jsonResponse.IntOf("amount");
    arrival_date = jsonResponse.IntOf("arrival_date");
    automatic = jsonResponse.BoolOf("automatic");
    balance_transaction = jsonResponse.stringOf("balance_transaction");
    created = jsonResponse.IntOf("created");
    currency = jsonResponse.stringOf("currency");
    description = jsonResponse.stringOf("description");
    destination = jsonResponse.stringOf("destination");
    failure_balance_transaction = jsonResponse.IsNullOf("failure_balance_transaction");
    failure_code = jsonResponse.IsNullOf("failure_code");
    failure_message = jsonResponse.IsNullOf("failure_message");
    livemode = jsonResponse.BoolOf("livemode");
    method = jsonResponse.stringOf("method");
    source_type = jsonResponse.stringOf("source_type");
    statement_descriptor = jsonResponse.IsNullOf("statement_descriptor");
    status = jsonResponse.stringOf("status");
    type = jsonResponse.stringOf("type");

  }

  static {
      System.loadLibrary("chilkat");

      // Note: If the incorrect library name is passed to System.loadLibrary,
      // then you will see the following error message at application startup:
      //"The application <your-application-name> has stopped unexpectedly. Please try again."
  }
}

Sample JSON Response Body

{
  "id": "po_1BnETKGswQrCoh0XeUopRyDR",
  "object": "payout",
  "amount": 1100,
  "arrival_date": 1516662782,
  "automatic": true,
  "balance_transaction": "txn_1BnETKGswQrCoh0X762wrMpF",
  "created": 1516662782,
  "currency": "usd",
  "description": "STRIPE TRANSFER",
  "destination": "ba_1BnETKGswQrCoh0XO5G2kEG5",
  "failure_balance_transaction": null,
  "failure_code": null,
  "failure_message": null,
  "livemode": false,
  "metadata": {},
  "method": "standard",
  "source_type": "card",
  "statement_descriptor": null,
  "status": "in_transit",
  "type": "bank_account"
}