@stewardhq/sdk 0.1.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +437 -0
- package/dist/_chunks/errors.js +73 -0
- package/dist/_chunks/events.d.ts +537 -0
- package/dist/_chunks/events.js +350 -0
- package/dist/_chunks/index.d.ts +6005 -0
- package/dist/_chunks/locale.d.ts +17 -0
- package/dist/_chunks/locale.js +17 -0
- package/dist/_chunks/src.js +1202 -0
- package/dist/_chunks/steward.d.ts +2588 -0
- package/dist/_chunks/steward.js +578 -0
- package/dist/_chunks/validators.d.ts +23 -0
- package/dist/_chunks/validators.js +106 -0
- package/dist/_chunks/webhook-core.d.ts +32 -0
- package/dist/_chunks/webhook-core.js +64 -0
- package/dist/_chunks/webhook.d.ts +22 -0
- package/dist/_chunks/webhook.js +53 -0
- package/dist/contract.d.ts +4 -0
- package/dist/contract.js +4 -0
- package/dist/index.d.ts +268 -0
- package/dist/index.js +784 -0
- package/dist/server.d.ts +236 -0
- package/dist/server.js +384 -0
- package/dist/testing/fixtures/events/LOCK.json +27 -0
- package/dist/testing/fixtures/events/account.deleted.json +36 -0
- package/dist/testing/fixtures/events/account.state_changed.json +53 -0
- package/dist/testing/fixtures/events/account.updated.json +37 -0
- package/dist/testing/fixtures/events/checkout.completed.json +36 -0
- package/dist/testing/fixtures/events/checkout.expired.json +26 -0
- package/dist/testing/fixtures/events/checkout.failed.json +27 -0
- package/dist/testing/fixtures/events/invoice.created.json +37 -0
- package/dist/testing/fixtures/events/invoice.issued.json +38 -0
- package/dist/testing/fixtures/events/invoice.voided.json +39 -0
- package/dist/testing/fixtures/events/subscription.activated.json +40 -0
- package/dist/testing/fixtures/events/subscription.cancel_scheduled.json +38 -0
- package/dist/testing/fixtures/events/subscription.canceled.json +29 -0
- package/dist/testing/fixtures/events/subscription.expired.json +27 -0
- package/dist/testing/fixtures/events/subscription.payment_failed.json +38 -0
- package/dist/testing/fixtures/events/subscription.reactivated.json +36 -0
- package/dist/testing/fixtures/events/subscription.renewed.json +39 -0
- package/dist/testing/fixtures/events/subscription.suspended.json +36 -0
- package/dist/testing/fixtures/events/subscription.terminated.json +28 -0
- package/dist/testing.d.ts +629 -0
- package/dist/testing.js +3759 -0
- package/dist/webhook/web.d.ts +17 -0
- package/dist/webhook/web.js +66 -0
- package/dist/webhook.d.ts +3 -0
- package/dist/webhook.js +3 -0
- package/package.json +70 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "evt_0192f1a0-0000-7000-8000-000000000020",
|
|
3
|
+
"type": "account.state_changed",
|
|
4
|
+
"apiVersion": "2026-10-01",
|
|
5
|
+
"createdAt": "2026-10-01T09:00:00Z",
|
|
6
|
+
"product": "example",
|
|
7
|
+
"accountRef": "acct_42",
|
|
8
|
+
"data": {
|
|
9
|
+
"account": {
|
|
10
|
+
"ref": "acct_42",
|
|
11
|
+
"displayName": "Örnek A.Ş.",
|
|
12
|
+
"version": 2,
|
|
13
|
+
"updatedAt": "2026-10-01T09:00:00Z",
|
|
14
|
+
"planCode": "team",
|
|
15
|
+
"accessState": "active",
|
|
16
|
+
"entitlements": {
|
|
17
|
+
"max_users": null,
|
|
18
|
+
"max_devices": 250,
|
|
19
|
+
"max_networks_per_account": 3,
|
|
20
|
+
"max_approved_routes": 10,
|
|
21
|
+
"max_exit_nodes": 1
|
|
22
|
+
},
|
|
23
|
+
"catalogVersion": "3f2a9c0e7b41d8a65c09e1f4b7d2a8c3",
|
|
24
|
+
"subscription": {
|
|
25
|
+
"id": "0192f1a0-0000-7000-8000-000000000001",
|
|
26
|
+
"status": "past_due",
|
|
27
|
+
"planCode": "team",
|
|
28
|
+
"interval": "month",
|
|
29
|
+
"amountMinor": 125000,
|
|
30
|
+
"currency": "TRY",
|
|
31
|
+
"currentPeriodEnd": "2026-10-01T09:00:00Z",
|
|
32
|
+
"cancelAt": null,
|
|
33
|
+
"cancelAtPeriodEnd": false,
|
|
34
|
+
"pastDueSince": "2026-10-01T09:00:00Z",
|
|
35
|
+
"currentPeriodStart": "2026-09-01T09:00:00Z",
|
|
36
|
+
"dunning": {
|
|
37
|
+
"step": 0,
|
|
38
|
+
"nextActionAt": "2026-10-02T09:00:00Z"
|
|
39
|
+
},
|
|
40
|
+
"scheduledChange": null
|
|
41
|
+
},
|
|
42
|
+
"openCheckout": null,
|
|
43
|
+
"profile": {
|
|
44
|
+
"present": true,
|
|
45
|
+
"kind": "company"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"detail": {
|
|
49
|
+
"cause": "subscription.payment_failed",
|
|
50
|
+
"causeEventId": "evt_0192f1a0-0000-7000-8000-000000000016"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "evt_0192f1a0-0000-7000-8000-000000000010",
|
|
3
|
+
"type": "account.updated",
|
|
4
|
+
"apiVersion": "2026-10-01",
|
|
5
|
+
"createdAt": "2026-10-01T09:00:00Z",
|
|
6
|
+
"product": "example",
|
|
7
|
+
"accountRef": "acct_42",
|
|
8
|
+
"data": {
|
|
9
|
+
"account": {
|
|
10
|
+
"version": 3,
|
|
11
|
+
"planCode": "team",
|
|
12
|
+
"accessState": "active",
|
|
13
|
+
"entitlements": {
|
|
14
|
+
"max_users": null,
|
|
15
|
+
"max_devices": 250,
|
|
16
|
+
"max_networks_per_account": 3,
|
|
17
|
+
"max_approved_routes": 10,
|
|
18
|
+
"max_exit_nodes": 1
|
|
19
|
+
},
|
|
20
|
+
"subscription": {
|
|
21
|
+
"id": "0192f1a0-0000-7000-8000-000000000001",
|
|
22
|
+
"status": "active",
|
|
23
|
+
"planCode": "team",
|
|
24
|
+
"interval": "month",
|
|
25
|
+
"amountMinor": 125000,
|
|
26
|
+
"currency": "TRY",
|
|
27
|
+
"currentPeriodEnd": "2026-11-01T09:00:00Z",
|
|
28
|
+
"cancelAt": null
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"detail": {
|
|
32
|
+
"changed": [
|
|
33
|
+
"entitlements"
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "evt_0192f1a0-0000-7000-8000-000000000011",
|
|
3
|
+
"type": "checkout.completed",
|
|
4
|
+
"apiVersion": "2026-10-01",
|
|
5
|
+
"createdAt": "2026-10-01T09:00:00Z",
|
|
6
|
+
"product": "example",
|
|
7
|
+
"accountRef": "acct_42",
|
|
8
|
+
"data": {
|
|
9
|
+
"account": {
|
|
10
|
+
"version": 1,
|
|
11
|
+
"planCode": "team",
|
|
12
|
+
"accessState": "active",
|
|
13
|
+
"entitlements": {
|
|
14
|
+
"max_users": null,
|
|
15
|
+
"max_devices": 250,
|
|
16
|
+
"max_networks_per_account": 3,
|
|
17
|
+
"max_approved_routes": 10,
|
|
18
|
+
"max_exit_nodes": 1
|
|
19
|
+
},
|
|
20
|
+
"subscription": {
|
|
21
|
+
"id": "0192f1a0-0000-7000-8000-000000000001",
|
|
22
|
+
"status": "active",
|
|
23
|
+
"planCode": "team",
|
|
24
|
+
"interval": "month",
|
|
25
|
+
"amountMinor": 125000,
|
|
26
|
+
"currency": "TRY",
|
|
27
|
+
"currentPeriodEnd": "2026-11-01T09:00:00Z",
|
|
28
|
+
"cancelAt": null
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"detail": {
|
|
32
|
+
"checkoutSessionId": "0192f1a0-0000-7000-8000-000000000004",
|
|
33
|
+
"subscriptionId": "0192f1a0-0000-7000-8000-000000000001"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "evt_0192f1a0-0000-7000-8000-000000000013",
|
|
3
|
+
"type": "checkout.expired",
|
|
4
|
+
"apiVersion": "2026-10-01",
|
|
5
|
+
"createdAt": "2026-10-01T09:00:00Z",
|
|
6
|
+
"product": "example",
|
|
7
|
+
"accountRef": "acct_42",
|
|
8
|
+
"data": {
|
|
9
|
+
"account": {
|
|
10
|
+
"version": 0,
|
|
11
|
+
"planCode": "free",
|
|
12
|
+
"accessState": "active",
|
|
13
|
+
"entitlements": {
|
|
14
|
+
"max_users": 3,
|
|
15
|
+
"max_devices": 15,
|
|
16
|
+
"max_networks_per_account": 1,
|
|
17
|
+
"max_approved_routes": 1,
|
|
18
|
+
"max_exit_nodes": 0
|
|
19
|
+
},
|
|
20
|
+
"subscription": null
|
|
21
|
+
},
|
|
22
|
+
"detail": {
|
|
23
|
+
"checkoutSessionId": "0192f1a0-0000-7000-8000-000000000004"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "evt_0192f1a0-0000-7000-8000-000000000012",
|
|
3
|
+
"type": "checkout.failed",
|
|
4
|
+
"apiVersion": "2026-10-01",
|
|
5
|
+
"createdAt": "2026-10-01T09:00:00Z",
|
|
6
|
+
"product": "example",
|
|
7
|
+
"accountRef": "acct_42",
|
|
8
|
+
"data": {
|
|
9
|
+
"account": {
|
|
10
|
+
"version": 0,
|
|
11
|
+
"planCode": "free",
|
|
12
|
+
"accessState": "active",
|
|
13
|
+
"entitlements": {
|
|
14
|
+
"max_users": 3,
|
|
15
|
+
"max_devices": 15,
|
|
16
|
+
"max_networks_per_account": 1,
|
|
17
|
+
"max_approved_routes": 1,
|
|
18
|
+
"max_exit_nodes": 0
|
|
19
|
+
},
|
|
20
|
+
"subscription": null
|
|
21
|
+
},
|
|
22
|
+
"detail": {
|
|
23
|
+
"checkoutSessionId": "0192f1a0-0000-7000-8000-000000000004",
|
|
24
|
+
"reason": "provider:card_declined"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "evt_0192f1a0-0000-7000-8000-00000000001d",
|
|
3
|
+
"type": "invoice.created",
|
|
4
|
+
"apiVersion": "2026-10-01",
|
|
5
|
+
"createdAt": "2026-10-01T09:00:00Z",
|
|
6
|
+
"product": "example",
|
|
7
|
+
"accountRef": "acct_42",
|
|
8
|
+
"data": {
|
|
9
|
+
"account": {
|
|
10
|
+
"version": 2,
|
|
11
|
+
"planCode": "team",
|
|
12
|
+
"accessState": "active",
|
|
13
|
+
"entitlements": {
|
|
14
|
+
"max_users": null,
|
|
15
|
+
"max_devices": 250,
|
|
16
|
+
"max_networks_per_account": 3,
|
|
17
|
+
"max_approved_routes": 10,
|
|
18
|
+
"max_exit_nodes": 1
|
|
19
|
+
},
|
|
20
|
+
"subscription": {
|
|
21
|
+
"id": "0192f1a0-0000-7000-8000-000000000001",
|
|
22
|
+
"status": "active",
|
|
23
|
+
"planCode": "team",
|
|
24
|
+
"interval": "month",
|
|
25
|
+
"amountMinor": 125000,
|
|
26
|
+
"currency": "TRY",
|
|
27
|
+
"currentPeriodEnd": "2026-11-01T09:00:00Z",
|
|
28
|
+
"cancelAt": null
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"detail": {
|
|
32
|
+
"invoiceId": "0192f1a0-0000-7000-8000-000000000003",
|
|
33
|
+
"totalMinor": 125000,
|
|
34
|
+
"currency": "TRY"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "evt_0192f1a0-0000-7000-8000-00000000001e",
|
|
3
|
+
"type": "invoice.issued",
|
|
4
|
+
"apiVersion": "2026-10-01",
|
|
5
|
+
"createdAt": "2026-10-01T09:00:00Z",
|
|
6
|
+
"product": "example",
|
|
7
|
+
"accountRef": "acct_42",
|
|
8
|
+
"data": {
|
|
9
|
+
"account": {
|
|
10
|
+
"version": 2,
|
|
11
|
+
"planCode": "team",
|
|
12
|
+
"accessState": "active",
|
|
13
|
+
"entitlements": {
|
|
14
|
+
"max_users": null,
|
|
15
|
+
"max_devices": 250,
|
|
16
|
+
"max_networks_per_account": 3,
|
|
17
|
+
"max_approved_routes": 10,
|
|
18
|
+
"max_exit_nodes": 1
|
|
19
|
+
},
|
|
20
|
+
"subscription": {
|
|
21
|
+
"id": "0192f1a0-0000-7000-8000-000000000001",
|
|
22
|
+
"status": "active",
|
|
23
|
+
"planCode": "team",
|
|
24
|
+
"interval": "month",
|
|
25
|
+
"amountMinor": 125000,
|
|
26
|
+
"currency": "TRY",
|
|
27
|
+
"currentPeriodEnd": "2026-11-01T09:00:00Z",
|
|
28
|
+
"cancelAt": null
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"detail": {
|
|
32
|
+
"invoiceId": "0192f1a0-0000-7000-8000-000000000003",
|
|
33
|
+
"number": "NXS2026000000123",
|
|
34
|
+
"totalMinor": 125000,
|
|
35
|
+
"currency": "TRY"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "evt_0192f1a0-0000-7000-8000-000000000f4f",
|
|
3
|
+
"type": "invoice.voided",
|
|
4
|
+
"apiVersion": "2026-10-01",
|
|
5
|
+
"createdAt": "2026-10-01T09:00:00Z",
|
|
6
|
+
"product": "example",
|
|
7
|
+
"accountRef": "acct_42",
|
|
8
|
+
"data": {
|
|
9
|
+
"account": {
|
|
10
|
+
"ref": "acct_42",
|
|
11
|
+
"displayName": "Örnek A.Ş.",
|
|
12
|
+
"version": 4,
|
|
13
|
+
"updatedAt": "2026-09-20T09:00:00Z",
|
|
14
|
+
"planCode": "enterprise",
|
|
15
|
+
"accessState": "active",
|
|
16
|
+
"entitlements": {
|
|
17
|
+
"max_users": null,
|
|
18
|
+
"max_devices": null,
|
|
19
|
+
"max_networks_per_account": 20,
|
|
20
|
+
"max_approved_routes": 100,
|
|
21
|
+
"max_exit_nodes": 10
|
|
22
|
+
},
|
|
23
|
+
"catalogVersion": "3f2a9c0e7b41d8a65c09e1f4b7d2a8c3",
|
|
24
|
+
"subscription": null,
|
|
25
|
+
"openCheckout": null,
|
|
26
|
+
"profile": {
|
|
27
|
+
"present": true,
|
|
28
|
+
"kind": "company"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"detail": {
|
|
32
|
+
"invoiceId": "0192f1a0-0000-7000-8000-000000000004",
|
|
33
|
+
"number": "NXS2026000000124",
|
|
34
|
+
"totalMinor": 6000000,
|
|
35
|
+
"currency": "TRY",
|
|
36
|
+
"reason": "sözleşme yeniden düzenlendi"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "evt_0192f1a0-0000-7000-8000-000000000014",
|
|
3
|
+
"type": "subscription.activated",
|
|
4
|
+
"apiVersion": "2026-10-01",
|
|
5
|
+
"createdAt": "2026-10-01T09:00:00Z",
|
|
6
|
+
"product": "example",
|
|
7
|
+
"accountRef": "acct_42",
|
|
8
|
+
"data": {
|
|
9
|
+
"account": {
|
|
10
|
+
"version": 1,
|
|
11
|
+
"planCode": "team",
|
|
12
|
+
"accessState": "active",
|
|
13
|
+
"entitlements": {
|
|
14
|
+
"max_users": null,
|
|
15
|
+
"max_devices": 250,
|
|
16
|
+
"max_networks_per_account": 3,
|
|
17
|
+
"max_approved_routes": 10,
|
|
18
|
+
"max_exit_nodes": 1
|
|
19
|
+
},
|
|
20
|
+
"subscription": {
|
|
21
|
+
"id": "0192f1a0-0000-7000-8000-000000000001",
|
|
22
|
+
"status": "active",
|
|
23
|
+
"planCode": "team",
|
|
24
|
+
"interval": "month",
|
|
25
|
+
"amountMinor": 125000,
|
|
26
|
+
"currency": "TRY",
|
|
27
|
+
"currentPeriodEnd": "2026-11-01T09:00:00Z",
|
|
28
|
+
"cancelAt": null
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"detail": {
|
|
32
|
+
"subscriptionId": "0192f1a0-0000-7000-8000-000000000001",
|
|
33
|
+
"planCode": "team",
|
|
34
|
+
"interval": "month",
|
|
35
|
+
"amountMinor": 125000,
|
|
36
|
+
"currency": "TRY",
|
|
37
|
+
"actorRef": "user:42"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "evt_0192f1a0-0000-7000-8000-000000000019",
|
|
3
|
+
"type": "subscription.cancel_scheduled",
|
|
4
|
+
"apiVersion": "2026-10-01",
|
|
5
|
+
"createdAt": "2026-10-01T09:00:00Z",
|
|
6
|
+
"product": "example",
|
|
7
|
+
"accountRef": "acct_42",
|
|
8
|
+
"data": {
|
|
9
|
+
"account": {
|
|
10
|
+
"version": 2,
|
|
11
|
+
"planCode": "team",
|
|
12
|
+
"accessState": "active",
|
|
13
|
+
"entitlements": {
|
|
14
|
+
"max_users": null,
|
|
15
|
+
"max_devices": 250,
|
|
16
|
+
"max_networks_per_account": 3,
|
|
17
|
+
"max_approved_routes": 10,
|
|
18
|
+
"max_exit_nodes": 1
|
|
19
|
+
},
|
|
20
|
+
"subscription": {
|
|
21
|
+
"id": "0192f1a0-0000-7000-8000-000000000001",
|
|
22
|
+
"status": "active",
|
|
23
|
+
"planCode": "team",
|
|
24
|
+
"interval": "month",
|
|
25
|
+
"amountMinor": 125000,
|
|
26
|
+
"currency": "TRY",
|
|
27
|
+
"currentPeriodEnd": "2026-11-01T09:00:00Z",
|
|
28
|
+
"cancelAt": "2026-11-01T09:00:00Z"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"detail": {
|
|
32
|
+
"subscriptionId": "0192f1a0-0000-7000-8000-000000000001",
|
|
33
|
+
"cancelAt": "2026-11-01T09:00:00Z",
|
|
34
|
+
"reason": "müşteri talebi",
|
|
35
|
+
"actorRef": "staff:7"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "evt_0192f1a0-0000-7000-8000-00000000001a",
|
|
3
|
+
"type": "subscription.canceled",
|
|
4
|
+
"apiVersion": "2026-10-01",
|
|
5
|
+
"createdAt": "2026-10-01T09:00:00Z",
|
|
6
|
+
"product": "example",
|
|
7
|
+
"accountRef": "acct_42",
|
|
8
|
+
"data": {
|
|
9
|
+
"account": {
|
|
10
|
+
"version": 2,
|
|
11
|
+
"planCode": "free",
|
|
12
|
+
"accessState": "active",
|
|
13
|
+
"entitlements": {
|
|
14
|
+
"max_users": 3,
|
|
15
|
+
"max_devices": 15,
|
|
16
|
+
"max_networks_per_account": 1,
|
|
17
|
+
"max_approved_routes": 1,
|
|
18
|
+
"max_exit_nodes": 0
|
|
19
|
+
},
|
|
20
|
+
"subscription": null
|
|
21
|
+
},
|
|
22
|
+
"detail": {
|
|
23
|
+
"subscriptionId": "0192f1a0-0000-7000-8000-000000000001",
|
|
24
|
+
"reason": "müşteri talebi",
|
|
25
|
+
"effectiveAt": "2026-10-15T12:00:00Z",
|
|
26
|
+
"actorRef": "staff:7"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "evt_0192f1a0-0000-7000-8000-00000000001b",
|
|
3
|
+
"type": "subscription.expired",
|
|
4
|
+
"apiVersion": "2026-10-01",
|
|
5
|
+
"createdAt": "2026-10-01T09:00:00Z",
|
|
6
|
+
"product": "example",
|
|
7
|
+
"accountRef": "acct_42",
|
|
8
|
+
"data": {
|
|
9
|
+
"account": {
|
|
10
|
+
"version": 3,
|
|
11
|
+
"planCode": "free",
|
|
12
|
+
"accessState": "active",
|
|
13
|
+
"entitlements": {
|
|
14
|
+
"max_users": 3,
|
|
15
|
+
"max_devices": 15,
|
|
16
|
+
"max_networks_per_account": 1,
|
|
17
|
+
"max_approved_routes": 1,
|
|
18
|
+
"max_exit_nodes": 0
|
|
19
|
+
},
|
|
20
|
+
"subscription": null
|
|
21
|
+
},
|
|
22
|
+
"detail": {
|
|
23
|
+
"subscriptionId": "0192f1a0-0000-7000-8000-000000000001",
|
|
24
|
+
"effectiveAt": "2026-11-01T09:00:00Z"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "evt_0192f1a0-0000-7000-8000-000000000016",
|
|
3
|
+
"type": "subscription.payment_failed",
|
|
4
|
+
"apiVersion": "2026-10-01",
|
|
5
|
+
"createdAt": "2026-10-01T09:00:00Z",
|
|
6
|
+
"product": "example",
|
|
7
|
+
"accountRef": "acct_42",
|
|
8
|
+
"data": {
|
|
9
|
+
"account": {
|
|
10
|
+
"version": 2,
|
|
11
|
+
"planCode": "team",
|
|
12
|
+
"accessState": "active",
|
|
13
|
+
"entitlements": {
|
|
14
|
+
"max_users": null,
|
|
15
|
+
"max_devices": 250,
|
|
16
|
+
"max_networks_per_account": 3,
|
|
17
|
+
"max_approved_routes": 10,
|
|
18
|
+
"max_exit_nodes": 1
|
|
19
|
+
},
|
|
20
|
+
"subscription": {
|
|
21
|
+
"id": "0192f1a0-0000-7000-8000-000000000001",
|
|
22
|
+
"status": "past_due",
|
|
23
|
+
"planCode": "team",
|
|
24
|
+
"interval": "month",
|
|
25
|
+
"amountMinor": 125000,
|
|
26
|
+
"currency": "TRY",
|
|
27
|
+
"currentPeriodEnd": "2026-11-01T09:00:00Z",
|
|
28
|
+
"cancelAt": null
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"detail": {
|
|
32
|
+
"subscriptionId": "0192f1a0-0000-7000-8000-000000000001",
|
|
33
|
+
"paymentId": "0192f1a0-0000-7000-8000-000000000002",
|
|
34
|
+
"attempt": 1,
|
|
35
|
+
"nextRetryAt": "2026-11-02T09:00:00Z"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "evt_0192f1a0-0000-7000-8000-000000000018",
|
|
3
|
+
"type": "subscription.reactivated",
|
|
4
|
+
"apiVersion": "2026-10-01",
|
|
5
|
+
"createdAt": "2026-10-01T09:00:00Z",
|
|
6
|
+
"product": "example",
|
|
7
|
+
"accountRef": "acct_42",
|
|
8
|
+
"data": {
|
|
9
|
+
"account": {
|
|
10
|
+
"version": 4,
|
|
11
|
+
"planCode": "team",
|
|
12
|
+
"accessState": "active",
|
|
13
|
+
"entitlements": {
|
|
14
|
+
"max_users": null,
|
|
15
|
+
"max_devices": 250,
|
|
16
|
+
"max_networks_per_account": 3,
|
|
17
|
+
"max_approved_routes": 10,
|
|
18
|
+
"max_exit_nodes": 1
|
|
19
|
+
},
|
|
20
|
+
"subscription": {
|
|
21
|
+
"id": "0192f1a0-0000-7000-8000-000000000001",
|
|
22
|
+
"status": "active",
|
|
23
|
+
"planCode": "team",
|
|
24
|
+
"interval": "month",
|
|
25
|
+
"amountMinor": 125000,
|
|
26
|
+
"currency": "TRY",
|
|
27
|
+
"currentPeriodEnd": "2026-11-01T09:00:00Z",
|
|
28
|
+
"cancelAt": null
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"detail": {
|
|
32
|
+
"subscriptionId": "0192f1a0-0000-7000-8000-000000000001",
|
|
33
|
+
"paymentId": "0192f1a0-0000-7000-8000-000000000002"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "evt_0192f1a0-0000-7000-8000-000000000015",
|
|
3
|
+
"type": "subscription.renewed",
|
|
4
|
+
"apiVersion": "2026-10-01",
|
|
5
|
+
"createdAt": "2026-10-01T09:00:00Z",
|
|
6
|
+
"product": "example",
|
|
7
|
+
"accountRef": "acct_42",
|
|
8
|
+
"data": {
|
|
9
|
+
"account": {
|
|
10
|
+
"version": 2,
|
|
11
|
+
"planCode": "team",
|
|
12
|
+
"accessState": "active",
|
|
13
|
+
"entitlements": {
|
|
14
|
+
"max_users": null,
|
|
15
|
+
"max_devices": 250,
|
|
16
|
+
"max_networks_per_account": 3,
|
|
17
|
+
"max_approved_routes": 10,
|
|
18
|
+
"max_exit_nodes": 1
|
|
19
|
+
},
|
|
20
|
+
"subscription": {
|
|
21
|
+
"id": "0192f1a0-0000-7000-8000-000000000001",
|
|
22
|
+
"status": "active",
|
|
23
|
+
"planCode": "team",
|
|
24
|
+
"interval": "month",
|
|
25
|
+
"amountMinor": 125000,
|
|
26
|
+
"currency": "TRY",
|
|
27
|
+
"currentPeriodEnd": "2026-12-01T09:00:00Z",
|
|
28
|
+
"cancelAt": null
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"detail": {
|
|
32
|
+
"subscriptionId": "0192f1a0-0000-7000-8000-000000000001",
|
|
33
|
+
"paymentId": "0192f1a0-0000-7000-8000-000000000002",
|
|
34
|
+
"periodStart": "2026-11-01T09:00:00Z",
|
|
35
|
+
"periodEnd": "2026-12-01T09:00:00Z",
|
|
36
|
+
"invoiceId": "0192f1a0-0000-7000-8000-000000000003"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "evt_0192f1a0-0000-7000-8000-000000000017",
|
|
3
|
+
"type": "subscription.suspended",
|
|
4
|
+
"apiVersion": "2026-10-01",
|
|
5
|
+
"createdAt": "2026-10-01T09:00:00Z",
|
|
6
|
+
"product": "example",
|
|
7
|
+
"accountRef": "acct_42",
|
|
8
|
+
"data": {
|
|
9
|
+
"account": {
|
|
10
|
+
"version": 3,
|
|
11
|
+
"planCode": "team",
|
|
12
|
+
"accessState": "suspended",
|
|
13
|
+
"entitlements": {
|
|
14
|
+
"max_users": null,
|
|
15
|
+
"max_devices": 250,
|
|
16
|
+
"max_networks_per_account": 3,
|
|
17
|
+
"max_approved_routes": 10,
|
|
18
|
+
"max_exit_nodes": 1
|
|
19
|
+
},
|
|
20
|
+
"subscription": {
|
|
21
|
+
"id": "0192f1a0-0000-7000-8000-000000000001",
|
|
22
|
+
"status": "suspended",
|
|
23
|
+
"planCode": "team",
|
|
24
|
+
"interval": "month",
|
|
25
|
+
"amountMinor": 125000,
|
|
26
|
+
"currency": "TRY",
|
|
27
|
+
"currentPeriodEnd": "2026-11-01T09:00:00Z",
|
|
28
|
+
"cancelAt": null
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"detail": {
|
|
32
|
+
"subscriptionId": "0192f1a0-0000-7000-8000-000000000001",
|
|
33
|
+
"dunningDay": 7
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "evt_0192f1a0-0000-7000-8000-00000000001c",
|
|
3
|
+
"type": "subscription.terminated",
|
|
4
|
+
"apiVersion": "2026-10-01",
|
|
5
|
+
"createdAt": "2026-10-01T09:00:00Z",
|
|
6
|
+
"product": "example",
|
|
7
|
+
"accountRef": "acct_42",
|
|
8
|
+
"data": {
|
|
9
|
+
"account": {
|
|
10
|
+
"version": 5,
|
|
11
|
+
"planCode": "free",
|
|
12
|
+
"accessState": "active",
|
|
13
|
+
"entitlements": {
|
|
14
|
+
"max_users": 3,
|
|
15
|
+
"max_devices": 15,
|
|
16
|
+
"max_networks_per_account": 1,
|
|
17
|
+
"max_approved_routes": 1,
|
|
18
|
+
"max_exit_nodes": 0
|
|
19
|
+
},
|
|
20
|
+
"subscription": null
|
|
21
|
+
},
|
|
22
|
+
"detail": {
|
|
23
|
+
"subscriptionId": "0192f1a0-0000-7000-8000-000000000001",
|
|
24
|
+
"reason": "nonpayment",
|
|
25
|
+
"dunningDay": 30
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|