@paygentic/sdk 0.9.15 → 0.9.17
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 +34 -6
- package/dist/commonjs/funcs/invoicesV2ListProjectedInvoices.d.ts +18 -0
- package/dist/commonjs/funcs/invoicesV2ListProjectedInvoices.d.ts.map +1 -0
- package/dist/commonjs/funcs/invoicesV2ListProjectedInvoices.js +125 -0
- package/dist/commonjs/funcs/invoicesV2ListProjectedInvoices.js.map +1 -0
- package/dist/commonjs/funcs/invoicesV2RecordInvoicePayment.d.ts +27 -0
- package/dist/commonjs/funcs/invoicesV2RecordInvoicePayment.d.ts.map +1 -0
- package/dist/commonjs/funcs/invoicesV2RecordInvoicePayment.js +133 -0
- package/dist/commonjs/funcs/invoicesV2RecordInvoicePayment.js.map +1 -0
- package/dist/commonjs/funcs/invoicesV2RetryInvoicePayment.d.ts +40 -0
- package/dist/commonjs/funcs/invoicesV2RetryInvoicePayment.d.ts.map +1 -0
- package/dist/commonjs/funcs/invoicesV2RetryInvoicePayment.js +157 -0
- package/dist/commonjs/funcs/invoicesV2RetryInvoicePayment.js.map +1 -0
- package/dist/commonjs/funcs/merchantsReset.d.ts +22 -0
- package/dist/commonjs/funcs/merchantsReset.d.ts.map +1 -0
- package/dist/commonjs/funcs/merchantsReset.js +129 -0
- package/dist/commonjs/funcs/merchantsReset.js.map +1 -0
- package/dist/commonjs/funcs/profitabilityGetProfitability.d.ts +1 -1
- package/dist/commonjs/funcs/profitabilityGetProfitability.js +1 -1
- package/dist/commonjs/funcs/revenueGet.d.ts +1 -1
- package/dist/commonjs/funcs/revenueGet.js +1 -1
- package/dist/commonjs/funcs/subscriptionsMigrateSubscriptionVersion.d.ts +19 -0
- package/dist/commonjs/funcs/subscriptionsMigrateSubscriptionVersion.d.ts.map +1 -0
- package/dist/commonjs/funcs/subscriptionsMigrateSubscriptionVersion.js +127 -0
- package/dist/commonjs/funcs/subscriptionsMigrateSubscriptionVersion.js.map +1 -0
- package/dist/commonjs/funcs/webhooksDisable.d.ts +18 -0
- package/dist/commonjs/funcs/webhooksDisable.d.ts.map +1 -0
- package/dist/commonjs/funcs/webhooksDisable.js +122 -0
- package/dist/commonjs/funcs/webhooksDisable.js.map +1 -0
- package/dist/commonjs/funcs/webhooksEnable.d.ts +19 -0
- package/dist/commonjs/funcs/webhooksEnable.d.ts.map +1 -0
- package/dist/commonjs/funcs/webhooksEnable.js +122 -0
- package/dist/commonjs/funcs/webhooksEnable.js.map +1 -0
- package/dist/commonjs/funcs/webhooksGet.d.ts +19 -0
- package/dist/commonjs/funcs/webhooksGet.d.ts.map +1 -0
- package/dist/commonjs/funcs/webhooksGet.js +122 -0
- package/dist/commonjs/funcs/webhooksGet.js.map +1 -0
- package/dist/commonjs/funcs/webhooksGetPortal.d.ts +19 -0
- package/dist/commonjs/funcs/webhooksGetPortal.d.ts.map +1 -0
- package/dist/commonjs/funcs/webhooksGetPortal.js +122 -0
- package/dist/commonjs/funcs/webhooksGetPortal.js.map +1 -0
- package/dist/commonjs/funcs/webhooksUpdate.d.ts +19 -0
- package/dist/commonjs/funcs/webhooksUpdate.d.ts.map +1 -0
- package/dist/commonjs/funcs/webhooksUpdate.js +123 -0
- package/dist/commonjs/funcs/webhooksUpdate.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/currencybreakdownentry.d.ts +1 -1
- package/dist/commonjs/models/elapsedperiodbilling.d.ts +16 -0
- package/dist/commonjs/models/elapsedperiodbilling.d.ts.map +1 -0
- package/dist/commonjs/models/elapsedperiodbilling.js +50 -0
- package/dist/commonjs/models/elapsedperiodbilling.js.map +1 -0
- package/dist/commonjs/models/errors/index.d.ts +2 -0
- package/dist/commonjs/models/errors/index.d.ts.map +1 -1
- package/dist/commonjs/models/errors/index.js +2 -0
- package/dist/commonjs/models/errors/index.js.map +1 -1
- package/dist/commonjs/models/errors/recordinvoicepayment.d.ts +55 -0
- package/dist/commonjs/models/errors/recordinvoicepayment.d.ts.map +1 -0
- package/dist/commonjs/models/errors/recordinvoicepayment.js +76 -0
- package/dist/commonjs/models/errors/recordinvoicepayment.js.map +1 -0
- package/dist/commonjs/models/errors/retrypaymentresponseerror.d.ts +63 -0
- package/dist/commonjs/models/errors/retrypaymentresponseerror.d.ts.map +1 -0
- package/dist/commonjs/models/errors/retrypaymentresponseerror.js +81 -0
- package/dist/commonjs/models/errors/retrypaymentresponseerror.js.map +1 -0
- package/dist/commonjs/models/grouptrendentry.d.ts +5 -1
- package/dist/commonjs/models/grouptrendentry.d.ts.map +1 -1
- package/dist/commonjs/models/grouptrendentry.js +1 -0
- package/dist/commonjs/models/grouptrendentry.js.map +1 -1
- package/dist/commonjs/models/hostedlinkpaymentresult.d.ts +28 -0
- package/dist/commonjs/models/hostedlinkpaymentresult.d.ts.map +1 -0
- package/dist/commonjs/models/hostedlinkpaymentresult.js +56 -0
- package/dist/commonjs/models/hostedlinkpaymentresult.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +14 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +14 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/invoice.d.ts +7 -6
- package/dist/commonjs/models/invoice.d.ts.map +1 -1
- package/dist/commonjs/models/invoice.js +3 -2
- package/dist/commonjs/models/invoice.js.map +1 -1
- package/dist/commonjs/models/invoicepaymentlinkerrorcode.d.ts +17 -0
- package/dist/commonjs/models/invoicepaymentlinkerrorcode.d.ts.map +1 -0
- package/dist/commonjs/models/invoicepaymentlinkerrorcode.js +51 -0
- package/dist/commonjs/models/invoicepaymentlinkerrorcode.js.map +1 -0
- package/dist/commonjs/models/invoicepaymentmethod.d.ts +16 -0
- package/dist/commonjs/models/invoicepaymentmethod.d.ts.map +1 -0
- package/dist/commonjs/models/invoicepaymentmethod.js +50 -0
- package/dist/commonjs/models/invoicepaymentmethod.js.map +1 -0
- package/dist/commonjs/models/invoicepaymentprovider.d.ts +16 -0
- package/dist/commonjs/models/invoicepaymentprovider.d.ts.map +1 -0
- package/dist/commonjs/models/invoicepaymentprovider.js +50 -0
- package/dist/commonjs/models/invoicepaymentprovider.js.map +1 -0
- package/dist/commonjs/models/merchantreset.d.ts +41 -0
- package/dist/commonjs/models/merchantreset.d.ts.map +1 -0
- package/dist/commonjs/models/merchantreset.js +68 -0
- package/dist/commonjs/models/merchantreset.js.map +1 -0
- package/dist/commonjs/models/migratesubscriptionversionrequest.d.ts +37 -0
- package/dist/commonjs/models/migratesubscriptionversionrequest.d.ts.map +1 -0
- package/dist/commonjs/models/migratesubscriptionversionrequest.js +60 -0
- package/dist/commonjs/models/migratesubscriptionversionrequest.js.map +1 -0
- package/dist/commonjs/models/migratesubscriptionversionresponse.d.ts +47 -0
- package/dist/commonjs/models/migratesubscriptionversionresponse.d.ts.map +1 -0
- package/dist/commonjs/models/migratesubscriptionversionresponse.js +73 -0
- package/dist/commonjs/models/migratesubscriptionversionresponse.js.map +1 -0
- package/dist/commonjs/models/operations/createplan.d.ts +5 -0
- package/dist/commonjs/models/operations/createplan.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createplan.js +1 -0
- package/dist/commonjs/models/operations/createplan.js.map +1 -1
- package/dist/commonjs/models/operations/createsubscription.d.ts +5 -0
- package/dist/commonjs/models/operations/createsubscription.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createsubscription.js +1 -0
- package/dist/commonjs/models/operations/createsubscription.js.map +1 -1
- package/dist/commonjs/models/operations/createwebhooks.d.ts +15 -0
- package/dist/commonjs/models/operations/createwebhooks.d.ts.map +1 -0
- package/dist/commonjs/models/operations/createwebhooks.js +49 -0
- package/dist/commonjs/models/operations/createwebhooks.js.map +1 -0
- package/dist/commonjs/models/operations/deletewebhooks.d.ts +15 -0
- package/dist/commonjs/models/operations/deletewebhooks.d.ts.map +1 -0
- package/dist/commonjs/models/operations/deletewebhooks.js +49 -0
- package/dist/commonjs/models/operations/deletewebhooks.js.map +1 -0
- package/dist/commonjs/models/operations/getwebhookportal.d.ts +15 -0
- package/dist/commonjs/models/operations/getwebhookportal.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getwebhookportal.js +49 -0
- package/dist/commonjs/models/operations/getwebhookportal.js.map +1 -0
- package/dist/commonjs/models/operations/getwebhooks.d.ts +15 -0
- package/dist/commonjs/models/operations/getwebhooks.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getwebhooks.js +49 -0
- package/dist/commonjs/models/operations/getwebhooks.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +10 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +10 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listprojectedinvoices.d.ts +59 -0
- package/dist/commonjs/models/operations/listprojectedinvoices.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listprojectedinvoices.js +70 -0
- package/dist/commonjs/models/operations/listprojectedinvoices.js.map +1 -0
- package/dist/commonjs/models/operations/migratesubscriptionversion.d.ts +18 -0
- package/dist/commonjs/models/operations/migratesubscriptionversion.d.ts.map +1 -0
- package/dist/commonjs/models/operations/migratesubscriptionversion.js +56 -0
- package/dist/commonjs/models/operations/migratesubscriptionversion.js.map +1 -0
- package/dist/commonjs/models/operations/recordinvoicepayment.d.ts +45 -0
- package/dist/commonjs/models/operations/recordinvoicepayment.d.ts.map +1 -0
- package/dist/commonjs/models/operations/recordinvoicepayment.js +75 -0
- package/dist/commonjs/models/operations/recordinvoicepayment.js.map +1 -0
- package/dist/commonjs/models/operations/resetmerchant.d.ts +15 -0
- package/dist/commonjs/models/operations/resetmerchant.d.ts.map +1 -0
- package/dist/commonjs/models/operations/resetmerchant.js +56 -0
- package/dist/commonjs/models/operations/resetmerchant.js.map +1 -0
- package/dist/commonjs/models/operations/retryinvoicepayment.d.ts +30 -0
- package/dist/commonjs/models/operations/retryinvoicepayment.d.ts.map +1 -0
- package/dist/commonjs/models/operations/retryinvoicepayment.js +64 -0
- package/dist/commonjs/models/operations/retryinvoicepayment.js.map +1 -0
- package/dist/commonjs/models/operations/updateplan.d.ts +5 -0
- package/dist/commonjs/models/operations/updateplan.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updateplan.js +1 -0
- package/dist/commonjs/models/operations/updateplan.js.map +1 -1
- package/dist/commonjs/models/operations/updatewebhooks.d.ts +30 -0
- package/dist/commonjs/models/operations/updatewebhooks.d.ts.map +1 -0
- package/dist/commonjs/models/operations/updatewebhooks.js +63 -0
- package/dist/commonjs/models/operations/updatewebhooks.js.map +1 -0
- package/dist/commonjs/models/outofbandpaymentresult.d.ts +15 -0
- package/dist/commonjs/models/outofbandpaymentresult.d.ts.map +1 -0
- package/dist/commonjs/models/outofbandpaymentresult.js +52 -0
- package/dist/commonjs/models/outofbandpaymentresult.js.map +1 -0
- package/dist/commonjs/models/plan.d.ts +5 -0
- package/dist/commonjs/models/plan.d.ts.map +1 -1
- package/dist/commonjs/models/plan.js +2 -0
- package/dist/commonjs/models/plan.js.map +1 -1
- package/dist/commonjs/models/profitabilityrow.d.ts +23 -4
- package/dist/commonjs/models/profitabilityrow.d.ts.map +1 -1
- package/dist/commonjs/models/profitabilityrow.js +13 -1
- package/dist/commonjs/models/profitabilityrow.js.map +1 -1
- package/dist/commonjs/models/profitabilitysummaryresponse.d.ts +1 -1
- package/dist/commonjs/models/retrypaymenterror.d.ts +28 -0
- package/dist/commonjs/models/retrypaymenterror.d.ts.map +1 -0
- package/dist/commonjs/models/retrypaymenterror.js +53 -0
- package/dist/commonjs/models/retrypaymenterror.js.map +1 -0
- package/dist/commonjs/models/retrypaymentresponse.d.ts +46 -0
- package/dist/commonjs/models/retrypaymentresponse.d.ts.map +1 -0
- package/dist/commonjs/models/retrypaymentresponse.js +63 -0
- package/dist/commonjs/models/retrypaymentresponse.js.map +1 -0
- package/dist/commonjs/models/revenuesummaryresponse.d.ts +1 -1
- package/dist/commonjs/models/revenuetrendbucket.d.ts +6 -2
- package/dist/commonjs/models/revenuetrendbucket.d.ts.map +1 -1
- package/dist/commonjs/models/revenuetrendbucket.js +1 -0
- package/dist/commonjs/models/revenuetrendbucket.js.map +1 -1
- package/dist/commonjs/models/subscription.d.ts +29 -0
- package/dist/commonjs/models/subscription.d.ts.map +1 -1
- package/dist/commonjs/models/subscription.js +14 -1
- package/dist/commonjs/models/subscription.js.map +1 -1
- package/dist/commonjs/models/subscriptionintervaladdop.d.ts +1 -1
- package/dist/commonjs/models/versiontransition.d.ts +58 -0
- package/dist/commonjs/models/versiontransition.d.ts.map +1 -0
- package/dist/commonjs/models/versiontransition.js +82 -0
- package/dist/commonjs/models/versiontransition.js.map +1 -0
- package/dist/commonjs/models/webhookportal.d.ts +34 -0
- package/dist/commonjs/models/webhookportal.d.ts.map +1 -0
- package/dist/commonjs/models/webhookportal.js +60 -0
- package/dist/commonjs/models/webhookportal.js.map +1 -0
- package/dist/commonjs/models/webhooks.d.ts +46 -0
- package/dist/commonjs/models/webhooks.d.ts.map +1 -0
- package/dist/commonjs/models/webhooks.js +63 -0
- package/dist/commonjs/models/webhooks.js.map +1 -0
- package/dist/commonjs/sdk/invoicesv2.d.ts +51 -0
- package/dist/commonjs/sdk/invoicesv2.d.ts.map +1 -1
- package/dist/commonjs/sdk/invoicesv2.js +60 -0
- package/dist/commonjs/sdk/invoicesv2.js.map +1 -1
- package/dist/commonjs/sdk/merchants.d.ts +16 -0
- package/dist/commonjs/sdk/merchants.d.ts.map +1 -0
- package/dist/commonjs/sdk/merchants.js +26 -0
- package/dist/commonjs/sdk/merchants.js.map +1 -0
- package/dist/commonjs/sdk/profitability.d.ts +1 -1
- package/dist/commonjs/sdk/profitability.js +1 -1
- package/dist/commonjs/sdk/revenue.d.ts +1 -1
- package/dist/commonjs/sdk/revenue.js +1 -1
- package/dist/commonjs/sdk/sdk.d.ts +6 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +8 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/commonjs/sdk/subscriptions.d.ts +7 -0
- package/dist/commonjs/sdk/subscriptions.d.ts.map +1 -1
- package/dist/commonjs/sdk/subscriptions.js +10 -0
- package/dist/commonjs/sdk/subscriptions.js.map +1 -1
- package/dist/commonjs/sdk/webhooks.d.ts +41 -0
- package/dist/commonjs/sdk/webhooks.d.ts.map +1 -0
- package/dist/commonjs/sdk/webhooks.js +62 -0
- package/dist/commonjs/sdk/webhooks.js.map +1 -0
- package/dist/esm/funcs/invoicesV2ListProjectedInvoices.d.ts +18 -0
- package/dist/esm/funcs/invoicesV2ListProjectedInvoices.d.ts.map +1 -0
- package/dist/esm/funcs/invoicesV2ListProjectedInvoices.js +89 -0
- package/dist/esm/funcs/invoicesV2ListProjectedInvoices.js.map +1 -0
- package/dist/esm/funcs/invoicesV2RecordInvoicePayment.d.ts +27 -0
- package/dist/esm/funcs/invoicesV2RecordInvoicePayment.d.ts.map +1 -0
- package/dist/esm/funcs/invoicesV2RecordInvoicePayment.js +97 -0
- package/dist/esm/funcs/invoicesV2RecordInvoicePayment.js.map +1 -0
- package/dist/esm/funcs/invoicesV2RetryInvoicePayment.d.ts +40 -0
- package/dist/esm/funcs/invoicesV2RetryInvoicePayment.d.ts.map +1 -0
- package/dist/esm/funcs/invoicesV2RetryInvoicePayment.js +121 -0
- package/dist/esm/funcs/invoicesV2RetryInvoicePayment.js.map +1 -0
- package/dist/esm/funcs/merchantsReset.d.ts +22 -0
- package/dist/esm/funcs/merchantsReset.d.ts.map +1 -0
- package/dist/esm/funcs/merchantsReset.js +93 -0
- package/dist/esm/funcs/merchantsReset.js.map +1 -0
- package/dist/esm/funcs/profitabilityGetProfitability.d.ts +1 -1
- package/dist/esm/funcs/profitabilityGetProfitability.js +1 -1
- package/dist/esm/funcs/revenueGet.d.ts +1 -1
- package/dist/esm/funcs/revenueGet.js +1 -1
- package/dist/esm/funcs/subscriptionsMigrateSubscriptionVersion.d.ts +19 -0
- package/dist/esm/funcs/subscriptionsMigrateSubscriptionVersion.d.ts.map +1 -0
- package/dist/esm/funcs/subscriptionsMigrateSubscriptionVersion.js +91 -0
- package/dist/esm/funcs/subscriptionsMigrateSubscriptionVersion.js.map +1 -0
- package/dist/esm/funcs/webhooksDisable.d.ts +18 -0
- package/dist/esm/funcs/webhooksDisable.d.ts.map +1 -0
- package/dist/esm/funcs/webhooksDisable.js +86 -0
- package/dist/esm/funcs/webhooksDisable.js.map +1 -0
- package/dist/esm/funcs/webhooksEnable.d.ts +19 -0
- package/dist/esm/funcs/webhooksEnable.d.ts.map +1 -0
- package/dist/esm/funcs/webhooksEnable.js +86 -0
- package/dist/esm/funcs/webhooksEnable.js.map +1 -0
- package/dist/esm/funcs/webhooksGet.d.ts +19 -0
- package/dist/esm/funcs/webhooksGet.d.ts.map +1 -0
- package/dist/esm/funcs/webhooksGet.js +86 -0
- package/dist/esm/funcs/webhooksGet.js.map +1 -0
- package/dist/esm/funcs/webhooksGetPortal.d.ts +19 -0
- package/dist/esm/funcs/webhooksGetPortal.d.ts.map +1 -0
- package/dist/esm/funcs/webhooksGetPortal.js +86 -0
- package/dist/esm/funcs/webhooksGetPortal.js.map +1 -0
- package/dist/esm/funcs/webhooksUpdate.d.ts +19 -0
- package/dist/esm/funcs/webhooksUpdate.d.ts.map +1 -0
- package/dist/esm/funcs/webhooksUpdate.js +87 -0
- package/dist/esm/funcs/webhooksUpdate.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/currencybreakdownentry.d.ts +1 -1
- package/dist/esm/models/elapsedperiodbilling.d.ts +16 -0
- package/dist/esm/models/elapsedperiodbilling.d.ts.map +1 -0
- package/dist/esm/models/elapsedperiodbilling.js +14 -0
- package/dist/esm/models/elapsedperiodbilling.js.map +1 -0
- package/dist/esm/models/errors/index.d.ts +2 -0
- package/dist/esm/models/errors/index.d.ts.map +1 -1
- package/dist/esm/models/errors/index.js +2 -0
- package/dist/esm/models/errors/index.js.map +1 -1
- package/dist/esm/models/errors/recordinvoicepayment.d.ts +55 -0
- package/dist/esm/models/errors/recordinvoicepayment.d.ts.map +1 -0
- package/dist/esm/models/errors/recordinvoicepayment.js +39 -0
- package/dist/esm/models/errors/recordinvoicepayment.js.map +1 -0
- package/dist/esm/models/errors/retrypaymentresponseerror.d.ts +63 -0
- package/dist/esm/models/errors/retrypaymentresponseerror.d.ts.map +1 -0
- package/dist/esm/models/errors/retrypaymentresponseerror.js +44 -0
- package/dist/esm/models/errors/retrypaymentresponseerror.js.map +1 -0
- package/dist/esm/models/grouptrendentry.d.ts +5 -1
- package/dist/esm/models/grouptrendentry.d.ts.map +1 -1
- package/dist/esm/models/grouptrendentry.js +1 -0
- package/dist/esm/models/grouptrendentry.js.map +1 -1
- package/dist/esm/models/hostedlinkpaymentresult.d.ts +28 -0
- package/dist/esm/models/hostedlinkpaymentresult.d.ts.map +1 -0
- package/dist/esm/models/hostedlinkpaymentresult.js +19 -0
- package/dist/esm/models/hostedlinkpaymentresult.js.map +1 -0
- package/dist/esm/models/index.d.ts +14 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +14 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/invoice.d.ts +7 -6
- package/dist/esm/models/invoice.d.ts.map +1 -1
- package/dist/esm/models/invoice.js +3 -2
- package/dist/esm/models/invoice.js.map +1 -1
- package/dist/esm/models/invoicepaymentlinkerrorcode.d.ts +17 -0
- package/dist/esm/models/invoicepaymentlinkerrorcode.d.ts.map +1 -0
- package/dist/esm/models/invoicepaymentlinkerrorcode.js +15 -0
- package/dist/esm/models/invoicepaymentlinkerrorcode.js.map +1 -0
- package/dist/esm/models/invoicepaymentmethod.d.ts +16 -0
- package/dist/esm/models/invoicepaymentmethod.d.ts.map +1 -0
- package/dist/esm/models/invoicepaymentmethod.js +14 -0
- package/dist/esm/models/invoicepaymentmethod.js.map +1 -0
- package/dist/esm/models/invoicepaymentprovider.d.ts +16 -0
- package/dist/esm/models/invoicepaymentprovider.d.ts.map +1 -0
- package/dist/esm/models/invoicepaymentprovider.js +14 -0
- package/dist/esm/models/invoicepaymentprovider.js.map +1 -0
- package/dist/esm/models/merchantreset.d.ts +41 -0
- package/dist/esm/models/merchantreset.d.ts.map +1 -0
- package/dist/esm/models/merchantreset.js +29 -0
- package/dist/esm/models/merchantreset.js.map +1 -0
- package/dist/esm/models/migratesubscriptionversionrequest.d.ts +37 -0
- package/dist/esm/models/migratesubscriptionversionrequest.d.ts.map +1 -0
- package/dist/esm/models/migratesubscriptionversionrequest.js +23 -0
- package/dist/esm/models/migratesubscriptionversionrequest.js.map +1 -0
- package/dist/esm/models/migratesubscriptionversionresponse.d.ts +47 -0
- package/dist/esm/models/migratesubscriptionversionresponse.d.ts.map +1 -0
- package/dist/esm/models/migratesubscriptionversionresponse.js +34 -0
- package/dist/esm/models/migratesubscriptionversionresponse.js.map +1 -0
- package/dist/esm/models/operations/createplan.d.ts +5 -0
- package/dist/esm/models/operations/createplan.d.ts.map +1 -1
- package/dist/esm/models/operations/createplan.js +1 -0
- package/dist/esm/models/operations/createplan.js.map +1 -1
- package/dist/esm/models/operations/createsubscription.d.ts +5 -0
- package/dist/esm/models/operations/createsubscription.d.ts.map +1 -1
- package/dist/esm/models/operations/createsubscription.js +1 -0
- package/dist/esm/models/operations/createsubscription.js.map +1 -1
- package/dist/esm/models/operations/createwebhooks.d.ts +15 -0
- package/dist/esm/models/operations/createwebhooks.d.ts.map +1 -0
- package/dist/esm/models/operations/createwebhooks.js +12 -0
- package/dist/esm/models/operations/createwebhooks.js.map +1 -0
- package/dist/esm/models/operations/deletewebhooks.d.ts +15 -0
- package/dist/esm/models/operations/deletewebhooks.d.ts.map +1 -0
- package/dist/esm/models/operations/deletewebhooks.js +12 -0
- package/dist/esm/models/operations/deletewebhooks.js.map +1 -0
- package/dist/esm/models/operations/getwebhookportal.d.ts +15 -0
- package/dist/esm/models/operations/getwebhookportal.d.ts.map +1 -0
- package/dist/esm/models/operations/getwebhookportal.js +12 -0
- package/dist/esm/models/operations/getwebhookportal.js.map +1 -0
- package/dist/esm/models/operations/getwebhooks.d.ts +15 -0
- package/dist/esm/models/operations/getwebhooks.d.ts.map +1 -0
- package/dist/esm/models/operations/getwebhooks.js +12 -0
- package/dist/esm/models/operations/getwebhooks.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +10 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +10 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listprojectedinvoices.d.ts +59 -0
- package/dist/esm/models/operations/listprojectedinvoices.d.ts.map +1 -0
- package/dist/esm/models/operations/listprojectedinvoices.js +32 -0
- package/dist/esm/models/operations/listprojectedinvoices.js.map +1 -0
- package/dist/esm/models/operations/migratesubscriptionversion.d.ts +18 -0
- package/dist/esm/models/operations/migratesubscriptionversion.d.ts.map +1 -0
- package/dist/esm/models/operations/migratesubscriptionversion.js +19 -0
- package/dist/esm/models/operations/migratesubscriptionversion.js.map +1 -0
- package/dist/esm/models/operations/recordinvoicepayment.d.ts +45 -0
- package/dist/esm/models/operations/recordinvoicepayment.d.ts.map +1 -0
- package/dist/esm/models/operations/recordinvoicepayment.js +36 -0
- package/dist/esm/models/operations/recordinvoicepayment.js.map +1 -0
- package/dist/esm/models/operations/resetmerchant.d.ts +15 -0
- package/dist/esm/models/operations/resetmerchant.d.ts.map +1 -0
- package/dist/esm/models/operations/resetmerchant.js +19 -0
- package/dist/esm/models/operations/resetmerchant.js.map +1 -0
- package/dist/esm/models/operations/retryinvoicepayment.d.ts +30 -0
- package/dist/esm/models/operations/retryinvoicepayment.d.ts.map +1 -0
- package/dist/esm/models/operations/retryinvoicepayment.js +26 -0
- package/dist/esm/models/operations/retryinvoicepayment.js.map +1 -0
- package/dist/esm/models/operations/updateplan.d.ts +5 -0
- package/dist/esm/models/operations/updateplan.d.ts.map +1 -1
- package/dist/esm/models/operations/updateplan.js +1 -0
- package/dist/esm/models/operations/updateplan.js.map +1 -1
- package/dist/esm/models/operations/updatewebhooks.d.ts +30 -0
- package/dist/esm/models/operations/updatewebhooks.d.ts.map +1 -0
- package/dist/esm/models/operations/updatewebhooks.js +25 -0
- package/dist/esm/models/operations/updatewebhooks.js.map +1 -0
- package/dist/esm/models/outofbandpaymentresult.d.ts +15 -0
- package/dist/esm/models/outofbandpaymentresult.d.ts.map +1 -0
- package/dist/esm/models/outofbandpaymentresult.js +15 -0
- package/dist/esm/models/outofbandpaymentresult.js.map +1 -0
- package/dist/esm/models/plan.d.ts +5 -0
- package/dist/esm/models/plan.d.ts.map +1 -1
- package/dist/esm/models/plan.js +2 -0
- package/dist/esm/models/plan.js.map +1 -1
- package/dist/esm/models/profitabilityrow.d.ts +23 -4
- package/dist/esm/models/profitabilityrow.d.ts.map +1 -1
- package/dist/esm/models/profitabilityrow.js +12 -0
- package/dist/esm/models/profitabilityrow.js.map +1 -1
- package/dist/esm/models/profitabilitysummaryresponse.d.ts +1 -1
- package/dist/esm/models/retrypaymenterror.d.ts +28 -0
- package/dist/esm/models/retrypaymenterror.d.ts.map +1 -0
- package/dist/esm/models/retrypaymenterror.js +16 -0
- package/dist/esm/models/retrypaymenterror.js.map +1 -0
- package/dist/esm/models/retrypaymentresponse.d.ts +46 -0
- package/dist/esm/models/retrypaymentresponse.d.ts.map +1 -0
- package/dist/esm/models/retrypaymentresponse.js +26 -0
- package/dist/esm/models/retrypaymentresponse.js.map +1 -0
- package/dist/esm/models/revenuesummaryresponse.d.ts +1 -1
- package/dist/esm/models/revenuetrendbucket.d.ts +6 -2
- package/dist/esm/models/revenuetrendbucket.d.ts.map +1 -1
- package/dist/esm/models/revenuetrendbucket.js +1 -0
- package/dist/esm/models/revenuetrendbucket.js.map +1 -1
- package/dist/esm/models/subscription.d.ts +29 -0
- package/dist/esm/models/subscription.d.ts.map +1 -1
- package/dist/esm/models/subscription.js +13 -0
- package/dist/esm/models/subscription.js.map +1 -1
- package/dist/esm/models/subscriptionintervaladdop.d.ts +1 -1
- package/dist/esm/models/versiontransition.d.ts +58 -0
- package/dist/esm/models/versiontransition.d.ts.map +1 -0
- package/dist/esm/models/versiontransition.js +44 -0
- package/dist/esm/models/versiontransition.js.map +1 -0
- package/dist/esm/models/webhookportal.d.ts +34 -0
- package/dist/esm/models/webhookportal.d.ts.map +1 -0
- package/dist/esm/models/webhookportal.js +23 -0
- package/dist/esm/models/webhookportal.js.map +1 -0
- package/dist/esm/models/webhooks.d.ts +46 -0
- package/dist/esm/models/webhooks.d.ts.map +1 -0
- package/dist/esm/models/webhooks.js +26 -0
- package/dist/esm/models/webhooks.js.map +1 -0
- package/dist/esm/sdk/invoicesv2.d.ts +51 -0
- package/dist/esm/sdk/invoicesv2.d.ts.map +1 -1
- package/dist/esm/sdk/invoicesv2.js +60 -0
- package/dist/esm/sdk/invoicesv2.js.map +1 -1
- package/dist/esm/sdk/merchants.d.ts +16 -0
- package/dist/esm/sdk/merchants.d.ts.map +1 -0
- package/dist/esm/sdk/merchants.js +22 -0
- package/dist/esm/sdk/merchants.js.map +1 -0
- package/dist/esm/sdk/profitability.d.ts +1 -1
- package/dist/esm/sdk/profitability.js +1 -1
- package/dist/esm/sdk/revenue.d.ts +1 -1
- package/dist/esm/sdk/revenue.js +1 -1
- package/dist/esm/sdk/sdk.d.ts +6 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +8 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/dist/esm/sdk/subscriptions.d.ts +7 -0
- package/dist/esm/sdk/subscriptions.d.ts.map +1 -1
- package/dist/esm/sdk/subscriptions.js +10 -0
- package/dist/esm/sdk/subscriptions.js.map +1 -1
- package/dist/esm/sdk/webhooks.d.ts +41 -0
- package/dist/esm/sdk/webhooks.d.ts.map +1 -0
- package/dist/esm/sdk/webhooks.js +58 -0
- package/dist/esm/sdk/webhooks.js.map +1 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/invoicesV2ListProjectedInvoices.ts +183 -0
- package/src/funcs/invoicesV2RecordInvoicePayment.ts +194 -0
- package/src/funcs/invoicesV2RetryInvoicePayment.ts +219 -0
- package/src/funcs/merchantsReset.ts +185 -0
- package/src/funcs/profitabilityGetProfitability.ts +1 -1
- package/src/funcs/revenueGet.ts +1 -1
- package/src/funcs/subscriptionsMigrateSubscriptionVersion.ts +186 -0
- package/src/funcs/webhooksDisable.ts +175 -0
- package/src/funcs/webhooksEnable.ts +179 -0
- package/src/funcs/webhooksGet.ts +175 -0
- package/src/funcs/webhooksGetPortal.ts +175 -0
- package/src/funcs/webhooksUpdate.ts +179 -0
- package/src/lib/config.ts +2 -2
- package/src/models/currencybreakdownentry.ts +1 -1
- package/src/models/elapsedperiodbilling.ts +23 -0
- package/src/models/errors/index.ts +2 -0
- package/src/models/errors/recordinvoicepayment.ts +86 -0
- package/src/models/errors/retrypaymentresponseerror.ts +102 -0
- package/src/models/grouptrendentry.ts +6 -1
- package/src/models/hostedlinkpaymentresult.ts +56 -0
- package/src/models/index.ts +14 -0
- package/src/models/invoice.ts +7 -6
- package/src/models/invoicepaymentlinkerrorcode.ts +26 -0
- package/src/models/invoicepaymentmethod.ts +23 -0
- package/src/models/invoicepaymentprovider.ts +23 -0
- package/src/models/merchantreset.ts +85 -0
- package/src/models/migratesubscriptionversionrequest.ts +62 -0
- package/src/models/migratesubscriptionversionresponse.ts +122 -0
- package/src/models/operations/createplan.ts +6 -0
- package/src/models/operations/createsubscription.ts +8 -0
- package/src/models/operations/createwebhooks.ts +34 -0
- package/src/models/operations/deletewebhooks.ts +34 -0
- package/src/models/operations/getwebhookportal.ts +34 -0
- package/src/models/operations/getwebhooks.ts +34 -0
- package/src/models/operations/index.ts +10 -0
- package/src/models/operations/listprojectedinvoices.ts +110 -0
- package/src/models/operations/migratesubscriptionversion.ts +47 -0
- package/src/models/operations/recordinvoicepayment.ts +112 -0
- package/src/models/operations/resetmerchant.ts +40 -0
- package/src/models/operations/retryinvoicepayment.ts +74 -0
- package/src/models/operations/updateplan.ts +6 -0
- package/src/models/operations/updatewebhooks.ts +71 -0
- package/src/models/outofbandpaymentresult.ts +37 -0
- package/src/models/plan.ts +9 -0
- package/src/models/profitabilityrow.ts +27 -4
- package/src/models/profitabilitysummaryresponse.ts +1 -1
- package/src/models/retrypaymenterror.ts +52 -0
- package/src/models/retrypaymentresponse.ts +80 -0
- package/src/models/revenuesummaryresponse.ts +1 -1
- package/src/models/revenuetrendbucket.ts +7 -2
- package/src/models/subscription.ts +45 -0
- package/src/models/subscriptionintervaladdop.ts +1 -1
- package/src/models/versiontransition.ts +104 -0
- package/src/models/webhookportal.ts +61 -0
- package/src/models/webhooks.ts +76 -0
- package/src/sdk/invoicesv2.ts +84 -0
- package/src/sdk/merchants.ts +31 -0
- package/src/sdk/profitability.ts +1 -1
- package/src/sdk/revenue.ts +1 -1
- package/src/sdk/sdk.ts +12 -0
- package/src/sdk/subscriptions.ts +18 -0
- package/src/sdk/webhooks.ts +100 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { PaygenticCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import * as errors from "../models/errors/index.js";
|
|
21
|
+
import { PaygenticError } from "../models/errors/paygenticerror.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as models from "../models/index.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Retry Payment
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Charge the customer's saved payment method again for an unpaid invoice.
|
|
34
|
+
*
|
|
35
|
+
* The invoice must be in status `ISSUED` or `PAYMENT_FAILED`, auto-charge must be on for its subscription, and the invoice must have a payment session. If not, the response is 400.
|
|
36
|
+
*
|
|
37
|
+
* The response status tells you the result. Only 200 means that the charge succeeded. Every other response from this operation that has a `retry_payment_result` body has `success: false`, and `error.code` gives the reason:
|
|
38
|
+
*
|
|
39
|
+
* | Status | `error.code` | Meaning |
|
|
40
|
+
* | --- | --- | --- |
|
|
41
|
+
* | 200 | — | The charge succeeded, the provider had already collected it, or no amount is unpaid. |
|
|
42
|
+
* | 202 | `processing` | The provider accepted the charge. It settles later (for example, a bank debit). |
|
|
43
|
+
* | 402 | a decline code, for example `card_declined`, `insufficient_funds`, `do_not_honor`, `authentication_required` | The provider declined the payment method. |
|
|
44
|
+
* | 409 | `concurrent_attempt` | Another payment attempt for this invoice is in progress. |
|
|
45
|
+
* | 409 | `PAYMENT_SESSION_EXPIRED` | The payment link expired (after 30 days). Create a new link with `POST /v2/invoices/{id}/payment` and `method: hosted_link`, then retry. If the customer also has no usable saved payment method, the response is 422 instead. |
|
|
46
|
+
* | 409 | another value, or no `code` | The payment session cannot be charged in its current state (for example `session_unusable`, `non_confirmable`, `PAYMENT_PROCESSING`, `PAYMENT_ALREADY_COMPLETED`). Read `error.message` for the cause. |
|
|
47
|
+
* | 422 | `no_payment_method` | The customer has no usable saved payment method. Send a payment link instead. |
|
|
48
|
+
* | 502 | `provider_unavailable` or none | The payment provider did not answer, or the provider failed the charge for a reason that is not known. Retry later. |
|
|
49
|
+
*
|
|
50
|
+
* A 500 response has the standard error body, not `retry_payment_result`. It is an internal error, and a retry does not fix it.
|
|
51
|
+
*
|
|
52
|
+
* An invoice that does not exist returns 403, the same as an invoice of another merchant.
|
|
53
|
+
*
|
|
54
|
+
* This operation is rate limited to one call each minute for each invoice.
|
|
55
|
+
*/
|
|
56
|
+
export function invoicesV2RetryInvoicePayment(
|
|
57
|
+
client: PaygenticCore,
|
|
58
|
+
request: operations.RetryInvoicePaymentRequest,
|
|
59
|
+
options?: RequestOptions,
|
|
60
|
+
): APIPromise<
|
|
61
|
+
Result<
|
|
62
|
+
models.RetryPaymentResponse,
|
|
63
|
+
| errors.BadRequest
|
|
64
|
+
| errors.RetryPaymentResponseError
|
|
65
|
+
| errors.ErrorT
|
|
66
|
+
| PaygenticError
|
|
67
|
+
| ResponseValidationError
|
|
68
|
+
| ConnectionError
|
|
69
|
+
| RequestAbortedError
|
|
70
|
+
| RequestTimeoutError
|
|
71
|
+
| InvalidRequestError
|
|
72
|
+
| UnexpectedClientError
|
|
73
|
+
| SDKValidationError
|
|
74
|
+
>
|
|
75
|
+
> {
|
|
76
|
+
return new APIPromise($do(
|
|
77
|
+
client,
|
|
78
|
+
request,
|
|
79
|
+
options,
|
|
80
|
+
));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async function $do(
|
|
84
|
+
client: PaygenticCore,
|
|
85
|
+
request: operations.RetryInvoicePaymentRequest,
|
|
86
|
+
options?: RequestOptions,
|
|
87
|
+
): Promise<
|
|
88
|
+
[
|
|
89
|
+
Result<
|
|
90
|
+
models.RetryPaymentResponse,
|
|
91
|
+
| errors.BadRequest
|
|
92
|
+
| errors.RetryPaymentResponseError
|
|
93
|
+
| errors.ErrorT
|
|
94
|
+
| PaygenticError
|
|
95
|
+
| ResponseValidationError
|
|
96
|
+
| ConnectionError
|
|
97
|
+
| RequestAbortedError
|
|
98
|
+
| RequestTimeoutError
|
|
99
|
+
| InvalidRequestError
|
|
100
|
+
| UnexpectedClientError
|
|
101
|
+
| SDKValidationError
|
|
102
|
+
>,
|
|
103
|
+
APICall,
|
|
104
|
+
]
|
|
105
|
+
> {
|
|
106
|
+
const parsed = safeParse(
|
|
107
|
+
request,
|
|
108
|
+
(value) =>
|
|
109
|
+
operations.RetryInvoicePaymentRequest$outboundSchema.parse(value),
|
|
110
|
+
"Input validation failed",
|
|
111
|
+
);
|
|
112
|
+
if (!parsed.ok) {
|
|
113
|
+
return [parsed, { status: "invalid" }];
|
|
114
|
+
}
|
|
115
|
+
const payload = parsed.value;
|
|
116
|
+
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
117
|
+
|
|
118
|
+
const pathParams = {
|
|
119
|
+
id: encodeSimple("id", payload.id, {
|
|
120
|
+
explode: false,
|
|
121
|
+
charEncoding: "percent",
|
|
122
|
+
}),
|
|
123
|
+
};
|
|
124
|
+
const path = pathToFunc("/v2/invoices/{id}/retryPayment")(pathParams);
|
|
125
|
+
|
|
126
|
+
const headers = new Headers(compactMap({
|
|
127
|
+
"Content-Type": "application/json",
|
|
128
|
+
Accept: "application/json",
|
|
129
|
+
}));
|
|
130
|
+
|
|
131
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
132
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
133
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
134
|
+
|
|
135
|
+
const context = {
|
|
136
|
+
options: client._options,
|
|
137
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
138
|
+
operationID: "retryInvoicePayment",
|
|
139
|
+
oAuth2Scopes: null,
|
|
140
|
+
|
|
141
|
+
resolvedSecurity: requestSecurity,
|
|
142
|
+
|
|
143
|
+
securitySource: client._options.bearerAuth,
|
|
144
|
+
retryConfig: options?.retries
|
|
145
|
+
|| client._options.retryConfig
|
|
146
|
+
|| { strategy: "none" },
|
|
147
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const requestRes = client._createRequest(context, {
|
|
151
|
+
security: requestSecurity,
|
|
152
|
+
method: "POST",
|
|
153
|
+
baseURL: options?.serverURL,
|
|
154
|
+
path: path,
|
|
155
|
+
headers: headers,
|
|
156
|
+
body: body,
|
|
157
|
+
userAgent: client._options.userAgent,
|
|
158
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
159
|
+
}, options);
|
|
160
|
+
if (!requestRes.ok) {
|
|
161
|
+
return [requestRes, { status: "invalid" }];
|
|
162
|
+
}
|
|
163
|
+
const req = requestRes.value;
|
|
164
|
+
|
|
165
|
+
const doResult = await client._do(req, {
|
|
166
|
+
context,
|
|
167
|
+
errorCodes: [
|
|
168
|
+
"400",
|
|
169
|
+
"402",
|
|
170
|
+
"403",
|
|
171
|
+
"409",
|
|
172
|
+
"422",
|
|
173
|
+
"429",
|
|
174
|
+
"4XX",
|
|
175
|
+
"500",
|
|
176
|
+
"502",
|
|
177
|
+
"5XX",
|
|
178
|
+
],
|
|
179
|
+
retryConfig: context.retryConfig,
|
|
180
|
+
retryCodes: context.retryCodes,
|
|
181
|
+
});
|
|
182
|
+
if (!doResult.ok) {
|
|
183
|
+
return [doResult, { status: "request-error", request: req }];
|
|
184
|
+
}
|
|
185
|
+
const response = doResult.value;
|
|
186
|
+
|
|
187
|
+
const responseFields = {
|
|
188
|
+
HttpMeta: { Response: response, Request: req },
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
const [result] = await M.match<
|
|
192
|
+
models.RetryPaymentResponse,
|
|
193
|
+
| errors.BadRequest
|
|
194
|
+
| errors.RetryPaymentResponseError
|
|
195
|
+
| errors.ErrorT
|
|
196
|
+
| PaygenticError
|
|
197
|
+
| ResponseValidationError
|
|
198
|
+
| ConnectionError
|
|
199
|
+
| RequestAbortedError
|
|
200
|
+
| RequestTimeoutError
|
|
201
|
+
| InvalidRequestError
|
|
202
|
+
| UnexpectedClientError
|
|
203
|
+
| SDKValidationError
|
|
204
|
+
>(
|
|
205
|
+
M.json([200, 202], models.RetryPaymentResponse$inboundSchema),
|
|
206
|
+
M.jsonErr(400, errors.BadRequest$inboundSchema),
|
|
207
|
+
M.jsonErr([402, 409, 422], errors.RetryPaymentResponseError$inboundSchema),
|
|
208
|
+
M.jsonErr([403, 429], errors.ErrorT$inboundSchema),
|
|
209
|
+
M.jsonErr(500, errors.ErrorT$inboundSchema),
|
|
210
|
+
M.jsonErr(502, errors.RetryPaymentResponseError$inboundSchema),
|
|
211
|
+
M.fail("4XX"),
|
|
212
|
+
M.fail("5XX"),
|
|
213
|
+
)(response, req, { extraFields: responseFields });
|
|
214
|
+
if (!result.ok) {
|
|
215
|
+
return [result, { status: "complete", request: req, response }];
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return [result, { status: "complete", request: req, response }];
|
|
219
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { PaygenticCore } from "../core.js";
|
|
7
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { PaygenticError } from "../models/errors/paygenticerror.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Reset a merchant's data
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* With `scope: merchant`, deletes the merchant's customers and everything attached to them: subscriptions, invoices, line items, payments, entitlements, grants, orders, test clocks, usage events, invoice documents and, when tax is enabled, the documents in the merchant's Quaderno sandbox account. `keepCatalog: true` keeps the catalog (products, plans, prices, fees, features, billable metrics), and `keepCatalog: false` deletes it too; the merchant's configuration is always kept. With `scope: customer`, deletes one customer and what is attached to it; test clocks and the Quaderno account's documents are kept, since they belong to no single customer.
|
|
34
|
+
*
|
|
35
|
+
* A `204` means every delete is done or scheduled: usage events and Quaderno documents finish in the background, and usage events still being ingested while it runs can survive it. A `502` means a store outside Postgres failed; the customers are already out of the API, and calling again with the same body finishes the reset. Calling again is always safe. While a customer waits for that, its external id is free for a new customer to take; a retry then deletes usage events by customer id only.
|
|
36
|
+
*
|
|
37
|
+
* Not available in production.
|
|
38
|
+
*/
|
|
39
|
+
export function merchantsReset(
|
|
40
|
+
client: PaygenticCore,
|
|
41
|
+
request: operations.ResetMerchantRequest,
|
|
42
|
+
options?: RequestOptions,
|
|
43
|
+
): APIPromise<
|
|
44
|
+
Result<
|
|
45
|
+
void,
|
|
46
|
+
| errors.BadRequest
|
|
47
|
+
| errors.ErrorT
|
|
48
|
+
| PaygenticError
|
|
49
|
+
| ResponseValidationError
|
|
50
|
+
| ConnectionError
|
|
51
|
+
| RequestAbortedError
|
|
52
|
+
| RequestTimeoutError
|
|
53
|
+
| InvalidRequestError
|
|
54
|
+
| UnexpectedClientError
|
|
55
|
+
| SDKValidationError
|
|
56
|
+
>
|
|
57
|
+
> {
|
|
58
|
+
return new APIPromise($do(
|
|
59
|
+
client,
|
|
60
|
+
request,
|
|
61
|
+
options,
|
|
62
|
+
));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function $do(
|
|
66
|
+
client: PaygenticCore,
|
|
67
|
+
request: operations.ResetMerchantRequest,
|
|
68
|
+
options?: RequestOptions,
|
|
69
|
+
): Promise<
|
|
70
|
+
[
|
|
71
|
+
Result<
|
|
72
|
+
void,
|
|
73
|
+
| errors.BadRequest
|
|
74
|
+
| errors.ErrorT
|
|
75
|
+
| PaygenticError
|
|
76
|
+
| ResponseValidationError
|
|
77
|
+
| ConnectionError
|
|
78
|
+
| RequestAbortedError
|
|
79
|
+
| RequestTimeoutError
|
|
80
|
+
| InvalidRequestError
|
|
81
|
+
| UnexpectedClientError
|
|
82
|
+
| SDKValidationError
|
|
83
|
+
>,
|
|
84
|
+
APICall,
|
|
85
|
+
]
|
|
86
|
+
> {
|
|
87
|
+
const parsed = safeParse(
|
|
88
|
+
request,
|
|
89
|
+
(value) => operations.ResetMerchantRequest$outboundSchema.parse(value),
|
|
90
|
+
"Input validation failed",
|
|
91
|
+
);
|
|
92
|
+
if (!parsed.ok) {
|
|
93
|
+
return [parsed, { status: "invalid" }];
|
|
94
|
+
}
|
|
95
|
+
const payload = parsed.value;
|
|
96
|
+
const body = encodeJSON("body", payload.MerchantReset, { explode: true });
|
|
97
|
+
|
|
98
|
+
const pathParams = {
|
|
99
|
+
merchantId: encodeSimple("merchantId", payload.merchantId, {
|
|
100
|
+
explode: false,
|
|
101
|
+
charEncoding: "percent",
|
|
102
|
+
}),
|
|
103
|
+
};
|
|
104
|
+
const path = pathToFunc("/v0/merchants/{merchantId}/reset")(pathParams);
|
|
105
|
+
|
|
106
|
+
const headers = new Headers(compactMap({
|
|
107
|
+
"Content-Type": "application/json",
|
|
108
|
+
Accept: "application/json",
|
|
109
|
+
}));
|
|
110
|
+
|
|
111
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
112
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
113
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
114
|
+
|
|
115
|
+
const context = {
|
|
116
|
+
options: client._options,
|
|
117
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
118
|
+
operationID: "resetMerchant",
|
|
119
|
+
oAuth2Scopes: null,
|
|
120
|
+
|
|
121
|
+
resolvedSecurity: requestSecurity,
|
|
122
|
+
|
|
123
|
+
securitySource: client._options.bearerAuth,
|
|
124
|
+
retryConfig: options?.retries
|
|
125
|
+
|| client._options.retryConfig
|
|
126
|
+
|| { strategy: "none" },
|
|
127
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const requestRes = client._createRequest(context, {
|
|
131
|
+
security: requestSecurity,
|
|
132
|
+
method: "POST",
|
|
133
|
+
baseURL: options?.serverURL,
|
|
134
|
+
path: path,
|
|
135
|
+
headers: headers,
|
|
136
|
+
body: body,
|
|
137
|
+
userAgent: client._options.userAgent,
|
|
138
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
139
|
+
}, options);
|
|
140
|
+
if (!requestRes.ok) {
|
|
141
|
+
return [requestRes, { status: "invalid" }];
|
|
142
|
+
}
|
|
143
|
+
const req = requestRes.value;
|
|
144
|
+
|
|
145
|
+
const doResult = await client._do(req, {
|
|
146
|
+
context,
|
|
147
|
+
errorCodes: ["400", "401", "403", "4XX", "500", "502", "5XX"],
|
|
148
|
+
retryConfig: context.retryConfig,
|
|
149
|
+
retryCodes: context.retryCodes,
|
|
150
|
+
});
|
|
151
|
+
if (!doResult.ok) {
|
|
152
|
+
return [doResult, { status: "request-error", request: req }];
|
|
153
|
+
}
|
|
154
|
+
const response = doResult.value;
|
|
155
|
+
|
|
156
|
+
const responseFields = {
|
|
157
|
+
HttpMeta: { Response: response, Request: req },
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const [result] = await M.match<
|
|
161
|
+
void,
|
|
162
|
+
| errors.BadRequest
|
|
163
|
+
| errors.ErrorT
|
|
164
|
+
| PaygenticError
|
|
165
|
+
| ResponseValidationError
|
|
166
|
+
| ConnectionError
|
|
167
|
+
| RequestAbortedError
|
|
168
|
+
| RequestTimeoutError
|
|
169
|
+
| InvalidRequestError
|
|
170
|
+
| UnexpectedClientError
|
|
171
|
+
| SDKValidationError
|
|
172
|
+
>(
|
|
173
|
+
M.nil(204, z.void()),
|
|
174
|
+
M.jsonErr(400, errors.BadRequest$inboundSchema),
|
|
175
|
+
M.jsonErr([401, 403], errors.ErrorT$inboundSchema),
|
|
176
|
+
M.jsonErr([500, 502], errors.ErrorT$inboundSchema),
|
|
177
|
+
M.fail("4XX"),
|
|
178
|
+
M.fail("5XX"),
|
|
179
|
+
)(response, req, { extraFields: responseFields });
|
|
180
|
+
if (!result.ok) {
|
|
181
|
+
return [result, { status: "complete", request: req, response }];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return [result, { status: "complete", request: req, response }];
|
|
185
|
+
}
|
|
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
|
|
|
30
30
|
* Get profitability summary
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
|
-
* Returns a per-customer profitability summary for a merchant over a date range. Each row aggregates revenue (
|
|
33
|
+
* Returns a per-customer profitability summary for a merchant over a date range. Each row aggregates revenue (invoices issued in the period, whatever their status since, less refunds, both excluding tax; the same figure /v0/revenue reports), cost (from metered cost discovery), profit, and margin. Customers are ranked by profit descending and capped at topN; the remainder is rolled into a single self-consistent 'Other' row whose revenue, cost, and profit reflect the same set of customers. Rows are joined against the merchant's customer list, so meter subjects that match no customer are dropped. Soft-deleted customers with revenue or cost in the period are folded into a single 'deleted' row, which always comes last, after 'Other', and takes no top-N slot.
|
|
34
34
|
*/
|
|
35
35
|
export function profitabilityGetProfitability(
|
|
36
36
|
client: PaygenticCore,
|
package/src/funcs/revenueGet.ts
CHANGED
|
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
|
|
|
30
30
|
* Get revenue summary
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
|
-
* Returns revenue summary with invoice and payment breakdowns (outstanding/paid/writtenOff), plus a time-series trend. Revenue is
|
|
33
|
+
* Returns revenue summary with invoice and payment breakdowns (outstanding/paid/writtenOff), plus a time-series trend. Revenue is what was billed in the period (by default, invoices issued in it; see periodBasis), whatever their status since, less refunds, both excluding tax; completed payments are reported under payments, never in revenue.
|
|
34
34
|
*/
|
|
35
35
|
export function revenueGet(
|
|
36
36
|
client: PaygenticCore,
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { PaygenticCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import * as errors from "../models/errors/index.js";
|
|
21
|
+
import { PaygenticError } from "../models/errors/paygenticerror.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as models from "../models/index.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Migrate To A Plan Version
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Moves the subscription to a named version of its plan. By default the move follows the plan's versionTransition. With timing next_period, the move takes effect at the end of the current billing period: the current period bills as before, and each period that starts at or after that boundary bills from the target version. With timing immediate, entitlements change at once, in-arrears prices bill the whole current period at the target version, and in-advance prices change at the end of the current period, with no proration. The target can be an older or a newer published version. A migration always sets versionPolicy to pinned, so a later change of the plan's default version does not move the subscription. To follow the plan default again, call PATCH /v0/subscriptions/{id} with versionPolicy: 'floating'. A second migration before the boundary replaces the first. Migrating to the version the subscription is already on changes nothing except that it pins a floating subscription, so it is safe to repeat. A version number that does not exist on the plan and an archived version both return 404. The request is refused with 409 and a code when: the subscription is not live; the subscription ends at or before the boundary; a kept override has a rate that would mean something else on the new price; a feature's reset period, metric or pricing unit changes; or the new version sells a price that a continuing interval already covers.
|
|
34
|
+
*/
|
|
35
|
+
export function subscriptionsMigrateSubscriptionVersion(
|
|
36
|
+
client: PaygenticCore,
|
|
37
|
+
request: operations.MigrateSubscriptionVersionRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
models.MigrateSubscriptionVersionResponse,
|
|
42
|
+
| errors.BadRequest
|
|
43
|
+
| errors.ErrorT
|
|
44
|
+
| PaygenticError
|
|
45
|
+
| ResponseValidationError
|
|
46
|
+
| ConnectionError
|
|
47
|
+
| RequestAbortedError
|
|
48
|
+
| RequestTimeoutError
|
|
49
|
+
| InvalidRequestError
|
|
50
|
+
| UnexpectedClientError
|
|
51
|
+
| SDKValidationError
|
|
52
|
+
>
|
|
53
|
+
> {
|
|
54
|
+
return new APIPromise($do(
|
|
55
|
+
client,
|
|
56
|
+
request,
|
|
57
|
+
options,
|
|
58
|
+
));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function $do(
|
|
62
|
+
client: PaygenticCore,
|
|
63
|
+
request: operations.MigrateSubscriptionVersionRequest,
|
|
64
|
+
options?: RequestOptions,
|
|
65
|
+
): Promise<
|
|
66
|
+
[
|
|
67
|
+
Result<
|
|
68
|
+
models.MigrateSubscriptionVersionResponse,
|
|
69
|
+
| errors.BadRequest
|
|
70
|
+
| errors.ErrorT
|
|
71
|
+
| PaygenticError
|
|
72
|
+
| ResponseValidationError
|
|
73
|
+
| ConnectionError
|
|
74
|
+
| RequestAbortedError
|
|
75
|
+
| RequestTimeoutError
|
|
76
|
+
| InvalidRequestError
|
|
77
|
+
| UnexpectedClientError
|
|
78
|
+
| SDKValidationError
|
|
79
|
+
>,
|
|
80
|
+
APICall,
|
|
81
|
+
]
|
|
82
|
+
> {
|
|
83
|
+
const parsed = safeParse(
|
|
84
|
+
request,
|
|
85
|
+
(value) =>
|
|
86
|
+
operations.MigrateSubscriptionVersionRequest$outboundSchema.parse(value),
|
|
87
|
+
"Input validation failed",
|
|
88
|
+
);
|
|
89
|
+
if (!parsed.ok) {
|
|
90
|
+
return [parsed, { status: "invalid" }];
|
|
91
|
+
}
|
|
92
|
+
const payload = parsed.value;
|
|
93
|
+
const body = encodeJSON("body", payload.MigrateSubscriptionVersionRequest, {
|
|
94
|
+
explode: true,
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const pathParams = {
|
|
98
|
+
id: encodeSimple("id", payload.id, {
|
|
99
|
+
explode: false,
|
|
100
|
+
charEncoding: "percent",
|
|
101
|
+
}),
|
|
102
|
+
};
|
|
103
|
+
const path = pathToFunc("/v0/subscriptions/{id}/versionMigration")(
|
|
104
|
+
pathParams,
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
const headers = new Headers(compactMap({
|
|
108
|
+
"Content-Type": "application/json",
|
|
109
|
+
Accept: "application/json",
|
|
110
|
+
}));
|
|
111
|
+
|
|
112
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
113
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
114
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
115
|
+
|
|
116
|
+
const context = {
|
|
117
|
+
options: client._options,
|
|
118
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
119
|
+
operationID: "migrateSubscriptionVersion",
|
|
120
|
+
oAuth2Scopes: null,
|
|
121
|
+
|
|
122
|
+
resolvedSecurity: requestSecurity,
|
|
123
|
+
|
|
124
|
+
securitySource: client._options.bearerAuth,
|
|
125
|
+
retryConfig: options?.retries
|
|
126
|
+
|| client._options.retryConfig
|
|
127
|
+
|| { strategy: "none" },
|
|
128
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const requestRes = client._createRequest(context, {
|
|
132
|
+
security: requestSecurity,
|
|
133
|
+
method: "POST",
|
|
134
|
+
baseURL: options?.serverURL,
|
|
135
|
+
path: path,
|
|
136
|
+
headers: headers,
|
|
137
|
+
body: body,
|
|
138
|
+
userAgent: client._options.userAgent,
|
|
139
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
140
|
+
}, options);
|
|
141
|
+
if (!requestRes.ok) {
|
|
142
|
+
return [requestRes, { status: "invalid" }];
|
|
143
|
+
}
|
|
144
|
+
const req = requestRes.value;
|
|
145
|
+
|
|
146
|
+
const doResult = await client._do(req, {
|
|
147
|
+
context,
|
|
148
|
+
errorCodes: ["400", "401", "403", "404", "409", "429", "4XX", "500", "5XX"],
|
|
149
|
+
retryConfig: context.retryConfig,
|
|
150
|
+
retryCodes: context.retryCodes,
|
|
151
|
+
});
|
|
152
|
+
if (!doResult.ok) {
|
|
153
|
+
return [doResult, { status: "request-error", request: req }];
|
|
154
|
+
}
|
|
155
|
+
const response = doResult.value;
|
|
156
|
+
|
|
157
|
+
const responseFields = {
|
|
158
|
+
HttpMeta: { Response: response, Request: req },
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const [result] = await M.match<
|
|
162
|
+
models.MigrateSubscriptionVersionResponse,
|
|
163
|
+
| errors.BadRequest
|
|
164
|
+
| errors.ErrorT
|
|
165
|
+
| PaygenticError
|
|
166
|
+
| ResponseValidationError
|
|
167
|
+
| ConnectionError
|
|
168
|
+
| RequestAbortedError
|
|
169
|
+
| RequestTimeoutError
|
|
170
|
+
| InvalidRequestError
|
|
171
|
+
| UnexpectedClientError
|
|
172
|
+
| SDKValidationError
|
|
173
|
+
>(
|
|
174
|
+
M.json(200, models.MigrateSubscriptionVersionResponse$inboundSchema),
|
|
175
|
+
M.jsonErr(400, errors.BadRequest$inboundSchema),
|
|
176
|
+
M.jsonErr([401, 403, 404, 409, 429], errors.ErrorT$inboundSchema),
|
|
177
|
+
M.jsonErr(500, errors.ErrorT$inboundSchema),
|
|
178
|
+
M.fail("4XX"),
|
|
179
|
+
M.fail("5XX"),
|
|
180
|
+
)(response, req, { extraFields: responseFields });
|
|
181
|
+
if (!result.ok) {
|
|
182
|
+
return [result, { status: "complete", request: req, response }];
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return [result, { status: "complete", request: req, response }];
|
|
186
|
+
}
|