Paypal
PayPal is an online payment platform that facilitates payments between parties through online transfers. You can use Paypal to fetch commercial information (transactions, subscriptions ...) about your users who have an e-commerce business or use Paypal 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 Paypal account
To retrieve commerce data from companies using Paypal, you have to connect your Paypal account with Qard. To do that, you'll have to:
- Create a Paypal account if you already don't have one and register as a Third Party Provider (TPP).
- Connect your account to Qard API using Paypal credentials (
clientId
&clientSecret
). - Test your integration by creating a new synchronization using Paypal provider.
Create a new account:
- Go to the Paypal register page and follow the instructions.
- After that, you can go to the https://www.paypal.com/partnerexp/tppLanding/ and register as a Third Party Provider (TPP) for PayPal’s X2SA API
- Enter Qard callback URI (
https://api.qardfinance.com/callback/paypal
) in the "Your return URL" field. - After Submitting the form, your credentials (
clientId
andclientSecret
) will be available to download.
The API's credentials will only be activated once Paypal has verified your TPP license and confirmed your registration. Paypal will send you an email when you can start using the API. In the meantime, you can start testing by using sandbox's credentials.
Link your Paypal account to Qard API:
1. Update Paypal provider credentials:
- is_sandbox: The type of the account (sandbox or live)
- client_id: Application client ID
- client_secret: Application client secret
{
"credentials": {
"is_sandbox": (true|false),
"client_id": "PAYPAL_CLIENT_ID",
"client_secret": "PAYPAL_SECRET_KEY"
}
}
2. Settings Paypal provider:
{
"auto_connect": (true|false)
}
3. Enable Paypal provider:
{
"enable": true
}
Test Paypal integration:
You can test Paypal 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": "paypal"
}
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