@shoplygg/node 0.8.0 → 0.10.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.
@@ -293,6 +293,7 @@ export type StoreEmailSettingsResult = {
293
293
  emailPayoutsEnabled: boolean;
294
294
  emailCustomPaidEnabled: boolean;
295
295
  emailTicketsEnabled: boolean;
296
+ emailResellersEnabled: boolean;
296
297
  emailDisputeOpenedEnabled: boolean;
297
298
  emailDisputeClosedEnabled: boolean;
298
299
  testEmailEvery: {
@@ -308,6 +309,7 @@ export type StoreEmailSettingsResult = {
308
309
  discordPayoutsEnabled: boolean;
309
310
  discordCustomPaidEnabled: boolean;
310
311
  discordTicketsEnabled: boolean;
312
+ discordResellersEnabled: boolean;
311
313
  discordDisputesEnabled: boolean;
312
314
  discordStockThreshold: number;
313
315
  discordFailure: unknown;
@@ -950,7 +952,7 @@ export interface AnalyticsSearchParams {
950
952
  export type AnalyticsSearchResult = unknown;
951
953
 
952
954
  /** What list storefronts answers: `storefronts.list`. */
953
- export type StorefrontsListResult = {
955
+ export type StorefrontsListResult = Array<{
954
956
  id: string;
955
957
  name: string;
956
958
  theme: string;
@@ -964,11 +966,12 @@ export type StorefrontsListResult = {
964
966
  engine: string;
965
967
  codeOnCopy: unknown;
966
968
  themeChanged: unknown;
969
+ pictures: unknown[] | Record<string, unknown>;
967
970
  unpublished: boolean;
968
971
  accent: unknown;
969
972
  headingFont: unknown;
970
973
  pages: number;
971
- }[];
974
+ }>;
972
975
 
973
976
  /** What create a storefront takes: `storefronts.create`. */
974
977
  export interface StorefrontsCreateParams {
@@ -985,7 +988,7 @@ export interface StorefrontsCreateParams {
985
988
  }
986
989
 
987
990
  /** What create a storefront answers: `storefronts.create`. */
988
- export type StorefrontsCreateResult = {
991
+ export type StorefrontsCreateResult = Array<{
989
992
  id: string;
990
993
  name: string;
991
994
  theme: string;
@@ -999,11 +1002,12 @@ export type StorefrontsCreateResult = {
999
1002
  engine: string;
1000
1003
  codeOnCopy: unknown;
1001
1004
  themeChanged: unknown;
1005
+ pictures: unknown[] | Record<string, unknown>;
1002
1006
  unpublished: boolean;
1003
1007
  accent: unknown;
1004
1008
  headingFont: unknown;
1005
1009
  pages: number;
1006
- }[];
1010
+ }>;
1007
1011
 
1008
1012
  /** What import a storefront answers: `storefronts.import`. */
1009
1013
  export type StorefrontsImportResult = unknown;
@@ -1121,7 +1125,7 @@ export interface StorefrontsRenameParams {
1121
1125
  }
1122
1126
 
1123
1127
  /** What rename a storefront answers: `storefronts.rename`. */
1124
- export type StorefrontsRenameResult = {
1128
+ export type StorefrontsRenameResult = Array<{
1125
1129
  id: string;
1126
1130
  name: string;
1127
1131
  theme: string;
@@ -1135,14 +1139,15 @@ export type StorefrontsRenameResult = {
1135
1139
  engine: string;
1136
1140
  codeOnCopy: unknown;
1137
1141
  themeChanged: unknown;
1142
+ pictures: unknown[] | Record<string, unknown>;
1138
1143
  unpublished: boolean;
1139
1144
  accent: unknown;
1140
1145
  headingFont: unknown;
1141
1146
  pages: number;
1142
- }[];
1147
+ }>;
1143
1148
 
1144
1149
  /** What delete a storefront answers: `storefronts.delete`. */
1145
- export type StorefrontsDeleteResult = {
1150
+ export type StorefrontsDeleteResult = Array<{
1146
1151
  id: string;
1147
1152
  name: string;
1148
1153
  theme: string;
@@ -1156,11 +1161,12 @@ export type StorefrontsDeleteResult = {
1156
1161
  engine: string;
1157
1162
  codeOnCopy: unknown;
1158
1163
  themeChanged: unknown;
1164
+ pictures: unknown[] | Record<string, unknown>;
1159
1165
  unpublished: boolean;
1160
1166
  accent: unknown;
1161
1167
  headingFont: unknown;
1162
1168
  pages: number;
1163
- }[];
1169
+ }>;
1164
1170
 
1165
1171
  /** What make a storefront live takes: `storefronts.setLive`. */
1166
1172
  export interface StorefrontsSetLiveParams {
@@ -1173,7 +1179,7 @@ export interface StorefrontsSetLiveParams {
1173
1179
  }
1174
1180
 
1175
1181
  /** What make a storefront live answers: `storefronts.setLive`. */
1176
- export type StorefrontsSetLiveResult = {
1182
+ export type StorefrontsSetLiveResult = Array<{
1177
1183
  id: string;
1178
1184
  name: string;
1179
1185
  theme: string;
@@ -1187,11 +1193,12 @@ export type StorefrontsSetLiveResult = {
1187
1193
  engine: string;
1188
1194
  codeOnCopy: unknown;
1189
1195
  themeChanged: unknown;
1196
+ pictures: unknown[] | Record<string, unknown>;
1190
1197
  unpublished: boolean;
1191
1198
  accent: unknown;
1192
1199
  headingFont: unknown;
1193
1200
  pages: number;
1194
- }[];
1201
+ }>;
1195
1202
 
1196
1203
  /** What get a storefront's code answers: `storefronts.code`. */
1197
1204
  export type StorefrontsCodeResult = {
@@ -1209,6 +1216,7 @@ export type StorefrontsCodeResult = {
1209
1216
  engine: string;
1210
1217
  codeOnCopy: unknown;
1211
1218
  themeChanged: unknown;
1219
+ pictures: unknown[] | Record<string, unknown>;
1212
1220
  unpublished: boolean;
1213
1221
  accent: unknown;
1214
1222
  headingFont: unknown;
@@ -1239,6 +1247,7 @@ export type StorefrontsCodeStartResult = {
1239
1247
  engine: string;
1240
1248
  codeOnCopy: unknown;
1241
1249
  themeChanged: unknown;
1250
+ pictures: unknown[] | Record<string, unknown>;
1242
1251
  unpublished: boolean;
1243
1252
  accent: unknown;
1244
1253
  headingFont: unknown;
@@ -1477,6 +1486,7 @@ export type StorefrontsCodePublishResult = {
1477
1486
  engine: string;
1478
1487
  codeOnCopy: unknown;
1479
1488
  themeChanged: unknown;
1489
+ pictures: unknown[] | Record<string, unknown>;
1480
1490
  unpublished: boolean;
1481
1491
  accent: unknown;
1482
1492
  headingFont: unknown;
@@ -7563,15 +7573,800 @@ export type TeamMoveMemberResult = {
7563
7573
  avatarUrl: unknown;
7564
7574
  invitedBy: string;
7565
7575
  joinedAt: string;
7566
- lastSeenAt: unknown;
7567
- keys: number;
7568
- me: boolean;
7569
- };
7570
-
7571
- /** What remove somebody from the team answers: `team.removeMember`. */
7572
- export type TeamRemoveMemberResult = {
7573
- deleted: string;
7574
- keysStopped: number;
7576
+ lastSeenAt: unknown;
7577
+ keys: number;
7578
+ me: boolean;
7579
+ };
7580
+
7581
+ /** What remove somebody from the team answers: `team.removeMember`. */
7582
+ export type TeamRemoveMemberResult = {
7583
+ deleted: string;
7584
+ keysStopped: number;
7585
+ };
7586
+
7587
+ /** What get the reseller overview answers: `resellers.overview`. */
7588
+ export type ResellersOverviewResult = {
7589
+ panel: {
7590
+ enabled: boolean;
7591
+ currency: string;
7592
+ minTopup: number;
7593
+ };
7594
+ address: string;
7595
+ figures: {
7596
+ resellers: number;
7597
+ paused: number;
7598
+ sales30: number;
7599
+ orders30: number;
7600
+ topups30: number;
7601
+ topupCount30: number;
7602
+ balanceHeld: number;
7603
+ };
7604
+ waiting: {
7605
+ kind: string;
7606
+ line: string;
7607
+ hint: string;
7608
+ productId: string;
7609
+ }[];
7610
+ top: {
7611
+ id: string;
7612
+ name: string;
7613
+ website: string;
7614
+ email: string;
7615
+ tierId: string;
7616
+ tierName: string;
7617
+ tierDiscount: number;
7618
+ discount: unknown;
7619
+ paysOff: number;
7620
+ balance: number;
7621
+ status: string;
7622
+ members: number;
7623
+ spent30: number;
7624
+ lastOrderAt: string;
7625
+ joinedAt: string;
7626
+ removedAt: unknown;
7627
+ }[];
7628
+ };
7629
+
7630
+ /** What get the panel's settings answers: `resellers.settings`. */
7631
+ export type ResellersSettingsResult = {
7632
+ enabled: boolean;
7633
+ currency: string;
7634
+ minTopup: number;
7635
+ };
7636
+
7637
+ /** What update the panel's settings takes: `resellers.updateSettings`. */
7638
+ export interface ResellersUpdateSettingsParams {
7639
+ /** Whether the panel is on. */
7640
+ enabled?: boolean;
7641
+ /** The currency its prices and balances are in, as a three-letter code. */
7642
+ currency?: string;
7643
+ /** The smallest top-up a reseller can make, 5.00 to 100,000.00. */
7644
+ minTopup?: number;
7645
+ }
7646
+
7647
+ /** What update the panel's settings answers: `resellers.updateSettings`. */
7648
+ export type ResellersUpdateSettingsResult = {
7649
+ enabled: boolean;
7650
+ currency: string;
7651
+ minTopup: number;
7652
+ };
7653
+
7654
+ /** What get the panel's domain answers: `resellers.domain`. */
7655
+ export type ResellersDomainResult = {
7656
+ domain: unknown;
7657
+ cnameTarget: string;
7658
+ available: boolean;
7659
+ };
7660
+
7661
+ /** What connect a domain to the panel takes: `resellers.connectDomain`. */
7662
+ export interface ResellersConnectDomainParams {
7663
+ /** The domain, with no `https://` in front. */
7664
+ hostname: string;
7665
+ }
7666
+
7667
+ /** What connect a domain to the panel answers: `resellers.connectDomain`. */
7668
+ export type ResellersConnectDomainResult = unknown;
7669
+
7670
+ /** What remove the panel's domain answers: `resellers.removeDomain`. */
7671
+ export type ResellersRemoveDomainResult = unknown;
7672
+
7673
+ /** What list what the panel sells answers: `resellerProducts.list`. */
7674
+ export type ResellerProductsListResult = {
7675
+ variantId: string;
7676
+ productId: string;
7677
+ productName: string;
7678
+ variantName: string;
7679
+ image: unknown;
7680
+ delivery: string;
7681
+ stock: number;
7682
+ price: number;
7683
+ minQty: number;
7684
+ dailyCap: number;
7685
+ maxDiscount: unknown;
7686
+ enabled: boolean;
7687
+ }[];
7688
+
7689
+ /** What sell products on the panel takes: `resellerProducts.save`. */
7690
+ export interface ResellerProductsSaveParams {
7691
+ /** One a product option: `variantId`; `price`, its Reseller Price, above 0 and up to 1,000,000; `minQty`, the fewest bought at once, 1 to 1,000 (1 when left out); `dailyCap`, the most one reseller may buy of it in a day, or null for no cap; `maxDiscount`, the most off it in percent, or null for no limit (left out, as it was); `enabled`, whether it is on sale (true when left out). */
7692
+ rows: Record<string, unknown>[];
7693
+ }
7694
+
7695
+ /** What sell products on the panel answers: `resellerProducts.save`. */
7696
+ export type ResellerProductsSaveResult = {
7697
+ variantId: string;
7698
+ productId: string;
7699
+ productName: string;
7700
+ variantName: string;
7701
+ image: unknown;
7702
+ delivery: string;
7703
+ stock: number;
7704
+ price: number;
7705
+ minQty: number;
7706
+ dailyCap: number;
7707
+ maxDiscount: unknown;
7708
+ enabled: boolean;
7709
+ }[];
7710
+
7711
+ /** What list what the panel can sell answers: `resellerProducts.pickable`. */
7712
+ export type ResellerProductsPickableResult = {
7713
+ variantId: string;
7714
+ productId: string;
7715
+ productName: string;
7716
+ variantName: string;
7717
+ image: unknown;
7718
+ delivery: string;
7719
+ inPanel: boolean;
7720
+ price: number;
7721
+ }[];
7722
+
7723
+ /** What stop selling an option on the panel answers: `resellerProducts.remove`. */
7724
+ export type ResellerProductsRemoveResult = unknown[] | Record<string, unknown>;
7725
+
7726
+ /** What set a product's status and labels on the panel takes: `resellerProducts.badges`. */
7727
+ export interface ResellerProductsBadgesParams {
7728
+ /** Up to 3, each `{ label, color, kind }`: `label` 1 to 32 characters; `color` one of `blue`, `green`, `amber`, `red`, `purple` and `gray`, a `#rrggbb` colour, or empty for the plain look; `kind` `label`, or `status` for one at most. */
7729
+ badges: Record<string, unknown>[];
7730
+ }
7731
+
7732
+ /** What set a product's status and labels on the panel answers: `resellerProducts.badges`. */
7733
+ export type ResellerProductsBadgesResult = {
7734
+ "7626c760-c6cd-4b38-8344-cfbba0148a80": {
7735
+ label: string;
7736
+ color: string;
7737
+ kind: string;
7738
+ }[];
7739
+ };
7740
+
7741
+ /** What list tiers answers: `resellerTiers.list`. */
7742
+ export type ResellerTiersListResult = {
7743
+ id: string;
7744
+ name: string;
7745
+ discount: number;
7746
+ resellers: number;
7747
+ spent30: number;
7748
+ }[];
7749
+
7750
+ /** What create a tier takes: `resellerTiers.create`. */
7751
+ export interface ResellerTiersCreateParams {
7752
+ /** What the tier is called, up to 40 characters. */
7753
+ name: string;
7754
+ /** What it takes off every Reseller Price, in percent: 0.01 to 99.99. */
7755
+ discount: number;
7756
+ }
7757
+
7758
+ /** What create a tier answers: `resellerTiers.create`. */
7759
+ export type ResellerTiersCreateResult = {
7760
+ id: string;
7761
+ name: string;
7762
+ discount: number;
7763
+ resellers: number;
7764
+ spent30: number;
7765
+ };
7766
+
7767
+ /** What update a tier takes: `resellerTiers.update`. */
7768
+ export interface ResellerTiersUpdateParams {
7769
+ /** What the tier is called, up to 40 characters. */
7770
+ name: string;
7771
+ /** What it takes off every Reseller Price, in percent: 0.01 to 99.99. */
7772
+ discount: number;
7773
+ }
7774
+
7775
+ /** What update a tier answers: `resellerTiers.update`. */
7776
+ export type ResellerTiersUpdateResult = {
7777
+ id: string;
7778
+ name: string;
7779
+ discount: number;
7780
+ resellers: number;
7781
+ spent30: number;
7782
+ };
7783
+
7784
+ /** What delete a tier answers: `resellerTiers.delete`. */
7785
+ export type ResellerTiersDeleteResult = unknown[] | Record<string, unknown>;
7786
+
7787
+ /** What list invite links answers: `resellerInvites.list`. */
7788
+ export type ResellerInvitesListResult = {
7789
+ id: string;
7790
+ name: string;
7791
+ code: string;
7792
+ tierId: string;
7793
+ tierName: string;
7794
+ maxUses: number;
7795
+ uses: number;
7796
+ endsAt: string;
7797
+ enabled: boolean;
7798
+ live: boolean;
7799
+ }[];
7800
+
7801
+ /** What create an invite link takes: `resellerInvites.create`. */
7802
+ export interface ResellerInvitesCreateParams {
7803
+ /** What the link is called on the dashboard, up to 60 characters. Resellers never see it. Needed to make one. */
7804
+ name?: string;
7805
+ /** The tier whoever joins through it starts in. Empty or left out, none: they pay the Reseller Price. */
7806
+ tierId?: string;
7807
+ /** How many may join through it, 1 to 100,000. Empty or left out, no limit. */
7808
+ maxUses?: number;
7809
+ /** When it stops working, as a date and time. Empty or left out, never. */
7810
+ endsAt?: string;
7811
+ /**
7812
+ * Whether it works.
7813
+ *
7814
+ * Left out, it is true.
7815
+ */
7816
+ enabled?: boolean;
7817
+ }
7818
+
7819
+ /** What create an invite link answers: `resellerInvites.create`. */
7820
+ export type ResellerInvitesCreateResult = {
7821
+ id: string;
7822
+ name: string;
7823
+ code: string;
7824
+ tierId: string;
7825
+ tierName: string;
7826
+ maxUses: number;
7827
+ uses: number;
7828
+ endsAt: unknown;
7829
+ enabled: boolean;
7830
+ live: boolean;
7831
+ };
7832
+
7833
+ /** What update an invite link takes: `resellerInvites.update`. */
7834
+ export interface ResellerInvitesUpdateParams {
7835
+ /** What the link is called on the dashboard, up to 60 characters. Resellers never see it. Needed to make one. */
7836
+ name?: string;
7837
+ /** The tier whoever joins through it starts in. Empty or left out, none: they pay the Reseller Price. */
7838
+ tierId?: string;
7839
+ /** How many may join through it, 1 to 100,000. Empty or left out, no limit. */
7840
+ maxUses?: number;
7841
+ /** When it stops working, as a date and time. Empty or left out, never. */
7842
+ endsAt?: string;
7843
+ /**
7844
+ * Whether it works.
7845
+ *
7846
+ * Left out, it is true.
7847
+ */
7848
+ enabled?: boolean;
7849
+ }
7850
+
7851
+ /** What update an invite link answers: `resellerInvites.update`. */
7852
+ export type ResellerInvitesUpdateResult = {
7853
+ id: string;
7854
+ name: string;
7855
+ code: string;
7856
+ tierId: string;
7857
+ tierName: string;
7858
+ maxUses: number;
7859
+ uses: number;
7860
+ endsAt: string;
7861
+ enabled: boolean;
7862
+ live: boolean;
7863
+ };
7864
+
7865
+ /** What delete an invite link answers: `resellerInvites.delete`. */
7866
+ export type ResellerInvitesDeleteResult = unknown[] | Record<string, unknown>;
7867
+
7868
+ /** What list announcements answers: `resellerAnnouncements.list`. */
7869
+ export type ResellerAnnouncementsListResult = {
7870
+ id: string;
7871
+ title: string;
7872
+ body: string;
7873
+ pinned: boolean;
7874
+ createdAt: string;
7875
+ updatedAt: string;
7876
+ closes: number;
7877
+ }[];
7878
+
7879
+ /** What post an announcement takes: `resellerAnnouncements.create`. */
7880
+ export interface ResellerAnnouncementsCreateParams {
7881
+ /** Its title, up to 100 characters. */
7882
+ title: string;
7883
+ /** What it says, up to 1,000 characters. */
7884
+ body: string;
7885
+ /**
7886
+ * Whether it is shown first, before the newer ones.
7887
+ *
7888
+ * Left out, it is false.
7889
+ */
7890
+ pinned?: boolean;
7891
+ }
7892
+
7893
+ /** What post an announcement answers: `resellerAnnouncements.create`. */
7894
+ export type ResellerAnnouncementsCreateResult = {
7895
+ id: string;
7896
+ title: string;
7897
+ body: string;
7898
+ pinned: boolean;
7899
+ createdAt: string;
7900
+ updatedAt: string;
7901
+ closes: number;
7902
+ };
7903
+
7904
+ /** What update an announcement takes: `resellerAnnouncements.update`. */
7905
+ export interface ResellerAnnouncementsUpdateParams {
7906
+ /** Its title, up to 100 characters. */
7907
+ title: string;
7908
+ /** What it says, up to 1,000 characters. */
7909
+ body: string;
7910
+ /**
7911
+ * Whether it is shown first, before the newer ones.
7912
+ *
7913
+ * Left out, it is false.
7914
+ */
7915
+ pinned?: boolean;
7916
+ }
7917
+
7918
+ /** What update an announcement answers: `resellerAnnouncements.update`. */
7919
+ export type ResellerAnnouncementsUpdateResult = {
7920
+ id: string;
7921
+ title: string;
7922
+ body: string;
7923
+ pinned: boolean;
7924
+ createdAt: string;
7925
+ updatedAt: string;
7926
+ closes: number;
7927
+ };
7928
+
7929
+ /** What delete an announcement answers: `resellerAnnouncements.delete`. */
7930
+ export type ResellerAnnouncementsDeleteResult = unknown[] | Record<string, unknown>;
7931
+
7932
+ /** What list reseller orders takes: `resellerOrders.list`. */
7933
+ export interface ResellerOrdersListParams {
7934
+ /** Only what matches this text: an order's ID, a reseller's website, or who bought or paid. */
7935
+ q?: string;
7936
+ /** Only one reseller's, by their ID. */
7937
+ reseller?: string;
7938
+ /** Only those bought one way. */
7939
+ via?: "panel" | "api" | "url";
7940
+ /**
7941
+ * Which page of the list. The first is 1.
7942
+ *
7943
+ * Left out, it is 1.
7944
+ */
7945
+ page?: number;
7946
+ }
7947
+
7948
+ /** A row of what list reseller orders lists: `resellerOrders.list`. */
7949
+ export type ResellerOrdersListItem = {
7950
+ id: string;
7951
+ resellerId: string;
7952
+ reseller: string;
7953
+ resellerRemoved: boolean;
7954
+ boughtBy: string;
7955
+ productName: string;
7956
+ variantName: string;
7957
+ quantity: number;
7958
+ total: number;
7959
+ currency: string;
7960
+ status: string;
7961
+ via: string;
7962
+ createdAt: string;
7963
+ };
7964
+
7965
+ /** What export reseller orders takes: `resellerOrders.export`. */
7966
+ export interface ResellerOrdersExportParams {
7967
+ /** Only what matches this text: an order's ID, a reseller's website, or who bought or paid. */
7968
+ q?: string;
7969
+ /** Only one reseller's, by their ID. */
7970
+ reseller?: string;
7971
+ /** Only those bought one way. */
7972
+ via?: "panel" | "api" | "url";
7973
+ /** `1` for how many rows the file would have, as `{ rows }`, in place of the file. */
7974
+ check?: "1";
7975
+ }
7976
+
7977
+ /** What get a reseller order answers: `resellerOrders.get`. */
7978
+ export type ResellerOrdersGetResult = {
7979
+ id: string;
7980
+ status: string;
7981
+ via: string;
7982
+ currency: string;
7983
+ total: number;
7984
+ listTotal: number;
7985
+ discount: number;
7986
+ balanceAfter: number;
7987
+ createdAt: string;
7988
+ reseller: {
7989
+ id: string;
7990
+ name: string;
7991
+ removed: boolean;
7992
+ };
7993
+ boughtBy: string;
7994
+ goodsShown: boolean;
7995
+ lines: Array<{
7996
+ productId: string;
7997
+ productName: string;
7998
+ variantName: string;
7999
+ unitPrice: number;
8000
+ quantity: number;
8001
+ delivered: number;
8002
+ keys: string[];
8003
+ items: unknown[] | Record<string, unknown>;
8004
+ waiting: boolean;
8005
+ instructions: string;
8006
+ }>;
8007
+ };
8008
+
8009
+ /** What list top-ups takes: `resellerTopUps.list`. */
8010
+ export interface ResellerTopUpsListParams {
8011
+ /** Only what matches this text: an order's ID, a reseller's website, or who bought or paid. */
8012
+ q?: string;
8013
+ /** Only one reseller's, by their ID. */
8014
+ reseller?: string;
8015
+ /** Only those in one state. */
8016
+ status?: "paid" | "waiting" | "checking" | "expired" | "taken_back";
8017
+ /**
8018
+ * Which page of the list. The first is 1.
8019
+ *
8020
+ * Left out, it is 1.
8021
+ */
8022
+ page?: number;
8023
+ }
8024
+
8025
+ /** A row of what list top-ups lists: `resellerTopUps.list`. */
8026
+ export type ResellerTopUpsListItem = {
8027
+ id: string;
8028
+ resellerId: string;
8029
+ reseller: string;
8030
+ resellerRemoved: boolean;
8031
+ paidBy: string;
8032
+ amount: number;
8033
+ currency: string;
8034
+ state: string;
8035
+ method: string;
8036
+ createdAt: string;
8037
+ paidAt: unknown;
8038
+ };
8039
+
8040
+ /** What export top-ups takes: `resellerTopUps.export`. */
8041
+ export interface ResellerTopUpsExportParams {
8042
+ /** Only what matches this text: an order's ID, a reseller's website, or who bought or paid. */
8043
+ q?: string;
8044
+ /** Only one reseller's, by their ID. */
8045
+ reseller?: string;
8046
+ /** Only those in one state. */
8047
+ status?: "paid" | "waiting" | "checking" | "expired" | "taken_back";
8048
+ /** `1` for how many rows the file would have, as `{ rows }`, in place of the file. */
8049
+ check?: "1";
8050
+ }
8051
+
8052
+ /** What get a top-up's custom payment answers: `resellerTopUps.payment`. */
8053
+ export type ResellerTopUpsPaymentResult = {
8054
+ method: string;
8055
+ kind: string;
8056
+ status: string;
8057
+ asksProof: boolean;
8058
+ requiresPicture: boolean;
8059
+ amount: number;
8060
+ currency: string;
8061
+ proof: {
8062
+ reference: string;
8063
+ picture: boolean;
8064
+ at: string;
8065
+ };
8066
+ };
8067
+
8068
+ /** What approve a top-up's custom payment answers: `resellerTopUps.approve`. */
8069
+ export type ResellerTopUpsApproveResult = {
8070
+ id: string;
8071
+ state: string;
8072
+ };
8073
+
8074
+ /** What reject a top-up's custom payment answers: `resellerTopUps.reject`. */
8075
+ export type ResellerTopUpsRejectResult = {
8076
+ id: string;
8077
+ state: string;
8078
+ };
8079
+
8080
+ /** What mark a top-up as paid answers: `resellerTopUps.markPaid`. */
8081
+ export type ResellerTopUpsMarkPaidResult = {
8082
+ id: string;
8083
+ state: string;
8084
+ };
8085
+
8086
+ /** What list resellers answers: `resellers.list`. */
8087
+ export type ResellersListResult = {
8088
+ id: string;
8089
+ name: string;
8090
+ website: string;
8091
+ email: string;
8092
+ tierId: unknown;
8093
+ tierName: unknown;
8094
+ tierDiscount: unknown;
8095
+ discount: unknown;
8096
+ paysOff: number;
8097
+ balance: number;
8098
+ status: string;
8099
+ members: number;
8100
+ spent30: number;
8101
+ lastOrderAt: unknown;
8102
+ joinedAt: string;
8103
+ removedAt: unknown;
8104
+ }[];
8105
+
8106
+ /** What get a reseller answers: `resellers.get`. */
8107
+ export type ResellersGetResult = {
8108
+ id: string;
8109
+ name: string;
8110
+ website: string;
8111
+ email: string;
8112
+ tierId: string;
8113
+ tierName: string;
8114
+ tierDiscount: number;
8115
+ discount: unknown;
8116
+ paysOff: number;
8117
+ balance: number;
8118
+ status: string;
8119
+ members: number;
8120
+ spent30: number;
8121
+ lastOrderAt: string;
8122
+ joinedAt: string;
8123
+ removedAt: unknown;
8124
+ inviteName: unknown;
8125
+ team: {
8126
+ id: string;
8127
+ email: string;
8128
+ owner: boolean;
8129
+ permissions: string[];
8130
+ access: {
8131
+ buy: boolean;
8132
+ topup: boolean;
8133
+ keys: boolean;
8134
+ api: boolean;
8135
+ };
8136
+ twoFactor: boolean;
8137
+ verified: boolean;
8138
+ lastSeenAt: unknown;
8139
+ joinedAt: string;
8140
+ }[];
8141
+ catalogue: Array<{
8142
+ id: string;
8143
+ label: string;
8144
+ permissions: Array<{
8145
+ key: string;
8146
+ label: string;
8147
+ about: string;
8148
+ needs: unknown[] | Record<string, unknown>;
8149
+ }>;
8150
+ }>;
8151
+ };
8152
+
8153
+ /** What update a reseller takes: `resellers.update`. */
8154
+ export interface ResellersUpdateParams {
8155
+ /** Their tier. Empty, none. */
8156
+ tierId?: string;
8157
+ /** Their own discount off every Reseller Price, in percent, 0.01 to 99.99, in place of their tier's. Null or empty, none. */
8158
+ discount?: number;
8159
+ /** Whether they can buy and top up. */
8160
+ status?: "active" | "paused";
8161
+ }
8162
+
8163
+ /** What update a reseller answers: `resellers.update`. */
8164
+ export type ResellersUpdateResult = {
8165
+ id: string;
8166
+ name: string;
8167
+ website: string;
8168
+ email: string;
8169
+ tierId: string;
8170
+ tierName: string;
8171
+ tierDiscount: number;
8172
+ discount: unknown;
8173
+ paysOff: number;
8174
+ balance: number;
8175
+ status: string;
8176
+ members: number;
8177
+ spent30: number;
8178
+ lastOrderAt: unknown;
8179
+ joinedAt: string;
8180
+ removedAt: unknown;
8181
+ inviteName: unknown;
8182
+ team: {
8183
+ id: string;
8184
+ email: string;
8185
+ owner: boolean;
8186
+ permissions: string[];
8187
+ access: {
8188
+ buy: boolean;
8189
+ topup: boolean;
8190
+ keys: boolean;
8191
+ api: boolean;
8192
+ };
8193
+ twoFactor: boolean;
8194
+ verified: boolean;
8195
+ lastSeenAt: unknown;
8196
+ joinedAt: string;
8197
+ }[];
8198
+ catalogue: Array<{
8199
+ id: string;
8200
+ label: string;
8201
+ permissions: Array<{
8202
+ key: string;
8203
+ label: string;
8204
+ about: string;
8205
+ needs: unknown[] | Record<string, unknown>;
8206
+ }>;
8207
+ }>;
8208
+ };
8209
+
8210
+ /** What remove a reseller answers: `resellers.delete`. */
8211
+ export type ResellersDeleteResult = {
8212
+ removed: boolean;
8213
+ };
8214
+
8215
+ /** What change a reseller's balance takes: `resellers.setBalance`. */
8216
+ export interface ResellersSetBalanceParams {
8217
+ /** Add to it, take from it, or set it to exactly this. */
8218
+ mode: "add" | "subtract" | "set";
8219
+ /** How much, in the panel's currency, with at most 2 decimals. */
8220
+ amount: number;
8221
+ /** Why, up to 500 characters. The reseller reads it. */
8222
+ note?: string;
8223
+ }
8224
+
8225
+ /** What change a reseller's balance answers: `resellers.setBalance`. */
8226
+ export type ResellersSetBalanceResult = {
8227
+ id: string;
8228
+ name: string;
8229
+ website: string;
8230
+ email: string;
8231
+ tierId: string;
8232
+ tierName: string;
8233
+ tierDiscount: number;
8234
+ discount: unknown;
8235
+ paysOff: number;
8236
+ balance: number;
8237
+ status: string;
8238
+ members: number;
8239
+ spent30: number;
8240
+ lastOrderAt: unknown;
8241
+ joinedAt: string;
8242
+ removedAt: unknown;
8243
+ inviteName: unknown;
8244
+ team: {
8245
+ id: string;
8246
+ email: string;
8247
+ owner: boolean;
8248
+ permissions: string[];
8249
+ access: {
8250
+ buy: boolean;
8251
+ topup: boolean;
8252
+ keys: boolean;
8253
+ api: boolean;
8254
+ };
8255
+ twoFactor: boolean;
8256
+ verified: boolean;
8257
+ lastSeenAt: unknown;
8258
+ joinedAt: string;
8259
+ }[];
8260
+ catalogue: Array<{
8261
+ id: string;
8262
+ label: string;
8263
+ permissions: Array<{
8264
+ key: string;
8265
+ label: string;
8266
+ about: string;
8267
+ needs: unknown[] | Record<string, unknown>;
8268
+ }>;
8269
+ }>;
8270
+ };
8271
+
8272
+ /** What change what a reseller's member may do takes: `resellers.updateMember`. */
8273
+ export interface ResellersUpdateMemberParams {
8274
+ /** What they may do, by name: `products.view`, `products.buy`, `orders.view`, `orders.keys`, `balance.view`, `balance.topup`, `api.keys`, `api.urls`, `team.view`, `team.manage`, `alerts.manage`. */
8275
+ permissions: string[];
8276
+ }
8277
+
8278
+ /** What change what a reseller's member may do answers: `resellers.updateMember`. */
8279
+ export type ResellersUpdateMemberResult = {
8280
+ id: string;
8281
+ name: string;
8282
+ website: string;
8283
+ email: string;
8284
+ tierId: string;
8285
+ tierName: string;
8286
+ tierDiscount: number;
8287
+ discount: unknown;
8288
+ paysOff: number;
8289
+ balance: number;
8290
+ status: string;
8291
+ members: number;
8292
+ spent30: number;
8293
+ lastOrderAt: unknown;
8294
+ joinedAt: string;
8295
+ removedAt: unknown;
8296
+ inviteName: unknown;
8297
+ team: {
8298
+ id: string;
8299
+ email: string;
8300
+ owner: boolean;
8301
+ permissions: string[];
8302
+ access: {
8303
+ buy: boolean;
8304
+ topup: boolean;
8305
+ keys: boolean;
8306
+ api: boolean;
8307
+ };
8308
+ twoFactor: boolean;
8309
+ verified: boolean;
8310
+ lastSeenAt: unknown;
8311
+ joinedAt: string;
8312
+ }[];
8313
+ catalogue: Array<{
8314
+ id: string;
8315
+ label: string;
8316
+ permissions: Array<{
8317
+ key: string;
8318
+ label: string;
8319
+ about: string;
8320
+ needs: unknown[] | Record<string, unknown>;
8321
+ }>;
8322
+ }>;
8323
+ };
8324
+
8325
+ /** What remove a reseller's member answers: `resellers.removeMember`. */
8326
+ export type ResellersRemoveMemberResult = {
8327
+ id: string;
8328
+ name: string;
8329
+ website: string;
8330
+ email: string;
8331
+ tierId: string;
8332
+ tierName: string;
8333
+ tierDiscount: number;
8334
+ discount: unknown;
8335
+ paysOff: number;
8336
+ balance: number;
8337
+ status: string;
8338
+ members: number;
8339
+ spent30: number;
8340
+ lastOrderAt: string;
8341
+ joinedAt: string;
8342
+ removedAt: unknown;
8343
+ inviteName: unknown;
8344
+ team: {
8345
+ id: string;
8346
+ email: string;
8347
+ owner: boolean;
8348
+ permissions: string[];
8349
+ access: {
8350
+ buy: boolean;
8351
+ topup: boolean;
8352
+ keys: boolean;
8353
+ api: boolean;
8354
+ };
8355
+ twoFactor: boolean;
8356
+ verified: boolean;
8357
+ lastSeenAt: unknown;
8358
+ joinedAt: string;
8359
+ }[];
8360
+ catalogue: Array<{
8361
+ id: string;
8362
+ label: string;
8363
+ permissions: Array<{
8364
+ key: string;
8365
+ label: string;
8366
+ about: string;
8367
+ needs: unknown[] | Record<string, unknown>;
8368
+ }>;
8369
+ }>;
7575
8370
  };
7576
8371
 
7577
8372
  /** What list blacklist rules takes: `blacklist.list`. */
@@ -14013,6 +14808,427 @@ export interface ShoplyResourcesTeams {
14013
14808
  delete(teamId: string, options?: RequestOptions): Promise<TeamsDeleteResult>;
14014
14809
  }
14015
14810
 
14811
+ export interface ShoplyResourcesResellers {
14812
+ /**
14813
+ * **Get the reseller overview**
14814
+ *
14815
+ * What the workspace's Overview shows: the panel (`panel`: whether it is on, its currency and smallest top-up), its address, the last 30 days' figures (`figures`: sales, orders and top-ups, and `balanceHeld`, every reseller's balance added up), what waits on the store (`waiting`, most pressing first: the panel off, nothing for sale, no invite link on, a product running out of keys) and the five resellers who spent most in 30 days (`top`). None of it is in the store's own figures: a reseller's purchases and top-ups are never its orders or revenue.
14816
+ *
14817
+ * Needs the `resellers.read` permission (Read Resellers). It is one of the heavier reads, and is counted against a smaller budget of its own: 60 a minute for each key.
14818
+ *
14819
+ * @see https://docs.shoply.gg/api-reference/resellers/get-the-reseller-overview
14820
+ */
14821
+ overview(options?: RequestOptions): Promise<ResellersOverviewResult>;
14822
+ /**
14823
+ * **Get the panel's settings**
14824
+ *
14825
+ * Whether the panel is on, its currency and its smallest top-up. `meta` has its addresses (`address`, its own domain once it is live; `shoplyAddress`, always its store's myshoply.gg one; `joinAddress`, what an invite link starts with), the invite links and tiers, `balanceHeld`, the bounds a smallest top-up is held to, and the currencies it can be in.
14826
+ *
14827
+ * Needs the `resellers.read` permission (Read Resellers).
14828
+ *
14829
+ * @see https://docs.shoply.gg/api-reference/resellers/get-the-panels-settings
14830
+ */
14831
+ settings(options?: RequestOptions): Promise<ResellersSettingsResult>;
14832
+ /**
14833
+ * **Update the panel's settings**
14834
+ *
14835
+ * Only what is sent changes. Switched off, nobody can join, sign in or buy, and every balance and order is kept. The currency changes only while every reseller's balance is zero.
14836
+ *
14837
+ * Needs the `resellers.write` permission (Change Resellers).
14838
+ *
14839
+ * @see https://docs.shoply.gg/api-reference/resellers/update-the-panels-settings
14840
+ */
14841
+ updateSettings(params?: ResellersUpdateSettingsParams, options?: RequestOptions): Promise<ResellersUpdateSettingsResult>;
14842
+ /**
14843
+ * **Get the panel's domain**
14844
+ *
14845
+ * The panel's own domain, if it has one, with where it stands (`status`, and `checks`: whether it points here, whether its TXT record has proved it the store's, and whether its certificate is issued), and `cnameTarget`. The panel has a domain of its own as the store does: point a CNAME record for it at `cnameTarget`, and it goes live once that is seen and its certificate is issued. Its store's myshoply.gg address answers too, always.
14846
+ *
14847
+ * Needs the `resellers.read` permission (Read Resellers).
14848
+ *
14849
+ * @see https://docs.shoply.gg/api-reference/resellers/get-the-panels-domain
14850
+ */
14851
+ domain(options?: RequestOptions): Promise<ResellersDomainResult>;
14852
+ /**
14853
+ * **Connect a domain to the panel**
14854
+ *
14855
+ * The panel has a domain of its own as the store does: point a CNAME record for it at `cnameTarget`, and it goes live once that is seen and its certificate is issued. Its store's myshoply.gg address answers too, always. A panel has one domain: remove it to connect another. Only a key the store's owner made can do this.
14856
+ *
14857
+ * Needs the `resellers.write` permission (Change Resellers). Only a key the store's owner made, or an app the owner connected, can call it: one made by somebody on the store's team is refused (`owner_only`).
14858
+ *
14859
+ * @see https://docs.shoply.gg/api-reference/resellers/connect-a-domain-to-the-panel
14860
+ */
14861
+ connectDomain(params: ResellersConnectDomainParams, options?: RequestOptions): Promise<ResellersConnectDomainResult>;
14862
+ /**
14863
+ * **Remove the panel's domain**
14864
+ *
14865
+ * Disconnects the panel's own domain. It goes on answering at its store's myshoply.gg address. Only a key the store's owner made can do this.
14866
+ *
14867
+ * Needs the `resellers.write` permission (Change Resellers). Only a key the store's owner made, or an app the owner connected, can call it: one made by somebody on the store's team is refused (`owner_only`).
14868
+ *
14869
+ * @see https://docs.shoply.gg/api-reference/resellers/remove-the-panels-domain
14870
+ */
14871
+ removeDomain(options?: RequestOptions): Promise<ResellersRemoveDomainResult>;
14872
+ /**
14873
+ * **List resellers**
14874
+ *
14875
+ * Every reseller of the store, the newest first, but those removed: a business, by the website it joined with (`name`), with its owner's email address, its tier and its own discount (`paysOff` is what it pays off every Reseller Price), its `balance`, whether it is `active` or `paused`, how many are on its team, and what it spent in 30 days. `meta.limit` is how many resellers the store's plan holds, so the list is not paged.
14876
+ *
14877
+ * Needs the `resellers.read` permission (Read Resellers).
14878
+ *
14879
+ * @see https://docs.shoply.gg/api-reference/resellers/list-resellers
14880
+ */
14881
+ list(options?: RequestOptions): Promise<ResellersListResult>;
14882
+ /**
14883
+ * **Get a reseller**
14884
+ *
14885
+ * One reseller as the list has them, with the invite link they joined by (`inviteName`) and their `team`: each member's email address, whether they are its owner, and what they may do (`permissions`, from `catalogue`). `meta.history` is their balance line by line, the newest 50 first. A reseller the store removed is still answered, with `removedAt` and no team.
14886
+ *
14887
+ * Needs the `resellers.read` permission (Read Resellers).
14888
+ *
14889
+ * @see https://docs.shoply.gg/api-reference/resellers/get-a-reseller
14890
+ */
14891
+ get(resellerId: string, options?: RequestOptions): Promise<ResellersGetResult>;
14892
+ /**
14893
+ * **Update a reseller**
14894
+ *
14895
+ * Only what is sent changes. A paused reseller signs in and reads their orders, and cannot buy or top up. Refused with `reseller_removed` for one the store removed.
14896
+ *
14897
+ * Needs the `resellers.write` permission (Change Resellers).
14898
+ *
14899
+ * @see https://docs.shoply.gg/api-reference/resellers/update-a-reseller
14900
+ */
14901
+ update(resellerId: string, params?: ResellersUpdateParams, options?: RequestOptions): Promise<ResellersUpdateResult>;
14902
+ /**
14903
+ * **Remove a reseller**
14904
+ *
14905
+ * Removes a reseller from the store: their team can no longer sign in, and their API keys, delivery URLs and team invites are deleted. Their records are kept: their orders and top-ups stay in List reseller orders and List top-ups, and Get a reseller still answers them, with `removedAt` and their balance history. Refused with `reseller_has_balance` while they hold a balance: set it to zero first. A removed reseller is in no list of resellers, and does not count against the store's plan.
14906
+ *
14907
+ * Needs the `resellers.write` permission (Change Resellers).
14908
+ *
14909
+ * @see https://docs.shoply.gg/api-reference/resellers/remove-a-reseller
14910
+ */
14911
+ delete(resellerId: string, options?: RequestOptions): Promise<ResellersDeleteResult>;
14912
+ /**
14913
+ * **Change a reseller's balance**
14914
+ *
14915
+ * Adds to, takes from or sets a reseller's balance, which never goes below zero or past 1,000,000. Shoply moves no money: this is for what you settled with them yourself. The note is what they read in their own history. A removed reseller's balance does not move. Send an `Idempotency-Key` with this request.
14916
+ *
14917
+ * Needs the `resellers.balance` permission (Change Reseller Balances).
14918
+ *
14919
+ * @see https://docs.shoply.gg/api-reference/resellers/change-a-resellers-balance
14920
+ */
14921
+ setBalance(resellerId: string, params: ResellersSetBalanceParams, options?: RequestOptions): Promise<ResellersSetBalanceResult>;
14922
+ /**
14923
+ * **Change what a reseller's member may do**
14924
+ *
14925
+ * Saves a member's permissions whole. What a permission leans on is added with it. The team's owner can always do everything, so theirs is refused.
14926
+ *
14927
+ * Needs the `resellers.write` permission (Change Resellers).
14928
+ *
14929
+ * @see https://docs.shoply.gg/api-reference/resellers/change-what-a-resellers-member-may-do
14930
+ */
14931
+ updateMember(resellerId: string, memberId: string, params: ResellersUpdateMemberParams, options?: RequestOptions): Promise<ResellersUpdateMemberResult>;
14932
+ /**
14933
+ * **Remove a reseller's member**
14934
+ *
14935
+ * Takes one person off a reseller's team. Their sessions and the API keys they made stop working. The team's owner cannot be removed.
14936
+ *
14937
+ * Needs the `resellers.write` permission (Change Resellers).
14938
+ *
14939
+ * @see https://docs.shoply.gg/api-reference/resellers/remove-a-resellers-member
14940
+ */
14941
+ removeMember(resellerId: string, memberId: string, options?: RequestOptions): Promise<ResellersRemoveMemberResult>;
14942
+ }
14943
+
14944
+ export interface ShoplyResourcesResellerProducts {
14945
+ /**
14946
+ * **List what the panel sells**
14947
+ *
14948
+ * Every option of the store's products the panel sells, a row an option: its Reseller Price (`price`), the fewest bought at once (`minQty`), the most one reseller may buy of it in a day (`dailyCap`), the most a tier or a reseller's own discount may take off it (`maxDiscount`), whether it is on sale (`enabled`) and its stock. `meta.badges` is each product's status and labels on the panel, by its ID, and `meta.tiers` the tiers.
14949
+ *
14950
+ * Needs the `resellers.read` permission (Read Resellers).
14951
+ *
14952
+ * @see https://docs.shoply.gg/api-reference/resellers/list-what-the-panel-sells
14953
+ */
14954
+ list(options?: RequestOptions): Promise<ResellerProductsListResult>;
14955
+ /**
14956
+ * **Sell products on the panel**
14957
+ *
14958
+ * Puts options on the panel or changes them, up to 1,000 at once, all or none: one row refused leaves every row as it was, and the errors are keyed by the option and the field (`<variantId>.price`). An option not sent is left as it is. Answers every row the panel sells.
14959
+ *
14960
+ * Needs the `resellers.write` permission (Change Resellers).
14961
+ *
14962
+ * @see https://docs.shoply.gg/api-reference/resellers/sell-products-on-the-panel
14963
+ */
14964
+ save(params: ResellerProductsSaveParams, options?: RequestOptions): Promise<ResellerProductsSaveResult>;
14965
+ /**
14966
+ * **List what the panel can sell**
14967
+ *
14968
+ * The store's products with the options a panel can sell: those delivered as license keys or by dynamic delivery. A file is never sold to resellers. `meta.categories` is the store's categories they are in.
14969
+ *
14970
+ * Needs the `resellers.read` permission (Read Resellers).
14971
+ *
14972
+ * @see https://docs.shoply.gg/api-reference/resellers/list-what-the-panel-can-sell
14973
+ */
14974
+ pickable(options?: RequestOptions): Promise<ResellerProductsPickableResult>;
14975
+ /**
14976
+ * **Stop selling an option on the panel**
14977
+ *
14978
+ * Takes one option off the panel. What resellers bought of it stays on record. Answers every row the panel still sells.
14979
+ *
14980
+ * Needs the `resellers.write` permission (Change Resellers).
14981
+ *
14982
+ * @see https://docs.shoply.gg/api-reference/resellers/stop-selling-an-option-on-the-panel
14983
+ */
14984
+ remove(variantId: string, options?: RequestOptions): Promise<ResellerProductsRemoveResult>;
14985
+ /**
14986
+ * **Set a product's status and labels on the panel**
14987
+ *
14988
+ * What resellers read beside a product on the panel, never the product's own badges: one status and labels, as a product's badges are written. An empty list takes them off. 404 for a product the panel does not sell. Answers every product's, by its ID.
14989
+ *
14990
+ * Needs the `resellers.write` permission (Change Resellers).
14991
+ *
14992
+ * @see https://docs.shoply.gg/api-reference/resellers/set-a-products-status-and-labels-on-the-panel
14993
+ */
14994
+ badges(productId: string, params: ResellerProductsBadgesParams, options?: RequestOptions): Promise<ResellerProductsBadgesResult>;
14995
+ }
14996
+
14997
+ export interface ShoplyResourcesResellerTiers {
14998
+ /**
14999
+ * **List tiers**
15000
+ *
15001
+ * The panel's tiers, each a discount off every Reseller Price, with how many resellers are in it. A reseller pays their own discount where they have one, else their tier's. `meta.limit` is how many tiers the store's plan holds.
15002
+ *
15003
+ * Needs the `resellers.read` permission (Read Resellers).
15004
+ *
15005
+ * @see https://docs.shoply.gg/api-reference/resellers/list-tiers
15006
+ */
15007
+ list(options?: RequestOptions): Promise<ResellerTiersListResult>;
15008
+ /**
15009
+ * **Create a tier**
15010
+ *
15011
+ * Adds a tier, up to as many as the store's plan holds. A name is used once a panel.
15012
+ *
15013
+ * Needs the `resellers.write` permission (Change Resellers).
15014
+ *
15015
+ * @see https://docs.shoply.gg/api-reference/resellers/create-a-tier
15016
+ */
15017
+ create(params: ResellerTiersCreateParams, options?: RequestOptions): Promise<ResellerTiersCreateResult>;
15018
+ /**
15019
+ * **Update a tier**
15020
+ *
15021
+ * Saves the tier whole: its name and discount. Its resellers pay the new discount from their next purchase.
15022
+ *
15023
+ * Needs the `resellers.write` permission (Change Resellers).
15024
+ *
15025
+ * @see https://docs.shoply.gg/api-reference/resellers/update-a-tier
15026
+ */
15027
+ update(tierId: string, params: ResellerTiersUpdateParams, options?: RequestOptions): Promise<ResellerTiersUpdateResult>;
15028
+ /**
15029
+ * **Delete a tier**
15030
+ *
15031
+ * Its resellers and invite links are left in no tier, which is the Reseller Price. Answers the tiers that are left.
15032
+ *
15033
+ * Needs the `resellers.write` permission (Change Resellers).
15034
+ *
15035
+ * @see https://docs.shoply.gg/api-reference/resellers/delete-a-tier
15036
+ */
15037
+ delete(tierId: string, options?: RequestOptions): Promise<ResellerTiersDeleteResult>;
15038
+ }
15039
+
15040
+ export interface ShoplyResourcesResellerInvites {
15041
+ /**
15042
+ * **List invite links**
15043
+ *
15044
+ * The links a business joins the panel by, the newest first, each with its `code` (the link is `meta.joinAddress` followed by it), the tier it starts them in, how many have joined through it (`uses`) and how many may, when it ends, whether it is switched on (`enabled`) and whether it can still be used (`live`). `meta.limits` says how many may be live at once on the store's plan, and how many are.
15045
+ *
15046
+ * Needs the `resellers.read` permission (Read Resellers).
15047
+ *
15048
+ * @see https://docs.shoply.gg/api-reference/resellers/list-invite-links
15049
+ */
15050
+ list(options?: RequestOptions): Promise<ResellerInvitesListResult>;
15051
+ /**
15052
+ * **Create an invite link**
15053
+ *
15054
+ * Makes a link a business joins the panel by, with their website, an email address and a password, and no approval. Refused with `reseller_invite_limit` where the store's plan has as many on as it holds.
15055
+ *
15056
+ * Needs the `resellers.write` permission (Change Resellers).
15057
+ *
15058
+ * @see https://docs.shoply.gg/api-reference/resellers/create-an-invite-link
15059
+ */
15060
+ create(params?: ResellerInvitesCreateParams, options?: RequestOptions): Promise<ResellerInvitesCreateResult>;
15061
+ /**
15062
+ * **Update an invite link**
15063
+ *
15064
+ * Only what is sent changes: send `enabled: false` to switch a link off. Its address stays the same.
15065
+ *
15066
+ * Needs the `resellers.write` permission (Change Resellers).
15067
+ *
15068
+ * @see https://docs.shoply.gg/api-reference/resellers/update-an-invite-link
15069
+ */
15070
+ update(inviteId: string, params?: ResellerInvitesUpdateParams, options?: RequestOptions): Promise<ResellerInvitesUpdateResult>;
15071
+ /**
15072
+ * **Delete an invite link**
15073
+ *
15074
+ * Whoever joined through it stays a reseller; only the link goes. Answers the links that are left.
15075
+ *
15076
+ * Needs the `resellers.write` permission (Change Resellers).
15077
+ *
15078
+ * @see https://docs.shoply.gg/api-reference/resellers/delete-an-invite-link
15079
+ */
15080
+ delete(inviteId: string, options?: RequestOptions): Promise<ResellerInvitesDeleteResult>;
15081
+ }
15082
+
15083
+ export interface ShoplyResourcesResellerAnnouncements {
15084
+ /**
15085
+ * **List announcements**
15086
+ *
15087
+ * What the store tells its resellers, in a bar on every page of the panel, pinned ones first, then the newest. `meta.resellers` is how many people can read them (everybody on every reseller's team), and `meta.bounds` the lengths and how many a panel keeps.
15088
+ *
15089
+ * Needs the `resellers.read` permission (Read Resellers).
15090
+ *
15091
+ * @see https://docs.shoply.gg/api-reference/resellers/list-announcements
15092
+ */
15093
+ list(options?: RequestOptions): Promise<ResellerAnnouncementsListResult>;
15094
+ /**
15095
+ * **Post an announcement**
15096
+ *
15097
+ * Every reseller sees it on the panel from their next page. Nobody is emailed. A panel keeps up to 100: past that, a new one is refused with `announcement_limit`.
15098
+ *
15099
+ * Needs the `resellers.write` permission (Change Resellers).
15100
+ *
15101
+ * @see https://docs.shoply.gg/api-reference/resellers/post-an-announcement
15102
+ */
15103
+ create(params: ResellerAnnouncementsCreateParams, options?: RequestOptions): Promise<ResellerAnnouncementsCreateResult>;
15104
+ /**
15105
+ * **Update an announcement**
15106
+ *
15107
+ * Saves it whole: its title, what it says and whether it is pinned.
15108
+ *
15109
+ * Needs the `resellers.write` permission (Change Resellers).
15110
+ *
15111
+ * @see https://docs.shoply.gg/api-reference/resellers/update-an-announcement
15112
+ */
15113
+ update(announcementId: string, params: ResellerAnnouncementsUpdateParams, options?: RequestOptions): Promise<ResellerAnnouncementsUpdateResult>;
15114
+ /**
15115
+ * **Delete an announcement**
15116
+ *
15117
+ * Takes it off the panel. Answers the announcements that are left.
15118
+ *
15119
+ * Needs the `resellers.write` permission (Change Resellers).
15120
+ *
15121
+ * @see https://docs.shoply.gg/api-reference/resellers/delete-an-announcement
15122
+ */
15123
+ delete(announcementId: string, options?: RequestOptions): Promise<ResellerAnnouncementsDeleteResult>;
15124
+ }
15125
+
15126
+ export interface ShoplyResourcesResellerOrders {
15127
+ /**
15128
+ * **List reseller orders**
15129
+ *
15130
+ * What resellers bought, newest first, 25 a page: who (`reseller`, and `boughtBy`, the member of their team), what and how many, the `total` taken off their balance, and how it was bought (`via`: `panel`, `api` for their own API, or `url` for a delivery URL). These are never the store's orders: List orders does not have them, and no order webhook is sent for them. `meta.counts` is how many each way, and `meta.figures` the last 30 days'.
15131
+ *
15132
+ * Needs the `resellers.read` permission (Read Resellers).
15133
+ *
15134
+ * @see https://docs.shoply.gg/api-reference/resellers/list-reseller-orders
15135
+ */
15136
+ list(params?: ResellerOrdersListParams, options?: RequestOptions): PagePromise<ResellerOrdersListItem>;
15137
+ /**
15138
+ * **Export reseller orders**
15139
+ *
15140
+ * The orders the same filters would list, as a CSV file: Order ID, Reseller, Bought By, Product, Variant, Quantity, Total, Currency, Bought With and Date. No delivered key is in it. Every row the filters match is in the file, up to 50,000, sent as it is read. Add `check=1` for `{ rows }`, how many it would have, which is not counted. A store exports at most 30 files every 10 minutes, whatever they are of, whoever asks: after that the answer is 429.
15141
+ *
15142
+ * Needs the `resellers.read` permission (Read Resellers). It is one of the heavier reads, and is counted against a smaller budget of its own: 60 a minute for each key.
15143
+ *
15144
+ * @see https://docs.shoply.gg/api-reference/resellers/export-reseller-orders
15145
+ */
15146
+ export(params?: ResellerOrdersExportParams, options?: RequestOptions): Promise<Response>;
15147
+ /**
15148
+ * **Get a reseller order**
15149
+ *
15150
+ * One reseller order whole, as the dashboard's page for it shows it: who bought it (`reseller`, and `boughtBy`, the member of their team), how (`via`), the `total` taken off their balance, `listTotal` (what it came to at the panel's list prices when bought) and `discount` (what their price took off it), both null for an order from before those were kept, and `balanceAfter`. Each of `lines` is an option it bought, with its `unitPrice` and `quantity` and what it delivered: `keys`, `items` (what a dynamic delivery's server handed back, a line each), `instructions`, and `waiting` while a dynamic line is still being fetched. A store's own order or a top-up answers 404.
15151
+ *
15152
+ * Needs the `resellers.read` permission (Read Resellers).
15153
+ *
15154
+ * @see https://docs.shoply.gg/api-reference/resellers/get-a-reseller-order
15155
+ */
15156
+ get(orderId: string, options?: RequestOptions): Promise<ResellerOrdersGetResult>;
15157
+ }
15158
+
15159
+ export interface ShoplyResourcesResellerTopUps {
15160
+ /**
15161
+ * **List top-ups**
15162
+ *
15163
+ * Money resellers put on their balance, paid on the store's checkout with its own payment methods, newest first, 25 a page. `state` is `paid`, `waiting` (for the reseller to pay), `checking` (paid with one of the store's custom methods, and waiting for the store), `expired` (not paid in the store's unpaid order time) or `taken_back` (its payment was taken back by the bank, and came off the balance). A top-up's `id` is the order it is paid with. `meta.counts` is how many in each state, and `meta.figures` the last 30 days'.
15164
+ *
15165
+ * Needs the `resellers.read` permission (Read Resellers).
15166
+ *
15167
+ * @see https://docs.shoply.gg/api-reference/resellers/list-top-ups
15168
+ */
15169
+ list(params?: ResellerTopUpsListParams, options?: RequestOptions): PagePromise<ResellerTopUpsListItem>;
15170
+ /**
15171
+ * **Export top-ups**
15172
+ *
15173
+ * The top-ups the same filters would list, as a CSV file: Top-up ID, Reseller, Paid By, Amount, Currency, Paid With, Status, Opened and Paid. Every row the filters match is in the file, up to 50,000, sent as it is read. Add `check=1` for `{ rows }`, how many it would have, which is not counted. A store exports at most 30 files every 10 minutes, whatever they are of, whoever asks: after that the answer is 429.
15174
+ *
15175
+ * Needs the `resellers.read` permission (Read Resellers). It is one of the heavier reads, and is counted against a smaller budget of its own: 60 a minute for each key.
15176
+ *
15177
+ * @see https://docs.shoply.gg/api-reference/resellers/export-top-ups
15178
+ */
15179
+ export(params?: ResellerTopUpsExportParams, options?: RequestOptions): Promise<Response>;
15180
+ /**
15181
+ * **Get a top-up's custom payment**
15182
+ *
15183
+ * A top-up paid with one of the store's custom methods: the method, what the reseller sent with it (a reference, a picture) and where it stands (`status` `review` while it waits for the store). Null for a top-up paid any other way. `meta.gateway` is the method.
15184
+ *
15185
+ * Needs the `resellers.read` permission (Read Resellers).
15186
+ *
15187
+ * @see https://docs.shoply.gg/api-reference/resellers/get-a-top-ups-custom-payment
15188
+ */
15189
+ payment(topUpId: string, options?: RequestOptions): Promise<ResellerTopUpsPaymentResult>;
15190
+ /**
15191
+ * **Get a top-up's proof of payment**
15192
+ *
15193
+ * The picture a reseller sent with a custom payment, as the file itself: a PNG, JPEG or WebP. 404 where the top-up has none.
15194
+ *
15195
+ * Needs the `resellers.read` permission (Read Resellers).
15196
+ *
15197
+ * @see https://docs.shoply.gg/api-reference/resellers/get-a-top-ups-proof-of-payment
15198
+ */
15199
+ proof(topUpId: string, options?: RequestOptions): Promise<Response>;
15200
+ /**
15201
+ * **Approve a top-up's custom payment**
15202
+ *
15203
+ * Says the money a reseller sent with one of the store's custom methods arrived, and puts the top-up on their balance. Shoply never sees that money: check it reached you first. Refused with `payment_not_approved` where there is nothing to approve. Send an `Idempotency-Key` with this request.
15204
+ *
15205
+ * Needs the `resellers.balance` permission (Change Reseller Balances).
15206
+ *
15207
+ * @see https://docs.shoply.gg/api-reference/resellers/approve-a-top-ups-custom-payment
15208
+ */
15209
+ approve(topUpId: string, options?: RequestOptions): Promise<ResellerTopUpsApproveResult>;
15210
+ /**
15211
+ * **Reject a top-up's custom payment**
15212
+ *
15213
+ * Cancels the top-up, and nothing goes on the balance. The reseller is not emailed. Refused with `payment_not_rejected` where there is nothing to reject.
15214
+ *
15215
+ * Needs the `resellers.balance` permission (Change Reseller Balances).
15216
+ *
15217
+ * @see https://docs.shoply.gg/api-reference/resellers/reject-a-top-ups-custom-payment
15218
+ */
15219
+ reject(topUpId: string, options?: RequestOptions): Promise<ResellerTopUpsRejectResult>;
15220
+ /**
15221
+ * **Mark a top-up as paid**
15222
+ *
15223
+ * A top-up waiting for payment or expired goes onto the reseller's balance as if its payment had arrived, for money that reached you another way. It cannot be undone. Refused with `top_up_not_payable` for one paid already or taken back, and for one whose custom payment waits for you: approve or reject that instead. Send an `Idempotency-Key` with this request.
15224
+ *
15225
+ * Needs the `resellers.balance` permission (Change Reseller Balances).
15226
+ *
15227
+ * @see https://docs.shoply.gg/api-reference/resellers/mark-a-top-up-as-paid
15228
+ */
15229
+ markPaid(topUpId: string, options?: RequestOptions): Promise<ResellerTopUpsMarkPaidResult>;
15230
+ }
15231
+
14016
15232
  export interface ShoplyResourcesBlacklist {
14017
15233
  /**
14018
15234
  * **List blacklist rules**
@@ -14895,6 +16111,13 @@ export interface ShoplyResources {
14895
16111
  tickets: ShoplyResourcesTickets;
14896
16112
  team: ShoplyResourcesTeam;
14897
16113
  teams: ShoplyResourcesTeams;
16114
+ resellers: ShoplyResourcesResellers;
16115
+ resellerProducts: ShoplyResourcesResellerProducts;
16116
+ resellerTiers: ShoplyResourcesResellerTiers;
16117
+ resellerInvites: ShoplyResourcesResellerInvites;
16118
+ resellerAnnouncements: ShoplyResourcesResellerAnnouncements;
16119
+ resellerOrders: ShoplyResourcesResellerOrders;
16120
+ resellerTopUps: ShoplyResourcesResellerTopUps;
14898
16121
  blacklist: ShoplyResourcesBlacklist;
14899
16122
  allowlist: ShoplyResourcesAllowlist;
14900
16123
  fraudEvents: ShoplyResourcesFraudEvents;
@@ -15285,6 +16508,13 @@ export type WebhookEventName =
15285
16508
  | "team.member_joined"
15286
16509
  | "team.member_moved"
15287
16510
  | "team.member_left"
16511
+ | "reseller.joined"
16512
+ | "reseller.updated"
16513
+ | "reseller.removed"
16514
+ | "reseller.balance_changed"
16515
+ | "reseller.top_up_paid"
16516
+ | "reseller.top_up_submitted"
16517
+ | "reseller.order_completed"
15288
16518
  | "fraud.checkout_blocked"
15289
16519
  | "fraud.checkout_allowed"
15290
16520
  | "webhook.test";
@@ -15669,6 +16899,48 @@ export interface WebhookEventData {
15669
16899
  * `data`: For `team.created` and `team.updated` the team as [Get the team](https://docs.shoply.gg/api-reference/teams/get-the-team) answers it in `teams`, without its `people`; `team.deleted` has its `id` and `name`. The three `team.member_` events have the person as Get the team answers them on a team (`id`, `teamId`, `name`, `email`, `joinedAt`), with `team`, the team they are on now or were on, by `id` and `name`; `team.member_moved` adds `from`, the team they left, and `team.member_left` adds `reason` (`removed` or `left`) and `keysStopped`.
15670
16900
  */
15671
16901
  "team.member_left": Record<string, unknown>;
16902
+ /**
16903
+ * A business joined the store's reseller panel through one of its invite links.
16904
+ *
16905
+ * `data`: For `reseller.joined`, `reseller.updated` and `reseller.removed`, the reseller, as [List resellers](https://docs.shoply.gg/api-reference/resellers/list-resellers) answers one. `reseller.balance_changed` adds `change`: its `kind` (`topup`, `order`, `manual` or `chargeback`), `amount`, `balanceAfter`, `orderId`, `note`, `actor` and `createdAt`. The two `reseller.top_up_` events have the top-up, as [List top-ups](https://docs.shoply.gg/api-reference/resellers/list-top-ups) answers it, and `reseller.order_completed` the order, as [List reseller orders](https://docs.shoply.gg/api-reference/resellers/list-reseller-orders) answers it.
16906
+ */
16907
+ "reseller.joined": Record<string, unknown>;
16908
+ /**
16909
+ * A reseller was paused or made active again, or given another tier or discount, by the store or by Shoply; or paused because a top-up's payment was taken back.
16910
+ *
16911
+ * `data`: For `reseller.joined`, `reseller.updated` and `reseller.removed`, the reseller, as [List resellers](https://docs.shoply.gg/api-reference/resellers/list-resellers) answers one. `reseller.balance_changed` adds `change`: its `kind` (`topup`, `order`, `manual` or `chargeback`), `amount`, `balanceAfter`, `orderId`, `note`, `actor` and `createdAt`. The two `reseller.top_up_` events have the top-up, as [List top-ups](https://docs.shoply.gg/api-reference/resellers/list-top-ups) answers it, and `reseller.order_completed` the order, as [List reseller orders](https://docs.shoply.gg/api-reference/resellers/list-reseller-orders) answers it.
16912
+ */
16913
+ "reseller.updated": Record<string, unknown>;
16914
+ /**
16915
+ * The store removed a reseller: their team can no longer sign in. Their orders, top-ups and balance history are kept.
16916
+ *
16917
+ * `data`: For `reseller.joined`, `reseller.updated` and `reseller.removed`, the reseller, as [List resellers](https://docs.shoply.gg/api-reference/resellers/list-resellers) answers one. `reseller.balance_changed` adds `change`: its `kind` (`topup`, `order`, `manual` or `chargeback`), `amount`, `balanceAfter`, `orderId`, `note`, `actor` and `createdAt`. The two `reseller.top_up_` events have the top-up, as [List top-ups](https://docs.shoply.gg/api-reference/resellers/list-top-ups) answers it, and `reseller.order_completed` the order, as [List reseller orders](https://docs.shoply.gg/api-reference/resellers/list-reseller-orders) answers it.
16918
+ */
16919
+ "reseller.removed": Record<string, unknown>;
16920
+ /**
16921
+ * A reseller's balance changed: a top-up paid, a purchase, a change by hand, or a top-up's payment taken back.
16922
+ *
16923
+ * `data`: For `reseller.joined`, `reseller.updated` and `reseller.removed`, the reseller, as [List resellers](https://docs.shoply.gg/api-reference/resellers/list-resellers) answers one. `reseller.balance_changed` adds `change`: its `kind` (`topup`, `order`, `manual` or `chargeback`), `amount`, `balanceAfter`, `orderId`, `note`, `actor` and `createdAt`. The two `reseller.top_up_` events have the top-up, as [List top-ups](https://docs.shoply.gg/api-reference/resellers/list-top-ups) answers it, and `reseller.order_completed` the order, as [List reseller orders](https://docs.shoply.gg/api-reference/resellers/list-reseller-orders) answers it.
16924
+ */
16925
+ "reseller.balance_changed": Record<string, unknown>;
16926
+ /**
16927
+ * A reseller's top-up was paid, or marked paid by the store, and is on their balance.
16928
+ *
16929
+ * `data`: For `reseller.joined`, `reseller.updated` and `reseller.removed`, the reseller, as [List resellers](https://docs.shoply.gg/api-reference/resellers/list-resellers) answers one. `reseller.balance_changed` adds `change`: its `kind` (`topup`, `order`, `manual` or `chargeback`), `amount`, `balanceAfter`, `orderId`, `note`, `actor` and `createdAt`. The two `reseller.top_up_` events have the top-up, as [List top-ups](https://docs.shoply.gg/api-reference/resellers/list-top-ups) answers it, and `reseller.order_completed` the order, as [List reseller orders](https://docs.shoply.gg/api-reference/resellers/list-reseller-orders) answers it.
16930
+ */
16931
+ "reseller.top_up_paid": Record<string, unknown>;
16932
+ /**
16933
+ * A reseller says they paid a top-up with one of the store's custom payment methods, and it waits for the store to approve or reject it. Approved, it is `reseller.top_up_paid`.
16934
+ *
16935
+ * `data`: For `reseller.joined`, `reseller.updated` and `reseller.removed`, the reseller, as [List resellers](https://docs.shoply.gg/api-reference/resellers/list-resellers) answers one. `reseller.balance_changed` adds `change`: its `kind` (`topup`, `order`, `manual` or `chargeback`), `amount`, `balanceAfter`, `orderId`, `note`, `actor` and `createdAt`. The two `reseller.top_up_` events have the top-up, as [List top-ups](https://docs.shoply.gg/api-reference/resellers/list-top-ups) answers it, and `reseller.order_completed` the order, as [List reseller orders](https://docs.shoply.gg/api-reference/resellers/list-reseller-orders) answers it.
16936
+ */
16937
+ "reseller.top_up_submitted": Record<string, unknown>;
16938
+ /**
16939
+ * A reseller bought from the panel, in the panel itself, with their API or by a delivery URL, paid from their balance.
16940
+ *
16941
+ * `data`: For `reseller.joined`, `reseller.updated` and `reseller.removed`, the reseller, as [List resellers](https://docs.shoply.gg/api-reference/resellers/list-resellers) answers one. `reseller.balance_changed` adds `change`: its `kind` (`topup`, `order`, `manual` or `chargeback`), `amount`, `balanceAfter`, `orderId`, `note`, `actor` and `createdAt`. The two `reseller.top_up_` events have the top-up, as [List top-ups](https://docs.shoply.gg/api-reference/resellers/list-top-ups) answers it, and `reseller.order_completed` the order, as [List reseller orders](https://docs.shoply.gg/api-reference/resellers/list-reseller-orders) answers it.
16942
+ */
16943
+ "reseller.order_completed": Record<string, unknown>;
15672
16944
  /**
15673
16945
  * A checkout was turned away by the blacklist, a blocked country, the VPN rule or the limit on unpaid orders. The same buyer turned away again for the same reason within ten minutes is not sent again.
15674
16946
  *