feat(billing): attach attribution metadata to cloud subscriptions

This commit is contained in:
Sojan Jose
2026-04-28 19:51:47 +05:30
parent 6aeda0ddf6
commit df0daebc99
9 changed files with 159 additions and 34 deletions
@@ -1,5 +1,6 @@
/* global axios */
import ApiClient from '../ApiClient';
import { getBillingAttribution } from '../../helper/billingAttribution';
class EnterpriseAccountAPI extends ApiClient {
constructor() {
@@ -11,7 +12,9 @@ class EnterpriseAccountAPI extends ApiClient {
}
subscription() {
return axios.post(`${this.url}subscription`);
return axios.post(`${this.url}subscription`, {
billing_attribution: getBillingAttribution(),
});
}
getLimits() {
@@ -42,7 +42,10 @@ describe('#enterpriseAccountAPI', () => {
it('#subscription', () => {
accountAPI.subscription();
expect(axiosMock.post).toHaveBeenCalledWith(
'/enterprise/api/v1/subscription'
'/enterprise/api/v1/subscription',
{
billing_attribution: { visitor_id: undefined, session_id: undefined },
}
);
});