orb-billing 1.0.1 → 1.19.5
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 +61 -41
- package/dist/internal/utils/requestbody.d.ts +1 -1
- package/dist/internal/utils/requestbody.js +1 -1
- package/dist/internal/utils/retries.d.ts +2 -2
- package/dist/internal/utils/security.d.ts +5 -2
- package/dist/internal/utils/security.js +28 -28
- package/dist/internal/utils/utils.js +1 -1
- package/dist/sdk/availability.d.ts +3 -4
- package/dist/sdk/availability.js +80 -10
- package/dist/sdk/coupon.d.ts +16 -7
- package/dist/sdk/coupon.js +396 -35
- package/dist/sdk/credit.d.ts +242 -36
- package/dist/sdk/credit.js +704 -77
- package/dist/sdk/creditnote.d.ts +8 -5
- package/dist/sdk/creditnote.js +160 -16
- package/dist/sdk/customer.d.ts +358 -93
- package/dist/sdk/customer.js +1351 -189
- package/dist/sdk/event.d.ts +198 -103
- package/dist/sdk/event.js +906 -157
- package/dist/sdk/invoice.d.ts +39 -10
- package/dist/sdk/invoice.js +727 -47
- package/dist/sdk/item.d.ts +27 -0
- package/dist/sdk/item.js +328 -0
- package/dist/sdk/metric.d.ts +39 -0
- package/dist/sdk/metric.js +475 -0
- package/dist/sdk/models/errors/index.d.ts +1 -0
- package/dist/sdk/models/errors/index.js +20 -0
- package/dist/sdk/models/errors/sdkerror.d.ts +7 -0
- package/dist/sdk/models/errors/sdkerror.js +40 -0
- package/dist/sdk/models/operations/addeditpriceintervals.d.ts +53 -0
- package/dist/sdk/models/operations/addeditpriceintervals.js +123 -0
- package/dist/sdk/models/operations/amendevent.d.ts +35 -5
- package/dist/sdk/models/operations/amendevent.js +28 -4
- package/dist/sdk/models/operations/amendusage.d.ts +36 -15
- package/dist/sdk/models/operations/amendusage.js +31 -22
- package/dist/sdk/models/operations/amendusageexternalcustomerid.d.ts +36 -15
- package/dist/sdk/models/operations/amendusageexternalcustomerid.js +31 -22
- package/dist/sdk/models/operations/archivecoupon.d.ts +37 -0
- package/dist/sdk/models/operations/archivecoupon.js +28 -0
- package/dist/sdk/models/operations/cancelsubscription.d.ts +38 -1
- package/dist/sdk/models/operations/cancelsubscription.js +30 -2
- package/dist/sdk/models/operations/closebackfill.d.ts +37 -0
- package/dist/sdk/models/operations/closebackfill.js +28 -0
- package/dist/sdk/models/operations/createbackfill.d.ts +37 -0
- package/dist/sdk/models/operations/createbackfill.js +28 -0
- package/dist/sdk/models/operations/createcoupon.d.ts +38 -1
- package/dist/sdk/models/operations/createcoupon.js +28 -0
- package/dist/sdk/models/operations/createcustomer.d.ts +37 -0
- package/dist/sdk/models/operations/createcustomer.js +28 -0
- package/dist/sdk/models/operations/createcustomerbalancetransaction.d.ts +38 -1
- package/dist/sdk/models/operations/createcustomerbalancetransaction.js +30 -2
- package/dist/sdk/models/operations/createinvoice.d.ts +49 -0
- package/dist/sdk/models/operations/createinvoice.js +107 -0
- package/dist/sdk/models/operations/createinvoicelineitem.d.ts +37 -0
- package/dist/sdk/models/operations/createinvoicelineitem.js +28 -0
- package/dist/sdk/models/operations/createledgerentry.d.ts +40 -3
- package/dist/sdk/models/operations/createledgerentry.js +31 -3
- package/dist/sdk/models/operations/createledgerentryexternalid.d.ts +53 -0
- package/dist/sdk/models/operations/createledgerentryexternalid.js +123 -0
- package/dist/sdk/models/operations/createmetric.d.ts +49 -0
- package/dist/sdk/models/operations/createmetric.js +107 -0
- package/dist/sdk/models/operations/createplan.d.ts +49 -0
- package/dist/sdk/models/operations/createplan.js +107 -0
- package/dist/sdk/models/operations/createprice.d.ts +49 -0
- package/dist/sdk/models/operations/{addledgerentryexternalid.js → createprice.js} +37 -25
- package/dist/sdk/models/operations/createsubscription.d.ts +38 -1
- package/dist/sdk/models/operations/createsubscription.js +28 -0
- package/dist/sdk/models/operations/deletecustomer.d.ts +41 -11
- package/dist/sdk/models/operations/deletecustomer.js +57 -16
- package/dist/sdk/models/operations/deprecateevent.d.ts +35 -5
- package/dist/sdk/models/operations/deprecateevent.js +28 -4
- package/dist/sdk/models/operations/fetchbackfill.d.ts +52 -0
- package/dist/sdk/models/operations/fetchbackfill.js +119 -0
- package/dist/sdk/models/operations/fetchcoupon.d.ts +37 -0
- package/dist/sdk/models/operations/fetchcoupon.js +28 -0
- package/dist/sdk/models/operations/fetchcreditnote.d.ts +37 -3
- package/dist/sdk/models/operations/fetchcreditnote.js +28 -0
- package/dist/sdk/models/operations/fetchcustomer.d.ts +38 -4
- package/dist/sdk/models/operations/fetchcustomer.js +28 -0
- package/dist/sdk/models/operations/fetchcustomercosts.d.ts +44 -12
- package/dist/sdk/models/operations/fetchcustomercosts.js +37 -1
- package/dist/sdk/models/operations/fetchcustomercostsexternalid.d.ts +45 -10
- package/dist/sdk/models/operations/fetchcustomercostsexternalid.js +37 -1
- package/dist/sdk/models/operations/fetchcustomercredits.d.ts +37 -9
- package/dist/sdk/models/operations/fetchcustomercredits.js +31 -3
- package/dist/sdk/models/operations/fetchcustomercreditsexternalid.d.ts +39 -8
- package/dist/sdk/models/operations/fetchcustomercreditsexternalid.js +31 -3
- package/dist/sdk/models/operations/fetchcustomercreditsledger.d.ts +53 -13
- package/dist/sdk/models/operations/fetchcustomercreditsledger.js +66 -3
- package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.d.ts +53 -13
- package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.js +66 -3
- package/dist/sdk/models/operations/fetchcustomerexternalid.d.ts +37 -0
- package/dist/sdk/models/operations/fetchcustomerexternalid.js +28 -0
- package/dist/sdk/models/operations/fetchinvoice.d.ts +37 -0
- package/dist/sdk/models/operations/fetchinvoice.js +28 -0
- package/dist/sdk/models/operations/fetchitem.d.ts +52 -0
- package/dist/sdk/models/operations/fetchitem.js +119 -0
- package/dist/sdk/models/operations/fetchmetric.d.ts +52 -0
- package/dist/sdk/models/operations/fetchmetric.js +119 -0
- package/dist/sdk/models/operations/fetchplan.d.ts +37 -0
- package/dist/sdk/models/operations/fetchplan.js +28 -0
- package/dist/sdk/models/operations/fetchplanexternalid.d.ts +37 -0
- package/dist/sdk/models/operations/fetchplanexternalid.js +28 -0
- package/dist/sdk/models/operations/fetchprice.d.ts +52 -0
- package/dist/sdk/models/operations/fetchprice.js +119 -0
- package/dist/sdk/models/operations/fetchpriceexternalid.d.ts +52 -0
- package/dist/sdk/models/operations/fetchpriceexternalid.js +119 -0
- package/dist/sdk/models/operations/fetchsubscription.d.ts +37 -0
- package/dist/sdk/models/operations/fetchsubscription.js +28 -0
- package/dist/sdk/models/operations/fetchsubscriptioncosts.d.ts +45 -10
- package/dist/sdk/models/operations/fetchsubscriptioncosts.js +37 -1
- package/dist/sdk/models/operations/fetchsubscriptionschedule.d.ts +43 -8
- package/dist/sdk/models/operations/fetchsubscriptionschedule.js +47 -3
- package/dist/sdk/models/operations/fetchsubscriptionusage.d.ts +60 -16
- package/dist/sdk/models/operations/fetchsubscriptionusage.js +69 -2
- package/dist/sdk/models/operations/fetchupcominginvoice.d.ts +38 -1
- package/dist/sdk/models/operations/fetchupcominginvoice.js +28 -0
- package/dist/sdk/models/operations/index.d.ts +20 -2
- package/dist/sdk/models/operations/index.js +20 -2
- package/dist/sdk/models/operations/ingest.d.ts +36 -12
- package/dist/sdk/models/operations/ingest.js +31 -22
- package/dist/sdk/models/operations/issueinvoice.d.ts +35 -2
- package/dist/sdk/models/operations/issueinvoice.js +28 -4
- package/dist/sdk/models/operations/listbackfills.d.ts +37 -6
- package/dist/sdk/models/operations/listbackfills.js +29 -1
- package/dist/sdk/models/operations/listbalancetransactions.d.ts +45 -10
- package/dist/sdk/models/operations/listbalancetransactions.js +49 -5
- package/dist/sdk/models/operations/listcoupons.d.ts +35 -10
- package/dist/sdk/models/operations/listcoupons.js +29 -1
- package/dist/sdk/models/operations/listcouponsubscriptions.d.ts +39 -0
- package/dist/sdk/models/operations/listcouponsubscriptions.js +36 -0
- package/dist/sdk/models/operations/listcreditnotes.d.ts +53 -0
- package/dist/sdk/models/operations/listcreditnotes.js +123 -0
- package/dist/sdk/models/operations/listcustomers.d.ts +41 -6
- package/dist/sdk/models/operations/listcustomers.js +45 -1
- package/dist/sdk/models/operations/listinvoices.d.ts +66 -14
- package/dist/sdk/models/operations/listinvoices.js +109 -3
- package/dist/sdk/models/operations/listitems.d.ts +53 -0
- package/dist/sdk/models/operations/{listcreditnote.js → listitems.js} +46 -30
- package/dist/sdk/models/operations/listmetrics.d.ts +57 -0
- package/dist/sdk/models/operations/listmetrics.js +139 -0
- package/dist/sdk/models/operations/listplans.d.ts +53 -6
- package/dist/sdk/models/operations/listplans.js +59 -2
- package/dist/sdk/models/operations/listprices.d.ts +53 -0
- package/dist/sdk/models/operations/listprices.js +123 -0
- package/dist/sdk/models/operations/listsubscriptions.d.ts +48 -7
- package/dist/sdk/models/operations/listsubscriptions.js +56 -2
- package/dist/sdk/models/operations/markinvoiceaspaid.d.ts +53 -0
- package/dist/sdk/models/operations/markinvoiceaspaid.js +123 -0
- package/dist/sdk/models/operations/ping.d.ts +39 -2
- package/dist/sdk/models/operations/ping.js +30 -2
- package/dist/sdk/models/operations/revertbackfill.d.ts +37 -0
- package/dist/sdk/models/operations/revertbackfill.js +28 -0
- package/dist/sdk/models/operations/scheduleplanchange.d.ts +37 -0
- package/dist/sdk/models/operations/scheduleplanchange.js +28 -0
- package/dist/sdk/models/operations/searchevents.d.ts +42 -7
- package/dist/sdk/models/operations/searchevents.js +47 -3
- package/dist/sdk/models/operations/triggerphase.d.ts +53 -0
- package/dist/sdk/models/operations/triggerphase.js +123 -0
- package/dist/sdk/models/operations/unschedulecancellation.d.ts +37 -0
- package/dist/sdk/models/operations/unschedulecancellation.js +28 -0
- package/dist/sdk/models/operations/unschedulefixedfeequantity.d.ts +53 -0
- package/dist/sdk/models/operations/unschedulefixedfeequantity.js +123 -0
- package/dist/sdk/models/operations/unscheduleplanchange.d.ts +37 -0
- package/dist/sdk/models/operations/unscheduleplanchange.js +28 -0
- package/dist/sdk/models/operations/updatecustomer.d.ts +38 -4
- package/dist/sdk/models/operations/updatecustomer.js +30 -2
- package/dist/sdk/models/operations/updatecustomerexternalid.d.ts +38 -1
- package/dist/sdk/models/operations/updatecustomerexternalid.js +30 -2
- package/dist/sdk/models/operations/updatefixedfeequantity.d.ts +37 -0
- package/dist/sdk/models/operations/updatefixedfeequantity.js +28 -0
- package/dist/sdk/models/operations/updateplan.d.ts +53 -0
- package/dist/sdk/models/operations/updateplan.js +123 -0
- package/dist/sdk/models/operations/updateplanexternal.d.ts +53 -0
- package/dist/sdk/models/operations/updateplanexternal.js +123 -0
- package/dist/sdk/models/operations/voidinvoice.d.ts +36 -3
- package/dist/sdk/models/operations/voidinvoice.js +28 -4
- package/dist/sdk/models/shared/accountingprovider.d.ts +9 -0
- package/dist/sdk/models/shared/accountingprovider.js +55 -0
- package/dist/sdk/models/shared/accountingproviderconfig.d.ts +5 -0
- package/dist/sdk/models/shared/{creditblock.js → accountingproviderconfig.js} +10 -18
- package/dist/sdk/models/shared/accountingsyncconfiguration.d.ts +6 -0
- package/dist/sdk/models/shared/accountingsyncconfiguration.js +52 -0
- package/dist/sdk/models/shared/addamendmentcreditledgerentryrequestparams.d.ts +28 -0
- package/dist/sdk/models/shared/addamendmentcreditledgerentryrequestparams.js +81 -0
- package/dist/sdk/models/shared/adddecrementcreditledgerentryrequestparams.d.ts +24 -0
- package/dist/sdk/models/shared/adddecrementcreditledgerentryrequestparams.js +76 -0
- package/dist/sdk/models/shared/addeditpriceintervalparams.d.ts +13 -0
- package/dist/sdk/models/shared/addeditpriceintervalparams.js +54 -0
- package/dist/sdk/models/shared/addexpirationchangecreditledgerentryrequestparams.d.ts +37 -0
- package/dist/sdk/models/shared/{newcreditledgerentry.js → addexpirationchangecreditledgerentryrequestparams.js} +27 -34
- package/dist/sdk/models/shared/addincrementcreditledgerentryrequestparams.d.ts +42 -0
- package/dist/sdk/models/shared/addincrementcreditledgerentryrequestparams.js +109 -0
- package/dist/sdk/models/shared/addpriceintervalparams.d.ts +54 -0
- package/dist/sdk/models/shared/addpriceintervalparams.js +103 -0
- package/dist/sdk/models/shared/address.d.ts +9 -0
- package/dist/sdk/models/shared/address.js +70 -0
- package/dist/sdk/models/shared/addressinput.d.ts +9 -0
- package/dist/sdk/models/shared/addressinput.js +70 -0
- package/dist/sdk/models/shared/addvoidcreditledgerentryrequestparams.d.ts +38 -0
- package/dist/sdk/models/shared/addvoidcreditledgerentryrequestparams.js +93 -0
- package/dist/sdk/models/shared/affectedblock.d.ts +6 -0
- package/dist/sdk/models/shared/{credit.js → affectedblock.js} +9 -14
- package/dist/sdk/models/shared/{subscriptioncost.d.ts → aggregatedcost.d.ts} +1 -1
- package/dist/sdk/models/shared/{customercost.js → aggregatedcost.js} +11 -11
- package/dist/sdk/models/shared/amendedusage.d.ts +2 -7
- package/dist/sdk/models/shared/amendedusage.js +2 -14
- package/dist/sdk/models/shared/amendeventresult.d.ts +1 -4
- package/dist/sdk/models/shared/amendeventresult.js +0 -3
- package/dist/sdk/models/shared/amendmentledgerentry.d.ts +27 -0
- package/dist/sdk/models/shared/amendmentledgerentry.js +120 -0
- package/dist/sdk/models/shared/amountdiscount.d.ts +15 -0
- package/dist/sdk/models/shared/amountdiscount.js +59 -0
- package/dist/sdk/models/shared/amountdiscountcreationparams.d.ts +11 -0
- package/dist/sdk/models/shared/amountdiscountcreationparams.js +54 -0
- package/dist/sdk/models/shared/amountdiscountinterval.d.ts +27 -0
- package/dist/sdk/models/shared/amountdiscountinterval.js +82 -0
- package/dist/sdk/models/shared/autocollection.d.ts +3 -6
- package/dist/sdk/models/shared/autocollection.js +0 -3
- package/dist/sdk/models/shared/backfill.d.ts +2 -2
- package/dist/sdk/models/shared/backfills.d.ts +2 -5
- package/dist/sdk/models/shared/backfills.js +0 -3
- package/dist/sdk/models/shared/billablemetric.d.ts +24 -1
- package/dist/sdk/models/shared/billablemetric.js +40 -1
- package/dist/sdk/models/shared/billablemetrics.d.ts +7 -0
- package/dist/sdk/models/shared/billablemetrics.js +54 -0
- package/dist/sdk/models/shared/billablemetricsimple.d.ts +5 -0
- package/dist/sdk/models/shared/{billablemetricminified.js → billablemetricsimple.js} +8 -8
- package/dist/sdk/models/shared/billablemetrictiny.d.ts +4 -0
- package/dist/sdk/models/shared/billablemetrictiny.js +45 -0
- package/dist/sdk/models/shared/billingcyclealignment.d.ts +8 -0
- package/dist/sdk/models/shared/billingcyclealignment.js +15 -0
- package/dist/sdk/models/shared/bpsconfig.d.ts +7 -4
- package/dist/sdk/models/shared/bpsconfig.js +1 -4
- package/dist/sdk/models/shared/bpsprice.d.ts +242 -0
- package/dist/sdk/models/shared/bpsprice.js +363 -0
- package/dist/sdk/models/shared/bpstier.d.ts +15 -3
- package/dist/sdk/models/shared/bpstier.js +1 -1
- package/dist/sdk/models/shared/bulkbpsconfig.d.ts +4 -4
- package/dist/sdk/models/shared/bulkbpsconfig.js +0 -3
- package/dist/sdk/models/shared/bulkbpsprice.d.ts +242 -0
- package/dist/sdk/models/shared/bulkbpsprice.js +363 -0
- package/dist/sdk/models/shared/bulkbpstier.d.ts +10 -1
- package/dist/sdk/models/shared/bulkbpstier.js +1 -1
- package/dist/sdk/models/shared/bulkconfig.d.ts +4 -4
- package/dist/sdk/models/shared/bulkconfig.js +0 -3
- package/dist/sdk/models/shared/bulkprice.d.ts +242 -0
- package/dist/sdk/models/shared/bulkprice.js +363 -0
- package/dist/sdk/models/shared/bulktier.d.ts +7 -1
- package/dist/sdk/models/shared/bulktier.js +1 -1
- package/dist/sdk/models/shared/cancelsubscriptionparams.d.ts +19 -0
- package/dist/sdk/models/shared/cancelsubscriptionparams.js +63 -0
- package/dist/sdk/models/shared/changeoption.d.ts +0 -3
- package/dist/sdk/models/shared/changeoption.js +0 -3
- package/dist/sdk/models/shared/coupon.d.ts +14 -10
- package/dist/sdk/models/shared/coupon.js +16 -6
- package/dist/sdk/models/shared/couponredemption.d.ts +6 -0
- package/dist/sdk/models/shared/{usageitem.js → couponredemption.js} +12 -12
- package/dist/sdk/models/shared/coupons.d.ts +2 -5
- package/dist/sdk/models/shared/coupons.js +0 -3
- package/dist/sdk/models/shared/{newinvoicelineitem.d.ts → createinvoicelineitemparams.d.ts} +5 -5
- package/dist/sdk/models/shared/{newinvoicelineitem.js → createinvoicelineitemparams.js} +15 -13
- package/dist/sdk/models/shared/createoneoffinvoiceparams.d.ts +33 -0
- package/dist/sdk/models/shared/createoneoffinvoiceparams.js +86 -0
- package/dist/sdk/models/shared/creditblockexpiryledgerentry.d.ts +27 -0
- package/dist/sdk/models/shared/creditblockexpiryledgerentry.js +120 -0
- package/dist/sdk/models/shared/creditledgerentries.d.ts +1 -5
- package/dist/sdk/models/shared/creditledgerentries.js +1 -6
- package/dist/sdk/models/shared/creditnote.d.ts +34 -22
- package/dist/sdk/models/shared/creditnote.js +44 -7
- package/dist/sdk/models/shared/creditnotelineitem.d.ts +12 -10
- package/dist/sdk/models/shared/creditnotelineitem.js +24 -10
- package/dist/sdk/models/shared/creditnoteminified.d.ts +7 -0
- package/dist/sdk/models/shared/creditnoteminified.js +45 -0
- package/dist/sdk/models/shared/creditnotes.d.ts +2 -5
- package/dist/sdk/models/shared/creditnotes.js +0 -3
- package/dist/sdk/models/shared/{sublineitem2.d.ts → creditnotesublineitem.d.ts} +1 -1
- package/dist/sdk/models/shared/{sublineitem2.js → creditnotesublineitem.js} +9 -9
- package/dist/sdk/models/shared/creditnotesummary.d.ts +9 -6
- package/dist/sdk/models/shared/customer.d.ts +30 -181
- package/dist/sdk/models/shared/customer.js +41 -223
- package/dist/sdk/models/shared/customerbalancetransaction.d.ts +13 -28
- package/dist/sdk/models/shared/customerbalancetransaction.js +18 -42
- package/dist/sdk/models/shared/{transactions.d.ts → customerbalancetransactions.d.ts} +3 -6
- package/dist/sdk/models/shared/{transactions.js → customerbalancetransactions.js} +8 -11
- package/dist/sdk/models/shared/customercosts.d.ts +2 -5
- package/dist/sdk/models/shared/customercosts.js +3 -6
- package/dist/sdk/models/shared/customercreditbalance.d.ts +7 -0
- package/dist/sdk/models/shared/customercreditbalance.js +64 -0
- package/dist/sdk/models/shared/customercreditbalances.d.ts +7 -0
- package/dist/sdk/models/shared/customercreditbalances.js +54 -0
- package/dist/sdk/models/shared/customerminified.d.ts +0 -3
- package/dist/sdk/models/shared/customerminified.js +0 -3
- package/dist/sdk/models/shared/customers.d.ts +0 -3
- package/dist/sdk/models/shared/customers.js +0 -3
- package/dist/sdk/models/shared/customertaxid.d.ts +6 -0
- package/dist/sdk/models/shared/{newtransaction.js → customertaxid.js} +12 -13
- package/dist/sdk/models/shared/debug.d.ts +2 -2
- package/dist/sdk/models/shared/decrementledgerentry.d.ts +30 -0
- package/dist/sdk/models/shared/{creditledgerentry.js → decrementledgerentry.js} +42 -51
- package/dist/sdk/models/shared/deletecustomerresponse.d.ts +3 -0
- package/dist/sdk/models/shared/deletecustomerresponse.js +30 -0
- package/dist/sdk/models/shared/deprecatedeventresult.d.ts +1 -4
- package/dist/sdk/models/shared/deprecatedeventresult.js +0 -3
- package/dist/sdk/models/shared/discount.d.ts +13 -5
- package/dist/sdk/models/shared/discount.js +13 -4
- package/dist/sdk/models/shared/duplicateconstraintviolationerror.d.ts +16 -0
- package/dist/sdk/models/shared/duplicateconstraintviolationerror.js +82 -0
- package/dist/sdk/models/shared/duplicateresourcecreationerror.d.ts +16 -0
- package/dist/sdk/models/shared/duplicateresourcecreationerror.js +82 -0
- package/dist/sdk/models/shared/editcustomer.d.ts +72 -0
- package/dist/sdk/models/shared/editcustomer.js +151 -0
- package/dist/sdk/models/shared/editplan.d.ts +10 -0
- package/dist/sdk/models/shared/editplan.js +59 -0
- package/dist/sdk/models/shared/editpriceintervalparams.d.ts +34 -0
- package/dist/sdk/models/shared/editpriceintervalparams.js +78 -0
- package/dist/sdk/models/shared/event.d.ts +11 -4
- package/dist/sdk/models/shared/event.js +14 -3
- package/dist/sdk/models/shared/{credits.d.ts → events.d.ts} +3 -6
- package/dist/sdk/models/shared/{eventsearchresults.js → events.js} +8 -11
- package/dist/sdk/models/shared/expirationchangeledgerentry.d.ts +28 -0
- package/dist/sdk/models/shared/expirationchangeledgerentry.js +129 -0
- package/dist/sdk/models/shared/featurenotavailableerror.d.ts +16 -0
- package/dist/sdk/models/shared/featurenotavailableerror.js +82 -0
- package/dist/sdk/models/shared/fivehundrederror.d.ts +13 -0
- package/dist/sdk/models/shared/fivehundrederror.js +78 -0
- package/dist/sdk/models/shared/fivetranexampleprice.d.ts +241 -0
- package/dist/sdk/models/shared/fivetranexampleprice.js +361 -0
- package/dist/sdk/models/shared/fixedfeequantitychange.d.ts +12 -5
- package/dist/sdk/models/shared/fixedfeequantitychange.js +12 -3
- package/dist/sdk/models/shared/fixedfeequantityscheduleentry.d.ts +7 -0
- package/dist/sdk/models/shared/{fixedfeequantityschedule.js → fixedfeequantityscheduleentry.js} +10 -10
- package/dist/sdk/models/shared/fixedfeequantitytransition.d.ts +6 -0
- package/dist/sdk/models/shared/fixedfeequantitytransition.js +59 -0
- package/dist/sdk/models/shared/fourhundredandoneerror.d.ts +16 -0
- package/dist/sdk/models/shared/fourhundredandoneerror.js +82 -0
- package/dist/sdk/models/shared/fourhundredandtwentynineerror.d.ts +16 -0
- package/dist/sdk/models/shared/fourhundredandtwentynineerror.js +82 -0
- package/dist/sdk/models/shared/groupedsubscriptionusage.d.ts +7 -0
- package/dist/sdk/models/shared/groupedsubscriptionusage.js +54 -0
- package/dist/sdk/models/shared/groupedsubscriptionusagerecord.d.ts +14 -0
- package/dist/sdk/models/shared/groupedsubscriptionusagerecord.js +71 -0
- package/dist/sdk/models/shared/idempotencyconflict.d.ts +16 -0
- package/dist/sdk/models/shared/idempotencyconflict.js +82 -0
- package/dist/sdk/models/shared/idempotencykeyvalidationerror.d.ts +17 -0
- package/dist/sdk/models/shared/idempotencykeyvalidationerror.js +87 -0
- package/dist/sdk/models/shared/idempotencyrequestmismatch.d.ts +16 -0
- package/dist/sdk/models/shared/idempotencyrequestmismatch.js +82 -0
- package/dist/sdk/models/shared/{invoicesettings.d.ts → incrementcreditledgerentryinvoicesettings.d.ts} +2 -2
- package/dist/sdk/models/shared/{invoicesettings.js → incrementcreditledgerentryinvoicesettings.js} +10 -10
- package/dist/sdk/models/shared/incrementledgerentry.d.ts +27 -0
- package/dist/sdk/models/shared/incrementledgerentry.js +120 -0
- package/dist/sdk/models/shared/index.d.ts +144 -54
- package/dist/sdk/models/shared/index.js +144 -54
- package/dist/sdk/models/shared/ingestevent.d.ts +32 -0
- package/dist/sdk/models/shared/ingestevent.js +86 -0
- package/dist/sdk/models/shared/ingestionresponse.d.ts +5 -5
- package/dist/sdk/models/shared/ingestionresponse.js +3 -6
- package/dist/sdk/models/shared/ingestrequestbody.d.ts +5 -0
- package/dist/sdk/models/shared/{tieredbpsconfig1.js → ingestrequestbody.js} +11 -11
- package/dist/sdk/models/shared/invoice.d.ts +46 -182
- package/dist/sdk/models/shared/invoice.js +70 -201
- package/dist/sdk/models/shared/invoicelineitem.d.ts +10 -168
- package/dist/sdk/models/shared/invoicelineitem.js +21 -303
- package/dist/sdk/models/shared/invoicelineitemparams.d.ts +27 -0
- package/dist/sdk/models/shared/invoicelineitemparams.js +92 -0
- package/dist/sdk/models/shared/invoiceminified.d.ts +7 -0
- package/dist/sdk/models/shared/invoiceminified.js +45 -0
- package/dist/sdk/models/shared/invoices.d.ts +2 -5
- package/dist/sdk/models/shared/invoices.js +0 -3
- package/dist/sdk/models/shared/item.d.ts +14 -0
- package/dist/sdk/models/shared/item.js +72 -0
- package/dist/sdk/models/shared/itemexternalconnection.d.ts +16 -0
- package/dist/sdk/models/shared/itemexternalconnection.js +63 -0
- package/dist/sdk/models/shared/items.d.ts +7 -0
- package/dist/sdk/models/shared/{credits.js → items.js} +11 -14
- package/dist/sdk/models/shared/itemslim.d.ts +5 -0
- package/dist/sdk/models/shared/itemslim.js +50 -0
- package/dist/sdk/models/shared/markaspaidrequestparams.d.ts +16 -0
- package/dist/sdk/models/shared/markaspaidrequestparams.js +61 -0
- package/dist/sdk/models/shared/matrixconfig.d.ts +12 -5
- package/dist/sdk/models/shared/matrixconfig.js +5 -3
- package/dist/sdk/models/shared/matrixprice.d.ts +242 -0
- package/dist/sdk/models/shared/matrixprice.js +363 -0
- package/dist/sdk/models/shared/matrixsublineitem.d.ts +17 -0
- package/dist/sdk/models/shared/matrixsublineitem.js +78 -0
- package/dist/sdk/models/shared/matrixvalue.d.ts +8 -1
- package/dist/sdk/models/shared/matrixvalue.js +5 -0
- package/dist/sdk/models/shared/maximum.d.ts +11 -0
- package/dist/sdk/models/shared/{subscriptionusage.js → maximum.js} +14 -14
- package/dist/sdk/models/shared/maximuminterval.d.ts +23 -0
- package/dist/sdk/models/shared/{subscriptioncost.js → maximuminterval.js} +21 -23
- package/dist/sdk/models/shared/metricgroup.d.ts +5 -0
- package/dist/sdk/models/shared/metricgroup.js +50 -0
- package/dist/sdk/models/shared/minimum.d.ts +11 -0
- package/dist/sdk/models/shared/minimum.js +50 -0
- package/dist/sdk/models/shared/minimuminterval.d.ts +23 -0
- package/dist/sdk/models/shared/minimuminterval.js +73 -0
- package/dist/sdk/models/shared/newaccountingsyncconfiguration.d.ts +6 -0
- package/dist/sdk/models/shared/newaccountingsyncconfiguration.js +52 -0
- package/dist/sdk/models/shared/newbackfill.d.ts +1 -1
- package/dist/sdk/models/shared/newbillablemetric.d.ts +28 -0
- package/dist/sdk/models/shared/newbillablemetric.js +77 -0
- package/dist/sdk/models/shared/newbpsprice.d.ts +53 -0
- package/dist/sdk/models/shared/newbpsprice.js +110 -0
- package/dist/sdk/models/shared/newbulkbpsprice.d.ts +53 -0
- package/dist/sdk/models/shared/newbulkbpsprice.js +110 -0
- package/dist/sdk/models/shared/newbulkprice.d.ts +53 -0
- package/dist/sdk/models/shared/newbulkprice.js +110 -0
- package/dist/sdk/models/shared/newcoupon.d.ts +4 -10
- package/dist/sdk/models/shared/newcoupon.js +11 -11
- package/dist/sdk/models/shared/newcustomer.d.ts +20 -154
- package/dist/sdk/models/shared/newcustomer.js +34 -206
- package/dist/sdk/models/shared/newcustomerbalancetransaction.d.ts +13 -0
- package/dist/sdk/models/shared/newcustomerbalancetransaction.js +60 -0
- package/dist/sdk/models/shared/newmatrixprice.d.ts +53 -0
- package/dist/sdk/models/shared/{sublineitem.js → newmatrixprice.js} +51 -43
- package/dist/sdk/models/shared/newpackageprice.d.ts +53 -0
- package/dist/sdk/models/shared/newpackageprice.js +110 -0
- package/dist/sdk/models/shared/newpackagewithallocationprice.d.ts +52 -0
- package/dist/sdk/models/shared/newpackagewithallocationprice.js +108 -0
- package/dist/sdk/models/shared/newplan.d.ts +26 -0
- package/dist/sdk/models/shared/newplan.js +93 -0
- package/dist/sdk/models/shared/newreportingconfiguration.d.ts +4 -0
- package/dist/sdk/models/shared/newreportingconfiguration.js +45 -0
- package/dist/sdk/models/shared/newsubscription.d.ts +18 -43
- package/dist/sdk/models/shared/newsubscription.js +50 -8
- package/dist/sdk/models/shared/newthresholdtotalamountprice.d.ts +52 -0
- package/dist/sdk/models/shared/newthresholdtotalamountprice.js +108 -0
- package/dist/sdk/models/shared/newtieredbpsprice.d.ts +53 -0
- package/dist/sdk/models/shared/newtieredbpsprice.js +110 -0
- package/dist/sdk/models/shared/newtieredpackageprice.d.ts +52 -0
- package/dist/sdk/models/shared/newtieredpackageprice.js +108 -0
- package/dist/sdk/models/shared/newtieredprice.d.ts +53 -0
- package/dist/sdk/models/shared/newtieredprice.js +110 -0
- package/dist/sdk/models/shared/newtieredwithminimumprice.d.ts +52 -0
- package/dist/sdk/models/shared/newtieredwithminimumprice.js +108 -0
- package/dist/sdk/models/shared/newunitprice.d.ts +53 -0
- package/dist/sdk/models/shared/newunitprice.js +110 -0
- package/dist/sdk/models/shared/othersublineitem.d.ts +15 -0
- package/dist/sdk/models/shared/othersublineitem.js +71 -0
- package/dist/sdk/models/shared/overridebpsprice.d.ts +27 -0
- package/dist/sdk/models/shared/{bpspriceoverride.js → overridebpsprice.js} +27 -18
- package/dist/sdk/models/shared/overridebulkbpsprice.d.ts +27 -0
- package/dist/sdk/models/shared/{bulkbpspriceoverride.js → overridebulkbpsprice.js} +27 -18
- package/dist/sdk/models/shared/overridebulkprice.d.ts +27 -0
- package/dist/sdk/models/shared/{bulkpriceoverride.js → overridebulkprice.js} +27 -18
- package/dist/sdk/models/shared/overridefivetranexampleprice.d.ts +26 -0
- package/dist/sdk/models/shared/overridefivetranexampleprice.js +81 -0
- package/dist/sdk/models/shared/overridematrixprice.d.ts +27 -0
- package/dist/sdk/models/shared/overridematrixprice.js +83 -0
- package/dist/sdk/models/shared/overridepackageprice.d.ts +27 -0
- package/dist/sdk/models/shared/{packagepriceoverride.js → overridepackageprice.js} +27 -18
- package/dist/sdk/models/shared/overridepackagewithallocationprice.d.ts +26 -0
- package/dist/sdk/models/shared/overridepackagewithallocationprice.js +81 -0
- package/dist/sdk/models/shared/overridetestratingfunctionprice.d.ts +26 -0
- package/dist/sdk/models/shared/overridetestratingfunctionprice.js +81 -0
- package/dist/sdk/models/shared/overridethresholdtotalamountprice.d.ts +26 -0
- package/dist/sdk/models/shared/overridethresholdtotalamountprice.js +81 -0
- package/dist/sdk/models/shared/overridetieredbpsprice.d.ts +27 -0
- package/dist/sdk/models/shared/{tieredbpspriceoverride.js → overridetieredbpsprice.js} +30 -21
- package/dist/sdk/models/shared/overridetieredpackageprice.d.ts +26 -0
- package/dist/sdk/models/shared/overridetieredpackageprice.js +81 -0
- package/dist/sdk/models/shared/overridetieredprice.d.ts +27 -0
- package/dist/sdk/models/shared/{tieredpriceoverride.js → overridetieredprice.js} +27 -18
- package/dist/sdk/models/shared/overridetieredwithminimumprice.d.ts +26 -0
- package/dist/sdk/models/shared/overridetieredwithminimumprice.js +81 -0
- package/dist/sdk/models/shared/overrideunitprice.d.ts +27 -0
- package/dist/sdk/models/shared/{unitpriceoverride.js → overrideunitprice.js} +27 -18
- package/dist/sdk/models/shared/packageconfig.d.ts +7 -4
- package/dist/sdk/models/shared/packageconfig.js +0 -3
- package/dist/sdk/models/shared/packageprice.d.ts +242 -0
- package/dist/sdk/models/shared/packageprice.js +363 -0
- package/dist/sdk/models/shared/packagewithallocationprice.d.ts +241 -0
- package/dist/sdk/models/shared/packagewithallocationprice.js +361 -0
- package/dist/sdk/models/shared/percentagediscount.d.ts +15 -0
- package/dist/sdk/models/shared/percentagediscount.js +59 -0
- package/dist/sdk/models/shared/percentagediscountcreationparams.d.ts +11 -0
- package/dist/sdk/models/shared/percentagediscountcreationparams.js +54 -0
- package/dist/sdk/models/shared/percentagediscountinterval.d.ts +27 -0
- package/dist/sdk/models/shared/percentagediscountinterval.js +82 -0
- package/dist/sdk/models/shared/perpricecost.d.ts +206 -6
- package/dist/sdk/models/shared/perpricecost.js +6 -6
- package/dist/sdk/models/shared/phaseoverride.d.ts +7 -30
- package/dist/sdk/models/shared/phaseoverride.js +4 -42
- package/dist/sdk/models/shared/{availability.d.ts → pingresponse.d.ts} +1 -4
- package/dist/sdk/models/shared/{availability.js → pingresponse.js} +7 -10
- package/dist/sdk/models/shared/plan.d.ts +29 -62
- package/dist/sdk/models/shared/plan.js +55 -108
- package/dist/sdk/models/shared/planminified.d.ts +6 -2
- package/dist/sdk/models/shared/planminified.js +5 -0
- package/dist/sdk/models/shared/planphase.d.ts +18 -58
- package/dist/sdk/models/shared/planphase.js +30 -86
- package/dist/sdk/models/shared/plans.d.ts +2 -5
- package/dist/sdk/models/shared/plans.js +0 -3
- package/dist/sdk/models/shared/pricegroup.d.ts +2 -2
- package/dist/sdk/models/shared/priceinterval.d.ts +239 -0
- package/dist/sdk/models/shared/priceinterval.js +104 -0
- package/dist/sdk/models/shared/priceintervalfixedfeequantitytransitionparams.d.ts +11 -0
- package/dist/sdk/models/shared/priceintervalfixedfeequantitytransitionparams.js +54 -0
- package/dist/sdk/models/shared/prices.d.ts +6 -0
- package/dist/sdk/models/shared/prices.js +52 -0
- package/dist/sdk/models/shared/reportingconfiguration.d.ts +4 -0
- package/dist/sdk/models/shared/reportingconfiguration.js +45 -0
- package/dist/sdk/models/shared/requesttoolargeerror.d.ts +16 -0
- package/dist/sdk/models/shared/requesttoolargeerror.js +82 -0
- package/dist/sdk/models/shared/requestvalidationerror.d.ts +14 -17
- package/dist/sdk/models/shared/requestvalidationerror.js +29 -7
- package/dist/sdk/models/shared/resourcenotfounderror.d.ts +16 -0
- package/dist/sdk/models/shared/resourcenotfounderror.js +82 -0
- package/dist/sdk/models/shared/resourcetoolargeerror.d.ts +16 -0
- package/dist/sdk/models/shared/resourcetoolargeerror.js +82 -0
- package/dist/sdk/models/shared/sublineitemgrouping.d.ts +8 -0
- package/dist/sdk/models/shared/{grouping.js → sublineitemgrouping.js} +8 -11
- package/dist/sdk/models/shared/sublineitemmatrixconfig.d.ts +7 -0
- package/dist/sdk/models/shared/{matrixconfig1.js → sublineitemmatrixconfig.js} +7 -10
- package/dist/sdk/models/shared/subscription.d.ts +64 -31
- package/dist/sdk/models/shared/subscription.js +61 -42
- package/dist/sdk/models/shared/subscriptioncosts.d.ts +2 -5
- package/dist/sdk/models/shared/subscriptioncosts.js +3 -6
- package/dist/sdk/models/shared/subscriptionminified.d.ts +0 -3
- package/dist/sdk/models/shared/subscriptionminified.js +0 -3
- package/dist/sdk/models/shared/subscriptionplanchange.d.ts +20 -15
- package/dist/sdk/models/shared/subscriptionplanchange.js +37 -15
- package/dist/sdk/models/shared/subscriptions.d.ts +2 -5
- package/dist/sdk/models/shared/subscriptions.js +0 -3
- package/dist/sdk/models/shared/subscriptionscheduleitem.d.ts +3 -3
- package/dist/sdk/models/shared/{subscriptionschedule.d.ts → subscriptionscheduleitems.d.ts} +3 -6
- package/dist/sdk/models/shared/{subscriptionschedule.js → subscriptionscheduleitems.js} +8 -11
- package/dist/sdk/models/shared/subscriptiontrialinfo.d.ts +4 -0
- package/dist/sdk/models/shared/{subscriptioncancellation.js → subscriptiontrialinfo.js} +8 -14
- package/dist/sdk/models/shared/testratingfunctionprice.d.ts +241 -0
- package/dist/sdk/models/shared/testratingfunctionprice.js +361 -0
- package/dist/sdk/models/shared/thresholdtotalamountprice.d.ts +241 -0
- package/dist/sdk/models/shared/thresholdtotalamountprice.js +361 -0
- package/dist/sdk/models/shared/tier.d.ts +11 -2
- package/dist/sdk/models/shared/tier.js +2 -2
- package/dist/sdk/models/shared/tierconfig.d.ts +2 -5
- package/dist/sdk/models/shared/tierconfig.js +2 -5
- package/dist/sdk/models/shared/tieredbpsconfig.d.ts +4 -4
- package/dist/sdk/models/shared/tieredbpsconfig.js +0 -3
- package/dist/sdk/models/shared/tieredbpsprice.d.ts +242 -0
- package/dist/sdk/models/shared/tieredbpsprice.js +363 -0
- package/dist/sdk/models/shared/tieredconfig.d.ts +4 -4
- package/dist/sdk/models/shared/tieredconfig.js +0 -3
- package/dist/sdk/models/shared/tieredpackageprice.d.ts +241 -0
- package/dist/sdk/models/shared/tieredpackageprice.js +361 -0
- package/dist/sdk/models/shared/tieredprice.d.ts +242 -0
- package/dist/sdk/models/shared/tieredprice.js +363 -0
- package/dist/sdk/models/shared/tieredwithminimumprice.d.ts +241 -0
- package/dist/sdk/models/shared/tieredwithminimumprice.js +361 -0
- package/dist/sdk/models/shared/tiersublineitem.d.ts +17 -0
- package/dist/sdk/models/shared/{sublineitem1.js → tiersublineitem.js} +21 -18
- package/dist/sdk/models/shared/trialconfig.d.ts +1 -1
- package/dist/sdk/models/shared/trialdiscount.d.ts +19 -0
- package/dist/sdk/models/shared/trialdiscount.js +64 -0
- package/dist/sdk/models/shared/triggersubscriptionphaseparams.d.ts +8 -0
- package/dist/sdk/models/shared/triggersubscriptionphaseparams.js +51 -0
- package/dist/sdk/models/shared/ungroupedsubscriptionusage.d.ts +5 -0
- package/dist/sdk/models/shared/ungroupedsubscriptionusage.js +47 -0
- package/dist/sdk/models/shared/ungroupedsubscriptionusagerecord.d.ts +12 -0
- package/dist/sdk/models/shared/ungroupedsubscriptionusagerecord.js +64 -0
- package/dist/sdk/models/shared/unitconfig.d.ts +8 -4
- package/dist/sdk/models/shared/unitconfig.js +5 -3
- package/dist/sdk/models/shared/unitprice.d.ts +242 -0
- package/dist/sdk/models/shared/unitprice.js +363 -0
- package/dist/sdk/models/shared/unschedulefixedfeequantitychangeparams.d.ts +7 -0
- package/dist/sdk/models/shared/unschedulefixedfeequantitychangeparams.js +45 -0
- package/dist/sdk/models/shared/upcominginvoice.d.ts +89 -54
- package/dist/sdk/models/shared/upcominginvoice.js +216 -88
- package/dist/sdk/models/shared/updateevent.d.ts +1 -1
- package/dist/sdk/models/shared/updateevent.js +5 -1
- package/dist/sdk/models/shared/urlnotfound.d.ts +16 -0
- package/dist/sdk/models/shared/urlnotfound.js +82 -0
- package/dist/sdk/models/shared/usage.d.ts +3 -10
- package/dist/sdk/models/shared/usage.js +18 -24
- package/dist/sdk/models/shared/usagediscount.d.ts +15 -0
- package/dist/sdk/models/shared/{tier7.js → usagediscount.js} +18 -19
- package/dist/sdk/models/shared/usagediscountcreationparams.d.ts +11 -0
- package/dist/sdk/models/shared/usagediscountcreationparams.js +54 -0
- package/dist/sdk/models/shared/usagediscountinterval.d.ts +27 -0
- package/dist/sdk/models/shared/usagediscountinterval.js +82 -0
- package/dist/sdk/models/shared/validationerror.d.ts +11 -0
- package/dist/sdk/models/shared/validationerror.js +50 -0
- package/dist/sdk/models/shared/voidinitiatedledgerentry.d.ts +30 -0
- package/dist/sdk/models/shared/voidinitiatedledgerentry.js +139 -0
- package/dist/sdk/models/shared/voidledgerentry.d.ts +29 -0
- package/dist/sdk/models/shared/voidledgerentry.js +130 -0
- package/dist/sdk/plan.d.ts +54 -186
- package/dist/sdk/plan.js +656 -202
- package/dist/sdk/price.d.ts +246 -0
- package/dist/sdk/price.js +790 -0
- package/dist/sdk/priceinterval.d.ts +65 -0
- package/dist/sdk/priceinterval.js +281 -0
- package/dist/sdk/sdk.d.ts +149 -58
- package/dist/sdk/sdk.js +23 -40
- package/dist/sdk/subscription.d.ts +435 -280
- package/dist/sdk/subscription.js +1516 -350
- package/docs/models/operations/addeditpriceintervalsrequest.md +9 -0
- package/docs/models/operations/addeditpriceintervalsresponse.md +18 -0
- package/docs/models/operations/amendeventrequest.md +9 -0
- package/docs/models/operations/amendeventresponse.md +18 -0
- package/docs/models/operations/amendusageexternalcustomeridrequest.md +11 -0
- package/docs/models/operations/amendusageexternalcustomeridresponse.md +18 -0
- package/docs/models/operations/amendusagerequest.md +11 -0
- package/docs/models/operations/amendusageresponse.md +18 -0
- package/docs/models/operations/archivecouponrequest.md +8 -0
- package/docs/models/operations/archivecouponresponse.md +18 -0
- package/docs/models/operations/cancelsubscriptionrequest.md +9 -0
- package/docs/models/operations/cancelsubscriptionresponse.md +18 -0
- package/docs/models/operations/closebackfillrequest.md +8 -0
- package/docs/models/operations/closebackfillresponse.md +18 -0
- package/docs/models/operations/createbackfillresponse.md +18 -0
- package/docs/models/operations/createcouponresponse.md +18 -0
- package/docs/models/operations/createcustomerbalancetransactionrequest.md +9 -0
- package/docs/models/operations/createcustomerbalancetransactionresponse.md +18 -0
- package/docs/models/operations/createcustomerresponse.md +18 -0
- package/docs/models/operations/createinvoicelineitemresponse.md +18 -0
- package/docs/models/operations/createinvoiceresponse.md +18 -0
- package/docs/models/operations/createledgerentryexternalidrequest.md +9 -0
- package/docs/models/operations/createledgerentryexternalidresponse.md +18 -0
- package/docs/models/operations/createledgerentryrequest.md +9 -0
- package/docs/models/operations/createledgerentryresponse.md +18 -0
- package/docs/models/operations/createmetricresponse.md +18 -0
- package/docs/models/operations/createplanresponse.md +18 -0
- package/docs/models/operations/createpriceresponse.md +18 -0
- package/docs/models/operations/createsubscriptionresponse.md +18 -0
- package/docs/models/operations/deletecustomerrequest.md +8 -0
- package/docs/models/operations/deletecustomerresponse.md +18 -0
- package/docs/models/operations/deprecateeventrequest.md +8 -0
- package/docs/models/operations/deprecateeventresponse.md +18 -0
- package/docs/models/operations/fetchbackfillrequest.md +8 -0
- package/docs/models/operations/fetchbackfillresponse.md +18 -0
- package/docs/models/operations/fetchcouponrequest.md +8 -0
- package/docs/models/operations/fetchcouponresponse.md +18 -0
- package/docs/models/operations/fetchcreditnoterequest.md +8 -0
- package/docs/models/operations/fetchcreditnoteresponse.md +18 -0
- package/docs/models/operations/fetchcustomercostsexternalidrequest.md +12 -0
- package/docs/models/operations/fetchcustomercostsexternalidresponse.md +18 -0
- package/docs/models/operations/fetchcustomercostsexternalidviewmodeviewmode.md +11 -0
- package/docs/models/operations/fetchcustomercostsrequest.md +12 -0
- package/docs/models/operations/fetchcustomercostsresponse.md +18 -0
- package/docs/models/operations/fetchcustomercostsviewmodeviewmode.md +11 -0
- package/docs/models/operations/fetchcustomercreditsexternalidrequest.md +10 -0
- package/docs/models/operations/fetchcustomercreditsexternalidresponse.md +18 -0
- package/docs/models/operations/fetchcustomercreditsledgerentrystatusentrystatus.md +9 -0
- package/docs/models/operations/fetchcustomercreditsledgerentrytypeentrytype.md +14 -0
- package/docs/models/operations/fetchcustomercreditsledgerexternalidentrystatusentrystatus.md +9 -0
- package/docs/models/operations/fetchcustomercreditsledgerexternalidentrytypeentrytype.md +14 -0
- package/docs/models/operations/fetchcustomercreditsledgerexternalidrequest.md +18 -0
- package/docs/models/operations/fetchcustomercreditsledgerexternalidresponse.md +18 -0
- package/docs/models/operations/fetchcustomercreditsledgerrequest.md +18 -0
- package/docs/models/operations/fetchcustomercreditsledgerresponse.md +18 -0
- package/docs/models/operations/fetchcustomercreditsrequest.md +10 -0
- package/docs/models/operations/fetchcustomercreditsresponse.md +18 -0
- package/docs/models/operations/fetchcustomerexternalidrequest.md +8 -0
- package/docs/models/operations/fetchcustomerexternalidresponse.md +18 -0
- package/docs/models/operations/fetchcustomerrequest.md +8 -0
- package/docs/models/operations/fetchcustomerresponse.md +18 -0
- package/docs/models/operations/fetchinvoicerequest.md +8 -0
- package/docs/models/operations/fetchinvoiceresponse.md +18 -0
- package/docs/models/operations/fetchitemrequest.md +8 -0
- package/docs/models/operations/fetchitemresponse.md +18 -0
- package/docs/models/operations/fetchmetricrequest.md +8 -0
- package/docs/models/operations/fetchmetricresponse.md +18 -0
- package/docs/models/operations/fetchplanexternalidrequest.md +8 -0
- package/docs/models/operations/fetchplanexternalidresponse.md +18 -0
- package/docs/models/operations/fetchplanrequest.md +8 -0
- package/docs/models/operations/fetchplanresponse.md +18 -0
- package/docs/models/operations/fetchpriceexternalidrequest.md +8 -0
- package/docs/models/operations/fetchpriceexternalidresponse.md +18 -0
- package/docs/models/operations/fetchpricerequest.md +8 -0
- package/docs/models/operations/fetchpriceresponse.md +18 -0
- package/docs/models/operations/fetchsubscriptioncostsrequest.md +12 -0
- package/docs/models/operations/fetchsubscriptioncostsresponse.md +18 -0
- package/docs/models/operations/fetchsubscriptioncostsviewmodeviewmode.md +11 -0
- package/docs/models/operations/fetchsubscriptionrequest.md +8 -0
- package/docs/models/operations/fetchsubscriptionresponse.md +18 -0
- package/docs/models/operations/fetchsubscriptionschedulerequest.md +14 -0
- package/docs/models/operations/fetchsubscriptionscheduleresponse.md +18 -0
- package/docs/models/operations/fetchsubscriptionusagegranularitygranularity.md +10 -0
- package/docs/models/operations/fetchsubscriptionusagerequest.md +20 -0
- package/docs/models/operations/fetchsubscriptionusageresponse.md +18 -0
- package/docs/models/operations/fetchsubscriptionusageviewmodeviewmode.md +11 -0
- package/docs/models/operations/fetchupcominginvoicerequest.md +8 -0
- package/docs/models/operations/fetchupcominginvoiceresponse.md +18 -0
- package/docs/models/operations/ingestrequest.md +10 -0
- package/docs/models/operations/ingestresponse.md +18 -0
- package/docs/models/operations/issueinvoicerequest.md +8 -0
- package/docs/models/operations/issueinvoiceresponse.md +18 -0
- package/docs/models/operations/listbackfillsrequest.md +9 -0
- package/docs/models/operations/listbackfillsresponse.md +18 -0
- package/docs/models/operations/listbalancetransactionsrequest.md +14 -0
- package/docs/models/operations/listbalancetransactionsresponse.md +18 -0
- package/docs/models/operations/listcouponsrequest.md +11 -0
- package/docs/models/operations/listcouponsresponse.md +18 -0
- package/docs/models/operations/listcouponsubscriptionsrequest.md +10 -0
- package/docs/models/operations/listcouponsubscriptionsresponse.md +18 -0
- package/docs/models/operations/listcreditnotesrequest.md +9 -0
- package/docs/models/operations/listcreditnotesresponse.md +18 -0
- package/docs/models/operations/listcustomersrequest.md +13 -0
- package/docs/models/operations/listcustomersresponse.md +18 -0
- package/docs/models/operations/listinvoicesdatetypedatetype.md +9 -0
- package/docs/models/operations/listinvoicesrequest.md +27 -0
- package/docs/models/operations/listinvoicesresponse.md +18 -0
- package/docs/models/operations/listinvoicesstatus.md +12 -0
- package/docs/models/operations/listinvoicesstatusstatus.md +12 -0
- package/docs/models/operations/listitemsrequest.md +9 -0
- package/docs/models/operations/listitemsresponse.md +18 -0
- package/docs/models/operations/listmetricsrequest.md +13 -0
- package/docs/models/operations/listmetricsresponse.md +18 -0
- package/docs/models/operations/listplansrequest.md +14 -0
- package/docs/models/operations/listplansresponse.md +18 -0
- package/docs/models/operations/listplansstatusstatus.md +12 -0
- package/docs/models/operations/listpricesrequest.md +9 -0
- package/docs/models/operations/listpricesresponse.md +18 -0
- package/docs/models/operations/listsubscriptionsrequest.md +16 -0
- package/docs/models/operations/listsubscriptionsresponse.md +18 -0
- package/docs/models/operations/listsubscriptionsstatusstatus.md +10 -0
- package/docs/models/operations/markinvoiceaspaidrequest.md +9 -0
- package/docs/models/operations/markinvoiceaspaidresponse.md +18 -0
- package/docs/models/operations/pingresponse.md +18 -0
- package/docs/models/operations/revertbackfillrequest.md +8 -0
- package/docs/models/operations/revertbackfillresponse.md +18 -0
- package/docs/models/operations/scheduleplanchangerequest.md +9 -0
- package/docs/models/operations/scheduleplanchangeresponse.md +18 -0
- package/docs/models/operations/searcheventsrequest.md +14 -0
- package/docs/models/operations/searcheventsresponse.md +18 -0
- package/docs/models/operations/triggerphaserequest.md +9 -0
- package/docs/models/operations/triggerphaseresponse.md +18 -0
- package/docs/models/operations/unschedulecancellationrequest.md +8 -0
- package/docs/models/operations/unschedulecancellationresponse.md +18 -0
- package/docs/models/operations/unschedulefixedfeequantityrequest.md +9 -0
- package/docs/models/operations/unschedulefixedfeequantityresponse.md +18 -0
- package/docs/models/operations/unscheduleplanchangerequest.md +8 -0
- package/docs/models/operations/unscheduleplanchangeresponse.md +18 -0
- package/docs/models/operations/updatecustomerexternalidrequest.md +9 -0
- package/docs/models/operations/updatecustomerexternalidresponse.md +18 -0
- package/docs/models/operations/updatecustomerrequest.md +9 -0
- package/docs/models/operations/updatecustomerresponse.md +18 -0
- package/docs/models/operations/updatefixedfeequantityrequest.md +9 -0
- package/docs/models/operations/updatefixedfeequantityresponse.md +18 -0
- package/docs/models/operations/updateplanexternalrequest.md +9 -0
- package/docs/models/operations/updateplanexternalresponse.md +18 -0
- package/docs/models/operations/updateplanrequest.md +9 -0
- package/docs/models/operations/updateplanresponse.md +18 -0
- package/docs/models/operations/voidinvoicerequest.md +8 -0
- package/docs/models/operations/voidinvoiceresponse.md +18 -0
- package/docs/models/shared/accountingprovider.md +9 -0
- package/docs/models/shared/accountingproviderconfig.md +9 -0
- package/docs/models/shared/accountingproviderprovidertype.md +9 -0
- package/docs/models/shared/accountingsyncconfiguration.md +9 -0
- package/docs/models/shared/addamendmentcreditledgerentryrequestparams.md +12 -0
- package/docs/models/shared/addamendmentcreditledgerentryrequestparamsentrytype.md +8 -0
- package/docs/models/shared/addamendmentcreditledgerentryrequestparamsmetadata.md +9 -0
- package/docs/models/shared/adddecrementcreditledgerentryrequestparams.md +11 -0
- package/docs/models/shared/adddecrementcreditledgerentryrequestparamsentrytype.md +8 -0
- package/docs/models/shared/adddecrementcreditledgerentryrequestparamsmetadata.md +9 -0
- package/docs/models/shared/addeditpriceintervalparams.md +9 -0
- package/docs/models/shared/addexpirationchangecreditledgerentryrequestparams.md +14 -0
- package/docs/models/shared/addexpirationchangecreditledgerentryrequestparamsentrytype.md +8 -0
- package/docs/models/shared/addexpirationchangecreditledgerentryrequestparamsmetadata.md +9 -0
- package/docs/models/shared/addincrementcreditledgerentryrequestparams.md +15 -0
- package/docs/models/shared/addincrementcreditledgerentryrequestparamsentrytype.md +8 -0
- package/docs/models/shared/addincrementcreditledgerentryrequestparamsmetadata.md +9 -0
- package/docs/models/shared/addpriceintervalparams.md +16 -0
- package/docs/models/shared/addpriceintervalparamsenddateenddate.md +11 -0
- package/docs/models/shared/addpriceintervalparamsstartdatestartdate.md +11 -0
- package/docs/models/shared/address.md +13 -0
- package/docs/models/shared/addressinput.md +13 -0
- package/docs/models/shared/addvoidcreditledgerentryrequestparams.md +13 -0
- package/docs/models/shared/addvoidcreditledgerentryrequestparamsentrytype.md +8 -0
- package/docs/models/shared/addvoidcreditledgerentryrequestparamsmetadata.md +9 -0
- package/docs/models/shared/addvoidcreditledgerentryrequestparamsvoidreason.md +10 -0
- package/docs/models/shared/affectedblock.md +10 -0
- package/docs/models/shared/aggregatedcost.md +12 -0
- package/docs/models/shared/amendedevent.md +12 -0
- package/docs/models/shared/amendedeventproperties.md +9 -0
- package/docs/models/shared/amendedusage.md +9 -0
- package/docs/models/shared/amendeventresult.md +8 -0
- package/docs/models/shared/amendmentledgerentry.md +21 -0
- package/docs/models/shared/amendmentledgerentryentrystatus.md +9 -0
- package/docs/models/shared/amendmentledgerentryentrytype.md +8 -0
- package/docs/models/shared/amountdiscount.md +10 -0
- package/docs/models/shared/amountdiscountcreationparams.md +9 -0
- package/docs/models/shared/amountdiscountcreationparamsdiscounttype.md +8 -0
- package/docs/models/shared/amountdiscountdiscounttype.md +8 -0
- package/docs/models/shared/amountdiscountinterval.md +13 -0
- package/docs/models/shared/amountdiscountintervaldiscounttype.md +8 -0
- package/docs/models/shared/autocollection.md +10 -0
- package/docs/models/shared/backfill.md +17 -0
- package/docs/models/shared/backfills.md +9 -0
- package/docs/models/shared/backfillstatus.md +13 -0
- package/docs/models/shared/billablemetric.md +16 -0
- package/docs/models/shared/billablemetrics.md +9 -0
- package/docs/models/shared/billablemetricsimple.md +9 -0
- package/docs/models/shared/billablemetricstatus.md +10 -0
- package/docs/models/shared/billablemetrictiny.md +8 -0
- package/docs/models/shared/billingcyclealignment.md +12 -0
- package/docs/models/shared/bpsconfig.md +9 -0
- package/docs/models/shared/bpsprice.md +225 -0
- package/docs/models/shared/bpspricecadence.md +11 -0
- package/docs/models/shared/bpspricemodeltype.md +8 -0
- package/docs/models/shared/bpspricepricetype.md +9 -0
- package/docs/models/shared/bpstier.md +11 -0
- package/docs/models/shared/bulkbpsconfig.md +8 -0
- package/docs/models/shared/bulkbpsprice.md +225 -0
- package/docs/models/shared/bulkbpspricecadence.md +11 -0
- package/docs/models/shared/bulkbpspricemodeltype.md +8 -0
- package/docs/models/shared/bulkbpspricepricetype.md +9 -0
- package/docs/models/shared/bulkbpstier.md +10 -0
- package/docs/models/shared/bulkconfig.md +8 -0
- package/docs/models/shared/bulkprice.md +225 -0
- package/docs/models/shared/bulkpricecadence.md +11 -0
- package/docs/models/shared/bulkpricemodeltype.md +8 -0
- package/docs/models/shared/bulkpricepricetype.md +9 -0
- package/docs/models/shared/bulktier.md +9 -0
- package/docs/models/shared/cancelsubscriptionparams.md +9 -0
- package/docs/models/shared/cancelsubscriptionparamscanceloption.md +12 -0
- package/docs/models/shared/changeoption.md +10 -0
- package/docs/models/shared/coupon.md +21 -0
- package/docs/models/shared/coupondiscount.md +7 -0
- package/docs/models/shared/couponredemption.md +10 -0
- package/docs/models/shared/coupons.md +9 -0
- package/docs/models/shared/createinvoicelineitemparams.md +13 -0
- package/docs/models/shared/createoneoffinvoiceparams.md +15 -0
- package/docs/models/shared/creditblockexpiryledgerentry.md +21 -0
- package/docs/models/shared/creditblockexpiryledgerentryentrystatus.md +9 -0
- package/docs/models/shared/creditblockexpiryledgerentryentrytype.md +8 -0
- package/docs/models/shared/creditledgerentries.md +9 -0
- package/docs/models/shared/creditnote.md +26 -0
- package/docs/models/shared/creditnotediscounts.md +7 -0
- package/docs/models/shared/creditnotelineitem.md +15 -0
- package/docs/models/shared/creditnotelineitemdiscounts.md +7 -0
- package/docs/models/shared/creditnotelineitemtaxamounts.md +7 -0
- package/docs/models/shared/creditnotemaximumamountadjustment.md +9 -0
- package/docs/models/shared/creditnoteminified.md +8 -0
- package/docs/models/shared/creditnotereason.md +11 -0
- package/docs/models/shared/creditnotes.md +9 -0
- package/docs/models/shared/creditnotesublineitem.md +10 -0
- package/docs/models/shared/creditnotesummary.md +13 -0
- package/docs/models/shared/creditnotetype.md +9 -0
- package/docs/models/shared/customer.md +42 -0
- package/docs/models/shared/customerbalancetransaction.md +17 -0
- package/docs/models/shared/customerbalancetransactionaction.md +10 -0
- package/docs/models/shared/customerbalancetransactions.md +9 -0
- package/docs/models/shared/customerbalancetransactiontype.md +9 -0
- package/docs/models/shared/customercosts.md +8 -0
- package/docs/models/shared/customercreditbalance.md +11 -0
- package/docs/models/shared/customercreditbalances.md +9 -0
- package/docs/models/shared/customerminified.md +9 -0
- package/docs/models/shared/customerpaymentprovider.md +14 -0
- package/docs/models/shared/customers.md +9 -0
- package/docs/models/shared/customertaxid.md +10 -0
- package/docs/models/shared/debug.md +11 -0
- package/docs/models/shared/decrementledgerentry.md +24 -0
- package/docs/models/shared/decrementledgerentryentrystatus.md +9 -0
- package/docs/models/shared/decrementledgerentryentrytype.md +8 -0
- package/docs/models/shared/deletecustomerresponse.md +7 -0
- package/docs/models/shared/deprecatedeventresult.md +8 -0
- package/docs/models/shared/discount.md +15 -0
- package/docs/models/shared/discountdiscounttype.md +11 -0
- package/docs/models/shared/duplicateconstraintviolationerror.md +12 -0
- package/docs/models/shared/duplicateconstraintviolationerrorheaders.md +7 -0
- package/docs/models/shared/duplicateconstraintviolationerrorstatus.md +8 -0
- package/docs/models/shared/duplicateconstraintviolationerrortype.md +8 -0
- package/docs/models/shared/duplicateresourcecreationerror.md +12 -0
- package/docs/models/shared/duplicateresourcecreationerrorheaders.md +7 -0
- package/docs/models/shared/duplicateresourcecreationerrorstatus.md +8 -0
- package/docs/models/shared/duplicateresourcecreationerrortype.md +8 -0
- package/docs/models/shared/editcustomer.md +22 -0
- package/docs/models/shared/editcustomermetadata.md +9 -0
- package/docs/models/shared/editcustomerpaymentprovider.md +16 -0
- package/docs/models/shared/editplan.md +9 -0
- package/docs/models/shared/editplanmetadata.md +7 -0
- package/docs/models/shared/editpriceintervalparams.md +11 -0
- package/docs/models/shared/editpriceintervalparamsenddateenddate.md +11 -0
- package/docs/models/shared/editpriceintervalparamsstartdatestartdate.md +11 -0
- package/docs/models/shared/event.md +17 -0
- package/docs/models/shared/eventproperties.md +9 -0
- package/docs/models/shared/events.md +9 -0
- package/docs/models/shared/eventsearchcriteria.md +9 -0
- package/docs/models/shared/expirationchangeledgerentry.md +22 -0
- package/docs/models/shared/expirationchangeledgerentryentrystatus.md +9 -0
- package/docs/models/shared/expirationchangeledgerentryentrytype.md +8 -0
- package/docs/models/shared/featurenotavailableerror.md +12 -0
- package/docs/models/shared/featurenotavailableerrorheaders.md +7 -0
- package/docs/models/shared/featurenotavailableerrorstatus.md +8 -0
- package/docs/models/shared/featurenotavailableerrortype.md +8 -0
- package/docs/models/shared/fivehundrederror.md +12 -0
- package/docs/models/shared/fivehundrederrorheaders.md +7 -0
- package/docs/models/shared/fivehundrederrortype.md +8 -0
- package/docs/models/shared/fivetranexampleprice.md +225 -0
- package/docs/models/shared/fivetranexamplepricecadence.md +11 -0
- package/docs/models/shared/fivetranexamplepricemodeltype.md +8 -0
- package/docs/models/shared/fivetranexamplepricepricetype.md +9 -0
- package/docs/models/shared/fixedfeequantitychange.md +11 -0
- package/docs/models/shared/fixedfeequantitychangechangeoption.md +12 -0
- package/docs/models/shared/fixedfeequantityscheduleentry.md +11 -0
- package/docs/models/shared/fixedfeequantitytransition.md +10 -0
- package/docs/models/shared/fourhundredandoneerror.md +12 -0
- package/docs/models/shared/fourhundredandoneerrorheaders.md +7 -0
- package/docs/models/shared/fourhundredandoneerrorstatus.md +8 -0
- package/docs/models/shared/fourhundredandoneerrortype.md +8 -0
- package/docs/models/shared/fourhundredandtwentynineerror.md +12 -0
- package/docs/models/shared/fourhundredandtwentynineerrorheaders.md +7 -0
- package/docs/models/shared/fourhundredandtwentynineerrorstatus.md +8 -0
- package/docs/models/shared/fourhundredandtwentynineerrortype.md +8 -0
- package/docs/models/shared/groupedsubscriptionusage.md +9 -0
- package/docs/models/shared/groupedsubscriptionusagerecord.md +11 -0
- package/docs/models/shared/groupedsubscriptionusagerecordviewmode.md +9 -0
- package/docs/models/shared/idempotencyconflict.md +12 -0
- package/docs/models/shared/idempotencyconflictheaders.md +7 -0
- package/docs/models/shared/idempotencyconflictstatus.md +8 -0
- package/docs/models/shared/idempotencyconflicttype.md +8 -0
- package/docs/models/shared/idempotencykeyvalidationerror.md +13 -0
- package/docs/models/shared/idempotencykeyvalidationerrorheaders.md +7 -0
- package/docs/models/shared/idempotencykeyvalidationerrorstatus.md +8 -0
- package/docs/models/shared/idempotencykeyvalidationerrortype.md +8 -0
- package/docs/models/shared/idempotencyrequestmismatch.md +12 -0
- package/docs/models/shared/idempotencyrequestmismatchheaders.md +7 -0
- package/docs/models/shared/idempotencyrequestmismatchstatus.md +8 -0
- package/docs/models/shared/idempotencyrequestmismatchtype.md +8 -0
- package/docs/models/shared/incrementcreditledgerentryinvoicesettings.md +12 -0
- package/docs/models/shared/incrementledgerentry.md +21 -0
- package/docs/models/shared/incrementledgerentryentrystatus.md +9 -0
- package/docs/models/shared/incrementledgerentryentrytype.md +8 -0
- package/docs/models/shared/ingestevent.md +13 -0
- package/docs/models/shared/ingesteventproperties.md +9 -0
- package/docs/models/shared/ingestionresponse.md +9 -0
- package/docs/models/shared/ingestrequestbody.md +8 -0
- package/docs/models/shared/invoice.md +51 -0
- package/docs/models/shared/invoicelineitem.md +23 -0
- package/docs/models/shared/invoicelineitemparams.md +14 -0
- package/docs/models/shared/invoicelineitemparamsmodeltype.md +8 -0
- package/docs/models/shared/invoicemetadata.md +7 -0
- package/docs/models/shared/invoiceminified.md +8 -0
- package/docs/models/shared/invoices.md +9 -0
- package/docs/models/shared/invoicestatus.md +12 -0
- package/docs/models/shared/item.md +14 -0
- package/docs/models/shared/itemexternalconnection.md +9 -0
- package/docs/models/shared/itemexternalconnectionexternalconnectionnameexternalconnectionname.md +11 -0
- package/docs/models/shared/itemexternalconnectionexternalconnectionnameexternalconnectionname1.md +10 -0
- package/docs/models/shared/items.md +9 -0
- package/docs/models/shared/itemslim.md +9 -0
- package/docs/models/shared/markaspaidrequestparams.md +10 -0
- package/docs/models/shared/matrixconfig.md +11 -0
- package/docs/models/shared/matrixprice.md +225 -0
- package/docs/models/shared/matrixpricecadence.md +11 -0
- package/docs/models/shared/matrixpricemodeltype.md +8 -0
- package/docs/models/shared/matrixpricepricetype.md +9 -0
- package/docs/models/shared/matrixsublineitem.md +13 -0
- package/docs/models/shared/matrixsublineitemtype.md +8 -0
- package/docs/models/shared/matrixvalue.md +10 -0
- package/docs/models/shared/maximum.md +9 -0
- package/docs/models/shared/maximuminterval.md +12 -0
- package/docs/models/shared/metricgroup.md +9 -0
- package/docs/models/shared/minimum.md +9 -0
- package/docs/models/shared/minimuminterval.md +12 -0
- package/docs/models/shared/newaccountingsyncconfiguration.md +9 -0
- package/docs/models/shared/newbackfill.md +13 -0
- package/docs/models/shared/newbillablemetric.md +12 -0
- package/docs/models/shared/newbillablemetricmetadata.md +9 -0
- package/docs/models/shared/newbpsprice.md +18 -0
- package/docs/models/shared/newbpspricecadence.md +12 -0
- package/docs/models/shared/newbpspricemodeltype.md +8 -0
- package/docs/models/shared/newbulkbpsprice.md +18 -0
- package/docs/models/shared/newbulkbpspricecadence.md +12 -0
- package/docs/models/shared/newbulkbpspricemodeltype.md +8 -0
- package/docs/models/shared/newbulkprice.md +18 -0
- package/docs/models/shared/newbulkpricecadence.md +12 -0
- package/docs/models/shared/newbulkpricemodeltype.md +8 -0
- package/docs/models/shared/newcoupon.md +11 -0
- package/docs/models/shared/newcoupondiscount.md +7 -0
- package/docs/models/shared/newcustomer.md +23 -0
- package/docs/models/shared/newcustomerbalancetransaction.md +10 -0
- package/docs/models/shared/newcustomerbalancetransactiontype.md +9 -0
- package/docs/models/shared/newcustomermetadata.md +9 -0
- package/docs/models/shared/newcustomerpaymentprovider.md +14 -0
- package/docs/models/shared/newmatrixprice.md +18 -0
- package/docs/models/shared/newmatrixpricecadence.md +12 -0
- package/docs/models/shared/newmatrixpricemodeltype.md +8 -0
- package/docs/models/shared/newpackageprice.md +18 -0
- package/docs/models/shared/newpackagepricecadence.md +12 -0
- package/docs/models/shared/newpackagepricemodeltype.md +8 -0
- package/docs/models/shared/newpackagewithallocationprice.md +18 -0
- package/docs/models/shared/newpackagewithallocationpricecadence.md +12 -0
- package/docs/models/shared/newpackagewithallocationpricemodeltype.md +8 -0
- package/docs/models/shared/newplan.md +14 -0
- package/docs/models/shared/newplanmetadata.md +7 -0
- package/docs/models/shared/newplanprices.md +7 -0
- package/docs/models/shared/newreportingconfiguration.md +8 -0
- package/docs/models/shared/newsubscription.md +31 -0
- package/docs/models/shared/newsubscriptionexternalmarketplace.md +10 -0
- package/docs/models/shared/newsubscriptionmetadata.md +7 -0
- package/docs/models/shared/newthresholdtotalamountprice.md +18 -0
- package/docs/models/shared/newthresholdtotalamountpricecadence.md +12 -0
- package/docs/models/shared/newthresholdtotalamountpricemodeltype.md +8 -0
- package/docs/models/shared/newtieredbpsprice.md +18 -0
- package/docs/models/shared/newtieredbpspricecadence.md +12 -0
- package/docs/models/shared/newtieredbpspricemodeltype.md +8 -0
- package/docs/models/shared/newtieredpackageprice.md +18 -0
- package/docs/models/shared/newtieredpackagepricecadence.md +12 -0
- package/docs/models/shared/newtieredpackagepricemodeltype.md +8 -0
- package/docs/models/shared/newtieredprice.md +18 -0
- package/docs/models/shared/newtieredpricecadence.md +12 -0
- package/docs/models/shared/newtieredpricemodeltype.md +8 -0
- package/docs/models/shared/newtieredwithminimumprice.md +18 -0
- package/docs/models/shared/newtieredwithminimumpricecadence.md +12 -0
- package/docs/models/shared/newtieredwithminimumpricemodeltype.md +8 -0
- package/docs/models/shared/newunitprice.md +18 -0
- package/docs/models/shared/newunitpricecadence.md +12 -0
- package/docs/models/shared/newunitpricemodeltype.md +8 -0
- package/docs/models/shared/othersublineitem.md +12 -0
- package/docs/models/shared/othersublineitemtype.md +8 -0
- package/docs/models/shared/overridebpsprice.md +14 -0
- package/docs/models/shared/overridebpspricemodeltype.md +8 -0
- package/docs/models/shared/overridebulkbpsprice.md +14 -0
- package/docs/models/shared/overridebulkbpspricemodeltype.md +8 -0
- package/docs/models/shared/overridebulkprice.md +14 -0
- package/docs/models/shared/overridebulkpricemodeltype.md +8 -0
- package/docs/models/shared/overridefivetranexampleprice.md +14 -0
- package/docs/models/shared/overridefivetranexamplepricemodeltype.md +8 -0
- package/docs/models/shared/overridematrixprice.md +14 -0
- package/docs/models/shared/overridematrixpricemodeltype.md +8 -0
- package/docs/models/shared/overridepackageprice.md +14 -0
- package/docs/models/shared/overridepackagepricemodeltype.md +8 -0
- package/docs/models/shared/overridepackagewithallocationprice.md +14 -0
- package/docs/models/shared/overridepackagewithallocationpricemodeltype.md +8 -0
- package/docs/models/shared/overridetestratingfunctionprice.md +14 -0
- package/docs/models/shared/overridetestratingfunctionpricemodeltype.md +8 -0
- package/docs/models/shared/overridethresholdtotalamountprice.md +14 -0
- package/docs/models/shared/overridethresholdtotalamountpricemodeltype.md +8 -0
- package/docs/models/shared/overridetieredbpsprice.md +14 -0
- package/docs/models/shared/overridetieredbpspricemodeltype.md +8 -0
- package/docs/models/shared/overridetieredpackageprice.md +14 -0
- package/docs/models/shared/overridetieredpackagepricemodeltype.md +8 -0
- package/docs/models/shared/overridetieredprice.md +14 -0
- package/docs/models/shared/overridetieredpricemodeltype.md +8 -0
- package/docs/models/shared/overridetieredwithminimumprice.md +14 -0
- package/docs/models/shared/overridetieredwithminimumpricemodeltype.md +8 -0
- package/docs/models/shared/overrideunitprice.md +14 -0
- package/docs/models/shared/overrideunitpricemodeltype.md +8 -0
- package/docs/models/shared/packageconfig.md +9 -0
- package/docs/models/shared/packageprice.md +225 -0
- package/docs/models/shared/packagepricecadence.md +11 -0
- package/docs/models/shared/packagepricemodeltype.md +8 -0
- package/docs/models/shared/packagepricepricetype.md +9 -0
- package/docs/models/shared/packagewithallocationprice.md +225 -0
- package/docs/models/shared/packagewithallocationpricecadence.md +11 -0
- package/docs/models/shared/packagewithallocationpricemodeltype.md +8 -0
- package/docs/models/shared/packagewithallocationpricepricetype.md +9 -0
- package/docs/models/shared/paginationmetadata.md +9 -0
- package/docs/models/shared/percentagediscount.md +10 -0
- package/docs/models/shared/percentagediscountcreationparams.md +9 -0
- package/docs/models/shared/percentagediscountcreationparamsdiscounttype.md +8 -0
- package/docs/models/shared/percentagediscountdiscounttype.md +8 -0
- package/docs/models/shared/percentagediscountinterval.md +13 -0
- package/docs/models/shared/percentagediscountintervaldiscounttype.md +8 -0
- package/docs/models/shared/perpricecost.md +12 -0
- package/docs/models/shared/phaseoverride.md +11 -0
- package/docs/models/shared/pingresponse.md +8 -0
- package/docs/models/shared/plan.md +33 -0
- package/docs/models/shared/planmetadata.md +7 -0
- package/docs/models/shared/planminified.md +10 -0
- package/docs/models/shared/planphase.md +18 -0
- package/docs/models/shared/planphasedurationunit.md +11 -0
- package/docs/models/shared/planprices.md +7 -0
- package/docs/models/shared/plans.md +9 -0
- package/docs/models/shared/planstatus.md +10 -0
- package/docs/models/shared/pricegroup.md +12 -0
- package/docs/models/shared/priceinterval.md +18 -0
- package/docs/models/shared/priceintervalfixedfeequantitytransitionparams.md +9 -0
- package/docs/models/shared/prices.md +9 -0
- package/docs/models/shared/product.md +10 -0
- package/docs/models/shared/reportingconfiguration.md +8 -0
- package/docs/models/shared/requesttoolargeerror.md +12 -0
- package/docs/models/shared/requesttoolargeerrorheaders.md +7 -0
- package/docs/models/shared/requesttoolargeerrorstatus.md +8 -0
- package/docs/models/shared/requesttoolargeerrortype.md +8 -0
- package/docs/models/shared/requestvalidationerror.md +13 -0
- package/docs/models/shared/requestvalidationerrorheaders.md +7 -0
- package/docs/models/shared/requestvalidationerrorstatus.md +8 -0
- package/docs/models/shared/requestvalidationerrortype.md +8 -0
- package/docs/models/shared/resourcenotfounderror.md +12 -0
- package/docs/models/shared/resourcenotfounderrorheaders.md +7 -0
- package/docs/models/shared/resourcenotfounderrorstatus.md +8 -0
- package/docs/models/shared/resourcenotfounderrortype.md +8 -0
- package/docs/models/shared/resourcetoolargeerror.md +12 -0
- package/docs/models/shared/resourcetoolargeerrorheaders.md +7 -0
- package/docs/models/shared/resourcetoolargeerrorstatus.md +8 -0
- package/docs/models/shared/resourcetoolargeerrortype.md +8 -0
- package/docs/models/shared/security.md +8 -0
- package/docs/models/shared/sublineitemgrouping.md +9 -0
- package/docs/models/shared/sublineitemmatrixconfig.md +8 -0
- package/docs/models/shared/subscription.md +44 -0
- package/docs/models/shared/subscriptioncosts.md +8 -0
- package/docs/models/shared/subscriptionmetadata.md +9 -0
- package/docs/models/shared/subscriptionminified.md +8 -0
- package/docs/models/shared/subscriptionplanchange.md +23 -0
- package/docs/models/shared/subscriptions.md +9 -0
- package/docs/models/shared/subscriptionscheduleitem.md +10 -0
- package/docs/models/shared/subscriptionscheduleitems.md +9 -0
- package/docs/models/shared/subscriptionstatus.md +10 -0
- package/docs/models/shared/subscriptiontrialinfo.md +8 -0
- package/docs/models/shared/taxamount.md +10 -0
- package/docs/models/shared/testratingfunctionprice.md +225 -0
- package/docs/models/shared/testratingfunctionpricecadence.md +11 -0
- package/docs/models/shared/testratingfunctionpricemodeltype.md +8 -0
- package/docs/models/shared/testratingfunctionpricepricetype.md +9 -0
- package/docs/models/shared/thresholdtotalamountprice.md +225 -0
- package/docs/models/shared/thresholdtotalamountpricecadence.md +11 -0
- package/docs/models/shared/thresholdtotalamountpricemodeltype.md +8 -0
- package/docs/models/shared/thresholdtotalamountpricepricetype.md +9 -0
- package/docs/models/shared/tier.md +10 -0
- package/docs/models/shared/tierconfig.md +10 -0
- package/docs/models/shared/tieredbpsconfig.md +8 -0
- package/docs/models/shared/tieredbpsprice.md +225 -0
- package/docs/models/shared/tieredbpspricecadence.md +11 -0
- package/docs/models/shared/tieredbpspricemodeltype.md +8 -0
- package/docs/models/shared/tieredbpspricepricetype.md +9 -0
- package/docs/models/shared/tieredconfig.md +8 -0
- package/docs/models/shared/tieredpackageprice.md +225 -0
- package/docs/models/shared/tieredpackagepricecadence.md +11 -0
- package/docs/models/shared/tieredpackagepricemodeltype.md +8 -0
- package/docs/models/shared/tieredpackagepricepricetype.md +9 -0
- package/docs/models/shared/tieredprice.md +225 -0
- package/docs/models/shared/tieredpricecadence.md +11 -0
- package/docs/models/shared/tieredpricemodeltype.md +8 -0
- package/docs/models/shared/tieredpricepricetype.md +9 -0
- package/docs/models/shared/tieredwithminimumprice.md +225 -0
- package/docs/models/shared/tieredwithminimumpricecadence.md +11 -0
- package/docs/models/shared/tieredwithminimumpricemodeltype.md +8 -0
- package/docs/models/shared/tieredwithminimumpricepricetype.md +9 -0
- package/docs/models/shared/tiersublineitem.md +13 -0
- package/docs/models/shared/tiersublineitemtype.md +8 -0
- package/docs/models/shared/trialconfig.md +9 -0
- package/docs/models/shared/trialconfigtrialperiodunit.md +8 -0
- package/docs/models/shared/trialdiscount.md +11 -0
- package/docs/models/shared/trialdiscountdiscounttype.md +8 -0
- package/docs/models/shared/triggersubscriptionphaseparams.md +8 -0
- package/docs/models/shared/ungroupedsubscriptionusage.md +8 -0
- package/docs/models/shared/ungroupedsubscriptionusagerecord.md +10 -0
- package/docs/models/shared/ungroupedsubscriptionusagerecordviewmode.md +9 -0
- package/docs/models/shared/unitconfig.md +9 -0
- package/docs/models/shared/unitprice.md +225 -0
- package/docs/models/shared/unitpricecadence.md +11 -0
- package/docs/models/shared/unitpricemodeltype.md +8 -0
- package/docs/models/shared/unitpricepricetype.md +9 -0
- package/docs/models/shared/unschedulefixedfeequantitychangeparams.md +8 -0
- package/docs/models/shared/upcominginvoice.md +46 -0
- package/docs/models/shared/upcominginvoicemetadata.md +7 -0
- package/docs/models/shared/upcominginvoicestatus.md +12 -0
- package/docs/models/shared/updateevent.md +12 -0
- package/docs/models/shared/updateeventproperties.md +9 -0
- package/docs/models/shared/urlnotfound.md +12 -0
- package/docs/models/shared/urlnotfoundheaders.md +7 -0
- package/docs/models/shared/urlnotfoundstatus.md +8 -0
- package/docs/models/shared/urlnotfoundtype.md +8 -0
- package/docs/models/shared/usage.md +10 -0
- package/docs/models/shared/usagediscount.md +10 -0
- package/docs/models/shared/usagediscountcreationparams.md +9 -0
- package/docs/models/shared/usagediscountcreationparamsdiscounttype.md +8 -0
- package/docs/models/shared/usagediscountdiscounttype.md +8 -0
- package/docs/models/shared/usagediscountinterval.md +13 -0
- package/docs/models/shared/usagediscountintervaldiscounttype.md +8 -0
- package/docs/models/shared/validationerror.md +9 -0
- package/docs/models/shared/voidinitiatedledgerentry.md +24 -0
- package/docs/models/shared/voidinitiatedledgerentryentrystatus.md +9 -0
- package/docs/models/shared/voidinitiatedledgerentryentrytype.md +8 -0
- package/docs/models/shared/voidledgerentry.md +23 -0
- package/docs/models/shared/voidledgerentryentrystatus.md +9 -0
- package/docs/models/shared/voidledgerentryentrytype.md +8 -0
- package/docs/sdks/availability/README.md +45 -0
- package/docs/sdks/coupon/README.md +226 -0
- package/docs/sdks/credit/README.md +605 -0
- package/docs/sdks/creditnote/README.md +91 -0
- package/docs/sdks/customer/README.md +1129 -0
- package/docs/sdks/event/README.md +674 -0
- package/docs/sdks/invoice/README.md +402 -0
- package/docs/sdks/item/README.md +89 -0
- package/docs/sdks/metric/README.md +140 -0
- package/docs/sdks/orb/README.md +21 -0
- package/docs/sdks/plan/README.md +300 -0
- package/docs/sdks/price/README.md +411 -0
- package/docs/sdks/priceinterval/README.md +180 -0
- package/docs/sdks/subscription/README.md +1412 -0
- package/docs/types/rfcdate.md +11 -0
- package/package.json +2 -1
- package/dist/sdk/models/operations/addledgerentryexternalid.d.ts +0 -16
- package/dist/sdk/models/operations/listcreditnote.d.ts +0 -34
- package/dist/sdk/models/shared/action.d.ts +0 -8
- package/dist/sdk/models/shared/action.js +0 -15
- package/dist/sdk/models/shared/billablemetricminified.d.ts +0 -5
- package/dist/sdk/models/shared/bpspriceoverride.d.ts +0 -24
- package/dist/sdk/models/shared/bulkbpspriceoverride.d.ts +0 -24
- package/dist/sdk/models/shared/bulkpriceoverride.d.ts +0 -24
- package/dist/sdk/models/shared/cadence.d.ts +0 -5
- package/dist/sdk/models/shared/cadence.js +0 -12
- package/dist/sdk/models/shared/canceloption.d.ts +0 -8
- package/dist/sdk/models/shared/canceloption.js +0 -15
- package/dist/sdk/models/shared/changeoption1.d.ts +0 -8
- package/dist/sdk/models/shared/changeoption1.js +0 -15
- package/dist/sdk/models/shared/credit.d.ts +0 -16
- package/dist/sdk/models/shared/creditblock.d.ts +0 -15
- package/dist/sdk/models/shared/creditledgerentry.d.ts +0 -58
- package/dist/sdk/models/shared/creditnotetype.d.ts +0 -7
- package/dist/sdk/models/shared/creditnotetype.js +0 -14
- package/dist/sdk/models/shared/customercost.d.ts +0 -15
- package/dist/sdk/models/shared/discounttype.d.ts +0 -6
- package/dist/sdk/models/shared/discounttype.js +0 -13
- package/dist/sdk/models/shared/durationunit.d.ts +0 -8
- package/dist/sdk/models/shared/durationunit.js +0 -15
- package/dist/sdk/models/shared/entrystatus.d.ts +0 -7
- package/dist/sdk/models/shared/entrystatus.js +0 -14
- package/dist/sdk/models/shared/entrytype.d.ts +0 -9
- package/dist/sdk/models/shared/entrytype.js +0 -16
- package/dist/sdk/models/shared/eventsearchresults.d.ts +0 -10
- package/dist/sdk/models/shared/externalmarketplace.d.ts +0 -8
- package/dist/sdk/models/shared/externalmarketplace.js +0 -15
- package/dist/sdk/models/shared/fixedfeequantityschedule.d.ts +0 -7
- package/dist/sdk/models/shared/granularity.d.ts +0 -6
- package/dist/sdk/models/shared/granularity.js +0 -13
- package/dist/sdk/models/shared/grouping.d.ts +0 -8
- package/dist/sdk/models/shared/invoicestatus.d.ts +0 -10
- package/dist/sdk/models/shared/invoicestatus.js +0 -17
- package/dist/sdk/models/shared/lineitem.d.ts +0 -58
- package/dist/sdk/models/shared/lineitem.js +0 -147
- package/dist/sdk/models/shared/matrixconfig1.d.ts +0 -10
- package/dist/sdk/models/shared/modeltype.d.ts +0 -10
- package/dist/sdk/models/shared/modeltype.js +0 -17
- package/dist/sdk/models/shared/newcreditledgerentry.d.ts +0 -44
- package/dist/sdk/models/shared/newtransaction.d.ts +0 -10
- package/dist/sdk/models/shared/packagepriceoverride.d.ts +0 -24
- package/dist/sdk/models/shared/price.d.ts +0 -114
- package/dist/sdk/models/shared/price.js +0 -245
- package/dist/sdk/models/shared/reason.d.ts +0 -9
- package/dist/sdk/models/shared/reason.js +0 -16
- package/dist/sdk/models/shared/sublineitem.d.ts +0 -32
- package/dist/sdk/models/shared/sublineitem1.d.ts +0 -24
- package/dist/sdk/models/shared/subscriptioncancellation.d.ts +0 -12
- package/dist/sdk/models/shared/subscriptionstatus.d.ts +0 -5
- package/dist/sdk/models/shared/subscriptionstatus.js +0 -12
- package/dist/sdk/models/shared/subscriptionusage.d.ts +0 -8
- package/dist/sdk/models/shared/tier7.d.ts +0 -7
- package/dist/sdk/models/shared/tieredbpsconfig1.d.ts +0 -5
- package/dist/sdk/models/shared/tieredbpspriceoverride.d.ts +0 -21
- package/dist/sdk/models/shared/tieredpriceoverride.d.ts +0 -27
- package/dist/sdk/models/shared/transactiontype.d.ts +0 -4
- package/dist/sdk/models/shared/transactiontype.js +0 -11
- package/dist/sdk/models/shared/type.d.ts +0 -7
- package/dist/sdk/models/shared/type.js +0 -14
- package/dist/sdk/models/shared/unitpriceoverride.d.ts +0 -24
- package/dist/sdk/models/shared/usageitem.d.ts +0 -6
- package/dist/sdk/models/shared/validationerrors.d.ts +0 -13
- package/dist/sdk/models/shared/validationerrors.js +0 -59
- package/dist/sdk/models/shared/viewmode.d.ts +0 -7
- package/dist/sdk/models/shared/viewmode.js +0 -14
package/dist/sdk/credit.js
CHANGED
|
@@ -91,10 +91,11 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
91
91
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
92
92
|
exports.Credit = void 0;
|
|
93
93
|
var utils = __importStar(require("../internal/utils"));
|
|
94
|
+
var errors = __importStar(require("./models/errors"));
|
|
94
95
|
var operations = __importStar(require("./models/operations"));
|
|
95
96
|
var shared = __importStar(require("./models/shared"));
|
|
96
97
|
/**
|
|
97
|
-
* The
|
|
98
|
+
* The [Credit Ledger Entry resource](/guides/product-catalog/prepurchase) models prepaid credits within Orb.
|
|
98
99
|
*/
|
|
99
100
|
var Credit = /** @class */ (function () {
|
|
100
101
|
function Credit(sdkConfig) {
|
|
@@ -104,51 +105,209 @@ var Credit = /** @class */ (function () {
|
|
|
104
105
|
* Create ledger entry by external ID
|
|
105
106
|
*
|
|
106
107
|
* @remarks
|
|
107
|
-
* This endpoint
|
|
108
|
+
* This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to
|
|
109
|
+
* increment balance, deduct credits, and change the expiry date of existing credits.
|
|
110
|
+
*
|
|
111
|
+
* ## Effects of adding a ledger entry
|
|
112
|
+
* 1. After calling this endpoint, [Fetch Credit Balance](fetch-customer-credits) will return a credit block that
|
|
113
|
+
* represents the changes (i.e. balance changes or transfers).
|
|
114
|
+
* 2. A ledger entry will be added to the credits ledger for this customer, and therefore returned in the
|
|
115
|
+
* [View Credits Ledger](fetch-customer-credits) response as well as serialized in the response to this request. In
|
|
116
|
+
* the case of deductions without a specified block, multiple ledger entries may be created if the deduction spans
|
|
117
|
+
* credit blocks.
|
|
118
|
+
* 3. If `invoice_settings` is specified, an invoice will be created that reflects the cost of the credits (based on
|
|
119
|
+
* `amount` and `per_unit_cost_basis`).
|
|
120
|
+
*
|
|
121
|
+
* ## Adding credits
|
|
122
|
+
* Adding credits is done by creating an entry of type `increment`. This requires the caller to specify a number of
|
|
123
|
+
* credits as well as an optional expiry date in `YYYY-MM-DD` format. Orb also recommends specifying a description
|
|
124
|
+
* to assist with auditing. When adding credits, the caller can also specify a cost basis per-credit, to indicate
|
|
125
|
+
* how much in USD a customer paid for a single credit in a block. This can later be used for revenue recognition.
|
|
126
|
+
*
|
|
127
|
+
* The following snippet illustrates a sample request body to increment credits which will expire in January of 2022.
|
|
128
|
+
*
|
|
129
|
+
* ```json
|
|
130
|
+
* {
|
|
131
|
+
* "entry_type": "increment",
|
|
132
|
+
* "amount": 100,
|
|
133
|
+
* "expiry_date": "2022-12-28",
|
|
134
|
+
* "per_unit_cost_basis": "0.20",
|
|
135
|
+
* "description": "Purchased 100 credits"
|
|
136
|
+
* }
|
|
137
|
+
* ```
|
|
138
|
+
*
|
|
139
|
+
* Note that by default, Orb will always first increment any _negative_ balance in existing blocks before adding the
|
|
140
|
+
* remaining amount to the desired credit block.
|
|
141
|
+
*
|
|
142
|
+
* ### Invoicing for credits
|
|
143
|
+
* By default, Orb manipulates the credit ledger but does not charge for credits. However, if you pass
|
|
144
|
+
* `invoice_settings` in the body of this request, Orb will also generate a one-off invoice for the customer for the
|
|
145
|
+
* credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the
|
|
146
|
+
* invoice are calculated by multiplying the cost basis with the number of credit units added.
|
|
147
|
+
*
|
|
148
|
+
* ## Deducting Credits
|
|
149
|
+
* Orb allows you to deduct credits from a customer by creating an entry of type `decrement`. Orb matches the
|
|
150
|
+
* algorithm for automatic deductions for determining which credit blocks to decrement from. In the case that the
|
|
151
|
+
* deduction leads to multiple ledger entries, the response from this endpoint will be the final deduction. Orb also
|
|
152
|
+
* optionally allows specifying a description to assist with auditing.
|
|
153
|
+
*
|
|
154
|
+
* The following snippet illustrates a sample request body to decrement credits.
|
|
155
|
+
*
|
|
156
|
+
* ```json
|
|
157
|
+
* {
|
|
158
|
+
* "entry_type": "decrement",
|
|
159
|
+
* "amount": 20,
|
|
160
|
+
* "description": "Removing excess credits"
|
|
161
|
+
* }
|
|
162
|
+
* ```
|
|
163
|
+
*
|
|
164
|
+
* ## Changing credits expiry
|
|
165
|
+
* If you'd like to change when existing credits expire, you should create a ledger entry of type `expiration_change`.
|
|
166
|
+
* For this entry, the required parameter `expiry_date` identifies the _originating_ block, and the required parameter
|
|
167
|
+
* `target_expiry_date` identifies when the transferred credits should now expire. A new credit block will be created
|
|
168
|
+
* with expiry date `target_expiry_date`, with the same cost basis data as the original credit block, if present.
|
|
169
|
+
*
|
|
170
|
+
* Note that the balance of the block with the given `expiry_date` must be at least equal to the desired transfer
|
|
171
|
+
* amount determined by the `amount` parameter.
|
|
172
|
+
*
|
|
173
|
+
* The following snippet illustrates a sample request body to extend the expiration date of credits by one year:
|
|
174
|
+
*
|
|
175
|
+
* ```json
|
|
176
|
+
* {
|
|
177
|
+
* "entry_type": "expiration_change",
|
|
178
|
+
* "amount": 10,
|
|
179
|
+
* "expiry_date": "2022-12-28",
|
|
180
|
+
* "block_id": "UiUhFWeLHPrBY4Ad",
|
|
181
|
+
* "target_expiry_date": "2023-12-28",
|
|
182
|
+
* "description": "Extending credit validity"
|
|
183
|
+
* }
|
|
184
|
+
* ```
|
|
185
|
+
*
|
|
186
|
+
* ## Voiding credits
|
|
187
|
+
*
|
|
188
|
+
* If you'd like to void a credit block, create a ledger entry of type `void`. For this entry, `block_id` is required
|
|
189
|
+
* to identify the block, and `amount` indicates how many credits to void, up to the block's initial balance. Pass
|
|
190
|
+
* in a `void_reason` of `refund` if the void is due to a refund.
|
|
191
|
+
*
|
|
192
|
+
* ## Amendment
|
|
193
|
+
*
|
|
194
|
+
* If you'd like to undo a decrement on a credit block, create a ledger entry of type `amendment`. For this entry, `block_id`
|
|
195
|
+
* is required to identify the block that was originally decremented from, and `amount` indicates how many credits to return
|
|
196
|
+
* to the customer, up to the block's initial balance.
|
|
108
197
|
*/
|
|
109
198
|
Credit.prototype.addByExternalId = function (req, config) {
|
|
110
199
|
var _a, _b;
|
|
111
200
|
return __awaiter(this, void 0, void 0, function () {
|
|
112
|
-
var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res, decodedRes;
|
|
201
|
+
var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
113
202
|
var _d;
|
|
114
203
|
return __generator(this, function (_e) {
|
|
115
204
|
switch (_e.label) {
|
|
116
205
|
case 0:
|
|
117
206
|
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
118
|
-
req = new operations.
|
|
207
|
+
req = new operations.CreateLedgerEntryExternalIdRequest(req);
|
|
119
208
|
}
|
|
120
209
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
121
210
|
url = utils.generateURL(baseURL, "/customers/external_customer_id/{external_customer_id}/credits/ledger_entry", req);
|
|
122
|
-
_c = __read([{},
|
|
211
|
+
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
123
212
|
try {
|
|
124
|
-
_d = __read(utils.serializeRequestBody(req, "
|
|
213
|
+
_d = __read(utils.serializeRequestBody(req, "requestBody", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
125
214
|
}
|
|
126
215
|
catch (e) {
|
|
127
216
|
if (e instanceof Error) {
|
|
128
217
|
throw new Error("Error serializing request body, cause: ".concat(e.message));
|
|
129
218
|
}
|
|
130
219
|
}
|
|
131
|
-
client = this.sdkConfiguration.
|
|
132
|
-
|
|
220
|
+
client = this.sdkConfiguration.defaultClient;
|
|
221
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
222
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
223
|
+
return [4 /*yield*/, globalSecurity()];
|
|
224
|
+
case 1:
|
|
225
|
+
globalSecurity = _e.sent();
|
|
226
|
+
_e.label = 2;
|
|
227
|
+
case 2:
|
|
228
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
229
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
230
|
+
}
|
|
231
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
232
|
+
headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
133
233
|
headers["Accept"] = "application/json";
|
|
134
|
-
headers["user-agent"] =
|
|
234
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
135
235
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
136
|
-
case
|
|
236
|
+
case 3:
|
|
137
237
|
httpRes = _e.sent();
|
|
138
238
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
139
239
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
140
240
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
141
241
|
}
|
|
142
|
-
res = new operations.
|
|
242
|
+
res = new operations.CreateLedgerEntryExternalIdResponse({
|
|
143
243
|
statusCode: httpRes.status,
|
|
144
244
|
contentType: contentType,
|
|
145
245
|
rawResponse: httpRes,
|
|
146
246
|
});
|
|
147
247
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
148
248
|
switch (true) {
|
|
149
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) ==
|
|
249
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 201:
|
|
150
250
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
151
|
-
res.creditLedgerEntry =
|
|
251
|
+
res.creditLedgerEntry = JSON.parse(decodedRes);
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
255
|
+
}
|
|
256
|
+
break;
|
|
257
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
|
|
258
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
259
|
+
res.fourHundredError = JSON.parse(decodedRes);
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
263
|
+
}
|
|
264
|
+
break;
|
|
265
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
266
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
267
|
+
res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
271
|
+
}
|
|
272
|
+
break;
|
|
273
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
|
|
274
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
275
|
+
res.fourHundredAndFourError = JSON.parse(decodedRes);
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
279
|
+
}
|
|
280
|
+
break;
|
|
281
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
|
|
282
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
283
|
+
res.fourHundredAndNineError = JSON.parse(decodedRes);
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
287
|
+
}
|
|
288
|
+
break;
|
|
289
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
|
|
290
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
291
|
+
res.fourHundredAndThirteenError = JSON.parse(decodedRes);
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
295
|
+
}
|
|
296
|
+
break;
|
|
297
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
298
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
299
|
+
res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
303
|
+
}
|
|
304
|
+
break;
|
|
305
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
306
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
307
|
+
res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
152
311
|
}
|
|
153
312
|
break;
|
|
154
313
|
}
|
|
@@ -161,15 +320,24 @@ var Credit = /** @class */ (function () {
|
|
|
161
320
|
* Create ledger entry
|
|
162
321
|
*
|
|
163
322
|
* @remarks
|
|
164
|
-
* This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to
|
|
323
|
+
* This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to
|
|
324
|
+
* increment balance, deduct credits, and change the expiry date of existing credits.
|
|
165
325
|
*
|
|
166
326
|
* ## Effects of adding a ledger entry
|
|
167
|
-
* 1. After calling this endpoint, [Fetch Credit Balance](fetch-customer-credits) will return a credit block that
|
|
168
|
-
*
|
|
169
|
-
*
|
|
327
|
+
* 1. After calling this endpoint, [Fetch Credit Balance](fetch-customer-credits) will return a credit block that
|
|
328
|
+
* represents the changes (i.e. balance changes or transfers).
|
|
329
|
+
* 2. A ledger entry will be added to the credits ledger for this customer, and therefore returned in the
|
|
330
|
+
* [View Credits Ledger](fetch-customer-credits) response as well as serialized in the response to this request. In
|
|
331
|
+
* the case of deductions without a specified block, multiple ledger entries may be created if the deduction spans
|
|
332
|
+
* credit blocks.
|
|
333
|
+
* 3. If `invoice_settings` is specified, an invoice will be created that reflects the cost of the credits (based on
|
|
334
|
+
* `amount` and `per_unit_cost_basis`).
|
|
170
335
|
*
|
|
171
336
|
* ## Adding credits
|
|
172
|
-
*
|
|
337
|
+
* Adding credits is done by creating an entry of type `increment`. This requires the caller to specify a number of
|
|
338
|
+
* credits as well as an optional expiry date in `YYYY-MM-DD` format. Orb also recommends specifying a description
|
|
339
|
+
* to assist with auditing. When adding credits, the caller can also specify a cost basis per-credit, to indicate
|
|
340
|
+
* how much in USD a customer paid for a single credit in a block. This can later be used for revenue recognition.
|
|
173
341
|
*
|
|
174
342
|
* The following snippet illustrates a sample request body to increment credits which will expire in January of 2022.
|
|
175
343
|
*
|
|
@@ -183,13 +351,20 @@ var Credit = /** @class */ (function () {
|
|
|
183
351
|
* }
|
|
184
352
|
* ```
|
|
185
353
|
*
|
|
186
|
-
* Note that by default, Orb will always first increment any _negative_ balance in existing blocks before adding the
|
|
354
|
+
* Note that by default, Orb will always first increment any _negative_ balance in existing blocks before adding the
|
|
355
|
+
* remaining amount to the desired credit block.
|
|
187
356
|
*
|
|
188
357
|
* ### Invoicing for credits
|
|
189
|
-
* By default, Orb manipulates the credit ledger but does not charge for credits. However, if you pass
|
|
358
|
+
* By default, Orb manipulates the credit ledger but does not charge for credits. However, if you pass
|
|
359
|
+
* `invoice_settings` in the body of this request, Orb will also generate a one-off invoice for the customer for the
|
|
360
|
+
* credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the
|
|
361
|
+
* invoice are calculated by multiplying the cost basis with the number of credit units added.
|
|
190
362
|
*
|
|
191
363
|
* ## Deducting Credits
|
|
192
|
-
* Orb allows you to deduct credits from a customer by creating an entry of type `decrement`. Orb matches the
|
|
364
|
+
* Orb allows you to deduct credits from a customer by creating an entry of type `decrement`. Orb matches the
|
|
365
|
+
* algorithm for automatic deductions for determining which credit blocks to decrement from. In the case that the
|
|
366
|
+
* deduction leads to multiple ledger entries, the response from this endpoint will be the final deduction. Orb also
|
|
367
|
+
* optionally allows specifying a description to assist with auditing.
|
|
193
368
|
*
|
|
194
369
|
* The following snippet illustrates a sample request body to decrement credits.
|
|
195
370
|
*
|
|
@@ -202,9 +377,13 @@ var Credit = /** @class */ (function () {
|
|
|
202
377
|
* ```
|
|
203
378
|
*
|
|
204
379
|
* ## Changing credits expiry
|
|
205
|
-
* If you'd like to change when existing credits expire, you should create a ledger entry of type `expiration_change`.
|
|
380
|
+
* If you'd like to change when existing credits expire, you should create a ledger entry of type `expiration_change`.
|
|
381
|
+
* For this entry, the required parameter `expiry_date` identifies the _originating_ block, and the required parameter
|
|
382
|
+
* `target_expiry_date` identifies when the transferred credits should now expire. A new credit block will be created
|
|
383
|
+
* with expiry date `target_expiry_date`, with the same cost basis data as the original credit block, if present.
|
|
206
384
|
*
|
|
207
|
-
* Note that the balance of the block with the given `expiry_date` must be at least equal to the desired transfer
|
|
385
|
+
* Note that the balance of the block with the given `expiry_date` must be at least equal to the desired transfer
|
|
386
|
+
* amount determined by the `amount` parameter.
|
|
208
387
|
*
|
|
209
388
|
* The following snippet illustrates a sample request body to extend the expiration date of credits by one year:
|
|
210
389
|
*
|
|
@@ -218,11 +397,23 @@ var Credit = /** @class */ (function () {
|
|
|
218
397
|
* "description": "Extending credit validity"
|
|
219
398
|
* }
|
|
220
399
|
* ```
|
|
400
|
+
*
|
|
401
|
+
* ## Voiding credits
|
|
402
|
+
*
|
|
403
|
+
* If you'd like to void a credit block, create a ledger entry of type `void`. For this entry, `block_id` is required
|
|
404
|
+
* to identify the block, and `amount` indicates how many credits to void, up to the block's initial balance. Pass
|
|
405
|
+
* in a `void_reason` of `refund` if the void is due to a refund.
|
|
406
|
+
*
|
|
407
|
+
* ## Amendment
|
|
408
|
+
*
|
|
409
|
+
* If you'd like to undo a decrement on a credit block, create a ledger entry of type `amendment`. For this entry, `block_id`
|
|
410
|
+
* is required to identify the block that was originally decremented from, and `amount` indicates how many credits to return
|
|
411
|
+
* to the customer, up to the block's initial balance.
|
|
221
412
|
*/
|
|
222
413
|
Credit.prototype.create = function (req, config) {
|
|
223
414
|
var _a, _b;
|
|
224
415
|
return __awaiter(this, void 0, void 0, function () {
|
|
225
|
-
var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res, decodedRes;
|
|
416
|
+
var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
226
417
|
var _d;
|
|
227
418
|
return __generator(this, function (_e) {
|
|
228
419
|
switch (_e.label) {
|
|
@@ -232,21 +423,32 @@ var Credit = /** @class */ (function () {
|
|
|
232
423
|
}
|
|
233
424
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
234
425
|
url = utils.generateURL(baseURL, "/customers/{customer_id}/credits/ledger_entry", req);
|
|
235
|
-
_c = __read([{},
|
|
426
|
+
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
236
427
|
try {
|
|
237
|
-
_d = __read(utils.serializeRequestBody(req, "
|
|
428
|
+
_d = __read(utils.serializeRequestBody(req, "requestBody", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
238
429
|
}
|
|
239
430
|
catch (e) {
|
|
240
431
|
if (e instanceof Error) {
|
|
241
432
|
throw new Error("Error serializing request body, cause: ".concat(e.message));
|
|
242
433
|
}
|
|
243
434
|
}
|
|
244
|
-
client = this.sdkConfiguration.
|
|
245
|
-
|
|
435
|
+
client = this.sdkConfiguration.defaultClient;
|
|
436
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
437
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
438
|
+
return [4 /*yield*/, globalSecurity()];
|
|
439
|
+
case 1:
|
|
440
|
+
globalSecurity = _e.sent();
|
|
441
|
+
_e.label = 2;
|
|
442
|
+
case 2:
|
|
443
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
444
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
445
|
+
}
|
|
446
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
447
|
+
headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
246
448
|
headers["Accept"] = "application/json";
|
|
247
|
-
headers["user-agent"] =
|
|
449
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
248
450
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
249
|
-
case
|
|
451
|
+
case 3:
|
|
250
452
|
httpRes = _e.sent();
|
|
251
453
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
252
454
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
@@ -259,9 +461,68 @@ var Credit = /** @class */ (function () {
|
|
|
259
461
|
});
|
|
260
462
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
261
463
|
switch (true) {
|
|
262
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) ==
|
|
464
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 201:
|
|
465
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
466
|
+
res.creditLedgerEntry = JSON.parse(decodedRes);
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
470
|
+
}
|
|
471
|
+
break;
|
|
472
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
|
|
473
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
474
|
+
res.fourHundredError = JSON.parse(decodedRes);
|
|
475
|
+
}
|
|
476
|
+
else {
|
|
477
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
478
|
+
}
|
|
479
|
+
break;
|
|
480
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
481
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
482
|
+
res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
|
|
483
|
+
}
|
|
484
|
+
else {
|
|
485
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
486
|
+
}
|
|
487
|
+
break;
|
|
488
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
|
|
489
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
490
|
+
res.fourHundredAndFourError = JSON.parse(decodedRes);
|
|
491
|
+
}
|
|
492
|
+
else {
|
|
493
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
494
|
+
}
|
|
495
|
+
break;
|
|
496
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
|
|
497
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
498
|
+
res.fourHundredAndNineError = JSON.parse(decodedRes);
|
|
499
|
+
}
|
|
500
|
+
else {
|
|
501
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
502
|
+
}
|
|
503
|
+
break;
|
|
504
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
|
|
505
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
506
|
+
res.fourHundredAndThirteenError = JSON.parse(decodedRes);
|
|
507
|
+
}
|
|
508
|
+
else {
|
|
509
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
510
|
+
}
|
|
511
|
+
break;
|
|
512
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
513
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
514
|
+
res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
|
|
515
|
+
}
|
|
516
|
+
else {
|
|
517
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
518
|
+
}
|
|
519
|
+
break;
|
|
520
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
263
521
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
264
|
-
res.
|
|
522
|
+
res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
265
526
|
}
|
|
266
527
|
break;
|
|
267
528
|
}
|
|
@@ -274,16 +535,12 @@ var Credit = /** @class */ (function () {
|
|
|
274
535
|
* Fetch customer credit balance
|
|
275
536
|
*
|
|
276
537
|
* @remarks
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
* Orb keeps track of credit balances in _credit blocks_, where each block is optionally associated with an `expiry_date`. Each time credits are added, a new credit block is created. Credits which do not expire have an `expiry_date` of `null`. To aid in revenue recognition, credit blocks can optionally have a `per_unit_cost_basis`, to indicate how much in USD a customer paid for a single credit in a block.
|
|
280
|
-
*
|
|
281
|
-
* Orb only returns _unexpired_ credit blocks in this response. For credits that have already expired, you can view this deduction from the customer's balance in the [Credit Ledger](fetch-customer-credits-ledger) response.
|
|
538
|
+
* Returns a paginated list of unexpired, non-zero credit blocks for a customer.
|
|
282
539
|
*/
|
|
283
|
-
Credit.prototype.
|
|
540
|
+
Credit.prototype.fetchBalance = function (req, config) {
|
|
284
541
|
var _a, _b;
|
|
285
542
|
return __awaiter(this, void 0, void 0, function () {
|
|
286
|
-
var baseURL, url, client, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
543
|
+
var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
287
544
|
return __generator(this, function (_c) {
|
|
288
545
|
switch (_c.label) {
|
|
289
546
|
case 0:
|
|
@@ -292,13 +549,24 @@ var Credit = /** @class */ (function () {
|
|
|
292
549
|
}
|
|
293
550
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
294
551
|
url = utils.generateURL(baseURL, "/customers/{customer_id}/credits", req);
|
|
295
|
-
client = this.sdkConfiguration.
|
|
296
|
-
|
|
552
|
+
client = this.sdkConfiguration.defaultClient;
|
|
553
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
554
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
555
|
+
return [4 /*yield*/, globalSecurity()];
|
|
556
|
+
case 1:
|
|
557
|
+
globalSecurity = _c.sent();
|
|
558
|
+
_c.label = 2;
|
|
559
|
+
case 2:
|
|
560
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
561
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
562
|
+
}
|
|
563
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
564
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
297
565
|
queryParams = utils.serializeQueryParams(req);
|
|
298
566
|
headers["Accept"] = "application/json";
|
|
299
|
-
headers["user-agent"] =
|
|
567
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
300
568
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
301
|
-
case
|
|
569
|
+
case 3:
|
|
302
570
|
httpRes = _c.sent();
|
|
303
571
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
304
572
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
@@ -313,7 +581,66 @@ var Credit = /** @class */ (function () {
|
|
|
313
581
|
switch (true) {
|
|
314
582
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
315
583
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
316
|
-
res.
|
|
584
|
+
res.customerCreditBalances = utils.objectToClass(JSON.parse(decodedRes), shared.CustomerCreditBalances);
|
|
585
|
+
}
|
|
586
|
+
else {
|
|
587
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
588
|
+
}
|
|
589
|
+
break;
|
|
590
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
|
|
591
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
592
|
+
res.fourHundredError = JSON.parse(decodedRes);
|
|
593
|
+
}
|
|
594
|
+
else {
|
|
595
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
596
|
+
}
|
|
597
|
+
break;
|
|
598
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
599
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
600
|
+
res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
|
|
601
|
+
}
|
|
602
|
+
else {
|
|
603
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
604
|
+
}
|
|
605
|
+
break;
|
|
606
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
|
|
607
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
608
|
+
res.fourHundredAndFourError = JSON.parse(decodedRes);
|
|
609
|
+
}
|
|
610
|
+
else {
|
|
611
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
612
|
+
}
|
|
613
|
+
break;
|
|
614
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
|
|
615
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
616
|
+
res.fourHundredAndNineError = JSON.parse(decodedRes);
|
|
617
|
+
}
|
|
618
|
+
else {
|
|
619
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
620
|
+
}
|
|
621
|
+
break;
|
|
622
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
|
|
623
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
624
|
+
res.fourHundredAndThirteenError = JSON.parse(decodedRes);
|
|
625
|
+
}
|
|
626
|
+
else {
|
|
627
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
628
|
+
}
|
|
629
|
+
break;
|
|
630
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
631
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
632
|
+
res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
|
|
633
|
+
}
|
|
634
|
+
else {
|
|
635
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
636
|
+
}
|
|
637
|
+
break;
|
|
638
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
639
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
640
|
+
res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
|
|
641
|
+
}
|
|
642
|
+
else {
|
|
643
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
317
644
|
}
|
|
318
645
|
break;
|
|
319
646
|
}
|
|
@@ -326,12 +653,12 @@ var Credit = /** @class */ (function () {
|
|
|
326
653
|
* Fetch customer credit balance by external customer id
|
|
327
654
|
*
|
|
328
655
|
* @remarks
|
|
329
|
-
*
|
|
656
|
+
* Returns a paginated list of unexpired, non-zero credit blocks for a customer.
|
|
330
657
|
*/
|
|
331
|
-
Credit.prototype.
|
|
658
|
+
Credit.prototype.fetchBalanceByExternalId = function (req, config) {
|
|
332
659
|
var _a, _b;
|
|
333
660
|
return __awaiter(this, void 0, void 0, function () {
|
|
334
|
-
var baseURL, url, client, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
661
|
+
var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
335
662
|
return __generator(this, function (_c) {
|
|
336
663
|
switch (_c.label) {
|
|
337
664
|
case 0:
|
|
@@ -340,13 +667,24 @@ var Credit = /** @class */ (function () {
|
|
|
340
667
|
}
|
|
341
668
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
342
669
|
url = utils.generateURL(baseURL, "/customers/external_customer_id/{external_customer_id}/credits", req);
|
|
343
|
-
client = this.sdkConfiguration.
|
|
344
|
-
|
|
670
|
+
client = this.sdkConfiguration.defaultClient;
|
|
671
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
672
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
673
|
+
return [4 /*yield*/, globalSecurity()];
|
|
674
|
+
case 1:
|
|
675
|
+
globalSecurity = _c.sent();
|
|
676
|
+
_c.label = 2;
|
|
677
|
+
case 2:
|
|
678
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
679
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
680
|
+
}
|
|
681
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
682
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
345
683
|
queryParams = utils.serializeQueryParams(req);
|
|
346
684
|
headers["Accept"] = "application/json";
|
|
347
|
-
headers["user-agent"] =
|
|
685
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
348
686
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
349
|
-
case
|
|
687
|
+
case 3:
|
|
350
688
|
httpRes = _c.sent();
|
|
351
689
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
352
690
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
@@ -361,7 +699,66 @@ var Credit = /** @class */ (function () {
|
|
|
361
699
|
switch (true) {
|
|
362
700
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
363
701
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
364
|
-
res.
|
|
702
|
+
res.customerCreditBalances = utils.objectToClass(JSON.parse(decodedRes), shared.CustomerCreditBalances);
|
|
703
|
+
}
|
|
704
|
+
else {
|
|
705
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
706
|
+
}
|
|
707
|
+
break;
|
|
708
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
|
|
709
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
710
|
+
res.fourHundredError = JSON.parse(decodedRes);
|
|
711
|
+
}
|
|
712
|
+
else {
|
|
713
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
714
|
+
}
|
|
715
|
+
break;
|
|
716
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
717
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
718
|
+
res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
|
|
719
|
+
}
|
|
720
|
+
else {
|
|
721
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
722
|
+
}
|
|
723
|
+
break;
|
|
724
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
|
|
725
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
726
|
+
res.fourHundredAndFourError = JSON.parse(decodedRes);
|
|
727
|
+
}
|
|
728
|
+
else {
|
|
729
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
730
|
+
}
|
|
731
|
+
break;
|
|
732
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
|
|
733
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
734
|
+
res.fourHundredAndNineError = JSON.parse(decodedRes);
|
|
735
|
+
}
|
|
736
|
+
else {
|
|
737
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
738
|
+
}
|
|
739
|
+
break;
|
|
740
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
|
|
741
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
742
|
+
res.fourHundredAndThirteenError = JSON.parse(decodedRes);
|
|
743
|
+
}
|
|
744
|
+
else {
|
|
745
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
746
|
+
}
|
|
747
|
+
break;
|
|
748
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
749
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
750
|
+
res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
|
|
751
|
+
}
|
|
752
|
+
else {
|
|
753
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
754
|
+
}
|
|
755
|
+
break;
|
|
756
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
757
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
758
|
+
res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
|
|
759
|
+
}
|
|
760
|
+
else {
|
|
761
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
365
762
|
}
|
|
366
763
|
break;
|
|
367
764
|
}
|
|
@@ -374,42 +771,72 @@ var Credit = /** @class */ (function () {
|
|
|
374
771
|
* Fetch customer credits ledger
|
|
375
772
|
*
|
|
376
773
|
* @remarks
|
|
377
|
-
* The credits ledger provides _auditing_ functionality over Orb's credits system with a list of actions that have
|
|
774
|
+
* The credits ledger provides _auditing_ functionality over Orb's credits system with a list of actions that have
|
|
775
|
+
* taken place to modify a customer's credit balance. This [paginated endpoint](../reference/pagination) lists these
|
|
776
|
+
* entries, starting from the most recent ledger entry.
|
|
378
777
|
*
|
|
379
778
|
* More details on using Orb's real-time credit feature are [here](../guides/product-catalog/prepurchase.md).
|
|
380
779
|
*
|
|
381
780
|
* There are four major types of modifications to credit balance, detailed below.
|
|
382
781
|
*
|
|
383
782
|
* ## Increment
|
|
384
|
-
* Credits (which optionally expire on a future date) can be added via the API
|
|
783
|
+
* Credits (which optionally expire on a future date) can be added via the API
|
|
784
|
+
* ([Add Ledger Entry](create-ledger-entry)). The ledger entry for such an action will always contain the total
|
|
785
|
+
* eligible starting and ending balance for the customer at the time the entry was added to the ledger.
|
|
385
786
|
*
|
|
386
787
|
* ## Decrement
|
|
788
|
+
* Deductions can occur as a result of an API call to create a ledger entry (see
|
|
789
|
+
* [Add Ledger Entry](create-ledger-entry)), or automatically as a result of incurring usage. Both ledger entries
|
|
790
|
+
* present the `decrement` entry type.
|
|
387
791
|
*
|
|
388
|
-
*
|
|
792
|
+
* As usage for a customer is reported into Orb, credits may be deducted according to the customer's plan
|
|
793
|
+
* configuration. An automated deduction of this type will result in a ledger entry, also with a starting and ending
|
|
794
|
+
* balance. In order to provide better tracing capabilities for automatic deductions, Orb always associates each
|
|
795
|
+
* automatic deduction with the `event_id` at the time of ingestion, used to pinpoint _why_ credit deduction took
|
|
796
|
+
* place and to ensure that credits are never deducted without an associated usage event.
|
|
389
797
|
*
|
|
390
|
-
*
|
|
798
|
+
* By default, Orb uses an algorithm that automatically deducts from the *soonest expiring credit block* first in
|
|
799
|
+
* order to ensure that all credits are utilized appropriately. As an example, if trial credits with an expiration date
|
|
800
|
+
* of 2 weeks from now are present for a customer, they will be used before any deductions take place from a
|
|
801
|
+
* non-expiring credit block.
|
|
391
802
|
*
|
|
392
|
-
*
|
|
803
|
+
* If there are multiple blocks with the same expiration date, Orb will deduct from the block with the
|
|
804
|
+
* *lower cost basis* first (ex. trial credits with a $0 cost basis before paid credits with a $5.00 cost basis).
|
|
393
805
|
*
|
|
394
|
-
*
|
|
395
|
-
*
|
|
396
|
-
*
|
|
806
|
+
* It's also possible for a single usage event's deduction to _span_ credit blocks. In this case, Orb will deduct from
|
|
807
|
+
* the next block, ending at the credit block which consists of unexpiring credits. Each of these deductions will lead
|
|
808
|
+
* to a _separate_ ledger entry, one per credit block that is deducted from. By default, the customer's total credit
|
|
809
|
+
* balance in Orb can be negative as a result of a decrement.
|
|
397
810
|
*
|
|
398
811
|
* ## Expiration change
|
|
812
|
+
* The expiry of credits can be changed as a result of the API (See [Add Ledger Entry](create-ledger-entry)). This will
|
|
813
|
+
* create a ledger entry that specifies the balance as well as the initial and target expiry dates.
|
|
399
814
|
*
|
|
400
|
-
*
|
|
815
|
+
* Note that for this entry type, `starting_balance` will equal `ending_balance`, and the `amount` represents the
|
|
816
|
+
* balance transferred. The credit block linked to the ledger entry is the source credit block from which there was an
|
|
817
|
+
* expiration change
|
|
401
818
|
*
|
|
402
|
-
*
|
|
819
|
+
* ## Credits expiry
|
|
820
|
+
* When a set of credits expire on pre-set expiration date, the customer's balance automatically reflects this change
|
|
821
|
+
* and adds an entry to the ledger indicating this event. Note that credit expiry should always happen close to a date
|
|
822
|
+
* boundary in the customer's timezone.
|
|
403
823
|
*
|
|
824
|
+
* ## Void initiated
|
|
825
|
+
* Credit blocks can be voided via the API. The `amount` on this entry corresponds to the number of credits that were
|
|
826
|
+
* remaining in the block at time of void. `void_reason` will be populated if the void is created with a reason.
|
|
404
827
|
*
|
|
405
|
-
* ##
|
|
828
|
+
* ## Void
|
|
829
|
+
* When a set of credits is voided, the customer's balance automatically reflects this change and adds an entry to the
|
|
830
|
+
* ledger indicating this event.
|
|
406
831
|
*
|
|
407
|
-
*
|
|
832
|
+
* ## Amendment
|
|
833
|
+
* When credits are added to a customer's balance as a result of a correction, this entry will be added to the ledger
|
|
834
|
+
* to indicate the adjustment of credits.
|
|
408
835
|
*/
|
|
409
836
|
Credit.prototype.fetchLedger = function (req, config) {
|
|
410
837
|
var _a, _b;
|
|
411
838
|
return __awaiter(this, void 0, void 0, function () {
|
|
412
|
-
var baseURL, url, client, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
839
|
+
var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
413
840
|
return __generator(this, function (_c) {
|
|
414
841
|
switch (_c.label) {
|
|
415
842
|
case 0:
|
|
@@ -418,13 +845,24 @@ var Credit = /** @class */ (function () {
|
|
|
418
845
|
}
|
|
419
846
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
420
847
|
url = utils.generateURL(baseURL, "/customers/{customer_id}/credits/ledger", req);
|
|
421
|
-
client = this.sdkConfiguration.
|
|
422
|
-
|
|
848
|
+
client = this.sdkConfiguration.defaultClient;
|
|
849
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
850
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
851
|
+
return [4 /*yield*/, globalSecurity()];
|
|
852
|
+
case 1:
|
|
853
|
+
globalSecurity = _c.sent();
|
|
854
|
+
_c.label = 2;
|
|
855
|
+
case 2:
|
|
856
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
857
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
858
|
+
}
|
|
859
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
860
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
423
861
|
queryParams = utils.serializeQueryParams(req);
|
|
424
862
|
headers["Accept"] = "application/json";
|
|
425
|
-
headers["user-agent"] =
|
|
863
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
426
864
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
427
|
-
case
|
|
865
|
+
case 3:
|
|
428
866
|
httpRes = _c.sent();
|
|
429
867
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
430
868
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
@@ -441,6 +879,65 @@ var Credit = /** @class */ (function () {
|
|
|
441
879
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
442
880
|
res.creditLedgerEntries = utils.objectToClass(JSON.parse(decodedRes), shared.CreditLedgerEntries);
|
|
443
881
|
}
|
|
882
|
+
else {
|
|
883
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
884
|
+
}
|
|
885
|
+
break;
|
|
886
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
|
|
887
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
888
|
+
res.fourHundredError = JSON.parse(decodedRes);
|
|
889
|
+
}
|
|
890
|
+
else {
|
|
891
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
892
|
+
}
|
|
893
|
+
break;
|
|
894
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
895
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
896
|
+
res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
|
|
897
|
+
}
|
|
898
|
+
else {
|
|
899
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
900
|
+
}
|
|
901
|
+
break;
|
|
902
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
|
|
903
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
904
|
+
res.fourHundredAndFourError = JSON.parse(decodedRes);
|
|
905
|
+
}
|
|
906
|
+
else {
|
|
907
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
908
|
+
}
|
|
909
|
+
break;
|
|
910
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
|
|
911
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
912
|
+
res.fourHundredAndNineError = JSON.parse(decodedRes);
|
|
913
|
+
}
|
|
914
|
+
else {
|
|
915
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
916
|
+
}
|
|
917
|
+
break;
|
|
918
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
|
|
919
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
920
|
+
res.fourHundredAndThirteenError = JSON.parse(decodedRes);
|
|
921
|
+
}
|
|
922
|
+
else {
|
|
923
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
924
|
+
}
|
|
925
|
+
break;
|
|
926
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
927
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
928
|
+
res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
|
|
929
|
+
}
|
|
930
|
+
else {
|
|
931
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
932
|
+
}
|
|
933
|
+
break;
|
|
934
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
935
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
936
|
+
res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
|
|
937
|
+
}
|
|
938
|
+
else {
|
|
939
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
940
|
+
}
|
|
444
941
|
break;
|
|
445
942
|
}
|
|
446
943
|
return [2 /*return*/, res];
|
|
@@ -449,15 +946,75 @@ var Credit = /** @class */ (function () {
|
|
|
449
946
|
});
|
|
450
947
|
};
|
|
451
948
|
/**
|
|
452
|
-
* Fetch credits ledger by external ID
|
|
949
|
+
* Fetch customer credits ledger by external ID
|
|
453
950
|
*
|
|
454
951
|
* @remarks
|
|
455
|
-
*
|
|
952
|
+
* The credits ledger provides _auditing_ functionality over Orb's credits system with a list of actions that have
|
|
953
|
+
* taken place to modify a customer's credit balance. This [paginated endpoint](../reference/pagination) lists these
|
|
954
|
+
* entries, starting from the most recent ledger entry.
|
|
955
|
+
*
|
|
956
|
+
* More details on using Orb's real-time credit feature are [here](../guides/product-catalog/prepurchase.md).
|
|
957
|
+
*
|
|
958
|
+
* There are four major types of modifications to credit balance, detailed below.
|
|
959
|
+
*
|
|
960
|
+
* ## Increment
|
|
961
|
+
* Credits (which optionally expire on a future date) can be added via the API
|
|
962
|
+
* ([Add Ledger Entry](create-ledger-entry)). The ledger entry for such an action will always contain the total
|
|
963
|
+
* eligible starting and ending balance for the customer at the time the entry was added to the ledger.
|
|
964
|
+
*
|
|
965
|
+
* ## Decrement
|
|
966
|
+
* Deductions can occur as a result of an API call to create a ledger entry (see
|
|
967
|
+
* [Add Ledger Entry](create-ledger-entry)), or automatically as a result of incurring usage. Both ledger entries
|
|
968
|
+
* present the `decrement` entry type.
|
|
969
|
+
*
|
|
970
|
+
* As usage for a customer is reported into Orb, credits may be deducted according to the customer's plan
|
|
971
|
+
* configuration. An automated deduction of this type will result in a ledger entry, also with a starting and ending
|
|
972
|
+
* balance. In order to provide better tracing capabilities for automatic deductions, Orb always associates each
|
|
973
|
+
* automatic deduction with the `event_id` at the time of ingestion, used to pinpoint _why_ credit deduction took
|
|
974
|
+
* place and to ensure that credits are never deducted without an associated usage event.
|
|
975
|
+
*
|
|
976
|
+
* By default, Orb uses an algorithm that automatically deducts from the *soonest expiring credit block* first in
|
|
977
|
+
* order to ensure that all credits are utilized appropriately. As an example, if trial credits with an expiration date
|
|
978
|
+
* of 2 weeks from now are present for a customer, they will be used before any deductions take place from a
|
|
979
|
+
* non-expiring credit block.
|
|
980
|
+
*
|
|
981
|
+
* If there are multiple blocks with the same expiration date, Orb will deduct from the block with the
|
|
982
|
+
* *lower cost basis* first (ex. trial credits with a $0 cost basis before paid credits with a $5.00 cost basis).
|
|
983
|
+
*
|
|
984
|
+
* It's also possible for a single usage event's deduction to _span_ credit blocks. In this case, Orb will deduct from
|
|
985
|
+
* the next block, ending at the credit block which consists of unexpiring credits. Each of these deductions will lead
|
|
986
|
+
* to a _separate_ ledger entry, one per credit block that is deducted from. By default, the customer's total credit
|
|
987
|
+
* balance in Orb can be negative as a result of a decrement.
|
|
988
|
+
*
|
|
989
|
+
* ## Expiration change
|
|
990
|
+
* The expiry of credits can be changed as a result of the API (See [Add Ledger Entry](create-ledger-entry)). This will
|
|
991
|
+
* create a ledger entry that specifies the balance as well as the initial and target expiry dates.
|
|
992
|
+
*
|
|
993
|
+
* Note that for this entry type, `starting_balance` will equal `ending_balance`, and the `amount` represents the
|
|
994
|
+
* balance transferred. The credit block linked to the ledger entry is the source credit block from which there was an
|
|
995
|
+
* expiration change
|
|
996
|
+
*
|
|
997
|
+
* ## Credits expiry
|
|
998
|
+
* When a set of credits expire on pre-set expiration date, the customer's balance automatically reflects this change
|
|
999
|
+
* and adds an entry to the ledger indicating this event. Note that credit expiry should always happen close to a date
|
|
1000
|
+
* boundary in the customer's timezone.
|
|
1001
|
+
*
|
|
1002
|
+
* ## Void initiated
|
|
1003
|
+
* Credit blocks can be voided via the API. The `amount` on this entry corresponds to the number of credits that were
|
|
1004
|
+
* remaining in the block at time of void. `void_reason` will be populated if the void is created with a reason.
|
|
1005
|
+
*
|
|
1006
|
+
* ## Void
|
|
1007
|
+
* When a set of credits is voided, the customer's balance automatically reflects this change and adds an entry to the
|
|
1008
|
+
* ledger indicating this event.
|
|
1009
|
+
*
|
|
1010
|
+
* ## Amendment
|
|
1011
|
+
* When credits are added to a customer's balance as a result of a correction, this entry will be added to the ledger
|
|
1012
|
+
* to indicate the adjustment of credits.
|
|
456
1013
|
*/
|
|
457
|
-
Credit.prototype.
|
|
1014
|
+
Credit.prototype.fetchLedgerByExternalId = function (req, config) {
|
|
458
1015
|
var _a, _b;
|
|
459
1016
|
return __awaiter(this, void 0, void 0, function () {
|
|
460
|
-
var baseURL, url, client, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
1017
|
+
var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
461
1018
|
return __generator(this, function (_c) {
|
|
462
1019
|
switch (_c.label) {
|
|
463
1020
|
case 0:
|
|
@@ -466,13 +1023,24 @@ var Credit = /** @class */ (function () {
|
|
|
466
1023
|
}
|
|
467
1024
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
468
1025
|
url = utils.generateURL(baseURL, "/customers/external_customer_id/{external_customer_id}/credits/ledger", req);
|
|
469
|
-
client = this.sdkConfiguration.
|
|
470
|
-
|
|
1026
|
+
client = this.sdkConfiguration.defaultClient;
|
|
1027
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
1028
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
1029
|
+
return [4 /*yield*/, globalSecurity()];
|
|
1030
|
+
case 1:
|
|
1031
|
+
globalSecurity = _c.sent();
|
|
1032
|
+
_c.label = 2;
|
|
1033
|
+
case 2:
|
|
1034
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
1035
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
1036
|
+
}
|
|
1037
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
1038
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
471
1039
|
queryParams = utils.serializeQueryParams(req);
|
|
472
1040
|
headers["Accept"] = "application/json";
|
|
473
|
-
headers["user-agent"] =
|
|
1041
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
474
1042
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
475
|
-
case
|
|
1043
|
+
case 3:
|
|
476
1044
|
httpRes = _c.sent();
|
|
477
1045
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
478
1046
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
@@ -489,6 +1057,65 @@ var Credit = /** @class */ (function () {
|
|
|
489
1057
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
490
1058
|
res.creditLedgerEntries = utils.objectToClass(JSON.parse(decodedRes), shared.CreditLedgerEntries);
|
|
491
1059
|
}
|
|
1060
|
+
else {
|
|
1061
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1062
|
+
}
|
|
1063
|
+
break;
|
|
1064
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
|
|
1065
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1066
|
+
res.fourHundredError = JSON.parse(decodedRes);
|
|
1067
|
+
}
|
|
1068
|
+
else {
|
|
1069
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1070
|
+
}
|
|
1071
|
+
break;
|
|
1072
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
1073
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1074
|
+
res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
|
|
1075
|
+
}
|
|
1076
|
+
else {
|
|
1077
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1078
|
+
}
|
|
1079
|
+
break;
|
|
1080
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
|
|
1081
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1082
|
+
res.fourHundredAndFourError = JSON.parse(decodedRes);
|
|
1083
|
+
}
|
|
1084
|
+
else {
|
|
1085
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1086
|
+
}
|
|
1087
|
+
break;
|
|
1088
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
|
|
1089
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1090
|
+
res.fourHundredAndNineError = JSON.parse(decodedRes);
|
|
1091
|
+
}
|
|
1092
|
+
else {
|
|
1093
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1094
|
+
}
|
|
1095
|
+
break;
|
|
1096
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
|
|
1097
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1098
|
+
res.fourHundredAndThirteenError = JSON.parse(decodedRes);
|
|
1099
|
+
}
|
|
1100
|
+
else {
|
|
1101
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1102
|
+
}
|
|
1103
|
+
break;
|
|
1104
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
1105
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1106
|
+
res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
|
|
1107
|
+
}
|
|
1108
|
+
else {
|
|
1109
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1110
|
+
}
|
|
1111
|
+
break;
|
|
1112
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
1113
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1114
|
+
res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
|
|
1115
|
+
}
|
|
1116
|
+
else {
|
|
1117
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1118
|
+
}
|
|
492
1119
|
break;
|
|
493
1120
|
}
|
|
494
1121
|
return [2 /*return*/, res];
|