Stripe
Stripe is a suite of payment APIs that powers commerce for online businesses of all sizes, including fraud prevention, and subscription management. You can use Stripe to fetch commercial information (transactions, subscriptions ...) about your users who have an e-commerce business or use Stripe as a payment service provider.
This provider supports these data types:
- Commerce balance: to retrieve a list of user's balances.
- Commerce transaction: to retrieve a list of user's transactions.
- Commerce dispute: to retrieve a list of user's disputes.
- Commerce subscription: to retrieve a list of user's subscriptions.
- Commerce product: to retrieve a list of user's products.
- Commerce transactions insight (Insight): to retrieve a commerce transactions insight.
- Commerce subscriptions insight (Insight): to retrieve a commerce subscriptions insight.
- Commerce disputes insight (Insight): to retrieve a commerce disputes insight.
Connect your Stripe account
To retrieve commerce data from companies using Stripe, you have to connect your Stripe account with Qard. To do that, you'll have to:
- Create a Stripe account if you already don't have one.
- Connect your account to Qard API using Stripe credentials (
clientId
&secretKey
). - Test your integration by creating a new synchronization using Stripe provider.
Create a new account:
If you already have an account, you can skip this part.
- Go to the Stripe register page and follow the instructions.
- Complete account ownership verification by providing as much information as you can.
- You will be contacted by Stripe at your email address within 1-3 business days.
Set up your Stripe account to use Connect feature:
- Go to the Stripe Connect page and follow the guide.
- After activating Connect feature, you'll have to update the settings page.
- Under Branding, you can customize how your business appears to your users by filling out your business details, uploading your company logo, and choosing your brand color.
- Click on Save branding changes button
- Under Integration, make sure to toggle OAuth for Standard accounts option.
- Click on Add URI button to set up Qard redirection URI:
https://api.qardfinance.com/callback/stripe
. - Copy Client ID.
- Go to Stripe Developer Dashboard and copy your account Secret key.
- You are set to go !
Link your Stripe account to Qard API:
1. Update Stripe provider credentials:
{
"credentials": {
"client_id": "STRIPE_CLIENT_ID",
"secret_key": "STRIPE_SECRET_KEY"
}
}
2. Enable Stripe provider:
{
"enable": true
}
Test Stripe integration:
You can test Stripe integration by creating a new data connection for your user.
{
"requested_data_types": [
"COMMERCE_BALANCE",
"COMMERCE_TRANSACTION",
"COMMERCE_DISPUTE",
"COMMERCE_SUBSCRIPTION",
"COMMERCE_PRODUCT",
"COMMERCE_TRANSACTION_INSIGHT",
"COMMERCE_SUBSCRIPTION_INSIGHT",
"COMMERCE_DISPUTE_INSIGHT"
],
"provider_name": "stripe"
}
After finishing the connecting process by your user, and after validating that the data connection status is CONNECTED, you can run a new synchronization.
{
"data_types": [
"COMMERCE_TRANSACTION",
"COMMERCE_DISPUTE",
"COMMERCE_BALANCE",
"COMMERCE_SUBSCRIPTION",
"COMMERCE_PRODUCT",
"COMMERCE_TRANSACTION_INSIGHT",
"COMMERCE_SUBSCRIPTION_INSIGHT",
"COMMERCE_DISPUTE_INSIGHT"
]
}
To verify that you are receiving your user's commerce data, check out these endpoints:
- GET
/api/v6/users/{userId}/commerce-balances
- GET
/api/v6/users/{userId}/commerce-disputes
- GET
/api/v6/users/{userId}/commerce-subscriptions
- GET
/api/v6/users/{userId}/commerce-transactions
- GET
/api/v6/users/{userId}/commerce-products
- GET
/api/v6/users/{userId}/commerce-transaction-insight
- GET
/api/v6/users/{userId}/commerce-subscription-insight
- GET
/api/v6/users/{userId}/commerce-dispute-insight