@delopay/sdk 0.102.0 → 0.103.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
@@ -3910,6 +3910,46 @@ var Settlement = class {
3910
3910
  ...options
3911
3911
  });
3912
3912
  }
3913
+ /**
3914
+ * What a period's payments cost, and what was left over: gross, the
3915
+ * platform fee, hosting fees, what the rails took, and the margin, with a
3916
+ * per-connector breakdown.
3917
+ *
3918
+ * Send `year` and `month` together to report one UTC calendar month, or
3919
+ * neither for the running month so far.
3920
+ *
3921
+ * **Host-only.** The response is the host's cost base, which a shop owner
3922
+ * must never see, so a profile-scoped caller is refused with a 403 rather
3923
+ * than given a redacted shell. Gate the surface on the caller's scope
3924
+ * instead of calling it and handling the failure.
3925
+ *
3926
+ * Two things not to flatten when rendering the result:
3927
+ * `margin_usd` is absent — not zero — whenever `margin_quality` is
3928
+ * `'unknown'`, and `unlined_captured_attempt_count` (cost definitely
3929
+ * missing) means something different from `unlined_unresolved_attempt_count`
3930
+ * (mostly ordinary abandonment).
3931
+ *
3932
+ * `GET /settlement/cost`
3933
+ *
3934
+ * @example
3935
+ * ```typescript
3936
+ * const cost = await delopay.settlement.cost({ test_mode: false, year: 2026, month: 7 });
3937
+ * if (cost.margin_quality === 'unknown') {
3938
+ * // cost.margin_usd is absent — say so, do not render 0.00
3939
+ * }
3940
+ * ```
3941
+ */
3942
+ async cost(params, options) {
3943
+ return this.request("GET", "/settlement/cost", {
3944
+ query: {
3945
+ profile_id: params?.profile_id,
3946
+ test_mode: params?.test_mode,
3947
+ year: params?.year,
3948
+ month: params?.month
3949
+ },
3950
+ ...options
3951
+ });
3952
+ }
3913
3953
  /**
3914
3954
  * List generated settlement statements, newest first.
3915
3955
  *