ebay-api 9.1.1 → 9.2.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.
Files changed (38) hide show
  1. package/README.md +3 -3
  2. package/dist/api/apiFactory.js +3 -2
  3. package/dist/api/restful/developer/analytics/index.d.ts +1 -1
  4. package/dist/api/restful/sell/account/{index.d.ts → v1.d.ts} +1 -1
  5. package/dist/api/restful/sell/account/{index.js → v1.js} +3 -3
  6. package/dist/api/restful/sell/account/v2.d.ts +11 -0
  7. package/dist/api/restful/sell/account/v2.js +22 -0
  8. package/dist/api/restful/sell/feed/index.js +8 -2
  9. package/dist/api/restful/sell/fulfillment/index.d.ts +1 -1
  10. package/dist/api/restful/sell/index.d.ts +5 -3
  11. package/dist/api/restful/sell/index.js +3 -2
  12. package/dist/api/restful/sell/inventory/index.d.ts +4 -1
  13. package/dist/api/restful/sell/inventory/index.js +17 -2
  14. package/dist/ebay-api.min.mjs +1 -1
  15. package/dist/errors/index.js +8 -0
  16. package/dist/types/restful/specs/sell_account_v2_oas3.d.ts +154 -0
  17. package/dist/types/restful/specs/sell_account_v2_oas3.js +1 -0
  18. package/dist/types/restful/specs/sell_inventory_v1_oas3.d.ts +133 -4
  19. package/dist/types/restfulTypes.d.ts +12 -8
  20. package/lib/api/apiFactory.js +2 -1
  21. package/lib/api/restful/developer/analytics/index.d.ts +1 -1
  22. package/lib/api/restful/sell/account/{index.d.ts → v1.d.ts} +1 -1
  23. package/lib/api/restful/sell/account/{index.js → v1.js} +3 -3
  24. package/lib/api/restful/sell/account/v2.d.ts +11 -0
  25. package/lib/api/restful/sell/account/v2.js +27 -0
  26. package/lib/api/restful/sell/feed/index.js +8 -2
  27. package/lib/api/restful/sell/fulfillment/index.d.ts +1 -1
  28. package/lib/api/restful/sell/index.d.ts +5 -3
  29. package/lib/api/restful/sell/index.js +29 -27
  30. package/lib/api/restful/sell/inventory/index.d.ts +4 -1
  31. package/lib/api/restful/sell/inventory/index.js +17 -2
  32. package/lib/ebay-api.min.js +1 -1
  33. package/lib/errors/index.js +8 -0
  34. package/lib/types/restful/specs/sell_account_v2_oas3.d.ts +154 -0
  35. package/lib/types/restful/specs/sell_account_v2_oas3.js +2 -0
  36. package/lib/types/restful/specs/sell_inventory_v1_oas3.d.ts +133 -4
  37. package/lib/types/restfulTypes.d.ts +12 -8
  38. package/package.json +1 -1
@@ -177,9 +177,17 @@ export const handleEBayError = (error) => {
177
177
  throw new EBayApiError(message, description, meta, errorCode, firstError);
178
178
  };
179
179
  export const checkEBayTraditionalResponse = (apiResponse, data) => {
180
+ if (!data) {
181
+ log('checkEBayTraditionalResponse: No data found in response.');
182
+ return;
183
+ }
180
184
  if (!('Errors' in data) && !('errorMessage' in data)) {
181
185
  return;
182
186
  }
187
+ if ('Errors' in data && data.Ack !== 'Failure') {
188
+ log(`checkEBayTraditionalResponse: eBay API returned ${data.Ack}`);
189
+ return;
190
+ }
183
191
  const { message, meta, description, errorCode, firstError } = extractEBayError(apiResponse, data);
184
192
  if (typeof errorCode === 'undefined') {
185
193
  throw new EBayApiError(message, description, meta, errorCode, firstError);
@@ -0,0 +1,154 @@
1
+ export interface paths {
2
+ "/rate_table/{rate_table_id}": {
3
+ get: operations["getRateTable"];
4
+ };
5
+ "/rate_table/{rate_table_id}/update_shipping_cost": {
6
+ post: operations["updateShippingCost"];
7
+ };
8
+ "/payout_settings": {
9
+ get: operations["getPayoutSettings"];
10
+ };
11
+ "/payout_settings/update_percentage": {
12
+ post: operations["updatePayoutPercentage"];
13
+ };
14
+ }
15
+ export type webhooks = Record<string, never>;
16
+ export interface components {
17
+ schemas: {
18
+ Amount: {
19
+ currency?: string;
20
+ value?: string;
21
+ };
22
+ Error: {
23
+ category?: string;
24
+ domain?: string;
25
+ errorId?: number;
26
+ inputRefIds?: (string)[];
27
+ longMessage?: string;
28
+ message?: string;
29
+ outputRefIds?: (string)[];
30
+ parameters?: (components["schemas"]["ErrorParameter"])[];
31
+ subdomain?: string;
32
+ };
33
+ ErrorParameter: {
34
+ name?: string;
35
+ value?: string;
36
+ };
37
+ PayoutInstrument: {
38
+ accountLastFourDigits?: string;
39
+ instrumentId?: string;
40
+ instrumentStatus?: string;
41
+ instrumentType?: string;
42
+ nickname?: string;
43
+ payoutPercentage?: string;
44
+ };
45
+ PayoutSettingsResponse: {
46
+ payoutInstruments?: (components["schemas"]["PayoutInstrument"])[];
47
+ };
48
+ Rate: {
49
+ additionalCost?: components["schemas"]["Amount"];
50
+ rateId?: string;
51
+ shippingCategory?: string;
52
+ shippingCost?: components["schemas"]["Amount"];
53
+ shippingRegionNames?: (string)[];
54
+ shippingServiceCode?: string;
55
+ };
56
+ RateTableDetails: {
57
+ marketplaceId?: string;
58
+ name?: string;
59
+ rates?: (components["schemas"]["Rate"])[];
60
+ rateTableBasis?: string;
61
+ rateTableId?: string;
62
+ shippingOptionType?: string;
63
+ };
64
+ RateTableUpdate: {
65
+ rates?: (components["schemas"]["RateUpdate"])[];
66
+ };
67
+ RateUpdate: {
68
+ additionalCost?: components["schemas"]["Amount"];
69
+ rateId?: string;
70
+ shippingCost?: components["schemas"]["Amount"];
71
+ };
72
+ UpdatePayoutPercentage: {
73
+ instrumentId?: string;
74
+ payoutPercentage?: string;
75
+ };
76
+ UpdatePayoutPercentageRequest: {
77
+ payoutInstruments?: (components["schemas"]["UpdatePayoutPercentage"])[];
78
+ };
79
+ };
80
+ responses: never;
81
+ parameters: never;
82
+ requestBodies: never;
83
+ headers: never;
84
+ pathItems: never;
85
+ }
86
+ export type external = Record<string, never>;
87
+ export interface operations {
88
+ getRateTable: {
89
+ parameters: {
90
+ path: {
91
+ rate_table_id: string;
92
+ };
93
+ };
94
+ responses: {
95
+ 200: {
96
+ content: {
97
+ "application/json": components["schemas"]["RateTableDetails"];
98
+ };
99
+ };
100
+ 400: never;
101
+ 404: never;
102
+ 500: never;
103
+ };
104
+ };
105
+ updateShippingCost: {
106
+ parameters: {
107
+ header: {
108
+ "Content-Type": string;
109
+ };
110
+ path: {
111
+ rate_table_id: string;
112
+ };
113
+ };
114
+ requestBody?: {
115
+ content: {
116
+ "application/json": components["schemas"]["RateTableUpdate"];
117
+ };
118
+ };
119
+ responses: {
120
+ 204: never;
121
+ 400: never;
122
+ 404: never;
123
+ 409: never;
124
+ 500: never;
125
+ };
126
+ };
127
+ getPayoutSettings: {
128
+ responses: {
129
+ 200: {
130
+ content: {
131
+ "application/json": components["schemas"]["PayoutSettingsResponse"];
132
+ };
133
+ };
134
+ 500: never;
135
+ };
136
+ };
137
+ updatePayoutPercentage: {
138
+ parameters: {
139
+ header: {
140
+ "Content-Type": string;
141
+ };
142
+ };
143
+ requestBody?: {
144
+ content: {
145
+ "application/json": components["schemas"]["UpdatePayoutPercentageRequest"];
146
+ };
147
+ };
148
+ responses: {
149
+ 204: never;
150
+ 400: never;
151
+ 500: never;
152
+ };
153
+ };
154
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -29,6 +29,11 @@ export interface paths {
29
29
  "/bulk_migrate_listing": {
30
30
  post: operations["bulkMigrateListing"];
31
31
  };
32
+ "/listing/{listingId}/sku/{sku}/locations": {
33
+ get: operations["getSkuLocationMapping"];
34
+ put: operations["createOrReplaceSkuLocationMapping"];
35
+ delete: operations["deleteSkuLocationMapping"];
36
+ };
32
37
  "/bulk_create_offer": {
33
38
  post: operations["bulkCreateOffer"];
34
39
  };
@@ -47,10 +52,10 @@ export interface paths {
47
52
  "/offer/get_listing_fees": {
48
53
  post: operations["getListingFees"];
49
54
  };
50
- "/offer/{offerId}/publish/": {
55
+ "/offer/{offerId}/publish": {
51
56
  post: operations["publishOffer"];
52
57
  };
53
- "/offer/publish_by_inventory_item_group/": {
58
+ "/offer/publish_by_inventory_item_group": {
54
59
  post: operations["publishOfferByInventoryItemGroup"];
55
60
  };
56
61
  "/offer/{offerId}/withdraw": {
@@ -169,12 +174,19 @@ export interface components {
169
174
  name?: string;
170
175
  values?: (string)[];
171
176
  };
177
+ CountryPolicy: {
178
+ country?: string;
179
+ policyIds?: (string)[];
180
+ };
172
181
  Dimension: {
173
182
  height?: number;
174
183
  length?: number;
175
184
  unit?: string;
176
185
  width?: number;
177
186
  };
187
+ Document: {
188
+ documentId?: string;
189
+ };
178
190
  EbayOfferDetailsWithAll: {
179
191
  availableQuantity?: number;
180
192
  categoryId?: string;
@@ -288,6 +300,9 @@ export interface components {
288
300
  auction?: number;
289
301
  fixedPrice?: number;
290
302
  };
303
+ FulfillmentCenterSpecifications: {
304
+ sameDayShippingCutOffTimes?: components["schemas"]["SameDayShippingCutOffTimes"];
305
+ };
291
306
  GeoCoordinates: {
292
307
  latitude?: number;
293
308
  longitude?: number;
@@ -385,13 +400,17 @@ export interface components {
385
400
  total?: number;
386
401
  };
387
402
  InventoryLocation: {
403
+ location?: components["schemas"]["LocationDetails"];
388
404
  locationAdditionalInformation?: string;
389
405
  locationInstructions?: string;
406
+ locationTypes?: (string)[];
390
407
  locationWebUrl?: string;
391
408
  name?: string;
392
409
  operatingHours?: (components["schemas"]["OperatingHours"])[];
393
410
  phone?: string;
394
411
  specialHours?: (components["schemas"]["SpecialHours"])[];
412
+ timeZoneId?: string;
413
+ fulfillmentCenterSpecifications?: components["schemas"]["FulfillmentCenterSpecifications"];
395
414
  };
396
415
  InventoryLocationFull: {
397
416
  location?: components["schemas"]["LocationDetails"];
@@ -404,6 +423,8 @@ export interface components {
404
423
  operatingHours?: (components["schemas"]["OperatingHours"])[];
405
424
  phone?: string;
406
425
  specialHours?: (components["schemas"]["SpecialHours"])[];
426
+ timeZoneId?: string;
427
+ fulfillmentCenterSpecifications?: components["schemas"]["FulfillmentCenterSpecifications"];
407
428
  };
408
429
  InventoryLocationResponse: {
409
430
  location?: components["schemas"]["Location"];
@@ -417,9 +438,12 @@ export interface components {
417
438
  operatingHours?: (components["schemas"]["OperatingHours"])[];
418
439
  phone?: string;
419
440
  specialHours?: (components["schemas"]["SpecialHours"])[];
441
+ timeZoneId?: string;
442
+ fulfillmentCenterSpecifications?: components["schemas"]["FulfillmentCenterSpecifications"];
420
443
  };
421
444
  ListingDetails: {
422
445
  listingId?: string;
446
+ listingOnHold?: boolean;
423
447
  listingStatus?: string;
424
448
  soldQuantity?: number;
425
449
  };
@@ -440,10 +464,16 @@ export interface components {
440
464
  geoCoordinates?: components["schemas"]["GeoCoordinates"];
441
465
  locationId?: string;
442
466
  };
467
+ LocationAvailabilityDetails: {
468
+ merchantLocationKey?: string;
469
+ };
443
470
  LocationDetails: {
444
471
  address?: components["schemas"]["Address"];
445
472
  geoCoordinates?: components["schemas"]["GeoCoordinates"];
446
473
  };
474
+ LocationMapping: {
475
+ locations?: (components["schemas"]["LocationAvailabilityDetails"])[];
476
+ };
447
477
  LocationResponse: {
448
478
  href?: string;
449
479
  limit?: number;
@@ -453,6 +483,17 @@ export interface components {
453
483
  total?: number;
454
484
  locations?: (components["schemas"]["InventoryLocationResponse"])[];
455
485
  };
486
+ Manufacturer: {
487
+ addressLine1?: string;
488
+ addressLine2?: string;
489
+ city?: string;
490
+ companyName?: string;
491
+ country?: string;
492
+ email?: string;
493
+ phone?: string;
494
+ postalCode?: string;
495
+ stateOrProvince?: string;
496
+ };
456
497
  MigrateListing: {
457
498
  listingId?: string;
458
499
  };
@@ -513,9 +554,15 @@ export interface components {
513
554
  dayOfWeekEnum?: string;
514
555
  intervals?: (components["schemas"]["Interval"])[];
515
556
  };
557
+ Overrides: {
558
+ cutOffTime?: string;
559
+ endDate?: string;
560
+ startDate?: string;
561
+ };
516
562
  PackageWeightAndSize: {
517
563
  dimensions?: components["schemas"]["Dimension"];
518
564
  packageType?: string;
565
+ shippingIrregular?: boolean;
519
566
  weight?: components["schemas"]["Weight"];
520
567
  };
521
568
  PickupAtLocationAvailability: {
@@ -571,6 +618,11 @@ export interface components {
571
618
  gtin?: string;
572
619
  ktype?: string;
573
620
  };
621
+ ProductSafety: {
622
+ component?: string;
623
+ pictograms?: (string)[];
624
+ statements?: (string)[];
625
+ };
574
626
  PublishByInventoryItemGroupRequest: {
575
627
  inventoryItemGroupKey?: string;
576
628
  marketplaceId?: string;
@@ -580,15 +632,35 @@ export interface components {
580
632
  warnings?: (components["schemas"]["Error"])[];
581
633
  };
582
634
  RegionalProductCompliancePolicies: {
583
- countryPolicies?: (string)[];
635
+ countryPolicies?: (components["schemas"]["CountryPolicy"])[];
584
636
  };
585
637
  RegionalTakeBackPolicies: {
586
- countryPolicies?: (string)[];
638
+ countryPolicies?: (components["schemas"]["CountryPolicy"])[];
587
639
  };
588
640
  Regulatory: {
641
+ documents?: (components["schemas"]["Document"])[];
589
642
  energyEfficiencyLabel?: components["schemas"]["EnergyEfficiencyLabel"];
590
643
  hazmat?: components["schemas"]["Hazmat"];
644
+ manufacturer?: components["schemas"]["Manufacturer"];
645
+ productSafety?: components["schemas"]["ProductSafety"];
591
646
  repairScore?: number;
647
+ responsiblePersons?: (components["schemas"]["ResponsiblePerson"])[];
648
+ };
649
+ ResponsiblePerson: {
650
+ addressLine1?: string;
651
+ addressLine2?: string;
652
+ city?: string;
653
+ companyName?: string;
654
+ country?: string;
655
+ email?: string;
656
+ phone?: string;
657
+ postalCode?: string;
658
+ stateOrProvince?: string;
659
+ types?: (string)[];
660
+ };
661
+ SameDayShippingCutOffTimes: {
662
+ overrides?: (components["schemas"]["Overrides"])[];
663
+ weeklySchedule?: (components["schemas"]["WeeklySchedule"])[];
592
664
  };
593
665
  ShipToLocationAvailability: {
594
666
  availabilityDistributions?: (components["schemas"]["AvailabilityDistribution"])[];
@@ -631,6 +703,10 @@ export interface components {
631
703
  instance?: components["schemas"]["Version"];
632
704
  version?: string;
633
705
  };
706
+ WeeklySchedule: {
707
+ cutOffTime?: string;
708
+ dayOfWeekEnum?: (string)[];
709
+ };
634
710
  Weight: {
635
711
  unit?: string;
636
712
  value?: number;
@@ -960,6 +1036,59 @@ export interface operations {
960
1036
  500: never;
961
1037
  };
962
1038
  };
1039
+ getSkuLocationMapping: {
1040
+ parameters: {
1041
+ path: {
1042
+ listingId: string;
1043
+ sku: string;
1044
+ };
1045
+ };
1046
+ responses: {
1047
+ 200: {
1048
+ content: {
1049
+ "application/json": components["schemas"]["LocationMapping"];
1050
+ };
1051
+ };
1052
+ 400: never;
1053
+ 404: never;
1054
+ 500: never;
1055
+ };
1056
+ };
1057
+ createOrReplaceSkuLocationMapping: {
1058
+ parameters: {
1059
+ header: {
1060
+ "Content-Type": string;
1061
+ };
1062
+ path: {
1063
+ listingId: string;
1064
+ sku: string;
1065
+ };
1066
+ };
1067
+ requestBody: {
1068
+ content: {
1069
+ "application/json": components["schemas"]["LocationMapping"];
1070
+ };
1071
+ };
1072
+ responses: {
1073
+ 204: never;
1074
+ 400: never;
1075
+ 500: never;
1076
+ };
1077
+ };
1078
+ deleteSkuLocationMapping: {
1079
+ parameters: {
1080
+ path: {
1081
+ listingId: string;
1082
+ sku: string;
1083
+ };
1084
+ };
1085
+ responses: {
1086
+ 204: never;
1087
+ 400: never;
1088
+ 404: never;
1089
+ 500: never;
1090
+ };
1091
+ };
963
1092
  bulkCreateOffer: {
964
1093
  parameters: {
965
1094
  header: {
@@ -7,7 +7,8 @@ import { operations as commerceCatalogOperations } from './restful/specs/commerc
7
7
  import { components as commerceMedia } from './restful/specs/commerce_media_v1_beta_oas3.js';
8
8
  import { components as commerceNotification } from './restful/specs/commerce_notification_v1_oas3.js';
9
9
  import { components as commerceTranslation } from './restful/specs/commerce_translation_v1_beta_oas3.js';
10
- import { components as sellAccount } from './restful/specs/sell_account_v1_oas3.js';
10
+ import { components as sellAccountV1 } from './restful/specs/sell_account_v1_oas3.js';
11
+ import { components as sellAccountV2 } from './restful/specs/sell_account_v2_oas3.js';
11
12
  import { components as sellCompliance } from './restful/specs/sell_compliance_v1_oas3.js';
12
13
  import { components as sellFulfillment } from './restful/specs/sell_fulfillment_v1_oas3.js';
13
14
  import { components as sellInventory } from './restful/specs/sell_inventory_v1_oas3.js';
@@ -380,13 +381,15 @@ export type UpdatePaymentInformation = buyOrder['schemas']['UpdatePaymentInforma
380
381
  export type UpdateQuantity = buyOrder['schemas']['UpdateQuantity'];
381
382
  export type UpdateShippingOption = buyOrder['schemas']['UpdateShippingOption'];
382
383
  export type SuppressViolationRequest = sellCompliance['schemas']['SuppressViolationRequest'];
383
- export type CustomPolicyCreateRequest = sellAccount['schemas']['CustomPolicyCreateRequest'];
384
- export type CustomPolicyRequest = sellAccount['schemas']['CustomPolicyRequest'];
385
- export type FulfillmentPolicyRequest = sellAccount['schemas']['FulfillmentPolicyRequest'];
386
- export type FulfillmentSellAccountProgram = sellAccount['schemas']['Program'];
387
- export type PaymentPolicyRequest = sellAccount['schemas']['PaymentPolicyRequest'];
388
- export type ReturnPolicyRequest = sellAccount['schemas']['ReturnPolicyRequest'];
389
- export type SalesTaxBase = sellAccount['schemas']['SalesTaxBase'];
384
+ export type CustomPolicyCreateRequest = sellAccountV1['schemas']['CustomPolicyCreateRequest'];
385
+ export type CustomPolicyRequest = sellAccountV1['schemas']['CustomPolicyRequest'];
386
+ export type FulfillmentPolicyRequest = sellAccountV1['schemas']['FulfillmentPolicyRequest'];
387
+ export type FulfillmentSellAccountProgram = sellAccountV1['schemas']['Program'];
388
+ export type PaymentPolicyRequest = sellAccountV1['schemas']['PaymentPolicyRequest'];
389
+ export type ReturnPolicyRequest = sellAccountV1['schemas']['ReturnPolicyRequest'];
390
+ export type SalesTaxBase = sellAccountV1['schemas']['SalesTaxBase'];
391
+ export type RateTableUpdate = sellAccountV2['schemas']['RateTableUpdate'];
392
+ export type UpdatePayoutPercentageRequest = sellAccountV2['schemas']['UpdatePayoutPercentageRequest'];
390
393
  export type LineItemReference = sellFulfillment['schemas']['LineItemReference'];
391
394
  export type UpdateEvidencePaymentDisputeRequest = sellFulfillment['schemas']['UpdateEvidencePaymentDisputeRequest'];
392
395
  export type RefundItem = sellFulfillment['schemas']['RefundItem'];
@@ -410,6 +413,7 @@ export type OfferKeysWithId = sellInventory['schemas']['OfferKeysWithId'];
410
413
  export type PublishByInventoryItemGroupRequest = sellInventory['schemas']['PublishByInventoryItemGroupRequest'];
411
414
  export type WithdrawByInventoryItemGroupRequest = sellInventory['schemas']['WithdrawByInventoryItemGroupRequest'];
412
415
  export type InventoryItem = sellInventory['schemas']['InventoryItem'];
416
+ export type LocationMapping = sellInventory['schemas']['LocationMapping'];
413
417
  export type BulkCreateAdRequest = sellMarketing['schemas']['BulkCreateAdRequest'];
414
418
  export type BulkCreateAdsByInventoryReferenceRequest = sellMarketing['schemas']['BulkCreateAdsByInventoryReferenceRequest'];
415
419
  export type BulkCreateKeywordRequest = sellMarketing['schemas']['BulkCreateKeywordRequest'];
@@ -53,7 +53,8 @@ class ApiFactory extends index_js_1.default {
53
53
  }
54
54
  createSellApi() {
55
55
  return {
56
- account: this.createRestfulApi(index_js_6.Account),
56
+ account: this.createRestfulApi(index_js_6.AccountV1),
57
+ accountV2: this.createRestfulApi(index_js_6.AccountV2),
57
58
  analytics: this.createRestfulApi(index_js_6.Analytics),
58
59
  compliance: this.createRestfulApi(index_js_6.Compliance),
59
60
  fulfillment: this.createRestfulApi(index_js_6.Fulfillment),
@@ -3,6 +3,6 @@ import Restful, { OpenApi } from '../../index.js';
3
3
  export default class Analytics extends Restful implements OpenApi<operations> {
4
4
  static id: string;
5
5
  get basePath(): string;
6
- getRateLimits(apiContext: string, apiName: string): Promise<any>;
6
+ getRateLimits(apiContext?: string, apiName?: string): Promise<any>;
7
7
  getUserRateLimits(apiContext: string, apiName: string): Promise<any>;
8
8
  }
@@ -2,7 +2,7 @@ import { PaymentsProgramType } from '../../../../enums/index.js';
2
2
  import { CustomPolicyCreateRequest, CustomPolicyRequest, FulfillmentPolicyRequest, FulfillmentSellAccountProgram, InventoryLocation, InventoryLocationFull, PaymentPolicyRequest, ReturnPolicyRequest, SalesTaxBase } from '../../../../types/index.js';
3
3
  import { operations } from '../../../../types/restful/specs/sell_account_v1_oas3.js';
4
4
  import Restful, { OpenApi } from '../../index.js';
5
- export default class Account extends Restful implements OpenApi<operations> {
5
+ export default class AccountV1 extends Restful implements OpenApi<operations> {
6
6
  static id: string;
7
7
  get basePath(): string;
8
8
  getCustomPolicies(policyTypes: string): Promise<any>;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const index_js_1 = __importDefault(require("../../index.js"));
7
- class Account extends index_js_1.default {
7
+ class AccountV1 extends index_js_1.default {
8
8
  get basePath() {
9
9
  return '/sell/account/v1';
10
10
  }
@@ -221,5 +221,5 @@ class Account extends index_js_1.default {
221
221
  return this.get(`/country/${countryCode}/sales_tax_jurisdiction`);
222
222
  }
223
223
  }
224
- Account.id = 'Account';
225
- exports.default = Account;
224
+ AccountV1.id = 'AccountV1';
225
+ exports.default = AccountV1;
@@ -0,0 +1,11 @@
1
+ import { RateTableUpdate, UpdatePayoutPercentageRequest } from '../../../../types/index.js';
2
+ import { operations } from '../../../../types/restful/specs/sell_account_v2_oas3.js';
3
+ import Restful, { OpenApi } from '../../index.js';
4
+ export default class AccountV2 extends Restful implements OpenApi<operations> {
5
+ static id: string;
6
+ get basePath(): string;
7
+ getRateTable(rateTableId: string): Promise<any>;
8
+ updateShippingCost(rateTableId: string, body: RateTableUpdate): Promise<any>;
9
+ getPayoutSettings(): Promise<any>;
10
+ updatePayoutPercentage(body: UpdatePayoutPercentageRequest): Promise<any>;
11
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const index_js_1 = __importDefault(require("../../index.js"));
7
+ class AccountV2 extends index_js_1.default {
8
+ get basePath() {
9
+ return '/sell/account/v2';
10
+ }
11
+ getRateTable(rateTableId) {
12
+ rateTableId = encodeURIComponent(rateTableId);
13
+ return this.get(`/rate_table/${rateTableId}`);
14
+ }
15
+ updateShippingCost(rateTableId, body) {
16
+ rateTableId = encodeURIComponent(rateTableId);
17
+ return this.post(`/rate_table/${rateTableId}/update_shipping_cost`, body);
18
+ }
19
+ getPayoutSettings() {
20
+ return this.get('/payout_settings');
21
+ }
22
+ updatePayoutPercentage(body) {
23
+ return this.post(`/payout_settings/update_percentage`, body);
24
+ }
25
+ }
26
+ AccountV2.id = 'AccountV2';
27
+ exports.default = AccountV2;
@@ -73,7 +73,10 @@ class Feed extends index_js_1.default {
73
73
  }
74
74
  getLatestResultFile(scheduleId) {
75
75
  scheduleId = encodeURIComponent(scheduleId);
76
- return this.get(`/schedule/${scheduleId}/download_result_file`);
76
+ return this.get(`/schedule/${scheduleId}/download_result_file`, {
77
+ responseType: 'arraybuffer',
78
+ responseEncoding: 'binary',
79
+ });
77
80
  }
78
81
  getScheduleTemplate(scheduleTemplateId) {
79
82
  scheduleTemplateId = encodeURIComponent(scheduleTemplateId);
@@ -109,7 +112,10 @@ class Feed extends index_js_1.default {
109
112
  }
110
113
  getResultFile(taskId) {
111
114
  taskId = encodeURIComponent(taskId);
112
- return this.get(`/task/${taskId}/download_result_file`);
115
+ return this.get(`/task/${taskId}/download_result_file`, {
116
+ responseType: 'arraybuffer',
117
+ responseEncoding: 'binary',
118
+ });
113
119
  }
114
120
  getTask(taskId) {
115
121
  taskId = encodeURIComponent(taskId);
@@ -12,7 +12,7 @@ export default class Fulfillment extends Restful implements OpenApi<operations>
12
12
  limit?: number;
13
13
  offset?: number;
14
14
  orderIds?: string | string[];
15
- fieldGroups?: string[];
15
+ fieldGroups?: string;
16
16
  }): Promise<any>;
17
17
  issueRefund(orderId: string, body?: IssueRefundRequest): Promise<any>;
18
18
  getShippingFulfillments(orderId: string): Promise<any>;
@@ -1,4 +1,5 @@
1
- import Account from './account/index.js';
1
+ import AccountV1 from './account/v1.js';
2
+ import AccountV2 from './account/v2.js';
2
3
  import Analytics from './analytics/index.js';
3
4
  import Compliance from './compliance/index.js';
4
5
  import Finances from './finances/index.js';
@@ -12,7 +13,8 @@ import Logistics from './logistics/index.js';
12
13
  import Negotiation from './negotiation/index.js';
13
14
  import Listing from './listing/index.js';
14
15
  export type Sell = {
15
- account: Account;
16
+ account: AccountV1;
17
+ accountV2: AccountV2;
16
18
  analytics: Analytics;
17
19
  compliance: Compliance;
18
20
  fulfillment: Fulfillment;
@@ -26,4 +28,4 @@ export type Sell = {
26
28
  negotiation: Negotiation;
27
29
  listing: Listing;
28
30
  };
29
- export { Account, Compliance, Analytics, Fulfillment, Inventory, Marketing, Metadata, Recommendation, Finances, Feed, Logistics, Negotiation, Listing };
31
+ export { AccountV1, AccountV2, Compliance, Analytics, Fulfillment, Inventory, Marketing, Metadata, Recommendation, Finances, Feed, Logistics, Negotiation, Listing };