Skip to main content
Event: checkout.session.initialized.v2 Fires the moment the buyer starts the checkout. At this point the form hasn’t been filled in yet, so customer and shipping come empty, paymentMethod is null, status is waiting_payment, and the commission amounts are zero (the commission doesn’t exist yet). There is also no amounts breakdown: tax is only calculated at payment time.

Payload

products lists the cart items at the moment the checkout started, and trackingParameters carries the parameters captured from the checkout URL (see Tracking parameters). customParams carries every other parameter of the checkout URL, the ones trackingParameters doesn’t have a key for (aff, fbclid, subid, or a parameter of your own, for example), with each key exactly as it arrived. When the URL has no other parameter, it comes as an empty object. affiliation identifies the affiliate of the session: the affiliate code, name and email, the same affiliate the order carries once it’s paid. Use it to measure checkout conversion per affiliate. The field is absent when the session has no affiliate, and it has no commission, since the commission only exists once the payment is approved. email comes as null on the rare session whose affiliate has no email on record.
To attribute a session to an affiliate, use affiliation.code, not customParams.aff. aff is the raw value from the link, while affiliation only appears when the checkout accepts that affiliate for the product.