5

I am working on create payout, while run the code i am getting error

Sorry, you don't have any external accounts in that currency (usd)

first i am creating the customer, and then i am creating the bank account, and after then i am doing the payout, can anyone please help me how can i resolve this issue, here is my code

<?php
require_once('init.php');
\Stripe\Stripe::setApiKey("*************");


$customer = \Stripe\Customer::create(array(
  "description" => "Customer for payout"
));

$customer_id =  $customer->id;

$customer = \Stripe\Customer::retrieve($customer_id);


$bank_data = \Stripe\Token::create(array(
  "bank_account" => array(
    "country" => "US",
    "currency" => "usd",
    "account_holder_name" => "Charlotte Thomas",
    "account_holder_type" => "individual",
    "routing_number" => "110000000",
    "account_number" => "000123456789"
  )
));

$bank_token = $bank_data->id;

$bank_account = $customer->sources->create(array("source" => $bank_token));


$payout_data = \Stripe\Payout::create(array(
  "amount" => 100,
  "currency" => "usd",
));

echo "<pre>";
print_r($payout_data);
die;


?>
Nikul Panchal
  • 663
  • 1
  • 14
  • 32

1 Answers1

4

You're adding a bank account as a payment source to a customer object, i.e. for ACH payments.

For payouts, if this is your own Stripe account, you need to enter your bank account details in your dashboard at https://dashboard.stripe.com/account/payouts. You'll also need to set your payout schedule to "Manual" if you want to be able to create payouts via the API.

Also note that when creating charges, funds are not immediately available, so you will not be able to create a payout immediately after creating a charge. You can read all about payouts in Stripe's documentation at https://stripe.com/docs/payouts.

Ywain
  • 16,854
  • 4
  • 51
  • 67
  • Hi @Ywain I am getting this error `Cannot create payouts: this account has requirements that need to be collected.. Please provide those fields to re-enable payouts.` Could you please help – Ashh Sep 27 '19 at 11:00