PHP Extension Stripe: Update a Payout

Back to Index

Updates the specified payout by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request accepts only the metadata as arguments.

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

CURL Command

curl -X POST https://api.stripe.com/v1/payouts/po_1BnETKGswQrCoh0XeUopRyDR \
   -u STRIPE_SECRET_KEY: \
   -d metadata[order_id]=6735

PHP Extension Example

<?php

// The version number (9_5_0) should match version of the Chilkat extension used, omitting the micro-version number.
// For example, if using Chilkat v9.5.0.48, then include as shown here:
include("chilkat_9_5_0.php");

$rest = new CkRest();

//  URL: https://api.stripe.com/v1/payouts/po_1BnETKGswQrCoh0XeUopRyDR
$bTls = true;
$port = 443;
$bAutoReconnect = true;
$success = $rest->Connect('api.stripe.com',$port,$bTls,$bAutoReconnect);
if ($success != true) {
    print 'ConnectFailReason: ' . $rest->get_ConnectFailReason() . "\n";
    print $rest->lastErrorText() . "\n";
    exit;
}

$rest->SetAuthBasic('STRIPE_SECRET_KEY','');

$rest->AddQueryParam('metadata[order_id]','6735');

$strResponseBody = $rest->fullRequestFormUrlEncoded('POST','/v1/payouts/po_1BnETKGswQrCoh0XeUopRyDR');
if ($rest->get_LastMethodSuccess() != true) {
    print $rest->lastErrorText() . "\n";
    exit;
}

$jsonResponse = new CkJsonObject();
$jsonResponse->Load($strResponseBody);

$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');

?>

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"
}