Documentation

  • How To
  • /
  • Configure In-App Web Purchases (Stripe)

Overview

 

This guide explains how to add Stripe as a web payment provider and report web-based purchases to the GoMarketMe platform.

 

Step 1 – Complete Onboarding

 

https://gomarketme.co > Get Started.

 

When asked for Apple In-App Purchases details, click “Skip for now”.



Step 2 – Configure Stripe Web payments

 

  • Go to Apps > Configure Stripe > Add

Provide:

    • Stripe Account ID
      • In Stripe, go to Settings > Business > Account ID (copy)
    • Stripe API Key (restricted)
      • In Stripe, go to Settings > Developers > API Key > Manage API Keys
      • Restricted Keys > Create Restricted Key
      • “Providing this key to another website”
      • Name: GoMarketMe
      • URL: https://gomarketme.co
      • Check Customize permissions for this key
      • Min permission: Payment Intents > Permission: Read. 
      • Copy the API key
    • Webhook Secret
  •  
  •  

Configure Stripe Web Payments

 

 

Step 3 – Update your app to initialize the GoMarketMe SDK and capture the device id

 

(e.g. with Flutter)

 

GoMarketMeAffiliateMarketingData? goMarketMe;

 

Future<void> main() async {

  WidgetsFlutterBinding.ensureInitialized();

 

  final goMarketMeSDK = GoMarketMe();

 

  goMarketMeSDK.initialize(“[API_KEY]”).then((_) {

 

    // Once initialization completes, you can access the affiliate marketing data:

    goMarketMe = goMarketMeSDK.affiliateMarketingData;

    

    var deviceId = goMarketMe?.deviceId;

 

    debugPrint(“Device ID: $deviceId);

  });

 

  runApp(const MyApp());

}




Step 4 – Pass the deviceId as metadata to Stripe

 

See https://docs.stripe.com/api/metadata 

 

and https://docs.stripe.com/api/checkout/sessions/retrieve for Stripe.

 

 

Step 5 – Backend to retrieve the metadata at checkout and post sales to GoMarketMe

 

Method: POST

 

URL: https://api.gomarketme.net/v1/web/event

 

Headers (required):

 

Content-Type

application/json

x-event-type

web-purchase

x-api-key

[API_KEY] (GoMarketMe API KEY)

 

Body (all fields required):

 

device_id

As returned by the GoMarketMe SDK

external_purchase_id

Unique Identifier of the Purchase (as returned by the provider, e.g., Stripe)

currency_code

ISO 4217 (Uppercase, 3 characters)

sale_price

Sales price of the purchase (decimal)

product_name

Name of the product that was purchased. Used in Marketer and Affiliate Reporting.



Sample Request:

 

curl -X POST “https://api.gomarketme.net/v1/web/event” \

  -H “Content-Type: application/json” \

  -H “x-event-type: web-purchase” \

  -H “x-api-key: 123456789” \

  -d ‘{

    “device_id”: “123”,

    “external_purchase_id”: “123”,

    “currency_code”: “USD”,

    “sale_price”: 0.99,

    “product_name”: “123”

  }’



Expected Results

 

Once the affiliate sale is posted to GoMarketMe:

 

  1. Real-time Reporting

    The affiliate sale should appear in real time in both the Marketer and Affiliate dashboards.

  2. Marketer UI

    Navigate to Sales to view the recorded purchase.

Tracking App to Web Affiliates Sales - Marketer UI

 

  1. Affiliate UI


Navigate to Sales to see the purchase attributed.

Tracking App to Web Affiliates Sales - Affiliate UI






Need Help?

 

If you have any questions or need assistance, please reach out to integrations@gomarketme.co. We’re always happy to help!