Skip to main content
Attach arbitrary string key-value pairs to payment requests with the data object on WidgetConfig. Values are forwarded to the Paysight API with each payment attempt (card, wallet, upsell).

Basic usage

PaySightSDK.createWidget({
  config: {
    productId: YOUR_PRODUCT_ID,
    sessionId: 'YOUR_SESSION_ID',
    environment: 'sandbox',
    amount: 29.99,
    data: {
      affiliateId: 'partner-123',
      campaign: 'spring-sale',
      source: 'landing-page-a',
      url: 'https://yoursite.com/offer?utm_source=email',
    },
  },
});

Common keys

KeyPurpose
urlLanding or checkout page URL (used for attribution)
affiliateId / partnerIdPartner or affiliate identifier
utm_source, utm_medium, utm_campaignStandard UTM parameters
clickId, subIdClick or sub-affiliate tracking
There is no fixed schema — use keys your Paysight product or reporting expects.

Updating at runtime

widget.update({
  data: {
    ...existingData,
    campaign: 'retargeting',
  },
});

UTM capture pattern

function getUtmParams() {
  const params = new URLSearchParams(window.location.search);
  return {
    utm_source: params.get('utm_source') ?? '',
    utm_medium: params.get('utm_medium') ?? '',
    utm_campaign: params.get('utm_campaign') ?? '',
    url: window.location.href,
  };
}

const widget = PaySightSDK.createWidget({
  config: {
    // ...
    data: getUtmParams(),
  },
});
data values must be strings (Record<string, string>). Coerce numbers before passing.

Distinction from session IDs

FieldSourcePurpose
sessionIdYouPer-checkout idempotency in widget config
data.*YouAttribution / metadata
paysightSessionPaysight APIUpsell handoff — not set via data