Classic ASP 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

Classic ASP Example

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
set rest = Server.CreateObject("Chilkat_9_5_0.Rest")

'  URL: https://api.stripe.com/v1/payouts/po_1BnETKGswQrCoh0XeUopRyDR
bTls = 1
port = 443
bAutoReconnect = 1
success = rest.Connect("api.stripe.com",port,bTls,bAutoReconnect)
If (success <> 1) Then
    Response.Write "<pre>" & Server.HTMLEncode( "ConnectFailReason: " & rest.ConnectFailReason) & "</pre>"
    Response.Write "<pre>" & Server.HTMLEncode( rest.LastErrorText) & "</pre>"

End If

success = rest.SetAuthBasic("STRIPE_SECRET_KEY","")

success = rest.AddQueryParam("metadata[order_id]","6735")

strResponseBody = rest.FullRequestFormUrlEncoded("POST","/v1/payouts/po_1BnETKGswQrCoh0XeUopRyDR")
If (rest.LastMethodSuccess <> 1) Then
    Response.Write "<pre>" & Server.HTMLEncode( rest.LastErrorText) & "</pre>"

End If

set jsonResponse = Server.CreateObject("Chilkat_9_5_0.JsonObject")
success = 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")

%>
</body>
</html>

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