Billing
Stripe
Integrate Stripe with your TrackReward account to manage billing and payouts. Stripe is a payment gateway that allows you to accept payments and manage subscriptions.
Level of Difficulty: Easy
Developer Needed: No
This means the task is straightforward and can be completed without requiring a developer's help.
TrackPromoter allows you to automatically track sales, refunds, upgrades, and cancellations by integrating with your Stripe account, whether in Test or Live mode.
TrackReward enables automatic tracking of sales, refunds, upgrades, and cancellations from Stripe.
To get started, follow the steps below.
- Click on the 'Connect Stripe' button. This will redirect you to the Stripe marketplace, where you will be prompted to install TrackReward.
- Select your Stripe account and install the app.
- After the installation is complete, you will be redirected back to this page to finish the setup.
Switching between test and live mode on Stripe allows you to toggle between testing transactions and processing real payments. To switch between test mode and live mode on Stripe, you will need to disconnect and then reconnect to the desired mode.
API
TrackReward allows you to track sales, refunds, upgrades, and cancellations by integrating with your Stripe account using our API. This allows you to track sales in real-time and automate the process.
To get started, follow the steps below.
- Get your API key from the TrackReward settings.
- On your website need to add this POST API https://trackreward.com/api/tracker/v1/track-sale with the following parameters:
Key | Type | Required | Description |
---|---|---|---|
account_id | string | Yes | The app ID provided by TrackReward |
customer_email | string | Yes (if customer_uid empty) | Lead's authentic email address |
customer_uid | string | Yes (if customer_email empty) | user id of the lead |
plan | string | No | plan of the product |
track_id | string | No | plan of the product |
amount | number | Yes | Amount of the sale |
event | string | Yes | Event of the sale |
affiliate_code | string | No | Affiliate code of the sale |
Example
const axios = require('axios'); async function trackSale(data) { try { const response = await axios.post( 'https://trackreward.com/api/tracker/v1/track-sale', { account_id: data.account_id, // required customer_email: data.customer_email, // required if customer_uid is empty customer_uid: data.customer_uid, // required if customer_email is empty plan: data.plan, // optional track_id: data.track_id, // optional amount: data.amount, // required event: data.event, // required affiliate_code: data.affiliate_code // optional }, { headers: { 'Content-Type': 'application/json', 'API-Key': '<your-api-key-here<', // Replace this with your actual API key from TrackReward settings } } ); console.log('Success:', response.data); } catch (error) { console.error('Error:', error.response ? error.response.data : error.message); } } // Example data for the function call const saleData = { account_id: 'your_account_id', customer_email: 'customer@example.com', // Required if customer_uid is not provided customer_uid: '', // Leave blank if using customer_email plan: 'basic', track_id: '12345', amount: 99.99, event: 'sale', affiliate_code: 'AFF123' }; // Call the function trackSale(saleData);