@flexprice/sdk 2.1.43 → 2.1.44-dev.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.
- package/docs/sdk/models/active-window.md +16 -0
- package/docs/sdk/models/commitment-collection-method.md +17 -0
- package/docs/sdk/models/commitment-early-termination.md +17 -0
- package/docs/sdk/models/commitment-filter-order.md +15 -0
- package/docs/sdk/models/commitment-filter.md +31 -0
- package/docs/sdk/models/commitment-measurement.md +17 -0
- package/docs/sdk/models/commitment-price-input.md +19 -0
- package/docs/sdk/models/commitment-response.md +51 -0
- package/docs/sdk/models/commitment-scope-input.md +18 -0
- package/docs/sdk/models/commitment-scope-type.md +17 -0
- package/docs/sdk/models/commitment-status.md +17 -0
- package/docs/sdk/models/commitment-usage-breakdown.md +26 -0
- package/docs/sdk/models/commitment-usage-value.md +16 -0
- package/docs/sdk/models/create-commitment-request.md +42 -0
- package/docs/sdk/models/create-entitlement-request.md +1 -1
- package/docs/sdk/models/create-price-tier.md +1 -0
- package/docs/sdk/models/create-scheduled-task-request.md +1 -1
- package/docs/sdk/models/create-subscription-request.md +1 -0
- package/docs/sdk/models/delete-events-request.md +26 -0
- package/docs/sdk/models/delete-events-response-response.md +19 -0
- package/docs/sdk/models/delete-events-response.md +16 -0
- package/docs/sdk/models/get-commitment-request.md +17 -0
- package/docs/sdk/models/get-usage-by-subscription-response.md +14 -13
- package/docs/sdk/models/invoice-filter.md +2 -0
- package/docs/sdk/models/invoice-line-item-response.md +1 -0
- package/docs/sdk/models/list-commitments-response.md +16 -0
- package/docs/sdk/models/price-price-tier.md +1 -0
- package/docs/sdk/models/report-query-request.md +1 -0
- package/docs/sdk/models/scheduled-task-entity-type.md +2 -2
- package/docs/sdk/models/self-billing-charge-response.md +35 -0
- package/docs/sdk/models/self-billing-plan-response.md +18 -0
- package/docs/sdk/models/self-billing-summary-response.md +1 -0
- package/docs/sdk/models/subscription-line-item-response.md +2 -0
- package/docs/sdk/models/subscription-subscription-line-item.md +2 -0
- package/docs/sdk/models/terminate-commitment-request-request.md +18 -0
- package/docs/sdk/models/terminate-commitment-request.md +16 -0
- package/docs/sdk/models/trigger-force-run-request.md +6 -1
- package/docs/sdk/models/update-commitment-request-request.md +19 -0
- package/docs/sdk/models/update-commitment-request.md +18 -0
- package/docs/sdk/models/update-entitlement-request.md +1 -1
- package/docs/sdk/models/webhook-dto-commitment-webhook-payload.md +16 -0
- package/docs/sdk/models/webhook-event-name.md +1 -1
- package/docs/sdks/commitments/README.md +476 -0
- package/docs/sdks/events/README.md +86 -0
- package/docs/sdks/selfbilling/README.md +1 -1
- package/docs/sdks/webhookevents/README.md +207 -0
- package/esm/funcs/commitments-create-commitment.d.ts +17 -0
- package/esm/funcs/commitments-create-commitment.d.ts.map +1 -0
- package/esm/funcs/commitments-create-commitment.js +83 -0
- package/esm/funcs/commitments-create-commitment.js.map +1 -0
- package/esm/funcs/commitments-get-commitment.d.ts +17 -0
- package/esm/funcs/commitments-get-commitment.d.ts.map +1 -0
- package/esm/funcs/commitments-get-commitment.js +91 -0
- package/esm/funcs/commitments-get-commitment.js.map +1 -0
- package/esm/funcs/commitments-preview-commitment.d.ts +17 -0
- package/esm/funcs/commitments-preview-commitment.d.ts.map +1 -0
- package/esm/funcs/commitments-preview-commitment.js +83 -0
- package/esm/funcs/commitments-preview-commitment.js.map +1 -0
- package/esm/funcs/commitments-query-commitment.d.ts +17 -0
- package/esm/funcs/commitments-query-commitment.d.ts.map +1 -0
- package/esm/funcs/commitments-query-commitment.js +83 -0
- package/esm/funcs/commitments-query-commitment.js.map +1 -0
- package/esm/funcs/commitments-terminate-commitment.d.ts +17 -0
- package/esm/funcs/commitments-terminate-commitment.d.ts.map +1 -0
- package/esm/funcs/commitments-terminate-commitment.js +93 -0
- package/esm/funcs/commitments-terminate-commitment.js.map +1 -0
- package/esm/funcs/commitments-update-commitment.d.ts +17 -0
- package/esm/funcs/commitments-update-commitment.d.ts.map +1 -0
- package/esm/funcs/commitments-update-commitment.js +93 -0
- package/esm/funcs/commitments-update-commitment.js.map +1 -0
- package/esm/funcs/events-delete-events.d.ts +17 -0
- package/esm/funcs/events-delete-events.d.ts.map +1 -0
- package/esm/funcs/events-delete-events.js +86 -0
- package/esm/funcs/events-delete-events.js.map +1 -0
- package/esm/funcs/self-billing-get-self-billing-summary.d.ts +1 -1
- package/esm/funcs/self-billing-get-self-billing-summary.js +1 -1
- package/esm/funcs/webhook-events-post-webhook-events-commitment-created.d.ts +17 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-created.d.ts.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-created.js +69 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-created.js.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-terminated.d.ts +17 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-terminated.d.ts.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-terminated.js +69 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-terminated.js.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-updated.d.ts +17 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-updated.d.ts.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-updated.js +69 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-updated.js.map +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/config.js.map +1 -1
- package/esm/sdk/commitments.d.ts +47 -0
- package/esm/sdk/commitments.d.ts.map +1 -0
- package/esm/sdk/commitments.js +68 -0
- package/esm/sdk/commitments.js.map +1 -0
- package/esm/sdk/events.d.ts +7 -0
- package/esm/sdk/events.d.ts.map +1 -1
- package/esm/sdk/events.js +10 -0
- package/esm/sdk/events.js.map +1 -1
- package/esm/sdk/models/active-window.d.ts +20 -0
- package/esm/sdk/models/active-window.d.ts.map +1 -0
- package/esm/sdk/models/active-window.js +24 -0
- package/esm/sdk/models/active-window.js.map +1 -0
- package/esm/sdk/models/commitment-collection-method.d.ts +12 -0
- package/esm/sdk/models/commitment-collection-method.d.ts.map +1 -0
- package/esm/sdk/models/commitment-collection-method.js +13 -0
- package/esm/sdk/models/commitment-collection-method.js.map +1 -0
- package/esm/sdk/models/commitment-early-termination.d.ts +11 -0
- package/esm/sdk/models/commitment-early-termination.d.ts.map +1 -0
- package/esm/sdk/models/commitment-early-termination.js +12 -0
- package/esm/sdk/models/commitment-early-termination.js.map +1 -0
- package/esm/sdk/models/commitment-filter.d.ts +60 -0
- package/esm/sdk/models/commitment-filter.d.ts.map +1 -0
- package/esm/sdk/models/commitment-filter.js +51 -0
- package/esm/sdk/models/commitment-filter.js.map +1 -0
- package/esm/sdk/models/commitment-measurement.d.ts +12 -0
- package/esm/sdk/models/commitment-measurement.d.ts.map +1 -0
- package/esm/sdk/models/commitment-measurement.js +13 -0
- package/esm/sdk/models/commitment-measurement.js.map +1 -0
- package/esm/sdk/models/commitment-price-input.d.ts +24 -0
- package/esm/sdk/models/commitment-price-input.d.ts.map +1 -0
- package/esm/sdk/models/commitment-price-input.js +27 -0
- package/esm/sdk/models/commitment-price-input.js.map +1 -0
- package/esm/sdk/models/commitment-response.d.ts +56 -0
- package/esm/sdk/models/commitment-response.d.ts.map +1 -0
- package/esm/sdk/models/commitment-response.js +88 -0
- package/esm/sdk/models/commitment-response.js.map +1 -0
- package/esm/sdk/models/commitment-scope-input.d.ts +18 -0
- package/esm/sdk/models/commitment-scope-input.d.ts.map +1 -0
- package/esm/sdk/models/commitment-scope-input.js +20 -0
- package/esm/sdk/models/commitment-scope-input.js.map +1 -0
- package/esm/sdk/models/commitment-scope-type.d.ts +14 -0
- package/esm/sdk/models/commitment-scope-type.d.ts.map +1 -0
- package/esm/sdk/models/commitment-scope-type.js +15 -0
- package/esm/sdk/models/commitment-scope-type.js.map +1 -0
- package/esm/sdk/models/commitment-status.d.ts +13 -0
- package/esm/sdk/models/commitment-status.d.ts.map +1 -0
- package/esm/sdk/models/commitment-status.js +14 -0
- package/esm/sdk/models/commitment-status.js.map +1 -0
- package/esm/sdk/models/commitment-usage-breakdown.d.ts +33 -0
- package/esm/sdk/models/commitment-usage-breakdown.d.ts.map +1 -0
- package/esm/sdk/models/commitment-usage-breakdown.js +37 -0
- package/esm/sdk/models/commitment-usage-breakdown.js.map +1 -0
- package/esm/sdk/models/commitment-usage-value.d.ts +11 -0
- package/esm/sdk/models/commitment-usage-value.d.ts.map +1 -0
- package/esm/sdk/models/commitment-usage-value.js +15 -0
- package/esm/sdk/models/commitment-usage-value.js.map +1 -0
- package/esm/sdk/models/create-commitment-request.d.ts +64 -0
- package/esm/sdk/models/create-commitment-request.d.ts.map +1 -0
- package/esm/sdk/models/create-commitment-request.js +50 -0
- package/esm/sdk/models/create-commitment-request.js.map +1 -0
- package/esm/sdk/models/create-entitlement-request.d.ts +3 -0
- package/esm/sdk/models/create-entitlement-request.d.ts.map +1 -1
- package/esm/sdk/models/create-entitlement-request.js.map +1 -1
- package/esm/sdk/models/create-price-tier.d.ts +3 -0
- package/esm/sdk/models/create-price-tier.d.ts.map +1 -1
- package/esm/sdk/models/create-price-tier.js +3 -0
- package/esm/sdk/models/create-price-tier.js.map +1 -1
- package/esm/sdk/models/create-subscription-request.d.ts +9 -0
- package/esm/sdk/models/create-subscription-request.d.ts.map +1 -1
- package/esm/sdk/models/create-subscription-request.js +2 -0
- package/esm/sdk/models/create-subscription-request.js.map +1 -1
- package/esm/sdk/models/delete-events-op.d.ts +14 -0
- package/esm/sdk/models/delete-events-op.d.ts.map +1 -0
- package/esm/sdk/models/delete-events-op.js +21 -0
- package/esm/sdk/models/delete-events-op.js.map +1 -0
- package/esm/sdk/models/delete-events-request.d.ts +38 -0
- package/esm/sdk/models/delete-events-request.d.ts.map +1 -0
- package/esm/sdk/models/delete-events-request.js +27 -0
- package/esm/sdk/models/delete-events-request.js.map +1 -0
- package/esm/sdk/models/delete-events-response.d.ts +11 -0
- package/esm/sdk/models/delete-events-response.d.ts.map +1 -0
- package/esm/sdk/models/delete-events-response.js +21 -0
- package/esm/sdk/models/delete-events-response.js.map +1 -0
- package/esm/sdk/models/get-commitment-op.d.ts +15 -0
- package/esm/sdk/models/get-commitment-op.d.ts.map +1 -0
- package/esm/sdk/models/get-commitment-op.js +12 -0
- package/esm/sdk/models/get-commitment-op.js.map +1 -0
- package/esm/sdk/models/get-usage-by-subscription-response.d.ts +5 -0
- package/esm/sdk/models/get-usage-by-subscription-response.d.ts.map +1 -1
- package/esm/sdk/models/get-usage-by-subscription-response.js +2 -0
- package/esm/sdk/models/get-usage-by-subscription-response.js.map +1 -1
- package/esm/sdk/models/index.d.ts +25 -0
- package/esm/sdk/models/index.d.ts.map +1 -1
- package/esm/sdk/models/index.js +25 -0
- package/esm/sdk/models/index.js.map +1 -1
- package/esm/sdk/models/invoice-filter.d.ts +10 -0
- package/esm/sdk/models/invoice-filter.d.ts.map +1 -1
- package/esm/sdk/models/invoice-filter.js +4 -0
- package/esm/sdk/models/invoice-filter.js.map +1 -1
- package/esm/sdk/models/invoice-line-item-response.d.ts +4 -0
- package/esm/sdk/models/invoice-line-item-response.d.ts.map +1 -1
- package/esm/sdk/models/invoice-line-item-response.js +2 -0
- package/esm/sdk/models/invoice-line-item-response.js.map +1 -1
- package/esm/sdk/models/list-commitments-response.d.ts +13 -0
- package/esm/sdk/models/list-commitments-response.d.ts.map +1 -0
- package/esm/sdk/models/list-commitments-response.js +17 -0
- package/esm/sdk/models/list-commitments-response.js.map +1 -0
- package/esm/sdk/models/price-price-tier.d.ts +2 -0
- package/esm/sdk/models/price-price-tier.d.ts.map +1 -1
- package/esm/sdk/models/price-price-tier.js +3 -0
- package/esm/sdk/models/price-price-tier.js.map +1 -1
- package/esm/sdk/models/price-transform-quantity.d.ts +5 -0
- package/esm/sdk/models/price-transform-quantity.d.ts.map +1 -1
- package/esm/sdk/models/price-transform-quantity.js +15 -1
- package/esm/sdk/models/price-transform-quantity.js.map +1 -1
- package/esm/sdk/models/report-query-request.d.ts +2 -0
- package/esm/sdk/models/report-query-request.d.ts.map +1 -1
- package/esm/sdk/models/report-query-request.js +1 -0
- package/esm/sdk/models/report-query-request.js.map +1 -1
- package/esm/sdk/models/scheduled-task-entity-type.d.ts +1 -0
- package/esm/sdk/models/scheduled-task-entity-type.d.ts.map +1 -1
- package/esm/sdk/models/scheduled-task-entity-type.js +1 -0
- package/esm/sdk/models/scheduled-task-entity-type.js.map +1 -1
- package/esm/sdk/models/self-billing-charge-response.d.ts +45 -0
- package/esm/sdk/models/self-billing-charge-response.d.ts.map +1 -0
- package/esm/sdk/models/self-billing-charge-response.js +63 -0
- package/esm/sdk/models/self-billing-charge-response.js.map +1 -0
- package/esm/sdk/models/self-billing-plan-response.d.ts +14 -0
- package/esm/sdk/models/self-billing-plan-response.d.ts.map +1 -0
- package/esm/sdk/models/self-billing-plan-response.js +18 -0
- package/esm/sdk/models/self-billing-plan-response.js.map +1 -0
- package/esm/sdk/models/self-billing-summary-response.d.ts +2 -0
- package/esm/sdk/models/self-billing-summary-response.d.ts.map +1 -1
- package/esm/sdk/models/self-billing-summary-response.js +2 -0
- package/esm/sdk/models/self-billing-summary-response.js.map +1 -1
- package/esm/sdk/models/subscription-line-item-response.d.ts +5 -0
- package/esm/sdk/models/subscription-line-item-response.d.ts.map +1 -1
- package/esm/sdk/models/subscription-line-item-response.js +4 -0
- package/esm/sdk/models/subscription-line-item-response.js.map +1 -1
- package/esm/sdk/models/subscription-subscription-line-item.d.ts +5 -0
- package/esm/sdk/models/subscription-subscription-line-item.d.ts.map +1 -1
- package/esm/sdk/models/subscription-subscription-line-item.js +4 -0
- package/esm/sdk/models/subscription-subscription-line-item.js.map +1 -1
- package/esm/sdk/models/terminate-commitment-op.d.ts +21 -0
- package/esm/sdk/models/terminate-commitment-op.d.ts.map +1 -0
- package/esm/sdk/models/terminate-commitment-op.js +14 -0
- package/esm/sdk/models/terminate-commitment-op.js.map +1 -0
- package/esm/sdk/models/terminate-commitment-request.d.ts +14 -0
- package/esm/sdk/models/terminate-commitment-request.d.ts.map +1 -0
- package/esm/sdk/models/terminate-commitment-request.js +19 -0
- package/esm/sdk/models/terminate-commitment-request.js.map +1 -0
- package/esm/sdk/models/trigger-force-run-request.d.ts +5 -0
- package/esm/sdk/models/trigger-force-run-request.d.ts.map +1 -1
- package/esm/sdk/models/trigger-force-run-request.js +2 -0
- package/esm/sdk/models/trigger-force-run-request.js.map +1 -1
- package/esm/sdk/models/update-commitment-op.d.ts +21 -0
- package/esm/sdk/models/update-commitment-op.d.ts.map +1 -0
- package/esm/sdk/models/update-commitment-op.js +14 -0
- package/esm/sdk/models/update-commitment-op.js.map +1 -0
- package/esm/sdk/models/update-commitment-request.d.ts +22 -0
- package/esm/sdk/models/update-commitment-request.d.ts.map +1 -0
- package/esm/sdk/models/update-commitment-request.js +21 -0
- package/esm/sdk/models/update-commitment-request.js.map +1 -0
- package/esm/sdk/models/update-entitlement-request.d.ts +3 -0
- package/esm/sdk/models/update-entitlement-request.d.ts.map +1 -1
- package/esm/sdk/models/update-entitlement-request.js.map +1 -1
- package/esm/sdk/models/webhook-dto-commitment-webhook-payload.d.ts +13 -0
- package/esm/sdk/models/webhook-dto-commitment-webhook-payload.d.ts.map +1 -0
- package/esm/sdk/models/webhook-dto-commitment-webhook-payload.js +22 -0
- package/esm/sdk/models/webhook-dto-commitment-webhook-payload.js.map +1 -0
- package/esm/sdk/models/webhook-event-name.d.ts +3 -0
- package/esm/sdk/models/webhook-event-name.d.ts.map +1 -1
- package/esm/sdk/models/webhook-event-name.js +3 -0
- package/esm/sdk/models/webhook-event-name.js.map +1 -1
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +5 -0
- package/esm/sdk/sdk.js.map +1 -1
- package/esm/sdk/self-billing.d.ts +1 -1
- package/esm/sdk/self-billing.js +1 -1
- package/esm/sdk/webhook-events.d.ts +21 -0
- package/esm/sdk/webhook-events.d.ts.map +1 -1
- package/esm/sdk/webhook-events.js +30 -0
- package/esm/sdk/webhook-events.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/commitments-create-commitment.ts +172 -0
- package/src/funcs/commitments-get-commitment.ts +181 -0
- package/src/funcs/commitments-preview-commitment.ts +172 -0
- package/src/funcs/commitments-query-commitment.ts +172 -0
- package/src/funcs/commitments-terminate-commitment.ts +187 -0
- package/src/funcs/commitments-update-commitment.ts +187 -0
- package/src/funcs/events-delete-events.ts +175 -0
- package/src/funcs/self-billing-get-self-billing-summary.ts +1 -1
- package/src/funcs/webhook-events-post-webhook-events-commitment-created.ts +144 -0
- package/src/funcs/webhook-events-post-webhook-events-commitment-terminated.ts +144 -0
- package/src/funcs/webhook-events-post-webhook-events-commitment-updated.ts +144 -0
- package/src/lib/config.ts +3 -3
- package/src/sdk/commitments.ts +121 -0
- package/src/sdk/events.ts +18 -0
- package/src/sdk/models/active-window.ts +54 -0
- package/src/sdk/models/commitment-collection-method.ts +26 -0
- package/src/sdk/models/commitment-early-termination.ts +22 -0
- package/src/sdk/models/commitment-filter.ts +127 -0
- package/src/sdk/models/commitment-measurement.ts +24 -0
- package/src/sdk/models/commitment-price-input.ts +64 -0
- package/src/sdk/models/commitment-response.ts +164 -0
- package/src/sdk/models/commitment-scope-input.ts +49 -0
- package/src/sdk/models/commitment-scope-type.ts +26 -0
- package/src/sdk/models/commitment-status.ts +25 -0
- package/src/sdk/models/commitment-usage-breakdown.ts +86 -0
- package/src/sdk/models/commitment-usage-value.ts +33 -0
- package/src/sdk/models/create-commitment-request.ts +134 -0
- package/src/sdk/models/create-entitlement-request.ts +3 -0
- package/src/sdk/models/create-price-tier.ts +9 -0
- package/src/sdk/models/create-subscription-request.ts +14 -0
- package/src/sdk/models/delete-events-op.ts +45 -0
- package/src/sdk/models/delete-events-request.ts +74 -0
- package/src/sdk/models/delete-events-response.ts +42 -0
- package/src/sdk/models/get-commitment-op.ts +33 -0
- package/src/sdk/models/get-usage-by-subscription-response.ts +11 -0
- package/src/sdk/models/index.ts +25 -0
- package/src/sdk/models/invoice-filter.ts +14 -0
- package/src/sdk/models/invoice-line-item-response.ts +6 -0
- package/src/sdk/models/list-commitments-response.ts +41 -0
- package/src/sdk/models/price-price-tier.ts +7 -0
- package/src/sdk/models/price-transform-quantity.ts +33 -1
- package/src/sdk/models/report-query-request.ts +3 -0
- package/src/sdk/models/scheduled-task-entity-type.ts +1 -0
- package/src/sdk/models/self-billing-charge-response.ts +124 -0
- package/src/sdk/models/self-billing-plan-response.ts +41 -0
- package/src/sdk/models/self-billing-summary-response.ts +6 -0
- package/src/sdk/models/subscription-line-item-response.ts +9 -0
- package/src/sdk/models/subscription-subscription-line-item.ts +9 -0
- package/src/sdk/models/terminate-commitment-op.ts +46 -0
- package/src/sdk/models/terminate-commitment-request.ts +44 -0
- package/src/sdk/models/trigger-force-run-request.ts +7 -0
- package/src/sdk/models/update-commitment-op.ts +46 -0
- package/src/sdk/models/update-commitment-request.ts +48 -0
- package/src/sdk/models/update-entitlement-request.ts +3 -0
- package/src/sdk/models/webhook-dto-commitment-webhook-payload.ts +50 -0
- package/src/sdk/models/webhook-event-name.ts +3 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/self-billing.ts +1 -1
- package/src/sdk/webhook-events.ts +48 -0
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
# Commitments
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
### Available Operations
|
|
6
|
+
|
|
7
|
+
* [createCommitment](#createcommitment) - Create commitment
|
|
8
|
+
* [previewCommitment](#previewcommitment) - Preview commitment
|
|
9
|
+
* [queryCommitment](#querycommitment) - Query commitments
|
|
10
|
+
* [getCommitment](#getcommitment) - Get commitment
|
|
11
|
+
* [updateCommitment](#updatecommitment) - Update commitment
|
|
12
|
+
* [terminateCommitment](#terminatecommitment) - Terminate commitment
|
|
13
|
+
|
|
14
|
+
## createCommitment
|
|
15
|
+
|
|
16
|
+
Creates a commitment on a subscription: a minimum spend or quantity over a term, with optional committed and overage rates.
|
|
17
|
+
|
|
18
|
+
### Example Usage
|
|
19
|
+
|
|
20
|
+
<!-- UsageSnippet language="typescript" operationID="createCommitment" method="post" path="/commitments" -->
|
|
21
|
+
```typescript
|
|
22
|
+
import { Flexprice } from "@flexprice/sdk";
|
|
23
|
+
|
|
24
|
+
const flexprice = new Flexprice({
|
|
25
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
async function run() {
|
|
29
|
+
const result = await flexprice.commitments.createCommitment({
|
|
30
|
+
endDate: new Date("2024-12-01T13:56:43.281Z"),
|
|
31
|
+
measurement: "billing_period",
|
|
32
|
+
name: "<value>",
|
|
33
|
+
scope: {
|
|
34
|
+
entityType: "group",
|
|
35
|
+
},
|
|
36
|
+
startDate: new Date("2026-08-30T15:34:29.816Z"),
|
|
37
|
+
type: "amount",
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
console.log(result);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
run();
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Standalone function
|
|
47
|
+
|
|
48
|
+
The standalone function version of this method:
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
import { FlexpriceCore } from "@flexprice/sdk/core.js";
|
|
52
|
+
import { commitmentsCreateCommitment } from "@flexprice/sdk/funcs/commitments-create-commitment.js";
|
|
53
|
+
|
|
54
|
+
// Use `FlexpriceCore` for best tree-shaking performance.
|
|
55
|
+
// You can create one instance of it to use across an application.
|
|
56
|
+
const flexprice = new FlexpriceCore({
|
|
57
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
async function run() {
|
|
61
|
+
const res = await commitmentsCreateCommitment(flexprice, {
|
|
62
|
+
endDate: new Date("2024-12-01T13:56:43.281Z"),
|
|
63
|
+
measurement: "billing_period",
|
|
64
|
+
name: "<value>",
|
|
65
|
+
scope: {
|
|
66
|
+
entityType: "group",
|
|
67
|
+
},
|
|
68
|
+
startDate: new Date("2026-08-30T15:34:29.816Z"),
|
|
69
|
+
type: "amount",
|
|
70
|
+
});
|
|
71
|
+
if (res.ok) {
|
|
72
|
+
const { value: result } = res;
|
|
73
|
+
console.log(result);
|
|
74
|
+
} else {
|
|
75
|
+
console.log("commitmentsCreateCommitment failed:", res.error);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
run();
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Parameters
|
|
83
|
+
|
|
84
|
+
| Parameter | Type | Required | Description |
|
|
85
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
86
|
+
| `request` | [models.CreateCommitmentRequest](../../sdk/models/create-commitment-request.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
87
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
88
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
89
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
90
|
+
|
|
91
|
+
### Response
|
|
92
|
+
|
|
93
|
+
**Promise\<[models.CommitmentResponse](../../sdk/models/commitment-response.md)\>**
|
|
94
|
+
|
|
95
|
+
### Errors
|
|
96
|
+
|
|
97
|
+
| Error Type | Status Code | Content Type |
|
|
98
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
99
|
+
| models.ErrorsErrorResponse | 400, 404 | application/json |
|
|
100
|
+
| models.ErrorsErrorResponse | 500 | application/json |
|
|
101
|
+
| models.SDKError | 4XX, 5XX | \*/\* |
|
|
102
|
+
|
|
103
|
+
## previewCommitment
|
|
104
|
+
|
|
105
|
+
Validates a commitment and returns its computed value without creating it.
|
|
106
|
+
|
|
107
|
+
### Example Usage
|
|
108
|
+
|
|
109
|
+
<!-- UsageSnippet language="typescript" operationID="previewCommitment" method="post" path="/commitments/preview" -->
|
|
110
|
+
```typescript
|
|
111
|
+
import { Flexprice } from "@flexprice/sdk";
|
|
112
|
+
|
|
113
|
+
const flexprice = new Flexprice({
|
|
114
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
async function run() {
|
|
118
|
+
const result = await flexprice.commitments.previewCommitment({
|
|
119
|
+
endDate: new Date("2025-03-29T18:57:47.888Z"),
|
|
120
|
+
measurement: "window",
|
|
121
|
+
name: "<value>",
|
|
122
|
+
scope: {
|
|
123
|
+
entityType: "group",
|
|
124
|
+
},
|
|
125
|
+
startDate: new Date("2024-09-25T08:18:25.213Z"),
|
|
126
|
+
type: "amount",
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
console.log(result);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
run();
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Standalone function
|
|
136
|
+
|
|
137
|
+
The standalone function version of this method:
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
import { FlexpriceCore } from "@flexprice/sdk/core.js";
|
|
141
|
+
import { commitmentsPreviewCommitment } from "@flexprice/sdk/funcs/commitments-preview-commitment.js";
|
|
142
|
+
|
|
143
|
+
// Use `FlexpriceCore` for best tree-shaking performance.
|
|
144
|
+
// You can create one instance of it to use across an application.
|
|
145
|
+
const flexprice = new FlexpriceCore({
|
|
146
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
async function run() {
|
|
150
|
+
const res = await commitmentsPreviewCommitment(flexprice, {
|
|
151
|
+
endDate: new Date("2025-03-29T18:57:47.888Z"),
|
|
152
|
+
measurement: "window",
|
|
153
|
+
name: "<value>",
|
|
154
|
+
scope: {
|
|
155
|
+
entityType: "group",
|
|
156
|
+
},
|
|
157
|
+
startDate: new Date("2024-09-25T08:18:25.213Z"),
|
|
158
|
+
type: "amount",
|
|
159
|
+
});
|
|
160
|
+
if (res.ok) {
|
|
161
|
+
const { value: result } = res;
|
|
162
|
+
console.log(result);
|
|
163
|
+
} else {
|
|
164
|
+
console.log("commitmentsPreviewCommitment failed:", res.error);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
run();
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Parameters
|
|
172
|
+
|
|
173
|
+
| Parameter | Type | Required | Description |
|
|
174
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
175
|
+
| `request` | [models.CreateCommitmentRequest](../../sdk/models/create-commitment-request.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
176
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
177
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
178
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
179
|
+
|
|
180
|
+
### Response
|
|
181
|
+
|
|
182
|
+
**Promise\<[models.CommitmentResponse](../../sdk/models/commitment-response.md)\>**
|
|
183
|
+
|
|
184
|
+
### Errors
|
|
185
|
+
|
|
186
|
+
| Error Type | Status Code | Content Type |
|
|
187
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
188
|
+
| models.ErrorsErrorResponse | 400 | application/json |
|
|
189
|
+
| models.ErrorsErrorResponse | 500 | application/json |
|
|
190
|
+
| models.SDKError | 4XX, 5XX | \*/\* |
|
|
191
|
+
|
|
192
|
+
## queryCommitment
|
|
193
|
+
|
|
194
|
+
Lists commitments with filtering and sorting. Returns a paginated list.
|
|
195
|
+
|
|
196
|
+
### Example Usage
|
|
197
|
+
|
|
198
|
+
<!-- UsageSnippet language="typescript" operationID="queryCommitment" method="post" path="/commitments/search" -->
|
|
199
|
+
```typescript
|
|
200
|
+
import { Flexprice } from "@flexprice/sdk";
|
|
201
|
+
|
|
202
|
+
const flexprice = new Flexprice({
|
|
203
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
async function run() {
|
|
207
|
+
const result = await flexprice.commitments.queryCommitment({});
|
|
208
|
+
|
|
209
|
+
console.log(result);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
run();
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Standalone function
|
|
216
|
+
|
|
217
|
+
The standalone function version of this method:
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
import { FlexpriceCore } from "@flexprice/sdk/core.js";
|
|
221
|
+
import { commitmentsQueryCommitment } from "@flexprice/sdk/funcs/commitments-query-commitment.js";
|
|
222
|
+
|
|
223
|
+
// Use `FlexpriceCore` for best tree-shaking performance.
|
|
224
|
+
// You can create one instance of it to use across an application.
|
|
225
|
+
const flexprice = new FlexpriceCore({
|
|
226
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
async function run() {
|
|
230
|
+
const res = await commitmentsQueryCommitment(flexprice, {});
|
|
231
|
+
if (res.ok) {
|
|
232
|
+
const { value: result } = res;
|
|
233
|
+
console.log(result);
|
|
234
|
+
} else {
|
|
235
|
+
console.log("commitmentsQueryCommitment failed:", res.error);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
run();
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Parameters
|
|
243
|
+
|
|
244
|
+
| Parameter | Type | Required | Description |
|
|
245
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
246
|
+
| `request` | [models.CommitmentFilter](../../sdk/models/commitment-filter.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
247
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
248
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
249
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
250
|
+
|
|
251
|
+
### Response
|
|
252
|
+
|
|
253
|
+
**Promise\<[models.ListCommitmentsResponse](../../sdk/models/list-commitments-response.md)\>**
|
|
254
|
+
|
|
255
|
+
### Errors
|
|
256
|
+
|
|
257
|
+
| Error Type | Status Code | Content Type |
|
|
258
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
259
|
+
| models.ErrorsErrorResponse | 400 | application/json |
|
|
260
|
+
| models.ErrorsErrorResponse | 500 | application/json |
|
|
261
|
+
| models.SDKError | 4XX, 5XX | \*/\* |
|
|
262
|
+
|
|
263
|
+
## getCommitment
|
|
264
|
+
|
|
265
|
+
Loads a single commitment by ID.
|
|
266
|
+
|
|
267
|
+
### Example Usage
|
|
268
|
+
|
|
269
|
+
<!-- UsageSnippet language="typescript" operationID="getCommitment" method="get" path="/commitments/{id}" -->
|
|
270
|
+
```typescript
|
|
271
|
+
import { Flexprice } from "@flexprice/sdk";
|
|
272
|
+
|
|
273
|
+
const flexprice = new Flexprice({
|
|
274
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
async function run() {
|
|
278
|
+
const result = await flexprice.commitments.getCommitment("<id>");
|
|
279
|
+
|
|
280
|
+
console.log(result);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
run();
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Standalone function
|
|
287
|
+
|
|
288
|
+
The standalone function version of this method:
|
|
289
|
+
|
|
290
|
+
```typescript
|
|
291
|
+
import { FlexpriceCore } from "@flexprice/sdk/core.js";
|
|
292
|
+
import { commitmentsGetCommitment } from "@flexprice/sdk/funcs/commitments-get-commitment.js";
|
|
293
|
+
|
|
294
|
+
// Use `FlexpriceCore` for best tree-shaking performance.
|
|
295
|
+
// You can create one instance of it to use across an application.
|
|
296
|
+
const flexprice = new FlexpriceCore({
|
|
297
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
async function run() {
|
|
301
|
+
const res = await commitmentsGetCommitment(flexprice, "<id>");
|
|
302
|
+
if (res.ok) {
|
|
303
|
+
const { value: result } = res;
|
|
304
|
+
console.log(result);
|
|
305
|
+
} else {
|
|
306
|
+
console.log("commitmentsGetCommitment failed:", res.error);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
run();
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Parameters
|
|
314
|
+
|
|
315
|
+
| Parameter | Type | Required | Description |
|
|
316
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
317
|
+
| `id` | *string* | :heavy_check_mark: | Commitment ID |
|
|
318
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
319
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
320
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
321
|
+
|
|
322
|
+
### Response
|
|
323
|
+
|
|
324
|
+
**Promise\<[models.CommitmentResponse](../../sdk/models/commitment-response.md)\>**
|
|
325
|
+
|
|
326
|
+
### Errors
|
|
327
|
+
|
|
328
|
+
| Error Type | Status Code | Content Type |
|
|
329
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
330
|
+
| models.ErrorsErrorResponse | 400, 404 | application/json |
|
|
331
|
+
| models.ErrorsErrorResponse | 500 | application/json |
|
|
332
|
+
| models.SDKError | 4XX, 5XX | \*/\* |
|
|
333
|
+
|
|
334
|
+
## updateCommitment
|
|
335
|
+
|
|
336
|
+
Updates the descriptive fields of a commitment. Economic terms are immutable.
|
|
337
|
+
|
|
338
|
+
### Example Usage
|
|
339
|
+
|
|
340
|
+
<!-- UsageSnippet language="typescript" operationID="updateCommitment" method="put" path="/commitments/{id}" -->
|
|
341
|
+
```typescript
|
|
342
|
+
import { Flexprice } from "@flexprice/sdk";
|
|
343
|
+
|
|
344
|
+
const flexprice = new Flexprice({
|
|
345
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
async function run() {
|
|
349
|
+
const result = await flexprice.commitments.updateCommitment("<id>", {});
|
|
350
|
+
|
|
351
|
+
console.log(result);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
run();
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### Standalone function
|
|
358
|
+
|
|
359
|
+
The standalone function version of this method:
|
|
360
|
+
|
|
361
|
+
```typescript
|
|
362
|
+
import { FlexpriceCore } from "@flexprice/sdk/core.js";
|
|
363
|
+
import { commitmentsUpdateCommitment } from "@flexprice/sdk/funcs/commitments-update-commitment.js";
|
|
364
|
+
|
|
365
|
+
// Use `FlexpriceCore` for best tree-shaking performance.
|
|
366
|
+
// You can create one instance of it to use across an application.
|
|
367
|
+
const flexprice = new FlexpriceCore({
|
|
368
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
async function run() {
|
|
372
|
+
const res = await commitmentsUpdateCommitment(flexprice, "<id>", {});
|
|
373
|
+
if (res.ok) {
|
|
374
|
+
const { value: result } = res;
|
|
375
|
+
console.log(result);
|
|
376
|
+
} else {
|
|
377
|
+
console.log("commitmentsUpdateCommitment failed:", res.error);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
run();
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### Parameters
|
|
385
|
+
|
|
386
|
+
| Parameter | Type | Required | Description |
|
|
387
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
388
|
+
| `id` | *string* | :heavy_check_mark: | Commitment ID |
|
|
389
|
+
| `body` | [models.UpdateCommitmentRequest](../../sdk/models/update-commitment-request.md) | :heavy_check_mark: | Commitment update |
|
|
390
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
391
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
392
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
393
|
+
|
|
394
|
+
### Response
|
|
395
|
+
|
|
396
|
+
**Promise\<[models.CommitmentResponse](../../sdk/models/commitment-response.md)\>**
|
|
397
|
+
|
|
398
|
+
### Errors
|
|
399
|
+
|
|
400
|
+
| Error Type | Status Code | Content Type |
|
|
401
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
402
|
+
| models.ErrorsErrorResponse | 400, 404 | application/json |
|
|
403
|
+
| models.ErrorsErrorResponse | 500 | application/json |
|
|
404
|
+
| models.SDKError | 4XX, 5XX | \*/\* |
|
|
405
|
+
|
|
406
|
+
## terminateCommitment
|
|
407
|
+
|
|
408
|
+
Ends a commitment early, effective at the given time or now.
|
|
409
|
+
|
|
410
|
+
### Example Usage
|
|
411
|
+
|
|
412
|
+
<!-- UsageSnippet language="typescript" operationID="terminateCommitment" method="post" path="/commitments/{id}/terminate" -->
|
|
413
|
+
```typescript
|
|
414
|
+
import { Flexprice } from "@flexprice/sdk";
|
|
415
|
+
|
|
416
|
+
const flexprice = new Flexprice({
|
|
417
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
async function run() {
|
|
421
|
+
const result = await flexprice.commitments.terminateCommitment("<id>");
|
|
422
|
+
|
|
423
|
+
console.log(result);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
run();
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
### Standalone function
|
|
430
|
+
|
|
431
|
+
The standalone function version of this method:
|
|
432
|
+
|
|
433
|
+
```typescript
|
|
434
|
+
import { FlexpriceCore } from "@flexprice/sdk/core.js";
|
|
435
|
+
import { commitmentsTerminateCommitment } from "@flexprice/sdk/funcs/commitments-terminate-commitment.js";
|
|
436
|
+
|
|
437
|
+
// Use `FlexpriceCore` for best tree-shaking performance.
|
|
438
|
+
// You can create one instance of it to use across an application.
|
|
439
|
+
const flexprice = new FlexpriceCore({
|
|
440
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
async function run() {
|
|
444
|
+
const res = await commitmentsTerminateCommitment(flexprice, "<id>");
|
|
445
|
+
if (res.ok) {
|
|
446
|
+
const { value: result } = res;
|
|
447
|
+
console.log(result);
|
|
448
|
+
} else {
|
|
449
|
+
console.log("commitmentsTerminateCommitment failed:", res.error);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
run();
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
### Parameters
|
|
457
|
+
|
|
458
|
+
| Parameter | Type | Required | Description |
|
|
459
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
460
|
+
| `id` | *string* | :heavy_check_mark: | Commitment ID |
|
|
461
|
+
| `body` | [models.TerminateCommitmentRequest](../../sdk/models/terminate-commitment-request.md) | :heavy_minus_sign: | Termination request |
|
|
462
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
463
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
464
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
465
|
+
|
|
466
|
+
### Response
|
|
467
|
+
|
|
468
|
+
**Promise\<[models.CommitmentResponse](../../sdk/models/commitment-response.md)\>**
|
|
469
|
+
|
|
470
|
+
### Errors
|
|
471
|
+
|
|
472
|
+
| Error Type | Status Code | Content Type |
|
|
473
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
474
|
+
| models.ErrorsErrorResponse | 400, 404 | application/json |
|
|
475
|
+
| models.ErrorsErrorResponse | 500 | application/json |
|
|
476
|
+
| models.SDKError | 4XX, 5XX | \*/\* |
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* [ingestEvent](#ingestevent) - Ingest event
|
|
8
8
|
* [getUsageAnalytics](#getusageanalytics) - Get usage analytics
|
|
9
9
|
* [ingestEventsBulk](#ingesteventsbulk) - Bulk ingest events
|
|
10
|
+
* [deleteEvents](#deleteevents) - Delete events
|
|
10
11
|
* [getEvent](#getevent) - Get event
|
|
11
12
|
* [listRawEvents](#listrawevents) - List raw events
|
|
12
13
|
* [getUsageStatistics](#getusagestatistics) - Get usage statistics
|
|
@@ -251,6 +252,91 @@ run();
|
|
|
251
252
|
| models.ErrorsErrorResponse | 500 | application/json |
|
|
252
253
|
| models.SDKError | 4XX, 5XX | \*/\* |
|
|
253
254
|
|
|
255
|
+
## deleteEvents
|
|
256
|
+
|
|
257
|
+
Hard-deletes ingested events and the meter usage they produced for the named customers and period, optionally narrowed by feature or by exact event id. Refused when anything in scope has already been invoiced. Irreversible.
|
|
258
|
+
|
|
259
|
+
### Example Usage
|
|
260
|
+
|
|
261
|
+
<!-- UsageSnippet language="typescript" operationID="deleteEvents" method="post" path="/events/delete" -->
|
|
262
|
+
```typescript
|
|
263
|
+
import { Flexprice } from "@flexprice/sdk";
|
|
264
|
+
|
|
265
|
+
const flexprice = new Flexprice({
|
|
266
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
async function run() {
|
|
270
|
+
const result = await flexprice.events.deleteEvents({
|
|
271
|
+
externalCustomerIds: [
|
|
272
|
+
"<value 1>",
|
|
273
|
+
"<value 2>",
|
|
274
|
+
],
|
|
275
|
+
periodEnd: new Date("2026-03-28T00:00:00Z"),
|
|
276
|
+
periodStart: new Date("2026-03-01T00:00:00Z"),
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
console.log(result);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
run();
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Standalone function
|
|
286
|
+
|
|
287
|
+
The standalone function version of this method:
|
|
288
|
+
|
|
289
|
+
```typescript
|
|
290
|
+
import { FlexpriceCore } from "@flexprice/sdk/core.js";
|
|
291
|
+
import { eventsDeleteEvents } from "@flexprice/sdk/funcs/events-delete-events.js";
|
|
292
|
+
|
|
293
|
+
// Use `FlexpriceCore` for best tree-shaking performance.
|
|
294
|
+
// You can create one instance of it to use across an application.
|
|
295
|
+
const flexprice = new FlexpriceCore({
|
|
296
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
async function run() {
|
|
300
|
+
const res = await eventsDeleteEvents(flexprice, {
|
|
301
|
+
externalCustomerIds: [
|
|
302
|
+
"<value 1>",
|
|
303
|
+
"<value 2>",
|
|
304
|
+
],
|
|
305
|
+
periodEnd: new Date("2026-03-28T00:00:00Z"),
|
|
306
|
+
periodStart: new Date("2026-03-01T00:00:00Z"),
|
|
307
|
+
});
|
|
308
|
+
if (res.ok) {
|
|
309
|
+
const { value: result } = res;
|
|
310
|
+
console.log(result);
|
|
311
|
+
} else {
|
|
312
|
+
console.log("eventsDeleteEvents failed:", res.error);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
run();
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Parameters
|
|
320
|
+
|
|
321
|
+
| Parameter | Type | Required | Description |
|
|
322
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
323
|
+
| `request` | [models.DeleteEventsRequest](../../sdk/models/delete-events-request.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
324
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
325
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
326
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
327
|
+
|
|
328
|
+
### Response
|
|
329
|
+
|
|
330
|
+
**Promise\<[models.DeleteEventsResponseResponse](../../sdk/models/delete-events-response-response.md)\>**
|
|
331
|
+
|
|
332
|
+
### Errors
|
|
333
|
+
|
|
334
|
+
| Error Type | Status Code | Content Type |
|
|
335
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
336
|
+
| models.ErrorsErrorResponse | 400, 403, 409 | application/json |
|
|
337
|
+
| models.ErrorsErrorResponse | 500 | application/json |
|
|
338
|
+
| models.SDKError | 4XX, 5XX | \*/\* |
|
|
339
|
+
|
|
254
340
|
## getEvent
|
|
255
341
|
|
|
256
342
|
Use when debugging a specific event (e.g. why it failed or how it was aggregated). Reads the meter-usage pipeline; includes processing status and step-by-step debug tracker when unprocessed. Uses ?id= query param because event IDs can contain "/".
|
|
@@ -378,7 +378,7 @@ run();
|
|
|
378
378
|
|
|
379
379
|
## getSelfBillingSummary
|
|
380
380
|
|
|
381
|
-
Returns
|
|
381
|
+
Returns billing status, recent invoices, usage and a plan with charges. Charges use expanded subscription line-item prices, including overrides; without a current subscription they use the configured self-serve plan. Pricing terms are not an invoice total.
|
|
382
382
|
|
|
383
383
|
### Example Usage
|
|
384
384
|
|