Creating multiple payments with single token

1,838 views
Skip to first unread message

Malik

unread,
Apr 16, 2015, 9:44:53 AM4/16/15
to api-d...@lists.stripe.com
Hi,

I am new to stripe,

Need to transfer money to multiple CONNECTED_STRIPE_ACCOUNT_ID using single stripe token.Please give me a suggestion.


Thanks

Matthew Arkin

unread,
Apr 16, 2015, 1:03:06 PM4/16/15
to api-d...@lists.stripe.com
Hi Malik, 

You can create a customer and specify their token, this will save the token to the customer and allow you to use it multiple times. See:
https://stripe.com/docs/api#create_customer (note the "source" parameter)
https://stripe.com/docs/api#create_charge (note the "customer" parameter).

--
You received this message because you are subscribed to the Google Groups "Stripe API Discussion" group.
To post to this group, send email to api-d...@lists.stripe.com.
Visit this group at http://groups.google.com/a/lists.stripe.com/group/api-discuss/.

To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.

Mallika arjuna

unread,
Apr 17, 2015, 6:30:21 AM4/17/15
to api-d...@lists.stripe.com
Hi Matthew,

The below mentioned code using to charge single connected stripe account using source token. 

In this case i need to  send money to multiple 'CONNECTED_STRIPE_ACCOUNT_ID' with regarding amount using single source token.

\Stripe\Stripe::setApiKey(PLATFORM_SECRET_KEY); \Stripe\Charge::create(array( 'amount' => 1000, 'currency' => 'usd', 'source' => {TOKEN}, 'destination' => {CONNECTED_STRIPE_ACCOUNT_ID} ));


--
Mallikarjunan C
Senior Developer
AuctionSoftware.com
DevelopScripts LLC., a Texas based company
Chennai, India

Ankit Jindal

unread,
Apr 20, 2015, 3:46:23 AM4/20/15
to api-d...@lists.stripe.com
$c_charge = \Stripe\Charge::create(
    array(
      "amount" => 1000, // amount in cents
      "currency" => "usd",
      "source" => $stripe_token,
      "description" => "Example charge",
      "application_fee" => 123 // amount in cents
    ),
    array("stripe_account" => $stripe_id)
  );

in array u can mention multiple stripe_ids in which u want to transfer.

Mallika arjuna

unread,
Apr 20, 2015, 8:17:01 AM4/20/15
to api-d...@lists.stripe.com
Hi Ankit Jidal,

Thank you for your kind reply. I need to send different amount to multiple stripe_id.

eg: $stripe_id1 = 1000, $stripe_id2 = 5000.

Matthew Arkin

unread,
Apr 20, 2015, 7:26:19 PM4/20/15
to api-d...@lists.stripe.com
Hi Mallika, 
You'd have to create a separate charge per destination. 

So if you want to send money to 5 different people, you'd have to create 5 charges each one specifying a stripe account id like in Ankit's example. 

Brian Krausz

unread,
Apr 20, 2015, 7:30:47 PM4/20/15
to api-d...@lists.stripe.com
Hi Mallika,

In most cases Stripe cannot currently support splitting a single charge between multiple accounts: the bulk must go to a single account, and we allow you to take an application_fee. This is due to both legal and credit card rules and regulations. We can sometimes make exceptions for specific business models. One of the requirements for these exceptions is a well-defined product or service being provided. For example, a general auction site would not be able to do this.

As Matthew says, you can make separate charges for each recipient: this is something we do allow.

Thanks,
Brian

Thiruppathi A

unread,
Apr 24, 2015, 7:58:14 AM4/24/15
to api-d...@lists.stripe.com
Hi Matthew,

I want to send money to only one seller from my website. But I don't know how to get the CONNECTED_STRIPE_ACCOUNT_ID from stripe for my seller's stripe account. I have stored access_token from stripe when the user connected with stripe. I used this access_token for stripe_account. But it doesn't work for me. Can you let me know how to get the stripe account id?

Thanks in advance

Thiruppathi A

Brian Krausz

unread,
Apr 24, 2015, 6:15:14 PM4/24/15
to api-d...@lists.stripe.com
If you have an access token you can retrieve the account information using only that token:

Via curl - `curl https://api.stripe.com/v1/account -u ACCESS_TOKEN:`
Via ruby - `Stripe::Account.retrieve(api_key: ACCESS_TOKEN)`

All other language libraries follow a similar pattern to ruby. You will get back a hash of account information, including an `id`.

Thanks,
Brian

--

Thiruppathi A

unread,
Apr 27, 2015, 4:09:01 AM4/27/15
to api-d...@lists.stripe.com
Hi Brian,


             I have stored Access token from stripe when the user connected with stripe. I used this access_token to get the stripe connected account id . But it shows the error  ' Invalid API Key provided: ac_************. I have used the below format using php to get the account id. Is this correct format?

Stripe_Account::retrieve('api_key': ' ac_************'');


Thanks,

Thiruppathi A
             


           

--
Regards,
A.Thiruppathi

Matthew Arkin

unread,
Apr 27, 2015, 4:12:36 AM4/27/15
to api-d...@lists.stripe.com, api-d...@lists.stripe.com
Ac_... Is not an access token. Access tokens are in the format of sk_test_... and so_live_...

Ac_ are the authorization codes you get when someone is redirected back to your site from stripe, they also mean you haven't finished the oauth process.



Sent from Mailbox

Brian Krausz

unread,
Apr 27, 2015, 4:12:47 AM4/27/15
to api-d...@lists.stripe.com
That is an authorization code: only one part of the process of connecting to another Stripe account. You must turn that authorization code into an access token, as described in our docs[1] (and in accordance with the OAuth spec).

Our authorization codes begin with "ac_", while our access tokens begin with "sk_" or "pk_".

Thanks,

Thiruppathi A

unread,
Apr 27, 2015, 6:44:13 AM4/27/15
to api-d...@lists.stripe.com
Hi Brian,


           Thanks for your  idea.


          Let me Know, How to get access token if i connected with stripe.





Thanks

Thiruppathi A


Brian Krausz

unread,
Apr 27, 2015, 2:28:35 PM4/27/15
to api-d...@lists.stripe.com
The document I linked outlines how to go about doing that. If you are having issues integrating, I'd recommend contacting sup...@stripe.com - this list is for general questions about the Stripe API, not specific problems with your integration.

Thanks,
Brian

Thiruppathi A

unread,
Apr 28, 2015, 3:17:10 AM4/28/15
to api-d...@lists.stripe.com
Hi Brian,

 The below mentioned code using to charge single connected stripe account using source token. 


$c_charge = Stripe_Charge::create(
    array(
      "amount" => 1000, // amount in cents
      "currency" => "usd",
      "source" => $stripe_token,
      "description" => "Example charge",
      "application_fee" => 123 // amount in cents
    ),
    array("stripe_account" => $stripe_id)
  );


But i got the error 'The second argument to Stripe API method calls is an optional per-request apiKey, which must be a string. (HINT: you can set a global apiKey by "Stripe::setApiKey()")'


Thanks in Advance,



Matthew Arkin

unread,
Apr 28, 2015, 3:19:08 AM4/28/15
to api-d...@lists.stripe.com
Like Brian mentioned before this is getting a bit to integration / troubleshooting specific and you may want to email sup...@stripe.com to help you out in detail or checkout the Stripe irc room.

I’m guessing you’re using an older version of the Stripe api library that doesn’t support passing objects as the second argument.
--
Matt Arkin
Kollective Solutions

Reply all
Reply to author
Forward
0 new messages