Xojo Plugin Stripe: Create a Payout

Back to Index

To send funds to your own bank account, you create a new payout object.

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

CURL Command

curl -X POST https://api.stripe.com/v1/payouts \
   -d amount=400 \
   -d currency=usd

Xojo Plugin Example

Dim rest As New Chilkat.Rest
Dim success As Boolean

//  URL: https://api.stripe.com/v1/payouts
Dim bTls As Boolean
bTls = True
Dim port As Int32
port = 443
Dim bAutoReconnect As Boolean
bAutoReconnect = True
success = rest.Connect("api.stripe.com",port,bTls,bAutoReconnect)
If (success <> True) Then
    System.DebugLog("ConnectFailReason: " + Str(rest.ConnectFailReason))
End If



Dim strResponseBody As String
strResponseBody = rest.FullRequestFormUrlEncoded("POST","/v1/payouts")
If (rest.LastMethodSuccess <> True) Then
End If

Dim jsonResponse As New Chilkat.JsonObject

Dim id As String
Dim object As String
Dim amount As Int32
Dim arrival_date As Int32
Dim automatic As Boolean
Dim balance_transaction As String
Dim created As Int32
Dim currency As String
Dim description As String
Dim destination As String
Dim failure_balance_transaction As Boolean
Dim failure_code As Boolean
Dim failure_message As Boolean
Dim livemode As Boolean
Dim method As String
Dim source_type As String
Dim statement_descriptor As Boolean
Dim status As String
Dim type As String

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"