Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

stripe create payout getting error "Sorry, you don't have any external accounts in that currency (usd)"

Tags:

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;


?>
like image 417
Nikul Panchal Avatar asked Jan 19 '18 05:01

Nikul Panchal


1 Answers

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.

like image 86
Ywain Avatar answered Sep 20 '22 13:09

Ywain