Stripe Connect API

Stripe Connect API

Stripe Connect enables you to control creadit cart payment on behalf of merchant’s connected accounts. By configuring Stripe Connect API you can perform the common task of processing payments on a seller’s behalf. You’ll need CLIENT ID, SECRET KEY, PUBLISHABLE KEY and WEBHOOK SECRET from Stripe.
 

HELP! Learn more about Stripe connect. Read the Stripe documentation.

 

INFO Once the Stripe connect is configured. The same APIs can be used for vendor subscription billing, no extra configuration needed.

 

Register Your Platform

Very first you have to register your marketpalce platform with Stripe. Login into your Stripe dashboard and go to the Connected accounts section. Click Get Started button to activate connect account.

Stripe Dashboard

Stripe Dashboard


 

On next window, select Build a platform or marketplace option and proceed.

Dashboard Stripe 2

Choose Build a platform or marketplace


 

Go to Settings from the sidebar and click Connect Settings.

Stripe connect settings

Stripe connect settings

On the next screen Integration section get the client ID, we’ll need this ID later on this guide. Enable the OAuth settings based on your account type, If you’re confused then enable both. Now click Add URI button and give https://your_domain/admin/setting/stripe/redirect in the Redirect URI field.

Stripe connect settings

Stripe connect settings

On the same screen scroll to Branding section and fill the form with your brand information, upload logo, and icon.

 

Get API credentials

Next, go to Developers API keys section from the sidebar and get the Publishable key and Secret key.


 

Handling Stripe Webhooks

One more thing is remaining to finish configuring the Stripe side. And that is webhooks. By setting webhooks we allowing Stripe to communicate with your platform when any changes happen on Stripe’s site like subscription update, cancel, payment failed, etc. so that your marketplace can take actions to manage the vendor account on your marketplace. zCart has everything configured for you, now you just have to set the URL and the secret key for secure communications.

Go to Developers Webhooks section from the sidebar and click the Add endpoint button. On the next window enter https://your_domain/stripe/webhook in the Endpoint URI field and add below events on the Events to send section.

Stripe Webhooks

Stripe Webhooks Events

Events need to enabled

  • customer.subscription.updated
  • customer.subscription.deleted
  • customer.updated
  • customer.deleted
  • invoice.payment_action_required

 

After adding the webhook endpoint URL and events. Open the endpoint details and get the Signing secret value to secure the communication.

Stripe webhooks secret

Stripe webhooks secret

 
You have done Stripe connect API configurations, please open the .env file and update these keys with your values.

.
.
.
STRIPE_KEY=your_stripe_publishable_key
STRIPE_SECRET=your_stripe_secret_key
STRIPE_CLIENT_ID=your_stripe_client_id
STRIPE_WEBHOOK_SECRET=stripe_webhook_signing_secret
.
.
.

 

From now the application will automatically handle canceling subscriptions that have too many failed charges (as defined by your Stripe settings), customer updates, customer deletions, subscription updates, and credit card changes.

Now your marketplace can use Stripe APIs to manage payments. But still, we’re not done. You need to create subscriptions and prices on the Stripe dashboard and also in your marketplace dashboard to charge vendors. Please check this section of the documentation for help.

Note! Enable View test data to get test credentials on the Stripe dashboard.

 

Warning! The stripe platform account and the connected account (seller) can’t be the same account. To test stripe connect use different accounts.

 

Now from your platform’s admin Dashboard navigate to settings configuration payment method tab and enable Stripe payment method so that your marketplace vendors can accept credit card payment.

 
 
 

Was this helpful to you?

Leave Comment