← Home
/hyax-api/webhooks/stripe-connect

Attribute Stripe payments

With Stripe connected in Team settings, Hyax already receives `payment_intent.succeeded` from your connected account and records the order — you only need to tell it which visitor paid. Read the visitor ID in the browser with `hyax.getVisitorId()`, send it to your backend, and set it as `hyax_vid` in the PaymentIntent metadata. The webhook needs an email to attach the order to a person, so make sure the PaymentIntent has `receipt_email` set or an `email` metadata field.

Base URL: https://platform.hyax.com · Replace YOUR_API_KEY with your team API key.

Request

# This route is session-based, multipart, or provider-specific.
# Inspect: apps/web/server/routes/hyax-api/

Response

// Browser — read the visitor id
const visitorId = window.hyax.getVisitorId();

// Server — attach it to the payment
const paymentIntent = await stripe.paymentIntents.create({
  amount: 4999,
  currency: "usd",
  receipt_email: "[email protected]",
  metadata: {
    hyax_vid: visitorId,
    email: "[email protected]",
  },
});

// Hyax records the order when payment_intent.succeeded arrives:
//   paymentPlatform  STRIPE
//   externalOrderId  the PaymentIntent id (dedup key)
//   attribution      resolved from hyax_vid