@rebilly/api 0.6.0 → 0.7.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/CHANGELOG.md CHANGED
@@ -1,3 +1,3 @@
1
- ## 0.6.0 (2026-10-22)
1
+ ## 0.7.0 (2026-10-22)
2
2
 
3
3
  This was a version bump only for rebilly-api to align it with other projects, there were no code changes.
@@ -194,9 +194,14 @@ export type StorefrontPostDepositBody = {
194
194
  riskMetadata?: RiskMetadata;
195
195
  redirectUrl?: StorefrontTransactionRedirectUrl;
196
196
  /**
197
- * ID of the Replay promotion to apply to this deposit.
198
- * The customer must have an active opt-in for the promotion.
199
- * If the customer does not have an active opt-in, the deposit completes without the promotion.
197
+ * ID of the promotion to apply to this deposit.
198
+ * Requires `paymentInstrumentId` or `token`.
199
+ *
200
+ * Before the deposit is charged, the deposit amount, currency, and payment method are checked against the promotion rules,
201
+ * and the promotion is reserved for the customer.
202
+ * If the customer is not eligible, the response has status `409` and the customer is not charged.
203
+ * If the check cannot run, the response has status `503` and the customer is not charged.
204
+ * When the deposit completes, the customer receives the promotion.
200
205
  * @minLength 1
201
206
  * @maxLength 50
202
207
  */
@@ -1783,6 +1783,59 @@ export type StorefrontTransaction = {
1783
1783
  rel?: "self" | "approvalUrl" | "approvalContinue" | "approvalBypass" | "cancelUrl" | "redirectUrl";
1784
1784
  }[];
1785
1785
  };
1786
+ /**
1787
+ * Problem Details JSON Object [[RFC7807](https://tools.ietf.org/html/rfc7807)].
1788
+ */
1789
+ export type BlankProblem = {
1790
+ /**
1791
+ * HTTP status code.
1792
+ * @minimum 400
1793
+ * @maximum 599
1794
+ */
1795
+ status?: number;
1796
+ /**
1797
+ * Short, human-readable summary of the problem type.
1798
+ * It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.
1799
+ */
1800
+ title?: string;
1801
+ };
1802
+ export type DetailedProblem = BlankProblem & {
1803
+ /**
1804
+ * Human-readable explanation specific to this occurrence of the problem.
1805
+ */
1806
+ detail?: string;
1807
+ };
1808
+ export type PromotionIneligible = unknown & {
1809
+ /**
1810
+ * Machine-readable error code for this problem type, which consumers use to handle the failure programmatically.
1811
+ */
1812
+ type: "promotion-ineligible";
1813
+ /**
1814
+ * HTTP status code.
1815
+ * @minimum 409
1816
+ * @maximum 409
1817
+ */
1818
+ status?: number;
1819
+ } & DetailedProblem & {
1820
+ /**
1821
+ * Code of the promotion eligibility rule that the deposit fails, such as `min-deposit-not-met` or `payment-method-restricted`.
1822
+ * This value is `null` when a pre-check rejects the promotion before the eligibility rules run,
1823
+ * for example because the promotion is not active or the customer already claimed it.
1824
+ */
1825
+ ineligibleReasonCode: string | null;
1826
+ };
1827
+ export type PromotionCheckUnavailable = unknown & {
1828
+ /**
1829
+ * Machine-readable error code for this problem type, which consumers use to handle the failure programmatically.
1830
+ */
1831
+ type: "promotion-check-unavailable";
1832
+ /**
1833
+ * HTTP status code.
1834
+ * @minimum 503
1835
+ * @maximum 503
1836
+ */
1837
+ status?: number;
1838
+ } & DetailedProblem;
1786
1839
  export type CheckoutFormFixedPlan = {
1787
1840
  /**
1788
1841
  * ID of the plan.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebilly/api",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Rebilly Core and Storefront API clients generated from the OpenAPI definitions",
5
5
  "type": "module",
6
6
  "sideEffects": false,