API/Track Payment

Track Payment

Record a payment and create a commission when the program is payment-based.

Record a payment after the target app receives money.

POST /api/v1/affiliate/payment

Recommended payload:

{
  "customerKey": "cus_123",
  "stripeInvoiceId": "in_123"
}

You can send one of:

  • stripeInvoiceId
  • stripePaymentIntentId
  • stripeChargeId

When the organization has connected Stripe, one Stripe ID is required. Growth retrieves the payment from the organization's connected Stripe account and stores Stripe's amount, currency, and source ID. This prevents caller-supplied revenue from unlocking the wrong commission tier.

Optional safety check:

{
  "customerKey": "cus_123",
  "stripePaymentIntentId": "pi_123",
  "amount": 4900,
  "currency": "eur"
}

Amounts are sent in the smallest currency unit. For EUR, 4900 means 49.00 EUR.

Subscription Vs One-Time

Growth classifies every payment as subscription (recurring billing) or one_time (single purchase) and splits revenue, MRR, and commission reporting by type.

When you send a Stripe ID, the type is detected automatically from the Stripe invoice: subscription invoices count as subscription, standalone charges and manual invoices count as one_time.

Without a Stripe reference, pass the type yourself:

{
  "customerKey": "user_42",
  "amount": 4900,
  "currency": "eur",
  "sourceId": "order_812",
  "paymentType": "one_time"
}

paymentType accepts subscription or one_time. When omitted and not detectable, the payment still counts in totals but stays out of the per-type split and the MRR estimate falls back to a heuristic.

The verified Stripe object ID makes the event idempotent. Re-sending the same payment does not create a duplicate commission.

If the first payment was sent before signup attribution existed, link the customer manually in Affiliation > Customers, then resend the same payment payload. Growth will use the existing Stripe id and create the commission only once.

Store customerKey in Stripe metadata or client_reference_id when you create Checkout Sessions. That makes it easy to recover the correct customer if the app misses the original referral cookie.