@mitumba/sdk 5.30.0 → 5.32.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.
package/dist/index.js CHANGED
@@ -2391,7 +2391,93 @@ var StoresModule = class {
2391
2391
  async delete(storeId, options) {
2392
2392
  return this.client.delete(`/listings/stores/${storeId}`, void 0, options);
2393
2393
  }
2394
+ /**
2395
+ * A shop's earnings: per currency, what is in escrow, on hold, awaiting approval, approved,
2396
+ * sending, sent, failed or a test, in minor units. The owner, or a team member who may read
2397
+ * earnings.
2398
+ *
2399
+ * Errors: 403 forbidden (a member whose role does not include earnings); 404 not_found.
2400
+ */
2401
+ async getEarnings(storeId, options) {
2402
+ return this.client.get(`/orders/stores/${encodeURIComponent(storeId)}/earnings`, void 0, options);
2403
+ }
2404
+ /**
2405
+ * Each paid order's entitlement, newest first, 20 per page, optionally of one state.
2406
+ *
2407
+ * Errors: 400 invalid_input (unknown state); 403 forbidden; 404 not_found.
2408
+ */
2409
+ async getEarningsEntries(storeId, params, options) {
2410
+ return this.client.get(
2411
+ `/orders/stores/${encodeURIComponent(storeId)}/earnings/entries`,
2412
+ params,
2413
+ options
2414
+ );
2415
+ }
2416
+ /**
2417
+ * One payout of the shop, with the settlement lines that explain it.
2418
+ *
2419
+ * Errors: 403 forbidden; 404 not_found.
2420
+ */
2421
+ async getPayout(storeId, payoutId, options) {
2422
+ return this.client.get(
2423
+ `/orders/stores/${encodeURIComponent(storeId)}/payouts/${encodeURIComponent(payoutId)}`,
2424
+ void 0,
2425
+ options
2426
+ );
2427
+ }
2428
+ /**
2429
+ * Where the shop is paid: its destinations, masked, with the methods and banks on offer. The
2430
+ * owner, or a team member who may read earnings.
2431
+ *
2432
+ * Errors: 403 store_forbidden.
2433
+ */
2434
+ async getPayoutDestinations(storeId, options) {
2435
+ return this.client.get(`/listings/stores/${encodeURIComponent(storeId)}/payout-destinations`, void 0, options);
2436
+ }
2437
+ /**
2438
+ * Owner: add a payout destination. The shop's first applies at once; every later one, and a change
2439
+ * of default, 48 hours later. Needs a second factor used in the last 10 minutes.
2440
+ *
2441
+ * Errors: 400 invalid_input, or a `PayoutDestinationRejection` with `field`; 403 store_forbidden,
2442
+ * step_up_required; 409 method_unavailable, destination_exists, too_many_destinations.
2443
+ */
2444
+ async addPayoutDestination(storeId, input, options) {
2445
+ return this.client.post(`/listings/stores/${encodeURIComponent(storeId)}/payout-destinations`, input, options);
2446
+ }
2447
+ /**
2448
+ * Owner: make a destination the default, 48 hours from now. Choosing the current default again
2449
+ * cancels any pending change. Needs a recent second factor.
2450
+ *
2451
+ * Errors: 403 store_forbidden, step_up_required; 404 not_found.
2452
+ */
2453
+ async setDefaultPayoutDestination(storeId, destinationId, options) {
2454
+ return this.client.post(this.destinationPath(storeId, destinationId, "/default"), void 0, options);
2455
+ }
2456
+ /**
2457
+ * Owner: cancel a pending change of default to this destination. Needs a recent second factor.
2458
+ *
2459
+ * Errors: 403 store_forbidden, step_up_required; 404 not_found; 409 no_pending_default.
2460
+ */
2461
+ async cancelPendingDefault(storeId, destinationId, options) {
2462
+ return this.client.delete(this.destinationPath(storeId, destinationId, "/default"), void 0, options);
2463
+ }
2464
+ /**
2465
+ * Owner: remove a destination, or cancel one still cooling off. The current default cannot be
2466
+ * removed: make another destination the default first, and remove this one once that applies.
2467
+ * Needs a recent second factor.
2468
+ *
2469
+ * Errors: 403 store_forbidden, step_up_required; 404 not_found; 409 default_destination.
2470
+ */
2471
+ async removePayoutDestination(storeId, destinationId, options) {
2472
+ return this.client.delete(this.destinationPath(storeId, destinationId, ""), void 0, options);
2473
+ }
2474
+ destinationPath(storeId, destinationId, suffix) {
2475
+ return `/listings/stores/${encodeURIComponent(storeId)}/payout-destinations/${encodeURIComponent(destinationId)}${suffix}`;
2476
+ }
2394
2477
  };
2478
+ function stepUpRequired(error) {
2479
+ return error instanceof APIError && error.code === "step_up_required";
2480
+ }
2395
2481
 
2396
2482
  // src/modules/reviews.ts
2397
2483
  var ReviewsModule = class {
@@ -2818,6 +2904,24 @@ var AdminModule = class {
2818
2904
  async disbursePayout(payoutId, options) {
2819
2905
  return this.client.post(`/admin/payouts/${payoutId}/disburse`, void 0, options);
2820
2906
  }
2907
+ // ── Refunds ──
2908
+ /**
2909
+ * Refunds owed to buyers, newest first, 25 per page. `admin:read`.
2910
+ *
2911
+ * Errors: 400 invalid_input (unknown status).
2912
+ */
2913
+ async listRefunds(params, options) {
2914
+ return this.client.get("/admin/refunds", params, options);
2915
+ }
2916
+ /**
2917
+ * Send a pending refund to the number that paid. `payouts:disburse` with a recent passkey.
2918
+ *
2919
+ * Errors: 403 forbidden; 404 refund_not_found; 409 refund_sandbox_payment, refund_number_unavailable;
2920
+ * 503 refund_disbursement_paused, refund_method_unsupported.
2921
+ */
2922
+ async sendRefund(refundId, options) {
2923
+ return this.client.post(`/admin/refunds/${encodeURIComponent(refundId)}/send`, void 0, options);
2924
+ }
2821
2925
  // ── Reports Moderation ──
2822
2926
  async listReports(params, options) {
2823
2927
  return this.client.get("/admin/reports", params, options);
@@ -3820,6 +3924,7 @@ exports.maskPhone = maskPhone;
3820
3924
  exports.normalizePhone = normalizePhone;
3821
3925
  exports.partitionCart = partitionCart;
3822
3926
  exports.regionById = regionById;
3927
+ exports.stepUpRequired = stepUpRequired;
3823
3928
  exports.storeShareUrl = storeShareUrl;
3824
3929
  //# sourceMappingURL=index.js.map
3825
3930
  //# sourceMappingURL=index.js.map