Skip to content

Register Your First Conversion

A conversion is an action that generates revenue or a positive outcome for your business, such as a product sale, subscription sign-up, or other valuable event. When a customer referred by a SoyCap.io affiliate completes a conversion on your site, it’s essential to register this event in SoyCap.io to attribute the conversion to the correct affiliate for rewards. Although you can register conversions manually on the SoyCap.io Dashboard, we recommend automating the process using the SoyCap.io API.

Manual Conversion Registration

If you know the campaignId and referralId associated with conversion event, you can manually register the conversion on the SoyCap.io Dashboard. This approach is ideal for testing, initial setup, or smaller campaigns with a few known affiliates, allowing you to skip API integration.

To register a conversion manually:

  1. Go to the specific campaign by campaignId via affiliate attribution.
  2. Open the Referral Links tab.
  3. Locate the referral link with the corresponding referralId.
  4. Click Register Conversion.
  5. Enter the following details:
    • Reward (USDC): The USDC reward amount to be distributed to the affiliate.
    • Gross Revenue (USDC): The business value or revenue generated by this conversion. This optional parameter can help calculate ROI and track campaign performance.
  6. Click Sign and Register to confirm the transaction using your Phantom Wallet.

After confirmation, note the updated referral link details:

  • Conversions Total: Increased by one.
  • Rewards Pending: Updated to reflect the newly registered conversion.

Programmatic Conversion Registration

For larger campaigns with many affiliates and conversions, automating conversion registration via your backend is essential. You can find full details on using the SoyCap.io API and @solana/web3.js for programmatic registration in our Developer documentation. Here’s a quick overview:

  1. In the Merchant Dashboard, go to the Dev Tools tab to Get Merchant API Key, also known as api_key.
  2. Create a keypair from the Phantom Wallet used to create the campaign. We recommend to use a dedicated Phantom wallet for each merchant so you can share same keypair across all merchant campaigns.
  3. On your backend server:
    1. Authenticate Merchant with the api_key via the /api/merchants/authenticate endpoint to receive an authentication token, or auth_token.
    2. Extract referralId from the user’s affiliate attribution.
    3. Call the /api/conversions/onchain/create/ endpoint with auth_token, referralId, and rewardAmountUSDC to get transaction details for registering a conversion.
    4. Construct the blockchain transaction using the transaction details from the previous step with the @solana/web3.js library.
    5. Send and confirm the transaction with the keypair using @solana/web3.js.
    6. Optionally, store the conversion details in your database for future reference and payout automation.