orb-billing 1.39.0 → 1.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -326,7 +326,7 @@ export interface CostListResponse {
326
326
 
327
327
  export namespace CostListResponse {
328
328
  export interface Data {
329
- per_price_costs: Array<Data.PerPriceCost | Data.PerPriceCostV2>;
329
+ per_price_costs: Array<Data.PerPriceCost>;
330
330
 
331
331
  /**
332
332
  * Total costs for the timeframe, excluding any minimums and discounts.
@@ -590,633 +590,39 @@ export namespace CostListResponse {
590
590
  */
591
591
  total: string;
592
592
 
593
- /**
594
- * If a `group_by` attribute is passed in, array of costs per `grouping_key`,
595
- * `grouping_value` or `secondary_grouping_key`, `secondary_grouping_value`.
596
- */
597
- price_groups?: Array<PerPriceCost.PriceGroup> | null;
598
-
599
- /**
600
- * The price's quantity for the timeframe
601
- */
602
- quantity?: number | null;
603
- }
604
-
605
- export namespace PerPriceCost {
606
- export interface PriceGroup {
607
- /**
608
- * Grouping key to break down a single price's costs
609
- */
610
- grouping_key: string;
611
-
612
- grouping_value: string | null;
613
-
614
- /**
615
- * If the price is a matrix price, this is the second dimension key
616
- */
617
- secondary_grouping_key: string | null;
618
-
619
- secondary_grouping_value: string | null;
620
-
621
- /**
622
- * Total costs for this group for the timeframe. Note that this does not account
623
- * for any minimums or discounts.
624
- */
625
- total: string;
626
- }
627
- }
628
-
629
- export interface PerPriceCostV2 {
630
- /**
631
- * The Price resource represents a price that can be billed on a subscription,
632
- * resulting in a charge on an invoice in the form of an invoice line item. Prices
633
- * take a quantity and determine an amount to bill.
634
- *
635
- * Orb supports a few different pricing models out of the box. Each of these models
636
- * is serialized differently in a given Price object. The model_type field
637
- * determines the key for the configuration object that is present.
638
- *
639
- * ## Unit pricing
640
- *
641
- * With unit pricing, each unit costs a fixed amount.
642
- *
643
- * ```json
644
- * {
645
- * ...
646
- * "model_type": "unit",
647
- * "unit_config": {
648
- * "unit_amount": "0.50"
649
- * }
650
- * ...
651
- * }
652
- * ```
653
- *
654
- * ## Tiered pricing
655
- *
656
- * In tiered pricing, the cost of a given unit depends on the tier range that it
657
- * falls into, where each tier range is defined by an upper and lower bound. For
658
- * example, the first ten units may cost $0.50 each and all units thereafter may
659
- * cost $0.10 each.
660
- *
661
- * ```json
662
- * {
663
- * ...
664
- * "model_type": "tiered",
665
- * "tiered_config": {
666
- * "tiers": [
667
- * {
668
- * "first_unit": 1,
669
- * "last_unit": 10,
670
- * "unit_amount": "0.50"
671
- * },
672
- * {
673
- * "first_unit": 11,
674
- * "last_unit": null,
675
- * "unit_amount": "0.10"
676
- * }
677
- * ]
678
- * }
679
- * ...
680
- * ```
681
- *
682
- * ## Bulk pricing
683
- *
684
- * Bulk pricing applies when the number of units determine the cost of all units.
685
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
686
- * total of $5.00. Once you've bought more than 10 units, all units may now be
687
- * priced at $0.40 (i.e. 101 units total would be $40.40).
688
- *
689
- * ```json
690
- * {
691
- * ...
692
- * "model_type": "bulk",
693
- * "bulk_config": {
694
- * "tiers": [
695
- * {
696
- * "maximum_units": 10,
697
- * "unit_amount": "0.50"
698
- * },
699
- * {
700
- * "maximum_units": 1000,
701
- * "unit_amount": "0.40"
702
- * }
703
- * ]
704
- * }
705
- * ...
706
- * }
707
- * ```
708
- *
709
- * ## Package pricing
710
- *
711
- * Package pricing defines the size or granularity of a unit for billing purposes.
712
- * For example, if the package size is set to 5, then 4 units will be billed as 5
713
- * and 6 units will be billed at 10.
714
- *
715
- * ```json
716
- * {
717
- * ...
718
- * "model_type": "package",
719
- * "package_config": {
720
- * "package_amount": "0.80",
721
- * "package_size": 10
722
- * }
723
- * ...
724
- * }
725
- * ```
726
- *
727
- * ## BPS pricing
728
- *
729
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
730
- * percent (the number of basis points to charge), as well as a cap per event to
731
- * assess. For example, this would allow you to assess a fee of 0.25% on every
732
- * payment you process, with a maximum charge of $25 per payment.
733
- *
734
- * ```json
735
- * {
736
- * ...
737
- * "model_type": "bps",
738
- * "bps_config": {
739
- * "bps": 125,
740
- * "per_unit_maximum": "11.00"
741
- * }
742
- * ...
743
- * }
744
- * ```
745
- *
746
- * ## Bulk BPS pricing
747
- *
748
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
749
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
750
- * a given event depends on the tier range that the billing period falls into. Each
751
- * tier range is defined by an upper bound. For example, after $1.5M of payment
752
- * volume is reached, each individual payment may have a lower cap or a smaller
753
- * take-rate.
754
- *
755
- * ```json
756
- * ...
757
- * "model_type": "bulk_bps",
758
- * "bulk_bps_config": {
759
- * "tiers": [
760
- * {
761
- * "maximum_amount": "1000000.00",
762
- * "bps": 125,
763
- * "per_unit_maximum": "19.00"
764
- * },
765
- * {
766
- * "maximum_amount": null,
767
- * "bps": 115,
768
- * "per_unit_maximum": "4.00"
769
- * }
770
- * ]
771
- * }
772
- * ...
773
- * }
774
- * ```
775
- *
776
- * ## Tiered BPS pricing
777
- *
778
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
779
- * event's applicable parameter is a function of its marginal addition to the
780
- * period total. Similar to tiered pricing, the BPS parameters of a given event
781
- * depends on the tier range that it falls into, where each tier range is defined
782
- * by an upper and lower bound. For example, the first few payments may have a 0.8
783
- * BPS take-rate and all payments after a specific volume may incur a take-rate of
784
- * 0.5 BPS each.
785
- *
786
- * ```json
787
- * ...
788
- * "model_type": "tiered_bps",
789
- * "tiered_bps_config": {
790
- * "tiers": [
791
- * {
792
- * "minimum_amount": "0",
793
- * "maximum_amount": "1000000.00",
794
- * "bps": 125,
795
- * "per_unit_maximum": "19.00"
796
- * },
797
- * {
798
- * "minimum_amount": "1000000.00",
799
- * "maximum_amount": null,
800
- * "bps": 115,
801
- * "per_unit_maximum": "4.00"
802
- * }
803
- * ]
804
- * }
805
- * ...
806
- * }
807
- * ```
808
- *
809
- * ## Matrix pricing
810
- *
811
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
812
- * `dimensions` defines the two event property values evaluated in this pricing
813
- * model. In a one-dimensional matrix, the second value is `null`. Every
814
- * configuration has a list of `matrix_values` which give the unit prices for
815
- * specified property values. In a one-dimensional matrix, the matrix values will
816
- * have `dimension_values` where the second value of the pair is null. If an event
817
- * does not match any of the dimension values in the matrix, it will resort to the
818
- * `default_unit_amount`.
819
- *
820
- * ```json
821
- * {
822
- * "model_type": "matrix"
823
- * "matrix_config": {
824
- * "default_unit_amount": "3.00",
825
- * "dimensions": [
826
- * "cluster_name",
827
- * "region"
828
- * ],
829
- * "matrix_values": [
830
- * {
831
- * "dimension_values": [
832
- * "alpha",
833
- * "west"
834
- * ],
835
- * "unit_amount": "2.00"
836
- * },
837
- * ...
838
- * ]
839
- * }
840
- * }
841
- * ```
842
- *
843
- * ### Fixed fees
844
- *
845
- * Fixed fees are prices that are applied independent of usage quantities, and
846
- * follow unit pricing. They also have an additional parameter
847
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents
848
- * the quantity of units applied.
849
- *
850
- * ```json
851
- * {
852
- * ...
853
- * "id": "price_id",
854
- * "model_type": "unit",
855
- * "unit_config": {
856
- * "unit_amount": "2.00"
857
- * },
858
- * "fixed_price_quantity": 3.0
859
- * ...
860
- * }
861
- * ```
862
- */
863
- price: PricesAPI.Price;
864
-
865
- /**
866
- * Price's contributions for the timeframe, excluding any minimums and discounts.
867
- */
868
- subtotal: string;
869
-
870
- /**
871
- * Price's contributions for the timeframe, including minimums and discounts.
872
- */
873
- total: string;
874
-
875
- /**
876
- * If a `group_by` attribute is passed in, array of costs per `grouping_key`,
877
- * `grouping_value` or `secondary_grouping_key`, `secondary_grouping_value`.
878
- */
879
- price_groups?: Array<PerPriceCostV2.PriceGroup> | null;
880
-
881
- /**
882
- * The price's quantity for the timeframe
883
- */
884
- quantity?: number | null;
885
- }
886
-
887
- export namespace PerPriceCostV2 {
888
- export interface PriceGroup {
889
- /**
890
- * Grouping key to break down a single price's costs
891
- */
892
- grouping_key: string;
893
-
894
- grouping_value: string | null;
895
-
896
- /**
897
- * If the price is a matrix price, this is the second dimension key
898
- */
899
- secondary_grouping_key: string | null;
900
-
901
- secondary_grouping_value: string | null;
902
-
903
- /**
904
- * Total costs for this group for the timeframe. Note that this does not account
905
- * for any minimums or discounts.
906
- */
907
- total: string;
908
- }
909
- }
910
- }
911
- }
912
-
913
- export interface CostListByExternalIDResponse {
914
- data: Array<CostListByExternalIDResponse.Data>;
915
- }
916
-
917
- export namespace CostListByExternalIDResponse {
918
- export interface Data {
919
- per_price_costs: Array<Data.PerPriceCost | Data.PerPriceCostV2>;
920
-
921
- /**
922
- * Total costs for the timeframe, excluding any minimums and discounts.
923
- */
924
- subtotal: string;
925
-
926
- timeframe_end: string;
927
-
928
- timeframe_start: string;
929
-
930
- /**
931
- * Total costs for the timeframe, including any minimums and discounts.
932
- */
933
- total: string;
934
- }
935
-
936
- export namespace Data {
937
- export interface PerPriceCost {
938
- /**
939
- * The Price resource represents a price that can be billed on a subscription,
940
- * resulting in a charge on an invoice in the form of an invoice line item. Prices
941
- * take a quantity and determine an amount to bill.
942
- *
943
- * Orb supports a few different pricing models out of the box. Each of these models
944
- * is serialized differently in a given Price object. The model_type field
945
- * determines the key for the configuration object that is present.
946
- *
947
- * ## Unit pricing
948
- *
949
- * With unit pricing, each unit costs a fixed amount.
950
- *
951
- * ```json
952
- * {
953
- * ...
954
- * "model_type": "unit",
955
- * "unit_config": {
956
- * "unit_amount": "0.50"
957
- * }
958
- * ...
959
- * }
960
- * ```
961
- *
962
- * ## Tiered pricing
963
- *
964
- * In tiered pricing, the cost of a given unit depends on the tier range that it
965
- * falls into, where each tier range is defined by an upper and lower bound. For
966
- * example, the first ten units may cost $0.50 each and all units thereafter may
967
- * cost $0.10 each.
968
- *
969
- * ```json
970
- * {
971
- * ...
972
- * "model_type": "tiered",
973
- * "tiered_config": {
974
- * "tiers": [
975
- * {
976
- * "first_unit": 1,
977
- * "last_unit": 10,
978
- * "unit_amount": "0.50"
979
- * },
980
- * {
981
- * "first_unit": 11,
982
- * "last_unit": null,
983
- * "unit_amount": "0.10"
984
- * }
985
- * ]
986
- * }
987
- * ...
988
- * ```
989
- *
990
- * ## Bulk pricing
991
- *
992
- * Bulk pricing applies when the number of units determine the cost of all units.
993
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
994
- * total of $5.00. Once you've bought more than 10 units, all units may now be
995
- * priced at $0.40 (i.e. 101 units total would be $40.40).
996
- *
997
- * ```json
998
- * {
999
- * ...
1000
- * "model_type": "bulk",
1001
- * "bulk_config": {
1002
- * "tiers": [
1003
- * {
1004
- * "maximum_units": 10,
1005
- * "unit_amount": "0.50"
1006
- * },
1007
- * {
1008
- * "maximum_units": 1000,
1009
- * "unit_amount": "0.40"
1010
- * }
1011
- * ]
1012
- * }
1013
- * ...
1014
- * }
1015
- * ```
1016
- *
1017
- * ## Package pricing
1018
- *
1019
- * Package pricing defines the size or granularity of a unit for billing purposes.
1020
- * For example, if the package size is set to 5, then 4 units will be billed as 5
1021
- * and 6 units will be billed at 10.
1022
- *
1023
- * ```json
1024
- * {
1025
- * ...
1026
- * "model_type": "package",
1027
- * "package_config": {
1028
- * "package_amount": "0.80",
1029
- * "package_size": 10
1030
- * }
1031
- * ...
1032
- * }
1033
- * ```
1034
- *
1035
- * ## BPS pricing
1036
- *
1037
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
1038
- * percent (the number of basis points to charge), as well as a cap per event to
1039
- * assess. For example, this would allow you to assess a fee of 0.25% on every
1040
- * payment you process, with a maximum charge of $25 per payment.
1041
- *
1042
- * ```json
1043
- * {
1044
- * ...
1045
- * "model_type": "bps",
1046
- * "bps_config": {
1047
- * "bps": 125,
1048
- * "per_unit_maximum": "11.00"
1049
- * }
1050
- * ...
1051
- * }
1052
- * ```
1053
- *
1054
- * ## Bulk BPS pricing
1055
- *
1056
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
1057
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
1058
- * a given event depends on the tier range that the billing period falls into. Each
1059
- * tier range is defined by an upper bound. For example, after $1.5M of payment
1060
- * volume is reached, each individual payment may have a lower cap or a smaller
1061
- * take-rate.
1062
- *
1063
- * ```json
1064
- * ...
1065
- * "model_type": "bulk_bps",
1066
- * "bulk_bps_config": {
1067
- * "tiers": [
1068
- * {
1069
- * "maximum_amount": "1000000.00",
1070
- * "bps": 125,
1071
- * "per_unit_maximum": "19.00"
1072
- * },
1073
- * {
1074
- * "maximum_amount": null,
1075
- * "bps": 115,
1076
- * "per_unit_maximum": "4.00"
1077
- * }
1078
- * ]
1079
- * }
1080
- * ...
1081
- * }
1082
- * ```
1083
- *
1084
- * ## Tiered BPS pricing
1085
- *
1086
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
1087
- * event's applicable parameter is a function of its marginal addition to the
1088
- * period total. Similar to tiered pricing, the BPS parameters of a given event
1089
- * depends on the tier range that it falls into, where each tier range is defined
1090
- * by an upper and lower bound. For example, the first few payments may have a 0.8
1091
- * BPS take-rate and all payments after a specific volume may incur a take-rate of
1092
- * 0.5 BPS each.
1093
- *
1094
- * ```json
1095
- * ...
1096
- * "model_type": "tiered_bps",
1097
- * "tiered_bps_config": {
1098
- * "tiers": [
1099
- * {
1100
- * "minimum_amount": "0",
1101
- * "maximum_amount": "1000000.00",
1102
- * "bps": 125,
1103
- * "per_unit_maximum": "19.00"
1104
- * },
1105
- * {
1106
- * "minimum_amount": "1000000.00",
1107
- * "maximum_amount": null,
1108
- * "bps": 115,
1109
- * "per_unit_maximum": "4.00"
1110
- * }
1111
- * ]
1112
- * }
1113
- * ...
1114
- * }
1115
- * ```
1116
- *
1117
- * ## Matrix pricing
1118
- *
1119
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
1120
- * `dimensions` defines the two event property values evaluated in this pricing
1121
- * model. In a one-dimensional matrix, the second value is `null`. Every
1122
- * configuration has a list of `matrix_values` which give the unit prices for
1123
- * specified property values. In a one-dimensional matrix, the matrix values will
1124
- * have `dimension_values` where the second value of the pair is null. If an event
1125
- * does not match any of the dimension values in the matrix, it will resort to the
1126
- * `default_unit_amount`.
1127
- *
1128
- * ```json
1129
- * {
1130
- * "model_type": "matrix"
1131
- * "matrix_config": {
1132
- * "default_unit_amount": "3.00",
1133
- * "dimensions": [
1134
- * "cluster_name",
1135
- * "region"
1136
- * ],
1137
- * "matrix_values": [
1138
- * {
1139
- * "dimension_values": [
1140
- * "alpha",
1141
- * "west"
1142
- * ],
1143
- * "unit_amount": "2.00"
1144
- * },
1145
- * ...
1146
- * ]
1147
- * }
1148
- * }
1149
- * ```
1150
- *
1151
- * ### Fixed fees
1152
- *
1153
- * Fixed fees are prices that are applied independent of usage quantities, and
1154
- * follow unit pricing. They also have an additional parameter
1155
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents
1156
- * the quantity of units applied.
1157
- *
1158
- * ```json
1159
- * {
1160
- * ...
1161
- * "id": "price_id",
1162
- * "model_type": "unit",
1163
- * "unit_config": {
1164
- * "unit_amount": "2.00"
1165
- * },
1166
- * "fixed_price_quantity": 3.0
1167
- * ...
1168
- * }
1169
- * ```
1170
- */
1171
- price: PricesAPI.Price;
1172
-
1173
- /**
1174
- * Price's contributions for the timeframe, excluding any minimums and discounts.
1175
- */
1176
- subtotal: string;
1177
-
1178
- /**
1179
- * Price's contributions for the timeframe, including minimums and discounts.
1180
- */
1181
- total: string;
1182
-
1183
- /**
1184
- * If a `group_by` attribute is passed in, array of costs per `grouping_key`,
1185
- * `grouping_value` or `secondary_grouping_key`, `secondary_grouping_value`.
1186
- */
1187
- price_groups?: Array<PerPriceCost.PriceGroup> | null;
1188
-
1189
593
  /**
1190
594
  * The price's quantity for the timeframe
1191
595
  */
1192
596
  quantity?: number | null;
1193
597
  }
598
+ }
599
+ }
600
+
601
+ export interface CostListByExternalIDResponse {
602
+ data: Array<CostListByExternalIDResponse.Data>;
603
+ }
1194
604
 
1195
- export namespace PerPriceCost {
1196
- export interface PriceGroup {
1197
- /**
1198
- * Grouping key to break down a single price's costs
1199
- */
1200
- grouping_key: string;
605
+ export namespace CostListByExternalIDResponse {
606
+ export interface Data {
607
+ per_price_costs: Array<Data.PerPriceCost>;
1201
608
 
1202
- grouping_value: string | null;
609
+ /**
610
+ * Total costs for the timeframe, excluding any minimums and discounts.
611
+ */
612
+ subtotal: string;
1203
613
 
1204
- /**
1205
- * If the price is a matrix price, this is the second dimension key
1206
- */
1207
- secondary_grouping_key: string | null;
614
+ timeframe_end: string;
1208
615
 
1209
- secondary_grouping_value: string | null;
616
+ timeframe_start: string;
1210
617
 
1211
- /**
1212
- * Total costs for this group for the timeframe. Note that this does not account
1213
- * for any minimums or discounts.
1214
- */
1215
- total: string;
1216
- }
1217
- }
618
+ /**
619
+ * Total costs for the timeframe, including any minimums and discounts.
620
+ */
621
+ total: string;
622
+ }
1218
623
 
1219
- export interface PerPriceCostV2 {
624
+ export namespace Data {
625
+ export interface PerPriceCost {
1220
626
  /**
1221
627
  * The Price resource represents a price that can be billed on a subscription,
1222
628
  * resulting in a charge on an invoice in the form of an invoice line item. Prices
@@ -1462,41 +868,11 @@ export namespace CostListByExternalIDResponse {
1462
868
  */
1463
869
  total: string;
1464
870
 
1465
- /**
1466
- * If a `group_by` attribute is passed in, array of costs per `grouping_key`,
1467
- * `grouping_value` or `secondary_grouping_key`, `secondary_grouping_value`.
1468
- */
1469
- price_groups?: Array<PerPriceCostV2.PriceGroup> | null;
1470
-
1471
871
  /**
1472
872
  * The price's quantity for the timeframe
1473
873
  */
1474
874
  quantity?: number | null;
1475
875
  }
1476
-
1477
- export namespace PerPriceCostV2 {
1478
- export interface PriceGroup {
1479
- /**
1480
- * Grouping key to break down a single price's costs
1481
- */
1482
- grouping_key: string;
1483
-
1484
- grouping_value: string | null;
1485
-
1486
- /**
1487
- * If the price is a matrix price, this is the second dimension key
1488
- */
1489
- secondary_grouping_key: string | null;
1490
-
1491
- secondary_grouping_value: string | null;
1492
-
1493
- /**
1494
- * Total costs for this group for the timeframe. Note that this does not account
1495
- * for any minimums or discounts.
1496
- */
1497
- total: string;
1498
- }
1499
- }
1500
876
  }
1501
877
  }
1502
878