Objective-C 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 \

Objective-C Example

#import <CkoRest.h>
#import <CkoStringBuilder.h>
#import <CkoJsonObject.h>
#import <NSString.h>

CkoRest *rest = [[CkoRest alloc] init];
BOOL success;

//  URL: https://api.stripe.com/v1/payouts/po_1BnETKGswQrCoh0XeUopRyDR
BOOL bTls = YES;
int port = 443;
BOOL bAutoReconnect = YES;
success = [rest Connect: @"api.stripe.com" port: [NSNumber numberWithInt: port] tls: bTls autoReconnect: bAutoReconnect];
if (success != YES) {
    NSLog(@"%@%d",@"ConnectFailReason: ",[rest.ConnectFailReason intValue]);

[rest SetAuthBasic: @"STRIPE_SECRET_KEY" password: @""];

CkoStringBuilder *sbResponseBody = [[CkoStringBuilder alloc] init];
success = [rest FullRequestNoBodySb: @"GET" uriPath: @"/v1/payouts/po_1BnETKGswQrCoh0XeUopRyDR" sb: sbResponseBody];
if (success != YES) {

CkoJsonObject *jsonResponse = [[CkoJsonObject alloc] init];
[jsonResponse LoadSb: sbResponseBody];

NSString *id = 0;
NSString *object = 0;
int amount;
int arrival_date;
BOOL automatic;
NSString *balance_transaction = 0;
int created;
NSString *currency = 0;
NSString *description = 0;
NSString *destination = 0;
BOOL failure_balance_transaction;
BOOL failure_code;
BOOL failure_message;
BOOL livemode;
NSString *method = 0;
NSString *source_type = 0;
BOOL statement_descriptor;
NSString *status = 0;
NSString *type = 0;

id = [jsonResponse StringOf: @"id"];
object = [jsonResponse StringOf: @"object"];
amount = [[jsonResponse IntOf: @"amount"] intValue];
arrival_date = [[jsonResponse IntOf: @"arrival_date"] intValue];
automatic = [jsonResponse BoolOf: @"automatic"];
balance_transaction = [jsonResponse StringOf: @"balance_transaction"];
created = [[jsonResponse IntOf: @"created"] intValue];
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"];

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"