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
| Key | Purpose |
|---|
url | Landing or checkout page URL (used for attribution) |
affiliateId / partnerId | Partner or affiliate identifier |
utm_source, utm_medium, utm_campaign | Standard UTM parameters |
clickId, subId | Click 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
| Field | Source | Purpose |
|---|
sessionId | You | Per-checkout idempotency in widget config |
data.* | You | Attribution / metadata |
paysightSession | Paysight API | Upsell handoff — not set via data |