@greatwait/contracts 0.2.0 → 0.2.2

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.
Files changed (46) hide show
  1. package/dist/billing.d.ts +339 -0
  2. package/dist/billing.js +131 -1
  3. package/dist/host-correlation.d.ts +4 -0
  4. package/dist/host-correlation.js +18 -0
  5. package/dist/identifiers.d.ts +2 -0
  6. package/dist/identifiers.js +3 -0
  7. package/dist/index.d.ts +2 -1
  8. package/dist/index.js +2 -1
  9. package/dist/operations.d.ts +514 -0
  10. package/dist/operations.js +93 -1
  11. package/dist/protocol.d.ts +2 -0
  12. package/dist/protocol.js +3 -0
  13. package/dist/scheduling-records.d.ts +4 -0
  14. package/dist/scheduling.d.ts +12 -0
  15. package/dist/scheduling.js +13 -0
  16. package/generated/v1/examples/billing.promotions.response.json +26 -0
  17. package/generated/v1/examples/billing.redeem.request.json +4 -0
  18. package/generated/v1/examples/billing.redeem.response.json +43 -0
  19. package/generated/v1/manifest.json +56 -0
  20. package/generated/v1/openapi.json +2749 -89
  21. package/generated/v1/policy-matrix.json +14 -0
  22. package/generated/v1/schemas/billing.change.response.json +64 -0
  23. package/generated/v1/schemas/billing.projects.response.json +64 -0
  24. package/generated/v1/schemas/billing.promotions.response.json +188 -0
  25. package/generated/v1/schemas/billing.quote.response.json +51 -0
  26. package/generated/v1/schemas/billing.reconcile.response.json +324 -0
  27. package/generated/v1/schemas/billing.redeem.request-headers.json +13 -0
  28. package/generated/v1/schemas/billing.redeem.request.json +22 -0
  29. package/generated/v1/schemas/billing.redeem.response-headers.json +10 -0
  30. package/generated/v1/schemas/billing.redeem.response.json +326 -0
  31. package/generated/v1/schemas/billing.summary.response.json +324 -0
  32. package/generated/v1/schemas/executions.list.query.json +12 -0
  33. package/generated/v1/schemas/schedules.archive.response.json +17 -0
  34. package/generated/v1/schemas/schedules.cancel.response.json +17 -0
  35. package/generated/v1/schemas/schedules.create.request.json +17 -0
  36. package/generated/v1/schemas/schedules.create.response.json +17 -0
  37. package/generated/v1/schemas/schedules.list.query.json +12 -0
  38. package/generated/v1/schemas/schedules.list.response.json +17 -0
  39. package/generated/v1/schemas/schedules.pause.response.json +17 -0
  40. package/generated/v1/schemas/schedules.read.response.json +17 -0
  41. package/generated/v1/schemas/schedules.replace.request.json +17 -0
  42. package/generated/v1/schemas/schedules.replace.response.json +17 -0
  43. package/generated/v1/schemas/schedules.resume.response.json +17 -0
  44. package/generated/v1/snippets/billing.promotions.json +6 -0
  45. package/generated/v1/snippets/billing.redeem.json +6 -0
  46. package/package.json +1 -1
@@ -10,7 +10,7 @@ import { callbackEndpointCreatedSchema, callbackEndpointEnsuredSchema, callbackE
10
10
  import { FORECAST_WINDOW_VERSION, forecastRequestSchema, forecastSchema, forecastRequestHeadersSchema, forecastWindowsSchema, } from "./forecast.js";
11
11
  import { usageRequestSchema, usageSchema } from "./usage.js";
12
12
  import { deliveryTimingSummarySchema } from "./timing.js";
13
- import { billingAutoTopUpApplyRequestSchema, billingAutoTopUpPreviewRequestSchema, billingAutoTopUpPreviewSchema, billingCeilingUpdateRequestSchema, billingFundingQuoteRequestSchema, billingFundingQuoteSchema, billingFundingViewSchema, billingNoticePageSchema, billingNotificationSettingsSchema, billingNotificationSettingsUpdateRequestSchema, billingLedgerPageSchema, billingLedgerRequestSchema, billingBudgetUpdateRequestHeadersSchema, billingBudgetUpdateRequestSchema, billingBudgetUpdateResponseSchema, billingPurchaseRequestSchema, billingRefundRequestCreateSchema, billingRefundResolutionRequestSchema, billingRefundRequestViewSchema, billingSummarySchema, projectBillingStateSchema, projectBillingQuoteSchema, projectBillingQuoteRequestSchema, projectBillingChangeRequestSchema, billingPortalSchema, billingInvoiceListSchema, billingPaymentHistoryPageSchema, billingInvoiceHistoryPageSchema, billingPaymentMethodSchema, billingPaymentMethodSetupRequestSchema, billingPaymentMethodConfirmRequestSchema, billingPaymentMethodRemoveRequestSchema, } from "./billing.js";
13
+ import { billingAutoTopUpApplyRequestSchema, billingAutoTopUpPreviewRequestSchema, billingAutoTopUpPreviewSchema, billingCeilingUpdateRequestSchema, billingFundingQuoteRequestSchema, billingFundingQuoteSchema, billingFundingViewSchema, billingNoticePageSchema, billingNotificationSettingsSchema, billingNotificationSettingsUpdateRequestSchema, billingLedgerPageSchema, billingLedgerRequestSchema, billingBudgetUpdateRequestHeadersSchema, billingBudgetUpdateRequestSchema, billingBudgetUpdateResponseSchema, billingPurchaseRequestSchema, billingRefundRequestCreateSchema, billingRefundResolutionRequestSchema, billingRefundRequestViewSchema, billingSummarySchema, billingPromotionsSchema, billingRedeemRequestSchema, billingRedeemResponseSchema, projectBillingStateSchema, projectBillingQuoteSchema, projectBillingQuoteRequestSchema, projectBillingChangeRequestSchema, billingPortalSchema, billingInvoiceListSchema, billingPaymentHistoryPageSchema, billingInvoiceHistoryPageSchema, billingPaymentMethodSchema, billingPaymentMethodSetupRequestSchema, billingPaymentMethodConfirmRequestSchema, billingPaymentMethodRemoveRequestSchema, } from "./billing.js";
14
14
  import { conditionalRequestHeaderSchema, idempotencyReplayResponseHeaderSchema, idempotencyRequestHeaderSchema, historyPageRequestSchema, pageRequestSchema, scheduleListRequestSchema, replayedResponseHeaderSchema, requiredConditionalRequestHeaderSchema, requiredIdempotencyRequestHeaderSchema, versionResponseHeaderSchema, } from "./protocol.js";
15
15
  import { oauthGrantListSchema, oauthGrantRevokedSchema } from "./oauth.js";
16
16
  import { credentialCreatedSchema, credentialPageSchema, credentialRequestSchema, credentialRevokedSchema, credentialRotatedSchema, credentialRotationRequestSchema, } from "./secrets.js";
@@ -76,6 +76,24 @@ const PROJECT_BILLING_QUOTE_EXAMPLE = {
76
76
  effectiveAt: "2026-09-10T12:00:00.000Z",
77
77
  formerIncludedWillBlock: false,
78
78
  };
79
+ const BILLING_PROMOTIONS_EXAMPLE = {
80
+ grants: [
81
+ {
82
+ benefit: {
83
+ amount: { currency: "USD", microdollars: "10000000", scale: 6 },
84
+ kind: "credit",
85
+ },
86
+ endsAt: "2026-12-08T12:00:00.000Z",
87
+ id: "grn_01hzy3v8k2m9q4r6t7w8x9y0za",
88
+ source: "code",
89
+ startsAt: "2026-09-09T12:00:00.000Z",
90
+ state: "active",
91
+ },
92
+ ],
93
+ perks: [],
94
+ projectCapacity: { complimentary: 0, included: 1, paid: 0 },
95
+ restrictions: [],
96
+ };
79
97
  const BILLING_SUMMARY_EXAMPLE = {
80
98
  activation: {
81
99
  boundary: "2026-09-01T00:00:00.000Z",
@@ -2427,6 +2445,80 @@ export const OPERATIONS = [
2427
2445
  : "Read exact execution-credit state",
2428
2446
  surfaces: ["api", "mock"],
2429
2447
  },
2448
+ {
2449
+ creates: false,
2450
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2451
+ ? ""
2452
+ : "Lists the verified organization's launch promotions: each promotional credit grant, complimentary project slot, perk and project-subscription discount, whether it came from an operator or a redeemed code, and when it ends or was revoked. Also reports effective project capacity by source and any restriction that applies. Promotional credit balances by kind are on billing.summary. Promotional value has no cash value, is never refunded and cannot move to another organization or product.",
2453
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2454
+ ? {}
2455
+ : BILLING_PROMOTIONS_EXAMPLE,
2456
+ environments: ["live"],
2457
+ id: "billing.promotions",
2458
+ idempotent: true,
2459
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2460
+ method: "GET",
2461
+ mutates: false,
2462
+ path: "/v1/billing/promotions",
2463
+ principals: ["api-credential", "oauth", "session"],
2464
+ problems: ["service_unavailable", "test_to_live_escalation"],
2465
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2466
+ ? API_UNUSED_RESPONSE_SCHEMA
2467
+ : billingPromotionsSchema,
2468
+ scopes: ["usage:read"],
2469
+ sessionAuthority: "headers",
2470
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2471
+ ? ""
2472
+ : "List promotions and complimentary grants",
2473
+ surfaces: ["api", "mock"],
2474
+ },
2475
+ {
2476
+ creates: true,
2477
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2478
+ ? ""
2479
+ : "Redeems one promotion code for the verified organization, with the billing owner's explicit confirmation. A code carries one benefit: promotional execution credit that expires and is spent before purchased credit, a complimentary slot for a named project that never becomes a paid subscription, a perk, or a discount on the project subscription shown in the next project quote. Every code that cannot be redeemed — unknown, ended, used up, not for this organization, or not combinable with a benefit already held — receives the same not_found answer; repeated refusals are throttled with rate_limited. The Idempotency-Key makes retries return the original grant. Nothing is charged and no payment method is needed.",
2480
+ environments: ["live"],
2481
+ id: "billing.redeem",
2482
+ idempotent: true,
2483
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2484
+ method: "POST",
2485
+ mutates: true,
2486
+ path: "/v1/billing/promotions/redeem",
2487
+ principals: ["api-credential", "oauth", "session"],
2488
+ problems: [
2489
+ "idempotency_key_reused",
2490
+ "invalid_request",
2491
+ "not_found",
2492
+ "rate_limited",
2493
+ "service_unavailable",
2494
+ "state_conflict",
2495
+ "test_to_live_escalation",
2496
+ ],
2497
+ request: billingRedeemRequestSchema,
2498
+ requestExample: globalThis
2499
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2500
+ ? {}
2501
+ : { code: "LAUNCH-2026", confirmed: true },
2502
+ requestHeaders: requiredIdempotencyRequestHeaderSchema,
2503
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2504
+ ? API_UNUSED_RESPONSE_SCHEMA
2505
+ : billingRedeemResponseSchema,
2506
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
2507
+ ? {}
2508
+ : { responseHeaders: idempotencyReplayResponseHeaderSchema }),
2509
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2510
+ ? {}
2511
+ : {
2512
+ grant: BILLING_PROMOTIONS_EXAMPLE.grants[0],
2513
+ promotions: BILLING_PROMOTIONS_EXAMPLE,
2514
+ },
2515
+ scopes: ["billing:write"],
2516
+ sessionAuthority: "headers",
2517
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2518
+ ? ""
2519
+ : "Redeem a promotion code",
2520
+ surfaces: ["api", "mock"],
2521
+ },
2430
2522
  BILLING_NOTICE_LIST_OPERATION,
2431
2523
  BILLING_NOTIFICATION_SETTINGS_OPERATION,
2432
2524
  BILLING_NOTIFICATION_SETTINGS_UPDATE_OPERATION,
@@ -54,6 +54,8 @@ export type ScheduleOrder = (typeof SCHEDULE_ORDERS)[number];
54
54
  export declare const scheduleListRequestSchema: import("zod").ZodObject<{
55
55
  cursor: import("zod").ZodOptional<import("zod").ZodString>;
56
56
  limit: import("zod").ZodDefault<import("zod").ZodNumber>;
57
+ external_identifier: import("zod").ZodOptional<import("zod").ZodString>;
58
+ tag: import("zod").ZodOptional<import("zod").ZodString>;
57
59
  dueBefore: import("zod").ZodOptional<import("zod").ZodString>;
58
60
  endpoint: import("zod").ZodOptional<import("zod").ZodString>;
59
61
  order: import("zod").ZodDefault<import("zod").ZodEnum<{
package/dist/protocol.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { z } from "./zod.js";
2
+ import { externalIdentifierSchema, scheduleTagSchema, } from "./host-correlation.js";
2
3
  import { PUBLIC_PAGE_SIZE } from "./configuration-bounds.js";
3
4
  import { endpointIdSchema, environmentIdSchema, organizationIdSchema, projectIdSchema, } from "./identifiers.js";
4
5
  import { timestampSchema } from "./time.js";
@@ -55,6 +56,8 @@ export const SCHEDULE_ORDERS = ["created", "due"];
55
56
  * no instant to compare and inventing one either way would be a guess.
56
57
  */
57
58
  export const scheduleListRequestSchema = pageRequestSchema.extend({
59
+ external_identifier: externalIdentifierSchema.optional(),
60
+ tag: scheduleTagSchema.optional(),
58
61
  dueBefore: timestampSchema.optional(),
59
62
  endpoint: endpointIdSchema.optional(),
60
63
  order: z.enum(SCHEDULE_ORDERS).default("created"),
@@ -117,6 +117,8 @@ export declare const portableScheduleRecordSchema: import("zod").ZodObject<{
117
117
  }>;
118
118
  }, import("zod/v4/core").$strict>;
119
119
  name: import("zod").ZodOptional<import("zod").ZodString>;
120
+ external_identifier: import("zod").ZodOptional<import("zod").ZodString>;
121
+ tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
120
122
  partitionKey: import("zod").ZodOptional<import("zod").ZodString>;
121
123
  nextDueAt: import("zod").ZodOptional<import("zod").ZodString>;
122
124
  recurrence: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
@@ -758,6 +760,8 @@ export declare const portableSchedulingRecordSetSchema: import("zod").ZodObject<
758
760
  }>;
759
761
  }, import("zod/v4/core").$strict>;
760
762
  name: import("zod").ZodOptional<import("zod").ZodString>;
763
+ external_identifier: import("zod").ZodOptional<import("zod").ZodString>;
764
+ tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
761
765
  partitionKey: import("zod").ZodOptional<import("zod").ZodString>;
762
766
  nextDueAt: import("zod").ZodOptional<import("zod").ZodString>;
763
767
  recurrence: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
@@ -371,6 +371,8 @@ export declare const projectOccurrenceListRequestSchema: import("zod").ZodObject
371
371
  cursor: import("zod").ZodOptional<import("zod").ZodString>;
372
372
  limit: import("zod").ZodDefault<import("zod").ZodNumber>;
373
373
  endpoint: import("zod").ZodOptional<import("zod").ZodString>;
374
+ external_identifier: import("zod").ZodOptional<import("zod").ZodString>;
375
+ tag: import("zod").ZodOptional<import("zod").ZodString>;
374
376
  from: import("zod").ZodOptional<import("zod").ZodString>;
375
377
  outcome: import("zod").ZodOptional<import("zod").ZodEnum<{
376
378
  succeeded: "succeeded";
@@ -786,6 +788,8 @@ export declare const scheduleSchema: import("zod").ZodObject<{
786
788
  }>;
787
789
  }, import("zod/v4/core").$strict>;
788
790
  name: import("zod").ZodOptional<import("zod").ZodString>;
791
+ external_identifier: import("zod").ZodOptional<import("zod").ZodString>;
792
+ tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
789
793
  partitionKey: import("zod").ZodOptional<import("zod").ZodString>;
790
794
  nextDueAt: import("zod").ZodOptional<import("zod").ZodString>;
791
795
  recurrence: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
@@ -886,6 +890,8 @@ export declare const schedulePageSchema: import("zod").ZodObject<{
886
890
  }>;
887
891
  }, import("zod/v4/core").$strict>;
888
892
  name: import("zod").ZodOptional<import("zod").ZodString>;
893
+ external_identifier: import("zod").ZodOptional<import("zod").ZodString>;
894
+ tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
889
895
  partitionKey: import("zod").ZodOptional<import("zod").ZodString>;
890
896
  nextDueAt: import("zod").ZodOptional<import("zod").ZodString>;
891
897
  recurrence: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
@@ -1622,6 +1628,8 @@ export declare const scheduleViewSchema: import("zod").ZodObject<{
1622
1628
  }>;
1623
1629
  }, import("zod/v4/core").$strict>;
1624
1630
  name: import("zod").ZodOptional<import("zod").ZodString>;
1631
+ external_identifier: import("zod").ZodOptional<import("zod").ZodString>;
1632
+ tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
1625
1633
  partitionKey: import("zod").ZodOptional<import("zod").ZodString>;
1626
1634
  nextDueAt: import("zod").ZodOptional<import("zod").ZodString>;
1627
1635
  recurrence: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
@@ -1748,6 +1756,8 @@ export declare const scheduleWrittenViewSchema: import("zod").ZodObject<{
1748
1756
  }>;
1749
1757
  }, import("zod/v4/core").$strict>;
1750
1758
  name: import("zod").ZodOptional<import("zod").ZodString>;
1759
+ external_identifier: import("zod").ZodOptional<import("zod").ZodString>;
1760
+ tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
1751
1761
  partitionKey: import("zod").ZodOptional<import("zod").ZodString>;
1752
1762
  nextDueAt: import("zod").ZodOptional<import("zod").ZodString>;
1753
1763
  recurrence: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
@@ -1861,6 +1871,8 @@ export declare const scheduleRequestSchema: import("zod").ZodObject<{
1861
1871
  }, import("zod/v4/core").$strict>>;
1862
1872
  partitionKey: import("zod").ZodOptional<import("zod").ZodString>;
1863
1873
  name: import("zod").ZodOptional<import("zod").ZodString>;
1874
+ external_identifier: import("zod").ZodOptional<import("zod").ZodString>;
1875
+ tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
1864
1876
  timeZone: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>>;
1865
1877
  }, import("zod/v4/core").$strict>;
1866
1878
  export type ScheduleRequest = z.infer<typeof scheduleRequestSchema>;
@@ -1,6 +1,7 @@
1
1
  import { httpRequestSchema, publicHttpRequestSchema } from "./http-request.js";
2
2
  import { FIXED_INTERVAL_MIN_SECONDS, FIXED_INTERVAL_MAX_SECONDS, MAX_INLINE_PAYLOAD_BYTES, } from "./configuration-bounds.js";
3
3
  import { z } from "./zod.js";
4
+ import { externalIdentifierSchema, scheduleTagSchema, scheduleTagsSchema, } from "./host-correlation.js";
4
5
  import { attemptIdSchema, deliveryIdSchema, endpointIdSchema, occurrenceIdSchema, scheduleIdSchema, } from "./identifiers.js";
5
6
  import { CALLBACK_ATTEMPT_DIAGNOSTICS } from "./delivery.js";
6
7
  import { callbackUrlSchema, signingSecretNoticeSchema } from "./endpoints.js";
@@ -380,6 +381,8 @@ export const occurrenceStateSchema = z.enum(OCCURRENCE_STATES);
380
381
  export const projectOccurrenceListRequestSchema = pageRequestSchema
381
382
  .extend({
382
383
  endpoint: endpointIdSchema.optional(),
384
+ external_identifier: externalIdentifierSchema.optional(),
385
+ tag: scheduleTagSchema.optional(),
383
386
  from: timestampSchema.optional(),
384
387
  outcome: occurrenceStateSchema.optional(),
385
388
  schedule: scheduleIdSchema.optional(),
@@ -395,6 +398,8 @@ const PROJECT_OCCURRENCE_LIST_PARAMETERS = [
395
398
  "cursor",
396
399
  "limit",
397
400
  "endpoint",
401
+ "external_identifier",
402
+ "tag",
398
403
  "from",
399
404
  "outcome",
400
405
  "schedule",
@@ -445,6 +450,10 @@ export function projectOccurrenceCursorBinding(request) {
445
450
  operation: "executions.list",
446
451
  parameters: {
447
452
  ...(request.endpoint === undefined ? {} : { endpoint: request.endpoint }),
453
+ ...(request.external_identifier === undefined
454
+ ? {}
455
+ : { external_identifier: request.external_identifier }),
456
+ ...(request.tag === undefined ? {} : { tag: request.tag }),
448
457
  ...(request.from === undefined ? {} : { from: request.from }),
449
458
  ...(request.outcome === undefined ? {} : { outcome: request.outcome }),
450
459
  ...(request.schedule === undefined ? {} : { schedule: request.schedule }),
@@ -917,6 +926,8 @@ export const scheduleSchema = z.object({
917
926
  * projection the migration has not reached, parses rather than fails.
918
927
  */
919
928
  name: scheduleNameSchema.optional(),
929
+ external_identifier: externalIdentifierSchema.optional(),
930
+ tags: scheduleTagsSchema.optional(),
920
931
  partitionKey: partitionKeySchema.optional(),
921
932
  /**
922
933
  * How this schedule recurs, in the vocabulary it will keep being read in.
@@ -1430,6 +1441,8 @@ export const scheduleRequestSchema = z
1430
1441
  * the person kept or changed. Names may collide.
1431
1442
  */
1432
1443
  name: scheduleNameSchema.optional(),
1444
+ external_identifier: externalIdentifierSchema.optional(),
1445
+ tags: scheduleTagsSchema.optional(),
1433
1446
  /**
1434
1447
  * The IANA timezone `cron` is read against. `UTC` when omitted.
1435
1448
  *
@@ -0,0 +1,26 @@
1
+ {
2
+ "grants": [
3
+ {
4
+ "id": "grn_01hzy3v8k2m9q4r6t7w8x9y0za",
5
+ "source": "code",
6
+ "benefit": {
7
+ "kind": "credit",
8
+ "amount": {
9
+ "currency": "USD",
10
+ "microdollars": "10000000",
11
+ "scale": 6
12
+ }
13
+ },
14
+ "state": "active",
15
+ "startsAt": "2026-09-09T12:00:00.000Z",
16
+ "endsAt": "2026-12-08T12:00:00.000Z"
17
+ }
18
+ ],
19
+ "projectCapacity": {
20
+ "included": 1,
21
+ "paid": 0,
22
+ "complimentary": 0
23
+ },
24
+ "perks": [],
25
+ "restrictions": []
26
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "code": "LAUNCH-2026",
3
+ "confirmed": true
4
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "grant": {
3
+ "id": "grn_01hzy3v8k2m9q4r6t7w8x9y0za",
4
+ "source": "code",
5
+ "benefit": {
6
+ "kind": "credit",
7
+ "amount": {
8
+ "currency": "USD",
9
+ "microdollars": "10000000",
10
+ "scale": 6
11
+ }
12
+ },
13
+ "state": "active",
14
+ "startsAt": "2026-09-09T12:00:00.000Z",
15
+ "endsAt": "2026-12-08T12:00:00.000Z"
16
+ },
17
+ "promotions": {
18
+ "grants": [
19
+ {
20
+ "id": "grn_01hzy3v8k2m9q4r6t7w8x9y0za",
21
+ "source": "code",
22
+ "benefit": {
23
+ "kind": "credit",
24
+ "amount": {
25
+ "currency": "USD",
26
+ "microdollars": "10000000",
27
+ "scale": 6
28
+ }
29
+ },
30
+ "state": "active",
31
+ "startsAt": "2026-09-09T12:00:00.000Z",
32
+ "endsAt": "2026-12-08T12:00:00.000Z"
33
+ }
34
+ ],
35
+ "projectCapacity": {
36
+ "included": 1,
37
+ "paid": 0,
38
+ "complimentary": 0
39
+ },
40
+ "perks": [],
41
+ "restrictions": []
42
+ }
43
+ }
@@ -51,11 +51,14 @@
51
51
  "examples/billing.paymentmethodsetup.response.json",
52
52
  "examples/billing.portal.response.json",
53
53
  "examples/billing.projects.response.json",
54
+ "examples/billing.promotions.response.json",
54
55
  "examples/billing.purchase.request.json",
55
56
  "examples/billing.purchase.response.json",
56
57
  "examples/billing.quote.request.json",
57
58
  "examples/billing.quote.response.json",
58
59
  "examples/billing.reconcile.response.json",
60
+ "examples/billing.redeem.request.json",
61
+ "examples/billing.redeem.response.json",
59
62
  "examples/billing.refundrequest.request.json",
60
63
  "examples/billing.refundrequest.response.json",
61
64
  "examples/billing.refundresolution.request.json",
@@ -211,6 +214,7 @@
211
214
  "schemas/billing.paymentmethodsetup.response.json",
212
215
  "schemas/billing.portal.response.json",
213
216
  "schemas/billing.projects.response.json",
217
+ "schemas/billing.promotions.response.json",
214
218
  "schemas/billing.purchase.request-headers.json",
215
219
  "schemas/billing.purchase.request.json",
216
220
  "schemas/billing.purchase.response-headers.json",
@@ -218,6 +222,10 @@
218
222
  "schemas/billing.quote.request.json",
219
223
  "schemas/billing.quote.response.json",
220
224
  "schemas/billing.reconcile.response.json",
225
+ "schemas/billing.redeem.request-headers.json",
226
+ "schemas/billing.redeem.request.json",
227
+ "schemas/billing.redeem.response-headers.json",
228
+ "schemas/billing.redeem.response.json",
221
229
  "schemas/billing.refundrequest.request-headers.json",
222
230
  "schemas/billing.refundrequest.request.json",
223
231
  "schemas/billing.refundrequest.response-headers.json",
@@ -398,9 +406,11 @@
398
406
  "snippets/billing.paymentmethodsetup.json",
399
407
  "snippets/billing.portal.json",
400
408
  "snippets/billing.projects.json",
409
+ "snippets/billing.promotions.json",
401
410
  "snippets/billing.purchase.json",
402
411
  "snippets/billing.quote.json",
403
412
  "snippets/billing.reconcile.json",
413
+ "snippets/billing.redeem.json",
404
414
  "snippets/billing.refundrequest.json",
405
415
  "snippets/billing.refundresolution.json",
406
416
  "snippets/billing.summary.json",
@@ -1830,6 +1840,52 @@
1830
1840
  "sessionAuthority": "headers",
1831
1841
  "surfaces": ["api", "mock"]
1832
1842
  },
1843
+ {
1844
+ "id": "billing.promotions",
1845
+ "method": "GET",
1846
+ "mutates": false,
1847
+ "path": "/v1/billing/promotions",
1848
+ "principals": ["api-credential", "oauth", "session"],
1849
+ "problems": [
1850
+ "authentication_required",
1851
+ "capability_not_configured",
1852
+ "credential_expired",
1853
+ "credential_revoked",
1854
+ "project_archived",
1855
+ "rate_limited",
1856
+ "scope_missing",
1857
+ "service_unavailable",
1858
+ "test_to_live_escalation"
1859
+ ],
1860
+ "scopes": ["usage:read"],
1861
+ "sessionAuthority": "headers",
1862
+ "surfaces": ["api", "mock"]
1863
+ },
1864
+ {
1865
+ "id": "billing.redeem",
1866
+ "method": "POST",
1867
+ "mutates": true,
1868
+ "path": "/v1/billing/promotions/redeem",
1869
+ "principals": ["api-credential", "oauth", "session"],
1870
+ "problems": [
1871
+ "authentication_required",
1872
+ "capability_not_configured",
1873
+ "credential_expired",
1874
+ "credential_revoked",
1875
+ "idempotency_key_reused",
1876
+ "invalid_request",
1877
+ "not_found",
1878
+ "project_archived",
1879
+ "rate_limited",
1880
+ "scope_missing",
1881
+ "service_unavailable",
1882
+ "state_conflict",
1883
+ "test_to_live_escalation"
1884
+ ],
1885
+ "scopes": ["billing:write"],
1886
+ "sessionAuthority": "headers",
1887
+ "surfaces": ["api", "mock"]
1888
+ },
1833
1889
  {
1834
1890
  "id": "billing.notices",
1835
1891
  "method": "GET",