@usebillow/sdk 0.10.0 → 0.11.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.cjs CHANGED
@@ -519,6 +519,35 @@ function createCreditsResource(ctx) {
519
519
  return { ...data, replayed: status === 200 };
520
520
  }
521
521
  },
522
+ accounts: {
523
+ /**
524
+ * Freeze a customer's Credit Account (by external id): it takes no new reservations - a
525
+ * reserve throws `account_frozen` (423) - until unfrozen, while holds already made still
526
+ * commit and release, and grants, top-ups, reversals and included credits still fund it.
527
+ * Safe to retry: freezing a frozen account changes nothing and answers `changed: false`. A
528
+ * customer with no account yet gets one, frozen. Throws `account_closed` (409) for an erased
529
+ * customer.
530
+ */
531
+ freeze: (customer, options) => apiRequest(
532
+ ctx,
533
+ "POST",
534
+ "/v1/credits/accounts/freeze",
535
+ { customerId: customer },
536
+ options
537
+ ),
538
+ /**
539
+ * Unfreeze a customer's Credit Account (by external id): it takes reservations again. Safe to
540
+ * retry: unfreezing an account that is not frozen changes nothing and answers
541
+ * `changed: false`.
542
+ */
543
+ unfreeze: (customer, options) => apiRequest(
544
+ ctx,
545
+ "POST",
546
+ "/v1/credits/accounts/unfreeze",
547
+ { customerId: customer },
548
+ options
549
+ )
550
+ },
522
551
  packs: {
523
552
  /**
524
553
  * The Credit Packs a customer can buy in `currency` (ISO 4217), cheapest first: credits and